From 4038ab95a094b363f1748f3dcb51511a1217475d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:40:05 +0200 Subject: Adding upstream version 2.0.16. Signed-off-by: Daniel Baumann --- AUTHORS | 4 + CMakeLists.txt | 436 + COPYING | 339 + COPYING.LIB | 510 + ChangeLog | 2096 ++ INSTALL | 368 + INSTALL.html | 381 + LICENSE-2.0.txt | 202 + LICENSE.html | 99 + LICENSE.txt | 66 + Makefile.am | 69 + Makefile.in | 975 + NEWS | 747 + NEWS.html | 918 + NOTICE | 3 + README | 211 + README-cmake.md | 216 + README.html | 322 + RELEASE.html | 4873 +++++ UPGRADING.html | 159 + aclocal.m4 | 1253 ++ autogen.sh | 434 + build/ar-lib | 271 + build/compile | 348 + build/config.guess | 1754 ++ build/config.sub | 1890 ++ build/depcomp | 791 + build/gtk-doc.m4 | 113 + build/install-sh | 541 + build/libtool.m4 | 8427 ++++++++ build/ltmain.sh | 11448 ++++++++++ build/ltoptions.m4 | 437 + build/ltsugar.m4 | 124 + build/ltversion.m4 | 24 + build/lt~obsolete.m4 | 99 + build/missing | 215 + build/pkg.m4 | 214 + build/test-driver | 153 + configure | 20961 +++++++++++++++++++ configure.ac | 1384 ++ data/Makefile.am | 1 + data/Makefile.in | 492 + data/dc.rdf | 8 + docs/Makefile.am | 158 + docs/Makefile.in | 1023 + docs/html/home.png | Bin 0 -> 256 bytes docs/html/index.html | 249 + docs/html/introduction.html | 38 + docs/html/ix01.html | 887 + docs/html/left-insensitive.png | Bin 0 -> 395 bytes docs/html/left.png | Bin 0 -> 262 bytes docs/html/parser-grddl.html | 102 + docs/html/parser-guess.html | 42 + docs/html/parser-json.html | 34 + docs/html/parser-ntriples.html | 35 + docs/html/parser-rdfa.html | 43 + docs/html/parser-rdfxml.html | 42 + docs/html/parser-rss-tag-soup.html | 46 + docs/html/parser-trig.html | 35 + docs/html/parser-turtle.html | 34 + docs/html/raptor-formats-types-by-parser.html | 102 + docs/html/raptor-formats-types-by-serializer.html | 124 + docs/html/raptor-formats-types-index.html | 228 + docs/html/raptor-formats.html | 44 + docs/html/raptor-parsers.html | 55 + docs/html/raptor-serializers.html | 56 + docs/html/raptor2-changes-1-4-21-to-2-0-0.html | 968 + docs/html/raptor2-changes-2-0-10-to-2-0-11.html | 40 + docs/html/raptor2-changes-2-0-11-to-2-0-12.html | 37 + docs/html/raptor2-changes-2-0-13-to-2-0-14.html | 37 + docs/html/raptor2-changes-2-0-14-to-2-0-15.html | 46 + docs/html/raptor2-changes-2-0-15-to-2-0-16.html | 58 + docs/html/raptor2-changes-2-0-3-to-2-0-4.html | 40 + docs/html/raptor2-changes-2-0-4-to-2-0-5.html | 43 + docs/html/raptor2-changes-2-0-5-to-2-0-6.html | 41 + docs/html/raptor2-changes-2-0-6-to-2-0-7.html | 53 + docs/html/raptor2-changes-2-0-7-to-2-0-8.html | 45 + docs/html/raptor2-changes-2-0-9-to-2-0-10.html | 45 + docs/html/raptor2-changes.html | 76 + docs/html/raptor2-section-avltree.html | 799 + docs/html/raptor2-section-constants.html | 138 + docs/html/raptor2-section-general.html | 1496 ++ docs/html/raptor2-section-iostream.html | 1749 ++ docs/html/raptor2-section-locator.html | 384 + docs/html/raptor2-section-memory.html | 183 + docs/html/raptor2-section-option.html | 731 + docs/html/raptor2-section-parser.html | 1286 ++ docs/html/raptor2-section-sax2.html | 1018 + docs/html/raptor2-section-sequence.html | 870 + docs/html/raptor2-section-serializer.html | 811 + docs/html/raptor2-section-stringbuffer.html | 701 + docs/html/raptor2-section-triples.html | 1704 ++ docs/html/raptor2-section-unicode.html | 482 + docs/html/raptor2-section-uri.html | 1675 ++ docs/html/raptor2-section-world.html | 854 + docs/html/raptor2-section-www.html | 1241 ++ docs/html/raptor2-section-xml-namespace.html | 1023 + docs/html/raptor2-section-xml-qname.html | 668 + docs/html/raptor2-section-xml.html | 1565 ++ docs/html/raptor2.devhelp2 | 731 + docs/html/reference-manual.html | 180 + docs/html/restrict-parser-network-access.html | 152 + docs/html/right-insensitive.png | Bin 0 -> 373 bytes docs/html/right.png | Bin 0 -> 261 bytes docs/html/serializer-atom.html | 46 + docs/html/serializer-dot.html | 45 + docs/html/serializer-json.html | 37 + docs/html/serializer-mkr.html | 32 + docs/html/serializer-nquads.html | 36 + docs/html/serializer-ntriples.html | 35 + docs/html/serializer-rdfxml-abbrev.html | 33 + docs/html/serializer-rdfxml-xmp.html | 34 + docs/html/serializer-rdfxml.html | 36 + docs/html/serializer-rss-1-0.html | 38 + docs/html/serializer-turtle.html | 34 + docs/html/style.css | 530 + docs/html/tutorial-initialising-finishing.html | 42 + docs/html/tutorial-parse-strictness.html | 37 + docs/html/tutorial-parser-abort.html | 37 + docs/html/tutorial-parser-content.html | 150 + docs/html/tutorial-parser-create.html | 90 + docs/html/tutorial-parser-destroy.html | 37 + docs/html/tutorial-parser-example.html | 97 + docs/html/tutorial-parser-features.html | 71 + docs/html/tutorial-parser-runtime-info.html | 36 + ...tutorial-parser-set-error-warning-handlers.html | 54 + docs/html/tutorial-parser-set-id-handler.html | 61 + .../tutorial-parser-set-namespace-handler.html | 57 + docs/html/tutorial-parser-set-triple-handler.html | 52 + docs/html/tutorial-parser-static-info.html | 45 + docs/html/tutorial-parsing.html | 72 + docs/html/tutorial-querying-functionality.html | 112 + docs/html/tutorial-serializer-create.html | 43 + .../tutorial-serializer-declare-namespace.html | 63 + docs/html/tutorial-serializer-destroy.html | 37 + docs/html/tutorial-serializer-example.html | 113 + docs/html/tutorial-serializer-features.html | 70 + docs/html/tutorial-serializer-get-triples.html | 125 + docs/html/tutorial-serializer-runtime-info.html | 40 + docs/html/tutorial-serializer-send-triples.html | 56 + ...rial-serializer-set-error-warning-handlers.html | 54 + docs/html/tutorial-serializer-to-destination.html | 120 + docs/html/tutorial-serializing.html | 58 + docs/html/tutorial.html | 102 + docs/html/up-insensitive.png | Bin 0 -> 374 bytes docs/html/up.png | Bin 0 -> 260 bytes docs/libraptor2.3 | 140 + docs/libraptor2.html | 12 + docs/raptor-changes.tsv | 593 + docs/raptor-changes.xml | 1159 + docs/raptor-docs.xml | 169 + docs/raptor-formats.xml | 498 + docs/raptor-parsers.xml | 262 + docs/raptor-serializers.xml | 195 + docs/raptor-tutorial-intro.xml | 25 + docs/raptor-tutorial-parsing.xml | 642 + docs/raptor-tutorial-querying-functionality.xml | 85 + docs/raptor-tutorial-serializing.xml | 402 + docs/raptor1-eol.html | 108 + docs/raptor2-overrides.txt | 50 + docs/raptor2-sections.txt | 517 + docs/raptor2.types | 0 docs/rdfcat.c | 55 + docs/rdfprint.c | 42 + docs/rdfserialize.c | 47 + docs/upgrade-script.pl | 625 + docs/version.xml | 1 + docs/version.xml.in | 1 + examples/Makefile.am | 75 + examples/Makefile.in | 772 + examples/grapper.c | 1322 ++ examples/raptor_abort.c | 128 + examples/rdfcat.c | 55 + examples/rdfcount.c | 62 + examples/rdfguess.c | 102 + examples/rdfprint.c | 42 + examples/rdfserialize.c | 47 + gtk-doc.make | 322 + librdfa/Makefile.am | 83 + librdfa/Makefile.in | 747 + librdfa/config.h | 2 + librdfa/context.c | 591 + librdfa/curie.c | 691 + librdfa/iri.c | 73 + librdfa/language.c | 55 + librdfa/lists.c | 243 + librdfa/namespace.c | 140 + librdfa/rdfa.c | 1552 ++ librdfa/rdfa.h | 377 + librdfa/rdfa_utils.c | 543 + librdfa/rdfa_utils.h | 486 + librdfa/strtok_r.c | 52 + librdfa/strtok_r.h | 15 + librdfa/subject.c | 535 + librdfa/triple.c | 847 + raptor2.pc.in | 13 + raptor2.rdf.in | 94 + raptor2.spec.in | 139 + scripts/Makefile.am | 45 + scripts/Makefile.in | 671 + scripts/build-formats.c | 588 + scripts/fix-bison.pl | 107 + scripts/fix-flex.pl | 154 + scripts/fix-groff-xhtml.pl | 64 + scripts/fix-gtkdoc-header.pl | 38 + scripts/process-changes.pl | 844 + scripts/rdfcompare | 55 + src/CMakeLists.txt | 413 + src/Makefile.am | 350 + src/Makefile.in | 1807 ++ src/ntriples_parse.c | 799 + src/parsedate.c | 2760 +++ src/parsedate.h | 96 + src/parsedate.y | 1161 + src/raptor.h | 1 + src/raptor2.h.in | 2203 ++ src/raptor_abbrev.c | 642 + src/raptor_avltree.c | 1791 ++ src/raptor_concepts.c | 199 + src/raptor_config.h.in | 346 + src/raptor_config_cmake.h.in | 136 + src/raptor_escaped.c | 289 + src/raptor_general.c | 771 + src/raptor_grddl.c | 2131 ++ src/raptor_guess.c | 263 + src/raptor_internal.h | 1528 ++ src/raptor_iostream.c | 1666 ++ src/raptor_json.c | 782 + src/raptor_json_writer.c | 345 + src/raptor_librdfa.c | 398 + src/raptor_libxml.c | 889 + src/raptor_locator.c | 248 + src/raptor_log.c | 163 + src/raptor_memstr.c | 76 + src/raptor_namespace.c | 1160 + src/raptor_nfc_icu.c | 112 + src/raptor_nfc_test.c | 292 + src/raptor_ntriples.c | 723 + src/raptor_option.c | 718 + src/raptor_parse.c | 1832 ++ src/raptor_permute_test.c | 342 + src/raptor_qname.c | 695 + src/raptor_rdfxml.c | 3224 +++ src/raptor_rfc2396.c | 881 + src/raptor_rss.c | 1733 ++ src/raptor_rss.h | 448 + src/raptor_rss_common.c | 732 + src/raptor_sax2.c | 1026 + src/raptor_sequence.c | 895 + src/raptor_serialize.c | 791 + src/raptor_serialize_dot.c | 584 + src/raptor_serialize_html.c | 273 + src/raptor_serialize_json.c | 483 + src/raptor_serialize_ntriples.c | 342 + src/raptor_serialize_rdfxml.c | 729 + src/raptor_serialize_rdfxmla.c | 1553 ++ src/raptor_serialize_rss.c | 2425 +++ src/raptor_serialize_turtle.c | 1819 ++ src/raptor_set.c | 329 + src/raptor_statement.c | 424 + src/raptor_stringbuffer.c | 902 + src/raptor_syntax_description.c | 109 + src/raptor_term.c | 1039 + src/raptor_turtle_writer.c | 1043 + src/raptor_unicode.c | 940 + src/raptor_uri.c | 2099 ++ src/raptor_win32.c | 44 + src/raptor_www.c | 896 + src/raptor_www_curl.c | 388 + src/raptor_www_libfetch.c | 97 + src/raptor_www_libxml.c | 159 + src/raptor_www_test.c | 105 + src/raptor_xml.c | 1100 + src/raptor_xml_writer.c | 1046 + src/snprintf.c | 449 + src/sort_r.c | 135 + src/sort_r.h | 125 + src/ssort.h | 73 + src/strcasecmp.c | 108 + src/turtle_common.c | 336 + src/turtle_common.h | 98 + src/turtle_lexer.c | 3532 ++++ src/turtle_lexer.h | 724 + src/turtle_lexer.l | 1124 + src/turtle_parser.c | 4037 ++++ src/turtle_parser.h | 122 + src/turtle_parser.y | 2128 ++ tests/Makefile.am | 44 + tests/Makefile.in | 1155 + tests/empty.c | 33 + tests/feeds/CMakeLists.txt | 75 + tests/feeds/Makefile.am | 248 + tests/feeds/Makefile.in | 719 + tests/feeds/atom.rnc | 334 + tests/feeds/atom.rng | 597 + tests/feeds/test01-result.atom | 26 + tests/feeds/test01-result.ttl | 40 + tests/feeds/test01.rdf | 44 + tests/feeds/test02-result.atom | 60 + tests/feeds/test02-result.ttl | 41 + tests/feeds/test02.rdf | 44 + tests/feeds/test03-result.atom | 84 + tests/feeds/test03-result.ttl | 57 + tests/feeds/test03.rdf | 72 + tests/feeds/test04-result.ttl | 67 + tests/feeds/test04.atom | 44 + tests/feeds/test05-result.ttl | 24 + tests/feeds/test05.atom | 9 + tests/grddl/CMakeLists.txt | 17 + tests/grddl/Makefile.am | 85 + tests/grddl/Makefile.in | 571 + tests/grddl/data-01.nt | 1 + tests/grddl/data-01.rdf | 6 + tests/grddl/data-02.rdf | 6 + tests/grddl/test-01.html | 21 + tests/grddl/test-01.out | 2 + tests/json/CMakeLists.txt | 69 + tests/json/Makefile.am | 130 + tests/json/Makefile.in | 613 + tests/json/bad-00.json | 3 + tests/json/bad-01.json | 10 + tests/json/bad-02.json | 11 + tests/json/bad-03.json | 10 + tests/json/bad-04.json | 7 + tests/json/bad-05.json | 11 + tests/json/bad-06.json | 12 + tests/json/bad-07.json | 11 + tests/json/bad-08.json | 11 + tests/json/bad-09.json | 11 + tests/json/bad-10.json | 11 + tests/json/bad-11.json | 11 + tests/json/bad-12.json | 7 + tests/json/bad-13.json | 11 + tests/json/example1.json | 22 + tests/json/example1.nt | 13 + tests/json/example2.json | 57 + tests/json/example2.nt | 13 + tests/json/example3.json | 14 + tests/json/example3.nt | 1 + tests/json/example4.json | 39 + tests/json/example4.nt | 5 + tests/mkr/Makefile.am | 111 + tests/mkr/Makefile.in | 587 + tests/mkr/README.txt | 12 + tests/mkr/rdf-schema.mkr | 155 + tests/mkr/rdf-schema.ttl | 154 + tests/mkr/rdfq-results.mkr | 13 + tests/mkr/rdfq-results.ttl | 39 + tests/mkr/rdfs-namespace.mkr | 185 + tests/mkr/rdfs-namespace.ttl | 160 + tests/mkr/test-07.mkr | 7 + tests/mkr/test-07.ttl | 3 + tests/mkr/test-08.mkr | 7 + tests/mkr/test-08.ttl | 3 + tests/mkr/test-16a.mkr | 7 + tests/mkr/test-16a.ttl | 11 + tests/mkr/test-28.mkr | 6 + tests/mkr/test-28.ttl | 22 + tests/mkr/test-31.mkr | 12 + tests/mkr/test-31.ttl | 10 + tests/mkr/test-32.mkr | 7 + tests/mkr/test-32.ttl | 5 + tests/mkr/test-34.mkr | 7 + tests/mkr/test-34.ttl | 4 + tests/nquads-2013/Makefile.am | 211 + tests/nquads-2013/Makefile.in | 694 + tests/nquads-2013/README | 25 + tests/nquads-2013/comment_following_triple.nq | 5 + tests/nquads-2013/langtagged_string.nq | 1 + tests/nquads-2013/lantag_with_subtag.nq | 1 + tests/nquads-2013/literal.nq | 1 + tests/nquads-2013/literal_all_controls.nq | 1 + tests/nquads-2013/literal_all_punctuation.nq | 1 + tests/nquads-2013/literal_ascii_boundaries.nq | Bin 0 -> 57 bytes tests/nquads-2013/literal_false.nq | 1 + tests/nquads-2013/literal_true.nq | 1 + tests/nquads-2013/literal_with_2_dquotes.nq | 1 + tests/nquads-2013/literal_with_2_squotes.nq | 1 + tests/nquads-2013/literal_with_BACKSPACE.nq | 1 + tests/nquads-2013/literal_with_CARRIAGE_RETURN.nq | 1 + .../literal_with_CHARACTER_TABULATION.nq | 1 + tests/nquads-2013/literal_with_FORM_FEED.nq | 1 + tests/nquads-2013/literal_with_LINE_FEED.nq | 1 + tests/nquads-2013/literal_with_REVERSE_SOLIDUS.nq | 1 + tests/nquads-2013/literal_with_REVERSE_SOLIDUS2.nq | 1 + tests/nquads-2013/literal_with_UTF8_boundaries.nq | 1 + tests/nquads-2013/literal_with_dquote.nq | 1 + tests/nquads-2013/literal_with_numeric_escape4.nq | 1 + tests/nquads-2013/literal_with_numeric_escape8.nq | 1 + tests/nquads-2013/literal_with_squote.nq | 1 + tests/nquads-2013/minimal_whitespace.nq | 6 + tests/nquads-2013/nq-syntax-bad-literal-01.nq | 1 + tests/nquads-2013/nq-syntax-bad-literal-02.nq | 1 + tests/nquads-2013/nq-syntax-bad-literal-03.nq | 1 + tests/nquads-2013/nq-syntax-bad-quint-01.nq | 2 + tests/nquads-2013/nq-syntax-bad-uri-01.nq | 2 + tests/nquads-2013/nq-syntax-bnode-01.nq | 1 + tests/nquads-2013/nq-syntax-bnode-02.nq | 1 + tests/nquads-2013/nq-syntax-bnode-03.nq | 1 + tests/nquads-2013/nq-syntax-bnode-04.nq | 1 + tests/nquads-2013/nq-syntax-bnode-05.nq | 1 + tests/nquads-2013/nq-syntax-bnode-06.nq | 1 + tests/nquads-2013/nq-syntax-uri-01.nq | 1 + tests/nquads-2013/nq-syntax-uri-02.nq | 1 + tests/nquads-2013/nq-syntax-uri-03.nq | 1 + tests/nquads-2013/nq-syntax-uri-04.nq | 1 + tests/nquads-2013/nq-syntax-uri-05.nq | 1 + tests/nquads-2013/nq-syntax-uri-06.nq | 1 + tests/nquads-2013/nt-syntax-bad-base-01.nq | 1 + tests/nquads-2013/nt-syntax-bad-esc-01.nq | 2 + tests/nquads-2013/nt-syntax-bad-esc-02.nq | 2 + tests/nquads-2013/nt-syntax-bad-esc-03.nq | 2 + tests/nquads-2013/nt-syntax-bad-lang-01.nq | 2 + tests/nquads-2013/nt-syntax-bad-num-01.nq | 1 + tests/nquads-2013/nt-syntax-bad-num-02.nq | 1 + tests/nquads-2013/nt-syntax-bad-num-03.nq | 1 + tests/nquads-2013/nt-syntax-bad-prefix-01.nq | 1 + tests/nquads-2013/nt-syntax-bad-string-01.nq | 1 + tests/nquads-2013/nt-syntax-bad-string-02.nq | 1 + tests/nquads-2013/nt-syntax-bad-string-03.nq | 1 + tests/nquads-2013/nt-syntax-bad-string-04.nq | 1 + tests/nquads-2013/nt-syntax-bad-string-05.nq | 1 + tests/nquads-2013/nt-syntax-bad-string-06.nq | 1 + tests/nquads-2013/nt-syntax-bad-string-07.nq | 1 + tests/nquads-2013/nt-syntax-bad-struct-01.nq | 1 + tests/nquads-2013/nt-syntax-bad-struct-02.nq | 1 + tests/nquads-2013/nt-syntax-bad-uri-01.nq | 2 + tests/nquads-2013/nt-syntax-bad-uri-02.nq | 2 + tests/nquads-2013/nt-syntax-bad-uri-03.nq | 2 + tests/nquads-2013/nt-syntax-bad-uri-04.nq | 2 + tests/nquads-2013/nt-syntax-bad-uri-05.nq | 2 + tests/nquads-2013/nt-syntax-bad-uri-06.nq | 2 + tests/nquads-2013/nt-syntax-bad-uri-07.nq | 2 + tests/nquads-2013/nt-syntax-bad-uri-08.nq | 2 + tests/nquads-2013/nt-syntax-bad-uri-09.nq | 2 + tests/nquads-2013/nt-syntax-bnode-01.nq | 1 + tests/nquads-2013/nt-syntax-bnode-02.nq | 2 + tests/nquads-2013/nt-syntax-bnode-03.nq | 2 + tests/nquads-2013/nt-syntax-datatypes-01.nq | 1 + tests/nquads-2013/nt-syntax-datatypes-02.nq | 1 + tests/nquads-2013/nt-syntax-file-01.nq | 0 tests/nquads-2013/nt-syntax-file-02.nq | 1 + tests/nquads-2013/nt-syntax-file-03.nq | 2 + tests/nquads-2013/nt-syntax-str-esc-01.nq | 1 + tests/nquads-2013/nt-syntax-str-esc-02.nq | 1 + tests/nquads-2013/nt-syntax-str-esc-03.nq | 1 + tests/nquads-2013/nt-syntax-string-01.nq | 1 + tests/nquads-2013/nt-syntax-string-02.nq | 1 + tests/nquads-2013/nt-syntax-string-03.nq | 1 + tests/nquads-2013/nt-syntax-subm-01.nq | 79 + tests/nquads-2013/nt-syntax-uri-01.nq | 1 + tests/nquads-2013/nt-syntax-uri-02.nq | 2 + tests/nquads-2013/nt-syntax-uri-03.nq | 2 + tests/nquads-2013/nt-syntax-uri-04.nq | 2 + tests/ntriples-2013/LITERAL.nt | 1 + tests/ntriples-2013/LITERAL_all_controls.nt | 1 + tests/ntriples-2013/LITERAL_all_punctuation.nt | 1 + tests/ntriples-2013/LITERAL_ascii_boundaries.nt | Bin 0 -> 57 bytes tests/ntriples-2013/LITERAL_with_2_dquotes.nt | 1 + tests/ntriples-2013/LITERAL_with_2_squotes.nt | 1 + .../ntriples-2013/LITERAL_with_UTF8_boundaries.nt | 1 + tests/ntriples-2013/LITERAL_with_dquote.nt | 1 + tests/ntriples-2013/LITERAL_with_squote.nt | 1 + tests/ntriples-2013/Makefile.am | 193 + tests/ntriples-2013/Makefile.in | 678 + tests/ntriples-2013/README | 25 + tests/ntriples-2013/comment_following_triple.nt | 5 + tests/ntriples-2013/langtagged_string.nt | 1 + tests/ntriples-2013/lantag_with_subtag.nt | 1 + tests/ntriples-2013/literal_false.nt | 1 + tests/ntriples-2013/literal_true.nt | 1 + tests/ntriples-2013/literal_with_BACKSPACE.nt | 1 + .../ntriples-2013/literal_with_CARRIAGE_RETURN.nt | 1 + .../literal_with_CHARACTER_TABULATION.nt | 1 + tests/ntriples-2013/literal_with_FORM_FEED.nt | 1 + tests/ntriples-2013/literal_with_LINE_FEED.nt | 1 + .../ntriples-2013/literal_with_REVERSE_SOLIDUS.nt | 1 + .../ntriples-2013/literal_with_REVERSE_SOLIDUS2.nt | 1 + .../ntriples-2013/literal_with_numeric_escape4.nt | 1 + .../ntriples-2013/literal_with_numeric_escape8.nt | 1 + tests/ntriples-2013/minimal_whitespace.nt | 6 + tests/ntriples-2013/nt-syntax-bad-base-01.nt | 1 + tests/ntriples-2013/nt-syntax-bad-esc-01.nt | 2 + tests/ntriples-2013/nt-syntax-bad-esc-02.nt | 2 + tests/ntriples-2013/nt-syntax-bad-esc-03.nt | 2 + tests/ntriples-2013/nt-syntax-bad-lang-01.nt | 2 + tests/ntriples-2013/nt-syntax-bad-num-01.nt | 1 + tests/ntriples-2013/nt-syntax-bad-num-02.nt | 1 + tests/ntriples-2013/nt-syntax-bad-num-03.nt | 1 + tests/ntriples-2013/nt-syntax-bad-prefix-01.nt | 1 + tests/ntriples-2013/nt-syntax-bad-string-01.nt | 1 + tests/ntriples-2013/nt-syntax-bad-string-02.nt | 1 + tests/ntriples-2013/nt-syntax-bad-string-03.nt | 1 + tests/ntriples-2013/nt-syntax-bad-string-04.nt | 1 + tests/ntriples-2013/nt-syntax-bad-string-05.nt | 1 + tests/ntriples-2013/nt-syntax-bad-string-06.nt | 1 + tests/ntriples-2013/nt-syntax-bad-string-07.nt | 1 + tests/ntriples-2013/nt-syntax-bad-struct-01.nt | 1 + tests/ntriples-2013/nt-syntax-bad-struct-02.nt | 1 + tests/ntriples-2013/nt-syntax-bad-uri-01.nt | 2 + tests/ntriples-2013/nt-syntax-bad-uri-02.nt | 2 + tests/ntriples-2013/nt-syntax-bad-uri-03.nt | 2 + tests/ntriples-2013/nt-syntax-bad-uri-04.nt | 2 + tests/ntriples-2013/nt-syntax-bad-uri-05.nt | 2 + tests/ntriples-2013/nt-syntax-bad-uri-06.nt | 2 + tests/ntriples-2013/nt-syntax-bad-uri-07.nt | 2 + tests/ntriples-2013/nt-syntax-bad-uri-08.nt | 2 + tests/ntriples-2013/nt-syntax-bad-uri-09.nt | 2 + tests/ntriples-2013/nt-syntax-bnode-01.nt | 1 + tests/ntriples-2013/nt-syntax-bnode-02.nt | 2 + tests/ntriples-2013/nt-syntax-bnode-03.nt | 2 + tests/ntriples-2013/nt-syntax-datatypes-01.nt | 1 + tests/ntriples-2013/nt-syntax-datatypes-02.nt | 1 + tests/ntriples-2013/nt-syntax-file-01.nt | 0 tests/ntriples-2013/nt-syntax-file-02.nt | 1 + tests/ntriples-2013/nt-syntax-file-03.nt | 2 + tests/ntriples-2013/nt-syntax-str-esc-01.nt | 1 + tests/ntriples-2013/nt-syntax-str-esc-02.nt | 1 + tests/ntriples-2013/nt-syntax-str-esc-03.nt | 1 + tests/ntriples-2013/nt-syntax-string-01.nt | 1 + tests/ntriples-2013/nt-syntax-string-02.nt | 1 + tests/ntriples-2013/nt-syntax-string-03.nt | 1 + tests/ntriples-2013/nt-syntax-subm-01.nt | 79 + tests/ntriples-2013/nt-syntax-uri-01.nt | 1 + tests/ntriples-2013/nt-syntax-uri-02.nt | 2 + tests/ntriples-2013/nt-syntax-uri-03.nt | 2 + tests/ntriples-2013/nt-syntax-uri-04.nt | 2 + tests/ntriples/CMakeLists.txt | 53 + tests/ntriples/Makefile.am | 164 + tests/ntriples/Makefile.in | 646 + tests/ntriples/bad-00.nt | 1 + tests/ntriples/bad-02.nt | 1 + tests/ntriples/bad-03.nt | 1 + tests/ntriples/bad-04.nt | 1 + tests/ntriples/bad-05.nt | 1 + tests/ntriples/bad-06.nt | 1 + tests/ntriples/bad-07.nt | 1 + tests/ntriples/bug-481.nq | 1 + tests/ntriples/bug-481.out | 1 + tests/ntriples/bug-562.nt | 2 + tests/ntriples/bug-562.out | 2 + tests/ntriples/bug-574.nt | 1 + tests/ntriples/bug-574.out | 1 + tests/ntriples/bug-577.nt | 38 + tests/ntriples/bug-577.out | 37 + tests/ntriples/nt2013-ex1.nt | 4 + tests/ntriples/nt2013-ex1.out | 3 + tests/ntriples/nt2013-ex2.nt | 1 + tests/ntriples/nt2013-ex2.out | 1 + tests/ntriples/nt2013-ex3.nt | 8 + tests/ntriples/nt2013-ex3.out | 7 + tests/ntriples/nt2013-ex4.nt | 2 + tests/ntriples/nt2013-ex4.out | 2 + tests/ntriples/test.nt | 66 + tests/ntriples/test.out | 31 + tests/ntriples/testnq-1.nq | 11 + tests/ntriples/testnq-1.out | 10 + tests/ntriples/testnq-optional-context.nq | 2 + tests/ntriples/testnq-optional-context.out | 2 + tests/rdfa/0001.out | 1 + tests/rdfa/0001.xml | 10 + tests/rdfa/0006.out | 2 + tests/rdfa/0006.xml | 15 + tests/rdfa/0007.out | 3 + tests/rdfa/0007.xml | 15 + tests/rdfa/0008.out | 1 + tests/rdfa/0008.xml | 15 + tests/rdfa/0009.out | 1 + tests/rdfa/0009.xml | 13 + tests/rdfa/0010.out | 2 + tests/rdfa/0010.xml | 12 + tests/rdfa/0012.out | 1 + tests/rdfa/0012.xml | 11 + tests/rdfa/0013.out | 1 + tests/rdfa/0013.xml | 11 + tests/rdfa/0014.out | 1 + tests/rdfa/0014.xml | 14 + tests/rdfa/0015.out | 2 + tests/rdfa/0015.xml | 12 + tests/rdfa/0017.out | 3 + tests/rdfa/0017.xml | 15 + tests/rdfa/0018.out | 1 + tests/rdfa/0018.xml | 16 + tests/rdfa/0019.out | 1 + tests/rdfa/0019.xml | 11 + tests/rdfa/0020.out | 1 + tests/rdfa/0020.xml | 16 + tests/rdfa/0021.out | 1 + tests/rdfa/0021.xml | 16 + tests/rdfa/0023.out | 1 + tests/rdfa/0023.xml | 15 + tests/rdfa/0025.out | 2 + tests/rdfa/0025.xml | 18 + tests/rdfa/0026.out | 1 + tests/rdfa/0026.xml | 15 + tests/rdfa/0027.out | 1 + tests/rdfa/0027.xml | 16 + tests/rdfa/0029.out | 1 + tests/rdfa/0029.xml | 16 + tests/rdfa/0030.out | 1 + tests/rdfa/0030.xml | 15 + tests/rdfa/0031.out | 1 + tests/rdfa/0031.xml | 13 + tests/rdfa/0032.out | 1 + tests/rdfa/0032.xml | 14 + tests/rdfa/0033.out | 2 + tests/rdfa/0033.xml | 18 + tests/rdfa/0034.out | 1 + tests/rdfa/0034.xml | 13 + tests/rdfa/0035.out | 1 + tests/rdfa/0035.xml | 16 + tests/rdfa/0036.out | 1 + tests/rdfa/0036.xml | 16 + tests/rdfa/0037.out | 1 + tests/rdfa/0037.xml | 17 + tests/rdfa/0038.out | 1 + tests/rdfa/0038.xml | 13 + tests/rdfa/0039.out | 1 + tests/rdfa/0039.xml | 16 + tests/rdfa/0040.out | 1 + tests/rdfa/0040.xml | 15 + tests/rdfa/0041.out | 1 + tests/rdfa/0041.xml | 17 + tests/rdfa/0042.out | 0 tests/rdfa/0042.xml | 14 + tests/rdfa/0046.out | 3 + tests/rdfa/0046.xml | 12 + tests/rdfa/0047.out | 3 + tests/rdfa/0047.xml | 12 + tests/rdfa/0048.out | 3 + tests/rdfa/0048.xml | 12 + tests/rdfa/0049.out | 2 + tests/rdfa/0049.xml | 12 + tests/rdfa/0050.out | 2 + tests/rdfa/0050.xml | 12 + tests/rdfa/0051.out | 2 + tests/rdfa/0051.xml | 10 + tests/rdfa/0052.out | 1 + tests/rdfa/0052.xml | 12 + tests/rdfa/0053.out | 2 + tests/rdfa/0053.xml | 12 + tests/rdfa/0054.out | 2 + tests/rdfa/0054.xml | 13 + tests/rdfa/0055.out | 2 + tests/rdfa/0055.xml | 13 + tests/rdfa/0056.out | 3 + tests/rdfa/0056.xml | 12 + tests/rdfa/0057.out | 4 + tests/rdfa/0057.xml | 13 + tests/rdfa/0058.out | 6 + tests/rdfa/0058.xml | 13 + tests/rdfa/0059.out | 6 + tests/rdfa/0059.xml | 15 + tests/rdfa/0060.out | 2 + tests/rdfa/0060.xml | 13 + tests/rdfa/0061.out | 1 + tests/rdfa/0061.xml | 11 + tests/rdfa/0062.out | 1 + tests/rdfa/0062.xml | 11 + tests/rdfa/0063.out | 1 + tests/rdfa/0063.xml | 11 + tests/rdfa/0064.out | 1 + tests/rdfa/0064.xml | 12 + tests/rdfa/0065.out | 3 + tests/rdfa/0065.xml | 21 + tests/rdfa/0066.out | 1 + tests/rdfa/0066.xml | 10 + tests/rdfa/0067.out | 1 + tests/rdfa/0067.xml | 10 + tests/rdfa/0068.out | 1 + tests/rdfa/0068.xml | 13 + tests/rdfa/0069.out | 1 + tests/rdfa/0069.xml | 12 + tests/rdfa/0070.out | 1 + tests/rdfa/0070.xml | 12 + tests/rdfa/0071.out | 1 + tests/rdfa/0071.xml | 14 + tests/rdfa/0072.out | 1 + tests/rdfa/0072.xml | 14 + tests/rdfa/0073.out | 1 + tests/rdfa/0073.xml | 14 + tests/rdfa/0074.out | 1 + tests/rdfa/0074.xml | 14 + tests/rdfa/0075.out | 1 + tests/rdfa/0075.xml | 14 + tests/rdfa/0076.out | 23 + tests/rdfa/0076.xml | 34 + tests/rdfa/0077.out | 24 + tests/rdfa/0077.xml | 59 + tests/rdfa/0078.out | 6 + tests/rdfa/0078.xml | 14 + tests/rdfa/0079.out | 3 + tests/rdfa/0079.xml | 14 + tests/rdfa/0080.out | 1 + tests/rdfa/0080.xml | 12 + tests/rdfa/0081.out | 6 + tests/rdfa/0081.xml | 14 + tests/rdfa/0082.out | 8 + tests/rdfa/0082.xml | 14 + tests/rdfa/0083.out | 6 + tests/rdfa/0083.xml | 14 + tests/rdfa/0084.out | 8 + tests/rdfa/0084.xml | 17 + tests/rdfa/0085.out | 4 + tests/rdfa/0085.xml | 16 + tests/rdfa/0087.out | 24 + tests/rdfa/0087.xml | 35 + tests/rdfa/0088.out | 3 + tests/rdfa/0088.xml | 13 + tests/rdfa/0089.out | 1 + tests/rdfa/0089.xml | 12 + tests/rdfa/0090.out | 1 + tests/rdfa/0090.xml | 15 + tests/rdfa/0091.out | 3 + tests/rdfa/0091.xml | 16 + tests/rdfa/0093.out | 2 + tests/rdfa/0093.xml | 14 + tests/rdfa/0099.out | 1 + tests/rdfa/0099.xml | 19 + tests/rdfa/0104.out | 3 + tests/rdfa/0104.xml | 17 + tests/rdfa/0106.out | 1 + tests/rdfa/0106.xml | 12 + tests/rdfa/0107.out | 0 tests/rdfa/0107.xml | 10 + tests/rdfa/0108.out | 1 + tests/rdfa/0108.xml | 13 + tests/rdfa/0109.out | 1 + tests/rdfa/0109.xml | 14 + tests/rdfa/0110.out | 1 + tests/rdfa/0110.xml | 12 + tests/rdfa/0111.out | 2 + tests/rdfa/0111.xml | 14 + tests/rdfa/0112.out | 1 + tests/rdfa/0112.xml | 15 + tests/rdfa/0113.out | 2 + tests/rdfa/0113.xml | 11 + tests/rdfa/0114.out | 8 + tests/rdfa/0114.xml | 21 + tests/rdfa/0115.out | 4 + tests/rdfa/0115.xml | 16 + tests/rdfa/0117.out | 2 + tests/rdfa/0117.xml | 14 + tests/rdfa/0118.out | 1 + tests/rdfa/0118.xml | 16 + tests/rdfa/0119.out | 1 + tests/rdfa/0119.xml | 18 + tests/rdfa/0120.out | 1 + tests/rdfa/0120.xml | 15 + tests/rdfa/0121.out | 2 + tests/rdfa/0121.xml | 23 + tests/rdfa/0122.out | 0 tests/rdfa/0122.xml | 16 + tests/rdfa/0126.out | 3 + tests/rdfa/0126.xml | 14 + tests/rdfa/0131.out | 5 + tests/rdfa/0131.xml | 10 + tests/rdfa/0134.out | 1 + tests/rdfa/0134.xml | 10 + tests/rdfa/0140.out | 0 tests/rdfa/0140.xml | 11 + tests/rdfa/0147.out | 1 + tests/rdfa/0147.xml | 10 + tests/rdfa/0172.out | 1 + tests/rdfa/0172.xml | 11 + tests/rdfa/0173.out | 1 + tests/rdfa/0173.xml | 11 + tests/rdfa/0174.out | 1 + tests/rdfa/0174.xml | 15 + tests/rdfa/0181.out | 1 + tests/rdfa/0181.xml | 12 + tests/rdfa/0197.out | 1 + tests/rdfa/0197.xml | 14 + tests/rdfa/0201.out | 1 + tests/rdfa/0201.xml | 12 + tests/rdfa/0202.out | 1 + tests/rdfa/0202.xml | 14 + tests/rdfa/0203.out | 1 + tests/rdfa/0203.xml | 14 + tests/rdfa/0207.out | 6 + tests/rdfa/0207.xml | 17 + tests/rdfa/0209.out | 0 tests/rdfa/0209.xml | 14 + tests/rdfa/0210.out | 1 + tests/rdfa/0210.xml | 14 + tests/rdfa/0211.out | 0 tests/rdfa/0211.xml | 15 + tests/rdfa/0212.out | 1 + tests/rdfa/0212.xml | 14 + tests/rdfa/0215.out | 1 + tests/rdfa/0215.xml | 30 + tests/rdfa/0258.out | 1 + tests/rdfa/0258.xml | 14 + tests/rdfa/0262.out | 1 + tests/rdfa/0262.xml | 11 + tests/rdfa/0291.out | 1 + tests/rdfa/0291.xml | 11 + tests/rdfa/0294.out | 0 tests/rdfa/0294.xml | 48 + tests/rdfa/0304.out | 2 + tests/rdfa/0304.xml | 20 + tests/rdfa/CMakeLists.txt | 741 + tests/rdfa/Makefile.am | 168 + tests/rdfa/Makefile.in | 654 + tests/rdfa11/0001.out | 1 + tests/rdfa11/0001.xml | 10 + tests/rdfa11/0006.out | 2 + tests/rdfa11/0006.xml | 15 + tests/rdfa11/0007.out | 3 + tests/rdfa11/0007.xml | 15 + tests/rdfa11/0008.out | 1 + tests/rdfa11/0008.xml | 15 + tests/rdfa11/0009.out | 1 + tests/rdfa11/0009.xml | 13 + tests/rdfa11/0010.out | 2 + tests/rdfa11/0010.xml | 12 + tests/rdfa11/0012.out | 1 + tests/rdfa11/0012.xml | 11 + tests/rdfa11/0013.out | 1 + tests/rdfa11/0013.xml | 11 + tests/rdfa11/0014.out | 1 + tests/rdfa11/0014.xml | 14 + tests/rdfa11/0015.out | 2 + tests/rdfa11/0015.xml | 12 + tests/rdfa11/0017.out | 3 + tests/rdfa11/0017.xml | 15 + tests/rdfa11/0018.out | 1 + tests/rdfa11/0018.xml | 16 + tests/rdfa11/0019.out | 1 + tests/rdfa11/0019.xml | 11 + tests/rdfa11/0020.out | 1 + tests/rdfa11/0020.xml | 16 + tests/rdfa11/0021.out | 1 + tests/rdfa11/0021.xml | 16 + tests/rdfa11/0023.out | 1 + tests/rdfa11/0023.xml | 15 + tests/rdfa11/0025.out | 2 + tests/rdfa11/0025.xml | 18 + tests/rdfa11/0026.out | 1 + tests/rdfa11/0026.xml | 15 + tests/rdfa11/0027.out | 1 + tests/rdfa11/0027.xml | 16 + tests/rdfa11/0029.out | 1 + tests/rdfa11/0029.xml | 16 + tests/rdfa11/0030.out | 1 + tests/rdfa11/0030.xml | 15 + tests/rdfa11/0031.out | 1 + tests/rdfa11/0031.xml | 13 + tests/rdfa11/0032.out | 1 + tests/rdfa11/0032.xml | 14 + tests/rdfa11/0033.out | 2 + tests/rdfa11/0033.xml | 18 + tests/rdfa11/0034.out | 1 + tests/rdfa11/0034.xml | 13 + tests/rdfa11/0035.out | 1 + tests/rdfa11/0035.xml | 16 + tests/rdfa11/0036.out | 1 + tests/rdfa11/0036.xml | 16 + tests/rdfa11/0037.out | 1 + tests/rdfa11/0037.xml | 17 + tests/rdfa11/0038.out | 1 + tests/rdfa11/0038.xml | 13 + tests/rdfa11/0039.out | 1 + tests/rdfa11/0039.xml | 16 + tests/rdfa11/0041.out | 1 + tests/rdfa11/0041.xml | 17 + tests/rdfa11/0048.out | 3 + tests/rdfa11/0048.xml | 12 + tests/rdfa11/0049.out | 2 + tests/rdfa11/0049.xml | 12 + tests/rdfa11/0050.out | 2 + tests/rdfa11/0050.xml | 12 + tests/rdfa11/0051.out | 2 + tests/rdfa11/0051.xml | 10 + tests/rdfa11/0052.out | 1 + tests/rdfa11/0052.xml | 12 + tests/rdfa11/0053.out | 2 + tests/rdfa11/0053.xml | 12 + tests/rdfa11/0054.out | 2 + tests/rdfa11/0054.xml | 13 + tests/rdfa11/0055.out | 2 + tests/rdfa11/0055.xml | 13 + tests/rdfa11/0056.out | 3 + tests/rdfa11/0056.xml | 12 + tests/rdfa11/0057.out | 4 + tests/rdfa11/0057.xml | 13 + tests/rdfa11/0059.out | 6 + tests/rdfa11/0059.xml | 15 + tests/rdfa11/0060.out | 2 + tests/rdfa11/0060.xml | 13 + tests/rdfa11/0061.out | 1 + tests/rdfa11/0061.xml | 12 + tests/rdfa11/0062.out | 1 + tests/rdfa11/0062.xml | 12 + tests/rdfa11/0063.out | 1 + tests/rdfa11/0063.xml | 11 + tests/rdfa11/0064.out | 1 + tests/rdfa11/0064.xml | 12 + tests/rdfa11/0065.out | 3 + tests/rdfa11/0065.xml | 21 + tests/rdfa11/0066.out | 1 + tests/rdfa11/0066.xml | 10 + tests/rdfa11/0067.out | 1 + tests/rdfa11/0067.xml | 10 + tests/rdfa11/0068.out | 1 + tests/rdfa11/0068.xml | 13 + tests/rdfa11/0069.out | 1 + tests/rdfa11/0069.xml | 12 + tests/rdfa11/0070.out | 1 + tests/rdfa11/0070.xml | 12 + tests/rdfa11/0071.out | 1 + tests/rdfa11/0071.xml | 14 + tests/rdfa11/0072.out | 1 + tests/rdfa11/0072.xml | 14 + tests/rdfa11/0073.out | 1 + tests/rdfa11/0073.xml | 14 + tests/rdfa11/0074.out | 1 + tests/rdfa11/0074.xml | 14 + tests/rdfa11/0075.out | 1 + tests/rdfa11/0075.xml | 14 + tests/rdfa11/0076.out | 23 + tests/rdfa11/0076.xml | 35 + tests/rdfa11/0077.out | 24 + tests/rdfa11/0077.xml | 60 + tests/rdfa11/0079.out | 3 + tests/rdfa11/0079.xml | 14 + tests/rdfa11/0080.out | 1 + tests/rdfa11/0080.xml | 12 + tests/rdfa11/0083.out | 6 + tests/rdfa11/0083.xml | 14 + tests/rdfa11/0084.out | 8 + tests/rdfa11/0084.xml | 17 + tests/rdfa11/0085.out | 4 + tests/rdfa11/0085.xml | 16 + tests/rdfa11/0087.out | 24 + tests/rdfa11/0087.xml | 35 + tests/rdfa11/0088.out | 3 + tests/rdfa11/0088.xml | 13 + tests/rdfa11/0089.out | 1 + tests/rdfa11/0089.xml | 12 + tests/rdfa11/0091.out | 3 + tests/rdfa11/0091.xml | 16 + tests/rdfa11/0093.out | 2 + tests/rdfa11/0093.xml | 14 + tests/rdfa11/0099.out | 1 + tests/rdfa11/0099.xml | 19 + tests/rdfa11/0104.out | 3 + tests/rdfa11/0104.xml | 17 + tests/rdfa11/0106.out | 1 + tests/rdfa11/0106.xml | 12 + tests/rdfa11/0107.out | 0 tests/rdfa11/0107.xml | 10 + tests/rdfa11/0108.out | 1 + tests/rdfa11/0108.xml | 13 + tests/rdfa11/0109.out | 1 + tests/rdfa11/0109.xml | 14 + tests/rdfa11/0110.out | 1 + tests/rdfa11/0110.xml | 12 + tests/rdfa11/0111.out | 2 + tests/rdfa11/0111.xml | 14 + tests/rdfa11/0112.out | 1 + tests/rdfa11/0112.xml | 15 + tests/rdfa11/0113.out | 2 + tests/rdfa11/0113.xml | 11 + tests/rdfa11/0114.out | 8 + tests/rdfa11/0114.xml | 21 + tests/rdfa11/0115.out | 4 + tests/rdfa11/0115.xml | 16 + tests/rdfa11/0117.out | 2 + tests/rdfa11/0117.xml | 14 + tests/rdfa11/0118.out | 1 + tests/rdfa11/0118.xml | 16 + tests/rdfa11/0119.out | 1 + tests/rdfa11/0119.xml | 18 + tests/rdfa11/0120.out | 1 + tests/rdfa11/0120.xml | 15 + tests/rdfa11/0121.out | 2 + tests/rdfa11/0121.xml | 23 + tests/rdfa11/0122.out | 0 tests/rdfa11/0122.xml | 16 + tests/rdfa11/0126.out | 3 + tests/rdfa11/0126.xml | 14 + tests/rdfa11/0131.out | 5 + tests/rdfa11/0131.xml | 10 + tests/rdfa11/0134.out | 1 + tests/rdfa11/0134.xml | 10 + tests/rdfa11/0140.out | 0 tests/rdfa11/0140.xml | 11 + tests/rdfa11/0147.out | 1 + tests/rdfa11/0147.xml | 10 + tests/rdfa11/0172.out | 1 + tests/rdfa11/0172.xml | 13 + tests/rdfa11/0173.out | 1 + tests/rdfa11/0173.xml | 13 + tests/rdfa11/0174.out | 1 + tests/rdfa11/0174.xml | 15 + tests/rdfa11/0175.out | 1 + tests/rdfa11/0175.xml | 12 + tests/rdfa11/0176.out | 4 + tests/rdfa11/0176.xml | 22 + tests/rdfa11/0177.out | 1 + tests/rdfa11/0177.xml | 13 + tests/rdfa11/0178.out | 2 + tests/rdfa11/0178.xml | 13 + tests/rdfa11/0179.out | 1 + tests/rdfa11/0179.xml | 14 + tests/rdfa11/0180.out | 1 + tests/rdfa11/0180.xml | 13 + tests/rdfa11/0181.out | 1 + tests/rdfa11/0181.xml | 12 + tests/rdfa11/0182.out | 2 + tests/rdfa11/0182.xml | 15 + tests/rdfa11/0183.out | 2 + tests/rdfa11/0183.xml | 15 + tests/rdfa11/0186.out | 2 + tests/rdfa11/0186.xml | 13 + tests/rdfa11/0187.out | 3 + tests/rdfa11/0187.xml | 15 + tests/rdfa11/0188.out | 2 + tests/rdfa11/0188.xml | 15 + tests/rdfa11/0189.out | 2 + tests/rdfa11/0189.xml | 12 + tests/rdfa11/0190.out | 1 + tests/rdfa11/0190.xml | 12 + tests/rdfa11/0196.out | 2 + tests/rdfa11/0196.xml | 14 + tests/rdfa11/0197.out | 5 + tests/rdfa11/0197.xml | 14 + tests/rdfa11/0198.out | 4 + tests/rdfa11/0198.xml | 16 + tests/rdfa11/0201.out | 1 + tests/rdfa11/0201.xml | 12 + tests/rdfa11/0202.out | 1 + tests/rdfa11/0202.xml | 14 + tests/rdfa11/0203.out | 1 + tests/rdfa11/0203.xml | 14 + tests/rdfa11/0206.out | 1 + tests/rdfa11/0206.xml | 13 + tests/rdfa11/0207.out | 6 + tests/rdfa11/0207.xml | 17 + tests/rdfa11/0213.out | 1 + tests/rdfa11/0213.xml | 14 + tests/rdfa11/0214.out | 2 + tests/rdfa11/0214.xml | 10 + tests/rdfa11/0216.out | 1 + tests/rdfa11/0216.xml | 31 + tests/rdfa11/0217.out | 2 + tests/rdfa11/0217.xml | 13 + tests/rdfa11/0218.out | 1 + tests/rdfa11/0218.xml | 12 + tests/rdfa11/0219.out | 3 + tests/rdfa11/0219.xml | 12 + tests/rdfa11/0220.out | 4 + tests/rdfa11/0220.xml | 12 + tests/rdfa11/0221.out | 6 + tests/rdfa11/0221.xml | 13 + tests/rdfa11/0222.out | 5 + tests/rdfa11/0222.xml | 13 + tests/rdfa11/0223.out | 6 + tests/rdfa11/0223.xml | 14 + tests/rdfa11/0224.out | 5 + tests/rdfa11/0224.xml | 15 + tests/rdfa11/0225.out | 6 + tests/rdfa11/0225.xml | 15 + tests/rdfa11/0226.out | 7 + tests/rdfa11/0226.xml | 15 + tests/rdfa11/0227.out | 7 + tests/rdfa11/0227.xml | 15 + tests/rdfa11/0228.out | 1 + tests/rdfa11/0228.xml | 16 + tests/rdfa11/0229.out | 1 + tests/rdfa11/0229.xml | 14 + tests/rdfa11/0230.out | 1 + tests/rdfa11/0230.xml | 16 + tests/rdfa11/0231.out | 1 + tests/rdfa11/0231.xml | 12 + tests/rdfa11/0232.out | 3 + tests/rdfa11/0232.xml | 12 + tests/rdfa11/0233.out | 3 + tests/rdfa11/0233.xml | 12 + tests/rdfa11/0234.out | 3 + tests/rdfa11/0234.xml | 14 + tests/rdfa11/0235.out | 1 + tests/rdfa11/0235.xml | 13 + tests/rdfa11/0236.out | 1 + tests/rdfa11/0236.xml | 7 + tests/rdfa11/0237.out | 1 + tests/rdfa11/0237.xml | 12 + tests/rdfa11/0238.out | 1 + tests/rdfa11/0238.xml | 10 + tests/rdfa11/0239.out | 1 + tests/rdfa11/0239.xml | 11 + tests/rdfa11/0246.out | 6 + tests/rdfa11/0246.xml | 13 + tests/rdfa11/0247.out | 6 + tests/rdfa11/0247.xml | 14 + tests/rdfa11/0248.out | 6 + tests/rdfa11/0248.xml | 14 + tests/rdfa11/0249.out | 8 + tests/rdfa11/0249.xml | 14 + tests/rdfa11/0250.out | 2 + tests/rdfa11/0250.xml | 10 + tests/rdfa11/0251.out | 1 + tests/rdfa11/0251.xml | 11 + tests/rdfa11/0252.out | 1 + tests/rdfa11/0252.xml | 11 + tests/rdfa11/0253.out | 1 + tests/rdfa11/0253.xml | 13 + tests/rdfa11/0254.out | 1 + tests/rdfa11/0254.xml | 11 + tests/rdfa11/0255.out | 2 + tests/rdfa11/0255.xml | 11 + tests/rdfa11/0256.out | 1 + tests/rdfa11/0256.xml | 11 + tests/rdfa11/0257.out | 1 + tests/rdfa11/0257.xml | 10 + tests/rdfa11/0258.out | 1 + tests/rdfa11/0258.xml | 14 + tests/rdfa11/0259.out | 31 + tests/rdfa11/0259.xml | 48 + tests/rdfa11/0260.out | 25 + tests/rdfa11/0260.xml | 37 + tests/rdfa11/0261.out | 1 + tests/rdfa11/0261.xml | 14 + tests/rdfa11/0262.out | 1 + tests/rdfa11/0262.xml | 11 + tests/rdfa11/0263.out | 1 + tests/rdfa11/0263.xml | 10 + tests/rdfa11/0264.out | 1 + tests/rdfa11/0264.xml | 10 + tests/rdfa11/0265.out | 1 + tests/rdfa11/0265.xml | 10 + tests/rdfa11/0266.out | 2 + tests/rdfa11/0266.xml | 12 + tests/rdfa11/0267.out | 2 + tests/rdfa11/0267.xml | 12 + tests/rdfa11/0268.out | 2 + tests/rdfa11/0268.xml | 12 + tests/rdfa11/0269.out | 1 + tests/rdfa11/0269.xml | 10 + tests/rdfa11/0271.out | 1 + tests/rdfa11/0271.xml | 10 + tests/rdfa11/0272.out | 1 + tests/rdfa11/0272.xml | 10 + tests/rdfa11/0273.out | 1 + tests/rdfa11/0273.xml | 10 + tests/rdfa11/0274.out | 1 + tests/rdfa11/0274.xml | 10 + tests/rdfa11/0275.out | 1 + tests/rdfa11/0275.xml | 10 + tests/rdfa11/0276.out | 1 + tests/rdfa11/0276.xml | 10 + tests/rdfa11/0277.out | 1 + tests/rdfa11/0277.xml | 10 + tests/rdfa11/0278.out | 1 + tests/rdfa11/0278.xml | 10 + tests/rdfa11/0279.out | 1 + tests/rdfa11/0279.xml | 10 + tests/rdfa11/0280.out | 1 + tests/rdfa11/0280.xml | 10 + tests/rdfa11/0281.out | 1 + tests/rdfa11/0281.xml | 10 + tests/rdfa11/0282.out | 1 + tests/rdfa11/0282.xml | 10 + tests/rdfa11/0283.out | 1 + tests/rdfa11/0283.xml | 10 + tests/rdfa11/0284.out | 1 + tests/rdfa11/0284.xml | 10 + tests/rdfa11/0285.out | 1 + tests/rdfa11/0285.xml | 12 + tests/rdfa11/0286.out | 1 + tests/rdfa11/0286.xml | 12 + tests/rdfa11/0287.out | 1 + tests/rdfa11/0287.xml | 10 + tests/rdfa11/0289.out | 1 + tests/rdfa11/0289.xml | 11 + tests/rdfa11/0290.out | 1 + tests/rdfa11/0290.xml | 11 + tests/rdfa11/0291.out | 1 + tests/rdfa11/0291.xml | 11 + tests/rdfa11/0292.out | 2 + tests/rdfa11/0292.xml | 13 + tests/rdfa11/0293.out | 1 + tests/rdfa11/0293.xml | 13 + tests/rdfa11/0295.out | 495 + tests/rdfa11/0295.xml | 930 + tests/rdfa11/0296.out | 20 + tests/rdfa11/0296.xml | 27 + tests/rdfa11/0297.out | 2 + tests/rdfa11/0297.xml | 10 + tests/rdfa11/0298.out | 2 + tests/rdfa11/0298.xml | 12 + tests/rdfa11/0299.out | 1 + tests/rdfa11/0299.xml | 10 + tests/rdfa11/0300.out | 1 + tests/rdfa11/0300.xml | 10 + tests/rdfa11/0301.out | 4 + tests/rdfa11/0301.xml | 12 + tests/rdfa11/0302.out | 6 + tests/rdfa11/0302.xml | 12 + tests/rdfa11/0303.out | 6 + tests/rdfa11/0303.xml | 13 + tests/rdfa11/0304.out | 2 + tests/rdfa11/0304.xml | 20 + tests/rdfa11/CMakeLists.txt | 1243 ++ tests/rdfa11/Makefile.am | 211 + tests/rdfa11/Makefile.in | 697 + tests/rdfxml/22-rdf-syntax-ns.out | 23 + tests/rdfxml/22-rdf-syntax-ns.rdf | 48 + tests/rdfxml/CMakeLists.txt | 523 + tests/rdfxml/Makefile.am | 469 + tests/rdfxml/Makefile.in | 914 + tests/rdfxml/bad-00.rdf | 14 + tests/rdfxml/bad-01.rdf | 21 + tests/rdfxml/bad-02.rdf | 15 + tests/rdfxml/bad-03.rdf | 15 + tests/rdfxml/bad-04.rdf | 11 + tests/rdfxml/bad-05.rdf | 13 + tests/rdfxml/bad-06.rdf | 12 + tests/rdfxml/bad-07.rdf | 13 + tests/rdfxml/bad-08.rdf | 15 + tests/rdfxml/bad-09.rdf | 15 + tests/rdfxml/bad-10.rdf | 0 tests/rdfxml/bad-11.rdf | 13 + tests/rdfxml/bad-12.rdf | 7 + tests/rdfxml/bad-13.rdf | 11 + tests/rdfxml/bad-14.rdf | 11 + tests/rdfxml/bad-15.rdf | 16 + tests/rdfxml/bad-16.rdf | 16 + tests/rdfxml/bad-17.rdf | 16 + tests/rdfxml/bad-18.rdf | 7 + tests/rdfxml/bad-19.rdf | 10 + tests/rdfxml/bad-20.rdf | 6 + tests/rdfxml/bad-21.rdf | 10 + tests/rdfxml/bad-22.rdf | 11 + tests/rdfxml/bad-23.rdf | 10 + tests/rdfxml/bug-650.out | 1 + tests/rdfxml/bug-650.rdf | 9 + tests/rdfxml/daml-oil.out | 214 + tests/rdfxml/daml-oil.rdf | 492 + tests/rdfxml/ex-00.out | 1 + tests/rdfxml/ex-00.rdf | 6 + tests/rdfxml/ex-01.out | 2 + tests/rdfxml/ex-01.rdf | 6 + tests/rdfxml/ex-02.out | 0 tests/rdfxml/ex-02.rdf | 9 + tests/rdfxml/ex-03.out | 1 + tests/rdfxml/ex-03.rdf | 11 + tests/rdfxml/ex-04.out | 3 + tests/rdfxml/ex-04.rdf | 5 + tests/rdfxml/ex-05.out | 4 + tests/rdfxml/ex-05.rdf | 6 + tests/rdfxml/ex-06.out | 5 + tests/rdfxml/ex-06.rdf | 13 + tests/rdfxml/ex-07.out | 3 + tests/rdfxml/ex-07.rdf | 11 + tests/rdfxml/ex-08.out | 6 + tests/rdfxml/ex-08.rdf | 7 + tests/rdfxml/ex-09.out | 3 + tests/rdfxml/ex-09.rdf | 8 + tests/rdfxml/ex-10.out | 6 + tests/rdfxml/ex-10.rdf | 14 + tests/rdfxml/ex-11.out | 1 + tests/rdfxml/ex-11.rdf | 13 + tests/rdfxml/ex-12.out | 10 + tests/rdfxml/ex-12.rdf | 13 + tests/rdfxml/ex-13.out | 3 + tests/rdfxml/ex-13.rdf | 16 + tests/rdfxml/ex-14.out | 4 + tests/rdfxml/ex-14.rdf | 18 + tests/rdfxml/ex-15.out | 1 + tests/rdfxml/ex-15.rdf | 6 + tests/rdfxml/ex-16.out | 1 + tests/rdfxml/ex-16.rdf | 6 + tests/rdfxml/ex-17.out | 1 + tests/rdfxml/ex-17.rdf | 8 + tests/rdfxml/ex-18.out | 1 + tests/rdfxml/ex-18.rdf | 7 + tests/rdfxml/ex-19.out | 1 + tests/rdfxml/ex-19.rdf | 4 + tests/rdfxml/ex-20.out | 1 + tests/rdfxml/ex-20.rdf | 8 + tests/rdfxml/ex-21.out | 7 + tests/rdfxml/ex-21.rdf | 9 + tests/rdfxml/ex-22.out | 4 + tests/rdfxml/ex-22.rdf | 10 + tests/rdfxml/ex-23.out | 8 + tests/rdfxml/ex-23.rdf | 27 + tests/rdfxml/ex-24.out | 6 + tests/rdfxml/ex-24.rdf | 15 + tests/rdfxml/ex-25.out | 4 + tests/rdfxml/ex-25.rdf | 14 + tests/rdfxml/ex-26.out | 2 + tests/rdfxml/ex-26.rdf | 12 + tests/rdfxml/ex-27.out | 6 + tests/rdfxml/ex-27.rdf | 20 + tests/rdfxml/ex-28.out | 3 + tests/rdfxml/ex-28.rdf | 14 + tests/rdfxml/ex-29.out | 3 + tests/rdfxml/ex-29.rdf | 14 + tests/rdfxml/ex-30.out | 1 + tests/rdfxml/ex-30.rdf | 11 + tests/rdfxml/ex-31.out | 5 + tests/rdfxml/ex-31.rdf | 16 + tests/rdfxml/ex-32.out | 2 + tests/rdfxml/ex-32.rdf | 10 + tests/rdfxml/ex-33.out | 3 + tests/rdfxml/ex-33.rdf | 13 + tests/rdfxml/ex-34.out | 9 + tests/rdfxml/ex-34.rdf | 19 + tests/rdfxml/ex-35.out | 1 + tests/rdfxml/ex-35.rdf | 10 + tests/rdfxml/ex-36.out | 4 + tests/rdfxml/ex-36.rdf | 11 + tests/rdfxml/ex-37.out | 2 + tests/rdfxml/ex-37.rdf | 12 + tests/rdfxml/ex-38-rdfxmla.out | 17 + tests/rdfxml/ex-38.out | 8 + tests/rdfxml/ex-38.rdf | 12 + tests/rdfxml/ex-39.out | 7 + tests/rdfxml/ex-39.rdf | 16 + tests/rdfxml/ex-40.out | 1 + tests/rdfxml/ex-40.rdf | 9 + tests/rdfxml/ex-41.out | 3 + tests/rdfxml/ex-41.rdf | 13 + tests/rdfxml/ex-42.out | 19 + tests/rdfxml/ex-42.rdf | 14 + tests/rdfxml/ex-43.out | 7 + tests/rdfxml/ex-43.rdf | 12 + tests/rdfxml/ex-44.out | 8 + tests/rdfxml/ex-44.rdf | 12 + tests/rdfxml/ex-45.out | 2 + tests/rdfxml/ex-45.rdf | 12 + tests/rdfxml/ex-46.out | 53 + tests/rdfxml/ex-46.rdf | 91 + tests/rdfxml/ex-47.out | 24 + tests/rdfxml/ex-47.rdf | 51 + tests/rdfxml/ex-48.out | 5 + tests/rdfxml/ex-48.rdf | 16 + tests/rdfxml/ex-49.out | 4 + tests/rdfxml/ex-49.rdf | 14 + tests/rdfxml/ex-51.out | 1 + tests/rdfxml/ex-51.rdf | 9 + tests/rdfxml/ex-52.out | 2 + tests/rdfxml/ex-52.svg | 26 + tests/rdfxml/ex-53.out | 1 + tests/rdfxml/ex-53.rdf | 1 + tests/rdfxml/ex-54.out | 1 + tests/rdfxml/ex-54.rdf | 7 + tests/rdfxml/ex-55.out | 2 + tests/rdfxml/ex-55.rdf | 11 + tests/rdfxml/ex-56.out | 1 + tests/rdfxml/ex-56.rdf | 8 + tests/rdfxml/ex-57.out | 1 + tests/rdfxml/ex-57.rdf | 17 + tests/rdfxml/ex-58.out | 3 + tests/rdfxml/ex-58.rdf | 15 + tests/rdfxml/ex-59.nt | 1 + tests/rdfxml/ex-59.rdf | 6 + tests/rdfxml/ex-60.nt | 1 + tests/rdfxml/ex-60.rdf | 6 + tests/rdfxml/ex-61.out | 1 + tests/rdfxml/ex-61.rdf | 4 + tests/rdfxml/ex-62.out | 3 + tests/rdfxml/ex-62.rdf | 24 + tests/rdfxml/ex-63.out | 1 + tests/rdfxml/ex-63.rdf | 11 + tests/rdfxml/owl-schema.out | 160 + tests/rdfxml/owl-schema.rdf | 279 + tests/rdfxml/rdf-schema.out | 129 + tests/rdfxml/rdf-schema.rdf | 187 + tests/rdfxml/rdfs-namespace.out | 132 + tests/rdfxml/rdfs-namespace.rdf | 188 + tests/rdfxml/warn-00.out | 7 + tests/rdfxml/warn-00.rdf | 12 + tests/rdfxml/warn-02.out | 0 tests/rdfxml/warn-02.rdf | 7 + tests/rdfxml/warn-04.out | 2 + tests/rdfxml/warn-04.rdf | 10 + tests/rdfxml/warn-05.out | 1 + tests/rdfxml/warn-05.rdf | 9 + tests/rdfxml/warn-06.out | 1 + tests/rdfxml/warn-06.rdf | 9 + tests/rdfxml/warn-07.out | 2 + tests/rdfxml/warn-07.rdf | 20 + tests/rdfxml/wine.out | 2012 ++ tests/rdfxml/wine.rdf | 2402 +++ tests/trig/CMakeLists.txt | 37 + tests/trig/Makefile.am | 80 + tests/trig/Makefile.in | 570 + tests/trig/bug-584-dos.out | 1 + tests/trig/bug-584-dos.trig | 2 + tests/trig/bug-584-unix.out | 1 + tests/trig/bug-584-unix.trig | 2 + tests/trig/bug370.out | 8 + tests/trig/bug370.trig | 27 + tests/trig/bug451.out | 9 + tests/trig/bug451.trig | 26 + tests/trig/example1.out | 15 + tests/trig/example1.trig | 29 + tests/trig/example2.out | 6 + tests/trig/example2.trig | 11 + tests/trig/example3.out | 6 + tests/trig/example3.trig | 26 + tests/trig/issue-37.out | 2 + tests/trig/issue-37.trig | 1 + tests/turtle-2013/HYPHEN_MINUS_in_localName.nt | 1 + tests/turtle-2013/HYPHEN_MINUS_in_localName.ttl | 2 + tests/turtle-2013/IRIREF_datatype.nt | 1 + tests/turtle-2013/IRIREF_datatype.ttl | 1 + tests/turtle-2013/IRI_spo.nt | 1 + tests/turtle-2013/IRI_subject.nt | 1 + tests/turtle-2013/IRI_subject.ttl | 1 + tests/turtle-2013/IRI_with_all_punctuation.nt | 1 + tests/turtle-2013/IRI_with_all_punctuation.ttl | 1 + .../IRI_with_eight_digit_numeric_escape.nt | 1 + .../IRI_with_eight_digit_numeric_escape.ttl | 1 + .../IRI_with_four_digit_numeric_escape.nt | 1 + .../IRI_with_four_digit_numeric_escape.ttl | 1 + tests/turtle-2013/LITERAL1.nt | 1 + tests/turtle-2013/LITERAL1.ttl | 1 + tests/turtle-2013/LITERAL1_all_controls.nt | 1 + tests/turtle-2013/LITERAL1_all_controls.ttl | Bin 0 -> 77 bytes tests/turtle-2013/LITERAL1_all_punctuation.nt | 1 + tests/turtle-2013/LITERAL1_all_punctuation.ttl | 1 + tests/turtle-2013/LITERAL1_ascii_boundaries.nt | 1 + tests/turtle-2013/LITERAL1_ascii_boundaries.ttl | Bin 0 -> 57 bytes tests/turtle-2013/LITERAL1_with_UTF8_boundaries.nt | 1 + .../turtle-2013/LITERAL1_with_UTF8_boundaries.ttl | 1 + tests/turtle-2013/LITERAL2.nt | 1 + tests/turtle-2013/LITERAL2.ttl | 1 + tests/turtle-2013/LITERAL2_ascii_boundaries.nt | 1 + tests/turtle-2013/LITERAL2_ascii_boundaries.ttl | Bin 0 -> 57 bytes tests/turtle-2013/LITERAL2_with_UTF8_boundaries.nt | 1 + .../turtle-2013/LITERAL2_with_UTF8_boundaries.ttl | 1 + tests/turtle-2013/LITERAL_LONG1.nt | 1 + tests/turtle-2013/LITERAL_LONG1.ttl | 1 + .../turtle-2013/LITERAL_LONG1_ascii_boundaries.nt | 1 + .../turtle-2013/LITERAL_LONG1_ascii_boundaries.ttl | Bin 0 -> 53 bytes tests/turtle-2013/LITERAL_LONG1_with_1_squote.nt | 1 + tests/turtle-2013/LITERAL_LONG1_with_1_squote.ttl | 1 + tests/turtle-2013/LITERAL_LONG1_with_2_squotes.nt | 1 + tests/turtle-2013/LITERAL_LONG1_with_2_squotes.ttl | 1 + .../LITERAL_LONG1_with_UTF8_boundaries.nt | 1 + .../LITERAL_LONG1_with_UTF8_boundaries.ttl | 1 + tests/turtle-2013/LITERAL_LONG2.nt | 1 + tests/turtle-2013/LITERAL_LONG2.ttl | 1 + .../turtle-2013/LITERAL_LONG2_ascii_boundaries.nt | 1 + .../turtle-2013/LITERAL_LONG2_ascii_boundaries.ttl | Bin 0 -> 53 bytes tests/turtle-2013/LITERAL_LONG2_with_1_squote.nt | 1 + tests/turtle-2013/LITERAL_LONG2_with_1_squote.ttl | 1 + tests/turtle-2013/LITERAL_LONG2_with_2_squotes.nt | 1 + tests/turtle-2013/LITERAL_LONG2_with_2_squotes.ttl | 1 + .../LITERAL_LONG2_with_REVERSE_SOLIDUS.nt | 1 + .../LITERAL_LONG2_with_REVERSE_SOLIDUS.ttl | 3 + .../LITERAL_LONG2_with_UTF8_boundaries.nt | 1 + .../LITERAL_LONG2_with_UTF8_boundaries.ttl | 1 + tests/turtle-2013/LITERAL_with_UTF8_boundaries.nt | 1 + tests/turtle-2013/Makefile.am | 603 + tests/turtle-2013/Makefile.in | 1083 + tests/turtle-2013/README | 65 + tests/turtle-2013/SPARQL_style_base.nt | 1 + tests/turtle-2013/SPARQL_style_base.ttl | 2 + tests/turtle-2013/SPARQL_style_prefix.nt | 1 + tests/turtle-2013/SPARQL_style_prefix.ttl | 2 + tests/turtle-2013/anonymous_blank_node_object.nt | 1 + tests/turtle-2013/anonymous_blank_node_object.ttl | 1 + tests/turtle-2013/anonymous_blank_node_subject.nt | 1 + tests/turtle-2013/anonymous_blank_node_subject.ttl | 1 + tests/turtle-2013/bareword_a_predicate.nt | 1 + tests/turtle-2013/bareword_a_predicate.ttl | 1 + tests/turtle-2013/bareword_decimal.nt | 1 + tests/turtle-2013/bareword_decimal.ttl | 1 + tests/turtle-2013/bareword_double.nt | 1 + tests/turtle-2013/bareword_double.ttl | 1 + tests/turtle-2013/bareword_integer.nt | 1 + tests/turtle-2013/bareword_integer.ttl | 1 + .../turtle-2013/blankNodePropertyList_as_object.nt | 2 + .../blankNodePropertyList_as_object.ttl | 1 + .../blankNodePropertyList_as_subject.nt | 2 + .../blankNodePropertyList_as_subject.ttl | 1 + .../blankNodePropertyList_containing_collection.nt | 3 + ...blankNodePropertyList_containing_collection.ttl | 1 + .../blankNodePropertyList_with_multiple_triples.nt | 3 + ...blankNodePropertyList_with_multiple_triples.ttl | 1 + tests/turtle-2013/collection_object.nt | 3 + tests/turtle-2013/collection_object.ttl | 1 + tests/turtle-2013/collection_subject.nt | 3 + tests/turtle-2013/collection_subject.ttl | 1 + tests/turtle-2013/comment_following_PNAME_NS.nt | 1 + tests/turtle-2013/comment_following_PNAME_NS.ttl | 3 + tests/turtle-2013/comment_following_localName.nt | 1 + tests/turtle-2013/comment_following_localName.ttl | 3 + tests/turtle-2013/default_namespace_IRI.nt | 1 + tests/turtle-2013/default_namespace_IRI.ttl | 2 + tests/turtle-2013/double_lower_case_e.nt | 1 + tests/turtle-2013/double_lower_case_e.ttl | 1 + tests/turtle-2013/empty_collection.nt | 1 + tests/turtle-2013/empty_collection.ttl | 1 + tests/turtle-2013/first.nt | 7 + tests/turtle-2013/first.ttl | 1 + tests/turtle-2013/labeled_blank_node_object.nt | 1 + tests/turtle-2013/labeled_blank_node_object.ttl | 1 + tests/turtle-2013/labeled_blank_node_subject.nt | 1 + tests/turtle-2013/labeled_blank_node_subject.ttl | 1 + ...node_with_PN_CHARS_BASE_character_boundaries.nt | 1 + ...ode_with_PN_CHARS_BASE_character_boundaries.ttl | 1 + .../labeled_blank_node_with_leading_digit.nt | 1 + .../labeled_blank_node_with_leading_digit.ttl | 1 + .../labeled_blank_node_with_leading_underscore.nt | 1 + .../labeled_blank_node_with_leading_underscore.ttl | 1 + .../labeled_blank_node_with_non_leading_extras.nt | 1 + .../labeled_blank_node_with_non_leading_extras.ttl | 1 + tests/turtle-2013/langtagged_LONG.nt | 1 + tests/turtle-2013/langtagged_LONG.ttl | 1 + tests/turtle-2013/langtagged_LONG_with_subtag.nt | 1 + tests/turtle-2013/langtagged_LONG_with_subtag.ttl | 3 + tests/turtle-2013/langtagged_non_LONG.nt | 1 + tests/turtle-2013/langtagged_non_LONG.ttl | 1 + tests/turtle-2013/lantag_with_subtag.nt | 1 + tests/turtle-2013/lantag_with_subtag.ttl | 1 + tests/turtle-2013/last.nt | 7 + tests/turtle-2013/last.ttl | 1 + tests/turtle-2013/literal_false.nt | 1 + tests/turtle-2013/literal_false.ttl | 1 + tests/turtle-2013/literal_true.nt | 1 + tests/turtle-2013/literal_true.ttl | 1 + tests/turtle-2013/literal_with_BACKSPACE.nt | 1 + tests/turtle-2013/literal_with_BACKSPACE.ttl | 1 + tests/turtle-2013/literal_with_CARRIAGE_RETURN.nt | 1 + tests/turtle-2013/literal_with_CARRIAGE_RETURN.ttl | 1 + .../literal_with_CHARACTER_TABULATION.nt | 1 + .../literal_with_CHARACTER_TABULATION.ttl | 1 + tests/turtle-2013/literal_with_FORM_FEED.nt | 1 + tests/turtle-2013/literal_with_FORM_FEED.ttl | 1 + tests/turtle-2013/literal_with_LINE_FEED.nt | 1 + tests/turtle-2013/literal_with_LINE_FEED.ttl | 2 + tests/turtle-2013/literal_with_REVERSE_SOLIDUS.nt | 1 + tests/turtle-2013/literal_with_REVERSE_SOLIDUS.ttl | 1 + .../turtle-2013/literal_with_escaped_BACKSPACE.nt | 1 + .../turtle-2013/literal_with_escaped_BACKSPACE.ttl | 1 + .../literal_with_escaped_CARRIAGE_RETURN.nt | 1 + .../literal_with_escaped_CARRIAGE_RETURN.ttl | 1 + .../literal_with_escaped_CHARACTER_TABULATION.nt | 1 + .../literal_with_escaped_CHARACTER_TABULATION.ttl | 1 + .../turtle-2013/literal_with_escaped_FORM_FEED.nt | 1 + .../turtle-2013/literal_with_escaped_FORM_FEED.ttl | 1 + .../turtle-2013/literal_with_escaped_LINE_FEED.nt | 1 + .../turtle-2013/literal_with_escaped_LINE_FEED.ttl | 1 + tests/turtle-2013/literal_with_numeric_escape4.nt | 1 + tests/turtle-2013/literal_with_numeric_escape4.ttl | 1 + tests/turtle-2013/literal_with_numeric_escape8.nt | 1 + tests/turtle-2013/literal_with_numeric_escape8.ttl | 1 + ...Name_with_PN_CHARS_BASE_character_boundaries.nt | 1 + ...igned_nfc_PN_CHARS_BASE_character_boundaries.nt | 1 + ...gned_nfc_PN_CHARS_BASE_character_boundaries.ttl | 2 + ...signed_nfc_bmp_PN_CHARS_BASE_char_boundaries.nt | 1 + ...igned_nfc_bmp_PN_CHARS_BASE_char_boundaries.ttl | 2 + tests/turtle-2013/localName_with_leading_digit.nt | 1 + tests/turtle-2013/localName_with_leading_digit.ttl | 2 + .../localName_with_leading_underscore.nt | 1 + .../localName_with_leading_underscore.ttl | 2 + ..._with_nfc_PN_CHARS_BASE_character_boundaries.nt | 1 + ...with_nfc_PN_CHARS_BASE_character_boundaries.ttl | 2 + .../localName_with_non_leading_extras.nt | 1 + .../localName_with_non_leading_extras.ttl | 2 + tests/turtle-2013/localname_with_COLON.nt | 1 + tests/turtle-2013/localname_with_COLON.ttl | 2 + tests/turtle-2013/negative_numeric.nt | 1 + tests/turtle-2013/negative_numeric.ttl | 1 + tests/turtle-2013/nested_blankNodePropertyLists.nt | 3 + .../turtle-2013/nested_blankNodePropertyLists.ttl | 1 + tests/turtle-2013/nested_collection.nt | 5 + tests/turtle-2013/nested_collection.ttl | 1 + .../turtle-2013/number_sign_following_PNAME_NS.nt | 1 + .../turtle-2013/number_sign_following_PNAME_NS.ttl | 3 + .../turtle-2013/number_sign_following_localName.nt | 1 + .../number_sign_following_localName.ttl | 3 + tests/turtle-2013/numeric_with_leading_0.nt | 1 + tests/turtle-2013/numeric_with_leading_0.ttl | 1 + tests/turtle-2013/objectList_with_two_objects.nt | 2 + tests/turtle-2013/objectList_with_two_objects.ttl | 1 + tests/turtle-2013/old_style_base.nt | 1 + tests/turtle-2013/old_style_base.ttl | 2 + tests/turtle-2013/old_style_prefix.nt | 1 + tests/turtle-2013/old_style_prefix.ttl | 2 + tests/turtle-2013/oops.nt | 5 + tests/turtle-2013/oops.ttl | 9 + tests/turtle-2013/percent_escaped_localName.nt | 1 + tests/turtle-2013/percent_escaped_localName.ttl | 2 + tests/turtle-2013/positive_numeric.nt | 1 + tests/turtle-2013/positive_numeric.ttl | 1 + .../predicateObjectList_with_two_objectLists.nt | 2 + .../predicateObjectList_with_two_objectLists.ttl | 1 + tests/turtle-2013/prefix_only_IRI.nt | 1 + tests/turtle-2013/prefix_only_IRI.ttl | 2 + tests/turtle-2013/prefix_reassigned_and_used.nt | 1 + tests/turtle-2013/prefix_reassigned_and_used.ttl | 3 + ...efix_with_PN_CHARS_BASE_character_boundaries.nt | 1 + ...fix_with_PN_CHARS_BASE_character_boundaries.ttl | 2 + .../turtle-2013/prefix_with_non_leading_extras.nt | 1 + .../turtle-2013/prefix_with_non_leading_extras.ttl | 2 + tests/turtle-2013/prefixed_IRI_object.nt | 1 + tests/turtle-2013/prefixed_IRI_object.ttl | 2 + tests/turtle-2013/prefixed_IRI_predicate.nt | 1 + tests/turtle-2013/prefixed_IRI_predicate.ttl | 2 + tests/turtle-2013/prefixed_name_datatype.nt | 1 + tests/turtle-2013/prefixed_name_datatype.ttl | 2 + tests/turtle-2013/repeated_semis_at_end.nt | 2 + tests/turtle-2013/repeated_semis_at_end.ttl | 1 + tests/turtle-2013/repeated_semis_not_at_end.nt | 1 + tests/turtle-2013/repeated_semis_not_at_end.ttl | 1 + tests/turtle-2013/reserved_escaped_localName.nt | 1 + tests/turtle-2013/reserved_escaped_localName.ttl | 2 + tests/turtle-2013/sole_blankNodePropertyList.nt | 1 + tests/turtle-2013/sole_blankNodePropertyList.ttl | 1 + tests/turtle-2013/turtle-eval-bad-01.ttl | 2 + tests/turtle-2013/turtle-eval-bad-02.ttl | 2 + tests/turtle-2013/turtle-eval-bad-03.ttl | 2 + tests/turtle-2013/turtle-eval-bad-04.ttl | 2 + tests/turtle-2013/turtle-eval-struct-01.nt | 1 + tests/turtle-2013/turtle-eval-struct-01.ttl | 1 + tests/turtle-2013/turtle-eval-struct-02.nt | 2 + tests/turtle-2013/turtle-eval-struct-02.ttl | 4 + tests/turtle-2013/turtle-subm-01.nt | 1 + tests/turtle-2013/turtle-subm-01.ttl | 2 + tests/turtle-2013/turtle-subm-02.nt | 3 + tests/turtle-2013/turtle-subm-02.ttl | 7 + tests/turtle-2013/turtle-subm-03.nt | 3 + tests/turtle-2013/turtle-subm-03.ttl | 5 + tests/turtle-2013/turtle-subm-04.nt | 3 + tests/turtle-2013/turtle-subm-04.ttl | 5 + tests/turtle-2013/turtle-subm-05.nt | 2 + tests/turtle-2013/turtle-subm-05.ttl | 4 + tests/turtle-2013/turtle-subm-06.nt | 4 + tests/turtle-2013/turtle-subm-06.ttl | 4 + tests/turtle-2013/turtle-subm-07.nt | 1 + tests/turtle-2013/turtle-subm-07.ttl | 3 + tests/turtle-2013/turtle-subm-08.nt | 5 + tests/turtle-2013/turtle-subm-08.ttl | 3 + tests/turtle-2013/turtle-subm-09.nt | 1 + tests/turtle-2013/turtle-subm-09.ttl | 3 + tests/turtle-2013/turtle-subm-10.nt | 4 + tests/turtle-2013/turtle-subm-10.ttl | 10 + tests/turtle-2013/turtle-subm-11.nt | 5 + tests/turtle-2013/turtle-subm-11.ttl | 5 + tests/turtle-2013/turtle-subm-12.nt | 4 + tests/turtle-2013/turtle-subm-12.ttl | 10 + tests/turtle-2013/turtle-subm-13.nt | 4 + tests/turtle-2013/turtle-subm-13.ttl | 9 + tests/turtle-2013/turtle-subm-14.nt | 2 + tests/turtle-2013/turtle-subm-14.ttl | 7 + tests/turtle-2013/turtle-subm-15.nt | 1 + tests/turtle-2013/turtle-subm-15.ttl | 6 + tests/turtle-2013/turtle-subm-16.nt | 2 + tests/turtle-2013/turtle-subm-16.ttl | 20 + tests/turtle-2013/turtle-subm-17.nt | 1 + tests/turtle-2013/turtle-subm-17.ttl | 4 + tests/turtle-2013/turtle-subm-18.nt | 2 + tests/turtle-2013/turtle-subm-18.ttl | 6 + tests/turtle-2013/turtle-subm-19.nt | 3 + tests/turtle-2013/turtle-subm-19.ttl | 4 + tests/turtle-2013/turtle-subm-20.nt | 3 + tests/turtle-2013/turtle-subm-20.ttl | 4 + tests/turtle-2013/turtle-subm-21.nt | 1 + tests/turtle-2013/turtle-subm-21.ttl | 3 + tests/turtle-2013/turtle-subm-22.nt | 2 + tests/turtle-2013/turtle-subm-22.ttl | 3 + tests/turtle-2013/turtle-subm-23.nt | 7 + tests/turtle-2013/turtle-subm-23.ttl | 14 + tests/turtle-2013/turtle-subm-24.nt | 1 + tests/turtle-2013/turtle-subm-24.ttl | 4 + tests/turtle-2013/turtle-subm-25.nt | 1 + tests/turtle-2013/turtle-subm-25.ttl | 5 + tests/turtle-2013/turtle-subm-26.nt | 22 + tests/turtle-2013/turtle-subm-26.ttl | 22 + tests/turtle-2013/turtle-subm-27.nt | 5 + tests/turtle-2013/turtle-subm-27.ttl | 12 + ...ntax-bad-LITERAL2_with_langtag_and_datatype.ttl | 1 + tests/turtle-2013/turtle-syntax-bad-base-01.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-base-02.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-base-03.ttl | 3 + .../turtle-syntax-bad-blank-label-dot-end.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-esc-01.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-esc-02.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-esc-03.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-esc-04.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-kw-01.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-kw-02.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-kw-03.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-kw-04.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-kw-05.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-lang-01.ttl | 2 + .../turtle-syntax-bad-ln-dash-start.ttl | 2 + .../turtle-syntax-bad-ln-escape-start.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-ln-escape.ttl | 2 + .../turtle-syntax-bad-missing-ns-dot-end.ttl | 1 + .../turtle-syntax-bad-missing-ns-dot-start.ttl | 1 + .../turtle-2013/turtle-syntax-bad-n3-extras-01.ttl | 5 + .../turtle-2013/turtle-syntax-bad-n3-extras-02.ttl | 4 + .../turtle-2013/turtle-syntax-bad-n3-extras-03.ttl | 7 + .../turtle-2013/turtle-syntax-bad-n3-extras-04.ttl | 5 + .../turtle-2013/turtle-syntax-bad-n3-extras-05.ttl | 4 + .../turtle-2013/turtle-syntax-bad-n3-extras-06.ttl | 4 + .../turtle-2013/turtle-syntax-bad-n3-extras-07.ttl | 3 + .../turtle-2013/turtle-syntax-bad-n3-extras-08.ttl | 3 + .../turtle-2013/turtle-syntax-bad-n3-extras-09.ttl | 3 + .../turtle-2013/turtle-syntax-bad-n3-extras-10.ttl | 3 + .../turtle-2013/turtle-syntax-bad-n3-extras-11.ttl | 3 + .../turtle-2013/turtle-syntax-bad-n3-extras-12.ttl | 3 + .../turtle-2013/turtle-syntax-bad-n3-extras-13.ttl | 3 + tests/turtle-2013/turtle-syntax-bad-ns-dot-end.ttl | 2 + .../turtle-2013/turtle-syntax-bad-ns-dot-start.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-num-01.ttl | 1 + tests/turtle-2013/turtle-syntax-bad-num-02.ttl | 1 + tests/turtle-2013/turtle-syntax-bad-num-03.ttl | 1 + tests/turtle-2013/turtle-syntax-bad-num-04.ttl | 1 + tests/turtle-2013/turtle-syntax-bad-num-05.ttl | 1 + .../turtle-syntax-bad-number-dot-in-anon.ttl | 6 + tests/turtle-2013/turtle-syntax-bad-pname-01.ttl | 3 + tests/turtle-2013/turtle-syntax-bad-pname-02.ttl | 3 + tests/turtle-2013/turtle-syntax-bad-pname-03.ttl | 3 + tests/turtle-2013/turtle-syntax-bad-prefix-01.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-prefix-02.ttl | 3 + tests/turtle-2013/turtle-syntax-bad-prefix-03.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-prefix-04.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-prefix-05.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-string-01.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-string-02.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-string-03.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-string-04.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-string-05.ttl | 4 + tests/turtle-2013/turtle-syntax-bad-string-06.ttl | 3 + tests/turtle-2013/turtle-syntax-bad-string-07.ttl | 3 + tests/turtle-2013/turtle-syntax-bad-struct-01.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-02.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-03.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-04.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-05.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-06.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-07.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-08.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-09.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-10.ttl | 3 + tests/turtle-2013/turtle-syntax-bad-struct-11.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-12.ttl | 1 + tests/turtle-2013/turtle-syntax-bad-struct-13.ttl | 1 + tests/turtle-2013/turtle-syntax-bad-struct-14.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-15.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-16.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-struct-17.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-uri-01.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-uri-02.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-uri-03.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-uri-04.ttl | 2 + tests/turtle-2013/turtle-syntax-bad-uri-05.ttl | 2 + tests/turtle-2013/turtle-syntax-base-01.ttl | 1 + tests/turtle-2013/turtle-syntax-base-02.ttl | 1 + tests/turtle-2013/turtle-syntax-base-03.ttl | 2 + tests/turtle-2013/turtle-syntax-base-04.ttl | 2 + tests/turtle-2013/turtle-syntax-blank-label.nt | 3 + tests/turtle-2013/turtle-syntax-blank-label.ttl | 4 + tests/turtle-2013/turtle-syntax-bnode-01.ttl | 2 + tests/turtle-2013/turtle-syntax-bnode-02.ttl | 2 + tests/turtle-2013/turtle-syntax-bnode-03.ttl | 2 + tests/turtle-2013/turtle-syntax-bnode-04.ttl | 2 + tests/turtle-2013/turtle-syntax-bnode-05.ttl | 2 + tests/turtle-2013/turtle-syntax-bnode-06.ttl | 2 + tests/turtle-2013/turtle-syntax-bnode-07.ttl | 3 + tests/turtle-2013/turtle-syntax-bnode-08.ttl | 2 + tests/turtle-2013/turtle-syntax-bnode-09.ttl | 3 + tests/turtle-2013/turtle-syntax-bnode-10.ttl | 5 + tests/turtle-2013/turtle-syntax-datatypes-01.ttl | 2 + tests/turtle-2013/turtle-syntax-datatypes-02.ttl | 3 + tests/turtle-2013/turtle-syntax-file-01.ttl | 0 tests/turtle-2013/turtle-syntax-file-02.ttl | 1 + tests/turtle-2013/turtle-syntax-file-03.ttl | 2 + tests/turtle-2013/turtle-syntax-kw-01.ttl | 1 + tests/turtle-2013/turtle-syntax-kw-02.ttl | 1 + tests/turtle-2013/turtle-syntax-kw-03.ttl | 2 + tests/turtle-2013/turtle-syntax-lists-01.ttl | 2 + tests/turtle-2013/turtle-syntax-lists-02.ttl | 2 + tests/turtle-2013/turtle-syntax-lists-03.ttl | 2 + tests/turtle-2013/turtle-syntax-lists-04.ttl | 2 + tests/turtle-2013/turtle-syntax-lists-05.ttl | 2 + tests/turtle-2013/turtle-syntax-ln-colons.nt | 5 + tests/turtle-2013/turtle-syntax-ln-colons.ttl | 6 + tests/turtle-2013/turtle-syntax-ln-dots.nt | 3 + tests/turtle-2013/turtle-syntax-ln-dots.ttl | 4 + tests/turtle-2013/turtle-syntax-ns-dots.ttl | 2 + tests/turtle-2013/turtle-syntax-number-01.ttl | 1 + tests/turtle-2013/turtle-syntax-number-02.ttl | 1 + tests/turtle-2013/turtle-syntax-number-03.ttl | 1 + tests/turtle-2013/turtle-syntax-number-04.ttl | 2 + tests/turtle-2013/turtle-syntax-number-05.ttl | 2 + tests/turtle-2013/turtle-syntax-number-06.ttl | 2 + tests/turtle-2013/turtle-syntax-number-07.ttl | 2 + tests/turtle-2013/turtle-syntax-number-08.ttl | 2 + tests/turtle-2013/turtle-syntax-number-09.ttl | 1 + tests/turtle-2013/turtle-syntax-number-10.ttl | 1 + tests/turtle-2013/turtle-syntax-number-11.ttl | 1 + tests/turtle-2013/turtle-syntax-pname-esc-01.ttl | 2 + tests/turtle-2013/turtle-syntax-pname-esc-02.ttl | 2 + tests/turtle-2013/turtle-syntax-pname-esc-03.ttl | 2 + tests/turtle-2013/turtle-syntax-prefix-01.ttl | 1 + tests/turtle-2013/turtle-syntax-prefix-02.ttl | 1 + tests/turtle-2013/turtle-syntax-prefix-03.ttl | 2 + tests/turtle-2013/turtle-syntax-prefix-04.ttl | 2 + tests/turtle-2013/turtle-syntax-prefix-05.ttl | 2 + tests/turtle-2013/turtle-syntax-prefix-06.ttl | 4 + tests/turtle-2013/turtle-syntax-prefix-07.ttl | 3 + tests/turtle-2013/turtle-syntax-prefix-08.ttl | 3 + tests/turtle-2013/turtle-syntax-prefix-09.ttl | 4 + tests/turtle-2013/turtle-syntax-str-esc-01.ttl | 1 + tests/turtle-2013/turtle-syntax-str-esc-02.ttl | 1 + tests/turtle-2013/turtle-syntax-str-esc-03.ttl | 1 + tests/turtle-2013/turtle-syntax-string-01.ttl | 1 + tests/turtle-2013/turtle-syntax-string-02.ttl | 1 + tests/turtle-2013/turtle-syntax-string-03.ttl | 1 + tests/turtle-2013/turtle-syntax-string-04.ttl | 1 + tests/turtle-2013/turtle-syntax-string-05.ttl | 1 + tests/turtle-2013/turtle-syntax-string-06.ttl | 1 + tests/turtle-2013/turtle-syntax-string-07.ttl | 1 + tests/turtle-2013/turtle-syntax-string-08.ttl | 2 + tests/turtle-2013/turtle-syntax-string-09.ttl | 2 + tests/turtle-2013/turtle-syntax-string-10.ttl | 2 + tests/turtle-2013/turtle-syntax-string-11.ttl | 2 + tests/turtle-2013/turtle-syntax-struct-01.ttl | 2 + tests/turtle-2013/turtle-syntax-struct-02.ttl | 3 + tests/turtle-2013/turtle-syntax-struct-03.ttl | 4 + tests/turtle-2013/turtle-syntax-struct-04.ttl | 4 + tests/turtle-2013/turtle-syntax-struct-05.ttl | 4 + tests/turtle-2013/turtle-syntax-uri-01.ttl | 1 + tests/turtle-2013/turtle-syntax-uri-02.ttl | 2 + tests/turtle-2013/turtle-syntax-uri-03.ttl | 2 + tests/turtle-2013/turtle-syntax-uri-04.ttl | 3 + tests/turtle-2013/two_LITERAL_LONG2s.nt | 2 + tests/turtle-2013/two_LITERAL_LONG2s.ttl | 4 + tests/turtle-2013/underscore_in_localName.nt | 1 + tests/turtle-2013/underscore_in_localName.ttl | 2 + tests/turtle/Makefile.am | 295 + tests/turtle/Makefile.in | 768 + tests/turtle/README.txt | 20 + tests/turtle/bad-00.ttl | 2 + tests/turtle/bad-01.ttl | 3 + tests/turtle/bad-02.ttl | 3 + tests/turtle/bad-03.ttl | 3 + tests/turtle/bad-04.ttl | 3 + tests/turtle/bad-05.ttl | 4 + tests/turtle/bad-06.ttl | 3 + tests/turtle/bad-07.ttl | 4 + tests/turtle/bad-08.ttl | 2 + tests/turtle/bad-09.ttl | 3 + tests/turtle/bad-10.ttl | 3 + tests/turtle/bad-11.ttl | 3 + tests/turtle/bad-12.ttl | 3 + tests/turtle/bad-13.ttl | 3 + tests/turtle/bad-14.ttl | 6 + tests/turtle/bad-15.out | 1 + tests/turtle/bad-15.ttl | 2 + tests/turtle/bad-16.ttl | 1 + tests/turtle/bad-17.out | 1 + tests/turtle/bad-17.ttl | 3 + tests/turtle/bad-18.out | 1 + tests/turtle/bad-18.ttl | 3 + tests/turtle/bad-19.ttl | 3 + tests/turtle/bad-20.ttl | 3 + tests/turtle/bad-21.out | 0 tests/turtle/bad-21.ttl | 2 + tests/turtle/bad-22.out | 1 + tests/turtle/bad-22.ttl | 3 + tests/turtle/bad-23.ttl | 7 + tests/turtle/bad-24.ttl | 1 + tests/turtle/ex-38-turtle.out | 17 + tests/turtle/ex-62.rdf | 19 + tests/turtle/manifest-bad.ttl | 123 + tests/turtle/manifest.ttl | 263 + tests/turtle/rdf-schema.out | 124 + tests/turtle/rdf-schema.ttl | 154 + tests/turtle/rdfq-results.out | 36 + tests/turtle/rdfq-results.ttl | 39 + tests/turtle/rdfs-namespace.out | 131 + tests/turtle/rdfs-namespace.ttl | 160 + tests/turtle/test-00.out | 1 + tests/turtle/test-00.ttl | 2 + tests/turtle/test-01.out | 3 + tests/turtle/test-01.ttl | 7 + tests/turtle/test-02.out | 3 + tests/turtle/test-02.ttl | 5 + tests/turtle/test-03.out | 3 + tests/turtle/test-03.ttl | 5 + tests/turtle/test-04.out | 2 + tests/turtle/test-04.ttl | 4 + tests/turtle/test-05.out | 4 + tests/turtle/test-05.ttl | 4 + tests/turtle/test-06.out | 1 + tests/turtle/test-06.ttl | 3 + tests/turtle/test-07.out | 5 + tests/turtle/test-07.ttl | 3 + tests/turtle/test-08.out | 1 + tests/turtle/test-08.ttl | 3 + tests/turtle/test-09.out | 4 + tests/turtle/test-09.ttl | 10 + tests/turtle/test-10.out | 5 + tests/turtle/test-10.ttl | 5 + tests/turtle/test-11.out | 4 + tests/turtle/test-11.ttl | 10 + tests/turtle/test-12.out | 4 + tests/turtle/test-12.ttl | 9 + tests/turtle/test-13.out | 2 + tests/turtle/test-13.ttl | 7 + tests/turtle/test-14.out | 10000 +++++++++ tests/turtle/test-14.ttl | 10002 +++++++++ tests/turtle/test-15.out | 10000 +++++++++ tests/turtle/test-15.ttl | 3 + tests/turtle/test-16.out | 10000 +++++++++ tests/turtle/test-16.ttl | 10002 +++++++++ tests/turtle/test-17.out | 1 + tests/turtle/test-17.ttl | 6 + tests/turtle/test-18.out | 2 + tests/turtle/test-18.ttl | 9 + tests/turtle/test-19.out | 1 + tests/turtle/test-19.ttl | 4 + tests/turtle/test-20.out | 2 + tests/turtle/test-20.ttl | 6 + tests/turtle/test-21.out | 3 + tests/turtle/test-21.ttl | 4 + tests/turtle/test-22.out | 3 + tests/turtle/test-22.ttl | 4 + tests/turtle/test-23.out | 1 + tests/turtle/test-23.ttl | 3 + tests/turtle/test-24.out | 2 + tests/turtle/test-24.ttl | 3 + tests/turtle/test-25.out | 7 + tests/turtle/test-25.ttl | 14 + tests/turtle/test-26.out | 1 + tests/turtle/test-26.ttl | 4 + tests/turtle/test-27.out | 1 + tests/turtle/test-27.ttl | 5 + tests/turtle/test-28-out.ttl | 6 + tests/turtle/test-28.out | 22 + tests/turtle/test-28.ttl | 22 + tests/turtle/test-29.out | 1 + tests/turtle/test-29.ttl | 1 + tests/turtle/test-30.out | 5 + tests/turtle/test-30.ttl | 12 + tests/turtle/test-31-out.ttl | 10 + tests/turtle/test-31.ttl | 10 + tests/turtle/test-32-out.ttl | 8 + tests/turtle/test-32.ttl | 5 + tests/turtle/test-33.out | 1 + tests/turtle/test-33.ttl | 3 + tests/turtle/test-34-out.ttl | 7 + tests/turtle/test-34.ttl | 4 + tests/turtle/test-36.out | 2 + tests/turtle/test-36.ttl | 4 + tests/turtle/test-37.out | 1 + tests/turtle/test-37.ttl | 3 + tests/turtle/test-38.out | 1 + tests/turtle/test-38.ttl | 5 + tests/turtle/test-39-out.ttl | 6 + tests/turtle/test-39.ttl | 3 + utils/CMakeLists.txt | 26 + utils/Makefile.am | 91 + utils/Makefile.in | 877 + utils/getopt.c | 157 + utils/rapper.1 | 192 + utils/rapper.c | 972 + utils/rapper.html | 0 utils/raptor_getopt.h | 21 + utils/rdfdiff.c | 1069 + 1971 files changed, 271019 insertions(+) create mode 100644 AUTHORS create mode 100644 CMakeLists.txt create mode 100644 COPYING create mode 100644 COPYING.LIB create mode 100644 ChangeLog create mode 100644 INSTALL create mode 100644 INSTALL.html create mode 100644 LICENSE-2.0.txt create mode 100644 LICENSE.html create mode 100644 LICENSE.txt create mode 100644 Makefile.am create mode 100644 Makefile.in create mode 100644 NEWS create mode 100644 NEWS.html create mode 100644 NOTICE create mode 100644 README create mode 100644 README-cmake.md create mode 100644 README.html create mode 100644 RELEASE.html create mode 100644 UPGRADING.html create mode 100644 aclocal.m4 create mode 100755 autogen.sh create mode 100755 build/ar-lib create mode 100755 build/compile create mode 100755 build/config.guess create mode 100755 build/config.sub create mode 100755 build/depcomp create mode 100644 build/gtk-doc.m4 create mode 100755 build/install-sh create mode 100644 build/libtool.m4 create mode 100755 build/ltmain.sh create mode 100644 build/ltoptions.m4 create mode 100644 build/ltsugar.m4 create mode 100644 build/ltversion.m4 create mode 100644 build/lt~obsolete.m4 create mode 100755 build/missing create mode 100644 build/pkg.m4 create mode 100755 build/test-driver create mode 100755 configure create mode 100644 configure.ac create mode 100644 data/Makefile.am create mode 100644 data/Makefile.in create mode 100644 data/dc.rdf create mode 100644 docs/Makefile.am create mode 100644 docs/Makefile.in create mode 100644 docs/html/home.png create mode 100644 docs/html/index.html create mode 100644 docs/html/introduction.html create mode 100644 docs/html/ix01.html create mode 100644 docs/html/left-insensitive.png create mode 100644 docs/html/left.png create mode 100644 docs/html/parser-grddl.html create mode 100644 docs/html/parser-guess.html create mode 100644 docs/html/parser-json.html create mode 100644 docs/html/parser-ntriples.html create mode 100644 docs/html/parser-rdfa.html create mode 100644 docs/html/parser-rdfxml.html create mode 100644 docs/html/parser-rss-tag-soup.html create mode 100644 docs/html/parser-trig.html create mode 100644 docs/html/parser-turtle.html create mode 100644 docs/html/raptor-formats-types-by-parser.html create mode 100644 docs/html/raptor-formats-types-by-serializer.html create mode 100644 docs/html/raptor-formats-types-index.html create mode 100644 docs/html/raptor-formats.html create mode 100644 docs/html/raptor-parsers.html create mode 100644 docs/html/raptor-serializers.html create mode 100644 docs/html/raptor2-changes-1-4-21-to-2-0-0.html create mode 100644 docs/html/raptor2-changes-2-0-10-to-2-0-11.html create mode 100644 docs/html/raptor2-changes-2-0-11-to-2-0-12.html create mode 100644 docs/html/raptor2-changes-2-0-13-to-2-0-14.html create mode 100644 docs/html/raptor2-changes-2-0-14-to-2-0-15.html create mode 100644 docs/html/raptor2-changes-2-0-15-to-2-0-16.html create mode 100644 docs/html/raptor2-changes-2-0-3-to-2-0-4.html create mode 100644 docs/html/raptor2-changes-2-0-4-to-2-0-5.html create mode 100644 docs/html/raptor2-changes-2-0-5-to-2-0-6.html create mode 100644 docs/html/raptor2-changes-2-0-6-to-2-0-7.html create mode 100644 docs/html/raptor2-changes-2-0-7-to-2-0-8.html create mode 100644 docs/html/raptor2-changes-2-0-9-to-2-0-10.html create mode 100644 docs/html/raptor2-changes.html create mode 100644 docs/html/raptor2-section-avltree.html create mode 100644 docs/html/raptor2-section-constants.html create mode 100644 docs/html/raptor2-section-general.html create mode 100644 docs/html/raptor2-section-iostream.html create mode 100644 docs/html/raptor2-section-locator.html create mode 100644 docs/html/raptor2-section-memory.html create mode 100644 docs/html/raptor2-section-option.html create mode 100644 docs/html/raptor2-section-parser.html create mode 100644 docs/html/raptor2-section-sax2.html create mode 100644 docs/html/raptor2-section-sequence.html create mode 100644 docs/html/raptor2-section-serializer.html create mode 100644 docs/html/raptor2-section-stringbuffer.html create mode 100644 docs/html/raptor2-section-triples.html create mode 100644 docs/html/raptor2-section-unicode.html create mode 100644 docs/html/raptor2-section-uri.html create mode 100644 docs/html/raptor2-section-world.html create mode 100644 docs/html/raptor2-section-www.html create mode 100644 docs/html/raptor2-section-xml-namespace.html create mode 100644 docs/html/raptor2-section-xml-qname.html create mode 100644 docs/html/raptor2-section-xml.html create mode 100644 docs/html/raptor2.devhelp2 create mode 100644 docs/html/reference-manual.html create mode 100644 docs/html/restrict-parser-network-access.html create mode 100644 docs/html/right-insensitive.png create mode 100644 docs/html/right.png create mode 100644 docs/html/serializer-atom.html create mode 100644 docs/html/serializer-dot.html create mode 100644 docs/html/serializer-json.html create mode 100644 docs/html/serializer-mkr.html create mode 100644 docs/html/serializer-nquads.html create mode 100644 docs/html/serializer-ntriples.html create mode 100644 docs/html/serializer-rdfxml-abbrev.html create mode 100644 docs/html/serializer-rdfxml-xmp.html create mode 100644 docs/html/serializer-rdfxml.html create mode 100644 docs/html/serializer-rss-1-0.html create mode 100644 docs/html/serializer-turtle.html create mode 100644 docs/html/style.css create mode 100644 docs/html/tutorial-initialising-finishing.html create mode 100644 docs/html/tutorial-parse-strictness.html create mode 100644 docs/html/tutorial-parser-abort.html create mode 100644 docs/html/tutorial-parser-content.html create mode 100644 docs/html/tutorial-parser-create.html create mode 100644 docs/html/tutorial-parser-destroy.html create mode 100644 docs/html/tutorial-parser-example.html create mode 100644 docs/html/tutorial-parser-features.html create mode 100644 docs/html/tutorial-parser-runtime-info.html create mode 100644 docs/html/tutorial-parser-set-error-warning-handlers.html create mode 100644 docs/html/tutorial-parser-set-id-handler.html create mode 100644 docs/html/tutorial-parser-set-namespace-handler.html create mode 100644 docs/html/tutorial-parser-set-triple-handler.html create mode 100644 docs/html/tutorial-parser-static-info.html create mode 100644 docs/html/tutorial-parsing.html create mode 100644 docs/html/tutorial-querying-functionality.html create mode 100644 docs/html/tutorial-serializer-create.html create mode 100644 docs/html/tutorial-serializer-declare-namespace.html create mode 100644 docs/html/tutorial-serializer-destroy.html create mode 100644 docs/html/tutorial-serializer-example.html create mode 100644 docs/html/tutorial-serializer-features.html create mode 100644 docs/html/tutorial-serializer-get-triples.html create mode 100644 docs/html/tutorial-serializer-runtime-info.html create mode 100644 docs/html/tutorial-serializer-send-triples.html create mode 100644 docs/html/tutorial-serializer-set-error-warning-handlers.html create mode 100644 docs/html/tutorial-serializer-to-destination.html create mode 100644 docs/html/tutorial-serializing.html create mode 100644 docs/html/tutorial.html create mode 100644 docs/html/up-insensitive.png create mode 100644 docs/html/up.png create mode 100644 docs/libraptor2.3 create mode 100644 docs/libraptor2.html create mode 100644 docs/raptor-changes.tsv create mode 100644 docs/raptor-changes.xml create mode 100644 docs/raptor-docs.xml create mode 100644 docs/raptor-formats.xml create mode 100644 docs/raptor-parsers.xml create mode 100644 docs/raptor-serializers.xml create mode 100644 docs/raptor-tutorial-intro.xml create mode 100644 docs/raptor-tutorial-parsing.xml create mode 100644 docs/raptor-tutorial-querying-functionality.xml create mode 100644 docs/raptor-tutorial-serializing.xml create mode 100644 docs/raptor1-eol.html create mode 100644 docs/raptor2-overrides.txt create mode 100644 docs/raptor2-sections.txt create mode 100644 docs/raptor2.types create mode 100644 docs/rdfcat.c create mode 100644 docs/rdfprint.c create mode 100644 docs/rdfserialize.c create mode 100644 docs/upgrade-script.pl create mode 100644 docs/version.xml create mode 100644 docs/version.xml.in create mode 100644 examples/Makefile.am create mode 100644 examples/Makefile.in create mode 100644 examples/grapper.c create mode 100644 examples/raptor_abort.c create mode 100644 examples/rdfcat.c create mode 100644 examples/rdfcount.c create mode 100644 examples/rdfguess.c create mode 100644 examples/rdfprint.c create mode 100644 examples/rdfserialize.c create mode 100644 gtk-doc.make create mode 100644 librdfa/Makefile.am create mode 100644 librdfa/Makefile.in create mode 100644 librdfa/config.h create mode 100644 librdfa/context.c create mode 100644 librdfa/curie.c create mode 100644 librdfa/iri.c create mode 100644 librdfa/language.c create mode 100644 librdfa/lists.c create mode 100644 librdfa/namespace.c create mode 100644 librdfa/rdfa.c create mode 100644 librdfa/rdfa.h create mode 100644 librdfa/rdfa_utils.c create mode 100644 librdfa/rdfa_utils.h create mode 100644 librdfa/strtok_r.c create mode 100644 librdfa/strtok_r.h create mode 100644 librdfa/subject.c create mode 100644 librdfa/triple.c create mode 100644 raptor2.pc.in create mode 100644 raptor2.rdf.in create mode 100644 raptor2.spec.in create mode 100644 scripts/Makefile.am create mode 100644 scripts/Makefile.in create mode 100644 scripts/build-formats.c create mode 100755 scripts/fix-bison.pl create mode 100755 scripts/fix-flex.pl create mode 100755 scripts/fix-groff-xhtml.pl create mode 100755 scripts/fix-gtkdoc-header.pl create mode 100755 scripts/process-changes.pl create mode 100755 scripts/rdfcompare create mode 100644 src/CMakeLists.txt create mode 100644 src/Makefile.am create mode 100644 src/Makefile.in create mode 100644 src/ntriples_parse.c create mode 100644 src/parsedate.c create mode 100644 src/parsedate.h create mode 100644 src/parsedate.y create mode 100644 src/raptor.h create mode 100644 src/raptor2.h.in create mode 100644 src/raptor_abbrev.c create mode 100644 src/raptor_avltree.c create mode 100644 src/raptor_concepts.c create mode 100644 src/raptor_config.h.in create mode 100644 src/raptor_config_cmake.h.in create mode 100644 src/raptor_escaped.c create mode 100644 src/raptor_general.c create mode 100644 src/raptor_grddl.c create mode 100644 src/raptor_guess.c create mode 100644 src/raptor_internal.h create mode 100644 src/raptor_iostream.c create mode 100644 src/raptor_json.c create mode 100644 src/raptor_json_writer.c create mode 100644 src/raptor_librdfa.c create mode 100644 src/raptor_libxml.c create mode 100644 src/raptor_locator.c create mode 100644 src/raptor_log.c create mode 100644 src/raptor_memstr.c create mode 100644 src/raptor_namespace.c create mode 100644 src/raptor_nfc_icu.c create mode 100644 src/raptor_nfc_test.c create mode 100644 src/raptor_ntriples.c create mode 100644 src/raptor_option.c create mode 100644 src/raptor_parse.c create mode 100644 src/raptor_permute_test.c create mode 100644 src/raptor_qname.c create mode 100644 src/raptor_rdfxml.c create mode 100644 src/raptor_rfc2396.c create mode 100644 src/raptor_rss.c create mode 100644 src/raptor_rss.h create mode 100644 src/raptor_rss_common.c create mode 100644 src/raptor_sax2.c create mode 100644 src/raptor_sequence.c create mode 100644 src/raptor_serialize.c create mode 100644 src/raptor_serialize_dot.c create mode 100644 src/raptor_serialize_html.c create mode 100644 src/raptor_serialize_json.c create mode 100644 src/raptor_serialize_ntriples.c create mode 100644 src/raptor_serialize_rdfxml.c create mode 100644 src/raptor_serialize_rdfxmla.c create mode 100644 src/raptor_serialize_rss.c create mode 100644 src/raptor_serialize_turtle.c create mode 100644 src/raptor_set.c create mode 100644 src/raptor_statement.c create mode 100644 src/raptor_stringbuffer.c create mode 100644 src/raptor_syntax_description.c create mode 100644 src/raptor_term.c create mode 100644 src/raptor_turtle_writer.c create mode 100644 src/raptor_unicode.c create mode 100644 src/raptor_uri.c create mode 100644 src/raptor_win32.c create mode 100644 src/raptor_www.c create mode 100644 src/raptor_www_curl.c create mode 100644 src/raptor_www_libfetch.c create mode 100644 src/raptor_www_libxml.c create mode 100644 src/raptor_www_test.c create mode 100644 src/raptor_xml.c create mode 100644 src/raptor_xml_writer.c create mode 100644 src/snprintf.c create mode 100644 src/sort_r.c create mode 100644 src/sort_r.h create mode 100644 src/ssort.h create mode 100644 src/strcasecmp.c create mode 100644 src/turtle_common.c create mode 100644 src/turtle_common.h create mode 100644 src/turtle_lexer.c create mode 100644 src/turtle_lexer.h create mode 100644 src/turtle_lexer.l create mode 100644 src/turtle_parser.c create mode 100644 src/turtle_parser.h create mode 100644 src/turtle_parser.y create mode 100644 tests/Makefile.am create mode 100644 tests/Makefile.in create mode 100644 tests/empty.c create mode 100644 tests/feeds/CMakeLists.txt create mode 100644 tests/feeds/Makefile.am create mode 100644 tests/feeds/Makefile.in create mode 100644 tests/feeds/atom.rnc create mode 100644 tests/feeds/atom.rng create mode 100644 tests/feeds/test01-result.atom create mode 100644 tests/feeds/test01-result.ttl create mode 100644 tests/feeds/test01.rdf create mode 100644 tests/feeds/test02-result.atom create mode 100644 tests/feeds/test02-result.ttl create mode 100644 tests/feeds/test02.rdf create mode 100644 tests/feeds/test03-result.atom create mode 100644 tests/feeds/test03-result.ttl create mode 100644 tests/feeds/test03.rdf create mode 100644 tests/feeds/test04-result.ttl create mode 100644 tests/feeds/test04.atom create mode 100644 tests/feeds/test05-result.ttl create mode 100644 tests/feeds/test05.atom create mode 100644 tests/grddl/CMakeLists.txt create mode 100644 tests/grddl/Makefile.am create mode 100644 tests/grddl/Makefile.in create mode 100644 tests/grddl/data-01.nt create mode 100644 tests/grddl/data-01.rdf create mode 100644 tests/grddl/data-02.rdf create mode 100644 tests/grddl/test-01.html create mode 100644 tests/grddl/test-01.out create mode 100644 tests/json/CMakeLists.txt create mode 100644 tests/json/Makefile.am create mode 100644 tests/json/Makefile.in create mode 100644 tests/json/bad-00.json create mode 100644 tests/json/bad-01.json create mode 100644 tests/json/bad-02.json create mode 100644 tests/json/bad-03.json create mode 100644 tests/json/bad-04.json create mode 100644 tests/json/bad-05.json create mode 100644 tests/json/bad-06.json create mode 100644 tests/json/bad-07.json create mode 100644 tests/json/bad-08.json create mode 100644 tests/json/bad-09.json create mode 100644 tests/json/bad-10.json create mode 100644 tests/json/bad-11.json create mode 100644 tests/json/bad-12.json create mode 100644 tests/json/bad-13.json create mode 100644 tests/json/example1.json create mode 100644 tests/json/example1.nt create mode 100644 tests/json/example2.json create mode 100644 tests/json/example2.nt create mode 100644 tests/json/example3.json create mode 100644 tests/json/example3.nt create mode 100644 tests/json/example4.json create mode 100644 tests/json/example4.nt create mode 100644 tests/mkr/Makefile.am create mode 100644 tests/mkr/Makefile.in create mode 100644 tests/mkr/README.txt create mode 100644 tests/mkr/rdf-schema.mkr create mode 100644 tests/mkr/rdf-schema.ttl create mode 100644 tests/mkr/rdfq-results.mkr create mode 100644 tests/mkr/rdfq-results.ttl create mode 100644 tests/mkr/rdfs-namespace.mkr create mode 100644 tests/mkr/rdfs-namespace.ttl create mode 100644 tests/mkr/test-07.mkr create mode 100644 tests/mkr/test-07.ttl create mode 100644 tests/mkr/test-08.mkr create mode 100644 tests/mkr/test-08.ttl create mode 100644 tests/mkr/test-16a.mkr create mode 100644 tests/mkr/test-16a.ttl create mode 100644 tests/mkr/test-28.mkr create mode 100644 tests/mkr/test-28.ttl create mode 100644 tests/mkr/test-31.mkr create mode 100644 tests/mkr/test-31.ttl create mode 100644 tests/mkr/test-32.mkr create mode 100644 tests/mkr/test-32.ttl create mode 100644 tests/mkr/test-34.mkr create mode 100644 tests/mkr/test-34.ttl create mode 100644 tests/nquads-2013/Makefile.am create mode 100644 tests/nquads-2013/Makefile.in create mode 100644 tests/nquads-2013/README create mode 100644 tests/nquads-2013/comment_following_triple.nq create mode 100644 tests/nquads-2013/langtagged_string.nq create mode 100644 tests/nquads-2013/lantag_with_subtag.nq create mode 100644 tests/nquads-2013/literal.nq create mode 100644 tests/nquads-2013/literal_all_controls.nq create mode 100644 tests/nquads-2013/literal_all_punctuation.nq create mode 100644 tests/nquads-2013/literal_ascii_boundaries.nq create mode 100644 tests/nquads-2013/literal_false.nq create mode 100644 tests/nquads-2013/literal_true.nq create mode 100644 tests/nquads-2013/literal_with_2_dquotes.nq create mode 100644 tests/nquads-2013/literal_with_2_squotes.nq create mode 100644 tests/nquads-2013/literal_with_BACKSPACE.nq create mode 100644 tests/nquads-2013/literal_with_CARRIAGE_RETURN.nq create mode 100644 tests/nquads-2013/literal_with_CHARACTER_TABULATION.nq create mode 100644 tests/nquads-2013/literal_with_FORM_FEED.nq create mode 100644 tests/nquads-2013/literal_with_LINE_FEED.nq create mode 100644 tests/nquads-2013/literal_with_REVERSE_SOLIDUS.nq create mode 100644 tests/nquads-2013/literal_with_REVERSE_SOLIDUS2.nq create mode 100644 tests/nquads-2013/literal_with_UTF8_boundaries.nq create mode 100644 tests/nquads-2013/literal_with_dquote.nq create mode 100644 tests/nquads-2013/literal_with_numeric_escape4.nq create mode 100644 tests/nquads-2013/literal_with_numeric_escape8.nq create mode 100644 tests/nquads-2013/literal_with_squote.nq create mode 100644 tests/nquads-2013/minimal_whitespace.nq create mode 100644 tests/nquads-2013/nq-syntax-bad-literal-01.nq create mode 100644 tests/nquads-2013/nq-syntax-bad-literal-02.nq create mode 100644 tests/nquads-2013/nq-syntax-bad-literal-03.nq create mode 100644 tests/nquads-2013/nq-syntax-bad-quint-01.nq create mode 100644 tests/nquads-2013/nq-syntax-bad-uri-01.nq create mode 100644 tests/nquads-2013/nq-syntax-bnode-01.nq create mode 100644 tests/nquads-2013/nq-syntax-bnode-02.nq create mode 100644 tests/nquads-2013/nq-syntax-bnode-03.nq create mode 100644 tests/nquads-2013/nq-syntax-bnode-04.nq create mode 100644 tests/nquads-2013/nq-syntax-bnode-05.nq create mode 100644 tests/nquads-2013/nq-syntax-bnode-06.nq create mode 100644 tests/nquads-2013/nq-syntax-uri-01.nq create mode 100644 tests/nquads-2013/nq-syntax-uri-02.nq create mode 100644 tests/nquads-2013/nq-syntax-uri-03.nq create mode 100644 tests/nquads-2013/nq-syntax-uri-04.nq create mode 100644 tests/nquads-2013/nq-syntax-uri-05.nq create mode 100644 tests/nquads-2013/nq-syntax-uri-06.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-base-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-esc-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-esc-02.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-esc-03.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-lang-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-num-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-num-02.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-num-03.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-prefix-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-string-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-string-02.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-string-03.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-string-04.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-string-05.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-string-06.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-string-07.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-struct-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-struct-02.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-02.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-03.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-04.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-05.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-06.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-07.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-08.nq create mode 100644 tests/nquads-2013/nt-syntax-bad-uri-09.nq create mode 100644 tests/nquads-2013/nt-syntax-bnode-01.nq create mode 100644 tests/nquads-2013/nt-syntax-bnode-02.nq create mode 100644 tests/nquads-2013/nt-syntax-bnode-03.nq create mode 100644 tests/nquads-2013/nt-syntax-datatypes-01.nq create mode 100644 tests/nquads-2013/nt-syntax-datatypes-02.nq create mode 100644 tests/nquads-2013/nt-syntax-file-01.nq create mode 100644 tests/nquads-2013/nt-syntax-file-02.nq create mode 100644 tests/nquads-2013/nt-syntax-file-03.nq create mode 100644 tests/nquads-2013/nt-syntax-str-esc-01.nq create mode 100644 tests/nquads-2013/nt-syntax-str-esc-02.nq create mode 100644 tests/nquads-2013/nt-syntax-str-esc-03.nq create mode 100644 tests/nquads-2013/nt-syntax-string-01.nq create mode 100644 tests/nquads-2013/nt-syntax-string-02.nq create mode 100644 tests/nquads-2013/nt-syntax-string-03.nq create mode 100644 tests/nquads-2013/nt-syntax-subm-01.nq create mode 100644 tests/nquads-2013/nt-syntax-uri-01.nq create mode 100644 tests/nquads-2013/nt-syntax-uri-02.nq create mode 100644 tests/nquads-2013/nt-syntax-uri-03.nq create mode 100644 tests/nquads-2013/nt-syntax-uri-04.nq create mode 100644 tests/ntriples-2013/LITERAL.nt create mode 100644 tests/ntriples-2013/LITERAL_all_controls.nt create mode 100644 tests/ntriples-2013/LITERAL_all_punctuation.nt create mode 100644 tests/ntriples-2013/LITERAL_ascii_boundaries.nt create mode 100644 tests/ntriples-2013/LITERAL_with_2_dquotes.nt create mode 100644 tests/ntriples-2013/LITERAL_with_2_squotes.nt create mode 100644 tests/ntriples-2013/LITERAL_with_UTF8_boundaries.nt create mode 100644 tests/ntriples-2013/LITERAL_with_dquote.nt create mode 100644 tests/ntriples-2013/LITERAL_with_squote.nt create mode 100644 tests/ntriples-2013/Makefile.am create mode 100644 tests/ntriples-2013/Makefile.in create mode 100644 tests/ntriples-2013/README create mode 100644 tests/ntriples-2013/comment_following_triple.nt create mode 100644 tests/ntriples-2013/langtagged_string.nt create mode 100644 tests/ntriples-2013/lantag_with_subtag.nt create mode 100644 tests/ntriples-2013/literal_false.nt create mode 100644 tests/ntriples-2013/literal_true.nt create mode 100644 tests/ntriples-2013/literal_with_BACKSPACE.nt create mode 100644 tests/ntriples-2013/literal_with_CARRIAGE_RETURN.nt create mode 100644 tests/ntriples-2013/literal_with_CHARACTER_TABULATION.nt create mode 100644 tests/ntriples-2013/literal_with_FORM_FEED.nt create mode 100644 tests/ntriples-2013/literal_with_LINE_FEED.nt create mode 100644 tests/ntriples-2013/literal_with_REVERSE_SOLIDUS.nt create mode 100644 tests/ntriples-2013/literal_with_REVERSE_SOLIDUS2.nt create mode 100644 tests/ntriples-2013/literal_with_numeric_escape4.nt create mode 100644 tests/ntriples-2013/literal_with_numeric_escape8.nt create mode 100644 tests/ntriples-2013/minimal_whitespace.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-base-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-esc-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-esc-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-esc-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-lang-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-num-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-num-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-num-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-prefix-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-string-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-string-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-string-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-string-04.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-string-05.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-string-06.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-string-07.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-struct-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-struct-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-04.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-05.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-06.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-07.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-08.nt create mode 100644 tests/ntriples-2013/nt-syntax-bad-uri-09.nt create mode 100644 tests/ntriples-2013/nt-syntax-bnode-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-bnode-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-bnode-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-datatypes-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-datatypes-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-file-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-file-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-file-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-str-esc-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-str-esc-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-str-esc-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-string-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-string-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-string-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-subm-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-uri-01.nt create mode 100644 tests/ntriples-2013/nt-syntax-uri-02.nt create mode 100644 tests/ntriples-2013/nt-syntax-uri-03.nt create mode 100644 tests/ntriples-2013/nt-syntax-uri-04.nt create mode 100644 tests/ntriples/CMakeLists.txt create mode 100644 tests/ntriples/Makefile.am create mode 100644 tests/ntriples/Makefile.in create mode 100644 tests/ntriples/bad-00.nt create mode 100644 tests/ntriples/bad-02.nt create mode 100644 tests/ntriples/bad-03.nt create mode 100644 tests/ntriples/bad-04.nt create mode 100644 tests/ntriples/bad-05.nt create mode 100644 tests/ntriples/bad-06.nt create mode 100644 tests/ntriples/bad-07.nt create mode 100644 tests/ntriples/bug-481.nq create mode 100644 tests/ntriples/bug-481.out create mode 100644 tests/ntriples/bug-562.nt create mode 100644 tests/ntriples/bug-562.out create mode 100644 tests/ntriples/bug-574.nt create mode 100644 tests/ntriples/bug-574.out create mode 100644 tests/ntriples/bug-577.nt create mode 100644 tests/ntriples/bug-577.out create mode 100644 tests/ntriples/nt2013-ex1.nt create mode 100644 tests/ntriples/nt2013-ex1.out create mode 100644 tests/ntriples/nt2013-ex2.nt create mode 100644 tests/ntriples/nt2013-ex2.out create mode 100644 tests/ntriples/nt2013-ex3.nt create mode 100644 tests/ntriples/nt2013-ex3.out create mode 100644 tests/ntriples/nt2013-ex4.nt create mode 100644 tests/ntriples/nt2013-ex4.out create mode 100644 tests/ntriples/test.nt create mode 100644 tests/ntriples/test.out create mode 100644 tests/ntriples/testnq-1.nq create mode 100644 tests/ntriples/testnq-1.out create mode 100644 tests/ntriples/testnq-optional-context.nq create mode 100644 tests/ntriples/testnq-optional-context.out create mode 100644 tests/rdfa/0001.out create mode 100644 tests/rdfa/0001.xml create mode 100644 tests/rdfa/0006.out create mode 100644 tests/rdfa/0006.xml create mode 100644 tests/rdfa/0007.out create mode 100644 tests/rdfa/0007.xml create mode 100644 tests/rdfa/0008.out create mode 100644 tests/rdfa/0008.xml create mode 100644 tests/rdfa/0009.out create mode 100644 tests/rdfa/0009.xml create mode 100644 tests/rdfa/0010.out create mode 100644 tests/rdfa/0010.xml create mode 100644 tests/rdfa/0012.out create mode 100644 tests/rdfa/0012.xml create mode 100644 tests/rdfa/0013.out create mode 100644 tests/rdfa/0013.xml create mode 100644 tests/rdfa/0014.out create mode 100644 tests/rdfa/0014.xml create mode 100644 tests/rdfa/0015.out create mode 100644 tests/rdfa/0015.xml create mode 100644 tests/rdfa/0017.out create mode 100644 tests/rdfa/0017.xml create mode 100644 tests/rdfa/0018.out create mode 100644 tests/rdfa/0018.xml create mode 100644 tests/rdfa/0019.out create mode 100644 tests/rdfa/0019.xml create mode 100644 tests/rdfa/0020.out create mode 100644 tests/rdfa/0020.xml create mode 100644 tests/rdfa/0021.out create mode 100644 tests/rdfa/0021.xml create mode 100644 tests/rdfa/0023.out create mode 100644 tests/rdfa/0023.xml create mode 100644 tests/rdfa/0025.out create mode 100644 tests/rdfa/0025.xml create mode 100644 tests/rdfa/0026.out create mode 100644 tests/rdfa/0026.xml create mode 100644 tests/rdfa/0027.out create mode 100644 tests/rdfa/0027.xml create mode 100644 tests/rdfa/0029.out create mode 100644 tests/rdfa/0029.xml create mode 100644 tests/rdfa/0030.out create mode 100644 tests/rdfa/0030.xml create mode 100644 tests/rdfa/0031.out create mode 100644 tests/rdfa/0031.xml create mode 100644 tests/rdfa/0032.out create mode 100644 tests/rdfa/0032.xml create mode 100644 tests/rdfa/0033.out create mode 100644 tests/rdfa/0033.xml create mode 100644 tests/rdfa/0034.out create mode 100644 tests/rdfa/0034.xml create mode 100644 tests/rdfa/0035.out create mode 100644 tests/rdfa/0035.xml create mode 100644 tests/rdfa/0036.out create mode 100644 tests/rdfa/0036.xml create mode 100644 tests/rdfa/0037.out create mode 100644 tests/rdfa/0037.xml create mode 100644 tests/rdfa/0038.out create mode 100644 tests/rdfa/0038.xml create mode 100644 tests/rdfa/0039.out create mode 100644 tests/rdfa/0039.xml create mode 100644 tests/rdfa/0040.out create mode 100644 tests/rdfa/0040.xml create mode 100644 tests/rdfa/0041.out create mode 100644 tests/rdfa/0041.xml create mode 100644 tests/rdfa/0042.out create mode 100644 tests/rdfa/0042.xml create mode 100644 tests/rdfa/0046.out create mode 100644 tests/rdfa/0046.xml create mode 100644 tests/rdfa/0047.out create mode 100644 tests/rdfa/0047.xml create mode 100644 tests/rdfa/0048.out create mode 100644 tests/rdfa/0048.xml create mode 100644 tests/rdfa/0049.out create mode 100644 tests/rdfa/0049.xml create mode 100644 tests/rdfa/0050.out create mode 100644 tests/rdfa/0050.xml create mode 100644 tests/rdfa/0051.out create mode 100644 tests/rdfa/0051.xml create mode 100644 tests/rdfa/0052.out create mode 100644 tests/rdfa/0052.xml create mode 100644 tests/rdfa/0053.out create mode 100644 tests/rdfa/0053.xml create mode 100644 tests/rdfa/0054.out create mode 100644 tests/rdfa/0054.xml create mode 100644 tests/rdfa/0055.out create mode 100644 tests/rdfa/0055.xml create mode 100644 tests/rdfa/0056.out create mode 100644 tests/rdfa/0056.xml create mode 100644 tests/rdfa/0057.out create mode 100644 tests/rdfa/0057.xml create mode 100644 tests/rdfa/0058.out create mode 100644 tests/rdfa/0058.xml create mode 100644 tests/rdfa/0059.out create mode 100644 tests/rdfa/0059.xml create mode 100644 tests/rdfa/0060.out create mode 100644 tests/rdfa/0060.xml create mode 100644 tests/rdfa/0061.out create mode 100644 tests/rdfa/0061.xml create mode 100644 tests/rdfa/0062.out create mode 100644 tests/rdfa/0062.xml create mode 100644 tests/rdfa/0063.out create mode 100644 tests/rdfa/0063.xml create mode 100644 tests/rdfa/0064.out create mode 100644 tests/rdfa/0064.xml create mode 100644 tests/rdfa/0065.out create mode 100644 tests/rdfa/0065.xml create mode 100644 tests/rdfa/0066.out create mode 100644 tests/rdfa/0066.xml create mode 100644 tests/rdfa/0067.out create mode 100644 tests/rdfa/0067.xml create mode 100644 tests/rdfa/0068.out create mode 100644 tests/rdfa/0068.xml create mode 100644 tests/rdfa/0069.out create mode 100644 tests/rdfa/0069.xml create mode 100644 tests/rdfa/0070.out create mode 100644 tests/rdfa/0070.xml create mode 100644 tests/rdfa/0071.out create mode 100644 tests/rdfa/0071.xml create mode 100644 tests/rdfa/0072.out create mode 100644 tests/rdfa/0072.xml create mode 100644 tests/rdfa/0073.out create mode 100644 tests/rdfa/0073.xml create mode 100644 tests/rdfa/0074.out create mode 100644 tests/rdfa/0074.xml create mode 100644 tests/rdfa/0075.out create mode 100644 tests/rdfa/0075.xml create mode 100644 tests/rdfa/0076.out create mode 100644 tests/rdfa/0076.xml create mode 100644 tests/rdfa/0077.out create mode 100644 tests/rdfa/0077.xml create mode 100644 tests/rdfa/0078.out create mode 100644 tests/rdfa/0078.xml create mode 100644 tests/rdfa/0079.out create mode 100644 tests/rdfa/0079.xml create mode 100644 tests/rdfa/0080.out create mode 100644 tests/rdfa/0080.xml create mode 100644 tests/rdfa/0081.out create mode 100644 tests/rdfa/0081.xml create mode 100644 tests/rdfa/0082.out create mode 100644 tests/rdfa/0082.xml create mode 100644 tests/rdfa/0083.out create mode 100644 tests/rdfa/0083.xml create mode 100644 tests/rdfa/0084.out create mode 100644 tests/rdfa/0084.xml create mode 100644 tests/rdfa/0085.out create mode 100644 tests/rdfa/0085.xml create mode 100644 tests/rdfa/0087.out create mode 100644 tests/rdfa/0087.xml create mode 100644 tests/rdfa/0088.out create mode 100644 tests/rdfa/0088.xml create mode 100644 tests/rdfa/0089.out create mode 100644 tests/rdfa/0089.xml create mode 100644 tests/rdfa/0090.out create mode 100644 tests/rdfa/0090.xml create mode 100644 tests/rdfa/0091.out create mode 100644 tests/rdfa/0091.xml create mode 100644 tests/rdfa/0093.out create mode 100644 tests/rdfa/0093.xml create mode 100644 tests/rdfa/0099.out create mode 100644 tests/rdfa/0099.xml create mode 100644 tests/rdfa/0104.out create mode 100644 tests/rdfa/0104.xml create mode 100644 tests/rdfa/0106.out create mode 100644 tests/rdfa/0106.xml create mode 100644 tests/rdfa/0107.out create mode 100644 tests/rdfa/0107.xml create mode 100644 tests/rdfa/0108.out create mode 100644 tests/rdfa/0108.xml create mode 100644 tests/rdfa/0109.out create mode 100644 tests/rdfa/0109.xml create mode 100644 tests/rdfa/0110.out create mode 100644 tests/rdfa/0110.xml create mode 100644 tests/rdfa/0111.out create mode 100644 tests/rdfa/0111.xml create mode 100644 tests/rdfa/0112.out create mode 100644 tests/rdfa/0112.xml create mode 100644 tests/rdfa/0113.out create mode 100644 tests/rdfa/0113.xml create mode 100644 tests/rdfa/0114.out create mode 100644 tests/rdfa/0114.xml create mode 100644 tests/rdfa/0115.out create mode 100644 tests/rdfa/0115.xml create mode 100644 tests/rdfa/0117.out create mode 100644 tests/rdfa/0117.xml create mode 100644 tests/rdfa/0118.out create mode 100644 tests/rdfa/0118.xml create mode 100644 tests/rdfa/0119.out create mode 100644 tests/rdfa/0119.xml create mode 100644 tests/rdfa/0120.out create mode 100644 tests/rdfa/0120.xml create mode 100644 tests/rdfa/0121.out create mode 100644 tests/rdfa/0121.xml create mode 100644 tests/rdfa/0122.out create mode 100644 tests/rdfa/0122.xml create mode 100644 tests/rdfa/0126.out create mode 100644 tests/rdfa/0126.xml create mode 100644 tests/rdfa/0131.out create mode 100644 tests/rdfa/0131.xml create mode 100644 tests/rdfa/0134.out create mode 100644 tests/rdfa/0134.xml create mode 100644 tests/rdfa/0140.out create mode 100644 tests/rdfa/0140.xml create mode 100644 tests/rdfa/0147.out create mode 100644 tests/rdfa/0147.xml create mode 100644 tests/rdfa/0172.out create mode 100644 tests/rdfa/0172.xml create mode 100644 tests/rdfa/0173.out create mode 100644 tests/rdfa/0173.xml create mode 100644 tests/rdfa/0174.out create mode 100644 tests/rdfa/0174.xml create mode 100644 tests/rdfa/0181.out create mode 100644 tests/rdfa/0181.xml create mode 100644 tests/rdfa/0197.out create mode 100644 tests/rdfa/0197.xml create mode 100644 tests/rdfa/0201.out create mode 100644 tests/rdfa/0201.xml create mode 100644 tests/rdfa/0202.out create mode 100644 tests/rdfa/0202.xml create mode 100644 tests/rdfa/0203.out create mode 100644 tests/rdfa/0203.xml create mode 100644 tests/rdfa/0207.out create mode 100644 tests/rdfa/0207.xml create mode 100644 tests/rdfa/0209.out create mode 100644 tests/rdfa/0209.xml create mode 100644 tests/rdfa/0210.out create mode 100644 tests/rdfa/0210.xml create mode 100644 tests/rdfa/0211.out create mode 100644 tests/rdfa/0211.xml create mode 100644 tests/rdfa/0212.out create mode 100644 tests/rdfa/0212.xml create mode 100644 tests/rdfa/0215.out create mode 100644 tests/rdfa/0215.xml create mode 100644 tests/rdfa/0258.out create mode 100644 tests/rdfa/0258.xml create mode 100644 tests/rdfa/0262.out create mode 100644 tests/rdfa/0262.xml create mode 100644 tests/rdfa/0291.out create mode 100644 tests/rdfa/0291.xml create mode 100644 tests/rdfa/0294.out create mode 100644 tests/rdfa/0294.xml create mode 100644 tests/rdfa/0304.out create mode 100644 tests/rdfa/0304.xml create mode 100644 tests/rdfa/CMakeLists.txt create mode 100644 tests/rdfa/Makefile.am create mode 100644 tests/rdfa/Makefile.in create mode 100644 tests/rdfa11/0001.out create mode 100644 tests/rdfa11/0001.xml create mode 100644 tests/rdfa11/0006.out create mode 100644 tests/rdfa11/0006.xml create mode 100644 tests/rdfa11/0007.out create mode 100644 tests/rdfa11/0007.xml create mode 100644 tests/rdfa11/0008.out create mode 100644 tests/rdfa11/0008.xml create mode 100644 tests/rdfa11/0009.out create mode 100644 tests/rdfa11/0009.xml create mode 100644 tests/rdfa11/0010.out create mode 100644 tests/rdfa11/0010.xml create mode 100644 tests/rdfa11/0012.out create mode 100644 tests/rdfa11/0012.xml create mode 100644 tests/rdfa11/0013.out create mode 100644 tests/rdfa11/0013.xml create mode 100644 tests/rdfa11/0014.out create mode 100644 tests/rdfa11/0014.xml create mode 100644 tests/rdfa11/0015.out create mode 100644 tests/rdfa11/0015.xml create mode 100644 tests/rdfa11/0017.out create mode 100644 tests/rdfa11/0017.xml create mode 100644 tests/rdfa11/0018.out create mode 100644 tests/rdfa11/0018.xml create mode 100644 tests/rdfa11/0019.out create mode 100644 tests/rdfa11/0019.xml create mode 100644 tests/rdfa11/0020.out create mode 100644 tests/rdfa11/0020.xml create mode 100644 tests/rdfa11/0021.out create mode 100644 tests/rdfa11/0021.xml create mode 100644 tests/rdfa11/0023.out create mode 100644 tests/rdfa11/0023.xml create mode 100644 tests/rdfa11/0025.out create mode 100644 tests/rdfa11/0025.xml create mode 100644 tests/rdfa11/0026.out create mode 100644 tests/rdfa11/0026.xml create mode 100644 tests/rdfa11/0027.out create mode 100644 tests/rdfa11/0027.xml create mode 100644 tests/rdfa11/0029.out create mode 100644 tests/rdfa11/0029.xml create mode 100644 tests/rdfa11/0030.out create mode 100644 tests/rdfa11/0030.xml create mode 100644 tests/rdfa11/0031.out create mode 100644 tests/rdfa11/0031.xml create mode 100644 tests/rdfa11/0032.out create mode 100644 tests/rdfa11/0032.xml create mode 100644 tests/rdfa11/0033.out create mode 100644 tests/rdfa11/0033.xml create mode 100644 tests/rdfa11/0034.out create mode 100644 tests/rdfa11/0034.xml create mode 100644 tests/rdfa11/0035.out create mode 100644 tests/rdfa11/0035.xml create mode 100644 tests/rdfa11/0036.out create mode 100644 tests/rdfa11/0036.xml create mode 100644 tests/rdfa11/0037.out create mode 100644 tests/rdfa11/0037.xml create mode 100644 tests/rdfa11/0038.out create mode 100644 tests/rdfa11/0038.xml create mode 100644 tests/rdfa11/0039.out create mode 100644 tests/rdfa11/0039.xml create mode 100644 tests/rdfa11/0041.out create mode 100644 tests/rdfa11/0041.xml create mode 100644 tests/rdfa11/0048.out create mode 100644 tests/rdfa11/0048.xml create mode 100644 tests/rdfa11/0049.out create mode 100644 tests/rdfa11/0049.xml create mode 100644 tests/rdfa11/0050.out create mode 100644 tests/rdfa11/0050.xml create mode 100644 tests/rdfa11/0051.out create mode 100644 tests/rdfa11/0051.xml create mode 100644 tests/rdfa11/0052.out create mode 100644 tests/rdfa11/0052.xml create mode 100644 tests/rdfa11/0053.out create mode 100644 tests/rdfa11/0053.xml create mode 100644 tests/rdfa11/0054.out create mode 100644 tests/rdfa11/0054.xml create mode 100644 tests/rdfa11/0055.out create mode 100644 tests/rdfa11/0055.xml create mode 100644 tests/rdfa11/0056.out create mode 100644 tests/rdfa11/0056.xml create mode 100644 tests/rdfa11/0057.out create mode 100644 tests/rdfa11/0057.xml create mode 100644 tests/rdfa11/0059.out create mode 100644 tests/rdfa11/0059.xml create mode 100644 tests/rdfa11/0060.out create mode 100644 tests/rdfa11/0060.xml create mode 100644 tests/rdfa11/0061.out create mode 100644 tests/rdfa11/0061.xml create mode 100644 tests/rdfa11/0062.out create mode 100644 tests/rdfa11/0062.xml create mode 100644 tests/rdfa11/0063.out create mode 100644 tests/rdfa11/0063.xml create mode 100644 tests/rdfa11/0064.out create mode 100644 tests/rdfa11/0064.xml create mode 100644 tests/rdfa11/0065.out create mode 100644 tests/rdfa11/0065.xml create mode 100644 tests/rdfa11/0066.out create mode 100644 tests/rdfa11/0066.xml create mode 100644 tests/rdfa11/0067.out create mode 100644 tests/rdfa11/0067.xml create mode 100644 tests/rdfa11/0068.out create mode 100644 tests/rdfa11/0068.xml create mode 100644 tests/rdfa11/0069.out create mode 100644 tests/rdfa11/0069.xml create mode 100644 tests/rdfa11/0070.out create mode 100644 tests/rdfa11/0070.xml create mode 100644 tests/rdfa11/0071.out create mode 100644 tests/rdfa11/0071.xml create mode 100644 tests/rdfa11/0072.out create mode 100644 tests/rdfa11/0072.xml create mode 100644 tests/rdfa11/0073.out create mode 100644 tests/rdfa11/0073.xml create mode 100644 tests/rdfa11/0074.out create mode 100644 tests/rdfa11/0074.xml create mode 100644 tests/rdfa11/0075.out create mode 100644 tests/rdfa11/0075.xml create mode 100644 tests/rdfa11/0076.out create mode 100644 tests/rdfa11/0076.xml create mode 100644 tests/rdfa11/0077.out create mode 100644 tests/rdfa11/0077.xml create mode 100644 tests/rdfa11/0079.out create mode 100644 tests/rdfa11/0079.xml create mode 100644 tests/rdfa11/0080.out create mode 100644 tests/rdfa11/0080.xml create mode 100644 tests/rdfa11/0083.out create mode 100644 tests/rdfa11/0083.xml create mode 100644 tests/rdfa11/0084.out create mode 100644 tests/rdfa11/0084.xml create mode 100644 tests/rdfa11/0085.out create mode 100644 tests/rdfa11/0085.xml create mode 100644 tests/rdfa11/0087.out create mode 100644 tests/rdfa11/0087.xml create mode 100644 tests/rdfa11/0088.out create mode 100644 tests/rdfa11/0088.xml create mode 100644 tests/rdfa11/0089.out create mode 100644 tests/rdfa11/0089.xml create mode 100644 tests/rdfa11/0091.out create mode 100644 tests/rdfa11/0091.xml create mode 100644 tests/rdfa11/0093.out create mode 100644 tests/rdfa11/0093.xml create mode 100644 tests/rdfa11/0099.out create mode 100644 tests/rdfa11/0099.xml create mode 100644 tests/rdfa11/0104.out create mode 100644 tests/rdfa11/0104.xml create mode 100644 tests/rdfa11/0106.out create mode 100644 tests/rdfa11/0106.xml create mode 100644 tests/rdfa11/0107.out create mode 100644 tests/rdfa11/0107.xml create mode 100644 tests/rdfa11/0108.out create mode 100644 tests/rdfa11/0108.xml create mode 100644 tests/rdfa11/0109.out create mode 100644 tests/rdfa11/0109.xml create mode 100644 tests/rdfa11/0110.out create mode 100644 tests/rdfa11/0110.xml create mode 100644 tests/rdfa11/0111.out create mode 100644 tests/rdfa11/0111.xml create mode 100644 tests/rdfa11/0112.out create mode 100644 tests/rdfa11/0112.xml create mode 100644 tests/rdfa11/0113.out create mode 100644 tests/rdfa11/0113.xml create mode 100644 tests/rdfa11/0114.out create mode 100644 tests/rdfa11/0114.xml create mode 100644 tests/rdfa11/0115.out create mode 100644 tests/rdfa11/0115.xml create mode 100644 tests/rdfa11/0117.out create mode 100644 tests/rdfa11/0117.xml create mode 100644 tests/rdfa11/0118.out create mode 100644 tests/rdfa11/0118.xml create mode 100644 tests/rdfa11/0119.out create mode 100644 tests/rdfa11/0119.xml create mode 100644 tests/rdfa11/0120.out create mode 100644 tests/rdfa11/0120.xml create mode 100644 tests/rdfa11/0121.out create mode 100644 tests/rdfa11/0121.xml create mode 100644 tests/rdfa11/0122.out create mode 100644 tests/rdfa11/0122.xml create mode 100644 tests/rdfa11/0126.out create mode 100644 tests/rdfa11/0126.xml create mode 100644 tests/rdfa11/0131.out create mode 100644 tests/rdfa11/0131.xml create mode 100644 tests/rdfa11/0134.out create mode 100644 tests/rdfa11/0134.xml create mode 100644 tests/rdfa11/0140.out create mode 100644 tests/rdfa11/0140.xml create mode 100644 tests/rdfa11/0147.out create mode 100644 tests/rdfa11/0147.xml create mode 100644 tests/rdfa11/0172.out create mode 100644 tests/rdfa11/0172.xml create mode 100644 tests/rdfa11/0173.out create mode 100644 tests/rdfa11/0173.xml create mode 100644 tests/rdfa11/0174.out create mode 100644 tests/rdfa11/0174.xml create mode 100644 tests/rdfa11/0175.out create mode 100644 tests/rdfa11/0175.xml create mode 100644 tests/rdfa11/0176.out create mode 100644 tests/rdfa11/0176.xml create mode 100644 tests/rdfa11/0177.out create mode 100644 tests/rdfa11/0177.xml create mode 100644 tests/rdfa11/0178.out create mode 100644 tests/rdfa11/0178.xml create mode 100644 tests/rdfa11/0179.out create mode 100644 tests/rdfa11/0179.xml create mode 100644 tests/rdfa11/0180.out create mode 100644 tests/rdfa11/0180.xml create mode 100644 tests/rdfa11/0181.out create mode 100644 tests/rdfa11/0181.xml create mode 100644 tests/rdfa11/0182.out create mode 100644 tests/rdfa11/0182.xml create mode 100644 tests/rdfa11/0183.out create mode 100644 tests/rdfa11/0183.xml create mode 100644 tests/rdfa11/0186.out create mode 100644 tests/rdfa11/0186.xml create mode 100644 tests/rdfa11/0187.out create mode 100644 tests/rdfa11/0187.xml create mode 100644 tests/rdfa11/0188.out create mode 100644 tests/rdfa11/0188.xml create mode 100644 tests/rdfa11/0189.out create mode 100644 tests/rdfa11/0189.xml create mode 100644 tests/rdfa11/0190.out create mode 100644 tests/rdfa11/0190.xml create mode 100644 tests/rdfa11/0196.out create mode 100644 tests/rdfa11/0196.xml create mode 100644 tests/rdfa11/0197.out create mode 100644 tests/rdfa11/0197.xml create mode 100644 tests/rdfa11/0198.out create mode 100644 tests/rdfa11/0198.xml create mode 100644 tests/rdfa11/0201.out create mode 100644 tests/rdfa11/0201.xml create mode 100644 tests/rdfa11/0202.out create mode 100644 tests/rdfa11/0202.xml create mode 100644 tests/rdfa11/0203.out create mode 100644 tests/rdfa11/0203.xml create mode 100644 tests/rdfa11/0206.out create mode 100644 tests/rdfa11/0206.xml create mode 100644 tests/rdfa11/0207.out create mode 100644 tests/rdfa11/0207.xml create mode 100644 tests/rdfa11/0213.out create mode 100644 tests/rdfa11/0213.xml create mode 100644 tests/rdfa11/0214.out create mode 100644 tests/rdfa11/0214.xml create mode 100644 tests/rdfa11/0216.out create mode 100644 tests/rdfa11/0216.xml create mode 100644 tests/rdfa11/0217.out create mode 100644 tests/rdfa11/0217.xml create mode 100644 tests/rdfa11/0218.out create mode 100644 tests/rdfa11/0218.xml create mode 100644 tests/rdfa11/0219.out create mode 100644 tests/rdfa11/0219.xml create mode 100644 tests/rdfa11/0220.out create mode 100644 tests/rdfa11/0220.xml create mode 100644 tests/rdfa11/0221.out create mode 100644 tests/rdfa11/0221.xml create mode 100644 tests/rdfa11/0222.out create mode 100644 tests/rdfa11/0222.xml create mode 100644 tests/rdfa11/0223.out create mode 100644 tests/rdfa11/0223.xml create mode 100644 tests/rdfa11/0224.out create mode 100644 tests/rdfa11/0224.xml create mode 100644 tests/rdfa11/0225.out create mode 100644 tests/rdfa11/0225.xml create mode 100644 tests/rdfa11/0226.out create mode 100644 tests/rdfa11/0226.xml create mode 100644 tests/rdfa11/0227.out create mode 100644 tests/rdfa11/0227.xml create mode 100644 tests/rdfa11/0228.out create mode 100644 tests/rdfa11/0228.xml create mode 100644 tests/rdfa11/0229.out create mode 100644 tests/rdfa11/0229.xml create mode 100644 tests/rdfa11/0230.out create mode 100644 tests/rdfa11/0230.xml create mode 100644 tests/rdfa11/0231.out create mode 100644 tests/rdfa11/0231.xml create mode 100644 tests/rdfa11/0232.out create mode 100644 tests/rdfa11/0232.xml create mode 100644 tests/rdfa11/0233.out create mode 100644 tests/rdfa11/0233.xml create mode 100644 tests/rdfa11/0234.out create mode 100644 tests/rdfa11/0234.xml create mode 100644 tests/rdfa11/0235.out create mode 100644 tests/rdfa11/0235.xml create mode 100644 tests/rdfa11/0236.out create mode 100644 tests/rdfa11/0236.xml create mode 100644 tests/rdfa11/0237.out create mode 100644 tests/rdfa11/0237.xml create mode 100644 tests/rdfa11/0238.out create mode 100644 tests/rdfa11/0238.xml create mode 100644 tests/rdfa11/0239.out create mode 100644 tests/rdfa11/0239.xml create mode 100644 tests/rdfa11/0246.out create mode 100644 tests/rdfa11/0246.xml create mode 100644 tests/rdfa11/0247.out create mode 100644 tests/rdfa11/0247.xml create mode 100644 tests/rdfa11/0248.out create mode 100644 tests/rdfa11/0248.xml create mode 100644 tests/rdfa11/0249.out create mode 100644 tests/rdfa11/0249.xml create mode 100644 tests/rdfa11/0250.out create mode 100644 tests/rdfa11/0250.xml create mode 100644 tests/rdfa11/0251.out create mode 100644 tests/rdfa11/0251.xml create mode 100644 tests/rdfa11/0252.out create mode 100644 tests/rdfa11/0252.xml create mode 100644 tests/rdfa11/0253.out create mode 100644 tests/rdfa11/0253.xml create mode 100644 tests/rdfa11/0254.out create mode 100644 tests/rdfa11/0254.xml create mode 100644 tests/rdfa11/0255.out create mode 100644 tests/rdfa11/0255.xml create mode 100644 tests/rdfa11/0256.out create mode 100644 tests/rdfa11/0256.xml create mode 100644 tests/rdfa11/0257.out create mode 100644 tests/rdfa11/0257.xml create mode 100644 tests/rdfa11/0258.out create mode 100644 tests/rdfa11/0258.xml create mode 100644 tests/rdfa11/0259.out create mode 100644 tests/rdfa11/0259.xml create mode 100644 tests/rdfa11/0260.out create mode 100644 tests/rdfa11/0260.xml create mode 100644 tests/rdfa11/0261.out create mode 100644 tests/rdfa11/0261.xml create mode 100644 tests/rdfa11/0262.out create mode 100644 tests/rdfa11/0262.xml create mode 100644 tests/rdfa11/0263.out create mode 100644 tests/rdfa11/0263.xml create mode 100644 tests/rdfa11/0264.out create mode 100644 tests/rdfa11/0264.xml create mode 100644 tests/rdfa11/0265.out create mode 100644 tests/rdfa11/0265.xml create mode 100644 tests/rdfa11/0266.out create mode 100644 tests/rdfa11/0266.xml create mode 100644 tests/rdfa11/0267.out create mode 100644 tests/rdfa11/0267.xml create mode 100644 tests/rdfa11/0268.out create mode 100644 tests/rdfa11/0268.xml create mode 100644 tests/rdfa11/0269.out create mode 100644 tests/rdfa11/0269.xml create mode 100644 tests/rdfa11/0271.out create mode 100644 tests/rdfa11/0271.xml create mode 100644 tests/rdfa11/0272.out create mode 100644 tests/rdfa11/0272.xml create mode 100644 tests/rdfa11/0273.out create mode 100644 tests/rdfa11/0273.xml create mode 100644 tests/rdfa11/0274.out create mode 100644 tests/rdfa11/0274.xml create mode 100644 tests/rdfa11/0275.out create mode 100644 tests/rdfa11/0275.xml create mode 100644 tests/rdfa11/0276.out create mode 100644 tests/rdfa11/0276.xml create mode 100644 tests/rdfa11/0277.out create mode 100644 tests/rdfa11/0277.xml create mode 100644 tests/rdfa11/0278.out create mode 100644 tests/rdfa11/0278.xml create mode 100644 tests/rdfa11/0279.out create mode 100644 tests/rdfa11/0279.xml create mode 100644 tests/rdfa11/0280.out create mode 100644 tests/rdfa11/0280.xml create mode 100644 tests/rdfa11/0281.out create mode 100644 tests/rdfa11/0281.xml create mode 100644 tests/rdfa11/0282.out create mode 100644 tests/rdfa11/0282.xml create mode 100644 tests/rdfa11/0283.out create mode 100644 tests/rdfa11/0283.xml create mode 100644 tests/rdfa11/0284.out create mode 100644 tests/rdfa11/0284.xml create mode 100644 tests/rdfa11/0285.out create mode 100644 tests/rdfa11/0285.xml create mode 100644 tests/rdfa11/0286.out create mode 100644 tests/rdfa11/0286.xml create mode 100644 tests/rdfa11/0287.out create mode 100644 tests/rdfa11/0287.xml create mode 100644 tests/rdfa11/0289.out create mode 100644 tests/rdfa11/0289.xml create mode 100644 tests/rdfa11/0290.out create mode 100644 tests/rdfa11/0290.xml create mode 100644 tests/rdfa11/0291.out create mode 100644 tests/rdfa11/0291.xml create mode 100644 tests/rdfa11/0292.out create mode 100644 tests/rdfa11/0292.xml create mode 100644 tests/rdfa11/0293.out create mode 100644 tests/rdfa11/0293.xml create mode 100644 tests/rdfa11/0295.out create mode 100644 tests/rdfa11/0295.xml create mode 100644 tests/rdfa11/0296.out create mode 100644 tests/rdfa11/0296.xml create mode 100644 tests/rdfa11/0297.out create mode 100644 tests/rdfa11/0297.xml create mode 100644 tests/rdfa11/0298.out create mode 100644 tests/rdfa11/0298.xml create mode 100644 tests/rdfa11/0299.out create mode 100644 tests/rdfa11/0299.xml create mode 100644 tests/rdfa11/0300.out create mode 100644 tests/rdfa11/0300.xml create mode 100644 tests/rdfa11/0301.out create mode 100644 tests/rdfa11/0301.xml create mode 100644 tests/rdfa11/0302.out create mode 100644 tests/rdfa11/0302.xml create mode 100644 tests/rdfa11/0303.out create mode 100644 tests/rdfa11/0303.xml create mode 100644 tests/rdfa11/0304.out create mode 100644 tests/rdfa11/0304.xml create mode 100644 tests/rdfa11/CMakeLists.txt create mode 100644 tests/rdfa11/Makefile.am create mode 100644 tests/rdfa11/Makefile.in create mode 100644 tests/rdfxml/22-rdf-syntax-ns.out create mode 100644 tests/rdfxml/22-rdf-syntax-ns.rdf create mode 100644 tests/rdfxml/CMakeLists.txt create mode 100644 tests/rdfxml/Makefile.am create mode 100644 tests/rdfxml/Makefile.in create mode 100644 tests/rdfxml/bad-00.rdf create mode 100644 tests/rdfxml/bad-01.rdf create mode 100644 tests/rdfxml/bad-02.rdf create mode 100644 tests/rdfxml/bad-03.rdf create mode 100644 tests/rdfxml/bad-04.rdf create mode 100644 tests/rdfxml/bad-05.rdf create mode 100644 tests/rdfxml/bad-06.rdf create mode 100644 tests/rdfxml/bad-07.rdf create mode 100644 tests/rdfxml/bad-08.rdf create mode 100644 tests/rdfxml/bad-09.rdf create mode 100644 tests/rdfxml/bad-10.rdf create mode 100644 tests/rdfxml/bad-11.rdf create mode 100644 tests/rdfxml/bad-12.rdf create mode 100644 tests/rdfxml/bad-13.rdf create mode 100644 tests/rdfxml/bad-14.rdf create mode 100644 tests/rdfxml/bad-15.rdf create mode 100644 tests/rdfxml/bad-16.rdf create mode 100644 tests/rdfxml/bad-17.rdf create mode 100644 tests/rdfxml/bad-18.rdf create mode 100644 tests/rdfxml/bad-19.rdf create mode 100644 tests/rdfxml/bad-20.rdf create mode 100644 tests/rdfxml/bad-21.rdf create mode 100644 tests/rdfxml/bad-22.rdf create mode 100644 tests/rdfxml/bad-23.rdf create mode 100644 tests/rdfxml/bug-650.out create mode 100644 tests/rdfxml/bug-650.rdf create mode 100644 tests/rdfxml/daml-oil.out create mode 100644 tests/rdfxml/daml-oil.rdf create mode 100644 tests/rdfxml/ex-00.out create mode 100644 tests/rdfxml/ex-00.rdf create mode 100644 tests/rdfxml/ex-01.out create mode 100644 tests/rdfxml/ex-01.rdf create mode 100644 tests/rdfxml/ex-02.out create mode 100644 tests/rdfxml/ex-02.rdf create mode 100644 tests/rdfxml/ex-03.out create mode 100644 tests/rdfxml/ex-03.rdf create mode 100644 tests/rdfxml/ex-04.out create mode 100644 tests/rdfxml/ex-04.rdf create mode 100644 tests/rdfxml/ex-05.out create mode 100644 tests/rdfxml/ex-05.rdf create mode 100644 tests/rdfxml/ex-06.out create mode 100644 tests/rdfxml/ex-06.rdf create mode 100644 tests/rdfxml/ex-07.out create mode 100644 tests/rdfxml/ex-07.rdf create mode 100644 tests/rdfxml/ex-08.out create mode 100644 tests/rdfxml/ex-08.rdf create mode 100644 tests/rdfxml/ex-09.out create mode 100644 tests/rdfxml/ex-09.rdf create mode 100644 tests/rdfxml/ex-10.out create mode 100644 tests/rdfxml/ex-10.rdf create mode 100644 tests/rdfxml/ex-11.out create mode 100644 tests/rdfxml/ex-11.rdf create mode 100644 tests/rdfxml/ex-12.out create mode 100644 tests/rdfxml/ex-12.rdf create mode 100644 tests/rdfxml/ex-13.out create mode 100644 tests/rdfxml/ex-13.rdf create mode 100644 tests/rdfxml/ex-14.out create mode 100644 tests/rdfxml/ex-14.rdf create mode 100644 tests/rdfxml/ex-15.out create mode 100644 tests/rdfxml/ex-15.rdf create mode 100644 tests/rdfxml/ex-16.out create mode 100644 tests/rdfxml/ex-16.rdf create mode 100644 tests/rdfxml/ex-17.out create mode 100644 tests/rdfxml/ex-17.rdf create mode 100644 tests/rdfxml/ex-18.out create mode 100644 tests/rdfxml/ex-18.rdf create mode 100644 tests/rdfxml/ex-19.out create mode 100644 tests/rdfxml/ex-19.rdf create mode 100644 tests/rdfxml/ex-20.out create mode 100644 tests/rdfxml/ex-20.rdf create mode 100644 tests/rdfxml/ex-21.out create mode 100644 tests/rdfxml/ex-21.rdf create mode 100644 tests/rdfxml/ex-22.out create mode 100644 tests/rdfxml/ex-22.rdf create mode 100644 tests/rdfxml/ex-23.out create mode 100644 tests/rdfxml/ex-23.rdf create mode 100644 tests/rdfxml/ex-24.out create mode 100644 tests/rdfxml/ex-24.rdf create mode 100644 tests/rdfxml/ex-25.out create mode 100644 tests/rdfxml/ex-25.rdf create mode 100644 tests/rdfxml/ex-26.out create mode 100644 tests/rdfxml/ex-26.rdf create mode 100644 tests/rdfxml/ex-27.out create mode 100644 tests/rdfxml/ex-27.rdf create mode 100644 tests/rdfxml/ex-28.out create mode 100644 tests/rdfxml/ex-28.rdf create mode 100644 tests/rdfxml/ex-29.out create mode 100644 tests/rdfxml/ex-29.rdf create mode 100644 tests/rdfxml/ex-30.out create mode 100644 tests/rdfxml/ex-30.rdf create mode 100644 tests/rdfxml/ex-31.out create mode 100644 tests/rdfxml/ex-31.rdf create mode 100644 tests/rdfxml/ex-32.out create mode 100644 tests/rdfxml/ex-32.rdf create mode 100644 tests/rdfxml/ex-33.out create mode 100644 tests/rdfxml/ex-33.rdf create mode 100644 tests/rdfxml/ex-34.out create mode 100644 tests/rdfxml/ex-34.rdf create mode 100644 tests/rdfxml/ex-35.out create mode 100644 tests/rdfxml/ex-35.rdf create mode 100644 tests/rdfxml/ex-36.out create mode 100644 tests/rdfxml/ex-36.rdf create mode 100644 tests/rdfxml/ex-37.out create mode 100644 tests/rdfxml/ex-37.rdf create mode 100644 tests/rdfxml/ex-38-rdfxmla.out create mode 100644 tests/rdfxml/ex-38.out create mode 100644 tests/rdfxml/ex-38.rdf create mode 100644 tests/rdfxml/ex-39.out create mode 100644 tests/rdfxml/ex-39.rdf create mode 100644 tests/rdfxml/ex-40.out create mode 100644 tests/rdfxml/ex-40.rdf create mode 100644 tests/rdfxml/ex-41.out create mode 100644 tests/rdfxml/ex-41.rdf create mode 100644 tests/rdfxml/ex-42.out create mode 100644 tests/rdfxml/ex-42.rdf create mode 100644 tests/rdfxml/ex-43.out create mode 100644 tests/rdfxml/ex-43.rdf create mode 100644 tests/rdfxml/ex-44.out create mode 100644 tests/rdfxml/ex-44.rdf create mode 100644 tests/rdfxml/ex-45.out create mode 100644 tests/rdfxml/ex-45.rdf create mode 100644 tests/rdfxml/ex-46.out create mode 100644 tests/rdfxml/ex-46.rdf create mode 100644 tests/rdfxml/ex-47.out create mode 100644 tests/rdfxml/ex-47.rdf create mode 100644 tests/rdfxml/ex-48.out create mode 100644 tests/rdfxml/ex-48.rdf create mode 100644 tests/rdfxml/ex-49.out create mode 100644 tests/rdfxml/ex-49.rdf create mode 100644 tests/rdfxml/ex-51.out create mode 100644 tests/rdfxml/ex-51.rdf create mode 100644 tests/rdfxml/ex-52.out create mode 100644 tests/rdfxml/ex-52.svg create mode 100644 tests/rdfxml/ex-53.out create mode 100644 tests/rdfxml/ex-53.rdf create mode 100644 tests/rdfxml/ex-54.out create mode 100644 tests/rdfxml/ex-54.rdf create mode 100644 tests/rdfxml/ex-55.out create mode 100644 tests/rdfxml/ex-55.rdf create mode 100644 tests/rdfxml/ex-56.out create mode 100644 tests/rdfxml/ex-56.rdf create mode 100644 tests/rdfxml/ex-57.out create mode 100644 tests/rdfxml/ex-57.rdf create mode 100644 tests/rdfxml/ex-58.out create mode 100644 tests/rdfxml/ex-58.rdf create mode 100644 tests/rdfxml/ex-59.nt create mode 100644 tests/rdfxml/ex-59.rdf create mode 100644 tests/rdfxml/ex-60.nt create mode 100644 tests/rdfxml/ex-60.rdf create mode 100644 tests/rdfxml/ex-61.out create mode 100644 tests/rdfxml/ex-61.rdf create mode 100644 tests/rdfxml/ex-62.out create mode 100644 tests/rdfxml/ex-62.rdf create mode 100644 tests/rdfxml/ex-63.out create mode 100644 tests/rdfxml/ex-63.rdf create mode 100644 tests/rdfxml/owl-schema.out create mode 100644 tests/rdfxml/owl-schema.rdf create mode 100644 tests/rdfxml/rdf-schema.out create mode 100644 tests/rdfxml/rdf-schema.rdf create mode 100644 tests/rdfxml/rdfs-namespace.out create mode 100644 tests/rdfxml/rdfs-namespace.rdf create mode 100644 tests/rdfxml/warn-00.out create mode 100644 tests/rdfxml/warn-00.rdf create mode 100644 tests/rdfxml/warn-02.out create mode 100644 tests/rdfxml/warn-02.rdf create mode 100644 tests/rdfxml/warn-04.out create mode 100644 tests/rdfxml/warn-04.rdf create mode 100644 tests/rdfxml/warn-05.out create mode 100644 tests/rdfxml/warn-05.rdf create mode 100644 tests/rdfxml/warn-06.out create mode 100644 tests/rdfxml/warn-06.rdf create mode 100644 tests/rdfxml/warn-07.out create mode 100644 tests/rdfxml/warn-07.rdf create mode 100644 tests/rdfxml/wine.out create mode 100644 tests/rdfxml/wine.rdf create mode 100644 tests/trig/CMakeLists.txt create mode 100644 tests/trig/Makefile.am create mode 100644 tests/trig/Makefile.in create mode 100644 tests/trig/bug-584-dos.out create mode 100644 tests/trig/bug-584-dos.trig create mode 100644 tests/trig/bug-584-unix.out create mode 100644 tests/trig/bug-584-unix.trig create mode 100644 tests/trig/bug370.out create mode 100644 tests/trig/bug370.trig create mode 100644 tests/trig/bug451.out create mode 100644 tests/trig/bug451.trig create mode 100644 tests/trig/example1.out create mode 100644 tests/trig/example1.trig create mode 100644 tests/trig/example2.out create mode 100644 tests/trig/example2.trig create mode 100644 tests/trig/example3.out create mode 100644 tests/trig/example3.trig create mode 100644 tests/trig/issue-37.out create mode 100644 tests/trig/issue-37.trig create mode 100644 tests/turtle-2013/HYPHEN_MINUS_in_localName.nt create mode 100644 tests/turtle-2013/HYPHEN_MINUS_in_localName.ttl create mode 100644 tests/turtle-2013/IRIREF_datatype.nt create mode 100644 tests/turtle-2013/IRIREF_datatype.ttl create mode 100644 tests/turtle-2013/IRI_spo.nt create mode 100644 tests/turtle-2013/IRI_subject.nt create mode 100644 tests/turtle-2013/IRI_subject.ttl create mode 100644 tests/turtle-2013/IRI_with_all_punctuation.nt create mode 100644 tests/turtle-2013/IRI_with_all_punctuation.ttl create mode 100644 tests/turtle-2013/IRI_with_eight_digit_numeric_escape.nt create mode 100644 tests/turtle-2013/IRI_with_eight_digit_numeric_escape.ttl create mode 100644 tests/turtle-2013/IRI_with_four_digit_numeric_escape.nt create mode 100644 tests/turtle-2013/IRI_with_four_digit_numeric_escape.ttl create mode 100644 tests/turtle-2013/LITERAL1.nt create mode 100644 tests/turtle-2013/LITERAL1.ttl create mode 100644 tests/turtle-2013/LITERAL1_all_controls.nt create mode 100644 tests/turtle-2013/LITERAL1_all_controls.ttl create mode 100644 tests/turtle-2013/LITERAL1_all_punctuation.nt create mode 100644 tests/turtle-2013/LITERAL1_all_punctuation.ttl create mode 100644 tests/turtle-2013/LITERAL1_ascii_boundaries.nt create mode 100644 tests/turtle-2013/LITERAL1_ascii_boundaries.ttl create mode 100644 tests/turtle-2013/LITERAL1_with_UTF8_boundaries.nt create mode 100644 tests/turtle-2013/LITERAL1_with_UTF8_boundaries.ttl create mode 100644 tests/turtle-2013/LITERAL2.nt create mode 100644 tests/turtle-2013/LITERAL2.ttl create mode 100644 tests/turtle-2013/LITERAL2_ascii_boundaries.nt create mode 100644 tests/turtle-2013/LITERAL2_ascii_boundaries.ttl create mode 100644 tests/turtle-2013/LITERAL2_with_UTF8_boundaries.nt create mode 100644 tests/turtle-2013/LITERAL2_with_UTF8_boundaries.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG1.nt create mode 100644 tests/turtle-2013/LITERAL_LONG1.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG1_ascii_boundaries.nt create mode 100644 tests/turtle-2013/LITERAL_LONG1_ascii_boundaries.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG1_with_1_squote.nt create mode 100644 tests/turtle-2013/LITERAL_LONG1_with_1_squote.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG1_with_2_squotes.nt create mode 100644 tests/turtle-2013/LITERAL_LONG1_with_2_squotes.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG1_with_UTF8_boundaries.nt create mode 100644 tests/turtle-2013/LITERAL_LONG1_with_UTF8_boundaries.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG2.nt create mode 100644 tests/turtle-2013/LITERAL_LONG2.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG2_ascii_boundaries.nt create mode 100644 tests/turtle-2013/LITERAL_LONG2_ascii_boundaries.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG2_with_1_squote.nt create mode 100644 tests/turtle-2013/LITERAL_LONG2_with_1_squote.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG2_with_2_squotes.nt create mode 100644 tests/turtle-2013/LITERAL_LONG2_with_2_squotes.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG2_with_REVERSE_SOLIDUS.nt create mode 100644 tests/turtle-2013/LITERAL_LONG2_with_REVERSE_SOLIDUS.ttl create mode 100644 tests/turtle-2013/LITERAL_LONG2_with_UTF8_boundaries.nt create mode 100644 tests/turtle-2013/LITERAL_LONG2_with_UTF8_boundaries.ttl create mode 100644 tests/turtle-2013/LITERAL_with_UTF8_boundaries.nt create mode 100644 tests/turtle-2013/Makefile.am create mode 100644 tests/turtle-2013/Makefile.in create mode 100644 tests/turtle-2013/README create mode 100644 tests/turtle-2013/SPARQL_style_base.nt create mode 100644 tests/turtle-2013/SPARQL_style_base.ttl create mode 100644 tests/turtle-2013/SPARQL_style_prefix.nt create mode 100644 tests/turtle-2013/SPARQL_style_prefix.ttl create mode 100644 tests/turtle-2013/anonymous_blank_node_object.nt create mode 100644 tests/turtle-2013/anonymous_blank_node_object.ttl create mode 100644 tests/turtle-2013/anonymous_blank_node_subject.nt create mode 100644 tests/turtle-2013/anonymous_blank_node_subject.ttl create mode 100644 tests/turtle-2013/bareword_a_predicate.nt create mode 100644 tests/turtle-2013/bareword_a_predicate.ttl create mode 100644 tests/turtle-2013/bareword_decimal.nt create mode 100644 tests/turtle-2013/bareword_decimal.ttl create mode 100644 tests/turtle-2013/bareword_double.nt create mode 100644 tests/turtle-2013/bareword_double.ttl create mode 100644 tests/turtle-2013/bareword_integer.nt create mode 100644 tests/turtle-2013/bareword_integer.ttl create mode 100644 tests/turtle-2013/blankNodePropertyList_as_object.nt create mode 100644 tests/turtle-2013/blankNodePropertyList_as_object.ttl create mode 100644 tests/turtle-2013/blankNodePropertyList_as_subject.nt create mode 100644 tests/turtle-2013/blankNodePropertyList_as_subject.ttl create mode 100644 tests/turtle-2013/blankNodePropertyList_containing_collection.nt create mode 100644 tests/turtle-2013/blankNodePropertyList_containing_collection.ttl create mode 100644 tests/turtle-2013/blankNodePropertyList_with_multiple_triples.nt create mode 100644 tests/turtle-2013/blankNodePropertyList_with_multiple_triples.ttl create mode 100644 tests/turtle-2013/collection_object.nt create mode 100644 tests/turtle-2013/collection_object.ttl create mode 100644 tests/turtle-2013/collection_subject.nt create mode 100644 tests/turtle-2013/collection_subject.ttl create mode 100644 tests/turtle-2013/comment_following_PNAME_NS.nt create mode 100644 tests/turtle-2013/comment_following_PNAME_NS.ttl create mode 100644 tests/turtle-2013/comment_following_localName.nt create mode 100644 tests/turtle-2013/comment_following_localName.ttl create mode 100644 tests/turtle-2013/default_namespace_IRI.nt create mode 100644 tests/turtle-2013/default_namespace_IRI.ttl create mode 100644 tests/turtle-2013/double_lower_case_e.nt create mode 100644 tests/turtle-2013/double_lower_case_e.ttl create mode 100644 tests/turtle-2013/empty_collection.nt create mode 100644 tests/turtle-2013/empty_collection.ttl create mode 100644 tests/turtle-2013/first.nt create mode 100644 tests/turtle-2013/first.ttl create mode 100644 tests/turtle-2013/labeled_blank_node_object.nt create mode 100644 tests/turtle-2013/labeled_blank_node_object.ttl create mode 100644 tests/turtle-2013/labeled_blank_node_subject.nt create mode 100644 tests/turtle-2013/labeled_blank_node_subject.ttl create mode 100644 tests/turtle-2013/labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.nt create mode 100644 tests/turtle-2013/labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.ttl create mode 100644 tests/turtle-2013/labeled_blank_node_with_leading_digit.nt create mode 100644 tests/turtle-2013/labeled_blank_node_with_leading_digit.ttl create mode 100644 tests/turtle-2013/labeled_blank_node_with_leading_underscore.nt create mode 100644 tests/turtle-2013/labeled_blank_node_with_leading_underscore.ttl create mode 100644 tests/turtle-2013/labeled_blank_node_with_non_leading_extras.nt create mode 100644 tests/turtle-2013/labeled_blank_node_with_non_leading_extras.ttl create mode 100644 tests/turtle-2013/langtagged_LONG.nt create mode 100644 tests/turtle-2013/langtagged_LONG.ttl create mode 100644 tests/turtle-2013/langtagged_LONG_with_subtag.nt create mode 100644 tests/turtle-2013/langtagged_LONG_with_subtag.ttl create mode 100644 tests/turtle-2013/langtagged_non_LONG.nt create mode 100644 tests/turtle-2013/langtagged_non_LONG.ttl create mode 100644 tests/turtle-2013/lantag_with_subtag.nt create mode 100644 tests/turtle-2013/lantag_with_subtag.ttl create mode 100644 tests/turtle-2013/last.nt create mode 100644 tests/turtle-2013/last.ttl create mode 100644 tests/turtle-2013/literal_false.nt create mode 100644 tests/turtle-2013/literal_false.ttl create mode 100644 tests/turtle-2013/literal_true.nt create mode 100644 tests/turtle-2013/literal_true.ttl create mode 100644 tests/turtle-2013/literal_with_BACKSPACE.nt create mode 100644 tests/turtle-2013/literal_with_BACKSPACE.ttl create mode 100644 tests/turtle-2013/literal_with_CARRIAGE_RETURN.nt create mode 100644 tests/turtle-2013/literal_with_CARRIAGE_RETURN.ttl create mode 100644 tests/turtle-2013/literal_with_CHARACTER_TABULATION.nt create mode 100644 tests/turtle-2013/literal_with_CHARACTER_TABULATION.ttl create mode 100644 tests/turtle-2013/literal_with_FORM_FEED.nt create mode 100644 tests/turtle-2013/literal_with_FORM_FEED.ttl create mode 100644 tests/turtle-2013/literal_with_LINE_FEED.nt create mode 100644 tests/turtle-2013/literal_with_LINE_FEED.ttl create mode 100644 tests/turtle-2013/literal_with_REVERSE_SOLIDUS.nt create mode 100644 tests/turtle-2013/literal_with_REVERSE_SOLIDUS.ttl create mode 100644 tests/turtle-2013/literal_with_escaped_BACKSPACE.nt create mode 100644 tests/turtle-2013/literal_with_escaped_BACKSPACE.ttl create mode 100644 tests/turtle-2013/literal_with_escaped_CARRIAGE_RETURN.nt create mode 100644 tests/turtle-2013/literal_with_escaped_CARRIAGE_RETURN.ttl create mode 100644 tests/turtle-2013/literal_with_escaped_CHARACTER_TABULATION.nt create mode 100644 tests/turtle-2013/literal_with_escaped_CHARACTER_TABULATION.ttl create mode 100644 tests/turtle-2013/literal_with_escaped_FORM_FEED.nt create mode 100644 tests/turtle-2013/literal_with_escaped_FORM_FEED.ttl create mode 100644 tests/turtle-2013/literal_with_escaped_LINE_FEED.nt create mode 100644 tests/turtle-2013/literal_with_escaped_LINE_FEED.ttl create mode 100644 tests/turtle-2013/literal_with_numeric_escape4.nt create mode 100644 tests/turtle-2013/literal_with_numeric_escape4.ttl create mode 100644 tests/turtle-2013/literal_with_numeric_escape8.nt create mode 100644 tests/turtle-2013/literal_with_numeric_escape8.ttl create mode 100644 tests/turtle-2013/localName_with_PN_CHARS_BASE_character_boundaries.nt create mode 100644 tests/turtle-2013/localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.nt create mode 100644 tests/turtle-2013/localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.ttl create mode 100644 tests/turtle-2013/localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.nt create mode 100644 tests/turtle-2013/localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.ttl create mode 100644 tests/turtle-2013/localName_with_leading_digit.nt create mode 100644 tests/turtle-2013/localName_with_leading_digit.ttl create mode 100644 tests/turtle-2013/localName_with_leading_underscore.nt create mode 100644 tests/turtle-2013/localName_with_leading_underscore.ttl create mode 100644 tests/turtle-2013/localName_with_nfc_PN_CHARS_BASE_character_boundaries.nt create mode 100644 tests/turtle-2013/localName_with_nfc_PN_CHARS_BASE_character_boundaries.ttl create mode 100644 tests/turtle-2013/localName_with_non_leading_extras.nt create mode 100644 tests/turtle-2013/localName_with_non_leading_extras.ttl create mode 100644 tests/turtle-2013/localname_with_COLON.nt create mode 100644 tests/turtle-2013/localname_with_COLON.ttl create mode 100644 tests/turtle-2013/negative_numeric.nt create mode 100644 tests/turtle-2013/negative_numeric.ttl create mode 100644 tests/turtle-2013/nested_blankNodePropertyLists.nt create mode 100644 tests/turtle-2013/nested_blankNodePropertyLists.ttl create mode 100644 tests/turtle-2013/nested_collection.nt create mode 100644 tests/turtle-2013/nested_collection.ttl create mode 100644 tests/turtle-2013/number_sign_following_PNAME_NS.nt create mode 100644 tests/turtle-2013/number_sign_following_PNAME_NS.ttl create mode 100644 tests/turtle-2013/number_sign_following_localName.nt create mode 100644 tests/turtle-2013/number_sign_following_localName.ttl create mode 100644 tests/turtle-2013/numeric_with_leading_0.nt create mode 100644 tests/turtle-2013/numeric_with_leading_0.ttl create mode 100644 tests/turtle-2013/objectList_with_two_objects.nt create mode 100644 tests/turtle-2013/objectList_with_two_objects.ttl create mode 100644 tests/turtle-2013/old_style_base.nt create mode 100644 tests/turtle-2013/old_style_base.ttl create mode 100644 tests/turtle-2013/old_style_prefix.nt create mode 100644 tests/turtle-2013/old_style_prefix.ttl create mode 100644 tests/turtle-2013/oops.nt create mode 100644 tests/turtle-2013/oops.ttl create mode 100644 tests/turtle-2013/percent_escaped_localName.nt create mode 100644 tests/turtle-2013/percent_escaped_localName.ttl create mode 100644 tests/turtle-2013/positive_numeric.nt create mode 100644 tests/turtle-2013/positive_numeric.ttl create mode 100644 tests/turtle-2013/predicateObjectList_with_two_objectLists.nt create mode 100644 tests/turtle-2013/predicateObjectList_with_two_objectLists.ttl create mode 100644 tests/turtle-2013/prefix_only_IRI.nt create mode 100644 tests/turtle-2013/prefix_only_IRI.ttl create mode 100644 tests/turtle-2013/prefix_reassigned_and_used.nt create mode 100644 tests/turtle-2013/prefix_reassigned_and_used.ttl create mode 100644 tests/turtle-2013/prefix_with_PN_CHARS_BASE_character_boundaries.nt create mode 100644 tests/turtle-2013/prefix_with_PN_CHARS_BASE_character_boundaries.ttl create mode 100644 tests/turtle-2013/prefix_with_non_leading_extras.nt create mode 100644 tests/turtle-2013/prefix_with_non_leading_extras.ttl create mode 100644 tests/turtle-2013/prefixed_IRI_object.nt create mode 100644 tests/turtle-2013/prefixed_IRI_object.ttl create mode 100644 tests/turtle-2013/prefixed_IRI_predicate.nt create mode 100644 tests/turtle-2013/prefixed_IRI_predicate.ttl create mode 100644 tests/turtle-2013/prefixed_name_datatype.nt create mode 100644 tests/turtle-2013/prefixed_name_datatype.ttl create mode 100644 tests/turtle-2013/repeated_semis_at_end.nt create mode 100644 tests/turtle-2013/repeated_semis_at_end.ttl create mode 100644 tests/turtle-2013/repeated_semis_not_at_end.nt create mode 100644 tests/turtle-2013/repeated_semis_not_at_end.ttl create mode 100644 tests/turtle-2013/reserved_escaped_localName.nt create mode 100644 tests/turtle-2013/reserved_escaped_localName.ttl create mode 100644 tests/turtle-2013/sole_blankNodePropertyList.nt create mode 100644 tests/turtle-2013/sole_blankNodePropertyList.ttl create mode 100644 tests/turtle-2013/turtle-eval-bad-01.ttl create mode 100644 tests/turtle-2013/turtle-eval-bad-02.ttl create mode 100644 tests/turtle-2013/turtle-eval-bad-03.ttl create mode 100644 tests/turtle-2013/turtle-eval-bad-04.ttl create mode 100644 tests/turtle-2013/turtle-eval-struct-01.nt create mode 100644 tests/turtle-2013/turtle-eval-struct-01.ttl create mode 100644 tests/turtle-2013/turtle-eval-struct-02.nt create mode 100644 tests/turtle-2013/turtle-eval-struct-02.ttl create mode 100644 tests/turtle-2013/turtle-subm-01.nt create mode 100644 tests/turtle-2013/turtle-subm-01.ttl create mode 100644 tests/turtle-2013/turtle-subm-02.nt create mode 100644 tests/turtle-2013/turtle-subm-02.ttl create mode 100644 tests/turtle-2013/turtle-subm-03.nt create mode 100644 tests/turtle-2013/turtle-subm-03.ttl create mode 100644 tests/turtle-2013/turtle-subm-04.nt create mode 100644 tests/turtle-2013/turtle-subm-04.ttl create mode 100644 tests/turtle-2013/turtle-subm-05.nt create mode 100644 tests/turtle-2013/turtle-subm-05.ttl create mode 100644 tests/turtle-2013/turtle-subm-06.nt create mode 100644 tests/turtle-2013/turtle-subm-06.ttl create mode 100644 tests/turtle-2013/turtle-subm-07.nt create mode 100644 tests/turtle-2013/turtle-subm-07.ttl create mode 100644 tests/turtle-2013/turtle-subm-08.nt create mode 100644 tests/turtle-2013/turtle-subm-08.ttl create mode 100644 tests/turtle-2013/turtle-subm-09.nt create mode 100644 tests/turtle-2013/turtle-subm-09.ttl create mode 100644 tests/turtle-2013/turtle-subm-10.nt create mode 100644 tests/turtle-2013/turtle-subm-10.ttl create mode 100644 tests/turtle-2013/turtle-subm-11.nt create mode 100644 tests/turtle-2013/turtle-subm-11.ttl create mode 100644 tests/turtle-2013/turtle-subm-12.nt create mode 100644 tests/turtle-2013/turtle-subm-12.ttl create mode 100644 tests/turtle-2013/turtle-subm-13.nt create mode 100644 tests/turtle-2013/turtle-subm-13.ttl create mode 100644 tests/turtle-2013/turtle-subm-14.nt create mode 100644 tests/turtle-2013/turtle-subm-14.ttl create mode 100644 tests/turtle-2013/turtle-subm-15.nt create mode 100644 tests/turtle-2013/turtle-subm-15.ttl create mode 100644 tests/turtle-2013/turtle-subm-16.nt create mode 100644 tests/turtle-2013/turtle-subm-16.ttl create mode 100644 tests/turtle-2013/turtle-subm-17.nt create mode 100644 tests/turtle-2013/turtle-subm-17.ttl create mode 100644 tests/turtle-2013/turtle-subm-18.nt create mode 100644 tests/turtle-2013/turtle-subm-18.ttl create mode 100644 tests/turtle-2013/turtle-subm-19.nt create mode 100644 tests/turtle-2013/turtle-subm-19.ttl create mode 100644 tests/turtle-2013/turtle-subm-20.nt create mode 100644 tests/turtle-2013/turtle-subm-20.ttl create mode 100644 tests/turtle-2013/turtle-subm-21.nt create mode 100644 tests/turtle-2013/turtle-subm-21.ttl create mode 100644 tests/turtle-2013/turtle-subm-22.nt create mode 100644 tests/turtle-2013/turtle-subm-22.ttl create mode 100644 tests/turtle-2013/turtle-subm-23.nt create mode 100644 tests/turtle-2013/turtle-subm-23.ttl create mode 100644 tests/turtle-2013/turtle-subm-24.nt create mode 100644 tests/turtle-2013/turtle-subm-24.ttl create mode 100644 tests/turtle-2013/turtle-subm-25.nt create mode 100644 tests/turtle-2013/turtle-subm-25.ttl create mode 100644 tests/turtle-2013/turtle-subm-26.nt create mode 100644 tests/turtle-2013/turtle-subm-26.ttl create mode 100644 tests/turtle-2013/turtle-subm-27.nt create mode 100644 tests/turtle-2013/turtle-subm-27.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-LITERAL2_with_langtag_and_datatype.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-base-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-base-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-base-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-blank-label-dot-end.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-esc-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-esc-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-esc-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-esc-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-kw-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-kw-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-kw-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-kw-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-kw-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-lang-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-ln-dash-start.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-ln-escape-start.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-ln-escape.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-missing-ns-dot-end.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-missing-ns-dot-start.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-06.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-07.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-08.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-09.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-10.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-11.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-12.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-n3-extras-13.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-ns-dot-end.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-ns-dot-start.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-num-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-num-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-num-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-num-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-num-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-number-dot-in-anon.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-pname-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-pname-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-pname-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-prefix-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-prefix-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-prefix-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-prefix-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-prefix-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-string-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-string-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-string-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-string-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-string-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-string-06.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-string-07.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-06.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-07.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-08.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-09.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-10.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-11.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-12.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-13.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-14.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-15.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-16.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-struct-17.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-uri-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-uri-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-uri-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-uri-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bad-uri-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-base-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-base-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-base-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-base-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-blank-label.nt create mode 100644 tests/turtle-2013/turtle-syntax-blank-label.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-06.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-07.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-08.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-09.ttl create mode 100644 tests/turtle-2013/turtle-syntax-bnode-10.ttl create mode 100644 tests/turtle-2013/turtle-syntax-datatypes-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-datatypes-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-file-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-file-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-file-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-kw-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-kw-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-kw-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-lists-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-lists-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-lists-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-lists-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-lists-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-ln-colons.nt create mode 100644 tests/turtle-2013/turtle-syntax-ln-colons.ttl create mode 100644 tests/turtle-2013/turtle-syntax-ln-dots.nt create mode 100644 tests/turtle-2013/turtle-syntax-ln-dots.ttl create mode 100644 tests/turtle-2013/turtle-syntax-ns-dots.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-06.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-07.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-08.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-09.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-10.ttl create mode 100644 tests/turtle-2013/turtle-syntax-number-11.ttl create mode 100644 tests/turtle-2013/turtle-syntax-pname-esc-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-pname-esc-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-pname-esc-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-06.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-07.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-08.ttl create mode 100644 tests/turtle-2013/turtle-syntax-prefix-09.ttl create mode 100644 tests/turtle-2013/turtle-syntax-str-esc-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-str-esc-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-str-esc-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-06.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-07.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-08.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-09.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-10.ttl create mode 100644 tests/turtle-2013/turtle-syntax-string-11.ttl create mode 100644 tests/turtle-2013/turtle-syntax-struct-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-struct-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-struct-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-struct-04.ttl create mode 100644 tests/turtle-2013/turtle-syntax-struct-05.ttl create mode 100644 tests/turtle-2013/turtle-syntax-uri-01.ttl create mode 100644 tests/turtle-2013/turtle-syntax-uri-02.ttl create mode 100644 tests/turtle-2013/turtle-syntax-uri-03.ttl create mode 100644 tests/turtle-2013/turtle-syntax-uri-04.ttl create mode 100644 tests/turtle-2013/two_LITERAL_LONG2s.nt create mode 100644 tests/turtle-2013/two_LITERAL_LONG2s.ttl create mode 100644 tests/turtle-2013/underscore_in_localName.nt create mode 100644 tests/turtle-2013/underscore_in_localName.ttl create mode 100644 tests/turtle/Makefile.am create mode 100644 tests/turtle/Makefile.in create mode 100644 tests/turtle/README.txt create mode 100644 tests/turtle/bad-00.ttl create mode 100644 tests/turtle/bad-01.ttl create mode 100644 tests/turtle/bad-02.ttl create mode 100644 tests/turtle/bad-03.ttl create mode 100644 tests/turtle/bad-04.ttl create mode 100644 tests/turtle/bad-05.ttl create mode 100644 tests/turtle/bad-06.ttl create mode 100644 tests/turtle/bad-07.ttl create mode 100644 tests/turtle/bad-08.ttl create mode 100644 tests/turtle/bad-09.ttl create mode 100644 tests/turtle/bad-10.ttl create mode 100644 tests/turtle/bad-11.ttl create mode 100644 tests/turtle/bad-12.ttl create mode 100644 tests/turtle/bad-13.ttl create mode 100644 tests/turtle/bad-14.ttl create mode 100644 tests/turtle/bad-15.out create mode 100644 tests/turtle/bad-15.ttl create mode 100644 tests/turtle/bad-16.ttl create mode 100644 tests/turtle/bad-17.out create mode 100644 tests/turtle/bad-17.ttl create mode 100644 tests/turtle/bad-18.out create mode 100644 tests/turtle/bad-18.ttl create mode 100644 tests/turtle/bad-19.ttl create mode 100644 tests/turtle/bad-20.ttl create mode 100644 tests/turtle/bad-21.out create mode 100644 tests/turtle/bad-21.ttl create mode 100644 tests/turtle/bad-22.out create mode 100644 tests/turtle/bad-22.ttl create mode 100644 tests/turtle/bad-23.ttl create mode 100644 tests/turtle/bad-24.ttl create mode 100644 tests/turtle/ex-38-turtle.out create mode 100644 tests/turtle/ex-62.rdf create mode 100644 tests/turtle/manifest-bad.ttl create mode 100644 tests/turtle/manifest.ttl create mode 100644 tests/turtle/rdf-schema.out create mode 100644 tests/turtle/rdf-schema.ttl create mode 100644 tests/turtle/rdfq-results.out create mode 100644 tests/turtle/rdfq-results.ttl create mode 100644 tests/turtle/rdfs-namespace.out create mode 100644 tests/turtle/rdfs-namespace.ttl create mode 100644 tests/turtle/test-00.out create mode 100644 tests/turtle/test-00.ttl create mode 100644 tests/turtle/test-01.out create mode 100644 tests/turtle/test-01.ttl create mode 100644 tests/turtle/test-02.out create mode 100644 tests/turtle/test-02.ttl create mode 100644 tests/turtle/test-03.out create mode 100644 tests/turtle/test-03.ttl create mode 100644 tests/turtle/test-04.out create mode 100644 tests/turtle/test-04.ttl create mode 100644 tests/turtle/test-05.out create mode 100644 tests/turtle/test-05.ttl create mode 100644 tests/turtle/test-06.out create mode 100644 tests/turtle/test-06.ttl create mode 100644 tests/turtle/test-07.out create mode 100644 tests/turtle/test-07.ttl create mode 100644 tests/turtle/test-08.out create mode 100644 tests/turtle/test-08.ttl create mode 100644 tests/turtle/test-09.out create mode 100644 tests/turtle/test-09.ttl create mode 100644 tests/turtle/test-10.out create mode 100644 tests/turtle/test-10.ttl create mode 100644 tests/turtle/test-11.out create mode 100644 tests/turtle/test-11.ttl create mode 100644 tests/turtle/test-12.out create mode 100644 tests/turtle/test-12.ttl create mode 100644 tests/turtle/test-13.out create mode 100644 tests/turtle/test-13.ttl create mode 100644 tests/turtle/test-14.out create mode 100644 tests/turtle/test-14.ttl create mode 100644 tests/turtle/test-15.out create mode 100644 tests/turtle/test-15.ttl create mode 100644 tests/turtle/test-16.out create mode 100644 tests/turtle/test-16.ttl create mode 100644 tests/turtle/test-17.out create mode 100644 tests/turtle/test-17.ttl create mode 100644 tests/turtle/test-18.out create mode 100644 tests/turtle/test-18.ttl create mode 100644 tests/turtle/test-19.out create mode 100644 tests/turtle/test-19.ttl create mode 100644 tests/turtle/test-20.out create mode 100644 tests/turtle/test-20.ttl create mode 100644 tests/turtle/test-21.out create mode 100644 tests/turtle/test-21.ttl create mode 100644 tests/turtle/test-22.out create mode 100644 tests/turtle/test-22.ttl create mode 100644 tests/turtle/test-23.out create mode 100644 tests/turtle/test-23.ttl create mode 100644 tests/turtle/test-24.out create mode 100644 tests/turtle/test-24.ttl create mode 100644 tests/turtle/test-25.out create mode 100644 tests/turtle/test-25.ttl create mode 100644 tests/turtle/test-26.out create mode 100644 tests/turtle/test-26.ttl create mode 100644 tests/turtle/test-27.out create mode 100644 tests/turtle/test-27.ttl create mode 100644 tests/turtle/test-28-out.ttl create mode 100644 tests/turtle/test-28.out create mode 100644 tests/turtle/test-28.ttl create mode 100644 tests/turtle/test-29.out create mode 100644 tests/turtle/test-29.ttl create mode 100644 tests/turtle/test-30.out create mode 100644 tests/turtle/test-30.ttl create mode 100644 tests/turtle/test-31-out.ttl create mode 100644 tests/turtle/test-31.ttl create mode 100644 tests/turtle/test-32-out.ttl create mode 100644 tests/turtle/test-32.ttl create mode 100644 tests/turtle/test-33.out create mode 100644 tests/turtle/test-33.ttl create mode 100644 tests/turtle/test-34-out.ttl create mode 100644 tests/turtle/test-34.ttl create mode 100644 tests/turtle/test-36.out create mode 100644 tests/turtle/test-36.ttl create mode 100644 tests/turtle/test-37.out create mode 100644 tests/turtle/test-37.ttl create mode 100644 tests/turtle/test-38.out create mode 100644 tests/turtle/test-38.ttl create mode 100644 tests/turtle/test-39-out.ttl create mode 100644 tests/turtle/test-39.ttl create mode 100644 utils/CMakeLists.txt create mode 100644 utils/Makefile.am create mode 100644 utils/Makefile.in create mode 100644 utils/getopt.c create mode 100644 utils/rapper.1 create mode 100644 utils/rapper.c create mode 100644 utils/rapper.html create mode 100644 utils/raptor_getopt.h create mode 100644 utils/rdfdiff.c diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..4e8a7c3 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,4 @@ +Dave Beckett +Dave Robillard +Lauri Aalto +Nicholas J Humfrey diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8f9bcb5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,436 @@ +# raptor/CMakeLists.txt +# +# This file allows building Raptor2 with the CMake configuration tool. +# Download CMake in source or binary form from http://www.cmake.org/ +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +SET(RAPTOR_VERSION_MAJOR 2) +SET(RAPTOR_VERSION_MINOR 0) +SET(RAPTOR_VERSION_RELEASE 16) +SET(RAPTOR_MIN_VERSION_DECIMAL 20016) + +SET(VERSION "${RAPTOR_VERSION_MAJOR}.${RAPTOR_VERSION_MINOR}.${RAPTOR_VERSION_RELEASE}") +MATH(EXPR RAPTOR_VERSION_DECIMAL "${RAPTOR_VERSION_MAJOR} * 10000 + ${RAPTOR_VERSION_MINOR} * 100 + ${RAPTOR_VERSION_RELEASE}") + +PROJECT(Raptor2 C) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7) + +INCLUDE( GNUInstallDirs ) + +SET(CMAKE_INCLUDE_CURRENT_DIR 1) + +################################################################ + +# Third-party libraries/dependencies + +FIND_PACKAGE(CURL) +FIND_PACKAGE(LibXml2) +FIND_PACKAGE(LibXslt) +#FIND_PACKAGE(YAJL) +FIND_PACKAGE(Perl REQUIRED) +FIND_PACKAGE(BISON 3.4 REQUIRED) +FIND_PACKAGE(FLEX 2.5.19 REQUIRED) + +if(EXISTS ${CURL_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIRS}) +endif(EXISTS ${CURL_INCLUDE_DIRS}) + +if(EXISTS ${EXPAT_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIRS}) +endif(EXISTS ${EXPAT_INCLUDE_DIRS}) + +if(EXISTS ${LIBXML2_INCLUDE_DIR}) + INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) +endif(EXISTS ${LIBXML2_INCLUDE_DIR}) + +if(EXISTS ${LIBXSLT_INCLUDE_DIRS}) + INCLUDE_DIRECTORIES(${LIBXSLT_INCLUDE_DIRS}) +endif(EXISTS ${LIBXSLT_INCLUDE_DIRS}) + +################################################################ + +# Configuration checks + +INCLUDE(CheckIncludeFile) +INCLUDE(CheckIncludeFiles) +INCLUDE(CheckFunctionExists) +INCLUDE(CheckTypeSize) +INCLUDE(CheckStructHasMember) +INCLUDE(CheckCSourceCompiles) + +CHECK_INCLUDE_FILE(errno.h HAVE_ERRNO_H) +CHECK_INCLUDE_FILE(fcntl.h HAVE_FCNTL_H) +CHECK_INCLUDE_FILE(getopt.h HAVE_GETOPT_H) +CHECK_INCLUDE_FILE(limits.h HAVE_LIMITS_H) +CHECK_INCLUDE_FILE(math.h HAVE_MATH_H) +CHECK_INCLUDE_FILE(setjmp.h HAVE_SETJMP_H) +CHECK_INCLUDE_FILE(stddef.h HAVE_STDDEF_H) +CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H) +CHECK_INCLUDE_FILE(string.h HAVE_STRING_H) +CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H) +CHECK_INCLUDE_FILE(time.h HAVE_TIME_H) +CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H) +CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE(sys/time.h HAVE_SYS_TIME_H) + +CHECK_INCLUDE_FILES("sys/time.h;time.h" TIME_WITH_SYS_TIME) + +CHECK_FUNCTION_EXISTS(access HAVE_ACCESS) +CHECK_FUNCTION_EXISTS(_access HAVE__ACCESS) +CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT) +CHECK_FUNCTION_EXISTS(getopt_long HAVE_GETOPT_LONG) +CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY) +CHECK_FUNCTION_EXISTS(isascii HAVE_ISASCII) +CHECK_FUNCTION_EXISTS(setjmp HAVE_SETJMP) +CHECK_FUNCTION_EXISTS(snprintf HAVE_SNPRINTF) +CHECK_FUNCTION_EXISTS(_snprintf HAVE__SNPRINTF) +CHECK_FUNCTION_EXISTS(stat HAVE_STAT) +CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP) +CHECK_FUNCTION_EXISTS(stricmp HAVE_STRICMP) +CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP) +CHECK_FUNCTION_EXISTS(strtok_r HAVE_STRTOK_R) +CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF) +CHECK_FUNCTION_EXISTS(vsnprintf HAVE_VSNPRINTF) +CHECK_FUNCTION_EXISTS(_vsnprintf HAVE__VSNPRINTF) + +CHECK_TYPE_SIZE("unsigned char" SIZEOF_UNSIGNED_CHAR) +CHECK_TYPE_SIZE("unsigned short" SIZEOF_UNSIGNED_SHORT) +CHECK_TYPE_SIZE("unsigned int" SIZEOF_UNSIGNED_INT) +CHECK_TYPE_SIZE("unsigned long" SIZEOF_UNSIGNED_LONG) +CHECK_TYPE_SIZE("unsigned long long" SIZEOF_UNSIGNED_LONG_LONG) + +CHECK_C_SOURCE_COMPILES(" +int main(void){ printf(__FUNCTION__); }" + HAVE___FUNCTION__ +) + + +IF(LIBXML2_FOUND) + + SET(CMAKE_REQUIRED_INCLUDES ${LIBXML2_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBXML2_LIBRARIES}) + + CHECK_FUNCTION_EXISTS(xmlCtxtUseOptions HAVE_XMLCTXTUSEOPTIONS) + CHECK_FUNCTION_EXISTS(xmlSAX2InternalSubset HAVE_XMLSAX2INTERNALSUBSET) + + CHECK_STRUCT_HAS_MEMBER( + xmlEntity + name_length + libxml/parser.h + RAPTOR_LIBXML_ENTITY_NAME_LENGTH + ) + + CHECK_STRUCT_HAS_MEMBER( + xmlEntity + etype + libxml/parser.h + RAPTOR_LIBXML_ENTITY_ETYPE + ) + + CHECK_STRUCT_HAS_MEMBER( + xmlSAXHandler + initialized + libxml/parser.h + RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED + ) + + CHECK_STRUCT_HAS_MEMBER( + xmlSAXHandler + externalSubset + libxml/parser.h + RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET + ) + + CHECK_C_SOURCE_COMPILES(" +#include +int main(void){ xmlParserOption foo; foo = XML_PARSE_NONET; return 0; }" + RAPTOR_LIBXML_XML_PARSE_NONET + ) + + CHECK_C_SOURCE_COMPILES(" +#include +int main(void){ htmlParserOption foo; foo = HTML_PARSE_NONET; return 0; }" + RAPTOR_LIBXML_HTML_PARSE_NONET + ) + + SET(CMAKE_REQUIRED_INCLUDES) + SET(CMAKE_REQUIRED_LIBRARIES) + +ENDIF(LIBXML2_FOUND) + +################################################################ + +# User-configurable options +# +# (Note: The CMake GUI displays these in alphabetical order, regardless of +# the order we use here) + +SET(BUILD_SHARED_LIBS ON CACHE BOOL + "Build shared libraries instead of static ones.") + +IF(BUILD_SHARED_LIBS) + SET(RAPTOR_STATIC FALSE) +ELSE(BUILD_SHARED_LIBS) + SET(RAPTOR_STATIC TRUE) +ENDIF(BUILD_SHARED_LIBS) + +SET(RAPTOR_XML_INIT none) +IF(LIBXML2_FOUND) + SET(RAPTOR_XML_INIT libxml) +ENDIF(LIBXML2_FOUND) + +SET(RAPTOR_XML ${RAPTOR_XML_INIT} CACHE STRING + "Which XML library to use (any of \"libxml\", \"none\").") + +SET(RAPTOR_XML_DEFINE RAPTOR_XML_NONE) +IF(RAPTOR_XML STREQUAL "libxml") + SET(RAPTOR_XML_DEFINE RAPTOR_XML_LIBXML) +ENDIF(RAPTOR_XML STREQUAL "libxml") + +SET(RAPTOR_WWW_INIT none) +IF(LIBXML2_FOUND) + SET(RAPTOR_WWW_INIT xml) +ENDIF(LIBXML2_FOUND) +IF(CURL_FOUND) + SET(RAPTOR_WWW_INIT curl) +ENDIF(CURL_FOUND) + +SET(RAPTOR_WWW ${RAPTOR_WWW_INIT} CACHE STRING + "Which WWW library to use (any of \"curl\", \"xml\", \"none\").") + +SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_NONE) +IF(RAPTOR_WWW STREQUAL "curl") + SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_LIBCURL) +ELSEIF(RAPTOR_WWW STREQUAL "xml") + SET(RAPTOR_WWW_DEFINE RAPTOR_WWW_LIBXML) +ENDIF(RAPTOR_WWW STREQUAL "curl") + +SET(RAPTOR_XML_1_1 FALSE CACHE BOOL + "Use XML version 1.1 name checking.") + +SET(HAVE_RAPTOR_PARSE_DATE 1) +SET(RAPTOR_PARSEDATE 1) + +SET(RAPTOR_PARSER_RDFXML_INIT FALSE) +IF(LIBXML2_FOUND) + SET(RAPTOR_PARSER_RDFXML_INIT TRUE) +ENDIF(LIBXML2_FOUND) + +SET(RAPTOR_PARSER_GRDDL_INIT FALSE) +IF(LIBXML2_FOUND AND LIBXSLT_FOUND) + SET(RAPTOR_PARSER_GRDDL_INIT TRUE) +ENDIF(LIBXML2_FOUND AND LIBXSLT_FOUND) + +SET(RAPTOR_PARSER_RDFXML ${RAPTOR_PARSER_RDFXML_INIT} + CACHE BOOL "Build RDF/XML parser.") +SET(RAPTOR_PARSER_NTRIPLES TRUE + CACHE BOOL "Build N-Triples parser.") +SET(RAPTOR_PARSER_TURTLE TRUE + CACHE BOOL "Build Turtle parser.") +SET(RAPTOR_PARSER_TRIG TRUE + CACHE BOOL "Build TRiG parser.") +SET(RAPTOR_PARSER_RSS ${LIBXML2_FOUND} + CACHE BOOL "Build RSS Tag Soup parser.") +SET(RAPTOR_PARSER_GRDDL ${RAPTOR_PARSER_GRDDL_INIT} + CACHE BOOL "Build GRDDL parser.") +SET(RAPTOR_PARSER_GUESS TRUE + CACHE BOOL "Build guess parser.") +SET(RAPTOR_PARSER_RDFA ${LIBXML2_FOUND} + CACHE BOOL "Build RDFA parser.") +SET(RAPTOR_PARSER_JSON ${YAJL_FOUND} + CACHE BOOL "Build JSON parser.") +SET(RAPTOR_PARSER_NQUADS TRUE + CACHE BOOL "Build N-Quads parser.") + +SET(RAPTOR_SERIALIZER_RDFXML TRUE + CACHE BOOL "Build RDF/XML serializer.") +SET(RAPTOR_SERIALIZER_NTRIPLES TRUE + CACHE BOOL "Build N-Triples serializer.") +SET(RAPTOR_SERIALIZER_RDFXML_ABBREV TRUE + CACHE BOOL "Build RDF/XML-abbreviated serializer.") +SET(RAPTOR_SERIALIZER_TURTLE TRUE + CACHE BOOL "Build Turtle serializer.") +SET(RAPTOR_SERIALIZER_RSS_1_0 TRUE + CACHE BOOL "Build RSS 1.0 serializer.") +SET(RAPTOR_SERIALIZER_ATOM TRUE + CACHE BOOL "Build Atom 1.0 serializer.") +SET(RAPTOR_SERIALIZER_DOT TRUE + CACHE BOOL "Build GraphViz DOT serializer.") +SET(RAPTOR_SERIALIZER_HTML TRUE + CACHE BOOL "Build HTML Table serializer.") +SET(RAPTOR_SERIALIZER_JSON TRUE + CACHE BOOL "Build JSON serializer.") +SET(RAPTOR_SERIALIZER_NQUADS TRUE + CACHE BOOL "Build N-Quads serializer.") + +################################################################ + +CONFIGURE_FILE( + src/raptor_config_cmake.h.in + src/raptor_config.h + @ONLY +) + +ADD_DEFINITIONS(-DHAVE_CONFIG_H) + +CONFIGURE_FILE( + src/raptor2.h.in + src/raptor2.h + @ONLY +) + +################################################################ + +message(STATUS " +################################################################ +Raptor Configuration Summary +################################################################ + + http://librdf.org/raptor/ + + Configured on host $ENV{COMPUTERNAME} ${HOSTNAME} + host OS ${CMAKE_SYSTEM_NAME} + host architecture ${CMAKE_SYSTEM_PROCESSOR} + + General flags: + CC ${CMAKE_C_COMPILER} + CXX (not used) ${CMAKE_CXX_COMPILER} + CFLAGS ${CMAKE_C_FLAGS} + CXXFLAGS ${CMAKE_CXX_FLAGS} + LDFLAGS ${CMAKE_EXE_LINKER_FLAGS} + + Installation prefix: ${CMAKE_INSTALL_PREFIX} + + Dependencies (packages marked with *** are required): + " +) + +message( " *** Perl ${PERL_EXECUTABLE}") +message( " *** Bison ${BISON_EXECUTABLE}") +message( " *** Flex ${FLEX_EXECUTABLE}") +message( " *** libxml2 (lib) ${LIBXML2_LIBRARIES}") +message( " *** libxml2 (include) ${LIBXML2_INCLUDE_DIR}") + +################################################################ + +# On Windows, the test/utility programs usually have DLL dependencies that +# make them cumbersome to invoke within IDE environments, so we enable the +# test suite only when makefiles are being used. +# +# Note that a partial solution is described at +# +# http://www.cmake.org/pipermail/cmake/2009-May/029464.html +# +# but we don't have a good way of knowing where the third-party DLLs are. +# +IF(CMAKE_GENERATOR MATCHES "Makefiles") + ENABLE_TESTING() +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + +SUBDIRS(src) +SUBDIRS(utils) + +################################################################ + +FIND_PROGRAM(JING jing) +IF(NOT JING STREQUAL "JING-NOTFOUND") + SET(HAVE_JING TRUE) +ENDIF(NOT JING STREQUAL "JING-NOTFOUND") + +SET(RAPPER ${CMAKE_BINARY_DIR}/utils/rapper) +SET(RDFDIFF ${CMAKE_BINARY_DIR}/utils/rdfdiff) + +MACRO(RAPPER_TEST NAME_PREFIX COMMAND OUTPUT REFERENCE) + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test-${NAME_PREFIX}.cmake " +EXECUTE_PROCESS( + COMMAND ${COMMAND} + TIMEOUT 10 + OUTPUT_FILE ${OUTPUT}.raw + ERROR_QUIET +) + +# http://public.kitware.com/Bug/view.php?id=13007 + +CONFIGURE_FILE( + ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT}.raw + ${OUTPUT} + @ONLY + NEWLINE_STYLE UNIX +) +") + ADD_TEST("${NAME_PREFIX}:run" ${CMAKE_COMMAND} -P test-${NAME_PREFIX}.cmake) + ADD_TEST("${NAME_PREFIX}:cmp" ${CMAKE_COMMAND} -E compare_files ${REFERENCE} ${OUTPUT}) +ENDMACRO(RAPPER_TEST NAME_PREFIX COMMAND OUTPUT REFERENCE) + +INCLUDE(CMakeParseArguments) + +FUNCTION(RAPPER_RDFDIFF_TEST TEST_NAME RAPPER_COMMAND RAPPER_OUTPUT RDFDIFF_COMMAND) + # http://www.cmake.org/pipermail/cmake/2012-July/051309.html + SET(options EXPECTED_FAILURE) + SET(oneValueArgs ) + SET(multiValueArgs ) + CMAKE_PARSE_ARGUMENTS(RRT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + SET(TEST_NAME ${ARGV0}) + SET(RAPPER_COMMAND ${ARGV1}) + SET(RAPPER_OUTPUT ${ARGV2}) + SET(RDFDIFF_COMMAND ${ARGV3}) + + # workaround because TRUE is not true in a CMake IF + IF(RRT_EXPECTED_FAILURE) + SET(EXPECT_FAILURE 1) + ELSE() + SET(EXPECT_FAILURE 0) + ENDIF() + + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/test-${TEST_NAME}.cmake " +SET(rdfdiff_status -1) + +EXECUTE_PROCESS( + COMMAND ${RAPPER_COMMAND} + TIMEOUT 10 + OUTPUT_FILE ${RAPPER_OUTPUT} + ERROR_QUIET + RESULT_VARIABLE rapper_status +) + +IF(rapper_status EQUAL 0 OR rapper_status EQUAL 2) + EXECUTE_PROCESS( + COMMAND ${RDFDIFF_COMMAND} + TIMEOUT 10 + OUTPUT_QUIET + ERROR_QUIET + RESULT_VARIABLE rdfdiff_status + ) +ENDIF(rapper_status EQUAL 0 OR rapper_status EQUAL 2) + +IF(${EXPECT_FAILURE}) + IF(rdfdiff_status EQUAL 0) + MESSAGE(FATAL_ERROR \"Test succeeded, but expected to fail.\") + ENDIF(rdfdiff_status EQUAL 0) +ELSE() + IF(NOT rdfdiff_status EQUAL 0) + MESSAGE(FATAL_ERROR \"Test failed.\") + ENDIF(NOT rdfdiff_status EQUAL 0) +ENDIF() +") + + ADD_TEST(${TEST_NAME} ${CMAKE_COMMAND} -P test-${TEST_NAME}.cmake) +ENDFUNCTION(RAPPER_RDFDIFF_TEST) + +SUBDIRS(tests/feeds) +SUBDIRS(tests/grddl) +SUBDIRS(tests/json) +SUBDIRS(tests/ntriples) +SUBDIRS(tests/rdfa) +SUBDIRS(tests/rdfa11) +SUBDIRS(tests/rdfxml) +SUBDIRS(tests/trig) +#SUBDIRS(tests/turtle) # TODO + +# end raptor/CMakeLists.txt diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/COPYING.LIB b/COPYING.LIB new file mode 100644 index 0000000..2d2d780 --- /dev/null +++ b/COPYING.LIB @@ -0,0 +1,510 @@ + + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations +below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must +be allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control +compilation and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply, and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License +may add an explicit geographical distribution limitation excluding those +countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms +of the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should +have at least the "copyright" line and a pointer to where the full +notice is found. + + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James + Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..4f506d9 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,2096 @@ +2023-03-01 Dave Beckett + + * Snapshotted raptor2_2_0_16 for 2.0.16 release (GIT b2d89d96cb43a93f751e17619491955abb41dbd1) + +2023-03-01 Dave Beckett + + * docs/raptor-changes.tsv, scripts/process-changes.pl: Support + constants in changes TSV + * docs/raptor-changes.tsv: 2.0.16 API changes + +2023-02-28 Dave Beckett + + * configure.ac: https and 2023 + * INSTALL.html, LICENSE.html, NEWS.html, README.html, RELEASE.html, + TODO.html, UPGRADING.html: + https and 2023 + * docs/.gitignore: Ignore raptor2.actions + +2023-02-22 Dave Beckett + + * docs/tmpl/section-avltree.sgml, + docs/tmpl/section-constants.sgml, docs/tmpl/section-www.sgml: + Updated doc templates + + * src/raptor_serialize_rdfxmla.c, src/raptor_serialize_turtle.c: + Remove set but unused variable i + +2022-12-27 Dave Beckett + + * ChangeLog, INSTALL.html, LICENSE.html, NEWS.html, RELEASE.html, + configure.ac, src/raptor_general.c: 2023 and https + +2022-12-27 Dave Beckett + + * Merge pull request #53 from trofi/shared-by-default + CMakeLists.txt: default to shared libraries by default (just like + GNU configure) + +2022-12-26 Dave Beckett + + * Merge pull request #55 from thesamesam/clang16 configure.ac: fix + -Wimplicit-function-declaration in HAVE___FUNCTION_… + +2022-11-04 Sam James + + * configure.ac: configure.ac: fix -Wimplicit-function-declaration + in HAVE___FUNCTION__ test (Clang 16) + + Clang 16 will make -Wimplicit-function-declaration errors by + default. + + ``` error: call to undeclared library function 'printf' + with type 'int (const char *, ...)'; ISO C99 and later do not + support implicit function declarations + [-Werror,-Wimplicit-function-declaration] error: call to undeclared + library function 'printf' with type 'int (const char *, ...)'; ISO + C99 and later do not support implicit function declarations + [-Werror,-Wimplicit-function-declaration] ``` + + For more information, see LWN.net [0] or LLVM's Discourse [1], + gentoo-dev@ [2], or the (new) c-std-porting mailing list [3]. [0] + https://lwn.net/Articles/913505/ [1] + + https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213[2] + + https://archives.gentoo.org/gentoo-dev/message/dd9f2d3082b8b6f8dfbccb0639e6e240[3] hosted at lists.linux.dev. + +2022-07-08 Dave Beckett + + * Merge pull request #52 from Artturin/cmakefix + +2022-07-03 Dave Beckett + + * src/raptor_uri.c: + (raptor_uri_counted_filename_to_uri_string): Copy NUL when copyin + file:// prefix. Coverity false positive since the following lines + of code always add more characters and a NUL. "Fixes" CID 353858 + +2022-06-15 Artturin + + * src/CMakeLists.txt: + fix the cmake generated pc file before + libdir=${exec_prefix}//nix/store/i7abvb760gzca1wqk9g617shqdj5sr7f-raptor2-aarch64-unknown-linux-gnu-2.0.15/lib + includedir=${prefix}//nix/store/i7abvb760gzca1wqk9g617shqdj5sr7f-raptor2-aarch64-unknown-linux-gnu-2.0.15/include/raptor2note the double // due to CMAKE_INSTALL_LIBDIR already being a + absolute path after + libdir=/nix/store/rlhzlak7chagd23898n1x9id6f5a6qpn-raptor2-aarch64-unknown-linux-gnu-2.0.15/lib + includedir=/nix/store/rlhzlak7chagd23898n1x9id6f5a6qpn-raptor2-aarch64-unknown-linux-gnu-2.0.15/include/raptor2 + +2022-06-06 Dave Beckett + + * src/raptor_internal.h, src/raptor_nfc_icu.c, + src/raptor_rdfxml.c, src/raptor_unicode.c, + tests/rdfxml/Makefile.am: Fix internal ICU string NFC check to + convert to UTF-16 first + + (raptor_nfc_icu_check, raptor_unicode_check_utf8_nfc_string): + Changed signature of these internal functions to not have error_p + which wasn't even consistently used. Instead return -1 on failure + which is also "falsey" in C. + + (raptor_nfc_icu_check): Do an UTF-8 (raptor) to UTF-16 conversion + before trying to do a NFC normalization check. Update callers of + above internal functions to remove error_p argument which was + unused in all callers. Update rdfxmla tests to allow tests to + throw warnings. + +2022-06-04 Dave Beckett + + * Merge pull request #50 from passware/enkey/cases/POS-5043 + +2021-12-24 mathvich + + * src/CMakeLists.txt: [POS-5320] librdfa directory fix + + * CMakeLists.txt, src/CMakeLists.txt: [POS-5230] librdfa directory fix + + * CMakeLists.txt, src/CMakeLists.txt: [POS-5230] tabs changed to spaces + +2021-12-15 mathvich + + * utils/CMakeLists.txt: [POS-5103] utils dir fix + + * CMakeLists.txt: [POS-5103] returned to origin + + * CMakeLists.txt: [POS-5103] debug message + +2021-12-14 mathvich + + * CMakeLists.txt: [POS-5103] directory change + + * CMakeLists.txt: [POS-5103] directory change + + * src/CMakeLists.txt: [POS-5103] scripts directory fix + +2021-11-29 Dave Beckett + + * src/raptor_www_curl.c: + (raptor_www_curl_set_ssl_cert_options) Set res + +2021-11-21 Dave Beckett + + * src/turtle_parser.y: Add va_end to turtle_parser_error_simple + error paths + + (turtle_parser_error_simple): Ensure va_end is always called on all + normal and error paths. [coverity CID 343351] + + * src/raptor_internal.h, src/raptor_www.c, src/raptor_www_curl.c: + Summary: Check curl_easy_setopt() return values for errors In + several places check for curl_easy_setopt() erorr returns and + fail. [coverity CID 343360] + + (raptor_new_www_with_connection): On curl module init failures, + free up www object before error return. + + (raptor_www_curl_init): + Return error value for failure in init, check all calls with a + macro. + + (raptor_www_curl_fetch, raptor_www_curl_set_ssl_cert_options) + (raptor_www_curl_set_ssl_verify_options): Check and set error + messages on failure + +2021-11-21 Dave Beckett + + * src/raptor_grddl.c: + Fix leak on failure of WWW model methods + + (raptor_grddl_fetch_uri): On WWW call failures, free up www object + before error return. [coverity CID 343353] + + * librdfa/curie.c: Fix check for ".." string (rdfa_resolve_uri): + Fix check for ".." that never matched; if was always false + [coverity CID 343354] + + * src/raptor_serialize_rdfxmla.c: + Handle leak of iter on failure + + (raptor_rdfxmla_emit_subject_properties): Handle leak of iter on + rv failure by breaking loop to let normal return handle it. + [coverity CID 343358] + +2021-11-14 Dave Beckett + + * CMakeLists.txt, src/raptor_config_cmake.h.in: Add cmake check + for time.h with HAVE_TIME_H + +2021-11-09 mathvich + + * CMakeLists.txt, src/raptor_config_cmake.h.in: Fix for CMake + build on Windows HAVE_TIME_H definition added + +2021-10-16 Dave Beckett + + * configure.ac: Fix newline quoting for OSX sh/bash compatibility + + * Makefile.am: old ChangeLog are not interesting + +2021-10-13 Dave Beckett + + * src/Makefile.am: Add parsedate.h to BUILT_SOURCES + + * configure.ac: + Update bison check to find first new enough GNU + bison This probably should find all versions and pick the latest but + that's not so easy in this AC_PATH_PROGS_FEATURE_CHECK approach. It + remains that it can be overrridden with the BISON envar, as before. + +2021-10-10 Dave Beckett + + * src/parsedate.y: Remove ancient protection around ctype calls + The isTHING() calls do not need an isascii() wrapper ever. + + * src/parsedate.y, src/raptor_internal.h: Fix time header check + with HAVE_ prefix + + * configure.ac, src/parsedate.y, src/raptor_internal.h: Fix + headers after removal of AC_HEADER_TIME + +2021-10-09 Dave Beckett + + * configure.ac, src/parsedate.y: Remove and fix obsolete autoconf + - Give AC_PROG_LEX an argument + - Remove AC_HEADER_TIME + - Remove AC_HEADER_STDC and uses + - Update explicit header checks adding getopt.h unistd.h + +2021-09-20 Dave Beckett + + * INSTALL.html, LICENSE.html, README.html: + 2021 + +2021-09-19 Dave Beckett + + * NEWS.html, RELEASE.html: + Document CVE-2017-18926 fix commit + + * tests/rdfxml/Makefile.am: add bug-650.out + +2021-09-18 Dave Beckett + + * src/raptor_xml_writer.c: + XML Writer : compare namespace + declarations correctly Apply patch from + 0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch.1 + that fixes Issue#0000650 + https://bugs.librdf.org/mantis/view.php?id=650 which overwrote heap + during XML writing in parse type literal content. This was detected + with clang asan. Thanks to Michael Stahl / mst2 for the fix. + + * tests/rdfxml/CMakeLists.txt, tests/rdfxml/Makefile.am, + tests/rdfxml/bug-650.out, tests/rdfxml/bug-650.rdf: + Add Issue + #0000650 example to trigger clang asan failure + + * README.html, utils/rapper.1: + Mention Atom 0.3 in docs and manual + page Fixes Issue#0000652 https://bugs.librdf.org/mantis/view.php?id=652 + +2020-10-25 Dave Beckett + + * docs/raptor2-sections.txt: Add raptor_avltree_trim + + * Remove callers of deprecated raptor_www setters + +2020-10-25 Dave Beckett + + * src/raptor_grddl.c, src/raptor_parse.c, src/raptor_www_test.c: + Remove callers of deprecated raptor_www setters + +2020-10-23 Dave Beckett + + * docs/raptor2-sections.txt, src/raptor2.h.in, src/raptor_parse.c, + src/raptor_www.c: Add raptor_www setters taking value string + length and returning error code on failure errors + + (raptor_www_set_user_agent2): Added, deprecating + raptor_www_set_user_agent. + + (raptor_www_set_proxy2): Added, deprecating + raptor_www_set_proxy. + + (raptor_www_set_http_accept2): Added, deprecating + raptor_www_set_http_accept. + + Fixes Issue #0000649 + https://bugs.librdf.org/mantis/view.php?id=649 + +2020-10-06 Dave Beckett + + * src/turtle_common.c: + (raptor_stringbuffer_append_turtle_string): Work around clang + --analyze warning not understanding ownership model + + * src/raptor_sax2.c: + (raptor_sax2_start_element): Work around clang --analyze warning + not understanding ownership model + + * src/raptor_uri.c: Use RAPTOR_LEN_FILE_CSS + +2020-09-29 Dave Beckett + + * src/.gitignore: ignore .c.bak + + * Merge pull request #43 from akimd/update-bison-usage Update + bison usage + +2020-09-24 Akim Demaille + + * src/turtle_parser.y: Stylistic change in the parser Propose a + shorter, more readable (IMHO) approach to typing tokens. + + * src/turtle_parser.y: Use per-type Bison destructors rather than + per symbols + + I can see two differences, and I believe this is an improvement: + before we were not reclaiming memory associated to + blankNodePropertyList and GRAPH_NAME_LEFT_CURLY. Now we do. + + * src/turtle_parser.y: Use Bison directives rather than CPP macros + + "%define parse.error verbose" is supported since 3.0, and support + for YYERROR_VERBOSE (deprecated since Bison 2.6, 2012-07-19), was + removed in 3.6. + +2020-09-20 Dave Beckett + + * src/raptor_ntriples.c: + (raptor_ntriples_parse_term): Free N-Triples datatype_uri + +2020-09-18 Dave Beckett + + * .travis.yml: Travis CI: Add clang ASAN on Linux + +2020-09-13 Dave Beckett + + * src/raptor_avltree.c: + (raptor_avltree_delete_internal): Handle deleting empty tree. + Fixes invalid pointer reference reported by Li Qiang via email. + + * src/raptor_qname.c: cast for warning + + * src/raptor_namespace.c: Do not declare any functions if + STANDALONE + + * configure.ac, src/raptor_nfc_icu.c: Use newer ICU NFC check for + ICU V56 or newer (raptor_nfc_icu_check): Switch to use + unorm2_quickCheck() for ICU >= 56 + + * docs/raptor2-sections.txt, src/raptor2.h.in, + src/raptor_namespace.c: Add raptor_rdf_schema_namespace_uri_len to + API Update raptor_namespace_test to define strings once to avoid + ASAN odr-violation test failure. + +2020-09-12 Dave Beckett + + * Merge pull request #42 from hughmcmaster/pkgconfig configure.ac: + Remove unused LIBXSLT_VERSION variable + +2020-09-08 Dave Beckett + + * .travis.yml: Remove slow (un-necessary) brew update for Travis + OSX build + +2020-09-08 Dave Beckett + + * Merge pull request #41 from hughmcmaster/pkgconfig Add + additional pkg-config support + +2020-08-21 Hugh McMaster + + * configure.ac: configure.ac: Use PKG_CHECK_MODULES to detect the + ICU library + +2020-09-08 Dave Beckett + + * src/CMakeLists.txt: Guess at making cmake do the same change to + turtle_lexer.h + +2020-09-07 Dave Beckett + + * scripts/fix-flex.pl, src/Makefile.am, src/turtle_parser.y: Fix + turtle_lexer__scan_bytes signatures for C++ - scripts/fix-flex.pl: + Fix length type call for newer flex naming convention - Run flex + output header file through fix-flex.pl + + * .travis.yml, scripts/install-bison3.sh: Travis config and + install-bison3.sh updates + + * .travis.yml: Add experimental builds for Travis for cmake, ppc, + arm64 + + * src/raptor_grddl.c, src/raptor_internal.h, src/raptor_json.c, + src/raptor_libxml.c, src/snprintf.c: Supporess worning to allow + YAJL2 to use long long in API + + * CMakeLists.txt: Add bison and flex versions to CMake + + * src/raptor_abbrev.c: + (raptor_print_abbrev_po): Another signature fix + + * src/raptor_abbrev.c: + (raptor_print_abbrev_po): Fix signature with casting + + * src/raptor_qname.c: Protect some debug messages from null URI + +2020-09-06 Dave Beckett + + * src/raptor_internal.h: Include ICU (vi libxml) in C++ context if + running under C++ + + * src/raptor_internal.h: Fix GCC version check that was not + working around IGNORE_FORMAT_NONLITERAL_START + + * src/turtle_parser.y: + Correct error callbacks for raptor and + mid-parsing + + (turtle_parser_error): Parsing error handling with scanner context + (turtle_parser_error_simple): Added for error handling for raptor + functions, matching the raptor_simple_message_handler method + + * INSTALL.html, configure.ac, scripts/install-bison3.sh, + src/parsedate.y, src/turtle_common.c, src/turtle_common.h, + src/turtle_lexer.l, src/turtle_parser.y: Move to bison 3.4+ + + * src/turtle_parser.y: + (turtle_parser_error): Allow and pass on varargs error + + * src/raptor_grddl.c: + (grddl_free_xml_context): Remove unused context Just free + xml_context via userdata arg. Fix callers + +2020-09-05 Dave Beckett + + * Merge pull request #40 from himajin100000/zero_on_failure + Documentation says "0 on failure." At least size_t >= 0 + +2020-09-05 Dave Beckett + + * Merge pull request #38 from hroptatyr/feat/turtle-flush provide + raptor_turtle_serialize_flush() + +2020-09-05 Dave Beckett + + * src/turtle_lexer.l, tests/trig/Makefile.am, + tests/trig/issue-37.out, tests/trig/issue-37.trig: Add test that + fails for PR#37 + + Pull request + https://github.com/dajobe/raptor/pull/37 + +2019-04-08 himajin100000 + + * src/turtle_common.c: + Documentation says "0 on failure." At least + size_t >= 0 + +2018-06-01 Adam Novak + + * scripts/fix-bison.pl, scripts/install-bison3.sh: Update to work + with Bison 3.0.5 + +2018-02-09 Sebastian Freundt + + * src/raptor2.h.in: fix, PEBKAC, actually declare + raptor_avltree_trim() as it is implemented + +2018-02-08 Sebastian Freundt + + * src/raptor2.h.in, src/raptor_avltree.c, + src/raptor_serialize_turtle.c: fix, actually trim the avltrees + after successful emission upon raptor_serialize_flush() + + * src/raptor_serialize_turtle.c: provide + raptor_turtle_serialize_flush() + + This changeset clones raptor_turtle_serialize_end() as + raptor_turtle_serialize_flush() without the reset for the header. + This, via raptor_serializer_flush(), allows for fine grained + emission of turtle statements. + +2018-02-07 Sebastian Freundt + + * src/turtle_parser.y: + This changeset fixes an issue with the turtle + chunk parser which defers statements internally to pick up the work + with the next chunk. + + Should the chunk parser not be called anymore any statements + recorded as deferred would be lost. An example to reproduce the + bug (TriG mode): + { [ a ] .} + + With this fix applied the above correctly produces the following 2 + quads: + _:genid1 . _:genid1 + . + +2017-07-01 Dave Beckett + + * src/raptor_xml_writer.c: + (raptor_xml_writer_start_element_common): Add and use + XML_LANG_PREFIX define + +2017-04-16 Dave Beckett + + * src/raptor2.h.in: Write UTF-8 for JSON literals + + Add #RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8 to + #RAPTOR_ESCAPED_WRITE_JSON_LITERAL and document why + + Fixes Issues #0000606 + https://bugs.librdf.org/mantis/view.php?id=606 + + * src/raptor_xml.c, src/raptor_xml_writer.c: Make nsd compare + methods handle NULLs (raptor_nsd_compare, + raptor_xml_writer_nsd_compare): Sort NULLs separate and avoid + strcmp() where those are undefined. + + * src/raptor_xml_writer.c: Calcualte max nspace declarations + correctly for XML writer + + (raptor_xml_writer_start_element_common): Calculate max including + for each attribute a potential name and value. + + Fixes Issues #0000617 + https://bugs.librdf.org/mantis/view.php?id=617 + and #0000618 + https://bugs.librdf.org/mantis/view.php?id=618 + + * src/sort_r.h: Accept cygwin as a Linux-like Fixes Issue + #00000600 https://bugs.librdf.org/mantis/view.php?id=600 + +2017-04-02 Dave Beckett + + * src/raptor_uri.c: Add _POSIX_C_SOURCE for lstat() in test code + +2017-01-08 Dave Beckett + + * .travis.yml: Add back OSX brew gtk-doc so autogen.sh works + + * src/raptor_internal.h: Annotate raptor_simple_message_handler as + having format arg. + + * src/snprintf.c: Define _GNU_SOURCE it not already set + + * src/raptor_avltree.c, src/raptor_grddl.c, src/raptor_internal.h, + src/raptor_rss_common.c, src/raptor_serialize_rdfxmla.c, + src/raptor_serialize_rss.c, src/raptor_serialize_turtle.c: Add + RAPTOR_VOIDP macro for casting fprint %p object arguments. + + * src/snprintf.c: + [c++] Test pointer against NULL rather than use as implicit bool + + * .travis.yml: + Travis: No need to install gtk-doc for OSX now + + * .travis.yml: + Travis: --disable-gtk-doc for speed + + * scripts/process-changes.pl: + Ignore changes from raptor v1 to v2 + + * librdfa/rdfa_utils.c: + cast for C++ + + * INSTALL.html, LICENSE.html, NEWS.html, README.html, + RELEASE.html, TODO.html, UPGRADING.html, docs/raptor-docs.xml: + 2017 + + * configure.ac, librdfa/curie.c, librdfa/iri.c, librdfa/lists.c, + librdfa/rdfa_utils.c, librdfa/rdfa_utils.h, src/Makefile.am, + src/raptor_internal.h, src/strdup.c: Get rid of strdup configure + code; move to librdfa. Easier to replace strdup() calls in + librdfa/ with it's own version and just alway use it. Remove + strdup checks from configure.ac + (rdfa_strdup): Added. Updated all callers. + + * configure.ac, src/Makefile.am, src/raptor_internal.h, + src/raptor_rdfxml.c, src/raptor_rss.c, src/raptor_uri.c, + src/raptor_www_curl.c, src/strdup.c: Portability fixes for C11 and + newer clang + + - Fix some RAPTOR_ASSERT_DIE() calls to have an arg value. + - Add strdup.c for when it is missing and a configure check. + - Write special configure.ac checks for strdup and strtok_r to + work (ie fail) when there functions are not defined in headers. + - Update compiler warning arguments: + - Add -std=c11 so it'll try to use C11 if available + - Add -Wstrict-overflow + - Add -Wpedantic + - Remove -Wno-conversion -Wno-sign-conversion that are no longer + warnings + - For clang (OSX) always add -Wno-nullability-completeness since even + stdio.h fails this. + - Remove duplicate functions in AC_CHECK_FUNCS that AC_HEADER_STDC + already calls. + - Move maintainer mode warning flags very early so they get picked + up by tests. + + * src/raptor_general.c, src/raptor_www.c: Fix RAPTOR_ASSERT and + RAPTOR_ASSERT_DIE call args + + * configure.ac: Pull out OSX-specific and clang-specific warnings + OSX 10.2 + clang is too noisy with warnings in stdio.h + + * scripts/fix-flex.pl, src/turtle_parser.y: + Fixes for newer flex Testing with flex 2.6.3 + +2017-01-07 Dave Beckett + + * src/raptor_internal.h: + (OSX) clang fix for ignoring -Wformat-nonliteral + + * src/raptor_internal.h: RAPTOR_ASSERT() macro: Pass return arg to + RAPTOR_ASSERT_DIE() + + * ChangeLog, NEWS.html, RELEASE.html: 2.0.16 + +2016-11-14 Dave Beckett + + * Merge pull request #36 from ariadnext/cmake-GNUInstallDirs + cmake: use GNUInstallDirs for install paths + +2016-10-06 Eric Le Lay + + * CMakeLists.txt, src/CMakeLists.txt, utils/CMakeLists.txt: use + GNUInstallDirs for install paths to be able to install + libraptor2.a and raptor2.pc to a specific directory when + cross-compiling + +2016-09-05 Dave Beckett + + * Merge pull request #34 from JervenBolleman/master + Change to count option of rapper to count in longs instead of ints + +2016-08-29 Stephan Bergmann + + * src/raptor_uri.c: -fsanitize=nonnull-attribute + +2016-08-05 Jerven Bolleman + + * utils/rapper.c: Untested change to count option of rapper to + count in longs instead of ints + +2015-12-29 Dave Beckett + + * src/raptor_general.c: Fix RAPTOR_ASSERT_DIE() call + +2015-12-12 Dave Beckett + + * RELEASE.html: html + +2015-10-27 Dave Beckett + + * ChangeLog, NEWS.html, RELEASE.html: 2.0.16 changes + + * Merge pull request #33 from schnitzeltony/master + configure.ac: do additional checks on libxml2 when library is found + +2015-10-27 Andreas Müller + + * configure.ac: + configure.ac: do additional checks on libxml2 when library is found + + In yocto cross environments we must use pkg-config. Configuring with + + --without-xml2-config + --without-curl-config + + causes + + | checking for LIBXML... yes + | checking for libxml via pkg-config... yes - 2.9.2 + | checking for LIBCURL... yes + | checking for libcurl via pkg-config... yes - 7.44.0 + | checking for ICU... no + | checking for yajl installation... not found. Get it from http://lloyd.github.com/yajl/ and use --with-yajl=DIR if necessary to configure the installation directory. + | checking GRDDL parser requirements... no - libxml2 and libxslt are both not available + + Applying this patch fixes configuration. + + Signed-off-by: Andreas Müller + +2015-07-20 Dave Beckett + + * .travis.yml, scripts/install-bison3.sh: Revert "Make Travis-CI + run in a container" + This reverts commit e02d2c43ad2c3e2ba5a9279861c943c9559f967e. + + * .travis.yml, scripts/install-bison3.sh: Make Travis-CI run in a + container + +2015-07-05 Dave Beckett + + * utils/rdfdiff.c: + (rdfdiff_new_blank) resource leak on error [CID 122405] + +2015-07-05 Dave Beckett + + * utils/rdfdiff.c: + (rdfdiff_new_file) resource leak on error [CID 122404] + +2015-05-03 Dave Beckett + + * src/turtle_lexer.l: + (YY_FATAL_ERROR): Remove never reachable abort() after longjmp() + + * Merge pull request #32 from dajobe/openbsd-fixes Fixes for + OpenBSD + +2015-05-02 Dave Beckett + + * librdfa/subject.c: Define BNODE_BUFFER_LEN + + * librdfa/rdfa.c: Fix librdfa end_element() generation without + sprintf + + * src/raptor_uri.c: remove another sprintf() + + * src/raptor_abbrev.c, src/raptor_librdfa.c, src/raptor_rss.c, + src/raptor_www.c: Several #ifdef fixes to avoid code after abort() + + * src/raptor_general.c, src/raptor_internal.h: Make + RAPTOR_ASSERT_DIE take parameter for non-abort case To prevent gcc + 'will never be executed' warnings. + + * librdfa/rdfa.c, librdfa/subject.c, src/turtle_lexer.l: Remove + sprintf() and replace with snprintf() or hard-coded format + + * examples/grapper.c, librdfa/curie.c, utils/rdfdiff.c: Remove + strcpy() and replace with count and memcpy() + + * src/raptor_grddl.c, src/raptor_internal.h, src/raptor_libxml.c, + src/snprintf.c: OpenBSD fixes + +2015-04-24 Dave Beckett + + * .gitignore, scripts/.gitignore, src/.gitignore, utils/.gitignore: + Update .gitignore + + * Merge pull request #29 from 0u812/cmake-update-squashed + CMake build system upgrade to allow building from git sources + +2015-04-24 Dave Beckett + + * tests/feeds/test01-result.atom, tests/feeds/test02-result.atom, + tests/feeds/test03-result.atom: Fix atom results after serializer + changes + +2015-04-23 0u812 <0u812@github.com> + + * appveyor.yml: don't split echo command + + * appveyor.yml: + Update appveyor.yml to let CMake build the lexers/parsers + + Also download latest Cygwin setup due to the one installed + on appveyor being out of date + + Squashed commit of the following: + + commit 103bee37c4a215494f4929a00497ced9238c8164 + Author: 0u812 <0u812@github.com> + Date: Thu Apr 23 14:20:30 2015 -0700 + + add CYG_SETUP_URL + + commit b4ef42b2c2449089a6295c19c2cced0bd485cade + Author: 0u812 <0u812@github.com> + Date: Thu Apr 23 14:12:07 2015 -0700 + + download latest Cygwin setup + + commit 02d81375698a12b52ef4c0a61af2f105c214d5c7 + Author: 0u812 <0u812@github.com> + Date: Wed Apr 22 23:24:55 2015 -0700 + + specify path to Cygwin-installed Perl/Bison/Flex in shared build as well + + commit 20e5181b1d2b098179d199e67d47ef24dbebafd9 + Author: 0u812 <0u812@github.com> + Date: Wed Mar 4 16:01:44 2015 -0800 + + prevent appveyor script from generating parser tables (done in + CMake instead) + +2015-03-23 Dave Beckett + + * src/raptor_serialize_rss.c: RSS 1.0 serializing default + namespaces fixes. + + Separate default namespace from root element namespace + - Root element is rdf:RDF for rss 1.0 always + - Attributes are always rdf:name + +2015-02-01 Dave Beckett + + * autogen.sh: Handle updated glibtoolize (OSX) name in --version + +2015-01-29 0u812 <0u812@github.com> + + * CMakeLists.txt, tests/rdfa/CMakeLists.txt, + tests/rdfa11/CMakeLists.txt: Make rdfa/rdfa11 tests expected + failures (they are not counted as failing tests, so get 100% + passing). + + Reject Bison at CMake config stage if major version + is older than 3. + + -- + + Squashed commit of the following: + + commit 5394d2817384d8ca18ca4b8f8b2eefd34aa60f4c + Author: 0u812 <0u812@github.com> + Date: Thu Jan 29 14:49:51 2015 -0800 + + add rdfa11 expected failures + + commit 1c205f2444dfe7b4341a08e35c00cc9627f58d3b + Author: 0u812 <0u812@github.com> + Date: Thu Jan 29 14:44:44 2015 -0800 + + add rdfa expected failures + + commit 81fbc40f08c430267559998024fdbaef5f67b532 + Author: 0u812 <0u812@github.com> + Date: Thu Jan 29 14:41:42 2015 -0800 + + allow expected failures for tests + + workaround: TRUE is not true in a CMake if statement + + commit cae280b8ad68f98f8256b11db2f7ca7ae51aa7e1 + Author: 0u812 <0u812@github.com> + Date: Thu Jan 29 14:11:20 2015 -0800 + + RAPPER_RDFDIFF_TEST func + + commit 14fa0f99419729b815c94e429a983174f0cc26fd + Author: 0u812 <0u812@github.com> + Date: Thu Jan 29 13:41:27 2015 -0800 + + specify bison ver + +2015-01-22 0u812 <0u812@github.com> + + * src/parsedate.y, src/turtle_parser.y: Required version of Bison + too specific. + + Must use 3.0 avail. via win_flex_bison-2.5.1. Compiles on Windows + via CMake with this change. + + * src/CMakeLists.txt: missed a few paths + + * src/CMakeLists.txt: use abs paths in custom commands/targets + +2015-01-21 0u812 <0u812@github.com> + + * CMakeLists.txt, src/CMakeLists.txt: Upgrade CMake build system + to allow building from source. Generate parsers and + tokenizers using flex/bison. Tested compile on FC21 with GNU + Bison 3.0.2 and flex 2.5.37. + + Squashed commit of the following: + + commit 680a64599970b07d9e4c797bf9ae876536257ac1 + Author: 0u812 <0u812@github.com> + Date: Wed Jan 21 13:42:21 2015 -0800 + + fix turtle flex dep + + commit 4de1288bbf84b18834332747e30e3ca6c92fa301 + Author: 0u812 <0u812@github.com> + Date: Wed Jan 21 13:35:28 2015 -0800 + + find flex + + commit 446387d3778ebb760f395e354e3b6cfeb1c700f7 + Author: 0u812 <0u812@github.com> + Date: Wed Jan 21 13:30:46 2015 -0800 + + LIBXML2_INCLUDE_DIRS wrong var; use LIBXML2_INCLUDE_DIR + + commit 76e852ef1acc2309c1a78c6e264fd7c538edd633 + Author: 0u812 <0u812@github.com> + Date: Wed Jan 21 13:26:32 2015 -0800 + + correct cmake rename command + + commit 109c4a3159e338af0e0aa6c886110ea9e31749c6 + Author: 0u812 <0u812@github.com> + Date: Tue Jan 20 12:21:35 2015 -0800 + + resolve paths of src and generated files + + commit 5d8366ef60d72e99f5bac3c29e68c903b16265dd + Author: 0u812 <0u812@github.com> + Date: Tue Jan 20 12:17:05 2015 -0800 + + headers are not sources + + commit 93e8ed1765ccc0da449a4515a264843954199838 + Author: 0u812 <0u812@github.com> + Date: Tue Jan 20 12:11:34 2015 -0800 + + fix output names + + commit 0a7e13ca88b4ffb6c0bf73b9eb635478cd852846 + Author: 0u812 <0u812@github.com> + Date: Tue Jan 20 12:10:32 2015 -0800 + + add turtle flex tgt + + commit 11c76cfa21b0457bb67411a1eae230c5f2f89008 + Author: 0u812 <0u812@github.com> + Date: Tue Jan 20 12:02:25 2015 -0800 + + fix dependencies for autogenerated tgts + + commit d30f99cecd27872edc5b9e2c31bef8079a717171 + Author: 0u812 <0u812@github.com> + Date: Tue Jan 20 11:53:57 2015 -0800 + + add custom cmd to generate turtle parser + + +2015-01-15 Dave Beckett + + * Merge pull request #28 from philjohn/patch-1 + Fixing build errors using raptor2.spec + +2015-01-14 philjohn + + * raptor2.spec.in: + Fixing build errors using raptor2.spec + + The spec file uses the wrong libdir for raptor2, + /usr/lib(|64)/raptor instead of /usr/lib(|64)/raptor2, it also + excludes some files (.a and .la) that rpmbuild complains about. + +2015-01-07 Dave Beckett + + * docs/raptor-docs.xml: 2015 + +2015-01-04 Dave Beckett + + * INSTALL.html, LICENSE.html, NEWS.html, RELEASE.html, TODO.html, + UPGRADING.html: 2015 + +2015-01-01 Dave Beckett + + * Merge pull request #27 from dajobe/appveyor + CMake and windows fixes targetted for Appveyor builds + +2014-12-23 Dave Beckett + + * docs/tmpl/section-general.sgml: tmpls + +2014-12-22 Dave Beckett + + * Merge pull request #26 from hroptatyr/feat/turtle-chunk-parser + Provide turtle chunk parser + +2014-12-20 Sebastian Freundt + + * src/turtle_parser.y: Stop passing chunks to turtle_parser if + there have been errors + +2014-12-18 Dave Beckett + + * src/raptor_serialize_turtle.c: code style + +2014-12-18 Sebastian Freundt + + * src/turtle_common.h: + hygiene, kick superfluous slot `statement' + + It seems the turtle parser routines will use the `statement' slot + from the rdf_parser structure only. + +2014-12-17 Dave Beckett + + * src/raptor_serialize_turtle.c: fix comment + +2014-12-17 Sebastian Freundt + + * src/turtle_common.h, src/turtle_lexer.l, src/turtle_parser.y: + Provide turtle chunk parser + + This changeset allows to parse huge turtle, trig and n3 files. + Huge hereby means file sizes bigger than the main memory. It has + been tested on the GND dataset of the Deutsche Nationalbibliothek + (121 MTriples), the dbpedia dataset (583 MT) and a private + production dataset (1225 MT). + + Previously, the turtle parser tried to stack up all input in a + huge buffer which it then proceeded to process at once. + + This changeset introduces a parser that attempts to parse each + given chunk immediately. Syntax errors that arise due to + end-of-buffer situations in the middle of a grammar rule are + accounted for by resolving statements using the special `error' + rule accompanied with error recovery that copies over the + remainder of the buffer to the beginning so it can be appended by + the next chunk. + + Full turtle statements (the ones ending in DOT) will never be part + of the remainder. However, because of blank nodes and collections + statements can't be issued immediately anymore, instead the + concept of deferring the emission of a statement is introduced. + This is to avoid dangling (bnodeid) statements in case a turtle + SPO statement isn't DOT ended yet but the blank node property list + or collection has been read already. + + * struct raptor_turtle_parser_s: introduce slots for buffer book + keeping + * turtle_lexer.l: use YY_USER_ACTION to keep track of buffer + consumption + * turtle_parser.y: + (raptor_turtle_generate_statement): split in two, see following + (raptor_turtle_clone_statement): prepare statement for handling + (raptor_turtle_handle_statement): call a parser's statement handler + (raptor_turtle_defer_statement): like + raptor_turtle_generate_statement() but instead of calling the + statement handler immediately put it on a list of deferred + statements, called (handled) only if the statement rule path has + been taken (triples DOT) + (raptor_turtle_parse_chunk): begin parsing on chunks for every + call, only stack up things in buffers if the remainder of a chunk + has been resolved through the `error' rule. + +2014-12-17 Dave Beckett + + * src/raptor_serialize_turtle.c: Fix check + + * src/raptor_serialize_turtle.c: + (raptor_mkr_emit_subject_resultset): code style + + * src/raptor_serialize_turtle.c: Move + raptor_mkr_emit_subject_resultset statics into turtle context. + + struct raptor_turtle_context gains fields mkr_rs_size / arity / + ntuple / nvalue / processing_value + + (raptor_mkr_emit_subject_resultset): Switch statics to context + vars above. + + * Merge pull request #25 from rhmccullough/master change mKR + relation to SPARQL compatible CSV format + + * NEWS.html, RELEASE.html: 2.0.16 + + * utils/rapper.c, utils/rdfdiff.c: Restore space between title and + version + +2014-12-15 Dave Beckett + + * scripts/process-changes.pl: Warn if no difference seen in + functions + +2014-12-14 Sebastian Freundt + + * src/raptor_uri.c: + fix, do fputs() properly + +2014-12-05 Dave Beckett + + * scripts/install-bison3.sh: Update install bison script to do + nothing if bison is new enough + +2014-11-25 Dave Beckett + + * src/raptor_grddl.c: Disable "-Wformat-nonliteral" with GCC + pragma for GRDDL error format + +2014-11-24 Dave Beckett + + * src/raptor_avltree.c, src/raptor_escaped.c, + src/raptor_general.c, src/raptor_grddl.c, + src/raptor_json_writer.c, src/raptor_librdfa.c, + src/raptor_ntriples.c, src/raptor_rdfxml.c, src/raptor_rss.c, + src/raptor_rss_common.c, src/raptor_serialize_dot.c, + src/raptor_serialize_html.c, src/raptor_serialize_json.c, + src/raptor_serialize_rdfxml.c, src/raptor_serialize_rdfxmla.c, + src/raptor_serialize_rss.c, src/raptor_serialize_turtle.c: Replace + type %d (for enums) with %u in error messages (-Wformat) + +2014-11-23 Dave Beckett + + * configure.ac: + Redisable -Wconversion - generated lexer too noisy + + * librdfa/curie.c, src/ntriples_parse.c, src/raptor_grddl.c, + src/raptor_internal.h, src/raptor_iostream.c, + src/raptor_ntriples.c, src/raptor_parse.c, src/raptor_sax2.c, + src/raptor_serialize_turtle.c, src/raptor_stringbuffer.c, + src/raptor_unicode.c, src/raptor_www_curl.c, src/raptor_xml.c: + Fixes for -Wconversion + - casting into to char near tolower and constructing chars from + ints + - unsigned int foo : 1 for bit flag + - raptor_stringbuffer_length() to unsigned int + + * configure.ac: Enable -Wconversion + + * src/snprintf.c: Disable "-Wformat-nonliteral" with GCC pragma + for snprintf test code + +2014-11-22 Dave Beckett + + * src/raptor_libxml.c: Disable GCC -Wformat-literal in a few + places using GCC pragma + + Using #pragma GCC diagnostic <...> from + https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html + + * utils/rapper.c, utils/rdfdiff.c: Remove static string printfs in + utilities (-Wformat) + + * configure.ac, src/raptor_internal.h, src/raptor_parse.c, + src/raptor_rdfxml.c: Enable -Wformat=2 for gcc and fix that + + (raptor_parser_log_error): Added to allow passing in format + message and log level. + + Use above in cases where a message can be an error or warning so + that -Wformat=2 will work with gcc: it can now check all + printf-style formats used in Raptor. + + * RELEASE.html: 2.0.16 + + * .travis.yml: docs + + * scripts/install-bison3.sh: Install bison with a C compiler + + * .travis.yml: try compile c++ + + * .travis.yml: Add matrix for CC=cc, CC=c++ + +2014-11-21 Dave Beckett + + * Merge pull request #21 from rhmccullough/master fix memory + leak with format, meaning + + * docs/Makefile.am, scripts/Makefile.am, scripts/fix-groff-xhtml, + scripts/fix-groff-xhtml.pl, utils/Makefile.am: Rename + scripts/fix-groff-xhtml to scripts/fix-groff-xhtml.pl + +2014-11-20 Richard H. McCullough + + * src/raptor_serialize_turtle.c: set pointers to NULL after + freeing memory + + I even ran "make distcheck" this time. I noticed a few permission + errors, but I don't worry about those because Windows ACLs often + take control of your files. + + * src/raptor_serialize_turtle.c: fix memory leak with format, + meaning check just before return at end of function + +2014-11-19 Dave Beckett + + * docs/Makefile.am: Add $(EXEEXT) to build-formats exe name + + * src/raptor_internal.h, src/raptor_serialize_turtle.c, + src/raptor_turtle_writer.c, tests/mkr/rdf-schema.mkr, + tests/mkr/rdfq-results.mkr, tests/mkr/rdfs-namespace.mkr, + tests/mkr/test-07.mkr, tests/mkr/test-08.mkr, + tests/mkr/test-16a.mkr, tests/mkr/test-28.mkr, + tests/mkr/test-31.mkr, tests/mkr/test-32.mkr, + tests/mkr/test-34.mkr: Add mkr turtle writer flag, move it out of + internal API. + + @base ends in ; raptor_turtle_writer_flags is now part of internal + API with bitflag values TURTLE_WRITER_FLAG_AUTO_INDENT and + TURTLE_WRITER_FLAG_MKR + + (raptor_new_turtle_writer): Gains flags arg. + + (raptor_turtle_writer_namespace_prefix, raptor_turtle_writer_base): + Lose emit_mkr arg and take it from the turtle_writer struct flags + field. Update mkr tests to end @base lines with ';' like other + mkr lines. + +2014-11-16 Dave Beckett + + * src/raptor_serialize_turtle.c: Remove trailing ws from lines + + * src/raptor_serialize_turtle.c: Code style fixes around mkr + serializer code + + * src/raptor_serialize_turtle.c: Free rs_ResultSet_uri and + rs_resultVariable_uri + +2014-11-14 Dave Beckett + + * NEWS.html, RELEASE.html: 2.0.16 + + * README.html, docs/raptor-serializers.xml: Add mKR serializer + references to docs + + * Merge pull request #18 from dajobe/mkr-serializer mKR serializer + - single commit + +2014-11-12 Dave Beckett + + * scripts/fix-bison.pl, scripts/fix-gtkdoc-header.pl: Update perms + + * scripts/Makefile.am: Add AM_CPPFLAGS + +2014-11-04 Dave Beckett + + * src/raptor_parse.c, src/raptor_serialize.c: Fix error returns in + new world methods + + (raptor_world_get_parser_factory, + raptor_world_get_serializers_count): Fix return value in + assertions + +2014-11-01 Dave Beckett + + * CMakeLists.txt, NEWS.html, RELEASE.html, configure.ac: Bumped + version to 2.0.16 + + * Snapshotted raptor2_2_0_15 for 2.0.15 release (GIT 815e4a75a0e1f15a5cf35de48a3d0b32a14c5663) + + * src/turtle_lexer.l, tests/trig/Makefile.am, + tests/trig/bug-584-dos.out, tests/trig/bug-584-dos.trig, + tests/trig/bug-584-unix.out, tests/trig/bug-584-unix.trig: Handle + \r in TRiG "graph-name {" + + Fixes Issue #0000584 + https://bugs.librdf.org/mantis/view.php?id=584 + + * src/turtle_lexer.l: + (turtle_token_print): Add GRAPH_NAME_LEFT_CURLY + + * src/turtle_lexer.l: + (turtle_token_print): Add LEFT/RIGHT_CURLY + + * src/turtle_lexer.l: + (main): Fix turtle_lexer_test to pass in string, not use yyinput + + * tests/ntriples/Makefile.am, tests/ntriples/bug-577.nt, + tests/ntriples/bug-577.out: Add ntriples test bug-577 for URI + escaping + + * src/turtle_common.h, src/turtle_parser.y: Rename + raptor_turtle_expand_name_escapes to + raptor_turtle_expand_qname_escapes + + * src/raptor_internal.h, src/turtle_common.c, src/turtle_lexer.l: + (raptor_stringbuffer_append_turtle_string): Enforce URI + restrictions. + + Add is_uri argument to distinguish. Report type label correctly. + URIs may not have \t \b \n \r \f or raw ' ' or \u0020 or \u003C or + \u003E + + Update all raptor_stringbuffer_append_turtle_string callers to + pass URI flag. + + * src/raptor_ntriples.c: + (raptor_ntriples_parse_term_internal): Enforce URI restrictions. + URIs may not have \t \b \n \r \f or raw ' ' or \u0020 or \u003C or + \u003E + + * src/raptor_internal.h, src/raptor_ntriples.c, + src/turtle_common.c, src/turtle_lexer.l: + Remove raptor_turtle_check_uri_string() which is at wrong level. + + Needs to be checked in earlier lexing so e.g. illegal escapes in + URIs such as \b are found. For example. + +2014-10-28 Dave Beckett + + * docs/raptor-changes.tsv, docs/raptor2-sections.txt, + src/raptor2.h.in, src/raptor_parse.c, src/raptor_serialize.c: + (raptor_world_get_parsers_count, + raptor_world_get_serializers_count): Added + + Fixes Issue #0000581 + https://bugs.librdf.org/mantis/view.php?id=581 + +2014-10-26 Dave Beckett + + * src/raptor_general.c: doc fix + + Fixes Issue #0000579 + https://bugs.librdf.org/mantis/view.php?id=579 + + * src/raptor_iostream.c: Code tidy; use nobj for + raptor_iostream_write_bytes() return value. + + Related to Issue #0000575 fix + + * src/raptor_iostream.c: + Fix return values for + raptor_iostream_{hexa,}decimal_write + + (raptor_iostream_decimal_write, + raptor_iostream_hexadecimal_write): Return non-0 if number of + objects returned from raptor_iostream_write_bytes() does not match + expected length. + + Fixes Issue #0000575 + https://bugs.librdf.org/mantis/view.php?id=575 + + * src/raptor_ntriples.c, src/raptor_term.c, + tests/ntriples/Makefile.am, tests/ntriples/bug-574.nt, + tests/ntriples/bug-574.out: Accept '_' as alias/typo for '-' in + lang strings. + + Replace on parsing. + Fixes Issue #0000574 + https://bugs.librdf.org/mantis/view.php?id=574 + +2014-10-20 Dave Beckett + + * Merge pull request #16 from rhmccullough/rdf-nil do not change + "( )" to "rdf:nil" + +2014-10-19 Dave Beckett + + * docs/Makefile.am, docs/raptor-1-to-2-map.tsv, + docs/raptor-changes.tsv: Rename changes file to raptor-changes.tsv + + Not just about v1 to v2 + + * scripts/process-changes.pl: Make process-changes.pl report wrong + fields count + + * .travis.yml: run autogen.sh not configure twice + + * scripts/install-bison3.sh: + delete working dir + + * scripts/install-bison3.sh: sudo + + * .travis.yml: Looks like Travis OS support is not generally + available + + http://blog.travis-ci.com/2014-05-13-multi-os-feature-available/ + +2014-10-19 Richard H. McCullough + + * src/raptor_serialize_turtle.c: do not change "( )" to "rdf:nil" + + In tests/turtle: rapper -i turtle -o turtle test-08.ttl + changes "( )" to "rdf:nil". + This change to src/raptor_serialize_turtle.c will produce "( )" in + the output file. + +2014-10-19 Dave Beckett + + * .travis.yml: Quote TRAVIS_OS_NAME that doesn't always seem to be + defined + + * .travis.yml: use test not [ ] + + * RELEASE.html: 2.0.15 + + * .travis.yml, scripts/install-bison3.sh: Travis update attempt + +2014-10-12 Dave Beckett + + * tests/rdfa11/Makefile.am: doc + + * tests/rdfa11/0297.out, tests/rdfa11/Makefile.am: 0297 passes + + * tests/rdfa11/0303.out, tests/rdfa11/Makefile.am: 0303 passes + + * tests/rdfa11/Makefile.am: 26 failures + + * tests/rdfa11/0235.out, tests/rdfa11/Makefile.am: 0235 passes + + * tests/rdfa11/Makefile.am: Fix error report again + + * tests/rdfa11/0134.out: fix 134 out + + * tests/rdfa11/0134.out, tests/rdfa11/Makefile.am: 0134 passes + + * tests/rdfa11/0197.out, tests/rdfa11/Makefile.am: 0197 passes + + * tests/rdfa11/Makefile.am: 0197 now fails, 0302 now passes. + + * tests/rdfa11/Makefile.am: Tidy failure output + + * tests/rdfa11/0295.out: Update 0295 output + +2014-10-10 Dave Beckett + + * librdfa/curie.c: Support full URLs for typeof. + librdfa commit 5b73975a778ee00f328457356a69163911d540a5 + +2014-10-09 Dave Beckett + + * src/Makefile.am: Further fix flex/bison rules to silence them in + normal runs + + * configure.ac, src/parsedate.y, src/raptor_internal.h, + src/raptor_rdfxml.c: Use __FUNCTION__ (c99) replacing __func__ + (c90) + + * src/sort_r.h: Add BSD header checks from sort_r + + * src/raptor_turtle_writer.c: Trailing , + + * configure.ac: Add some GCC5 warning flags + + * Merge pull request #14 from hroptatyr/compiler-support Intel C + compiler (icc) support + +2014-10-09 Sebastian Freundt + + * librdfa/rdfa.c, librdfa/triple.c, utils/rapper.c: const'ify + string literals and char pointers that needn't be changed + + librdfa (start_element): const'ify umap_key + librdfa (rdfa_complete_object_literal_triples): const'ifty + current_object_literal + rapper (print_graph): const'ify label + + * configure.ac: Always use AC_LANG_WERROR when checking for + compiler warning flags + + Many gcc-compatible compilers (icc, clang, etc.) verbosely ignore + gcc command line flags issuing a warning of some sort. Catch + these warnings and turn them into errors when checking for support + of specific warning flags. + +2014-10-04 Dave Beckett + + * scripts/Makefile.am, scripts/fix-bison, scripts/fix-bison.pl, + scripts/fix-flex, scripts/fix-flex.pl, src/Makefile.am: Rename + fix-flex, fix-bison to have .pl suffix + + * ChangeLog, NEWS.html, RELEASE.html: + 2.0.15 + +2014-09-25 Dave Beckett + + * src/raptor_grddl.c: + (raptor_grddl_filter_triples): Fix check [gcc5] + + This has been broken since 2007 but just meant too much work was + being done. Original commit that added this + 8bb88c9c4a5800b1163b50d2ff12b5245b4b1498 + +2014-08-21 Dave Beckett + + * utils/rdfdiff.c: Provide title and usage if args are missing + [Coverity CID 72385] + +2014-08-09 Dave Beckett + + * src/raptor_term.c: + (raptor_new_term_from_blank): Accept "" as same as NULL blank + +2014-08-04 Dave Beckett + + * src/raptor_uri.c: raptor_uri_counted_filename_to_uri_string + handles a counted string + + (raptor_uri_counted_filename_to_uri_string): Do not look for end + NUL char, count lengths. + + Fixes Issue #0000576 + https://bugs.librdf.org/mantis/view.php?id=576 + + * src/raptor_turtle_writer.c: + raptor_turtle_writer_quoted_counted_string handles a counted + string + + (raptor_turtle_writer_contains_newline): Add len param and use it, + drop strlen(). + + (raptor_turtle_writer_quoted_counted_string): Use len, drop + strlen() and call raptor_turtle_writer_contains_newline with + passed in len. + + Fixes Issue #0000576 + https://bugs.librdf.org/mantis/view.php?id=576 + + * src/raptor_uri.c: + Do not assume NUL terminated string in + raptor_new_uri_from_counted_string + + (raptor_new_uri_from_counted_string): Remove debug assert and use + fwrite to emit counted URI string to debug file handler. + + Fixes Issue #0000576 + https://bugs.librdf.org/mantis/view.php?id=576 + + * src/raptor_internal.h, src/turtle_parser.y: Add RAPTOR_DEBUG_FH + define internally + +2014-08-02 Dave Beckett + + * INSTALL.html: Fix flex url + +2014-07-27 Dave Beckett + + * src/raptor_iostream.c: Document sink handlers + +2014-07-26 Dave Beckett + + * src/raptor_rfc2396.c: + (raptor_uri_normalize_path): Check size of output buffer is big + enough. + +2014-07-07 Dave Beckett + + * README.html, INSTALL.html: bye bye sf + + * README.html: Update TRiG pointer, conformance + +2014-06-29 Dave Beckett + + * src/sort_r.c: correct docs; does not always use sort_r + + * src/ssort.h: one more rename + + * docs/raptor-1-to-2-map.tsv, src/raptor2.h.in, + src/raptor_sequence.c, src/sort_r.c: + raptor_data_compare_arg_handler renamed from raptor_sort_r_compare + Added it to changelog too + + * src/sort_r.c: Make sort test quiet on success + + * src/sort_r.c: const + + * src/sort_r.c: portability + + * configure.ac, src/Makefile.am, src/sort_r.c, src/ssort.h: + Add + public domain ssort_r if qsort_r and qsort_s are not present + + * docs/raptor-1-to-2-map.tsv, src/raptor2.h.in, + src/raptor_sequence.c: + (raptor_sequence_sort_r): Added based on raptor_sort_r() + + * docs/raptor-1-to-2-map.tsv, src/Makefile.am, src/raptor2.h.in, + src/sort_r.c: + (raptor_sort_r): Added based on public domain sort_r() + + * src/sort_r.h, sort_r.c: Public Domain sort_r() by Isaac Turner + Imported GIT commit 7c60ef94753624291055af0b1eec291f8c4bd5a7 from + https://github.com/noporpoise/sort_r + +2014-05-21 Dave Beckett + + * src/parsedate.y: + Update to point to PHP GIT + + * src/parsedate.y: Fix -99 <= var <= 99 timezone interval check. + Thanks to Richard Trieu for the report. + +2014-05-11 Dave Beckett + + * docs/raptor-docs.xml: 2014 + +2014-05-09 Dave Beckett + + * src/raptor_locator.c, src/snprintf.c: + (raptor_locator_format): Add a NUL to terminate output string. + See librdf commit aa3bf4ccf4cc9381a1c198566428812af28944de that + works around this. + +2014-05-05 Dave Beckett + + * utils/rapper.1: Use \- for hyphen + + * CMakeLists.txt, NEWS.html, RELEASE.html, configure.ac: Bumped + version to 2.0.15 + + * ChangeLog: + Snapshotted raptor2_2_0_14 for 2.0.14 release (GIT + 93bc8ef8fa1c0b6b4278412f5d12e558b70db708) + + * src/raptor_uri.c: fix autodoc + + * NEWS.html, RELEASE.html: 2.0.14 + + * Update tmpls + + * Snapshotted raptor2_2_0_14 for 2.0.14 release (GIT 93bc8ef8fa1c0b6b4278412f5d12e558b70db708) + +2014-05-03 Dave Beckett + + * configure.ac: Import flex check from rasqal + +2014-04-28 Dave Beckett + + * scripts/fix-bison: Remove dead code from bison output + +2014-04-27 Dave Beckett + + * tests/rdfa/Makefile.am: Fix failure test and update expected + failures: +0294.xml +0349.xml + + * tests/rdfa11/Makefile.am: Echo message when failures are not + what expected + + * librdfa/rdfa.c: + (rdfa_init_base): Fix Fixes support broke in commit + 9447e886ad66a1c3dd2c877341feca639824488a + +2014-04-26 Dave Beckett + + * tests/rdfa11/Makefile.am: Fail exit on test failures - broken + for a long itme + + * src/turtle_parser.y: + (collection): Use YYERR_MSG_GOTO to stop early break and add debug + info + + * src/turtle_parser.y: Import header code from turtle-parser.y + +2014-04-20 Dave Beckett + + * configure.ac, src/turtle_lexer.l: Define FLEX_VERSION_DECIMAL + and use to not duplicate column prototypes. + + * scripts/fix-flex: Convert buffer check for PREFIX_restart into + simple form + + * scripts/fix-flex: Use YY_CURRENT_BUFFER_LVALUE in + PREFIX_pop_buffer_state [coverity CID 29295] + + * scripts/fix-flex: pop_buffer_state does not get changed with + rule; delete ref + + * src/turtle_lexer.l: YY_FATAL_ERROR always calls abort() - + hopefully coverity notices + + * scripts/fix-flex: + Remove dead code after YY_INPUT - which is a + return NULL [coverity CID 29302] + + * scripts/fix-flex: + Match (static) yy_ prefix functions too + + * scripts/fix-flex: + Use YY_CURRENT_BUFFER_LVALUE when ensured ok + [coverity CID 29242 29252 29253 29295] + + Rewrite YY_CURRENT_BUFFER to YY_CURRENT_BUFFER_LVALUE in some + functions after a PREFIX_ensure_buffer_stack() call has been seen. + + * scripts/fix-flex: + Give function processing a state var %fn_state + + * scripts/fix-flex: Cleanups - Figure out lexer prefix from input + - Capture current function name in $cur_function - Rewrite some + checks to use exact function name - Added $debug var + +2014-04-19 Dave Beckett + + * scripts/fix-bison: Set yytoken to non-negative value for + [coverity CID 29259] + + * scripts/fix-bison: Add a default value for yyformat for + [coverity CID 10838] + + * src/raptor_xml.c: Added coverity[negative_returns] for second + use of unichar_len [CID 29257] + + * librdfa/lists.c: + (rdfa_complete_list_triples): Init tmp for error path [coverity + CID 36737] + + * src/raptor_grddl.c: + (raptor_grddl_run_xpath_match): Free base_uri on error path + [coverity CID 34618] + + * src/raptor_serialize_turtle.c: + (raptor_turtle_emit_subject): Free iterator on error path [coverity + CID 34617] + +2014-04-18 Dave Beckett + + * src/raptor_serialize_rss.c: + (raptor_rss10_emit_rdfxml_item_triples): root_element NULL [coverity + CID 34616] (raptor_rss10_emit_rdfxml_item_triples): start xml root_element if + not NULL [coverity CID 34616] + + * librdfa/curie.c: + (rdfa_resolve_uri): Check end_index2 is not NULL [coverity CID + 29261] + + * librdfa/lists.c: + (rdfa_complete_list_triples): strdup and strstr output. [coverity + CID 29260] + + (rdfa_complete_list_triples): Be careful for strdup and strstr + returning NULL. [coverity CID 29260] + + * src/raptor_namespace.c: Check return of raptor_xml_escape_string + for errors [coverity CID 29258] + + (raptor_namespace_format_as_xml): Check return values of + raptor_xml_escape_string() for negative failure before casting to + size_t. + + * src/raptor_iostream.c: + (test_read_from_filename): Use int for read bytes values + + * src/raptor_parse.c: Treat raptor_iostream_read_bytes() returning + int [coverity CID 29256] + + (raptor_parser_parse_iostream): Treat raptor_iostream_read_bytes() + return as int, convert to size_t when it's known to be + non-negative. [coverity CID 29256] The real fix is incompatible + API change to make iostream return size_t or ssize_t for reads. + + * src/raptor_serialize_rdfxml.c: + (raptor_rdfxml_serialize_statement): Restore *name always [coverity + CID 29255] + + * librdfa/rdfa.c: + (end_element): Do not call rdfa_complete_list_triples() with no + new subject [coverity CID 29254] + + * src/raptor_xml_writer.c: + (raptor_xml_writer_start_element_common): attribute namespaces + [coverity CID 29244] + + (raptor_xml_writer_start_element_common): Process attribute + namespaces only if there is a namespace stack [coverity CID 29244] + + * src/raptor_librdfa.c: rdfa requires a base URI [coverity CID + 29250] + + (raptor_librdfa_parse_start): Add check for base URI + (raptor_librdfa_parser_register_factory): Mark 'rdfa' parser needs + a base URI. + + * librdfa/triple.c: + (rdfa_complete_object_literal_triples) strchr on NULL [coverity CID + 29429] + + (rdfa_complete_object_literal_triples): Need non NULL + context->xml_literal to do strchr() on it [coverity CID 29429] + + * src/raptor_serialize_rdfxml.c: + (raptor_rdfxml_serialize_statement): Remove always 0 + end_predicate_element [coverity CID 29238] + + * src/raptor_serialize_rss.c: + (raptor_rss10_emit_rdfxml_item_triples): Free root_qname in logical + place [coverity CID 29236] + + * src/raptor_xml_writer.c: + (raptor_xml_writer_start_element_common): nstack [coverity CID + 29244] + + (raptor_xml_writer_start_element_common): Defining xml language + declaration requires namespace declarations so add nstack check. + + * src/raptor_grddl.c: + (raptor_grddl_run_xpath_match): Check if uri_string is not NULL + [coverity CID 29243] + + * src/raptor_log.c: + (raptor_log_error): Allow world to be NULL [coverity CID 29241] + + * src/raptor_log.c: + (raptor_log_error_varargs): Allow world to be NULL [coverity CID + 29241] + + * librdfa/triple.c: + (rdfa_complete_current_property_value_triples): Remove duplicate + variable [coverity CID 29240] + + * src/raptor_grddl.c: + (raptor_grddl_parse_chunk): Remove logically dead code [coverity CID + 29239] loop is always 0 or 1 so don't check for other values. + + * src/raptor_serialize_rss.c: + (raptor_rss10_emit_rdfxml_item_triples): Remove logically dead code + [coverity CID 29237] No need to test freeing serializer twice. + + * src/raptor_grddl.c: + (raptor_grddl_run_grddl_transform_doc): Check parse start/chunk + returns [coverity CID 29235] + + * src/raptor_serialize_turtle.c: + (raptor_turtle_emit_subject): check raptor_avltree_iterator_next() + return [coverity CID 29234] + +2014-04-17 Dave Beckett + + * src/raptor_parse.c: + (raptor_parser_fatal_error): set parser failed if not NULL [coverity + CID 29283] + + * src/raptor_xml_writer.c: + (raptor_xml_writer_start_element_common): nspace_declarations is + never NULL on return path [coverity CID 29284] + + * src/raptor_xml_writer.c: + (raptor_xml_writer_start_element): element is not NULL [coverity CID + 29285] + + * src/raptor_rss.c: + (raptor_rss_end_element_handler): rss_element is never NULL + [coverity CID 29286] + + * src/raptor_abbrev.c: + (raptor_new_abbrev_subject): Do not use subject->properties on debug + path [coverity CID 29287] + + * src/raptor_uri.c: + (raptor_uri_counted_filename_to_uri_string): Error path cannot use + NULL buffer [coverity CID 29302] + + * src/raptor_serialize_rdfxml.c: + (raptor_rdfxml_serialize_statement): Free object_uri_string always + [coverity CID 29269] + + * src/raptor_serialize_turtle.c: + (raptor_turtle_emit_subject_collection_items): Free iter on error + [coverity CID 29263] + + * src/turtle_lexer.l: Free stringbuffer on error case [coverity + CID 29273] + +2014-04-16 Dave Beckett + + * librdfa/rdfa.c: + (rdfa_init_base): Fix uri_start dead code again [coverity CID 29700] + + * src/raptor_abbrev.c: + (raptor_new_abbrev_subject): node arg is never NULL [coverity CID + 29288] + + * src/raptor_qname.c: + (raptor_new_qname_from_namespace_local_name): move strlen after + local_name NULL check [coverity CID 29289] + + * utils/rdfdiff.c: + (main): from_string and to_string are never NULL [coverity CID + 29290, CID 29291] + + * librdfa/triple.c: + (rdfa_complete_object_literal_triples): NULL check for + context->xml_literal [coverity CID 29292] + + * src/raptor_serialize_rdfxmla.c: + (raptor_rdfxmla_serialize_set_xml_writer): Check xml_writer NULL + [coverity CID 29293] + + * src/raptor_log.c: + (raptor_log_error_varargs): Can assume world is not NULL [coverity + CID 29294] + + * librdfa/rdfa.c: + (end_element): Add parent_context check around block [coverity CID + 29296] + + * librdfa/rdfa.c: + (rdfa_init_base): Check for uri_start before use [coverity CID + 29297] + + * src/raptor_serialize_turtle.c: + (raptor_turtle_emit_subject_collection_items): Free iter on error + path [coverity CID 29263] + + * src/raptor_parse.c: + (raptor_world_guess_parser_name): Free scores on error path + [coverity CID 29264] + + * src/raptor_grddl.c: + (raptor_grddl_run_recursive): Free ibuffer [coverity CID 29265] + + * src/raptor_rss.c: + (raptor_rss_end_element_handler): Free field on error path [coverity + CID 29266] + + * src/raptor_rss.c: + (raptor_rss_insert_rss_link): Free field on error path [coverity CID + 29267] + + * src/raptor_serialize_rdfxml.c: + (raptor_rdfxml_serialize_statement): Free object_uri_string on error + path [coverity CID 29269] + + * src/raptor_serialize_rss.c: + (raptor_rss10_serialize_end): Error path entry_uri cleanup [coverity + CID 29270] + + * librdfa/lists.c: + (rdfa_complete_list_triples): Free bnode after loop [coverity CID + 29272] Also strdup() the rdf:nil string so it can be freed. + + * src/turtle_lexer.l: Free stringbuffer on error case [coverity + CID 29273] + + * docs/raptor-1-to-2-map.tsv, docs/raptor2-sections.txt, + src/raptor2.h.in, src/raptor_internal.h, src/raptor_rfc2396.c, + src/raptor_uri.c: Added raptor_uri_counted_filename_to_uri_string + + (raptor_uri_counted_filename_to_uri_string): Added based on + raptor_uri_filename_to_uri_string. Updated to properly check the + length of the incoming filename and ensure (on unix) that the path + buffer is big enough. Eliminate strcat() calls while here. For + win32, properly calculate the length when there is a :\ in the + filename. RAPTOR_FATAL4 added for debugging URI length failures + + * src/turtle_common.c: (raptor_turtle_expand_name_escapes): arg + free on error path [coverity CID 29303] + + (raptor_turtle_expand_name_escapes): Remove RAPTOR_FREE of name + argument on error paths - this function does not own name. + +2014-03-24 Dave Beckett + + * ChangeLog, ChangeLog.14, Makefile.am: ChangeLog.14 for 2013 + +2014-03-24 Dave Beckett + + * librdfa/lists.c, librdfa/rdfa.c: librdfa fixes for + -Wunreachable-code (clang) + +2014-02-24 Dave Beckett + + * src/raptor_general.c, src/raptor_json.c, src/raptor_rss.c, + src/raptor_turtle_writer.c: Fixes for -Wunreachable-code (clang) + + (raptor_rss_insert_identifiers): When inserting identifiers, allow + the loop to continue searching. + + (raptor_rss_start_namespaces): Remove loop since 1 value is + enough. + + * configure.ac: Add -Wunreachable-code (clang) + +2014-02-13 Dave Beckett + + * tests/turtle-2013/Makefile.am, tests/turtle-2013/oops.nt, + tests/turtle-2013/oops.ttl: Add test and expected response for RDF + 1.1 Turtle post-REC error + + Announced: + http://lists.w3.org/Archives/Public/public-rdf-comments/2014Feb/0018.html + Expected answer requested: + http://lists.w3.org/Archives/Public/public-rdf-comments/2014Feb/0020.html + +2014-02-12 Dave Beckett + + * tests/ntriples-2013/LITERAL.nt, + tests/ntriples-2013/LITERAL_all_controls.nt, + tests/ntriples-2013/LITERAL_all_punctuation.nt, + tests/ntriples-2013/LITERAL_with_2_dquotes.nt, + tests/ntriples-2013/LITERAL_with_2_squotes.nt, + tests/ntriples-2013/LITERAL_with_UTF8_boundaries.nt, + tests/ntriples-2013/LITERAL_with_dquote.nt, + tests/ntriples-2013/LITERAL_with_squote.nt, + tests/ntriples-2013/Makefile.am, tests/ntriples-2013/README, + tests/ntriples-2013/literal.nt, + tests/ntriples-2013/literal_all_controls.nt, + tests/ntriples-2013/literal_all_punctuation.nt, + tests/ntriples-2013/literal_with_2_dquotes.nt, + tests/ntriples-2013/literal_with_2_squotes.nt, + tests/ntriples-2013/literal_with_UTF8_boundaries.nt, + tests/ntriples-2013/literal_with_dquote.nt, + tests/ntriples-2013/literal_with_squote.nt: Renames to match W3C + mercurial repo names + +2014-01-29 Dave Beckett + + * CMakeLists.txt, NEWS.html, RELEASE.html, configure.ac: Bumped + version to 2.0.14 + + * Snapshotted raptor2_2_0_13 for 2.0.13 release (GIT + fde3f210e7442de6de16c410443fd8a695f09820) + +2014-01-29 Dave Beckett + + * NEWS.html, RELEASE.html: + 2.0.13 + +2014-01-27 Dave Beckett + + * ChangeLog, INSTALL.html, LICENSE.html, NEWS.html, README.html, + RELEASE.html, TODO.html, UPGRADING.html: 2.0.13 and 2014 + + * configure.ac: Use presence of libxml / curl config programs as + test for presence + + Symptom was that after configuring, curl was present but not used + for WWW fetching. + + Original commit that changed this was + commit 7da03ba5cd6e45ea41afebd4955acf6e96e9d622 + Date: Fri Apr 5 19:01:55 2013 +0100 + + which was Raptor 2.0.10 onwards + +2014-01-15 Dave Beckett + + * autogen.sh: Create NEWS and README + +2014-01-14 Dave Beckett + + * Makefile.am: fix html rules more + + * .travis.yml: Travis CI fix + + * Makefile.am: fix html rule + +2014-01-10 Dave Beckett + + * src/raptor_abbrev.c: + Revert: (raptor_abbrev_subject_find): Remove + double free of lookup_node. + + This reverts commit c1c82f1be5d86ebf95fa10b86a938d6799e35626. + + * src/raptor_rfc2396.c: + (raptor_uri_resolve_uri_reference): Handle NULL ref->path + + * src/raptor_abbrev.c: + (raptor_abbrev_subject_find): Remove double free of lookup_node + Remove call to raptor_free_abbrev_node() + +2014-01-07 Dave Beckett + + * configure.ac: Use AC_CHECK_PROGS to find jing + AC_CHECK_PROG doesn't default to setting it as found! + +2014-01-04 Dave Beckett + + * src/raptor_general.c: 2014 + + * src/turtle_lexer.l: Remove YY_INPUT - never want to read from + stdin/file + +2014-01-02 Dave Beckett + + * Merge pull request #12 from dajobe/bison3.0-new Switch to use + and require Bison 3.0 + + * src/turtle_lexer.l: Provide missing flex prototypes for flex + 2.5.35 or earlier + + * src/parsedate.y: + (raptor_parse_date): No need for cast to void* for yyparse + +2014-01-01 Dave Beckett + + * src/turtle_parser.y: Remove redundant declaration of + turtle_lexer_lex + + * configure.ac, src/Makefile.am: Alter configure to accept bison + 3.0.0 or newer, no yacc + + * src/parsedate.y: Add bison 3.0 directives + + * src/parsedate.y: Bison 3.0 the parsedate parser + + - Update to new directives + - Set %param + - Update error call + + * src/turtle_parser.y: Bison 3.0 the turtle parser + + - Use bison 3.0+ directives replacing all command line arguments + - Update lexer and parser parameters (remove use of YYLEX_PARAM) + - (turtle_parser_error): Add scanner arg. + - Use rdf_parser argument directly rather than via casted variable. + - Add %empty directives + - Remove casts to raptor_parser* that are no longer needed + - (turtle_parse): Pass in scanner + + * src/turtle_parser.y: Remove YY_DECL + + * src/turtle_lexer.l: Add %option bison-bridge + + * src/turtle_lexer.l: Remove turtle_lexer_lex prototype / header + override + + No longer use YYDECL - the default works. + + * src/turtle_lexer.l: Replace turtle_parser_lval with yylval + + * src/turtle_common.c: Move turtle_lexer.h include earlier so + YYSTYPE can be found + + * src/turtle_lexer.l, src/turtle_parser.y: Remove token union + unused integer field + diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..e82fd21 --- /dev/null +++ b/INSTALL @@ -0,0 +1,368 @@ +Installation Instructions +************************* + + Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free +Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell command './configure && make && make install' +should configure, build, and install this package. The following +more-detailed instructions are generic; see the 'README' file for +instructions specific to this package. Some packages provide this +'INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The 'configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that +you can run in the future to recreate the current configuration, and a +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). + + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. + + If you need to do unusual things to compile the package, please try +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can +be considered for the next release. If you are using the cache, and at +some point 'config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. + + The simplest way to compile this package is: + + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. + + Running 'configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type 'make' to compile the package. + + 3. Optionally, type 'make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type 'make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the 'make install' phase executed with root + privileges. + + 5. Optionally, type 'make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior 'make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type 'make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide 'make + distcheck', which can by used by developers to test that all other + targets like 'make install' and 'make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the 'configure' script does not know about. Run './configure --help' +for details on some of the pertinent environment variables. + + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU 'make'. 'cd' to the +directory where you want the object files and executables to go and run +the 'configure' script. 'configure' automatically checks for the source +code in the directory that 'configure' is in and in '..'. This is known +as a "VPATH" build. + + With a non-GNU 'make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use 'make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple '-arch' options to the +compiler but only a single '-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the 'lipo' tool if you have problems. + +Installation Names +================== + + By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to 'configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +'make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, 'make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. + +Optional Features +================= + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the +package recognizes. + + For packages that use the X Window System, 'configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of 'make' will be. For these packages, running './configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with 'make V=1'; while running './configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with 'make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC +is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + HP-UX 'make' updates targets which have the same timestamps as their +prerequisites, which makes it generally unusable when shipped generated +files such as 'configure' are involved. Use GNU 'make' instead. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its '' header file. The option '-nodtk' can be used as a +workaround. If GNU CC is not installed, it is therefore recommended to +try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put '/usr/ucb' early in your 'PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in '/usr/bin'. So, if you need '/usr/ucb' +in your 'PATH', put it _after_ '/usr/bin'. + + On Haiku, software installed for all users goes in '/boot/common', +not '/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features 'configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, 'configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option '--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with '--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for 'configure' scripts to share, +you can create a site shell script called 'config.site' that gives +default values for variables like 'CC', 'cache_file', and 'prefix'. +'configure' looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to 'configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the 'configure' command line, using 'VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified 'gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +'configure' Invocation +====================== + + 'configure' recognizes the following options to control how it +operates. + +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. + +'--help=short' +'--help=recursive' + Print a summary of the options unique to this package's + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' + script, and exit. + +'--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally 'config.cache'. FILE defaults to '/dev/null' to + disable caching. + +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to '/dev/null' (any error + messages will still be shown). + +'--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + 'configure' can determine that directory automatically. + +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. + +'--no-create' +'-n' + Run the configure checks, but stop before creating any output + files. + +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/INSTALL.html b/INSTALL.html new file mode 100644 index 0000000..94b1142 --- /dev/null +++ b/INSTALL.html @@ -0,0 +1,381 @@ + + + + + Raptor RDF Syntax Library - Building and Installing from Source + + + +

Raptor RDF Syntax Library - Building and Installing from Source

+ + +

1. Getting the sources

+ +

There are several ways to get the sources. The most stable and +tested versions are the sources shipped with each release and these +are recommended as the first place to start. If you want to get a +newer set, then there are nightly snapshots made of the development +sources, which may not yet be committed to GIT. For the +latest developent sources, anonymous GIT access is available +but this may require some configuring of developer tools that are not +needed for the snapshot releases. +

+ +

The source bundle and package files contain all the HTML files and +documentation provided on the web site. +

+ +

1.1 Getting the sources from releases

+ +

This is the recommended source to build and install raptor. It +ensures that a tested and working set of files are used.

+ +

The released sources are available from +https://download.librdf.org/source/ (master site). +Do not use GitHub tagged tarballs, they are not the same thing and +are not supported. +

+ + +

1.2 Getting the sources from GIT

+ +

This is the recommended source for developers. It provides +the latest beta or unstable code. For a stable version, use a release +as described above.

+ +
+  git clone git://github.com/dajobe/raptor.git
+  cd raptor
+
+ +

At this stage, or after a git pull you will +need to create the automake and autoconf derived files, as described +below in Create the configure program +by using the autogen.sh script. +

+ +

Building Raptor in this way requires some particular development +tools not needed when building from snapshot releases - automake, +autoconf, libtool, gtkdocize and their dependencies. +The autogen.sh script looks for the newest versions of +the auto* tools and checks that they meet the minimum versions. +

+ +

gtkdocize can be found in the gtk-doc-tools package +on Debian-based systems such as Ubuntu, gtk-doc package +on RPM based systems such as Redhat and Fedora and in the homebrew +and macports package gtk-doc on OSX.

+ +

2. Configuring and building

+ +

Raptor uses the GNU automake and autoconf to handle system +dependency checking. It is developed and built on x86 Linux +and x86 OSX but is also tested on other systems occasionally. +

+ +

Raptor has several optional libraries:

+
    +
  • The libxml2 XML library (2.6.8 or newer) for parsing XML syntaxes.
  • +
  • Libcurl, libxml2 or libfetch for retrieving URIs.
  • +
  • libxslt (requiring libxml2 also) to provide the XSLT functionality for the + GRDDL and microformats parser.
  • +
  • YAJL to provide JSON + parsers if it is available.
  • +
  • ICU to provide + Unicode NFC checking only if enabled with + --with-icu-config
  • +
+ +

2.1. Create configure program

+ +

If there is a configure program, skip to the next +section.

+ +

If there is no configure program, you can create it +using the autogen.sh script, as long as you have the +automake and +autoconf +tools. This is done by: +

+
+  ./autogen.sh
+
+

and you can also pass along arguments intended for configure (see +below for what these are): +

+
+  ./autogen.sh --prefix=/usr/local/somewhere
+
+ +
+

On OSX you may have to explicitly set the LIBTOOLIZE +variable for the libtoolize utility since on +OSX libtoolize is a different program. The full +path to the utility should be given: +

+
+  LIBTOOLIZE=/opt/local/bin/glibtoolize ./autogen.sh
+
+
+ +

Alternatively you can run them by hand with: +

+
+  aclocal; autoheader; automake --add-missing; autoconf
+
+ +

The automake and autoconf tools have many different versions and +at present development is being done with automake 1.11.1 (minimum +version 1.11), autoconf 2.65 (minimum version 2.62) and libtool 2.2.10 +(minimum version 2.2.0). These are only needed when compiling from +GIT sources. autogen.sh enforces the requirements. +

+ +

Raptor also requires specific versions of +flex and +GNU Bison +to build lexers and parsers. configure will warn or fail if they +are missing or the installed versions are too old. +These are only required when building from GIT. +

+ + +

2.2 Options for configure

+ +

Raptor's configure supports the following options: +

+ +
+
--disable-nfc-check
+

Disable Unicode Normal Form C (NFC) checking code. +The code primarily consists of large tables plus some checking code +which can be removed from the library with this option. All NFC +checks will succeed when this is disabled. +

+ +
--enable-debug
+

Enable debug messages (default not enabled). +Maintainer mode automatically enables this. +

+
+ +
--enable-parsers=PARSERS
+

Pick the RDF parsers to build from the list:
+rdfxml ntriples turtle rss-tag-soup
+The default when this option is omitted is to enable all parsers. +grddl requires libxml2 and libxstl so may not always be +available. If all parsers are not enabled, parts of the test suite +will likely fail. +

+ +

The parsers that a built library supports can be found from the +API level using functions such as +raptor_parsers_enumerate and +raptor_syntaxes_enumerate or from the +rapper utility in the help message. +

+ +
--enable-serializers=SERIALIZERS
+

Pick the RDF serializers to build from the list:
+rdfxml ntriples rdfxml-abbrev
+The default when this option is omitted is to enable all serializers. +If all serializers are not enabled, parts of the test suite will +likely fail. +

+ +

The serializers that a built library supports can be found from the +API level using functions such as +raptor_serializers_enumerate or from the +rapper utility in the help message. +

+ +
--with-memory-signing
+

Enable signing of memory allocations so that when memory is +allocated with malloc() and released free(), a check is made that the +memory was allocated in the same library. +

+ +
--with-www=NAME
+

Pick a WWW library to use - either curl, +xml (for libxml), libwww for W3C libwww or +none to disable it. +

+ +
--with-xml2-config=NAME
+

Set the path to the libxml xml2-config program. +The default is to look for this on the PATH. +

+ +
--with-xslt-config=NAME
+

Set the path to the libxslt xslt-config program. +The default is to look for this on the PATH. +

+ +
--with-curl-config=NAME
+

Set the path to the libcurl curl-config program. +The default is to look for this on the PATH. +

+ +
--with-icu-config=NAME
+

Set the path to the ICU +icu-config program. This will NOT be searched for on the PATH. +

+ +
--with-libwww-config=NAME
+

Legacy option that used to support the libwww library. +

+ +
--with-yajl=DIR|no
+

Build against YAJL +installed into directory DIR or with 'no', disable looking +for YAJL. The default is to search a set of common installation directories +such /opt/local, /usr/local and /usr. +

+ +
+ +

2.3 Configuring

+ +

The default configuration will install into /usr/local: +

+
+   ./configure
+
+ +

To install into the standard Unix / Linux (and also Cygwin) system +directory, use: +

+
+   ./configure --prefix=/usr
+
+ + +

Append to the line any additional options you need like this: +

+
+   ./configure --prefix=/usr --enable-parsers=rdfxml
+
+ + +

2.4 Compiling

+ +

Compile the library and the rapper utility with: +

+
+   make
+
+

Note: GNU make is probably required which may be called +gmake or gnumake if your system has a different make available too. +

+ + +

2.5 Testing

+ +

Raptor has a built-in test suite that can be invoked with: +

+
+  make check
+
+ +

which should emit lots of exciting test messages to the screen but +conclude with something like:
+ All n tests passed
+if everything works correctly. There will be some Unicode NFC +checking tests that give ignored failures in 1.3.2 or later as NFC +checking has been temporarily removed. +

+ + +

2.6 Installing

+ +

Install the library and the rapper utility into the area +configure with --prefix (or /usr/local if not given) +with:

+
+   make install
+
+

Note: This may require root access if the destination area is +a system directory such as /usr. In that case you may have to do +sudo make install. +

+ + +

3. Using the library

+ +

Raptor includes a full tutorial and reference manual +for the library. These are installed into +PREFIX/share/gtk-doc/html/raptor +and are also available from the +Raptor web site. +

+ +

In addition, the examples in the tutorial as well as some other +example programs are available in the examples +sub-directory. These can be compiled with: +

+
+   cd examples
+
+   # Raptor GUI - only if you have the GTK libraries
+   make grapper
+
+   # If you have all requirements
+   make examples
+
+ + +

3.2 rapper utility

+ +

Raptor provides an RDF syntax utility program called +rapper which can do a variety of parsing and serializing operations. +

+ +

rapper can be run over RDF/XML content like this: +

+ +
+  rapper https://librdf.org/raptor/raptor.rdf
+
+ +

Raptor can also extract RDF content inside general XML when the +-f scanForRDF feature is enabled. For example if some +RDF/XML is embedded inside some SVG, it could be extracted with: +

+ +
+  rapper -f scanForRDF /path/to/test/pic.svg
+
+ +

You can also run it on other syntaxes such as +N-Triples +files with the -i option like this: +

+ +
+  rapper -i ntriples test.nt
+
+ +

The default output is a simple statement dump format, but it can +be changed to write +N-Triples +by using the -o option, like this: +

+ +
+  rapper -o ntriples dc.rdf
+
+ + +

See the rapper manual page for full details using 'man rapper' +or read the HTML version in docs/rapper.html or on the +Raptor website. +

+ + +
+ +

Copyright 2000-2023 Dave Beckett
Copyright 2000-2005 University of Bristol

+ + + diff --git a/LICENSE-2.0.txt b/LICENSE-2.0.txt new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/LICENSE-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/LICENSE.html b/LICENSE.html new file mode 100644 index 0000000..4eb80c9 --- /dev/null +++ b/LICENSE.html @@ -0,0 +1,99 @@ + + + + + Raptor RDF Syntax Library - License + + + +

Raptor RDF Syntax Library - License

+ +

This package is Free Software available under any one of the + specified licenses below, or any newer version of those licenses. + All the licenses below are alternatives and if you select one + license, that one alone applies. +

+ +

1. The GNU Lesser General Public License (LGPL) Version 2.1 or any newer version

+ +

See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html or COPYING.LIB for the full LGPL 2.1 license text. +

+ +
+ +
+

+Copyright (C) 2000-2023 Dave Beckett
+Copyright (C) 2000-2005 University of Bristol. +All Rights Reserved. +

+ +

This package is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License Version 2.1 as published by the Free Software Foundation + or any newer version. +

+ +

This package 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 Version 2.1 for more details. +

+ +

You should have received a copy of the GNU Lesser General + Public License Version 2.1 along with this package; if not, write + to the Free Software Foundation, Inc., 51 Franklin St, Fifth + Floor, Boston, MA 02110-1301 USA

+ +
+ +
+ +

2. GNU General Public License (GPL) V2 or any newer version

+ +

Under Term 3 of the LGPL Version 2.1, you may choose + to license the entire package under the GPL. If that option is + chosen, then this package is licensed under the terms of the + GPL Version 2 + or alternatively, any newer version of the GPL. + See COPYING for the full GPL 2.0 license text. +

+ + +

3. The Apache License V2.0 or any newer version

+ +

See https://www.apache.org/licenses/LICENSE-2.0 or LICENSE-2.0.txt for the full ASL 2.0 license text. +

+ +
+ +

+ Copyright (C) 2000-2023 Dave Beckett
+ Copyright (C) 2000-2005 University of Bristol. +

+ +

Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at:

+ +

https://www.apache.org/licenses/LICENSE-2.0

+ +

Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +

+
+ +

The NOTICE file contains the notices that + must be applied according to section 4(d) of the Apache License, + Version 2.0. +

+ +
+ +

Copyright (C) 2000-2023 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

+ + + diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f7b905f --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,66 @@ + Raptor RDF Syntax Library - License + + This package is Free Software available under any one of the specified + licenses below, or any newer version of those licenses. All the + licenses below are alternatives and if you select one license, that one + alone applies. + +1. The GNU Lesser General Public License (LGPL) Version 2.1 or any newer version + + See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html or + COPYING.LIB for the full LGPL 2.1 license text. + __________________________________________________________________ + + Copyright (C) 2000-2023 Dave Beckett + Copyright (C) 2000-2005 University of Bristol. All Rights Reserved. + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License Version + 2.1 as published by the Free Software Foundation or any newer + version. + + This package 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 Version 2.1 for more details. + + You should have received a copy of the GNU Lesser General Public + License Version 2.1 along with this package; if not, write to the + Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + MA 02110-1301 USA + __________________________________________________________________ + +2. GNU General Public License (GPL) V2 or any newer version + + Under Term 3 of the LGPL Version 2.1, you may choose to license the + entire package under the GPL. If that option is chosen, then this + package is licensed under the terms of the GPL Version 2 or + alternatively, any newer version of the GPL. See COPYING for the full + GPL 2.0 license text. + +3. The Apache License V2.0 or any newer version + + See https://www.apache.org/licenses/LICENSE-2.0 or LICENSE-2.0.txt for + the full ASL 2.0 license text. + + Copyright (C) 2000-2023 Dave Beckett + Copyright (C) 2000-2005 University of Bristol. + + Licensed under the Apache License, Version 2.0 (the "License"); you + may not use this file except in compliance with the License. You may + obtain a copy of the License at: + + https://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. + + The NOTICE file contains the notices that must be applied according to + section 4(d) of the Apache License, Version 2.0. + __________________________________________________________________ + + Copyright (C) 2000-2023 Dave Beckett + Copyright (C) 2000-2005 University of Bristol diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..f3b6545 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,69 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - top level automake file for Raptor +# +# Copyright (C) 2000-2013 David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2005 University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + + +SUBDIRS = librdfa src utils docs data tests examples scripts + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = raptor2.pc + +EXTRA_DIST=\ +CMakeLists.txt \ +README LICENSE.txt \ +README.html NEWS.html LICENSE.html INSTALL.html \ +README-cmake.md \ +RELEASE.html \ +LICENSE-2.0.txt NOTICE \ +UPGRADING.html \ +raptor2.rdf.in \ +autogen.sh \ +raptor2.spec.in \ +raptor2.pc.in + +if RELEASE_VERSION +EXTRA_DIST += raptor2.spec +endif + +DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc + +if MAINTAINER_MODE + +# Create some text files from HTML sources +LYNX=lynx +HTML_TO_TEXT=TERM=vt100 $(LYNX) -dump -nolist + +SUFFIXES = .html .txt + +.html.txt: + $(HTML_TO_TEXT) $< > $@ + +$(srcdir)/README: $(srcdir)/README.html + $(HTML_TO_TEXT) $< > $@ + +$(srcdir)/NEWS: $(srcdir)/NEWS.html + $(HTML_TO_TEXT) $< > $@ + +endif + +# Some people need a little help ;-) +test: check diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..45bb270 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,975 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - top level automake file for Raptor +# +# Copyright (C) 2000-2013 David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2005 University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@RELEASE_VERSION_TRUE@am__append_1 = raptor2.spec +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = raptor2.spec raptor2.rdf raptor2.pc +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkgconfigdir)" +DATA = $(pkgconfig_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/raptor2.pc.in \ + $(srcdir)/raptor2.rdf.in $(srcdir)/raptor2.spec.in \ + $(top_srcdir)/build/ar-lib $(top_srcdir)/build/compile \ + $(top_srcdir)/build/config.guess \ + $(top_srcdir)/build/config.sub $(top_srcdir)/build/install-sh \ + $(top_srcdir)/build/ltmain.sh $(top_srcdir)/build/missing \ + AUTHORS COPYING COPYING.LIB ChangeLog INSTALL NEWS README \ + build/ar-lib build/compile build/config.guess build/config.sub \ + build/depcomp build/install-sh build/ltmain.sh build/missing +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + if test -d "$(distdir)"; then \ + find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -rf "$(distdir)" \ + || { sleep 5 && rm -rf "$(distdir)"; }; \ + else :; fi +am__post_remove_distdir = $(am__remove_distdir) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +DIST_TARGETS = dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi +distuninstallcheck_listfiles = find . -type f -print +am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = librdfa src utils docs data tests examples scripts +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = raptor2.pc +EXTRA_DIST = CMakeLists.txt README LICENSE.txt README.html NEWS.html \ + LICENSE.html INSTALL.html README-cmake.md RELEASE.html \ + LICENSE-2.0.txt NOTICE UPGRADING.html raptor2.rdf.in \ + autogen.sh raptor2.spec.in raptor2.pc.in $(am__append_1) +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc + +# Create some text files from HTML sources +@MAINTAINER_MODE_TRUE@LYNX = lynx +@MAINTAINER_MODE_TRUE@HTML_TO_TEXT = TERM=vt100 $(LYNX) -dump -nolist +@MAINTAINER_MODE_TRUE@SUFFIXES = .html .txt +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .html .txt +am--refresh: Makefile + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): +raptor2.spec: $(top_builddir)/config.status $(srcdir)/raptor2.spec.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +raptor2.rdf: $(top_builddir)/config.status $(srcdir)/raptor2.rdf.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +raptor2.pc: $(top_builddir)/config.status $(srcdir)/raptor2.pc.in + cd $(top_builddir) && $(SHELL) ./config.status $@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-pkgconfigDATA: $(pkgconfig_DATA) + @$(NORMAL_INSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ + done + +uninstall-pkgconfigDATA: + @$(NORMAL_UNINSTALL) + @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @case `sed 15q $(srcdir)/NEWS` in \ + *"$(VERSION)"*) : ;; \ + *) \ + echo "NEWS not updated; not releasing" 1>&2; \ + exit 1;; \ + esac + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz + $(am__post_remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 + $(am__post_remove_distdir) + +dist-lzip: distdir + tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz + $(am__post_remove_distdir) + +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + +dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__post_remove_distdir) + +dist-shar: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz + $(am__post_remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__post_remove_distdir) + +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lz*) \ + lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ + $(AM_DISTCHECK_CONFIGURE_FLAGS) \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__post_remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @test -n '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: trying to run $@ with an empty' \ + '$$(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + $(am__cd) '$(distuninstallcheck_dir)' || { \ + echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ + exit 1; \ + }; \ + test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile $(DATA) +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: install-pkgconfigDATA + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-pkgconfigDATA + +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-libtool distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-pkgconfigDATA + +.PRECIOUS: Makefile + + +@MAINTAINER_MODE_TRUE@.html.txt: +@MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) $< > $@ + +@MAINTAINER_MODE_TRUE@$(srcdir)/README: $(srcdir)/README.html +@MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) $< > $@ + +@MAINTAINER_MODE_TRUE@$(srcdir)/NEWS: $(srcdir)/NEWS.html +@MAINTAINER_MODE_TRUE@ $(HTML_TO_TEXT) $< > $@ + +# Some people need a little help ;-) +test: check + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..388ec53 --- /dev/null +++ b/NEWS @@ -0,0 +1,747 @@ + Raptor RDF Syntax Library - News + +2023-03-01 Raptor2 Version 2.0.16 Released + + Fixes CVE-2017-18926 and CVE-2020-25713 + Multiple Appveyor Windows and CMake build fixes by 0u812. (Note: the + resulting binaries and libraries were not tested on Windows) + Turtle parser now reads input in chunks so can handle huge files. Patch + by Sebastian Freundt + Added a serializer for the mKR language. Patch by Richard H. + McCullough. + Rapper utility now counts triples using longs + Several smaller portability fixes for OpenBSD and cross building + + See the Raptor2 2.0.16 Release Notes for the full details of the + changes. + +2014-11-01 Raptor2 Version 2.0.15 Released + + Made several fixes to Turtle / N-Triples family of parsers and + serializers + Added utility functions for re-entrant sorting of objects and + sequences. + Made other fixes and improvements including fixing reported issues: + 0000574, 0000575, 0000576, 0000577, 0000579, 0000581 and 0000584. + + See the Raptor2 2.0.15 Release Notes for the full details of the + changes. + +2014-05-05 Raptor2 Version 2.0.14 Released + + Many code quality fixes from clang and coverity primarily in error path + cleanups (oom) and dead code. + Fixed Turtle 1.1 parser about triple quoting alignment with SPARQL + A few internal changes. + + See the Raptor2 2.0.14 Release Notes for the full details of the + changes. + +2013-01-29 Raptor2 Version 2.0.13 Released + + Fix configure not finding curl when curl-config --cflags is empty + Fixed reported issue: 0000562. + + See the Raptor2 2.0.13 Release Notes for the full details of the + changes. + +2013-12-13 Raptor2 Version 2.0.12 Released + + N-Triples / N-Quads parser updated to pass all the RDF 1.1 2013 tests + Added raptor_new_term_from_counted_string() + + See the Raptor2 2.0.12 Release Notes for the full details of the + changes. + +2013-11-24 Raptor2 Version 2.0.11 Released + + Completed support for RDF 1.1 N-Triples (aka N-Triples 2013) + Added a few new API calls + Made several build, portability and configuration improvements + Fixed reported issues: 0000554 and 0000556. + + See the Raptor2 2.0.11 Release Notes for the full details of the + changes. + +2013-07-27 Raptor2 Version 2.0.10 Released + + Completed support for Turtle Terse RDF Triple Language W3C Candidate + Recommendation 19 February 2013 (Turtle 2013) + Added support for N-Triples W3C Working Group Note 09 April 2013 + (N-Triples 2013) + Added a few new Turtle and N-Triples support functions + Update configure to better handle mixed pkg-config settings + Fixed reported issues: 0000532, 0000535, 0000545 and 0000548 + + See the Raptor2 2.0.10 Release Notes for the full details of the + changes. + +2013-02-26 Raptor2 Version 2.0.9 Released + + Added full parsing and serializing support for Turtle Terse RDF Triple + Language W3C Candidate Recommendation 19 February 2013 + Added CMake build framework for building Raptor on Microsoft (Daniel + Richard G.) + Made a few minor fixes and improvements + Fixed reported issues: 0000499, 0000508, 0000520, 0000521 and 0000526 + + See the Raptor2 2.0.9 Release Notes for the full details of the + changes. + +2012-06-24 Raptor2 Version 2.0.8 Released + + Added support for RDFa 1.1 via updated librdfa + Multiple portability fixes for Windows and Solarises. (Daniel Richard + G.) + Multiple minor fixes and improvements + Fixed reported issues: 0000381, 0000487, 0000505 and 0000507 + + See the Raptor2 2.0.8 Release Notes for the full details of the + changes. + +2012-03-22 Raptor2 Version 2.0.7 Released + + CVE-2012-0037 fixed + Removed Expat support + Removed internal Unicode NFC code for better and optional ICU + Added options for denying file requests and XML entity loading + Added options for SSL certificate verifying + Fixed reported issues: 0000448 and 0000469 + + See the Raptor2 2.0.7 Release Notes for the full details of the + changes. + +2011-11-27 Raptor2 Version 2.0.6 Released + + Fixed expat support which was broken in 2.0.5 + Handle libCurl SSL options before 7.16.4 (2007) + Add a few sequence utility methods for sort, reverse and permute + + See the Raptor2 2.0.6 Release Notes for the full details of the + changes. + +2011-11-14 Raptor2 Version 2.0.5 Released + + All parsers and serializers use the W3C Format URIs as their primary + URI + N-Quads parser can now handle optional context/graph URI + Turtle serializer uses official text/turtle mime type + Added some additional UTF-8 and snprintf utility functions + No longer needs math functions trunc, lround and round. + Several internal code style fixes and cleanups + Fixed reported issues: 0000465, 0000476, 0000479 and 0000481. + + See the Raptor2 2.0.5 Release Notes for the full details of the + changes. + +2011-07-25 Raptor2 Version 2.0.4 Released + + RDF/JSON parser now supports YAJL V2 + Support libcurl 7.21.7 that removed the curl/types.h header + TRiG parser now supports the optional ':' in 'uri : { }' syntax + WWW module now supports setting SSL client side certificates + Fixed reported issues: 0000308, 0000449, 0000451, 0000455, 0000456 and + 0000457 + + See the Raptor2 2.0.4 Release Notes for the full details of the + changes. + +2011-06-01 Raptor2 Version 2.0.3 Released + + Added a raptor2.h header + Turtle / TRiG parser improvements for larger documents + Fixes from LLVM clang static code analyzer + Fixed reported issues: 0000437. + + See the Raptor2 2.0.3 Release Notes for the full details of the + changes. + +2011-03-20 Raptor2 Version 2.0.2 Released + + Fixed a too strict version checking bug in raptor_new_world() + + See the Raptor2 2.0.2 Release Notes for the full details of the + changes. + +2011-03-20 Raptor Version 2.0.1 Released + + DO NOT USE. Use 2.0.2 which fixes a too strict version checking bug in + raptor_new_world() + Some minor fixes: + The N-Quads serializer was fixed to output the graph name correctly + The RDFa parser built with librdfa can now be linked with the standard + librdfa + Fixed reported issues: 0000416. + + See the Raptor 2.0.1 Release Notes for the full details of the changes. + +2011-01-03 Raptor Version 2.0.0 Released + + Raptor 2 final release + Some minor API changes since the last beta. + Fixed reported issue: 0000405. + + The Raptor 2 API reference manual section on Changes between raptor + 1.4.21 and 2.0.0 provides detailed function, macro, enum and type + changes. The upgrading document explains how to upgrade existing Raptor + V1 code to the new APIs. + + See the Raptor 2.0.0 Release Notes for the full details of the changes. + +2010-12-01 Raptor Version 1.9.1 Released + + Raptor 2 second beta release with some API changes. 2.0.0 final + expected next. + Improved the V1 to V2 upgrading script + raptor_new_world() checks Raptor header and library are consistent + Constructors now validate the world pointer is from Raptor V2 + Added an N-Quads parser + Added and removed a few API calls + Fixed a few bugs including reported issue 0000402 + + The Raptor 2 API reference manual section on Changes between raptor + 1.4.21 and 1.9.1 provides detailed function, macro, enum and type + changes. The upgrading document explains how to upgrade existing Raptor + V1 code to the new APIs. + + See the Raptor 1.9.1 Release Notes for the full details of the changes. + +2010-08-16 Raptor Version 1.9.0 Released + + Raptor 2 first beta release. There may be changes before a stable 2.0.0 + API + Removed all deprecated functions and typedefs. + Renamed all functions to the standard raptor_class_method form. + All constructors take a raptor_world argument. + URIs are interned and there is no longer a swappable implementation. + Statement is now an array of 3-4 RDF Terms to support triples and + quads. + World object owns logging, blank node ID generation and describing + syntaxes. + Features are now called options and have typed values. + GRDDL parser now saves and restores shared libxslt state. + Added serializers for HTML 'html' and N-Quads 'nquads'. + Added parser 'json' for JSON-Resource centric and JSON-Triples. + Switched to GIT version control hosted by GitHub. + Added memory-based AVL-Tree to the public API. + Fixed reported issues: 0000357, 0000361, 0000369, 0000370, 0000373 and + 0000379 + + The Raptor 2 API reference manual section on Changes between raptor + 1.4.21 and 1.9.0 provides detailed function and type changes. The + upgrading document explains how to upgrade existing Raptor V1 code to + the new APIs. + + See the Raptor 1.9.0 Release Notes for the full details of the changes. + +2010-01-30 Raptor Version 1.4.21 Released + + This is a bug fix only release with no new features. New development + has moved to raptor 2 where a planned ABI and API break is underway. + RDFa parser buffer management problems were fixed + Turtle parser and serializer now use QNames correctly against + specification + RDF/XML parser now resets correctly to detect duplicate rdf:IDs + Made a few other minor bug and build fixes + Fixed reported issues: 0000318, 0000319, 0000326, 0000331, 0000332 and + 0000337 + + See the Raptor 1.4.21 Release Notes for the full details of the + changes. + +2009-11-28 Raptor Version 1.4.20 Released + + Turtle serializing performance improvement by Chris Cannam + librdfa RDFa parser updates to fix empty datatype, xml:lang and 1-char + prefixes by Manu Sporny + Fix a crash when the GRDDL parser reported errors + Enable large file support for 32-bit systems + Several resilience improvements by Lauri Aalto + Other minor portability and bug fixes + Fixed reported issues: 0000306 0000307 0000310 and 0000312. + + See the Raptor 1.4.20 Release Notes for the full details of the + changes. + +2009-07-19 Raptor Version 1.4.19 Released + + Many improvements to RSS tag soup (RSSes and Atom) parser and the RSS + 1.0 and Atom serializers + Several fixes and improvements to the N-Triples, RDFa and RDF/XML + parsers and Turtle serializer + Improved the use and configuration of static libxml functions for + better compatibility + Several Win32 portability fixes - Lou Sakey + Many internal changes for upcoming Raptor V2 - primarily by Lauri Aalto + Many other fixes and resilience improvements. + Fixed reported issues: 0000259, 0000262, 0000263, 0000266, 0000269, + 0000270, 0000276, 0000277, 0000287, 0000288, 0000289, 0000290, 0000293, + 0000296, 0000299 and 0000303. + + WARNING: FUTURE ABI and API CHANGES. The next release of raptor 1.4.x + will include bug fixes only and no new features. New development will + move to raptor 2 where a planned ABI and API break will happen. There + may be preview releases of raptor 2 with 1.9.x numbering. + + See the Raptor 1.4.19 Release Notes for the full details of the + changes. + +2008-06-25 Raptor Version 1.4.18 Released + + Added an RDFa parser using an embedded version of librdfa by Manu + Sporny of Digital Bazaar. + Added an Atom 1.0 (RFC 4287) serializer with several output parameters. + Improved RSS 1.0 serializer functionality and resilience. + Added new API methods for qname, serializer, sequence and XML writer + classes. + Many other fixes and resilience improvements. + Fixed reported issues: 0000186 and 0000255. + + See the Raptor 1.4.18 Release Notes for the full details of the + changes. + +2008-03-30 Raptor Version 1.4.17 Released + + Added two new JSON serializers: resource-centric 'json' (Talis + RDF/JSON) and triple-centric 'json-triples' + Added a new public XML SAX2 API class + Added a new error handling structure + Made the I/O Stream class support reading + Added several new API methods. + Made several fixes, portability and resilience improvements. + Fixed reported issues: 0000252 and 0000245. + + See the Raptor 1.4.17 Release Notes for the full details of the + changes. + +2007-10-01 Raptor Version 1.4.16 Released + + 100% support for the GRDDL W3C Recommendation of 2007-09-11 + Turtle parser and serializer were updated to support @base from Turtle + 2007-09-11. + Turtle and RDF/XML serializers had performance improvements for large + graphs. + Added a TRiG Parser based on Turtle with named graph support. + Several other API changes, fixed and improvements were made. + Fixed reported issues: 0000188, 0000192, 0000194, 0000195, 0000207, + 0000210, 0000214, 0000216, 0000217, 0000232, 0000237, 0000238 and + 0000239 + Many other fixes and improvements. + + See the Raptor 1.4.16 Release Notes for the full details of the + changes. + +2007-03-26 Raptor Version 1.4.15 Released + + GRDDL parser substantially updated to support the GRDDL W3C Working + Draft 2 March 2007 + Errors for XML parsing and URI 404s are reported much better + Fixed reported issues: 0000174, 0000177, 0000178, 0000180 + Many other minor fixes and improvements. + + See the Raptor 1.4.15 Release Notes for the full details of the + changes. + +2007-01-31 Raptor Version 1.4.14 Released + + New Turtle serializer by Dave Robillard based on the existing + RDF/XML-Abbrev serializer. + New GraphViz DOT format serializer by Evan Nemerson. + GRDDL parser now does namespace and profile URI recursion and has other + improvements and fixes. + Fixed reported issues: 0000032, 0000141, 0000143, 0000148, 0000155 and + 0000157 + Many other fixes and improvements. + + See the Raptor 1.4.14 Release Notes for the full details of the + changes. + +2006-10-22 Raptor Version 1.4.13 Released + + Fixed a memory leak in reusing the XML writer + Fixed reported issues: 0000134 + Minor updates and fixes to tutorial, configuration and build + + See the Raptor 1.4.13 Release Notes for the full details of the + changes. + +2006-08-27 Raptor Version 1.4.12 Released + + Restore serializer enumeration ordering back to that of 1.4.10 which + was causing Redland problems when writing type 'application/rdf+xml'. + + See the Raptor 1.4.12 Release Notes for the gory details. + +2006-08-26 Raptor Version 1.4.11 Released + + Added network request filtering for parsers + Improved the GRDDL parser to read Embedded RDF and HCalendar + The Guess parser can now be reused to do multiple guesses + The RSS 1.0 Serializer now works again + Fixed reported issues: 0000014, 0000041, 0000089, 0000091 , 0000110 and + 0000112 + Made several other changes, fixes and improvements. + + See the Raptor 1.4.11 Release Notes for the full details of the + changes. + +2006-07-14 Raptor Version 1.4.10 Released + + Fixed a crash with RSS Tag Soup parser generating triples too late + Fixed a crash with the RDF/XML parser and serializer if a comment was + seen outside an element + Parsers no longer generate any triple parts of type + RAPTOR_IDENTIFIER_TYPE_ORDINAL + + See the Raptor 1.4.10 Release Notes for the full details of the + changes. + +2006-04-22 Raptor Version 1.4.9 Released + + Raptor Tutorial added covering parsing and serializing with examples + Raptor Reference Manual now covers 100% of the public API + rapper can now pretty-print RDF using namespaces as hints + Turtle parser gains boolean literals + Requests for content now send appropriate Accept: headers + No longer require libxml for rss-tag-soup parser + Various Win32 fixes and VC build files updates (John Barstow) + Many other bug fixes and changes were made. + + NOTE: Generation of RAPTOR_IDENTIFIER_TYPE_PREDICATE was removed as + deprecated in 1.4.8. + + See the Raptor 1.4.9 Release Notes for the full details of the changes. + +2006-01-03 Raptor Version 1.4.8 Released + + RSS Tag Soup parser now reads Atom 1.0 and rewrites old Atom 0.3 terms + Added a guess parser that picks the parser to use based on protocol + information such as HTTP Content-Type + Created an enhanced API reference manual with gtk-doc + Serializers to build can now be selected at configure time + Parsers can now return the namespace prefix/URIs seen in parsing + Turtle parser update to version 2006-01-02 (announcement) + Fix for URI resolution bugs (win32 fix by John Barstow) + Several parser bug fixes for RDF/XML, RSS and GRDDL + RDF/XML serializers and XML writer can write XML 1.0 or XML 1.1 + Added an alpha Atom 1.0 serializer + Added an Adobe XMP (RDF/XML profile) serializer + Internal source reorganisation + Many other changes, fixes and improvements. + + NOTE: Raptor will be switching to use Subversion for version control + after the 1.4.8 release. See the Redland Subversion site or the online + Raptor installation notes for the latest information. + + See the Raptor 1.4.8 Release Notes for the full details of the changes. + +2005-06-08 Raptor Version 1.4.7 Released + + Fix crashes in the RSS tag soup parser / serializer (Suzan Foster) + Fix a crash in the RDF/XML serializers with bad URI predicates. + + See the Raptor 1.4.7 Release Notes for the full details of the changes. + +2005-05-19 Raptor Version 1.4.6 Released + + Added a Gleaning Resource Descriptions from Dialects of Languages + (GRDDL) parser for reading XHTML and XML as RDF triples + Updated RSS enclosures support in RSS tag soup parser and RSS 1.0 + serializer (Suzan Foster) + Fixed several crashes with RSS tag soup parser, RDF/XML-abbrev + serializer. + The turtle parser now accepts """long literals""" + + See the Raptor 1.4.6 Release Notes for the full details of the changes. + +2005-02-06 Raptor Version 1.4.5 Released + + Added an RDF/XML with abbreviations serializer (Steve Shepard) + Handle RSS 1.1 in RSS tag soup parser + More fixes for broken OSX libxml2 + + See the Raptor 1.4.5 Release Notes for the full details of the changes. + +2005-01-15 Raptor Version 1.4.4 Released + + Fixed crashes in RSS tag soup parser and RSS 1.0 serializer + Handle RSS 0.9 namespace in RSS tag soup parser + Portability fixes for Win32 (Dave Viner) + + See the Raptor 1.4.4 Release Notes for the full details of the changes. + +2005-01-03 Raptor Version 1.4.3 Released + + New XML Writer API + Improved RDF/XML serializer allowing user namespace declarations and + writing relative URIs where possible + New RSS 1.0 serializer + Updated RSS tag soup parser + URI class can write relative URIs (Patch from René Puls) + Many other API changes + + See the Raptor 1.4.3 Release Notes for the full details of the changes. + +2004-11-01 Raptor Version 1.4.2 Released + + Fix raptor_xml_escape_string error return. + + See the Raptor 1.4.2 Release Notes for the full details of the changes. + +2004-10-29 Raptor Version 1.4.1 Released + + Fixed crashes in URI decoding and RSS enclosures. + + See the Raptor 1.4.1 Release Notes for the full details of the changes. + +2004-10-24 Raptor Version 1.4.0 Released + + Added a serializing class for writing RDF triples as a syntax + Added serializers for RDF/XML and N-Triples + Added an I/O stream class for aiding writing + Added RSS enclosure support to RSS Tag Soup parser (Suzan Foster) + + See the Raptor 1.4.0 Release Notes for the full details of the changes. + +2004-09-20 Raptor Version 1.3.3 Released + + License changed to LGPL 2.1/Apache 2 + Added a new Unicode NFC checker + Rewritten URI parsing and resolving code + Added configure selection of RDF parsers + Updated the RSS Tag Soup parser to handle Atom 0.3 + Updated the Turtle parser to handle large documents (Geoff Chappell) + Added a parser feature to disable rdf:ID duplicate checking + Updated rdf:ID duplicate value checking implementation + Portability fixes for building on win32 (Chris Pointon) + + See the Raptor 1.3.3 Release Notes for the full details of the changes. + +2004-07-21 Raptor Version 1.3.2 Released + + Added support for compiling against expat source trees (Mark Smith) + Added raptor_alloc_memory to allocate memory in raptor, typically + needed by handler routines on win32. + Make errors in fetching WWW content pass to the main error handler. + Added accessor functions for parts of the raptor_locator structure (Edd + Dumbill) + Disabled the broken Unicode NFC checking via GNOME glib for this + release. + + See the Raptor 1.3.2 Release Notes for the full details of the changes. + +2004-06-12 Raptor Version 1.3.1 Released + + Correct raptor_print_statement declaration argument statement to have + one less 'const', to match the code. + raptor.h now includes stdarg.h + Portability fixes for win32 + Updates to Turtle parser to only allow language with non-datatyped + literals; allow a '_' immediately after a ':' in qnames and make bare + ':' work. + Added a warning for unknown rdf:parseType values, when parsing in lax + mode. This is controlled by a new parser feature warn_other_parsetypes + The Turtle parser was fixed to re-initialise correctly when performing + multiple parsings + Fixes to the file: URI support for %-escaping and for Win32 filenames + + See the Raptor 1.3.1 Release Notes for the full details of the changes. + +2004-05-11 Raptor Version 1.3.0 Released + + Updated Turtle parser to fix the collections syntax, add integer + literals and allow - in names. + Added support for guessing a parser from content or identifiers + Completed parser feature support + Added sending HTTP Accept: headers for WWW retrieval when possible + Added new utility sequence and stringbuffer classes + Several other functions added and improvements made. + + See the Raptor 1.3.0 Release Notes for the full details of the changes. + +2004-01-24 Raptor Version 1.2.0 Released + + Added a Turtle parser (was N-Triples Plus) now with collections. + Added raptor_syntaxes_enumerate to get syntax name, label, mime_type or + uri_string of all known parsers. + Added WWW access via BSD libfetch if available. + Updated the GNOME GUI grapper program to report errors and warnings + +2003-12-31 Raptor Version 1.1.0 Released + + Added an N-Triples Plus parser + Updated for RDF/XML Revised Working Draft (10 October 2003) allowing + rdf:RDF to be optional by default. No further changes were needed for + RDF/XML Revised Proposed Recommendation (15 December 2003) + Made URI class constructors, methods and factory methods as well as + some other utility functions using or returning URIs or literals take + unsigned char* rather than char*. + Added the XML namespace, XML namespace stack and XML qname classes to + the public API. + Added a function to discover supported parsers. + Fixes for line number counting in N-Triples + Added support for libxml2 SAX2 API for 2.6.0 and later. + The N-Triples parser now uses the generate ID code. + Added configure options for XML 1.1 names and disabling NFC check code. + +2003-09-08 Raptor Version 1.0.0 Released + + Several long-deprecated functions were removed and consequently the + library shared version number was increased to 1 + Fixed scanning for rdf:RDF so that RDF/XML in other XML works, such as + in SVG + raptor-config --libs now works, added --libtool-libs and + --version-decimal + Check N-Triples legal Unicode character range #x0-#x10FFFF + Normalize RDF/XML xml:lang and N-Triples language to lowercase on input + Worked around libxml2 bug causing a crash on some error reporting + Added raptor_parse_file_stream for parsing a C FILE* + Tidied rapper utility argument handling, added --version + +2003-08-25 Raptor Version 0.9.12 Released + + Fix some XML memory leaks in Exclusive XML Canonicalization. + Stop parsing RSS tag soup after a user abort + Improved N-Triples syntax checking. + Crash fixes for 64 bit Alpha/Sparc Linux/Solaris (varargs, size_t) + Fixed some other minor memory leaks with rdf:datatype and rdf:ID + attributes. + +2003-07-29 Raptor Version 0.9.11 Released + + Completely handles the revised RDF/XML syntax (including post W3C Last + Call changes) + Added Unicode Normal Form C (NFC) checking for literals (requires GNOME + glib 2.0 at present) + Added Exclusive XML Canonicalization for XML Literals + Added many more checks for bad syntax (mostly illegal property + attributes) + Updated parseType="Collection" triples after RDF Core WG change + Added an experimental RSS Tag Soup parser to read any pile of XML that + has elements such as channel, image, item tags with title, description + etc inside them into coherent RSS 1.0 RDF triples. (Requires libxml + 2.5.0 or newer) + API: Added new methods raptor_get_name, raptor_get_label. + API: Added new methods raptor_set_default_generate_id_parameters and + raptor_set_generate_id_handler to control generation of IDs. + API: Modified utility function raptor_xml_escape_string arguments. + Ripped out ISO 3166 country code parts since commercial use might be + subject to a license fee. + Improvements to GTK example 'grapper'. + Several internal reorganisations for pulling out a SAX2 API, XML C14N. + Other minor bug fixes. + +2003-04-17 Raptor Version 0.9.10 Released + + Added parser lax / strict modes. lax is the default. + rdf:bagID now generates a warning in lax mode, an error in strict + Added raptor_www_no_www_library_init_finish to allow disabling of WWW + library startup/shutdown. + Added raptor_parse_abort to abort parsing inside a callback. + Added a GTK GUI example program grapper + Other minor bug fixes. + +2003-03-28 Raptor Version 0.9.9 Released + + Performance improvements - uses less memory, less repeated small + malloc/free sequences, faster for larger files. + Added WWW retrieval - can parse from an URI as well as files, given + either libcurl or libxml2 is available. + Minor bug fixes. + Various Win32 configure, building patches + Sources updated to use autoconf 1.6+, automake 2.52+ + More debian packaging updates. + +2003-02-13 Raptor Version 0.9.8 Released + + Minor bug fixes (synchronising with Redland 0.9.12 release). + Fixed crashing on empty files + Fixed accepting illegal xmlns:prefix="" (prefix without URI not + allowed) + N-Triples bnodeIDs can now have '0's + Utility program rdfdump renamed to rapper; name conflicted with a + common Linux utility. + +2002-12-20 Raptor Version 0.9.7 Released + + Passes about 90% of RDF Core WG Test Cases + All memory leaks fixed + Portability fixes - compilers, scripts, auto* tools, libxml2 version + rdf:ID syntax and duplicates checked + rdf:bagID supported + Added more conformance tests, errors and warnings. + +2002-11-02 Raptor Version 0.9.6 Released + + Calling API changed to provide a common interface to the RDF parsers. + The libraptor.3 manual page describes the changes. + Added support for RDF datatyped literals in RDF/XML with rdf:datatype + attribute on property elements and N-Triples with the + "string"^^. + Added support for rdf:parseType="Collection" for RDF Collections + URI class allows swappable implementation by applications. + URI class now handles file: URIs for Win32 and Unix conventions. + Fixes to enable it to work on Apple OSX 10.1, 10.2 (also tested working + on Linux/x86, Solaris/sparc, FreeBSD/x86) + Many internal changes to support API changes, allow it to work with + Redland when compiled as a separate library + Reorganised source into separate modules - URI, xml parser, ntriples + parser, XML namespaces, XML qnames, locator. + More resilience with XML errors and XML parser errors - none of + libxml2's XML test suite examples crash raptor. + N-Triples parser recovers gracefully from errors in content + Packing for debian included + Added manual pages libraptor.3 and rapper.1 + Added raptor-config script for compiling with the library. + +2002-06-08 Raptor Version 0.9.5 Released + + Many bugs fixed + Added full relative URI resolving + Work around bugs in libxml and expat (older versions) + Support libxml with the use of entities in the document + Support xml:lang passing to application + +2002-03-27 Raptor Version 0.9.4 Released + + XML Base support (xml:base) added + xml:lang support added with N-Triples lang-string support + All N-Triples string escapes implemented + N-Triples support with XML literals - xml("") and plain "foo" + removed all special code for containers; treated as regular typedNodes + rdf:parseType="Literal" now working + Builds as shared and static libraries + Conformance test suite added + +2001-08-21 Raptor Version 0.9.3 Released + + N-Triples parser added + rdf:parseType="Literal" works much better (Aaron Michal and me) + DAML collections support added (Aaron Michal) + Win32 patch added - I can't confirm my merge didn't break this (Aaron + Michal) + N-Triples updated to support CR, LF and CR LF endings + Make parser generated ids appear distinguised from regular URIs + Added N-Triples output + Made rdf:type, rdf:value as property attributes work + Made empty typed nodes work + GNOME xml / libxml error location (line, column) values corrected. + +2001-07-03 Raptor Version 0.9.2 Released + + Now called Raptor + +2001-06-06 Raptor Version 0.9.1 Released + + Many bug fixes + Updates for Redland API changes + Fixed rdf:parsetype="Literal" buffer overrun + Added better XML parser auto-detection for various expats and libxml + +2001-01-22 Raptor Version 0.9.0 Released + + First release + __________________________________________________________________ + + Copyright (C) 2001-2023 Dave Beckett + Copyright (C) 2001-2005 University of Bristol diff --git a/NEWS.html b/NEWS.html new file mode 100644 index 0000000..3f648ab --- /dev/null +++ b/NEWS.html @@ -0,0 +1,918 @@ + + + + + Raptor RDF Syntax Library - News + + + +

Raptor RDF Syntax Library - News

+ +

2023-03-01 Raptor2 Version 2.0.16 Released

+ +

+Fixes CVE-2017-18926 and CVE-2020-25713
+Multiple Appveyor Windows and CMake build fixes by 0u812. (Note: the resulting binaries and libraries were not tested on Windows)
+Turtle parser now reads input in chunks so can handle huge files. Patch by Sebastian Freundt
+Added a serializer for the mKR language. Patch by Richard H. McCullough.
+Rapper utility now counts triples using longs
+Several smaller portability fixes for OpenBSD and cross building +

+ +

See the Raptor2 2.0.16 Release Notes +for the full details of the changes.

+ + +

2014-11-01 Raptor2 Version 2.0.15 Released

+ +

Made several fixes to Turtle / N-Triples family of parsers and serializers
+Added utility functions for re-entrant sorting of objects and sequences.
+Made other fixes and improvements including fixing reported issues: +0000574, +0000575, +0000576, +0000577, +0000579, +0000581 and +0000584. +

+ +

See the Raptor2 2.0.15 Release Notes +for the full details of the changes.

+ + +

2014-05-05 Raptor2 Version 2.0.14 Released

+ +

Many code quality fixes from clang and coverity primarily in error +path cleanups (oom) and dead code.
+Fixed Turtle 1.1 parser about triple quoting alignment with SPARQL
+A few internal changes. +

+ +

See the Raptor2 2.0.14 Release Notes +for the full details of the changes.

+ + +

2013-01-29 Raptor2 Version 2.0.13 Released

+ +

Fix configure not finding curl when curl-config --cflags is empty
+Fixed reported issue: +0000562. +

+ +

See the Raptor2 2.0.13 Release Notes +for the full details of the changes.

+ + +

2013-12-13 Raptor2 Version 2.0.12 Released

+ +

N-Triples / N-Quads parser updated to pass all the RDF 1.1 2013 tests
+Added raptor_new_term_from_counted_string() +

+ +

See the Raptor2 2.0.12 Release Notes +for the full details of the changes.

+ + +

2013-11-24 Raptor2 Version 2.0.11 Released

+ +

+Completed support for RDF 1.1 N-Triples (aka N-Triples 2013)
+Added a few new API calls
+Made several build, portability and configuration improvements
+Fixed reported issues: +0000554 and +0000556. +

+ +

See the Raptor2 2.0.11 Release Notes +for the full details of the changes.

+ + +

2013-07-27 Raptor2 Version 2.0.10 Released

+ +

+Completed support for Turtle Terse RDF Triple Language W3C Candidate Recommendation 19 February 2013 (Turtle 2013)
+Added support for N-Triples W3C Working Group Note 09 April 2013 (N-Triples 2013)
+Added a few new Turtle and N-Triples support functions
+Update configure to better handle mixed pkg-config settings
+Fixed reported issues: +0000532, +0000535, +0000545 and +0000548 +

+ +

See the Raptor2 2.0.10 Release Notes +for the full details of the changes.

+ + +

2013-02-26 Raptor2 Version 2.0.9 Released

+ +

+Added full parsing and serializing support for Turtle Terse RDF Triple Language W3C Candidate Recommendation 19 February 2013
+Added CMake build framework for building Raptor on Microsoft (Daniel Richard G.)
+Made a few minor fixes and improvements
+Fixed reported issues: +0000499, +0000508, +0000520, +0000521 and +0000526 +

+ +

See the Raptor2 2.0.9 Release Notes +for the full details of the changes.

+ + +

2012-06-24 Raptor2 Version 2.0.8 Released

+ +

+Added support for RDFa 1.1 via updated librdfa
+Multiple portability fixes for Windows and Solarises. (Daniel Richard G.)
+Multiple minor fixes and improvements
+Fixed reported issues: +0000381, +0000487, +0000505 and +0000507 +

+ +

See the Raptor2 2.0.8 Release Notes +for the full details of the changes.

+ + +

2012-03-22 Raptor2 Version 2.0.7 Released

+ +

CVE-2012-0037 fixed
+Removed Expat support
+Removed internal Unicode NFC code for better and optional ICU
+Added options for denying file requests and XML entity loading
+Added options for SSL certificate verifying
+Fixed reported issues: +0000448 and +0000469 +

+ +

See the Raptor2 2.0.7 Release Notes +for the full details of the changes.

+ + +

2011-11-27 Raptor2 Version 2.0.6 Released

+ +

+Fixed expat support which was broken in 2.0.5
+Handle libCurl SSL options before 7.16.4 (2007)
+Add a few sequence utility methods for sort, reverse and permute
+

+ +

See the Raptor2 2.0.6 Release Notes +for the full details of the changes.

+ + +

2011-11-14 Raptor2 Version 2.0.5 Released

+ +

All parsers and serializers use the W3C Format URIs as their primary URI
+N-Quads parser can now handle optional context/graph URI
+Turtle serializer uses official text/turtle mime type
+Added some additional UTF-8 and snprintf utility functions
+No longer needs math functions trunc, lround and round.
+Several internal code style fixes and cleanups
+Fixed reported issues: +0000465, +0000476, +0000479 and +0000481. +

+ +

See the Raptor2 2.0.5 Release Notes +for the full details of the changes.

+ + +

2011-07-25 Raptor2 Version 2.0.4 Released

+ +

RDF/JSON parser now supports YAJL V2
+Support libcurl 7.21.7 that removed the curl/types.h header
+TRiG parser now supports the optional ':' in 'uri : { }' syntax
+WWW module now supports setting SSL client side certificates
+Fixed reported issues: +0000308, +0000449, +0000451, +0000455, +0000456 and +0000457 +

+ + +

See the Raptor2 2.0.4 Release Notes +for the full details of the changes.

+ + +

2011-06-01 Raptor2 Version 2.0.3 Released

+ +

Added a raptor2.h header
+Turtle / TRiG parser improvements for larger documents
+Fixes from LLVM clang static code analyzer
+Fixed reported issues: +0000437. +

+ +

See the Raptor2 2.0.3 Release Notes +for the full details of the changes.

+ + +

2011-03-20 Raptor2 Version 2.0.2 Released

+ +

Fixed a too strict version checking bug in raptor_new_world() +

+ +

See the Raptor2 2.0.2 Release Notes +for the full details of the changes.

+ + +

2011-03-20 Raptor Version 2.0.1 Released

+ +

DO NOT USE. Use 2.0.2 which fixes a too strict version +checking bug in raptor_new_world()
+Some minor fixes:
+The N-Quads serializer was fixed to output the graph name correctly
+The RDFa parser built with librdfa can now be linked with the standard librdfa
+Fixed reported issues: +0000416. +

+ +

See the Raptor 2.0.1 Release Notes +for the full details of the changes.

+ + +

2011-01-03 Raptor Version 2.0.0 Released

+ +

Raptor 2 final release
+Some minor API changes since the last beta.
+Fixed reported issue: +0000405. +

+ +

The Raptor 2 API reference manual +section on +Changes between raptor 1.4.21 and 2.0.0 +provides detailed function, macro, enum and type changes. +The upgrading document +explains how to upgrade existing Raptor V1 code to the new APIs. +

+ + +

See the Raptor 2.0.0 Release Notes +for the full details of the changes.

+ + +

2010-12-01 Raptor Version 1.9.1 Released

+ +

Raptor 2 second beta release with some API changes. 2.0.0 final expected next.
+Improved the V1 to V2 upgrading script
+raptor_new_world() checks Raptor header and library are consistent
+Constructors now validate the world pointer is from Raptor V2
+Added an N-Quads parser
+Added and removed a few API calls
+Fixed a few bugs including reported issue +0000402 +

+ +

The Raptor 2 API reference manual +section on +Changes between raptor 1.4.21 and 1.9.1 +provides detailed function, macro, enum and type changes. +The upgrading document +explains how to upgrade existing Raptor V1 code to the new APIs. +

+ +

See the Raptor 1.9.1 Release Notes +for the full details of the changes.

+ + +

2010-08-16 Raptor Version 1.9.0 Released

+ +

Raptor 2 first beta release. There may be changes before a stable 2.0.0 API
+Removed all deprecated functions and typedefs.
+Renamed all functions to the standard raptor_class_method form.
+All constructors take a raptor_world argument.
+URIs are interned and there is no longer a swappable implementation.
+Statement is now an array of 3-4 RDF Terms to support triples and quads.
+World object owns logging, blank node ID generation and describing syntaxes.
+Features are now called options and have typed values.
+GRDDL parser now saves and restores shared libxslt state.
+Added serializers for HTML 'html' and N-Quads 'nquads'.
+Added parser 'json' for JSON-Resource centric and JSON-Triples.
+Switched to GIT version control hosted by GitHub.
+Added memory-based AVL-Tree to the public API.
+Fixed reported issues: +0000357, +0000361, +0000369, +0000370, +0000373 and +0000379 +

+ +

The Raptor 2 API reference manual +section on +Changes between raptor 1.4.21 and 1.9.0 +provides detailed function and type changes. +The upgrading document +explains how to upgrade existing Raptor V1 code to the new APIs. +

+ +

See the Raptor 1.9.0 Release Notes +for the full details of the changes.

+ + + +

2010-01-30 Raptor Version 1.4.21 Released

+ +

This is a bug fix only release with no new features. New development has moved to raptor 2 where a planned ABI and API break is underway.
+RDFa parser buffer management problems were fixed
+Turtle parser and serializer now use QNames correctly against specification
+RDF/XML parser now resets correctly to detect duplicate rdf:IDs
+Made a few other minor bug and build fixes
+Fixed reported issues: +0000318, +0000319, +0000326, +0000331, +0000332 and +0000337 +

+ +

See the Raptor 1.4.21 Release Notes +for the full details of the changes.

+ + +

2009-11-28 Raptor Version 1.4.20 Released

+ +

+Turtle serializing performance improvement by Chris Cannam
+librdfa RDFa parser updates to fix empty datatype, xml:lang and 1-char prefixes by Manu Sporny
+Fix a crash when the GRDDL parser reported errors
+Enable large file support for 32-bit systems
+Several resilience improvements by Lauri Aalto
+Other minor portability and bug fixes
+Fixed reported issues: +0000306 +0000307 +0000310 +and 0000312. +

+ +

See the Raptor 1.4.20 Release Notes +for the full details of the changes.

+ + +

2009-07-19 Raptor Version 1.4.19 Released

+ +

+Many improvements to RSS tag soup (RSSes and Atom) parser and the RSS 1.0 and Atom serializers
+Several fixes and improvements to the N-Triples, RDFa and RDF/XML parsers and Turtle serializer
+Improved the use and configuration of static libxml functions for better compatibility
+Several Win32 portability fixes - Lou Sakey
+Many internal changes for upcoming Raptor V2 - primarily by Lauri Aalto
+Many other fixes and resilience improvements.
+Fixed reported issues: 0000259, 0000262, 0000263, 0000266, 0000269, 0000270, 0000276, 0000277, 0000287, 0000288, 0000289, 0000290, 0000293, 0000296, 0000299 and 0000303. +

+ +

WARNING: FUTURE ABI and API CHANGES. The next +release of raptor 1.4.x will include bug fixes only and no new +features. New development will move to raptor 2 where a planned ABI +and API break will happen. There may be preview releases of raptor 2 +with 1.9.x numbering.

+ +

See the Raptor 1.4.19 Release Notes +for the full details of the changes.

+ + +

2008-06-25 Raptor Version 1.4.18 Released

+ +

+Added an RDFa parser using an embedded version of librdfa by Manu Sporny of Digital Bazaar.
+Added an Atom 1.0 (RFC 4287) serializer with several output parameters.
+Improved RSS 1.0 serializer functionality and resilience.
+Added new API methods for qname, serializer, sequence and XML writer classes.
+Many other fixes and resilience improvements.
+Fixed reported issues: 0000186 and 0000255. +

+ +

See the Raptor 1.4.18 Release Notes +for the full details of the changes.

+ + +

2008-03-30 Raptor Version 1.4.17 Released

+ +

Added two new JSON serializers: resource-centric 'json' +(Talis RDF/JSON) +and triple-centric 'json-triples'
+Added a new public XML SAX2 API class
+Added a new error handling structure
+Made the I/O Stream class support reading
+Added several new API methods.
+Made several fixes, portability and resilience improvements.
+Fixed reported issues: 0000252 and 0000245. +

+ +

See the Raptor 1.4.17 Release Notes +for the full details of the changes.

+ + +

2007-10-01 Raptor Version 1.4.16 Released

+ +

100% support for the GRDDL W3C Recommendation of 2007-09-11
+Turtle parser and serializer were updated to support @base from Turtle 2007-09-11.
+Turtle and RDF/XML serializers had performance improvements for large graphs.
+Added a TRiG Parser based on Turtle with named graph support.
+Several other API changes, fixed and improvements were made.
+Fixed reported issues: 0000188, 0000192, 0000194, 0000195, 0000207, 0000210, 0000214, 0000216, 0000217, 0000232, 0000237, 0000238 and 0000239
+Many other fixes and improvements. +

+ +

See the Raptor 1.4.16 Release Notes +for the full details of the changes.

+ + + +

2007-03-26 Raptor Version 1.4.15 Released

+ +

GRDDL parser substantially updated to support the +GRDDL W3C Working Draft 2 March 2007
+Errors for XML parsing and URI 404s are reported much better
+Fixed reported issues: 0000174, 0000177, 0000178, 0000180
+Many other minor fixes and improvements. +

+ +

See the Raptor 1.4.15 Release Notes +for the full details of the changes.

+ + + +

2007-01-31 Raptor Version 1.4.14 Released

+ +

New Turtle +serializer by Dave Robillard based on the existing RDF/XML-Abbrev serializer.
+New GraphViz DOT format +serializer by Evan Nemerson.
+GRDDL parser now does namespace and profile URI recursion and +has other improvements and fixes.
+Fixed reported issues: 0000032, 0000141, 0000143, 0000148, 0000155 and 0000157
+Many other fixes and improvements. +

+ +

See the Raptor 1.4.14 Release Notes +for the full details of the changes.

+ + +

2006-10-22 Raptor Version 1.4.13 Released

+ +

Fixed a memory leak in reusing the XML writer
+Fixed reported issues: 0000134
+Minor updates and fixes to tutorial, configuration and build +

+ +

See the Raptor 1.4.13 Release Notes +for the full details of the changes.

+ + +

2006-08-27 Raptor Version 1.4.12 Released

+ +

Restore serializer enumeration ordering back to that of 1.4.10 +which was causing Redland problems when writing type 'application/rdf+xml'. +

+ +

See the Raptor 1.4.12 Release Notes +for the gory details.

+ + +

2006-08-26 Raptor Version 1.4.11 Released

+ +

+Added network request filtering for parsers
+Improved the GRDDL parser to read Embedded RDF and HCalendar
+The Guess parser can now be reused to do multiple guesses
+The RSS 1.0 Serializer now works again
+Fixed reported issues: 0000014, 0000041, 0000089, 0000091 , 0000110 and 0000112
+Made several other changes, fixes and improvements. +

+ +

See the Raptor 1.4.11 Release Notes +for the full details of the changes.

+ + + +

2006-07-14 Raptor Version 1.4.10 Released

+ +

+Fixed a crash with RSS Tag Soup parser generating triples too late
+Fixed a crash with the RDF/XML parser and serializer if a comment was seen outside an element
+Parsers no longer generate any triple parts of type RAPTOR_IDENTIFIER_TYPE_ORDINAL
+

+ +

See the Raptor 1.4.10 Release Notes +for the full details of the changes.

+ + + +

2006-04-22 Raptor Version 1.4.9 Released

+ +

+Raptor Tutorial added covering parsing and serializing with examples
+Raptor Reference Manual now covers 100% of the public API
+rapper can now pretty-print RDF using namespaces as hints
+Turtle parser gains boolean literals
+Requests for content now send appropriate Accept: headers
+No longer require libxml for rss-tag-soup parser
+Various Win32 fixes and VC build files updates (John Barstow)
+Many other bug fixes and changes were made. +

+ +

NOTE: +Generation of RAPTOR_IDENTIFIER_TYPE_PREDICATE +was removed as deprecated in 1.4.8. +

+ +

See the Raptor 1.4.9 Release Notes +for the full details of the changes.

+ + +

2006-01-03 Raptor Version 1.4.8 Released

+ +

RSS Tag Soup parser now reads Atom 1.0 and rewrites old Atom 0.3 terms
+Added a guess parser that picks the parser to use based on protocol information such as HTTP Content-Type
+Created an enhanced API reference manual with gtk-doc
+Serializers to build can now be selected at configure time
+Parsers can now return the namespace prefix/URIs seen in parsing
+Turtle parser update to version 2006-01-02 +(announcement)
+Fix for URI resolution bugs (win32 fix by John Barstow)
+Several parser bug fixes for RDF/XML, RSS and GRDDL
+RDF/XML serializers and XML writer can write XML 1.0 or XML 1.1
+Added an alpha Atom 1.0 serializer
+Added an Adobe XMP (RDF/XML profile) serializer
+Internal source reorganisation
+Many other changes, fixes and improvements. +

+ +

NOTE: Raptor will be switching to use +Subversion +for version control after the 1.4.8 release. +See the Redland Subversion site +or the online +Raptor installation notes +for the latest information. +

+ + +

See the Raptor 1.4.8 Release Notes +for the full details of the changes.

+ + +

2005-06-08 Raptor Version 1.4.7 Released

+ +

Fix crashes in the RSS tag soup parser / serializer (Suzan Foster)
+Fix a crash in the RDF/XML serializers with bad URI predicates. +

+ +

See the Raptor 1.4.7 Release Notes +for the full details of the changes.

+ + +

2005-05-19 Raptor Version 1.4.6 Released

+ +

Added a Gleaning Resource Descriptions from Dialects of Languages (GRDDL) parser for reading XHTML and XML as RDF triples
+Updated RSS enclosures support in RSS tag soup parser and RSS 1.0 serializer (Suzan Foster)
+Fixed several crashes with RSS tag soup parser, RDF/XML-abbrev serializer.
+The turtle parser now accepts """long literals""" +

+ + +

See the Raptor 1.4.6 Release Notes +for the full details of the changes.

+ + +

2005-02-06 Raptor Version 1.4.5 Released

+ +

Added an RDF/XML with abbreviations serializer (Steve Shepard)
+Handle RSS 1.1 in RSS tag soup parser
+More fixes for broken OSX libxml2 +

+ +

See the Raptor 1.4.5 Release Notes +for the full details of the changes.

+ + +

2005-01-15 Raptor Version 1.4.4 Released

+ +

Fixed crashes in RSS tag soup parser and RSS 1.0 serializer
+Handle RSS 0.9 namespace in RSS tag soup parser
+Portability fixes for Win32 (Dave Viner) +

+ +

See the Raptor 1.4.4 Release Notes +for the full details of the changes.

+ + +

2005-01-03 Raptor Version 1.4.3 Released

+

New XML Writer API
+Improved RDF/XML serializer allowing user namespace declarations +and writing relative URIs where possible
+New RSS 1.0 serializer
+Updated RSS tag soup parser
+URI class can write relative URIs (Patch from René Puls)
+Many other API changes +

+ +

See the Raptor 1.4.3 Release Notes +for the full details of the changes.

+ + +

2004-11-01 Raptor Version 1.4.2 Released

+

Fix raptor_xml_escape_string error return. +

+ +

See the Raptor 1.4.2 Release Notes +for the full details of the changes.

+ + +

2004-10-29 Raptor Version 1.4.1 Released

+

+Fixed crashes in URI decoding and RSS enclosures. +

+ +

See the Raptor 1.4.1 Release Notes +for the full details of the changes.

+ + +

2004-10-24 Raptor Version 1.4.0 Released

+

+Added a serializing class for writing RDF triples as a syntax
+Added serializers for RDF/XML and N-Triples
+Added an I/O stream class for aiding writing
+Added RSS enclosure support to RSS Tag Soup parser (Suzan Foster) +

+ +

See the Raptor 1.4.0 Release Notes +for the full details of the changes.

+ + +

2004-09-20 Raptor Version 1.3.3 Released

+

+License changed to LGPL 2.1/Apache 2
+Added a new Unicode NFC checker
+Rewritten URI parsing and resolving code
+Added configure selection of RDF parsers
+Updated the RSS Tag Soup parser to handle Atom 0.3
+Updated the Turtle parser to handle large documents (Geoff Chappell)
+Added a parser feature to disable rdf:ID duplicate checking
+Updated rdf:ID duplicate value checking implementation
+Portability fixes for building on win32 (Chris Pointon)
+

+ +

See the Raptor 1.3.3 Release Notes +for the full details of the changes.

+ +

2004-07-21 Raptor Version 1.3.2 Released

+

Added support for compiling against expat source trees (Mark Smith)
+Added raptor_alloc_memory to allocate memory in raptor, +typically needed by handler routines on win32.
+Make errors in fetching WWW content pass to the main error handler.
+Added accessor functions for parts of the raptor_locator structure (Edd Dumbill)
+Disabled the broken Unicode NFC checking via GNOME glib for this release. +

+ +

See the Raptor 1.3.2 Release Notes +for the full details of the changes.

+ +

2004-06-12 Raptor Version 1.3.1 Released

+

+Correct raptor_print_statement declaration argument +statement to have one less 'const', to match the code.
+raptor.h now includes stdarg.h
+Portability fixes for win32
+Updates to +Turtle +parser to only allow language with non-datatyped literals; +allow a '_' immediately after a ':' in qnames and make +bare ':' work.
+Added a warning for unknown rdf:parseType values, when +parsing in lax mode. This is controlled by a new parser feature +warn_other_parsetypes
+The Turtle parser was fixed to re-initialise correctly when performing +multiple parsings
+Fixes to the file: URI support for %-escaping and for Win32 filenames +

+ +

See the Raptor 1.3.1 Release Notes +for the full details of the changes.

+ + +

2004-05-11 Raptor Version 1.3.0 Released

+

+Updated Turtle parser to fix the collections syntax, add integer literals and allow - in names.
+Added support for guessing a parser from content or identifiers
+Completed parser feature support
+Added sending HTTP Accept: headers for WWW retrieval when possible
+Added new utility sequence and stringbuffer classes
+Several other functions added and improvements made. +

+ +

See the Raptor 1.3.0 Release Notes +for the full details of the changes.

+ + +

2004-01-24 Raptor Version 1.2.0 Released

+

Added a +Turtle parser (was N-Triples Plus) now with collections.
+Added raptor_syntaxes_enumerate to get syntax name, label, +mime_type or uri_string of all known parsers.
+Added WWW access via BSD libfetch if available.
+Updated the GNOME GUI grapper program to report errors and warnings
+

+ +

2003-12-31 Raptor Version 1.1.0 Released

+

Added an +N-Triples Plus parser
+Updated for RDF/XML Revised Working Draft (10 October 2003) allowing rdf:RDF to be optional by default. No further changes were needed for RDF/XML Revised Proposed Recommendation (15 December 2003)
+Made URI class constructors, methods and factory methods as +well as some other utility functions using or returning URIs or +literals take unsigned char* rather than char*.
+Added the XML namespace, XML namespace stack and XML qname classes to +the public API.
+Added a function to discover supported parsers.
+Fixes for line number counting in N-Triples
+Added support for libxml2 SAX2 API for 2.6.0 and later.
+The N-Triples parser now uses the generate ID code.
+Added configure options for XML 1.1 names and disabling NFC check code. +

+ +

2003-09-08 Raptor Version 1.0.0 Released

+

+Several long-deprecated functions were removed and consequently the +library shared version number was increased to 1
+Fixed scanning for rdf:RDF so that RDF/XML in other +XML works, such as in SVG
+raptor-config --libs now works, added --libtool-libs +and --version-decimal
+Check N-Triples legal Unicode character range #x0-#x10FFFF
+Normalize RDF/XML xml:lang and N-Triples language to lowercase +on input
+Worked around libxml2 bug causing a crash on some error reporting
+Added raptor_parse_file_stream for parsing a C FILE*
+Tidied rapper utility argument handling, added --version +

+ +

2003-08-25 Raptor Version 0.9.12 Released

+

Fix some XML memory leaks in Exclusive XML Canonicalization.
+Stop parsing RSS tag soup after a user abort
+Improved N-Triples syntax checking.
+Crash fixes for 64 bit Alpha/Sparc Linux/Solaris (varargs, size_t)
+Fixed some other minor memory leaks with rdf:datatype and rdf:ID attributes. +

+ +

2003-07-29 Raptor Version 0.9.11 Released

+

Completely handles the revised RDF/XML syntax +(including post W3C Last Call changes)
+Added Unicode Normal Form C (NFC) checking for literals (requires +GNOME glib 2.0 at present)
+Added Exclusive XML Canonicalization for XML Literals
+Added many more checks for bad syntax (mostly illegal property +attributes)
+Updated parseType="Collection" triples after RDF Core WG change
+Added an experimental RSS Tag Soup parser to read any pile of XML that has +elements such as channel, image, item tags with title, description +etc inside them into coherent RSS 1.0 RDF triples. +(Requires libxml 2.5.0 or newer)
+API: Added new methods raptor_get_name, raptor_get_label.
+API: Added new methods raptor_set_default_generate_id_parameters and +raptor_set_generate_id_handler to control generation of IDs.
+API: Modified utility function raptor_xml_escape_string arguments.
+Ripped out ISO 3166 country code parts since commercial use might be +subject to a license fee.
+Improvements to GTK example 'grapper'.
+Several internal reorganisations for pulling out a SAX2 API, XML C14N.
+Other minor bug fixes. +

+ +

2003-04-17 Raptor Version 0.9.10 Released

+

Added parser lax / strict modes. lax is the default.
+rdf:bagID now generates a warning in lax mode, an error in strict
+Added raptor_www_no_www_library_init_finish to allow disabling of +WWW library startup/shutdown.
+Added raptor_parse_abort to abort parsing inside a callback.
+Added a GTK GUI example program grapper
+Other minor bug fixes.
+

+ +

2003-03-28 Raptor Version 0.9.9 Released

+

Performance improvements - uses less memory, +less repeated small malloc/free sequences, faster for larger files.
+Added WWW retrieval - can parse from an URI as well as files, given +either libcurl or libxml2 is available.
+Minor bug fixes.
+Various Win32 configure, building patches
+Sources updated to use autoconf 1.6+, automake 2.52+
+More debian packaging updates. +

+ +

2003-02-13 Raptor Version 0.9.8 Released

+

Minor bug fixes (synchronising with Redland 0.9.12 release).
+Fixed crashing on empty files
+Fixed accepting illegal xmlns:prefix="" (prefix without URI not allowed)
+N-Triples bnodeIDs can now have '0's
+Utility program rdfdump renamed to rapper; name conflicted with a common +Linux utility. +

+ +

2002-12-20 Raptor Version 0.9.7 Released

+

Passes about 90% of RDF Core WG Test Cases
+All memory leaks fixed
+Portability fixes - compilers, scripts, auto* tools, libxml2 version
+rdf:ID syntax and duplicates checked
+rdf:bagID supported
+Added more conformance tests, errors and warnings. +

+ +

2002-11-02 Raptor Version 0.9.6 Released

+

Calling API changed to provide a common interface to +the RDF parsers. The libraptor.3 manual page describes the changes.
+Added support for RDF datatyped literals in +RDF/XML with +rdf:datatype attribute on property elements and +N-Triples +with the "string"^^<datatypeURIref>.
+Added support for rdf:parseType="Collection" for RDF Collections
+URI class allows swappable implementation by applications.
+URI class now handles file: URIs for Win32 and Unix conventions.
+Fixes to enable it to work on Apple OSX 10.1, 10.2 +(also tested working on Linux/x86, Solaris/sparc, FreeBSD/x86)
+Many internal changes to support API changes, allow it to work +with Redland when compiled as a separate library
+Reorganised source into separate modules - URI, xml parser, +ntriples parser, XML namespaces, XML qnames, locator.
+More resilience with XML errors and XML parser errors - none of +libxml2's XML test suite examples crash raptor.
+N-Triples +parser recovers gracefully from errors in content
+Packing for debian included
+Added manual pages libraptor.3 and rapper.1
+Added raptor-config script for compiling with the library. +

+ + +

2002-06-08 Raptor Version 0.9.5 Released

+

Many bugs fixed
+Added full relative URI resolving
+Work around bugs in libxml and expat (older versions)
+Support libxml with the use of entities in the document
+Support xml:lang passing to application +

+ +

2002-03-27 Raptor Version 0.9.4 Released

+

XML Base support (xml:base) added
+xml:lang support added with N-Triples lang-string support
+All N-Triples string escapes implemented
+N-Triples support with XML literals - xml("<foo/>") and plain "foo"
+removed all special code for containers; treated as regular typedNodes
+rdf:parseType="Literal" now working
+Builds as shared and static libraries
+Conformance test suite added +

+ +

2001-08-21 Raptor Version 0.9.3 Released

+

N-Triples +parser added
+rdf:parseType="Literal" works much better (Aaron Michal and me)
+DAML collections support added (Aaron Michal)
+Win32 patch added - I can't confirm my merge didn't break this (Aaron Michal)
+N-Triples updated to support CR, LF and CR LF endings
+Make parser generated ids appear distinguised from regular URIs
+Added N-Triples output
+Made rdf:type, rdf:value as property attributes work
+Made empty typed nodes work
+GNOME xml / libxml error location (line, column) values corrected. +

+ +

2001-07-03 Raptor Version 0.9.2 Released

+

Now called Raptor

+ +

2001-06-06 Raptor Version 0.9.1 Released

+

Many bug fixes
+Updates for Redland API changes
+Fixed rdf:parsetype="Literal" buffer overrun
+Added better XML parser auto-detection for various expats and libxml +

+ +

2001-01-22 Raptor Version 0.9.0 Released

+

First release

+ +
+ +

Copyright (C) 2001-2023 Dave Beckett
Copyright (C) 2001-2005 University of Bristol

+ + + diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..8c90e22 --- /dev/null +++ b/NOTICE @@ -0,0 +1,3 @@ +This product includes Redland software (http://librdf.org/) +developed at the Institute for Learning and Research Technology, +University of Bristol, UK (http://www.bristol.ac.uk/). diff --git a/README b/README new file mode 100644 index 0000000..8ec2628 --- /dev/null +++ b/README @@ -0,0 +1,211 @@ + #DOAP + + Raptor RDF Syntax Library + +Dave Beckett + +Overview + + Raptor is a free software / Open Source C library that provides a set + of parsers and serializers that generate Resource Description Framework + (RDF) triples by parsing syntaxes or serialize the triples into a + syntax. The supported parsing syntaxes are RDF/XML, N-Quads, N-Triples + 1.0 and 1.1, TRiG, Turtle 2008 and 2013, RDFa 1.0 and 1.1, RSS tag soup + including all versions of RSS, Atom 0.3 and Atom 1.0, GRDDL and + microformats for HTML, XHTML and XML. The serializing syntaxes are + RDF/XML (regular, abbreviated, XMP), Turtle 2013, N-Quads, N-Triples + 1.1, Atom 1.0, RSS 1.0, GraphViz DOT, HTML, JSON and mKR. + + Raptor was designed to work closely with the Redland RDF library (RDF + Parser Toolkit for Redland) but is entirely separate. It is a portable + library that works across many POSIX systems (Unix, GNU/Linux, BSDs, + OSX, cygwin, win32). + + A summary of the changes can be found in the NEWS file, detailed API + changes in the release notes and file-by-file changes in the ChangeLog. + + Details of upgrading from Raptor 1 as described in the Upgrading + document. + * Designed to integrate well with Redland + * Parses content on the web if libcurl, libxml2 or BSD libfetch is + available. + * Supports all RDF terms including datatyped and XML literals + * Optional features including parsers and serialisers can be selected + at configure time. + * Language bindings to Perl, PHP, Python and Ruby when used via + Redland + * No memory leaks + * Fast + * Standalone rapper RDF parser utility program + + Known bugs and issues are recorded in the Redland issue tracker or at + GitHub issues for Raptor. + +Parsers + + RDF/XML Parser + + A Parser for the standard RDF/XML syntax. + * Fully handles the RDF/XML syntax updates for XML Base, xml:lang, + RDF datatyping and Collections. + * Handles all RDF vocabularies such as FOAF, RSS 1.0, Dublin Core, + OWL, DOAP + * Handles rdf:resource / resource attributes + * Uses libxml XML parser + + N-Quads Parser + + A parser for the RDF 1.1 N-Quads - A line-based syntax for an RDF + datasets, W3C Candidate Recommendation, 05 November 2013. This is an + extension to N-Triples, providing an optional 4th context graph term at + the end of the line when a triple is associated with a named graph. + + N-Triples Parser + + A parser for the RDF 1.1 N-Triples - A line-based syntax for an RDF + graph, W3C Candidate Recommendation, 05 November 2013 (aka N-Triples + 2013) based on the older N-Triples. + + Turtle Parser + + A parser for the Turtle Terse RDF Triple Language W3C Candidate + Recommendation, 19 February 2013 based on earlier work Turtle Terse RDF + Triple Language (2004) + + TRiG Parser + + A parser for the RDF 1.1 TriG RDF Dataset Language. + + The parser does not support the entire 1.1 TRiG specification; the '{' + ... '}' around a graph and the GRAPH keyword may not be omitted. + + RSS "tag soup" parser + + A parser for the multiple XML RSS formats that use the elements such as + channel, item, title, description in different ways. Attempts to turn + the input into RSS 1.0 RDF triples. True RSS 1.0, as a full RDF + vocabulary, is best parsed by the RDF/XML parser. It also generates + triples for RSS enclosures. + + This parser also provides support for the Atom 1.0 syndication format + defined in IETF RFC 4287 as well as the earlier Atom 0.3. + + GRDDL and microformats parser + + A parser/processor for Gleaning Resource Descriptions from Dialects of + Languages (GRDDL) syntax, W3C Recommendation of 2007-09-11 which allows + reading XHTML and XML as RDF triples by using profiles in the document + that declare XSLT transforms from the XHTML or XML content into RDF/XML + or other RDF syntax which can then be parsed. It uses either an XML or + a lax HTML parser to allow HTML tag soup to be read. + + The parser passes the all the GRDDL tests as of Raptor 1.4.16. + + The parser also handles hCard and hReview using public XSL sheets. + + RDFa parser + + A parser for RDFa 1.0 (W3C Recommendation 14 October 2008) and RDFa 1.1 + (W3C Recommendation 07 June 2012) implemented via librdfa linked inside + Raptor. librdfa was, written primarily by Manu Sporny of Digital Bazaar + and is licensed with the same license as Raptor. + + As of Raptor 2.0.8 the RDFa parser passes all of the RDFa 1.0 test + suite except for 4 tests and all of the RDFa 1.1 test suite except for + 30 tests. + +Serializers + + RDF/XML Serializer + + A serializer to the standard RDF/XML syntax as revised by the W3C RDF + Core working group in 2004. This writes a plain triple-based RDF/XML + serialization with no optimisation or pretty-printing. + + A second serializer is provided using several of the RDF/XML + abbreviations to provide a more compact readable format, at the cost of + some pre-processing. This is suitable for small documents. + + N-Quads Serializer + + A serializer for the RDF 1.1 N-Quads -A line-based syntax for an RDF + datasets, W3C Candidate Recommendation, 05 November 2013. This is an + extension to N-Triples, providing an optional 4th context graph term at + the end of the line when a triple is associated with a named graph. + + N-Triples Serializer + + A serializer for the RDF 1.1 N-Triples - A line-based syntax for an RDF + graph (aka N-Triples 2013) based on the earlier N-Triples syntax as + used by the W3C RDF Core working group for the RDF Test Cases. + + Atom 1.0 Serializer + + A serializer to the Atom 1.0 syndication format defined in IETF RFC + 4287. + + JSON Serializers + + Two serializers for to write triples encoded in JSON: + 1. json: in a resource-centric abbreviated form like Turtle or + RDF/XML-Abbreviated as defined by: RDF 1.1 JSON Alternate + Serialization (RDF/JSON), W3C Working Group Note, 07 November 2013 + 2. json-triples: a triple-centric format based on the SPARQL results + in JSON format. + + JSON-LD is not supported - too complex to implement. + + GraphViz DOT Serializer + + An serializer to the GraphViz DOT format which aids visualising RDF + graphs. + + RSS 1.0 Serializer + + A serializer to the RDF Site Summary (RSS) 1.0 format. + + Turtle Serializer + + A serializer for the Turtle Terse RDF Triple Language W3C Candidate + Recommendation, 19 February 2013 + + XMP Serializer + + An alpha quality serializer to the Adobe XMP profile of RDF/XML + suitable for embedding inside an external document. + + mKR Serializer + + A serializer for the mKR (my Knowledge Representation) Language + +Documentation + + The public API is described in the libraptor.3 UNIX manual page. It is + demonstrated in the rapper utility program which shows how to call the + parser and write the triples in a serialization. When Raptor is used + inside Redland, the Redland documentation explains how to call the + parser and contains several example programs. There are also further + examples in the example directory of the distribution. + + To install Raptor see the Installation document. + +Sources + + The packaged sources are available from + http://download.librdf.org/source/ (master site) The development GIT + sources can also be browsed at GitHub or checked out at + git://github.com/dajobe/raptor.git + +License + + This library is free software / open source software released under the + LGPL (GPL) or Apache 2.0 licenses. See LICENSE.html for full details. + +Mailing Lists + + The Redland mailing lists discusses the development and use of Raptor + and Redland as well as future plans and announcement of releases. + __________________________________________________________________ + + Copyright (C) 2000-2023 Dave Beckett + Copyright (C) 2000-2005 University of Bristol diff --git a/README-cmake.md b/README-cmake.md new file mode 100644 index 0000000..3343779 --- /dev/null +++ b/README-cmake.md @@ -0,0 +1,216 @@ +This file is based on the email that Daniel Richard G. sent to +redland-dev: + + http://lists.librdf.org/pipermail/redland-dev/2012-July/002502.html + +I lightly edited the email to fit into 80 chars and make more it +markdowny and turn it into notes. + +-- Dave + +---------------------------------------------------------------------- +Date: Thu, 5 Jul 2012 14:56:01 -0400 +From: Daniel Richard G. +To: redland-dev + +Hello list, + +I've implemented support for building the Raptor library using the +CMake build configuration tool. This is intended not to replace the +existing GNU-Autotools-based configuration / build framework, but to +provide a better solution for building Raptor on Windows (and +potentially other platforms) than hand-maintained project files for +various popular IDEs. + +* [http://cmake.org/](CMake) + +* [http://en.wikipedia.org/wiki/CMake](CMake on Wikipedia) + +There are several reasons why I chose CMake for this: + +* It can generate project / solution / workspace files for basically + every version of Visual Studio in existence, from a common set of + definitions + +* Likewise, it can generate project files for less-common IDEs (e.g. + CodeBlocks, Apple Xcode) and makefile-trees for NMake, Borland, + MSYS... + +* A friendly GUI frontend is provided on Windows, great for IDE users + who like to click on things + +* CMake doesn't neglect to support Linux / Unix, of course; even + black-sheep systems like AIX are covered + +* The tool is actively maintained and developed by the folks at Kitware + +* The KDE folks moved whole-hog from Autotools to CMake due to its + solid support for Windows and popular IDEs, and while I certainly + wouldn't advocate a CMake-only zeitgeist, it certainly speaks to + their confidence in the tool + +* Of course: CMake is free software, distributed under the + three-clause BSD license + +* Teragram and I have used CMake extensively for the purpose of + facilitating Windows builds of primarily Autotools-based projects, + and so my own exerience has borne out the strengths of this + approach. + + +That's not to say, of course, that the tool is perfect: + +* The syntax and naming conventions used in the CMake scripting + language and standard modules are more in line with Windows culture + than Unix (ALL_CAPS, semicolon separators and CamelCasing are in + abundance) + +* Some operations, like setting predefined compiler flags, are + needlessly harder to do compared to Autoconf (where you can just + e.g. assign to CFLAGS) + +* When CMake generates makefiles, they make the ones produced by + Automake look simple and elegant by comparison :> You definitely + get more of an IDE-like experience when building with these, which + some folks may like, but I don't care for at all. + + +Nevertheless, I consider CMake's strengths to outweigh its +weaknesses. I myself am as much an Autotools-alternative skeptic as +anyone, and tend to look leerily at all the ones that have come +along---especially when I've no choice but to deal with them +(e.g. SCons in NSIS). But CMake not only stands strong where +Autotools is weak (support for non-Cygwin / MSYS Windows +environments, support for IDEs), it does so in a fully general, +polished, and consistent way. This is the one that, in my view, has +risen above the pack. + +All that said, then, I'll go on to the particulars of this CMake +implementation for Raptor. (Everything is in the attached patch, +against git master.) + +This turned out to be a fairly complex project, because the Raptor +library has so many features that can be enabled / disabled / +configured. These are not merely controlled by #define'ing +or #undefing cpp symbols; object files also need to be added or +removed, as well as associated third-party library +dependencies. Plus, the library conforms to various potential quirks +in LibXML2, which need to be checked for at configure time. This +complexity may be seen mostly in the top-level CMakeLists.txt file +and src/CMakeLists.txt. + +The `win32_raptor_config.h` header is no longer used; this is replaced +by the more general `raptor_config_cmake.h.in`, which CMake +instantiates with configuration-specific values much as Autoconf +instantiates `raptor_config.h.in`. Rather than remove the +`#include ` directive from numerous files, +however, I added an `#if 0` block to the header to make it a no-op +(to keep an already large patch from becoming even larger). + +In addition to reproducing the library build in CMake, I've also +reproduced most of the test suite. Of course, the test suite is +fairly extensive, and consists of numerous similar invocations of +rapper and rdfdiff; maintaining all of these in Automake is enough of +a task already without the extra work of maintaining it in CMake. So +I opted for an approach wherein the CMake test definitions are +generated as a side effect of the shell code that drives the tests in +Automake. + +The patch contains `tests/*/CMakeLists.txt`, of course, but it also +contains changes to the associated `Makefile.am` files that write out +the bulk of the CMake script to `CMakeTests.txt` (filename is +arbitrary; `make clean` deletes it). The intent is not full-auto +generation of the `CMakeLists.txt` files, but to make most of the work +in maintaining them a matter of cut-and-paste. (It wouldn't take much +more to enable full-auto generation, but I think there is value in +having the maintainer at least eyeball what's going in.) + +The CMake-based test suite does have a few shortcomings compared to +the Automake-based one, and will need further refinement: + +* Tests that compare output to a reference do not check for file + equality as a way of avoiding the use of rdfdiff. This is a problem + because rdfdiff currently blows up on certain inputs (e.g. test + 0176 in rdfa11). + +* That would be easier to resolve if it weren't for the issue of + comparing CRLF output from rapper on Windows to LF reference + files. CMake has built-in functionality to compare files, but as + currently implemented, it is basically a cross-platform + cmp(1) --- there's no way to see past differences in EOL + convention. I've filed a feature request on this... + [http://public.kitware.com/Bug/view.php?id=13007](CMake Isue 13007) + ...but for now, I'm using CMake's `CONFIGURE_FILE()` to normalize + line endings on the output files before doing the comparison. + +* `tests/turtle/CMakeLists.txt` has yet to be written, as the + exit-status logic there is a bit more involved than the other test + sections. + +* There is some awkwardness on Windows, when the rapper and rdfdiff + binaries depend on third-party DLLs (e.g. LibXML2). A correctly-set + PATH allows the DLLs to be found, but Visual Studio isn't terribly + straightforward about how to set PATH when running a program, and + (IIRC) the failure mode was not even obvious to begin with. I've + addressed this, if a little ham-handedly, by enabling the test + suite only when building Raptor with a makefile tree. + + +Other caveats of this CMake implementation: + +* This build framework is not enough to produce a Raptor DLL. There + are issues regarding DLL-export linkage of various functions in + `raptor_internal.h` and `turtle_common.h` that need + addressing. I'll bring those up here on the list once the CMake + stuff is hashed out. + +* Support for JSON --- and more specifically, the YAJL library --- is + penciled in, but not yet working or tested. (I have no experience + with this library, let alone on Windows.) + +* Generation of `turtle_lexer.c`, `turtle_parser.c` and such is not + implemented at all. This can be added, but my working premise is + that the CMake build framework is meant for library users, not + developers. + + +If you would like to kick the tires of this CMake implementation, +here are some steps to get you started: + +1. Apply my patch to a copy of Raptor's git master source + +2. Run `./autogen.sh`, `./configure` and `make dist` + +3. Unpack the resulting dist tarball somewhere + +4. Download and install the CMake tool + +5. (Linux) Create a new, empty build directory, and from there, + invoke + + $ cmake /path/to/raptor2-dist-src + + This is the equivalent of running plain `./configure`, with + default values for everything. Provided that you have all the + requisite libraries installed, this should produce a makefile + tree. + +5. (Windows) Run the `cmake-gui` application, set the source and + build paths at the top (the latter should be a new, empty + directory) and hit Configure. Select an appropriate "generator" + (this is where you choose the specific IDE or other build system + you want), then hit Finish. Allow CMake to run the configuration + checks, and if these succeed, hit Generate. Once the generation + process is finished, you may close CMake and use the + newly-generated build system. + +6. If you are building with makefiles, the test suite is invoked with + the "test" target, not "check". + +Questions and comments on this implementation are welcome; I'll do my +best to answer any. This framework addresses a difficulty that +Teragram has had with this library, and I hope it will do the same +for others here. + + +--Daniel diff --git a/README.html b/README.html new file mode 100644 index 0000000..5095083 --- /dev/null +++ b/README.html @@ -0,0 +1,322 @@ + + + + + Raptor RDF Syntax Library + + + + +

Raptor RDF Syntax Library

+

Dave Beckett

+ + +

Overview

+ +

Raptor +is a free software / Open Source C library that provides +a set of parsers and serializers that +generate Resource Description Framework (RDF) triples +by parsing syntaxes or serialize the triples into a syntax. +The supported parsing syntaxes are RDF/XML, N-Quads, N-Triples 1.0 +and 1.1, TRiG, Turtle 2008 and 2013, RDFa 1.0 and 1.1, RSS tag soup +including all versions of RSS, Atom 0.3 and Atom 1.0, GRDDL and +microformats for HTML, XHTML and XML. The serializing syntaxes are +RDF/XML (regular, abbreviated, XMP), Turtle 2013, N-Quads, N-Triples +1.1, Atom 1.0, RSS 1.0, GraphViz DOT, HTML, JSON and mKR. +

+ +

Raptor was designed to work closely with the +Redland RDF library +(RDF Parser Toolkit for Redland) +but is entirely separate. It is a portable library that works +across many POSIX systems (Unix, GNU/Linux, BSDs, OSX, cygwin, win32). +

+ +

A summary of the changes can be found in the +NEWS file, +detailed API changes in the release notes +and file-by-file changes in the ChangeLog. +

+ +

Details of upgrading from Raptor 1 as described in the +Upgrading document. +

+ +
    +
  • Designed to integrate well with Redland
  • +
  • Parses content on the web if libcurl, libxml2 or BSD libfetch is available.
  • +
  • Supports all RDF terms including datatyped and XML literals
  • +
  • Optional features including parsers and serialisers can be selected at configure time.
  • +
  • Language bindings to Perl, PHP, Python and Ruby when used via Redland
  • +
  • No memory leaks
  • +
  • Fast
  • +
  • Standalone rapper RDF parser utility program
  • +
+ +

Known bugs and issues are recorded in the +Redland issue tracker +or at +GitHub issues for Raptor. +

+ + + +

Parsers

+ +

RDF/XML Parser

+ +

A Parser for the standard +RDF/XML syntax. +

+ + + +

N-Quads Parser

+ +

A parser for the +RDF 1.1 N-Quads - A line-based syntax for an RDF datasets, W3C Candidate Recommendation, 05 November 2013. +This is an extension to N-Triples, providing an optional 4th context +graph term at the end of the line when a triple is associated with a +named graph. +

+ + +

N-Triples Parser

+ +

A parser for the +RDF 1.1 N-Triples - A line-based syntax for an RDF graph, W3C Candidate Recommendation, 05 November 2013 (aka N-Triples 2013) +based on the older +N-Triples. +

+ + +

Turtle Parser

+ +

A parser for the +Turtle Terse RDF Triple Language W3C Candidate Recommendation, 19 February 2013 +based on earlier work +Turtle Terse RDF Triple Language (2004) +

+ + +

TRiG Parser

+ +

A parser for the +RDF 1.1 TriG RDF Dataset Language. +

+ +

The parser does not support the entire 1.1 TRiG specification; the +'{' ... '}' around a graph and the GRAPH keyword may not +be omitted. +

+ + +

RSS "tag soup" parser

+ +

A parser for the multiple XML RSS formats that use the elements +such as channel, item, title, description in different ways. +Attempts to turn the input into +RSS 1.0 +RDF triples. True RSS 1.0, +as a full RDF vocabulary, is best parsed by the RDF/XML parser. +It also generates triples for RSS enclosures. +

+ +

This parser also provides support for the Atom 1.0 syndication +format defined in IETF +RFC 4287 +as well as the earlier Atom 0.3. +

+ + +

GRDDL and microformats parser

+ +

A parser/processor for +Gleaning Resource Descriptions from Dialects of Languages (GRDDL) +syntax, W3C Recommendation of 2007-09-11 which allows reading XHTML +and XML as RDF triples by using profiles in the document that declare +XSLT transforms from the XHTML or XML content into RDF/XML or other +RDF syntax which can then be parsed. It uses either an XML or +a lax HTML parser to allow HTML tag soup to be read. +

+ +

The parser passes the all the GRDDL tests as of Raptor 1.4.16. +

+ +

The parser also handles hCard and hReview using public XSL sheets. +

+ + +

RDFa parser

+ +

A parser for +RDFa 1.0 +(W3C Recommendation 14 October 2008) and +RDFa 1.1 +(W3C Recommendation 07 June 2012) +implemented via librdfa +linked inside Raptor. librdfa was, written primarily by Manu Sporny +of Digital Bazaar and is licensed with the same license as Raptor. +

+ +

As of Raptor 2.0.8 the RDFa parser passes all of the +RDFa 1.0 test suite +except for 4 tests and all of the +RDFa 1.1 test suite +except for 30 tests. +

+ + +

Serializers

+ +

RDF/XML Serializer

+ +

A serializer to the standard +RDF/XML syntax +as revised by the +W3C RDF Core working group +in 2004. This writes a plain triple-based RDF/XML serialization with +no optimisation or pretty-printing. +

+ +

A second serializer is provided using several of the RDF/XML +abbreviations to provide a more compact readable format, at the cost +of some pre-processing. This is suitable for small documents. +

+ + +

N-Quads Serializer

+ +

A serializer for the +RDF 1.1 N-Quads -A line-based syntax for an RDF datasets, W3C Candidate Recommendation, 05 November 2013. +This is an extension to N-Triples, providing an optional 4th context +graph term at the end of the line when a triple is associated with a +named graph. +

+ + +

N-Triples Serializer

+ +

A serializer for the +RDF 1.1 +N-Triples - A line-based syntax for an RDF graph (aka N-Triples 2013) +based on the earlier +N-Triples +syntax as used by the +W3C RDF Core working group +for the RDF Test Cases. +

+ + +

Atom 1.0 Serializer

+ +

A serializer to the Atom 1.0 syndication format defined in IETF +RFC 4287. +

+ + +

JSON Serializers

+ +

Two serializers for to write triples encoded in JSON:

+
    +
  1. json: in a resource-centric abbreviated form +like Turtle or RDF/XML-Abbreviated as defined by: +RDF 1.1 +JSON Alternate Serialization (RDF/JSON), W3C Working Group Note, 07 November 2013 +
  2. +
  3. json-triples: a triple-centric format based on the +SPARQL results in JSON format.
  4. +
+

JSON-LD is not supported - too complex to implement.

+ + +

GraphViz DOT Serializer

+ +

An serializer to the GraphViz +DOT format +which aids visualising RDF graphs. +

+ + +

RSS 1.0 Serializer

+ +

A serializer to the +RDF Site Summary (RSS) 1.0 +format. +

+ + +

Turtle Serializer

+ +

A serializer for the +Turtle Terse RDF Triple Language W3C Candidate Recommendation, 19 February 2013 +

+ +

XMP Serializer

+ +

An alpha quality serializer to the Adobe XMP profile of RDF/XML +suitable for embedding inside an external document. +

+ +

mKR Serializer

+ +

A serializer for the +mKR (my Knowledge Representation) Language +

+ +

Documentation

+ +

The public API is described in the +libraptor.3 UNIX manual page. +It is demonstrated in the +rapper +utility program which shows how to call the parser and write +the triples in a serialization. When Raptor is used inside +Redland, +the Redland documentation explains +how to call the parser and contains several example programs. +There are also further examples in the example directory +of the distribution. +

+ +

To install Raptor see the Installation document. +

+ + +

Sources

+ +

The packaged sources are available from +http://download.librdf.org/source/ (master site) +The development GIT sources can also be +browsed at GitHub +or checked out at git://github.com/dajobe/raptor.git +

+ + +

License

+ +

This library is free software / open source software released +under the LGPL (GPL) or Apache 2.0 licenses. See +LICENSE.html for full details. +

+ + +

Mailing Lists

+ +

The Redland mailing lists +discusses the development and use of Raptor and Redland as well as +future plans and announcement of releases. +

+ +
+ +

Copyright (C) 2000-2023 Dave Beckett
Copyright (C) 2000-2005 University of Bristol

+ + + diff --git a/RELEASE.html b/RELEASE.html new file mode 100644 index 0000000..8f95e8f --- /dev/null +++ b/RELEASE.html @@ -0,0 +1,4873 @@ + + + + + Raptor RDF Syntax Library - Release Notes + + + +

Raptor RDF Syntax Library - Release Notes

+ + +

Raptor2 2.0.16 changes

+ +

Release because ... it's been a while

+ +

CVE-2017-18926 +fixed in commit 590681e546cd9aa18d57dc2ea1858cb734a3863f

+ +

CVE-2020-25713 +fixed in commit 4f5dbbffcc1c6cf0398bd03450453289a0979dea

+ +

Issues Fixed:

+
    +
  • 0000600: Can't compile on Cygwin: sort_r.h "Cannot detect operating system"
  • +
  • 0000606: "JSON" format outputs invalid Unicode escapes
  • +
  • 0000617: heap buffer overflow in raptor_qname_format_as_xml
  • +
  • 0000618: heap buffer overflow in raptor_xml_writer_start_element_common
  • +
  • 0000650: Out of bounds read leads to segfault in raptor_xml_writer_start_element_common
  • +
  • 0000652: Manpage for the rapper utility describes the wrong Atom version
  • +
+ + +

Parser changes

+ +

The Turtle parser was improved to process input in chunks, rather +than all in one step (with a large memory buffer). This allows +Turtle to read and parse files much larger than the system memory; it +splits the inputs after the end of a turtle "sentence" that ends in a +.. Includes memory usage minimizing with AVLTree +pruning during serializing and addition of turtle serializer flush +implementation. + +This improvment across multiple patches was contributed by +Sebastian Freundt. Thanks +Pull Request #37 +Pull Request #38 +

+ +

Turtle parser improvements for Bison 3+ and removing deprecated or +older style directives. +Thanks to fix from Akim Demaille +Pull Request #43 +

+ +

Turtle parser fixes for cleaning up va_arg on failure paths. +[coverity CID 343351] +

+ +

grddl parser: fix leak on failure paths of WWW model methods +[coverity CID 343353] +

+ + +

Serializer changes

+ +

Added a serializer for the +mKR (my Knowledge Representation) +language with the name mkr Patch developed by Richard +H. McCullough based on the Turtle serializer. Thanks. +Pull Request #25 +

+ +

XML writer calculate max nspace declarations correctly. +Fixes Issues +#0000617 +and +#0000618 +

+ +

JSON writer changed to write UTF-8 for JSON literals +Add RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8 to +RAPTOR_ESCAPED_WRITE_JSON_LITERAL +Fixes Issue +#0000606 +

+ +

rdfxmla serializer was fixed to handle leak of iter object on some +failure pathes. [coverity CID 343354] [coverity CID 343358] +

+ +

Fix for RSS 1.0 serializing default namespaces.

+ +

Writer changes

+ +

XML Writer: compare namespace declarations correctly. Applied a patch from +0001-CVE-2020-25713-raptor2-malformed-input-file-can-lead.patch.1 +that fixes +Issue #0000650 +which overwrote heap during XML writing in parse type literal +content. This was detected with clang asan. Thanks to fix from Michael Stahl +/ mst2. +

+ +

Build and portability fixes

+ +

CMake fixes

+
    +
  • Fix cmake builds for time.h check change, generated pc file. +Thanks to fix from Artturin. +Pull Request #52 +
  • + +
  • Multiple cmake build fixes. Thanks to multiple changes from +mathvich. +Pull Request #50 +
  • + +
  • Multiple fixes for Appveyor's Windows build using CMake +Thanks to fix from 0u812. +
  • + +
  • Multiple fixes for Cmake build system to allow building from +source including running flex, bison and running the tests. +Thanks to fix from 0u812. +
  • + +
  • Made Raptor build again with CMake under Windows via CI as a +service Appveyor. The resulting binaries and libraries were not +tested.
  • +
+ +

Remove and fix obsolete autoconf: AC_PROG_LEX AC_HEADER_TIME AC_HEADER_STDC. +

+ +

Update bison check to find first new enough GNU bison

+ +

Fix configure.ac -Wimplicit-function-declaration in +HAVE___FUNCTION__ test to provide Clang 16 support. Fix +from Sam James, thanks. +

+ +

Support newer ICU UC version (>=56) for newer NFC check +interface unorm2_quickCheck()..

+ +

Several minor fixes and workarounds for clang ASAN warnings or +false warnings - not able to understand raptor's reference model.

+ +

Updated fix-flex.pl script for newer flex naming conventions.

+ +

Portability fixes found with GCC 10 and newer compilers for wrong +error message callbacks in turtle and grddl parsers +

+ +

Later, updated to make bison 3.4 the minimum.

+ +

Update turtle parser and support scripts to work with Bison 3.0.5 +Patch contributed by Adam Novak. Thanks. +Pull Request #39 +

+ +

Fix GNUInstallDirs for install paths to be able to install +libraptor2.a and raptor2.pc to a specific directory when +cross-compiling. Thanks to fix from +Eric Le Lay. +Pull Request #36 +

+ +

Made some code changes to quiet GCC extra warnings.

+ +

Portability fixes for OpenBSD

+ +

Some portability for building under cygwin by Richard +H. McCullough while developing the mkr serializer. +

+ +

Portability fixes in the raptor2.spec file. +Thanks to fix by philjohn +

+ +

Enable pkg-config to work when cross-building such as +with yocto. Thanks to fix by Andreas Müller. +

+ +

Use only pkgconfig for libxslt and ICU UC. Patches from Hugh +McMaster. Thanks. +

+ +

Updated Travis configuration to try builds across a wider range of +compilers and with clang ASAN enabled.

+ + + +

Other changes

+ +

Handle deleting empty avltree. Fixes invalid pointer reference +reported by Li Qiang via email. Thanks. +

+ +

Change rapper(1) utility to count in longs instead of +ints. Because: billions and billions of triples. Thanks to patch +from Jerven Bolleman. +

+ +

Accept cygwin as a Linux-like. +Fixes Issue #0000600. +

+ +

Mention Atom 0.3 in docs and manual page +Fixes Issue #0000652. +

+ +

Check curl_easy_setopt() return values for errors In +several places check for curl_easy_setopt() erorr +returns and fail. [coverity CID 343360] +

+ +

Fixed internal ICU string NFC check to convert to UTF-16 first +before trying to do a NFC normalization check. This allows returning +an error response. +

+ +

raptor_uri_counted_filename_to_uri_string() fix to +copy NUL when copying the file://code prefix. Coverity +false positive since the following lines of code always add more +characters and a NUL. "Fixes" [Coverity CID 353858] +

+ + +

Raptor2 2.0.15 changes

+ + +

This release mainly made general bug fixes as well as several +fixes to the Turtle / N-Triples family of parsers and serializers. It +added utility functions for re-entrant sorting of objects and +sequences and a few other useful methods.
+

+ + +

Issues Fixed:

+
    +
  • 0000574: Language tags with underscore
  • +
  • 0000575: Wrong API or wrong API documentation
  • +
  • 0000576: Wrong assert for a counted string being nul terminated
  • +
  • 0000577: iri parsing does not conform to REC-n-quads-20140225
  • +
  • 0000579: raptor_world_generate_bnodeid accepts world not parser
  • +
  • 0000581: My patch for parser and serializers count
  • +
  • 0000584: raptor fails to parse trig files with dos line endings
  • +
+ + +

Parser changes

+ +

Fixed raptor_grddl_filter_triples() check for three +URIs which has been broken since 2007 but just did more work. Found +via gcc5 warning.

+ +

The TRiG parser now accepts \r newlines between the graph name and +the following '{'. +Fixes Issue #0000584 +

+ +

Turtle, TRiG, N-Triples and N-Quads parsers now check escapes +correctly for URI strings. \t \b \n \r \f are forbidden. Check that +raw ' ' or \u0020, \u003C or \u003E are also not accepted. +Fixes Issue #0000577 +

+ +

N-Triples / N-Quads parsers nwo accept '_' as an alias for '-' in +lang strings. '_' is not legal. +Fixes Issue #0000574 +

+ +

Updated RDFa parser (librdfa) to support full URLs for +typeof from upstream. Re-checked several tests which +have been passing for some time but the expected output was not a +correct conversion from the testsuite sparql.

+ +

Serializer changes

+ +

Turtle serializer now writes () instead of +rdf:nil via +Pull Request #16 +from Richard H. McCullough. Thanks! +

+ +

I/O-stream class changes

+ +

raptor_iostream_decimal_write() and +raptor_iostream_hexadecimal_write now return non-0 if +they do not succeed in writing successfully. +Fixes Issue #0000575 +

+ +

Term class changes

+ +

raptor_new_term_from_blank() now also accepts "" as +the same as a NULL blank node ID argument.

+ +

URI class changes

+ +

Fixed raptor_uri_counted_filename_to_uri_string() to +use the passed in len, not look for end NUL char and count lengths. +Fixes Issue #0000576. +

+ +

raptor_new_uri_from_counted_string() no longer +assumes a NUL terminated string. Remove a debug assert and use +fwrite() to emit the counted URI string to the debug +file handler.

+ +

Fixed raptor_uri_normalize_path() to check the size of +output buffer is big enough.

+ +

Writer class changes

+

Fixed raptor_turtle_writer_quoted_counted_string() to +use the passed in length, drop the strlen() call and use +the length internally. +Fixes Issue #0000576. +

+ +

World class changes

+ +

Added raptor_world_get_parsers_count() +and raptor_world_get_serializers_count() +with patch from Victor Porton. Thanks! +Fixes Issue #0000581.

+ +

Other Changes

+ +

Made raptor work with Travis CI again; have to download and +install Bison 3.

+ +

Added raptor_sort_r() and +raptor_sequence_sort_r() re-entrant sort utility methods +based on the public domain sort_r code by Isaac +Turner. +

+ +

Ensure raptor_locator_format() always adds a NUL to +terminate the output string.

+ +

Fix a -99 <= var <= 99 timezone interval check. Thanks to +Richard Trieu for the report.

+ +

Improve configure warning check using AC_LANG_WERROR

+ +

Use C99 __FUNCTION__ replacing __func__ +from C90.

+ +

Improve build-time flex and bison output to be more silent.

+ +

Added Intel C compiler (icc) support from Sebastian Freundt +(hroptatyr on GitHub) - Thanks.

+ + +

Raptor2 2.0.14 changes

+ +

Many code quality fixes from clang and coverity primarily in error +path cleanups (out of memory cases) and dead code.

+ +

Parser changes

+ +

Turtle 1.1 parser: fixes about triple quoting alignment with +SPARQL from the www-rdf-comments list post REC +report of problem +and +expected answer. +

+ +

Other changes

+ +

Fixed RDFa 1.0 and RDFa 1.1 test suites to properly report +failures.

+ +

Updated the fix-flex and fix-bison scripts to remove dead +code that clang and coverity complain about.

+ + +

Raptor2 2.0.13 changes

+ +

Issues Fixed:

+
    +
  • 0000562: N-Quads parsing of URIs with ' fails
  • +
+ +

Parser changes

+ +

The N-Triples / N-Quads parser was updated to allow ' in URIs. +Fixes Issue #0000562. +

+ +

Configuration changes

+ +

Use the discovery of the xml2-config(1) / +curl-config(1) programs as test for presence of the +libraries. This fixes the issue where that after configuring, curl +was present but was not used for WWW fetching. This is seen when +the output of curl-config --cflags is empty / whitespace. +

+ +

Updated to use the AC_CHECK_PROGS macro to find jing +since AC_CHECK_PROG doesn't default to setting it as +found when present! +

+ +

Internal changes

+ +

The Turtle and parsedate parsers and the turtle lexer were updated +to use and require Bison 3.0.0. +

+ +

The JSON and turtle writers were updated to save several expensive +strlen() calls.

+ + +

Raptor2 2.0.12 changes

+ +

Parser changes

+ +

The N-Triples / N-Quads parser was updated to pass all the two test +suites for the updated specifications: +

+ +

The main fixes were:

+
    +
  • allow \b and \f escapes (from Turtle, SPARQL)
  • +
  • fix the allowed blank node identifier characters
  • +
  • require all URIs to be absolute
  • +
  • handle a single short document with no end of line
  • +
  • support NULs inside literals
  • +
  • handle unescaped newlines inside literals
  • +
+ +

Term class changes

+ +

Added raptor_new_term_from_counted_string() to +create a term from a Turtle or N-Triples string syntax. This is +the opposite of raptor_term_to_turtle_counted_string() +and raptor_term_to_turtle_string() and also reads the +strings created by raptor_term_to_counted_string() and +raptor_term_to_string(). +

+ + +

Raptor2 2.0.11 changes

+ +

Issues Fixed:

+
    +
  • 0000556: Problem with relative URI in rdf:about, rdf:resource etc.
  • +
  • 0000554: RDF/XML serializer does not canonicalize attribute order in XMLLiterals
  • +
+ +

Parser changes

+ +

N-Triples parser was updated to support all of +RDF 1.1 +N-Triples - A line-based syntax for an RDF graph (aka N-Triples 2013) +It now supports # comments after the end of +lines, checks for illegal unicode escapes, checks for bad URIs and +checks language tags. +Also removed support for legacy N-Triples +"foo"-LANGTOKEN. +Many internal changes were also made. +

+ +

RDF/XML parser fixed the XML Canonicalization so that it writes +the XML attributes in sorted order. +Fixes +Issue #0000554. +

+ +

URI class changes

+

Added raptor_uri_uri_string_is_absolute() to +check if a URI is absolute.

+ +

QName class changes

+ +

Added raptor_qname_format_as_xml() to turn a qname +into an XML declaration. +

+ +

Configuration and build changes

+ +

Restructured code to build an internal librdfa convenience library +(never installed) so that newer automake will stop moaning about +subdir-objects. +

+ +

configure now checks for clang to correctly find +supported warnings.

+ +

Various portability and build fixes (Daniel Richard G)

+ +

Build fixes: make check will now work if jing is not +installed (for feed XML generation validation). +

+ +

Other changes

+ +

Fixed a few issues found with LLVM 3.4 (SVN) run with address +sanitizing.

+ + +

Raptor2 2.0.10 changes

+ +

Issues Fixed:

+
    +
  • 0000532: configure.ac: required file `src/raptor_config.h.in' not found
  • +
  • 0000535: configure accepts bogus values for --with-xml2-config
  • +
  • 0000545: Reopen issue 503
  • +
  • 0000548: xml:lang inside rdf:parseType="Literal" are removed in parsed output
  • +
+ +

Parser changes

+ +

Turtle parser was updated to handle +Turtle Terse RDF Triple Language W3C Candidate Recommendation 19 February 2013 +(Turtle 2013) +The main changes were to align with SPARQL-style blank node names, +prefixes and local names. +

+ +

N-Triples parser was updated to handle +N-Triples - A line-based syntax for an RDF graph W3C Working Group Note 09 April 2013 (N-Triples 2013) +The main changes were to allow \b \f, UTF-8 in strings and +URIs and the SPARQL-style blank node names.

+ +

RDF/XML parser updated to understand the new RDF 1.1 datatypes: +rdf:HTML and rdf:langString

+ + +

Serializer changes

+ +

Updated N-Triples and Turtle serializers (via writers) for 2013 +versions based on SPARQL 1.1 definitions. These new formats +have incompatible changes. +

+ +

Added functions for writing escaped Turtle / N-Triples terms:

+
+int raptor_string_escaped_write(const unsigned char *string,
+  size_t len, const char delim, unsigned int flags, raptor_iostream *iostr);
+
+int raptor_term_escaped_write(const raptor_term *term, unsigned int flags,
+  raptor_iostream* iostr);
+
+int raptor_uri_escaped_write(raptor_uri* uri, raptor_uri* base_uri,
+  unsigned int flags, raptor_iostream *iostr);
+
+

These uses the new new raptor_escaped_write_bitflags +enum bitflag values for the flags argument.

+ +

Deprecated raptor_string_python_write() for +raptor_string_escaped_write() with flags.

+ + +

Configuration and build changes

+ +

configure now recommends flex 2.5.36

+ +

configure was updated to switch configuring libxml +and libcurl to use the PKG_PROG_PKG_CONFIG and +PKG_CHECK_MODULES macros. The preference remains to +prefer looking for the xml2-config and curl-config programs before +trying pkg-config unless --with-curl-config=no +--with-xml2-config=no are used. +

+ +

configure now dies if xml2-config or xslt-config +point at non executable files. Patch from Michael Stahl - thanks. +Fixes Issue #0000534 +

+ +

configure now adds curl or libxml pkg-config requires +only if they were found via pkg-config; this prevents unnecessary +dependency on pkg-config files if they are not needed.

+ +

Updated autogen.sh and code to handle variations of header +macro. +Fixes Issue #0000532 +

+ + + +

Raptor2 2.0.9 changes

+ +

Issues Fixed:

+
    +
  • 0000499: Turtle parser fails to correctly parse valid syntax
  • +
  • 0000508: Raptor objects to possibly valid Turtle syntax
  • +
  • 0000520: compilation failure
  • +
  • 0000521: Python RDF 1.0.14.1 segfault when one tries to parse xhtml+rdf using the RDFa parser
  • +
  • 0000526: Document how to find gtkdocize in INSTALL.html
  • +
+ + +

Parser Changes

+ +

RDFa parser: +Handle non-namespaced elements without crash in RDFa. +Fixes Issue #0000521 +

+ +

Turtle Parser: Added full support for +Turtle Terse RDF Triple Language W3C Candidate Recommendation 19 February 2013 +

+ +

This includes accepting new keywords from SPARQL +(BASE and PREFIX), triples forms and +details of the characters allowed in URIs, Literals, Prefix Names, +Local Names and Blank Node identifiers. Some existing documents that +used \-escapes in URIs to encode characters not allowed +in URIs, are now forbidden. For example ASCII 32 (0x20) - space, +which should be written as %20. +

+ + +

Serializer changes

+ +

Turtle Serializer: Added full support for +Turtle Terse RDF Triple Language W3C Candidate Recommendation 19 February 2013 +which particular effects the encoding of URIs in the serializer. +

+ + +

Configuration and build changes

+ +

Added CMake build framework for building Raptor on Microsoft +Windows. Removed the old win32/ area and +win32_raptor_config.h references. Contributed by Daniel +Richard G. for Teragram Inc. +

+ +

Ensure that a small system BUFSIZ does not affect parser guessing +Patch from Daniel Richard G for Teragram Inc.

+ +

Added a compile-time check for +raptor_world_guess_parser_name() to ensure that +RAPTOR_READ_BUFFER_SIZE is at least as large as +FIRSTN, because otherwise the guesser sees fewer than +FIRSTN bytes from the document. Patch from Daniel +Richard G for Teragram Inc. +

+ +

Update configure to allow xml2-config and curl-config +to work for libxml and libcurl. It now report on the source of xml, curl +libraries in the configuration status.

+ +

autogen.sh updates to abort the run if a configuring +program fails, Generate NEWS with old timestamp if missing so +automake can run.

+ +

Handle the libxml2 ret->checked field not being +present in older libxml2 versions. The entities checked field was +added 2006-10-10 in libxml2 GIT commit a37a6ad91a61d168ecc4b29263def3363fff4da6and +released in libxml2 2.6.27 on 2006-10-25. +Fixes Issue #0000520 +

+ + +

Other changes

+ +

raptor_www_set_ssl_verify_options() now supports the +Curl 7.28.1 removal of CURLOPT_SSL_VERIFYHOST with a +value of 2. Now verify_host non-0 means to verify CN, 0 +means to not verify.

+ +

Remove -m MODE from the rapper(1) help +message which was removed in commit +f94fa561db05b21132b14a2b72f05b77e666c252 on Wed Apr 28 21:31:54 2010 +-0700 as part of the Raptor V2 work. +

+ + +

Raptor2 2.0.8 changes

+ +

Issues Fixed:

+
    +
  • 0000381: Raptor incorrectly serializes turtle lists when list nodes are URIs.
  • +
  • 0000487: Does raptor_world_guess_parser_name [librdf_parser_guess_name2] ever return NULL?
  • +
  • 0000505: Parsing certain escaped unicode strings in Turtle cases an error
  • +
  • 0000507: Turtle parse error causes fatal error
  • +
+ +

Parser class changes

+ +

Guessing a parser with +raptor_world_guess_parser_name() now returns NULL failure +when the guess is very poor, rather just return the first bad result. +Fixes +Issue #0000487 +which was reported in Redland librdf but +is implemented here. +

+ +

Guess parser: now returns error file and line location information +from the guessed parser.

+ +

RDFa parser: Updated librdfa +to the latest GIT supporting +RDFa 1.1 +with 30 tests still not passing - mostly issues in the core librdfa. +Made several resilience and crash fixes. Updated the RDFa 1.0 test +suite to latest tests and made fixes. The RDFa parser now accepts +aliases 'rdfa10', 'rdfa11' and the default 'rdfa' is RDFa 1.1 +

+ +

RSS tag soup parser: Use time() when +gettimeofday() is not available. Fix several reference +leaks. +

+ +

RDF/XML parser: The range of RDF/XML entity recognizing heuristic was +broadened to allow recognition of documents produced by Stanford's +Protege software (and possibly others). Fixed some parser memory +leaks / double frees. +

+ +

Turtle parser: Do not report multiple errors for Turtle string decoding +problems. When a Turtle qname cannot be found, a fatal error is no +longer generated but a regular error message giving information on +the qname that failed (usually due to unknown prefix). +Fixes Issue #0000507 +

+ + +

SAX2 API changes

+ +

raptor_sax2_inscope_xml_language() will now return "" +for explicit no language (xml:lang="") as well as NULL +for undefined language (no xml:lang present). +

+ + +

Serializer class changes

+ +

Turtle: Do not emit a Turtle (...) collection if the +list item is a URI. This fixes +Issue #0000381. +

+ + +

Term class changes

+ +

Added raptor_term_to_turtle_counted_string() counted +string form of raptor_term_to_turtle_string. +

+ + +

Unicode class changes

+ +

raptor_unicode_utf8_string_put_char() and +raptor_unicode_utf8_string_get_char() +now allow reading / writing U+D800 to U+DFFF (UTF-16 surrogates). +rather than returning failure. BOMs remain forbidden - definitely not UTF-8. +Fixes Issue #0000505 +

+ + +

URI class changes

+ +

Fixed URI resolving with reference (relative) URIs that are bare +queries like '?y' with no path. Now matches the specification +RFC3986 section 5.4.1 Normal Examples. +

+ +

Added raptor_new_uri_relative_to_base_counted() +to construct URI relative to current base. +

+ +

Added raptor_uri_to_turtle_counted_string() counted +string form of raptor_uri_to_turtle_string. +

+ + +

WWW class changes

+ +

The Curl WWW implementation now interprets +Content-Locationcode> header as absolute or relative URI. +

+ + +

Configuration and build changes

+ +

All configure --with-foo options now handle --without-foo (and +--with-foo=no) to disable attempting to find the value in the PATH. +This can be used with --with-xml2-config, --with-xslt-config, +--with-curl-config, --with-icu-config and --with-libwww-config where +the value 'no' or --without-foo can be used to disable it and prevent +automatic searches for the config script in the PATH. +

+ +

The -DRAPTOR_DEBUG and -DMAINTAINER_MODE +flags are now written to the config header instead of added to +CPPFLAGS. +

+ +

The -g flag is no longer added to CFLAGS or CPPFLAGS +with --enable-debug.

+ +

The existing --disable-release (default) now +correctly removes -O options in flag variables for the maintainer. +

+ +

autogen.sh now looks for the environment variable +NOCONFIGURE to prevent it running configure at the end +of the auto generation run. +

+ +

The configure vsnprintf() check was made more +comprehensive. +

+ + +

Other changes

+ +

Multiple portability improvements to vsnprintf code and macros. +Also fixed uninitialized variable problems in non-c99 variant of +raptor_vsnprintf2(). Thanks to John Emmas for reporting. +

+ +

Multiple portability fixes for building out of the source tree. +Out of source tree 'make check' and 'make dist' should both work. +Thanks to Daniel Richard G. for the patches. +

+ +

Multiple portability fixes for building on old Solaris versions. +Thanks to Daniel Richard G. for the patches. +

+ +

Multiple portability fixes for building on Windows including +strcasecmp(), windows headers, configuration fixes, parsedate code, +URI test builds, vsnprintf building. Thanks to Daniel Richard G. +for the patches. +

+ +

Updated the example rdfguess to accept a file called +or no arguments to read from stdin.

+ + +

Raptor2 2.0.7 changes

+ +

CVE-2012-0037 fixed

+ +

Issues Fixed:

+
    +
  • 0000448: Turtle parser does not return error status from turtle_parse_chunk()
  • +
  • 0000469: Allow rapper to bypass server SSL certs checks in libcurl
  • +
+ +

Removed Expat support since expat has not had a release in years +and libxml2 works well. This allows some code simplification. +Updated configure so that if Raptor is configured with +no parser that requires an XML parser, libxml2 will not be required. +

+ +

Removed internal Unicode NFC checking code used for checking +RDF/XML literals conformance which was expensive to check and a large +of compiled-in static dataset that was rather out of date. Replaced +with optional compiled use of ICU. +If ICU is not explicitly configured, no literal checking is done.

+ +

Options changes

+ +

Added new options:

+
+
RAPTOR_OPTION_NO_FILE
+
Deny file requests during parsing. Enabled by default.
+ +
RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES
+
Allow loading of XML external entity loading. Disabled by + default.
+ +
RAPTOR_OPTION_WWW_SSL_VERIFY_PEER
+
Controls verifying an SSL peer during parsing / WWW. Takes an + integer value: non-0 to verify peer SSL certificate (default + 1).
+ +
RAPTOR_OPTION_WWW_SSL_VERIFY_HOST
+
Controls verifying an SSL host during parsing / WWW. Takes an + integer value: 0 none, 1 CN match, 2 host match (default). Other + values are ignored.
+
+ + +

Parser class changes

+ +

The RDF/XML, RSS Tag Soup and RDFa parsers now pass on network, +file and entity loading parser options to the internal SAX2 to enable +enforcing of network, file and entity loading policy.

+ +

RDF/JSON parser handles an API change between YAJL V1 and V2. +

+ +

Turtle parser now returns parser errors to +raptor_parse_chunk(). +Fixes Issue #0000488 +

+ + +

SAX2 class changes

+ +

Added raptor_sax2_set_uri_filter() to set a URI +filter for any SAX2 calls that do internal lookups of URIs. +

+ +

Control file and network loading inside SAX2. Option +RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES now enforces +loading external XML entities and is by default enabled. If enabled, +RAPTOR_OPTION_NO_FILE and +RAPTOR_OPTION_NO_NET are also checked. All URIs loaded +are also passed through any URI filter, if set by +raptor_sax2_set_uri_filter(). +

+ +

URI class changes

+ +

Added new URI constructor +raptor_new_uri_from_uri_or_file_string() +to build a URI from a URI string or a filename string, normalizing +the result to a file: URI. +

+ +

Added +raptor_uri_uri_string_to_counted_filename_fragment() to +turn a URI string to a filename and URI fragment along with string +output string counts. +

+ +

Added utility methods for checking if a file: URI or filename is a +file that exists: +raptor_uri_file_exists() and +raptor_uri_filename_exists() +

+ + +

WWW class changes

+ +

Added raptor_www_set_ssl_verify_options() to set SSL +verify options. +Fixes Issue# 0000469. +

+ +

The raptor_www_fetch() call now returns the status +from any URI filter that returns a non-0 response. +

+ + +

Build changes

+ +

Added --with-icu-config=PATH option +to enable use of ICU for NFC checking.

+ +

Requires automake 1.11.2+ for -Wextra-portability

+ +

configure uses AM_PROG_AR to make +automake -Wextra-portability happy. +

+ + +

Raptor2 2.0.6 changes

+ +

Fixed expat support which was broken in 2.0.5

+ +

Handle libCurl SSL options before 7.16.4 (that's 2007) since old +libcurl is still around on Enterprise (that means old) linux systems. +

+ +

Sequence Changes

+ +

Added utility functions to swap elements, reverse the sequence and +generate permuations:

+
+    int raptor_sequence_swap(raptor_sequence* seq,
+      int i, int j);
+
+    int raptor_sequence_reverse(raptor_sequence* seq,
+      int start_index, int length);
+
+    int raptor_sequence_next_permutation(raptor_sequence *seq,
+      raptor_data_compare_handler compare);
+
+ + +

Raptor2 2.0.5 changes

+ +

Issues Fixed:

+
    +
  • 0000465: c99 snprintf usage
  • +
  • 0000476: Add Format URIs to raptor_syntax_descriptions
  • +
  • 0000479: raptor 2.0.4 : -i nquads fails to treat the context term as optional bugs.librdf.org
  • +
  • 0000481: Invalid unicode characters cause raptor to emit infinite output while converting n-quads to n-triples
  • +
+ + +

Parser class changes

+ +

Updated all parser URIs to use the +W3C Format URIs +as the primary URIs. Existing URIs become aliases. (Nicholas J Humfrey) +

+ +

GRDDL parser: Correctly set the base_uri when resolving the +sheet URI.

+ +

N-Quads parser: Make context optional. (Lauri Aalto) +Fixes +Issue #0000479. +
+When guessing formats, make N-Quads always beat N-Triples since +since now all ntriples parse fine with the nquads parser. (Lauri Aalto) +

+ +

RDFA parser: fix when building with 64-bit systems to prevent +value truncation.

+ +

Turtle parser: now uses the official text/turtle mime +type in the syntax recognizing code. +

+ + +

Serializer class changes

+ +

Updated all serializer URIs to use the +W3C Format URIs +as the primary URIs. Existing URIs become aliases. (Nicholas J Humfrey) +

+ +

Turtle serializer now uses the official text/turtle mime +type in the syntax recognizing code. + +Do not generate infinite output when the input Unicode UTF-8 encoding +is bad. +Fixes Issue #000481. +

+ +

Unicode class changes

+ +

Added new utility functions for calculating number of Unicode +characters in a UTF-8 +string raptor_unicode_utf8_strlen() and getting a subset +of a UTF-8 string raptor_unicode_utf8_substr(): +

+
+    int raptor_unicode_utf8_strlen(const unsigned char *string,
+        size_t length);
+
+    size_t raptor_unicode_utf8_substr(
+        unsigned char* dest, size_t* dest_length_p,
+        const unsigned char* src, size_t src_length,
+        int startingLoc, int length);
+
+ + +

URI class changes

+ +

raptor_uri_string_to_relative_uri_string() now +compares URI paths not files. (Joe Presbrey) +Fixes Issue #0000472 +

+ + +

Build changes

+ +

The library no longer needs trunc(), +lround(), round() or anything else from +libm. Removed the checks for these functions from +configure. +

+ +

configure no longer enables debug messages by default +for --enable-maintainer-mode but now requires the +--enable-debug option to be given. +

+ +

Other changes

+ +

Records GIT version in the version string when building from GIT +sources with --enable-maintainer-mode. This makes it +clearer when an non-released version is being used. +

+ +

Added internal raptor_format_integer() which enabled +the removal of all internal use of snprintf(). +

+ +

Added raptor_vsnprintf2() deprecating +raptor_vsnprintf() which does not actually have the +vsnprintf() calling contention. Added raptor_snprintf() +with snprintf() calling convention. Added +raptor_vasprintf() with vasprintf() (GNU) calling +convention. +

+
+    int raptor_vsnprintf2(char *buffer, size_t size, 
+			  const char *format, va_list arguments);
+    int raptor_snprintf(char *buffer, size_t size, const char *format, ...);
+
+    int raptor_vasprintf(char **ret, const char *format, va_list arguments);
+
+ +

raptor_locator_format() now picks a large enough +buffer size if snprintf() is likely not portable, when +HAVE_C99_VSNPRINTF is not defined. +Fixes Issue #0000465 +

+ +

Internal code style changes for how allocation is done and casting +with new macros.

+
+

RAPTOR_GOOD_CAST: code checks or logic ensures cast will not + truncate

+ +

RAPTOR_BAD_CAST: value may be truncated; may require API + change/break. Might be unrealistic e.g. a >4G error message, + qname prefix.

+ +

Some good uses:

+
    +
  • narrowing a known, checked unicode char to a U16
  • +
+ +

Some 'bad' uses:

+
    +
  • only handing error messages, literal language, qname prefixes of + a max len constrained by int
  • +
  • passing in data to libxml constrained by int max len
  • +
  • locator column field constrained to int size
  • +
+ +

Some bad uses:

+
    +
  • iostream read_bytes and write-bytes methods return int but could + easily return a lot more in the size_t range (compare to fread). + API change needed.
  • +
  • locator byte field constrained to int size. should be size_t
  • +
  • raptor_nfc_check returns int offset into a buffer that could + be larger
  • +
  • raptor_ntriples_parser_context changed line_length and offset + to size_t
  • +
  • raptor_turtle_parser changed buffer_length to size_t
  • +
+
+ +

Updated code to use size_t for sizes such as those +from strlen() and ptrdiff_t for pointer +differences so that on 64-bit architectures, values are not +potentially truncated to size of int. +

+ + +

Raptor2 2.0.4 changes

+ +

Issues Fixed:

+
    +
  • 0000308: undefined reference to round and trunc while cross compiling for mipsel
  • +
  • 0000449: ntriples serializer and parser inconsistent w.r.t. _ in name tokens
  • +
  • 0000451: Incorrect qname definition in TRiG parser
  • +
  • 0000455: Incorrect AVL tree operations. [ with fix ]
  • +
  • 0000456: raptor-2.0.3 fails to build against yajl-2.0.2 API
  • +
  • 0000457: raptor-2.0.3 fails to build with curl-7.21.7
  • +
+ +

Parser class changes

+ +

The raptor_option enumeration gains values for +setting SSL client side certificates: +RAPTOR_OPTION_WWW_CERT_FILENAME for the certificate +filename, RAPTOR_OPTION_WWW_CERT_TYPE for the +certificate type and RAPTOR_OPTION_WWW_CERT_PASSPHRASE +for the certificate passphrase. +

+ +

raptor_parser_parse_uri_with_connection() (which is +called by raptor_parse_uri()) now uses +raptor_www_set_ssl_cert_options() to turn the parser +options above into settings on the WWW object. +

+ +

RDF/JSON parser: Gains support for building with +YAJL V2. Note that YAJL +V1 and V2 both install the same library name 'libyajl' even though +they have different ABI and APIs.

+ +

TRiG parser: Fixed to support the legal uri : +{ ... } syntax naming a graph where the +':' is optional. +

+ +

Turtle parser: Modified to not include the internal +input() function in the lexer which is never needed. +

+ +

Serializer class changes

+ +

N-Triples and Turtle serializers: Now +use raptor_bnodeid_ntriples_write() to always write +legal blank node IDs. +

+ +

WWW class changes

+ +

Added support for raptor_www to handle setting SSL +client certificate options during WWW retrieval. +

+ +

Added raptor_www_set_ssl_cert_options() method to set +the SSL client certificates on a WWW object. +

+ +

Other changes

+ +

Make Raptor build against Curl 7.21.7 which removed a header file +that was made an empty file in the libcurl source code on April 26 +2004 around version 7.12.0 which is now the minimum version Raptor +supports.. +

+ +

Fixed an AVL Tree issue during deletion that messes up some pointers. +Patch from 'v-for-vandal'. Thanks. +

+ +

Added a utility function +raptor_bnodeid_ntriples_write() to write a N-Triples +blank node ID in legal form, replacing any letters not in the allowed +set.

+ +

Expanded GCC warnings and corrected a few internal uses +of int when size_t was meant. Others +remain. +

+ +

Reduced stack use of raptor_www_file_handle_fetch() +and raptor_parser_parse_iostream() by moving I/O buffer +to the www or parser objects respectively. +

+ + +

Raptor2 2.0.3 changes

+ +

The main change is to add the new main header file +raptor2.h. The new header has been added to allow +applications to be sure they have got the raptor V2 header +(with #include <raptor2.h> and not the raptor V1 +header file (#include <raptor.h>). +The raptor.h header will NOT be removed until the next +major raptor release (V3). +

+ + +

Turtle / TRiG parser changes

+ +

Alter the parser to not use a large token stack when parsing TRiG +graphs, enabling the parser to handle much larger files. The parser +still gathers all input into a single memory segment so the maximum +amount of input is probably memory size/3. +

+ +

TRiG parser now allows a QName for the graph name. +

+ +

Attempted to make the parser handle streaming lexing and parsing +but only partially successful; bison could be made to stream parse +but flex could not be made to stream lex. This meant it could not +be convinced to return a "need more input" response at the end of a +chunk of data and continue lexing later. +

+ +

Fix value ownership fix graph name. +Fixes Issue #0000437 +

+ +

Other Changes

+ +

Raptor was ran through the +LLVM clang static code +analyzer and several issues fixed, mostly in unused variables and in +unlikely error recovery conditions. Some actual potential crash bugs +were found:

+
    +
  1. The workaround for + ancient libxml2 error handling + in raptor_libxml_xmlStructuredError_handler_parsing() + was broken for some time, so that probably means nobody uses old + libxml2.
  2. +
  3. librdfa URI + resolving in rdfa_resolve_uri() used unallocated + memory in some relative URI cases.
  4. +
+ +

Bison 2.4 is required to build Raptor from GIT source with +no pregenerated files. +

+ + +

Raptor2 2.0.2 changes

+ +

Fixed a too strict version checking bug in raptor_new_world() +

+ + +

Raptor 2.0.1 Changes

+ +

DO NOT USE. Use 2.0.2 which fixes a too strict version +checking bug in raptor_new_world() +

+ +

Parser class changes

+ +

The internal librdfa parser that uses Raptor internals now exports +symbols prefixed with raptor_librdfa so that Raptor can be linked +with the standard librdfa in applications without symbol clashes. +Fixes Issue #0000416 +

+ +

Serializer class changes

+ +

The N-Quads serializer was fixed to output the graph name in the +fourth column, instead of repeating the object. +

+ +

Internal changes

+ +

Replaced all internal fatal errors that went to +an abort() with regular logged error. +

+ + +

Raptor 2.0.0 Changes

+ +

Raptor V2 final release. See the release notes for 1.9.0 and +1.9.1 for the major changes in Raptor V2.

+ +

API changes since 1.9.1 beta

+ +

Added raptor_syntax_description_validate() to public +API to validate and compute counts for syntax descriptions. +Primarily this is for use by Rasqal. +

+ +

The raptor_syntax_description now has an array of URI +strings instead of a single one, to allow URI aliasing. This is +primarily for use by Rasqal.

+ +

Fixed guessing by URI in +raptor_world_guess_parser_name() which was not +working.

+ +

Fixed Issues:

+
    +
  • 0000405: RDFa parser does not handle base href with single quoted value
  • +
+ + +

Raptor 1.9.1 Changes

+ +

1.9.1 is the second beta release of Raptor 2 and intended to be +the last release before 2.0.0. +

+ +

Raptor V1 to V2 upgrading changes

+ +

Improved the upgrade-script.pl raptor V1 to V2 +upgrade script to handle changes to enums and macros as well as +handle statement field renaming. Updated the generated documentation +to also include enum and macro changes. +

+ +

Added defensive code in each constructor to check the passed-in +raptor world object is a valid Raptor V2 world rather than V1. It +generates a warning once per run of the program. +

+ +

The raptor_new_world() function is now a macro that +calls an internal function raptor_check_world_internal() +with a version macro argument to detect when Raptor V2 is invoked with +an inconsistent header and library. +

+ + +

AVLTree class changes

+ +

Free the iterator at the end of debug method +raptor_avltree_print(). +

+ + +

I/O Stream class changes

+ +

Fix major copying too much error in the internal +raptor_read_string_iostream_read_bytes() memcpy that +could cause crashes - the function always copied the maximum amount +the user requested in the read method even if the string was +smaller.

+ + +

Parser class changes

+

JSON parser: Made relative URIs option work. +

+ +

N-Quads parser: Added. The serializer already existed.

+ +

librdfa parser: Updated to latest librdfa GIT +1a1a08c790b7649a7f6c12fb9e40c0d3dbe70481

+ + +

Serializer class changes

+ +

Fix raptor_serializer_start_to_iostream() to prevent +crash when this method is used more than once on the same +serializer.

+ +

RSS/Atom serializer: Fix crashes with feeds containing entries +with blank node items. +

+ + +

Stringbuffer class changes

+ +

Added utility methods +raptor_stringbuffer_append_uri_escaped_counted_string() +and raptor_stringbuffer_append_hexadecimal(). +

+ + +

Term class changes

+ +

Deleted raptor_term_as_counted_string() and +raptor_term_as_string(). Since 1.9.0 was an unstable +API, this is allowed. +

+ +

Added raptor_term_to_counted_string() replacing +deleted raptor_term_as_counted_string().

+ +

Added raptor_term_to_string() replacing +deleted raptor_term_as_string().

+ + + +

URI class changes

+ +

Added convenience methods for constructing URI terms from strings: +raptor_new_term_from_counted_uri_string() and +raptor_new_term_from_uri_string(). +

+ +

Use string lengths in equals and comparisons for faster checking. +Use memcmp() instead of strncmp() when +lengths are known and the same. +

+ + +

WWW class changes

+ +

The CURL WWW module now looks for and uses the HTTP response +Content-Location: header to get the base URI for content +retrievals. This allows these base URIs to be used in parsing +content retrived from URIs. +Fixes Issue #0000402 +

+ + +

Raptor 1.9.0 Changes

+ +

1.9.0 is the first beta release of Raptor 2. There may be changes +and additional releases before version 2.0.0 with the final stable API. +

+ +

This is a major update and cleanup to the Raptor API and ABI with +additions, removals and changes. There are also major restructurings +of the internal code and cleanups. There are also some new features +in the form of additional APIs, new serializers and parsers. +

+ +

The details of the additions, removals and changes of functions, +structures, typedefs and enums are listed in the +Raptor 2 API reference manual +section on +Changes between raptor 1.4.21 and 1.9.0. +The upgrading document +explains how to upgrade existing code that uses the V1 APIs to use +the new APIs. +

+ +

The major changes in this release are:

+
    +
  • Removed all deprecated functions and typedefs.
  • +
  • Renamed all functions to the standard raptor_class_method form.
  • +
  • All constructors take a raptor_world argument.
  • +
  • URIs are interned and there is no longer a swappable implementation.
  • +
  • Statement is now an array of 3-4 RDF Terms to support triples and quads.
  • +
  • World object owns logging, blank node ID generation and describing syntaxes.
  • +
  • Features are now called options and have typed values.
  • +
  • GRDDL parser now saves and restores shared libxslt state.
  • +
  • Added serializers for HTML 'html' and N-Quads 'nquads'.
  • +
  • Added parser 'json' for JSON-Resource centric and JSON-Triples.
  • +
  • Switched to GIT version control hosted by GitHub.
  • +
  • Added memory-based AVL-Tree to the public API.
  • +
+ + +

Fixed Issues:

+
    +
  • 0000357: raptor_term_as_string does not return N-Triples escaped string, although API says so
  • +
  • 0000361: HTML Table serializer
  • +
  • 0000369: Unescaped quotes in long literals (Turtle/N3) cause parser failure if at the end of the literal
  • +
  • 0000370: Odd behaviour regarding the parsing of Trig files
  • +
  • 0000373: Remove deprecated GTK symbols
  • +
  • 0000379: raptor libxslt security policy conflicts with apps that also use libxslt and set security policy
  • +
+ + + + +

General changes

+ +

Renamed the library name and package tarball name to a new +separate names (libraptor2, raptor2-X.tar.gz) so they can be +distinguished and installed into the same system as raptor 1 without +file clashes. Note: This does not apply to the +rapper(1) utility and it's manual page which are in both +packages. Packagers should stop packaging the rapper(1) +binary and the rapper manual page from raptor 1, in preference to the +raptor 2 version. +

+ +

Nicholas J Humfrey is a new committer. +

+ +

A utility script docs/upgrade-script.pl is +automatically generated from the changes data to aid migrating from +Raptor 1 to Raptor 2 APIs. If it is not a simple rename, the script +annotates the change as a comment near the code. +

+ +

Raptor's Statement, Term and URI classes can fully replace +librdf's librdf_statement, librdf_node and +librdf_uri classes. This has been tested with GIT +versions when both Rasqal and librdf are configured with +--with-raptor2. When raptor 2 is stable, Rasqal and +librdf will default to use these.. +

+ + +

Documentation changes

+ +

The API reference manual now includes an automatically generated +reference section on the +functions and types that were added, removed and changed between raptor 1 and raptor 2 APIs. + +It also includes an automatically generated section on the +parser and serializers with their names, mime types and Q values. +

+ +

The tutorial examples were updated to the Raptor 2 APIs. +

+ +

NOTE: At this time, the descriptive parts of the tutorial have NOT +been updated to use the Raptor 2 API. +

+ + +

World class changes

+ +

A log handler function for receiving warnings and errors (fatal or +other) are now all sent to a single log handler of type +raptor_log_handler registered to the world class with +raptor_world_set_log_handler(), rather than handlers set +for each parser, sax2, serializer or www instance. Several +constructors lose error handler and error data parameters +consequently. +

+ +

The enumerating approach for listing the known parsers and +serializers and writing into variables passed in, was replaced with +methods that return pointers to static +raptor_syntax_description objects to allow more +parameters to be returned. This allowed the removal of multiple +older calls that kept having to gain new return arguments. +The description also returns a list of (mime type, qname) pairs +using a new typedef raptor_type_q. It includes a set +of bitflags for some simple information such as +RAPTOR_SYNTAX_NEED_BASE_URI to describe when +a syntax requires a base URI passed in, otherwise is not needed +or optional. +

+ +

raptor_world_set_libxml_flags() is replaced with +raptor_world_set_flag() which are simple flags that +require no initialisation of the world since they are used before it +is opened. This means that it cannot use the Options module for +world flags. New flag +RAPTOR_WORLD_FLAGS_URI_INTERNING allows disabling of +the URI interning using an AVL-Tree which can use up memory. +

+ +

raptor_world_set_libxslt_security_preferences() and +raptor_world_set_log_handler() gains an int return value +to report failure if world is already opened. +

+ +

Moved the generation of blank node IDs from the parsers (many +objects) to the world class (1 object). Cannot think of good reasons +why the blank node ID generation policy needs to be different +per-parser. Enumeration raptor_genid_type was deleted +since only the blank node type was ever used. +

+ + +

AVL Tree changes

+ +

The internal memory-based AVL Tree implementation is exposed as a +public API. +

+ + +

Features changes

+ +

Replaced with raptor_options

+ + +

Identifier class changes

+ +

Replaced with Term class. +

+ +

raptor_identifier_type enum was removed and replaced +with enum raptor_term_type and a smaller set of 3 +possible term types. The enum values match the int values used +in librdf_node_type. +

+ + +

I/O Stream class changes

+ +

Constructors all gain a world argument. +

+ +

Some methods now return an int error status such as +raptor_iostream_write_end() +

+ +

Many classes iostream writing methods and methods of the iostream +class itself were changed to follow the standard +raptor_CLASS_write naming +convention and to put the iostream argument at the end. +

+ +

Deprecated typedef raptor_iostream_handler was removed

+ +

Deprecated functions were removed: +raptor_new_iostream_from_handler(), +raptor_iostream_get_bytes_written_count() and +raptor_iostream_write_string_turtle() +

+ + +

Locator changes

+ +

Renamed some methods to follow the +raptor_locator_method standard. +

+ + +

Namespaces and namespace stack classes changes

+ +

Constructors all gain a world argument and lose error handler, +error data arguments. +

+ + +

Options

+ +

A new name for what were called features in Raptor 1 and this was +expanded to allow use of values types string, integer and boolean. +Options can be set on multiple classes such as parser, serializer but +are centrally described using the new +raptor_option_description structure. +

+ +

The option get / set operations were reduced from multiple methods +per class for getting / setting an int, int / string to just one get +and one set, with optional parameters. It can also handle adding new +types later, which will be passed in as strings and converted +internally. +

+ +

The options code +introduces a new enum raptor_domain which essentially is +for describing a class such as parser. +For example options listed +for domain RAPTOR_DOMAIN_PARSER will be usable with the +parser option get and set methods +raptor_parser_get_option(parser, ...) and +raptor_parser_set_option(parser, ...). +

+ + +

Parser class changes

+ +

raptor_parser_set_strict() was removed and replaced +with a new parser option RAPTOR_OPTION_STRICT. +

+ +

Parser object methods to return information about the parser class +were removed since they can be done instead via fields of the static +object returned from +raptor_world_get_parser_description(). Deleted +functions include raptor_parser_get_label(), +raptor_parser_get_mime_type(), and +raptor_parser_get_need_base_uri(). +

+ +

Parsing may generate start graph and end graph events for syntaxes +that return graph names such as TRiG. These are returned by the handler +of typedef raptor_graph_mark_handler +set by new function raptor_parser_set_graph_mark_handler() +which returns a start or end event of type enum +raptor_graph_mark_flags. +

+ +

raptor_parser_get_accept_header() fixed length of +static string to ensure NUL is copied. +

+ +

Many functions were renamed to match the +raptor_parser_method naming standard. Some of +these get a long longer, but are at least consistent. For example +raptor_parse_uri() becomes +raptor_parser_parse_uri(). +

+ +

Deprecated typedef raptor_ntriples_parser was removed. +

+ +

Deprecated functions were removed: +raptor_ntriples_term_as_string(), and +raptor_ntriples_string_as_utf8_string() +

+ +

The librdfa parser was updated with the latest updates to the RDFa +syntax (first, rel/rev, whitespace, xml:lang) and fixes issues with +non-terminated strings. +

+ + +

The GRDDL parser now saves and restores the libxslt global state +(handlers, security preferences) so that it does not affect other +applications in the same memory space. Part of this can be +overridden with +raptor_world_set_libxslt_security_preferences() which +allows user code to disable raptor touching the security preferences +entirely. +Fixes +Issue #0000379 +

+ + +

The RDF/XML parser never generated special names for bag IDs +(bagidNNN), so all support for that has been removed. +

+ +

The RDF/XML parser uses the new reference-counted URIs and raptor +terms to prevent a lot of malloc/free for temporary uses. +

+ +

Removed RDF/XML parser feature +RAPTOR_FEATURE_ASSUME_IS_RDF since it did nothing since +at least 2003, maybe earlier. +

+ +

Added a JSON parser (name 'json') that can read both the +resource-centric and triples JSON RDF formats. Requires the YAJL +JSON parser library. Contributed by Nicholas J Humfrey. +

+ +

Moved the generation of blank node IDs from the parsers (many +objects) to the world class (1 object). Cannot think of good reasons +why the blank node ID generation policy needs to be different +per-parser. +

+ + +

QName class changes

+ +

Constructors all gain a world argument and lose error handler, +error data arguments. +

+ + +

Sequence changes

+ +

Use new generic raptor_data_free_handler, +raptor_data_print_handler, +raptor_data_context_free_handler, +raptor_data_context_print_handler +data-focused handlers which are shared with the AVL Tree. +

+ + +

Serializer class changes

+ +

Added raptor_serializer_flush() for user code to +indicate to a serializer to flush state since the application knows a +block has been ended, or it needs to save memory. No serializer +currently implements this, but it is expected the abbreviated +serializers that use a lot of state - Turtle, RDF/XML-Abbrev - would +benefit from this. +

+ +

Added an HTML Table serializer with name 'table' contributed by +Nicholas J Humfrey. +

+ +

Removed the obsolete 'simple' serializer from the source code. +N-Triples is an appropriate simple (and well-defined) replacement +syntax. +

+ + +

Statement class changes

+ +

This was made a more regular class that can be created, copied and +freed using reference counting. The structure changed to be an +array of 4 raptor terms rather than a complex union focused on +the allowed RDF Statements. This change allows representing +non-RDF triples as well as triples with named graphs (also known as +quads). +

+ +

raptor_statement_part_as_counted_string() turns into +a method of the new Term class, as a "statement part" is now +represented as a Term. +

+ + +

Term class changes

+ +

This new class with an open structure replaces +raptor_identifier and was created to represent an RDF +Term: literal, URI or blank node and is reference counted and +dynamic. It is a union of fields for three types. +

+ +

This class can fully replace librdf's librdf_node when both Rasqal +and librdf are built with --with-raptor2. The +semantics of comparison (ordering) and equality are the same. +

+ + +

Unicode changes

+ +

Several utility functions were renamed to match their +functionality more accurately and be associated with the Unicode +module set of functions. For example raptor_utf8_check() +was renamed to raptor_unicode_check_utf8_string() +

+ + +

URI class changes

+ +

The whole concept of URI handlers was removed, there is no longer +a way to replace the implementation of the URI class. The +implementation built in now interns URIs string so that a single URIs +for a string is only ever in memory once, but reference counted. This +is what Redland librdf has done for many years, and librdf can fully +use this. +

+ +

Deprecated functions were removed: +raptor_uri_is_file_uri(). +

+ +

The raptor_uri_resolve_uri_reference() now returns the +length of the URI written into the buffer. +

+ + +

WWW class changes

+ +

Rename several of the functions to the standard constructor, +destructor and method naming format. +

+ + +

XML Writer class changes

+ +

Constructors all gain a world argument and lose error handler, +error data arguments. +

+ + +

Configuration changes

+ +

Added configure argument --with-yajl=DIR (or 'no') to +set the prefix where YAJL libraries and headers are installed. +

+ +

Raptor headers are now installed in a sub-directory of +PREFIX/include. +

+ +

raptor-config was removed. Building against raptor 2 +should be done only using pkg-config with either +--cflags or --libs arguments like this:

+
+  cc -o prog prog.c `pkg-config raptor2 --cflags`  `pkg-config raptor2 --libs`
+
+ + +

Internal changes

+ +

Code style: lots of changes mostly adding lots more whitespace +such as to show control change (if, while) or early function exit +(return). +

+ +

All strcpy() with known lengths and +strncpy() were replaced with memcpy() which +is quicker and compilers optimize better. +

+ +

Code style: +use TYPE* var_name = RAPTOR_CALLOC(TYPE, 1, sizeof(*var_name)) +rather than repeat the type name which can be error-prone. +

+ +

Code style: put whitespace round assignment and operators i.e. +use c = a + b rather than c=a+b. +

+ +

Code style: removed some strdup()s. +

+ +

Code style: try to remove un-necessary strlen() by +tending to pass around a string with it's length, a counted string. +This meant adding a few new constructors such as for the URI and Term +classes. +

+ +

Code style: methods called with a NULL object return failure +and destructors called with a NULL object return silently rather than +the former mix of crashing or abort()ing. +

+ +

Code style: copy constructor is now called +raptor_class_copy() rather than +raptor_new_class_from_class() +for brevity. +

+ +

Code style: print methods return an int return status indicating +success. +

+ + +

rapper Utility changes

+ +

Print out the option types next to the description in the -f +help usage message. +

+ +

Removed unused -a flag from code. +

+ +

Did NOT rename -f option to match the renaming of +features to options in the API. Not needed. +

+ +

Removed long deprecated -n flag which was shortcut for +selecting the N-Triples parser and can be done with -i ntriples +

+ +

Removed -s/--scan flag since it is an option of a +single parser (RDF/XML) which can be done with -f/--feature +scanForRDF. +

+ + +

Other changes

+ +

Removed support for building raptor with dmalloc debugging +(removing --with-dmalloc configure argument). Valgrind +wins. +

+ +

The example 'grapper' GNOME GUI utility for raptor was updated +to the latest GTK APIs (2.5.0+ but still quite old) so that it +builds with all the GTK 'disable deprecated' flags set. The +UI is not quite correct though - the preferences menu is broken. +

+ +

Switched to GIT version control, hosted by GitHub. The latest +raptor 1 code is available on branch 'raptor1' as well as from the +release tags for specific versions. +

+ + + + + + +

Raptor 1.4.21 Changes

+ +

This is a bug fix only release with no new features. New +development has moved to raptor 2 where a planned ABI and API break +is underway. +

+ +

Fixed Issues:

+
    +
  • 0000318: Cannot end a Turtle literal with \\ inside triple-quotes
  • +
  • 0000319: ntriples parser does not register that it accepts ntriples mime type - text/plain
  • +
  • 0000326: Turtle parser allows '.' in qnames which is not-to-spec
  • +
  • 0000331: Turtle long literals with raw newlines do not count line numbers correctly
  • +
  • 0000332: RDFXML parser finds duplicates and misbehaves (when it shouldn't)
  • +
  • 0000337: raptor/turtle outputs invalid qnames which cause syntax errors on parsing
  • +
+ +

Parser changes

+ +

N-Triples parser: Declare acceptance of text/plain mime type with +q=0.1 +

+ +

RDFA parser (via librdfa): Updated to fix some buffer management +problems when it was passed large blocks (4096 bytes or more), a few +memory leaks and some other minor bugs. +

+ +

RDF/XML parser: Properly reset the ID-checking set at the start of +each parse. +

+ +

Turtle parser: Allow \\ at the end of triple-quoted literals. +Forbid '.'s in prefixes and qnames (follow specification). +Properly count newlines inside the literals for error reporting. +

+ +

Serializer changes

+ +

Turtle serializer: Forbid '.'s in prefixes and qnames (follow +specification). +

+ +

Other Changes

+ +

Updated configure and the build system to use silent +rules for the maintainer (by default), or when +--enable-silent-rules is passed to +configure. This feature requires building with automake +1.11 which requires autoconf 2.62 or newer when building from GIT. +

+ +

autogen.sh script was updated to enforce the +autotools versions above. +

+ + + +

Raptor 1.4.20 Changes

+ +

This is a bug fix only release with no new features. New +development has moved to raptor 2 where a planned ABI and API break +will happen. There may be preview releases of raptor 2 with 1.9.x +numbering. +

+ +

Fixed Issues:

+
    +
  • 0000306: rapper doesn't handle datatype=""and xml:lang="" properly with RDFa
  • +
  • 0000307: configure fails at vnsprintf test when cross compiling
  • +
  • 0000310: Raptor does not like single character namespaces with RDFa
  • +
  • 0000312: Ununitialized pointer in example rdfserialize.c causes crash
  • +
+ +

Parser Changes

+ +

+GRDDL parser: Fix XML parser context resource leak if +raptor_grddl_fetch_uri() fails. Save and restore error +handlers properly to prevent crashes when an error is reported during +parsing. +

+ +

+RDFA parser (via librdfa): Update to latest librdfa GIT sources with head +a438ce68a40e04b399ec2b2c613d0c867d9315c7
+now moved to +https://github.com/msporny/librdfa +to fix handling single character namespaces +(Issue #0000310), +empty datatype attribute and empty xml:lang attributes +(Issue #0000306) +

+ +

Added three unapproved RDFa tests 0172, 0173 and 0174 to cover the +fixes above. +

+ +

Serializer Changes

+ +

+Turtle serializer: +Applied scalability patch from Chris Cannam. +This switches the serializer to use a raptor_avltree +instead of a raptor_sequence for the subject and blanks +used with raptor_abbrev_node_lookup(). This fixes a +performance problem in the serializing and moves lookups from O(N) to +O(log N) - from list to balanced tree. +

+ +

Other Changes

+ +

If cross compiling, check for vsnprintf() C99 compatible at +runtime by setting define CHECK_VSNPRINTF_RUNTIME during +configuration. +Fixes Issue #0000307 +

+ +

Use calloc() for allocating a raptor_statement in +rdfserializer.c example code to properly initialise state. +Fixes Issue #0000312 +

+ +

Use AC_SYS_LARGEFILE to get large file IO checks which +allows 32-bit systems to read multi-gigabyte files. +

+ +

autogen.sh script fix for if test when uname is not in +standard OSX dir. +

+ + + +

Raptor 1.4.19 Changes

+ +
+

WARNING: FUTURE ABI and API CHANGES. The next +release of raptor 1.4.x will include bug fixes only and no new +features. New development will move to raptor 2 where a planned ABI +and API break will happen. There may be preview releases of raptor 2 +with 1.9.x numbering.

+
+ +

Fixed Issues:

+
    +
  • 0000259: Fix NFC check for legal combiner sequence
  • +
  • 0000262: Error when raptor_new_uri() fails in Turtle parser
  • +
  • 0000263: Invalid turtle output syntax on empty integer/double/decimal literals
  • +
  • 0000266: Default/atom namespace in atom serializer output
  • +
  • 0000269: strstr is called in raptor_parse_chunk() on a buffer string, where it should be called on a null-terminating string.
  • +
  • 0000270: RSS serializer fixes for g++
  • +
  • 0000276: Fix raptor_sequence_set_at() when setting beyond end
  • +
  • 0000277: broken collection abbreviation in turtle serialization
  • +
  • 0000287: Fix raptor_sax2_parse_chunk() calling raptor_log_error_to_handlers() with expat
  • +
  • 0000288: raptor_get_feature function does not return feature value
  • +
  • 0000289: Fix RDFa parser problem when there is a subject and predicate specified on an element, but no child nodes for the object literal
  • +
  • 0000290: Fix performance problems when turtle parsing with lots of namespaces
  • +
  • 0000293: Fix RDF/XML Parser problem with legacy ordinal predicates
  • +
  • 0000296: Avoid calling xsltSetDefaultSecurityPrefs()
  • +
  • 0000299: Avoid calling xmlSetStructuredErrorFunc() and xmlSetGenericErrorFunc()
  • +
  • 0000303: rdfa parser does not parse content as RDFa which librdfa+expat alone handles
  • +
+ + +

Parser Changes

+ +

raptor_get_feature() now returns the integer value rather than +just 1 or 0.
+Issue #0000288 +

+ +

Guess parser: return name of guessed parser not 'guess'. +

+ +

N-Triples parser: +Produce error messages when raptor_new_uri() fails.
+Issue #0000262 +

+ +

RDFa parser: +Fix problem when there is a subject and predicate specified on an +element, but no child nodes for the object literal using +latest librdfa GIT source with head +2ddcb3f9e010d0b3d9ee546e807539be5da1b14a
+Issue #0000289 +

+ +

RSS tag soup parser: +Huge internal changes:
+Recording more atom core structures in triples (such as author, contributor - +person) rather than only channels and items
+Introduced a new 'blocks' concept to record single element structured +items such as atom category, link and rss enclosure
+Added itunes namespace and container.
+

+ +

RDF/XML Parser: +Adjust predicate_type when removing ordinal identifier type from predicate.
+Issue #0000293 +

+ + +

Serializer Changes

+ +

Atom 1.0 serializer: +Now tested and takes more care to try to generate valid Atom 1.0 +

+ +

Turtle serializer: +Validate XSD integer, decimal and double literal +output. Emit special short forms only if the whole literal value is +consumed by strtol() (for integers) or +strtod() (for decimals and doubles). Otherwise produce a +warning and emit literal in the normal +"value"^^<datatype_uri> format.
+Issue #0000263
+Fix broken collection abbreviation
+Issue #0000277
+

+ +

RSS serializer: +Fixes for g++
+Issue #0000270 +
+Added a new serializer feature +RAPTOR_FEATURE_PREFIX_ELEMENTS (short name +prefixElements) for atom and rss 1.0 serializers to decide whether +core elements in the default namespace are declared with the prefix +or without a prefix.
+Removed generation of deprecated predicate ordinals of type +RAPTOR_IDENTIFIER_TYPE_ORDINAL and replace with resource type URIs +

+ + +

XML Support Changes

+ +

Removed generic calls to xmlSetStructuredErrorFunc() +and xmlSetGenericErrorFunc() which can be a problem when +libxml is shared with other code in memory. They may be called +optionally but will do a save/restore of the existing functions. +This protection is enabled by the new API call +raptor_set_libxml_flags() to set the flags from values +in enum raptor_libxml_flags.
+Issue #0000299 +

+ +

Use context-specific libslt security configuration to avoid +calling generic call xsltSetDefaultSecurityPrefs() which +can be a problem when libxslt is shared with other code in memory. +Allow the user to set the policy for raptor globally with new API +function raptor_set_libxslt_security_preferences().
+Issue #0000296 +

+ +

Make libxml SAX2 structured errors register parser-specific +handler function raptor_libxml_xmlStructuredErrorFunc() +instead of libxml global structured error handler. The libxml flag +method above can still enable registerding the global error handlers. +

+ +

In raptor_sax2_parse_chunk() fixed calls to +raptor_log_error_to_handlers() when built with expat.
+Issue #0000287 +

+ + +

Other Changes

+ +

Win32 portability fixes from Lou Sakey:

+
    +
  • Handle absence of gettimeofday()
  • +
  • Call xmlCleanupParser() libxml call last to avoid an access +violation on windows.
  • +
  • Windows vsnprintf() portability patch
  • +
  • raptor_sequence_set_at() fixed to maintain the design +contract: provide "size" consecutive items in "sequence" starting from +"start" even when setting items more than +1 offset beyond the end of +sequence.
    +Issue #0000276 +
  • +
+ +

rapper(1) utility changes: if counting, do not use a +serializer at all. +

+ + +

Internal Changes

+ +

More internal changes to be more resiliant after allocation failure +(Lauri Aalto) +

+ +

Reorganised tests in source tree to pull out specific directories +for RDF/XML, Turtle, etc. +

+ +

Use a DJ Bernstein hash to replace a linked list for storing a +stack of namespaces. This makes turtle parsing with lots of +namespaces (100s) much faster. Based on the initial patch in the bug.
+Issue #0000290 +

+ +

Use new internal raptor_memstr() function to compare +a string against a buffer that may not be NUL terminated.
+Issue #0000269 +

+ +

raptor_error_handlers: API structure gains world +field. BINARY COMPATIBILITY BREAK: sizeof(raptor_error_handlers) +changed. Source compatibility not broken. +

+ +

raptor_identifier: API structure gains world +field. BINARY COMPATIBILITY BREAK: sizeof(raptor_identifier) +changed. Source compatibility not broken. +

+ +

More fixes for compiling with C++ +

+ +

Move some more static data as constant to enable more efficient +compilation - moves to data segment of object binary.

+ +

Use memmove for overlapping copy, not memcpy when doing relative +URI resolving. +

+ + +

Raptor V2 Preparation Changes

+ +

Lots of internal changes were made by Lauri Aalto preparing for +Raptor V2 to fully attach all static data and config to a new +raptor_world object. A new static instance of this +class is now used internally behind the existing V1 API and will be +required to be constructed by the library user for the V2 API with a +new constructor/destructor.

+ +

NOTE: The method names here are illustrative of the final +V2 names but are not confirmed - These functions are not +supported in the 1.4.x series. Some methods will still be +altered for fields and (raptor_world) parameters. All constructors +should have it as a parameter. All methods will not have them (so +for example, all the URI methods named _v2 will lose the world +parameter and just have the URI parameter - but that is also because +the URI handler/context part will go into raptor_world in V2)

+ +

To use the unsupported and experimental V2 +functions, define -DRAPTOR_V2_EXPERIMENTAL=1 when +building with raptor. +

+ +

Added raptor_world typedef.

+ +

Added raptor world class constructor +raptor_world* raptor_new_world(void) and initializer: +int raptor_world_open(raptor_world* world) +

+ +

Added world class destructor: +void raptor_free_world(raptor_world* world) +

+ +

Added new V2 methods:

+
+  void raptor_world_set_libxslt_security_preferences(raptor_world *world,
+    void *security_preferences)
+
+  void raptor_world_set_libxml_flags(raptor_world *world,  int flags)
+
+  void raptor_error_handlers_init_v2(raptor_world* world,
+    raptor_error_handlers* error_handlers);
+
+ + +

Added V2 methods that are versions of existing methods, named with +_v2 suffix:

+
+  int raptor_parsers_enumerate_v2(raptor_world* world,
+    const unsigned int counter, const char **name, const char **label)
+
+  int raptor_syntax_name_check_v2(raptor_world* world, const char *name);
+
+  void raptor_print_locator_v2(raptor_world* world, FILE *stream,
+    raptor_locator* locator);
+
+  const char *raptor_locator_uri_v2(raptor_world* world,
+    raptor_locator *locator);
+
+  int raptor_features_enumerate_v2(raptor_world* world,
+    const raptor_feature feature, const char **name,
+    raptor_uri **uri, const char **label);
+
+  int raptor_serializers_enumerate_v2(raptor_world* world,
+    const unsigned int counter, const char **name, const char **label,
+    const char **mime_type, const unsigned char **uri_string);
+
+  int raptor_serializer_syntax_name_check_v2(raptor_world* world,
+    const char *name);
+
+  int raptor_serializer_features_enumerate_v2(raptor_world* world,
+    const raptor_feature feature, const char **name,  raptor_uri **uri,
+    const char **label);
+
+ +

Added world pointer to raptor_identifier object

+ +

Added V2 identifier class constructor:

+
+  raptor_identifier* raptor_new_identifier_v2(raptor_world* world,
+    raptor_identifier_type type, raptor_uri *uri,
+    raptor_uri_source uri_source, const unsigned char *id,
+    const unsigned char *literal, raptor_uri *literal_datatype,
+    const unsigned char *literal_language);
+
+ +

Added V2 parser class method:

+
+  raptor_parser* raptor_new_parser_for_content_v2(raptor_world* world,
+    raptor_uri *uri, const char *mime_type, const unsigned char *buffer,
+    size_t len, const unsigned char *identifier)
+  raptor_world* raptor_parser_get_world(raptor_parser* rdf_parser);
+
+ +

Added V2 serializer class constructor and method:

+
+  raptor_serializer* raptor_new_serializer_v2(raptor_world* world,
+    const char *name)
+  raptor_world* raptor_serializer_get_world(raptor_serializer* rdf_serializer)
+
+ +

Added V2 statement class raptor_statement_v2 typdef +for future replacing of raptor_statement

+ +

Added V2 statement class methods:

+
+  void raptor_print_statement_v2(const raptor_statement_v2 * statement,
+    FILE *stream);
+
+  unsigned char* raptor_statement_part_as_counted_string_v2(raptor_world* world,
+    const void *term, raptor_identifier_type type,
+    raptor_uri* literal_datatype, const unsigned char *literal_language,
+    size_t* len_p);
+
+  unsigned char* raptor_statement_part_as_string_v2(raptor_world* world,
+    const void *term, raptor_identifier_type type,
+    raptor_uri* literal_datatype, const unsigned char *literal_language);  
+
+  int raptor_statement_compare_v2(const raptor_statement_v2 *s1,
+    const raptor_statement_v2 *s2);
+
+ +

Added V2 uri class methods:

+
+  unsigned char* raptor_uri_as_counted_string(raptor_uri *uri, size_t* len_p);
+
+  raptor_uri* raptor_new_uri_v2(raptor_world* world,
+    const unsigned char *uri_string);
+
+  raptor_uri* raptor_new_uri_from_uri_local_name_v2(raptor_world* world,
+    raptor_uri *uri, const unsigned char *local_name);
+
+  raptor_uri* raptor_new_uri_relative_to_base_v2(raptor_world* world,
+    raptor_uri *base_uri, const unsigned char *uri_string);
+
+  raptor_uri* raptor_new_uri_from_id_v2(raptor_world* world,
+    raptor_uri *base_uri, const unsigned char *id);
+
+  raptor_uri* raptor_new_uri_for_rdf_concept_v2(raptor_world* world,
+    const char *name);
+
+  void raptor_free_uri_v2(raptor_world* world, raptor_uri *uri);
+
+  int raptor_uri_equals_v2(raptor_world* world, raptor_uri* uri1,
+    raptor_uri* uri2);
+
+  int raptor_uri_compare_v2(raptor_world* world, raptor_uri* uri1,
+    raptor_uri* uri2);
+
+  raptor_uri* raptor_uri_copy_v2(raptor_world* world, raptor_uri *uri);
+
+  unsigned char* raptor_uri_as_string_v2(raptor_world* world, raptor_uri *uri);
+
+  unsigned char* raptor_uri_as_counted_string_v2(raptor_world* world,
+    raptor_uri *uri, size_t* len_p);
+
+  raptor_uri* raptor_new_uri_for_xmlbase_v2(raptor_world* world,
+    raptor_uri* old_uri);
+
+  raptor_uri* raptor_new_uri_for_retrieval(raptor_uri* old_uri);
+
+  raptor_uri* raptor_new_uri_for_retrieval_v2(raptor_world* world,
+    raptor_uri* old_uri);
+
+  raptor_uri* raptor_new_uri_for_xmlbase_v2(raptor_world* world,
+    raptor_uri* old_uri);
+
+  raptor_uri* raptor_new_uri_for_retrieval_v2(raptor_world* world,
+    raptor_uri* old_uri);
+
+  unsigned char* raptor_uri_to_relative_counted_uri_string_v2(raptor_world* world,
+    raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p);
+
+  unsigned char* raptor_uri_to_relative_uri_string_v2(raptor_world* world,
+    raptor_uri *base_uri,  raptor_uri *reference_uri);
+
+  void raptor_uri_print_v2(raptor_world* world,
+    const raptor_uri* uri, FILE *stream);
+
+  unsigned char* raptor_uri_to_counted_string_v2(raptor_world* world,
+    raptor_uri *uri, size_t *len_p);
+
+  void raptor_uri_set_handler_v2(raptor_world* world,
+    const raptor_uri_handler *handler, void *context);
+
+  void raptor_uri_get_handler_v2(raptor_world* world,
+    const raptor_uri_handler **handler, void **context);
+
+ +

Added V2 www class methods:

+
+  raptor_www *raptor_www_new_with_connection_v2(raptor_world* world,
+    void* connection);
+
+ +

Added V2 qname class methods:

+
+  raptor_qname* raptor_new_qname_from_namespace_local_name_v2(raptor_world* world,
+    raptor_namespace *ns, const unsigned char *local_name,
+    const unsigned char *value);
+
+ +

Added V2 namespace class methods:

+
+  raptor_namespace_stack* raptor_new_namespaces_v2(raptor_world* world,
+    raptor_simple_message_handler error_handler, void *error_data, int defaults);
+
+  int raptor_namespaces_init_v2(raptor_world* world,
+    raptor_namespace_stack *nstack,
+    raptor_simple_message_handler error_handler, void *error_data,
+    int defaults);
+
+ +

Added V2 sequence class typedefs and methods:

+
+  typedef void (raptor_sequence_free_handler_v2(void* context, void* object));
+
+  typedef void (raptor_sequence_print_handler_v2(void *context, void *object,
+    FILE *fh));
+
+  raptor_sequence* raptor_new_sequence_v2(raptor_sequence_free_handler_v2* free_handler,
+    raptor_sequence_print_handler_v2* print_handler, void* handler_context);
+
+  void raptor_sequence_set_print_handler_v2(raptor_sequence *seq,
+    raptor_sequence_print_handler_v2 *print_handler);
+
+ +

Added V2 iostream class methods:

+
+  int raptor_iostream_write_uri_v2(raptor_world* world,
+    raptor_iostream *iostr,  raptor_uri *uri);
+
+  void raptor_iostream_write_statement_ntriples_v2(raptor_world* world,
+    raptor_iostream* iostr, const raptor_statement *statement);
+
+ +

Added V2 xml writer class methods:

+
+  raptor_xml_writer* raptor_new_xml_writer_v2(raptor_world* world,
+    raptor_namespace_stack *nstack, raptor_iostream* iostr,
+    raptor_simple_message_handler error_handler, void *error_data,
+    int canonicalize);
+
+  int raptor_xml_writer_features_enumerate_v2(raptor_world* world,
+    const raptor_feature feature, const char **name, raptor_uri **uri,
+    const char **label);
+
+ + +

Raptor 1.4.18 Changes

+ +

Fixed Issues:

+
    +
  • 0000186: Add RDFa support to Raptor
  • +
  • 0000255: rss-tag-soup serializer does not generate namespaces so re-serializing in rdf/xml looks wierd for atom
  • +
+ + +

Parser Changes

+ +

A new +RDFa +parser was added (name rdfa) using +librdfa to +implement it. librdfa is linked as part of Raptor and +written by Manu Sporny of Digital Bazaar, licensed with the +same license as Raptor.

+ +

The RDFa +test suite +was added to the test and (via librdfa) Raptor passes all but 4 tests +which fail due to different output xmlns attribute ordering (which +does not matter to XML parsers).

+ + +

Serializer Changes

+ +

Added new function +raptor_serialize_start_to_iostream() to have the new +semantics of not owning and destroying the passed-in iostream. This +allows the caller to serialize to an existing iostream and then +to continue to write to it. raptor_serialize_start() +owns and then closes the iostream that is passed in. +

+ +

A new Atom Syndication Format 1.0 (RFC 4287) serializer was added (name atom) +using the RSS 1.0 RDF triple model with mapping to atom terms +and consideration of atom output format conditions. +

+ +

RSS 1.0 serializer

+
    +
  • Allow setting output namespaces for the serializer
  • +
  • Allow writing extra RDF triples as RDF/XML attached to RSS items.
  • +
  • Recognize predicates with XML Literal and emit as +parseType="Literal" or when content:encoded, +as a CDATA block, by RSS 1.0 convention.
  • +
  • Removed code assumptions about triples appearing in a certain order.
  • +
  • Free namespaces and stack in correct order
  • +
+ +

Turtle serializer now respects the writeBaseURI +feature to control generating the @base directive. +

+ +

Abbreviated serializers (RDF/XML Abbrev and Turtle) now remove +duplicate triples. +

+ +

Added feature RAPTOR_FEATURE_RSS_TRIPLES to add RDF +triples to RSS 1.0 or Atom serializer output with values 'rdfxml' or +'atom-triples'. Atom triples writes at:map sections for +the atom:entry elements and at:feedmap and +at:entrymap sections to the atom:feed +elements. at:contentType is used to provide a +type attribute value for an atom:content +that has a URI value. +

+ +

Added RAPTOR_FEATURE_ATOM_ENTRY_URI for the Atom +serializer to set the URI of an atom entry. If the URI matches the +URI of an entry item in the RDF mode of the channel, then an Atom +Entry document is generated rather than an Atom Feed document. +

+ + +

QName Class Changes

+ +

Added raptor_qname_to_counted_name() to get +a formatted qname for a name. +

+ +

raptor_new_qname_from_namespace_local_name() will +accept a NULL namespace to construct a namespace-less qname. +

+ +

Sequence Class Changes

+ +

raptor_sequence_set_at() now handles +setting an item at an index in the sequence beyond capacity+1 +to automatically extend. +

+ +

Added raptor_sequence_delete_at() to delete an item +at a position in a sequence and return it. +

+ +

URI Class Changes

+ +

raptor_uri_to_relative_counted_uri_string() now +has support for a base URI with scheme and authority but no path, +so the result can be a relative URI starting with '/'. +

+ +

XML Writer Class Changes

+ +

XML Writer allows adding newlines via +raptor_xml_writer_newline() which +requires use of raptor_xml_writer_flush() to indicate +when XML writer output is finished. +

+ +

Added raptor_xml_writer_get_depth() to get the current +XML writer element stack depth. +

+ +

Other Changes

+ +

Many more resiliance checks were added. +

+ +

Removed all calls to abort() in code on fatal errors. This +requires using setjmp and longjmp inside parsers built with +flex and bison. +

+ +

The Turtle writer may optionally generate @base depending on +flags. (This is used by Turtle serializer to handle the writeBaseURI +feature) +

+ +

Tidied error messages for rapper(1) when parsing stdin. +

+ +

raptor_init() and raptor_finish() use a reference count to ensure +initialising and terminating happen at most once each. +

+ + + + +

Raptor 1.4.17 Changes

+ +

The main changes to this release are:

+ +

Added two new JSON serializers: resource-centric 'json' +(Talis RDF/JSON) +and triple-centric 'json-triples'. +

+ +

Made I/O Stream class raptor_iostream support +reading as well as writing with new constructors and +new methods.

+ +

Added a new public SAX2 API class raptor_sax2 +exposing the existing internal API which has been around since the +first release of Raptor 8 years ago and runs on top of either expat +or libxml2.

+ +

Added new public error handlers structure +raptor_error_handlers containing a set of +(function, data pointers) pairs called raptor_handler_closure +for each error log level. +Added raptor_log_level enum for the error log level. +Added an initialization function for the structure, +raptor_error_handlers_init(). +

+ +

Several other API changes, fixes and improvements were made.

+ +

Fixed Issues:

+
    +
  • 0000252: Allow controlling of cache headers in Raptor
  • +
  • 0000245: Extra classes added to an OWL object
  • +
+ + +

I/O Stream class changes

+ +

Made I/O Stream class raptor_iostream support +reading data in addition to writing. (Dave B):

+
    +
  • Deprecated raptor_iostream_handler structure for new +raptor_iostream_handler2 structure which contains the +new factory functions for reading.
  • +
  • Added new read I/O stream factory handler typedefs +raptor_iostream_read_bytes_func and +raptor_iostream_read_eof_func. +
  • +
  • Added new raptor_new_iostream_from_handler2() I/O +stream constructor to allow building of read and write iostreams +deprecating raptor_new_iostream_from_handler(). +
  • +
  • Added new raptor_iostream_tell() deprecating +raptor_iostream_get_bytes_written_count. +
  • +
  • Added new read I/O Stream constructors: +raptor_new_iostream_from_sink(), +raptor_new_iostream_from_filename() +raptor_new_iostream_from_file_handle() and +raptor_new_iostream_from_string() +
  • +
  • Added new read I/O Stream methods +raptor_iostream_read_bytes() and +and raptor_iostream_read_eof(). +
  • +
+ +

Added new write I/O Stream method +raptor_iostream_write_string_python() to write an +encoded string to an I/O stream using python / JSON / Turtle / +N-Triples / SPARQL escaping rules. (Dave B) +

+ + +

Serializer Class Changes

+

Added two new JSON serializers (Dave B):

+
    +
  1. Resource-centric serializer named json based on +Talis RDF/JSON Specification
  2. +
  3. Triple-centric serializer named json-triples based on the SPARQL results in JSON format.
  4. +
+ +

Added new serializer features for the JSON serializers (DaveB):

+
    +
  • RAPTOR_FEATURE_JSON_CALLBACK (name 'jsonCallback') to +set the top-level callback function name wrapper above the outer object.
  • +
  • RAPTOR_FEATURE_JSON_EXTRA_DATA (name 'jsonExtraData') to +add extra top-level JSON object data.
  • +
+ +

Example of using the resource-centric serializer while defining a +callback:

+
+$ rapper -q -o json -f jsonCallback=foo https://librdf.org/raptor/raptor.rdf
+foo(
+{
+  "https://librdf.org/raptor/#raptor" : {
+    "http://usefulinc.com/ns/doap#description" : [ {
+...
+
+ + +

Statement Class Changes

+ +

Added raptor_statement_compare() to provide an +ordering between raptor_statement objects. (Dave B) +

+ + +

Parser Class Changes

+ +

Added new parser features to control HTTP headers in +web requests (Dave B, based on a patch in the bug):
+Also never Pragma: header with libcurl ever.
+Fixes Issue #0000252 +

+
    +
  • RAPTOR_FEATURE_WWW_HTTP_CACHE_CONTROL to control +sending Cache-Control (default: none)
  • +
  • RAPTOR_FEATURE_WWW_HTTP_USER_AGENT to control +sending User-Agent (default: none)
  • +
+ +

Turtle parser:

+
    +
  • Added tests to forbid ' and +'''-quoted strings and to forbid () in +triple predicate position following the updated Turtle spec. (Dave B)
  • +
  • Write ';' statement terminators with a leading +space for consistency with '.' terminator. (Dave R)
  • +
  • Remove canonicalisation of integer and double +to match Turtle latest spec. (Dave B)
  • +
+ + +

QName Class Changes

+ +

Added new methods raptor_qname_get_local_name(), +raptor_qname_get_value() and +raptor_qname_get_counted_value(). (Dave B) +

+ + +

SAX2 Class Changes

+ +

Added new public SAX2 API class raptor_sax2 exposind +th existing internal one which has been around since the first +release of Raptor 8 years ago and runs on top of either expat or +libxml2. (Dave B)

+ +
    +
  • Constructor: raptor_new_sax2()
  • +
  • Destructor: raptor_free_sax2()
  • +
  • XML handler methods: + raptor_sax2_set_start_element_handler(), + raptor_sax2_set_end_element_handler(), + raptor_sax2_set_characters_handler(), + raptor_sax2_set_cdata_handler(), + raptor_sax2_set_comment_handler(), + raptor_sax2_set_unparsed_entity_decl_handler() and + raptor_sax2_set_external_entity_ref_handler(). +
  • +
  • XML handler factory typedefs: + raptor_sax2_start_element_handler, + raptor_sax2_end_element_handler, + raptor_sax2_characters_handler, + raptor_sax2_cdata_handler, + raptor_sax2_comment_handler, + raptor_sax2_unparsed_entity_decl_handler and + raptor_sax2_external_entity_ref_handler. +
  • +
  • Set XML Namespace handler method: +raptor_sax2_set_namespace_handler() +
  • +
  • Parsing methods: + raptor_sax2_parse_start() and + raptor_sax2_parse_chunk() +
  • +
  • Other methods: + raptor_sax2_inscope_xml_language() and + raptor_sax2_inscope_base_uri() +
  • +
+ + +

Serializer Class Changes

+ +

Abbreviated serializers (RDF/XML-Abbrev and Turtle):

+
    +
  • Switched from using a sequence to using an AVL Tree with a cursor +to more efficiently (faster) group/sort triples by subject. This +changes the previous syntax output order but has no semantic +difference. (Dave B) +
  • +
  • Use the AVL Tree to remove duplicate triples. (Dave B)
    +Fixes Issue #0000245 +
  • +
+ +

Turtle serializer:

+
    +
  • Feature RAPTOR_FEATURE_WRITE_BASE_URI +added to control writing @base directive to Turtle. (Dave R)
  • +
  • Remove canonicalisation of integer and double +to match Turtle latest spec. (Dave B)
  • +
+ + +

URI Class Changes

+ +

Update URI resolving for RFC3986 changes (Dave B) +

+ + +

WWW Class Changes

+ +

Added new method raptor_www_set_http_cache_control() +to set the HTTP Cache-Control: header in requests. +(Dave B, based on a patch in the bug)
+Fixes Issue #0000252 +

+ + +

XML Class Changes

+ +

Added new method raptor_xml_element_get_language() +to get the language associated with an element. (Dave B) +

+ + +

Portability and Resilience Changes

+ +

Pass on error failures in parser and serializer factory +construction. (Lauri) +

+ +

Abbreviated serializers (RDF/XML-abbrev and Turtle): low memory +and allocation failure fixes. (Lauri) +

+ +

Altered API function signatures of +raptor_uri_set_handler(), +raptor_uri_get_handler(), +raptor_new_namespaces(), +raptor_namespaces_init() and +raptor_new_xml_writer() to add appropriate +consts. (Lauri) +

+ +

Portability fixes for RAPTOR_API and other macros. (Lauri) +

+ +

Removal of many sets of writable static data in N-Triples parser, URI +class, Unicode NFC code, libxml support, Turtle writer and XML +writer. (Lauri) +

+ +

Portability fixes for round() and +trunc() that are not always available in libc but might +be in libm. (Dave B) +

+ +

Turtle/N3 parsers and serializers, RDF/XML_Abbrev serializer: many +low memory fixes and better out of memory errors. (Lauri) +

+ + +

Other Changes

+ +

Rewrote internal error log functions to use new error handlers +structures and simplify the calls. (Dave B) +

+ +

Expanded internal raptor_avltree datatype support to +add a cursor, allowing it to be used for creating large ordered +sequences that need to be walked. (Dave B) +

+ +

Updated rdfdiff utility to handle duplicate triples +in inputs. (Dave B) +

+ +

raptor_sequence_shift() and +raptor_sequence_unshift() are now as efficient as the +sequence push and pop operations: O(1). (Lauri) +

+ +

autogen.sh was updated. +

+ +

rapper utility can now accept multiple +-f / --feature options; previously +only one parser and one serializer feature was possible. +

+ + +

Raptor 1.4.16 Changes

+ +

The main changes to this release are:

+ +

Provide 100% support for the +GRDDL W3C Recommendation of 2007-09-11. +

+ +

The +Turtle +parser and serializer were updated to support +@base for specifying a base URI, following +Turtle of 2007-09-11. +

+ +

The Turtle and RDF/XML serializers had performance improvements +for large graphs. +

+ +

Added a TRiG Parser based on Turtle with named graph support.

+ +

Several other API changes, fixes and improvements were made.

+ +

Fixed Issues:

+
    +
  • 0000188: Wrong RAPTOR_API definition for mingw
  • +
  • 0000192: raptor_uri_filename_to_uri_string() - getcwd() loop error
  • +
  • 0000194: parser and serializer don't recognize the same mime types
  • +
  • 0000195: Compile error in raptor_serialize.c debug code
  • +
  • 0000207: RDF file can be parsed, but not then serialised.
  • +
  • 0000210: RAPTOR_FEATURE_WRITER_XML_DECLARATION broken in Ruby
  • +
  • 0000214: Empty rdf:about, plus base-uri, produces incorrect turtle output
  • +
  • 0000216: flickrdf segfaults at raptor_serialize_end!
  • +
  • 0000217: flickrdf segfaults at raptor_serialize_end!
  • +
  • 0000232: libraptor does not correctly free up libxml error handler, causing crashes in subsequent calls to libxml error handlers
  • +
  • 0000237: raptor_sequence robustness: item ownership on insert error
  • +
  • 0000238: GRDDL parser in SVN overwrites blank nodes when merging graphs
  • +
  • 0000239: GRDDL parser in SVN returns 60 less triples with https://www.w3.org/
  • +
+ + +

Namespaces Class Changes

+ +

raptor_namespaces_init() now returns an integer +status. +

+ +

Parser Class Changes

+ +

+Added raptor_graph_handler typedef and +raptor_set_graph_handler() to return named graph +identifiers during parsing, initially for the TRiG parser. +

+ +

These were added the GRDDL parser:

+
    +
  • RAPTOR_FEATURE_MICROFORMATS (microformats) to enable + hCard and hCal microformats
  • +
  • RAPTOR_FEATURE_HTML_TAG_SOUP (htmlTagSoup) to use + the HTML tag soup parser if the XML parsing fails
  • +
  • RAPTOR_FEATURE_HTML_LINK (htmlLink) to enable html + <link>
  • +
  • RAPTOR_FEATURE_WWW_TIMEOUT (wwwTimeout) for setting + URI retrieval timeouts during processing
  • +
+ + +

XML Element Class Changes

+ +

Added +raptor_new_xml_element_from_namespace_local_name() +constructor to make an XML element from a local name relative +to a raptor_namespace. +

+ +

Unicode Class Changes

+ +

Defined a new raptor_unichar typedef for a Unicode +codepoint defined as unsigned long which was the +previous type used. Altered the Unicode function to take it as a +parameter. raptor_unicode_char_to_utf8(), +raptor_utf8_to_unicode_char(), +raptor_unicode_is_xml11_namestartchar(), +raptor_unicode_is_xml10_namestartchar(), +raptor_unicode_is_xml11_namechar() and +raptor_unicode_is_xml10_namechar(). +

+ +

URI Class Changes

+ +

Added raptor_uri_compare() and +raptor_uri_compare_func function pointer for +implementing it in the raptor_uri_handler. The handler +now has a version field initialised to trigger the new +factory method for uri compare when the version is 2 or more. +

+ +

WWW Class Changes

+

+Added raptor_www_set_connection_timeout() +to set the WWW retrieval connection timeout in seconds. +

+ +

+Added raptor_www_final_uri_handler typedef and +raptor_www_set_final_uri_handler() to return +the final URI seen during WWW retrieval such as after +redirects. +

+ +

+Added raptor_www_get_final_uri() to return the final URI +after a WWW retrieval which might include redirects. +

+ + +

Parser Changes

+ +

The GRDDL parser/processor was substantially updated and now +supports 100% of the +Gleaning Resource Descriptions from Dialects of Languages (GRDDL) +syntax, W3C Recommendation of 2007-09-11: +

+
    +
  • Transforming XML with XSLT 1.0
  • +
  • Processing XML namespaces.
  • +
  • Transforming XHTML with XSLT 1.0
  • +
  • Processing HTML profiles.
  • +
  • Handling of base URIs and URI redirects.
  • +
  • XInclude processing.
  • +
  • Parsing as RDF/XML when it is recognised after a transform.
  • +
+ +

it also:

+
    +
  • Handles hCard and hCal microformats when feature + RAPTOR_FEATURE_MICROFORMATS is enabled (default + enabled).
  • +
  • Handles <link type="application/rdf+xml" href="URI" /> to + RDF/XML content when feature RAPTOR_FEATURE_HTML_LINK is + enabled (default enabled).
  • +
  • Attempts parsing with libxml's HTML parser if XML parsing fails, + when feature RAPTOR_FEATURE_HTML_TAG_SOUP is enabled + (default enabled).
  • +
  • Discards errors during recursive processing such as 404s, + failure to parse, failure of XSLT processing.
  • +
  • Uses XSLT security - denies reading, writing to files, + directories or writing to network.
  • +
  • Accepts the RAPTOR_FEATURE_NO_NET feature to prevent + all networking.
  • +
  • Allows fine-grained URI filtering with + raptor_parser_set_uri_filter().
  • +
+ +

RDF/XML parser recognising was updated to just the start of the +document for guessing if it should handle content and to try +to avoid html URLs. +

+ +

RSS Tag soup parser recognising was updated to accept with the +string 'feed' in the identifier. +

+ +

TRiG Parser was added based on the Turtle parser, adding named +graphs. It returns name graph URis via a callback set with new API +call raptor_set_graph_handler() +

+ +

Turtle parser added @base support, fixed turtle +escapes to URIs. Recognising was updated to look for +@prefix early in the document. +

+ +

Serializer Changes

+ +

Turtle serialiser changes:

+
    +
  • Generate @base when an output base URI is given.
  • +
  • Properly format Turtle XSD doubles using new snprintf code.
  • +
  • Fix unwanted blank line at end of Turtle list abbreviation.
  • +
  • Use AVL Tree rather than sequence for significant performance +improvement for large serialisations.
  • +
+ +

RDF/XML serialiser was changed to emit a legal empty RDF/XML +document when no triples are serialised and to skip emitting +statements with bad predicate uris rather than returning an error. +

+ +

RDF/XML Abbrev serialiser was changed to use an AVL tree rather +than sequence for significant performance improvement for large +serialisations. +

+ +

rapper Utility Changes

+ +

Added an --show-graphs option to print named graph +URIs as seen (such as with TRiG). +

+ +

Added -I / --input-uri and +-O / --output-uri options to set the +input / parsing and output / serializing base URIs +separately. Defaults remain the same - the serializer base URI +defaults to the input base URI, however it was set. +

+ + +

Portability Changes

+ +

Fixes for when building from Subversion on cygwin (EOL issues, +Makefiles).

+ +

Remove unused semicolons for prevention of compiler warnings.

+ +

Fix some uninitialized variables that some compilers complain about.

+ +

Allow RAPTOR_ASSERT_DIE to be externally defined.

+ +

Allow RAPTOR_WWW_BUFFER_SIZE to be externally defined.

+ + +

Other Changes

+ +

autogen.sh was updated to handle program versions +better using an inline perl helper. +

+ +

Start to add resiliance to memory allocation failures +and errors inside the library. +

+ +

Added AVL Tree code to make much faster key:value lookups. This +is used for RDF/XML parser XML ID checks and in the 'abbrev' +serializers - Turtle and RDF/XML-Abbrev for looking up nodes. +

+ +

Better libxml error messages are now returned, mentioning +some of the names and values that caused the error. +

+ + + +

Raptor 1.4.15 Changes

+ +

General Changes

+ +

GRDDL parser now passes the (unapproved) test suite for the +GRDDL W3C Working Draft 2 March 2007 +except for two tests that have been reported as having errors. +

+ +

When using libcurl as the WWW retrieval library, errors in +resolving a URI such as not found (404) are now reported as proper +errors and cause parsing to fail rather than just return no triples. +

+ +

Some improvments where made to guessing for a parser to match some +content. Firstly, any mime type with Q <10 is added to the score, +don't lose the influence of the mime type entirely. The consequence of +this is that Turtle can pretend to be a partial N3 parser. Secondly, +the XHTML mime type is now correctly recognised by the GRDDL parser +rather than the RSS Tag Soup parser.

+ + +

Fixed Issues:

+
    +
  • #0000174: Serializing to rdfxml* with a base_uri doesn't set the xml:base attribute, but does truncate rdf:about and rdf:resource values
  • +
  • #0000177: Some URI references mis-resolved
  • +
  • #0000178: No errors from accessing 404 URIs
  • +
  • #0000180: messages garble output to stdout
  • +
+ + +

Parser and Serializer Changes

+ +

Added better error reporting for XML errors using the +libxml structured error reporing api. From +

+
+$ rapper -i grddl https://librdf.org/LICENSE.txt
+rapper: Parsing URI https://librdf.org/LICENSE.txt
+rapper: Error - URI https://librdf.org/LICENSE.txt - XML error - https://librdf.org/LICENSE.txt:2: 
+rapper: Error - URI https://librdf.org/LICENSE.txt - XML error - parser 
+rapper: Error - URI https://librdf.org/LICENSE.txt - XML error - error : 
+rapper: Error - URI https://librdf.org/LICENSE.txt - XML error - Document is empty
+rapper: Error - URI https://librdf.org/LICENSE.txt - XML error -                   Redland RDF Application Framework - License
+rapper: Error - URI https://librdf.org/LICENSE.txt - XML error -                   ^
+rapper: Failed to parse URI https://librdf.org/LICENSE.txt grddl content
+rapper: Parsing returned 0 triples
+
+

To this:

+
+$ rapper -i grddl https://librdf.org/LICENSE.txt
+rapper: Parsing URI https://librdf.org/LICENSE.txt
+rapper: Error - URI https://librdf.org/LICENSE.txt:1 - XML parser error: Document is empty
+rapper: Error - URI https://librdf.org/LICENSE.txt:1 - XInclude processing failed for GRDDL document
+rapper: Failed to parse URI https://librdf.org/LICENSE.txt grddl content
+rapper: Parsing returned 0 triples
+
+ + +

GRDDL parser updated to support the +GRDDL W3C Working Draft 2 March 2007: +

+
    +
  • Namespace and profile URI handling now works.
  • +
  • Run XML Include processing
  • +
  • Throw away XML validation errors
  • +
  • When a namespace URI is seen that was RDF/XML Mime type, run +the RDF/XML parser on the content.
  • +
  • Look for substrings inside rel attributes when looking for profiles.
  • +
  • Return a warning and do not fail if XSLT sheet is not found
  • +
  • Use libxml structured errors for better reporting
  • +
  • Removed old hard-coded xslt scripts
  • +
+ +

Turtle parser was changed to accept the N3 mime +type text/rdf+n3 at low Q(quality) +so it might work for N3 that is the RDF subset - quite common. +

+ +

Changed the RSS Tag Soup parser and RSS 1.0 serializer to stop +sharing use of the declared namespaces so that when using both at the +same time, there is no double-free of the same objects. +

+ +

Correct the content: namespace URI in the RSS parser and +serializers. +

+ + +

Other Changes

+ +

rapper gains a -t/--trace option to show +URIs traversed. Handy for GRDDL. +

+ +

raptor_uri_resolve_uri_reference() no longer goes +past the end of buffer when the relative URI is ,/ +

+ + +

Added an internal API for capturing parsed data as it is seen. +Use by GRDDL parser but with no public API. +

+ +

Added an internal API for structured error reporting. Updates +made throughout the library but with no public API. +

+ +

Internal API raptor_new_sax2() signature changed to +just have an error_handlers pointer argument rather than +multiple function / user_data pairs. +

+ + + + +

Raptor 1.4.14 Changes

+ +

General Changes

+ +

Added a +Turtle Terse RDF Triple Language serialiser by Dave Robillard based on the existing RDF/XML-Abbrev +serialiser. +

+ +

Added a GraphViz +DOT format serialiser +by Evan Nemerson. +

+ +

The GRDDL parser now does namespace and profile URI recursion and +has other improvements and fixes. +

+ +

Fixed Issues:

+
    +
  • #0000032: GRDDL indirection feature request
  • +
  • #0000141: Crash when GRDDL parser is used with a used-generated blank node ID prefix.
  • +
  • #0000143: Crash when GRDDL parser fails to retrieve URI.
  • +
  • #0000148: A public function to generate a blank ID would be nice though.
  • +
  • #0000155: entity processing in literal property elements (with libxml)
  • +
  • #0000157: Crash when RDF/XML Abbrev serializer sees a rdf:type predicate with a literal object.
  • +
+ +

Configuration Changes

+ +

raptor-config gains a --private-libs +for the internal libraries used in building raptor, with the public +ones only emitted with --libs. +

+ +

raptor.pc now uses Libs.private for +internal dynamically linked libraries. +

+ +

The libxml minimum version is now 2.6.8 since 2.6.7 crashes on +PPC64 Linux. 2.6.8 was released March 2004 so this should be no +burden.

+ +

Do not use PATH_MAX so raptor can build on Hurd. +

+ +

Parser Changes

+ +

RDF/XML parser now looks for the RDF/XML root element and +namespace declaration in the initial bytes of content when guessing. +This allows content that is in other mime types such as +application/xml to be more likely guessed as RDF/XML. +

+ +

When guessing a parser to use, if an an exact match is found for +the mime type (q=10), then that parser is used. +

+ +

The GRDDL parser has several changes:

+
    +
  • Recurses through the root element's namespace URI and the profile + URIs. It excludes several common namespace URIs from processing + (XHTML, RDF/XML, XML Schema) and does not traverse the GRDDL profile + URI itself. +
  • +
  • Tries to guess which of the RDF/XML or Turtle parser is wanted + from an XSLT result. Guessing is performed because not all the XSLT + sheets used in the demonstrations set the mime type to match Turtle's + unregistered type, or because the return no mime type, or return an + XML one, when it was expected RDF/XML would be received. +
  • +
  • Watches the processed URIs and never visits the same URI more + than once in a session. +
  • +
  • Passes on general XSLT errors to raptor rather than letting the + default (printing to stderr) work. +
  • +
  • Declares XSLT 'base' and 'Base' parameters to allow some XSLT + sheets to work - pragmatism. +
  • +
+ +

Serializer Changes

+ +

Added a new +Turtle Terse RDF Triple Language +serializer and two new internal APIs based on the existing RDF/XML-Abbrev +serialiser, written by Dave Robillard: +

+
    +
  • turtle_writer for serializing triples to Turtle This + may be moved to the public API in a future release.
  • +
  • raptor_abbrev for the common 'abbreviated + serializer' core that is shared between the RDF/XML-Abbrev and Turtle + serializer.
  • +
+ +

Added a new GraphViz +DOT format serialiser +writen by Evan Nemerson. +

+ +

Note that testing the turtle serializing (make test) +requires the rdfdiff -u and a few of the tests take some +time to run.

+ + +

Other Changes

+ +

Added raptor_home_url_string +and raptor_license_string exported strings. +

+ +

Added raptor_parser_generate_id() as a public function +to generate an identifier for a parser. +

+ +

rdfdiff gains the -u/--base-uri option to specify the +from file base URI so that if the from file is a local file or +relative URI, it can be given an absolute base.

+ +

Failures to retrieve content from a URI using +the raptor_www class implementations now return a +failure as well as setting the HTTP status code to 403 or 404 as +appropriate. Previously success may have been returned with no +bytes.

+ + +

Raptor 1.4.13 Changes

+ +

General Changes

+ +

Prevent losing memory for a raptor_xml_writer when a +serializer is reused several times.

+ +

Fixed issues reported on the Redland Issue Tracker:

+
    +
  • Issue #0000134: Check for equal scheme and authority during construction of relative URIs from two absolute URIs.
  • +
+ + +

Configuration Changes

+ +

In maintainer mode, add all the supported compiler -W +warning flags to the CFLAGS. +

+ +

Allow LEX to be set to things that aren't exactly +'flex'.

+ +

Documentation Changes

+ +

Added single triple serializing example to the tutorial to +demonstrate serializing without parsing and building +a raptor_statement.

+ +

Other Changes

+ + +

Declare several raptor functions with GCC printf-formatting +attributes when using a new enough GCC.

+ +

RDF/XML parser now creates literals with +raptor_stringbuffer so that it does a lot less copying +when constructing longer literals. +

+ +

Added single raptor_statement serializing example +to demonstrate serializing alone without parsing.

+ + + +

Raptor 1.4.12 Changes

+ +

Restored the order of serialized syntaxes back to the same as in +Raptor 1.4.10 which Redland was relying on - asking to serialize to +mime type 'application/rdf+xml' without specifying a parser name in +Redland with Raptor 1.4.11 wrote it in XMP instead of RDF/XML as +it used to. This happened more often with language bindings. +That problem will be fixed in a future release of Redland but for now, +this stops wierd things like that happening. +

+ + +

Raptor 1.4.11 Changes

+ +

General Changes

+ +

Added raptor_get_feature_count() to return +the count of features, in preference to using the +macro value RAPTOR_FEATURE_LAST. +

+ +

Added raptor_www_set_uri_filter() method of the +WWW class (raptor_www) objects to have an +optional URI filter function that checks if the URL given is +allowed to be retrieved, or denied entirely. +

+ +

Fixed issues reported on the Redland Issue Tracker:

+
    +
  • #0000112: raptor_namespaces_qname_from_uri not public API?
  • +
  • #0000110: strcasecmp problem under windows (raptor_rss.c does not compile)
  • +
  • #0000091: guess parser should guess the syntax each time it is run, not be fixed
  • +
  • #0000089: Add a NONET feature to prevent network fetches
  • +
  • #0000041: Allow multiple transformation URLs in data-view:transformation property
  • +
  • #0000014: bNode content written twice in rdfxml-abbrev output mode
  • +
+ + +

Documentation Changes

+ +

The +Raptor Reference Manual +now includes descriptions of all the parsers and serializers and the +tutorial has a new section describing how to filter URIs and deny +network requests.

+ + +

Parser Changes

+ +

Added functionality to prevent network requests either via setting +a new feature RAPTOR_FEATURE_NO_NET that denies network +requests during a parser operation or with a URI filter function +raptor_parser_set_uri_filter(). This function uses +raptor_www_set_uri_filter() internally. +

+ +

Added raptor_get_need_base_uri() to tell if a parser +requires a base URI argument. Presently the N-Triples parser +is the only parser that does not require a base URI. +raptor_start_parse() will now throw an error if no base +URI is given and it is needed. +

+ +

The GRDDL parser was changed to +handle a list of URIs in the profile so it now +can support dataview:transformation in XML taking a list +of transformations as defined in +The GRDDL profile for XHTML part of the GRDDL specification. +It now also recognises +Embedded RDF and +HCalendar +using well known XPaths and transforms them to RDF triples using well +known XSLT sheet URIs. +

+ +

The Guess parser now resets after each parse and does a +fresh guess on the syntax based on the incoming information. +Fixes Issue #0000091 +

+ + +

The Turtle parser (and experimental N3 parser) were +changed to now require base URIs as they always should have. The +error messages when reporting problems with grammar tokens now return +better responses. Added better memory cleanup during parser error +recovery. +

+ + +

Serializer Changes

+ +

The RSS 1.0 Serializer now works again.

+ +

Updated the RDF/XML Abbreviated serializer to do proper +reference counting on the blank/resource nodes used as subjects and +objects to prevent dual-triple generation. Fixes the reported +Issue #0000014 +

+ + +

Other Changes

+ +

The internal SAX2 API can also prevent network fetches with the +feature RAPTOR_FEATURE_NO_NET.

+ +

Fixed a SAX2 problem that caused parsers that use it to leak +memory for 1 URI, affected RDF/XML and RSS Tag Soup. +

+ +

rapper help and verbose message formats were tidied.

+ + + +

Raptor 1.4.10 Changes

+ +

General Changes

+ +

No parser will now generate a triple with an identifier type +RAPTOR_IDENTIFIER_TYPE_ORDINAL. Only identifier type +resource, anonymous (blank node) and literal will be generated. +All serializers will convert any +RAPTOR_IDENTIFIER_TYPE_ORDINAL type on input to type +resource. +

+ + +

Configuration Changes

+ +

No longer adds LDFLAGS to pkgconfig file raptor.pc +and raptor-config fixing +Issue #0000097. +

+ + +

Parser Changes

+ +

All parsers no longer generate a triple with an identifier type +RAPTOR_IDENTIFIER_TYPE_ORDINAL, as deprecated in 1.4.8. +The replacement type generated is RAPTOR_IDENTIFIER_TYPE_RESOURCE. +

+ + +

The RSS Tag Soup (rss-tag-soup) parser now makes the +triples appear before parser destruction. This caused odd symptoms +like parsing in python returning no triples and the parser then +crashing during object destruction. +

+ +

The RDF/XML (rdfxml) parser no longer crashes if a +comment is seen outside an element, such as before or after the root +element.

+ + +

Serializer Changes

+ +

The RDF/XML (rdfxml) serializer no longer crashes if +the serializer is used more than once. +

+ + + +

Raptor 1.4.9 Changes

+ +

Configuration and Build Changes

+ +

Now using Subversion +for version control and the Raptor installation instructions explain how to get Raptor from Subversion.

+ +

configure now allows --enable-parsers=node and +--enable-serializers=none. Using both is possible!

+ +

No longer require libxml2 for the RSS Tag Soup parser

+ +

Various Win32 fixes and VC build files updates from John Barstow. +

+ + +

Documentation Changes

+ +

A new +Raptor Tutorial +was written covering using all parsing and serializing functions along with +example code. +

+ +

The +Raptor Reference Manual +now covers 100% of all functions, structs and defines with gtkdoc generated +documentation.

+ + +

rapper utility Changes

+ +

rapper now uses namespaces found in parsing to give +hints to the serializer as to how to format the output. The result +of this is that rapper can be used as an RDF +pretty-printer and is especially good at such things as turning flat +N-Triples to RDF/XML or RDF/XML-Abbrev. such as: +

+
+rapper -q -i ntriples -o rdfxml-abbrev example.nt
+
+ + +

Parser Changes

+ +

All parsers no longer generate +RAPTOR_IDENTIFIER_TYPE_PREDICATE as the statement +predicate type, as deprecated in 1.4.8. The replacement +type generated is RAPTOR_IDENTIFIER_TYPE_RESOURCE.

+ +

The Turtle parser now has true and false +boolean literals, which were accidently omiited from the parser in +the 1.4.8 update. +

+ +

Parsers can register capabilities for handling multiple mime types +with Q values. These are then used in WWW requests for content +in the Accept: header for HTTP. Added +raptor_parser_factory_add_mime_type for registering, +raptor_parser_get_accept_header to get the accept header +values for the types supported by one parser. +

+ +

From the previous change, the RSS parser now accepts several +unregistered RSS mime types as well as the registered Atom one; the +RDF/XML parser accepts unregistered mime type text/rdf +seen occasionally; the Turtle parser accepts several experimental +mime types. All unregistered or experimental types are accepted with +lower Q than any registered type. +

+ +

The RSS Tag Soup parser for RSS* and Atom no longer requires +libxml2 (for it's XML Reader API). Internal changes mean that it +will fully work on top of expat.

+ + + +

Serializer Changes

+ +

The RSS/Atom serializer now uses input namespace declarations to +choose namespaces on output.

+ +

Added raptor_serialize_set_namespace_from_namespace +to set a namespace for serializing from an existing +raptor_namespace. +

+ +

Serializing to RDF/XML (or RDF/XML Abbrev) now does not +double-free URI strings. +Fixes Issue #0000065 +

+ +

RSS serializer no longer writes the XML header twice.

+ + +

IOStream Class Changes

+ +

Added raptor_iostream_write_uri to directly write a URI +to an iostream without the need to go via a string.

+ +

Fixed bug in raptor_iostream_write_xml_any_escaped_string +failing to write ';' after escaping U+0009 and U+000A

+ + +

Namespaces Class Changes

+ +

Added raptor_namespaces_qname_from_uri to do URI +splitting into qname prefering to use the current in-scope namespaces +before having to search.

+ +

raptor_namespaces_format now NULL-terminates the namespace string. +Fixes Issue #0000062 +

+ +

Added raptor_namespace_get_counted_prefix to return a +namespace prefix and it's length.

+ + +

QName Class Changes

+ +

Added raptor_qname_get_namespace to get the namespace +associated with a QName.

+ + +

StringBuffer Class Changes

+ +

raptor_stringbuffer_append_counted_string and +raptor_stringbuffer_append_string now Do nothing on +appending a NULL string or a string of length 0. +Fixes Issue #0000073 +

+ + +

Unicode Class Changes

+ +

raptor_utf8_to_unicode_char now also checks for +overlong UTF-8 sequences, illegal code positions or out of range +codes. +

+ + +

URI Class Changes

+ +

Deprecated raptor_uri_is_file_uri which takes a +URI string argument for new function raptor_uri_string_is_file_uri +which more clearly says that. +

+ +

Changed all URI string calloc/mallocs to add enough room for a +full pointer at the string end to stop valgrind moaning on 64bit +systems when looking for the end of string NUL. +

+ +

raptor_uri_set_handler and +raptor_new_iostream_from_handler now take const +handler arguments. +

+ + +

WWW Class Changes

+ +

Get the curl success status into a long, not an int which causes +failure on 64 bit. +Fixes Issue #0000075 +

+ +

WWW requests for content to parse now always send an appropriate +Accept: header with Q values for the parser, or for the +guess parser, all supported mime types. +

+ + +

Internal Changes

+ +

Added XML element methods +raptor_xml_element_get_attributes and +raptor_xml_element_get_attributes_count, +raptor_xml_element_is_empty +to the SAX2 API. +

+ +

Many internal changes were made to the SAX2 API to finally +separate XML and RDF/XML parts. The SAX2 API is now fully usable on +either libxml2 or expat. That last sentence implies a lot of work, +by the way.

+ + + +

Raptor 1.4.8 Changes

+ +

General Changes

+ +

A large source re-arrangement was performed. All C sources and +headers that build the library are now in the src dir, general +documentation in the doc dir and utilities in the utils dir. This +both tidied up the mixture of files at the top level and also enabled +better use with gtk-doc. +

+ +

Future API change: From the next release of +Raptor, raptor_statement predicates will return +identifiers of type RAPTOR_IDENTIFIER_TYPE_RESOURCE +instead of RAPTOR_IDENTIFIER_TYPE_PREDICATE. +Identifiers of type RAPTOR_IDENTIFIER_TYPE_ORDINAL may +no longer be returned in any statement position (to be confirmed). +

+ +

Version Control change: Raptor will be switching to use +Subversion +for version control after the 1.4.8 release. Please check the +Redland Subversion site +for the latest status or the online +Raptor installation notes +for the raptor specific subversion installation information. +

+ + + +

Configuration Changes

+ +

The autogen.sh script for building from CVS was revamped to be +more modular.

+ +

configure now takes an --enable-gtk-doc +option to enable building of the documentation using the +gtk-doc utility. It is by default enabled only if the +utility is available. +

+ +

Added a new configure option --enable-serializers (in +1.4.7) to allow the selection of the required RDF serializers from +any of those supported.

+ +

raptor-config now has a --options +argument to list the configured or discovered options of the library +such as parsers, serializers and other choices. +

+ + +

Documentation Changes

+ +

The GNOME gtk-doc program is now used to +automatically extract documentation from source comments into +reference documentation. This is then merged with templates and +additional documentation to provide a reference manual for raptor +as XML document which is turned into HTML along with GNOME devhelp +support.

+ +

This new documentation intended to replace the libraptor manual +page/web page as easier to read document with scope for better +expanding with more detail of raptor including examples and tutorial +information. The manual page will continue to contain the summary +information for the present. +

+ + +

Portability Changes

+ +

Fixed a long-standing URI resolution bug on win32 - only remove +leading / if there is one present (patch from John C. Barstow)

+ + +

rapper utility Changes

+ +

Altered the -g argument to invoke the guessing parser +rather than guess on file/URI name alone. This is now equivalent to +choosing an input syntax of guess with -i guess.

+ +

Added a --show-namespaces long option (no short version) +to show namespaces that are declared in the parsed content. +

+ + +

Parser Changes

+ +

A new guessing parser was added, picking the actual parser to use +at run-time based on protocol or other information.

+ +

Allow a content type returned by a protocol (such as HTTP) to +enable choosing of parser at run-time. Added a new optional +parser factory method content_type_handler to return this. +

+ +

Allow parsers to handle several syntaxes rather than only 1 or 2. +

+ +

Parsers can now return namespace prefix/URI declarations as +they are given in the content by the means of a new handler type +raptor_namespace_handler and parser method +raptor_set_namespace_handler. Duplicate namespace +prefix/URIs can be returned. +

+ +

GRDDL Parser Changes

+ +

Bug fix when the entire content is in one chunk (René Puls).

+ +

Guessing Parser Changes

+ +

A new parser that guesses the actual parser to use at run-time +based on a combination of MIME Content-Type, file or URI name and in +future, iniital bytes of the content. If the Content-Type is an +exact match to a known parser, it is always chosen before trying +heuristics. +

+ +

RDF/XML Parser Changes

+ +

When emitting literals, handle a datatyped empty literal. This +is a post-REC errata for the revised RDF/XML recommendation. +See +archived example +for further information. +

+ +

RSS Tag Soup Parser Changes

+ +

Added atom 1.0 support including use of the new namespace. Atom +0.3 namespace terms are turned into new properties. Replace atom +copies of Dublin Core or RSS properties with the original terms: +

+
+ + + + + + + +
Atom 1.0 term Original term
atom:content rss:description
atom:id rss:link
atom:published dc:date
atom:rights dc:rights
atom:title rss:title
+
+ +

Apply the in-scope base URI (such as from xml:base) +to atom 1.0 fields that take URI values: +atom:id, atom:icon and atom:logo. +

+ +

Added optional date parsing code to turn XML RSS date fields into +ISO format ones, suitable for Atom and XML schema datatypes format. +Will use library parsedate code from curl or INN if available. +

+ +

XML RSS field pubDate is now turned into Dublin Core +dc:date field in the ISO format. +

+ +

XML RSS field content is turned into +content:encoded in RDF triples on output with +escaping.

+ +

Turtle Parser Changes

+ +

Updated to support Turtle version 2006-01-02 +(announcement). +

+ +

Switch qname, blank node and prefix definitions to SPARQL ones.

+ +

Check for illegal not-hexadecimal \u and \U escape values.

+ +

Fix greedy matching of long literals ("""....""") that ended on +the last """ found rather than the first.

+ +

Added double and decimal constants.

+ +

Added optional +- sign to all numeric constants.

+ +

Allow \" escape inside long strings.

+ +

Take care to reset the generated raptor_statement +language and datatype fields when not used. +

+ + +

Serializer Changes

+ +

Added a new Atom 1.0 serializer (name atom) +by parameterising the RSS 1.0 serializer. +

+ +

Added a new Adobe XMP compatible serializer (name rdfxml-xmp) +by parameterising the RDF/XML Abbreviated serializer. Patch provided by +Sid Steward. +

+ +

All serializers can be chosen at configure time from +those available using configure option --enable-serializers. +

+ +

The RSS parser and serializer can now be independently enabled or +disabled. The RSS serializer no longer requires an XML parser.

+ + +

RDF/XML Serializer / XML Writer Changes

+ +

A new XML Writer feature +RAPTOR_FEATURE_WRITER_XML_VERSION was added to allow +chosing XML 1.0 (value 10) or XML 1.1 output (value 11). This +feature is also accepted by serializers as an option and used by the +RDF/XML and RDF/XML-Abbrev serializers. +

+ +

A new XML Writer feature +RAPTOR_FEATURE_WRITER_XML_DECLARATION was added to allow +omitting the XML declaration (default true). +

+ +

Added functions raptor_xml_any_escape_string() +and raptor_iostream_write_xml_any_escaped_string() +which take an XML version. The XML 1.0 functions give errors +when attempting to write #x1-#x1f (excluding #x9, #xA, #xD) or #x7F. +

+ + +

Atom 1.0 Serializer Changes

+ +

Added a new serializer using the Atom 1.0 format and namespace. +This reads RDF triples in the RSS 1.0 model, along with any +additional atom 1.0 properties and serializes an Atom 1.0 feed +file.

+ + +

Adobe XMP Serializer Changes

+ +

Added a new serializer writing RDF/XML in the profile used by +Adobe XMP. Note that this does require RDF triples to be used in a +certain style; for example all triple subjects are the "current +documment" giving rdf:about="".

+ + +

URI Class Changes

+ +

Fix a bug when adding a default path of / to a URI +in functions raptor_new_uri_for_xmlbase() +and raptor_new_uri_for_retrieval(). +(Bug #0000045) +

+ + +

raptor_uri_equals was altered to accept NULL pointers, +which do not compare equal to a non-NULL URI. NULL does equal NULL. +

+ + +

Internal Changes

+ +

The internal SAX2 class was extensively changed so that remaining +interdependencies with the RDF/XML parser were removed and it can now +be re-used for other syntaxes cleanly. Several functions +were modified or added.

+ +

Removed old and hardly-tested internal support for XML entity +resolution (libxml only).

+ +

Various fixes for GCC 4 warnings. +

+ + +

Raptor 1.4.7 Changes

+ +

Fix a couple of crashes in the RSS tag soup parser / serializer +(Dave Beckett, Suzan Foster).

+ +

configure now looks for the +libxslt/xslt.h header as well as the +libxslt library and disables XSLT and GRDDL support it +if is missing. This catches systems with the libraries without +headers as has happened on some OSX versions. +

+ +

In serializers rdfxml and rdfxml-abbrev, report failure to +serialize to RDF/XML if the predicate URI is not absolute. +

+ + +

Raptor 1.4.6 Changes

+ +

Added --with-xslt-config configure option

+ +

Added a new parser for +Gleaning Resource Descriptions from Dialects of Languages (GRDDL) +which allows reading XHTML and XML as RDF triples by using profiles +in the document that declare XSLT transforms from the XHTML/XML +content into RDF/XML which is the RDF content. It does not +support all the GRDDL styles, for example +dataview:namespaceTransformation, +or perform recursive transformations. +

+ +

The turtle parser now accepts """long literals"""

+ +

XML writer feature support were added in 1.4.5 and not documented. +The new functions are: +raptor_xml_writer_features_enumerate, +raptor_xml_writer_set_feature, +raptor_xml_writer_set_feature_string, +raptor_xml_writer_get_feature and +raptor_xml_writer_get_feature_string. +The three XML writer features added are +\fBRAPTOR_FEATURE_WRITER_AUTO_INDENT\fR with boolean value (default true) +to auto-indent the XML, +\fBRAPTOR_FEATURE_WRITER_AUTO_EMPTY\fR with boolean value (default true) +to automatically generate empty elements if a start/end element sequence +has no content and +\fBRAPTOR_FEATURE_WRITER_INDENT_WIDTH\fR with an integer value (default 2) +to set the indenting level for the XML. +

+ +

New build configuration and portability fixes for win32 (John Barstow)

+ +

Portability fixes for win32 - added +SIZEOF_UNSIGNED_SHORT (Dave Viner, others)

+ +

Added a signing memory debugging system to aid checking when +raptor-allocated memory is freed in another library or vice-versa +enabled by --with-memory-signing configure option +(defaults to on in maintainer mode).

+ +

Fixed a few internal malloc/frees to use RAPTOR_MALLOC / RAPTOR_FREE +so that the above signed memory system worked.

+ +

RDF/XML serializer: +Use the maximal name when splitting a predicate.
+Turn datatyped literals that are rdf:XMLLiteral into inline XML with +rdf:parseType="Literal" rather than XML-escaped. +

+ +

RDF/XML abbreviated serializer: +Fix a crash when there is a NULL base URI. +Use the maximal name when splitting a predicate.
+Turn datatyped literals that are rdf:XMLLiteral into inline XML with +rdf:parseType="Literal" rather than XML-escaped. +

+ +

RSS tag soup parser: +Fix crash with unexpected use of alternate attribute.
+Update from Suzan Foster to reflect the latest status of the +enclosure vocabulary and allow multiple common items and fields. +

+ +

RSS 1.0 serializer: +Added RSS enclosures serializing. +

+ +

grapper example GTK program now stores the window +width and height using gconf2.

+ + +

Raptor 1.4.5 Changes

+ +

Added a new RDF/XML with abbreviations serializer +rdfxml-abbrev written by Steve Shepard which handles +several of the abbreviations specified by the +RDF/XML Syntax Specification (Revised) +W3C Recommendation. It is suitable for writing small documents as +there are known scaling issues. +

+ +

The RSS tag soup parser was updated to work better when there is +no base URI given. It also now supports reading the +RSS 1.1 format and +turning it into RSS 1.0 model triples.

+ +

Deprecated raptor_ntriples_string_as_utf8_string as +rather too internal to be useful, since it only works with a parser. +

+ +

More fixes to work around the broken libxml2 on Apple OSX 10.3.x +with inconsistent shared libraries / headers.

+ +

Experimental and incomplete Notation 3 parser - updated to match +changes to Turtle. CVS changes only, not enabled in standard builds. +

+ + + +

Raptor 1.4.4 Changes

+ +

Make the RSS tag soup parser handle RSS 0.9 namespace elements by +turning them into RSS 1.0.

+ +

Fix a couple of crashes in the RSS 1.0 serialiser when +no base URI is used.

+ +

Make raptor_uri_to_relative_counted_uri_string +work when the base or reference URI have no paths such as like +http://example.org +

+ +

Added portability fixes for Win32 to get Raptor 1.4.3 building +with MS Visual Studio using expat and libcurl. The RAPTOR_INTERNAL +define was moved to the build configuration and defines added for +integral type sizes. Patch from Dave Viner (dviner at apache dot +org).

+ + + +

Raptor 1.4.3 Changes

+ +

A release with the major new feature of an XML writer API. +This is now used along with a new supporting XML element class to +improve the existing RDF/XML serializer and to provide a new +RSS 1.0 serializer. +

+ +

This API it is also used by the next release of +Rasqal to provide serializing +of query results to XML. +

+ +

The new raptor_xml_writer class functions added are: +raptor_new_xml_writer (constructor), +raptor_free_xml_writer (destructor), +raptor_xml_writer_empty_element, +raptor_xml_writer_start_element, +raptor_xml_writer_end_element, +raptor_xml_writer_cdata, +raptor_xml_writer_cdata_counted, +raptor_xml_writer_raw, +raptor_xml_writer_raw_counted, +raptor_xml_writer_comment and +raptor_xml_writer_comment_counted. +

+ +

The new raptor_xml_element class functions added are: +raptor_new_xml_element (constructor), +raptor_free_xml_element (destructor), +raptor_xml_element_get_name, +raptor_xml_element_set_attributes, +raptor_xml_element_declare_namespace and +raptor_iostream_write_xml_element. +

+ + +

Parser Changes

+ +

RSS tag soup parser now works with older libxml2s (2.5.10+), +including the one shipped with some Apple OSX versions that has an +inconsistent header file and library.

+ +

RSS tag soup parser recognises/scores more common XML RSS file names.

+ +

RSS tag soup parser turns XML RSS +<guid isPermaLink="true">val</guid> +into RDF/XML form <guid rdf:resource="val"/>, leaving +the non isPermaLink form to be a literal value.

+ +

A bug was found in libxml2 that causes double expanding of XML +entities in RDF/XML. This has been reported but cannot be worked +around from raptor. The expat XML parser can be used as an +alternative, as it does not have this problem. A test was added for +this bug but it will not cause the test suite ('make check') to +fail.

+ +

Added additional +Turtle +parser tests that cover Notation 3 syntax that is not part of the +Turtle language.

+ +

Added +raptor_parser_set_feature_string and +raptor_parser_get_feature_string +methods to set/get string feature values.

+ + +

Serializer Changes

+ +

Added feature relative_uris for serializers. This +is used by the RDF/XML serializer and enabled by default.

+ +

Added feature start_uri for serializers with a string +value to set the start URI for serializing. Not used at present.

+ +

Added new methods raptor_serializer_features_enumerate +to list serializer features and functions to set/get serializer +feature integer or strings values: +raptor_serializer_set_feature, +raptor_serializer_get_feature, +raptor_serializer_set_feature_string and +raptor_serializer_get_feature_string. +

+ +

Added raptor_serialize_set_namespace to allow user +declaration of prefix/URI namespaces pairs as serializing hints.

+ +

the RDF/XML serializer was improved using the new XML Writer class +so it now uses any user-declared namespace hints in it's output and +emits relative URIs whenever possible. The latter was provided +by a patch from René Puls.

+ +

A new +RSS 1.0 +serializer was added, using the new XML Writer class +and using the same structures, classes and properties as the RSS tag +soup parser.

+ + +

URI class changes

+ +

Added relative URI generating code from a patch written by René Puls +and provide this with two new methods +raptor_uri_to_relative_uri_string and +raptor_uri_to_relative_counted_uri_string. +

+ +

Added raptor_uri_print to print a URI to a file handle.

+ +

Added methods raptor_uri_to_string and +raptor_uri_to_counted_string to return a URI as newly +allocated strings.

+ + +

I/O Stream Changes

+ +

Many classes gained methods to write to iostreams, supporting the +new XML Writer class functionality. The added methods are: +raptor_iostream_write_namespace, +raptor_iostream_write_ntriples_string, +raptor_iostream_write_qname, +raptor_iostream_write_statement_ntriples, +raptor_iostream_write_stringbuffer, +raptor_iostream_write_xml_element and +raptor_iostream_write_xml_escaped_string. +

+ + +

Namespace Class Changes

+ +

Added raptor_namespace_copy copy +constructor and raptor_new_namespace_from_uri +constructor to build a namespace from a raptor_uri object.

+ +

Added utility function raptor_new_namespace_parts_from_string +to decode syntax of the form +xmlns:prefix="uri" +into prefix and uri string pairs. +

+ +

Added raptor_namespaces_find_namespace_by_uri method +for namespace stack to find a declared namespace by URI. This +complements raptor_namespaces_find_namespace which +already provides searching by prefix.

+ + +

Unicode and UTF-8 Changes

+ +

Added several methods for checking characters forming +parts of XML 1.0 or XML 1.1 names: +raptor_unicode_is_xml10_namestartchar, +raptor_unicode_is_xml11_namestartchar, +raptor_unicode_is_xml10_namechar and +raptor_unicode_is_xml11_namechar. +

+ +

Added a function raptor_utf8_check to check that a +string is legal UTF-8 and all the encoded Unicode characters are in +the range U+0 <= character <= U+10FFFF

+ +

Added a function raptor_xml_name_check to check that +a string is a legal XML name (1.0 or 1.1) as well as legal UTF-8.

+ + +

Other Changes

+ +

Feature support: Added raptor_feature_value_type to +determine value of a feature - either integer (most) or string.

+ +

XML QName class: Added raptor_qname_copy copy +constructor.

+ +

Sequence class: Added raptor_sequence_join +to join two sequences of items, leaving one empty.

+ +

Statement class: Added raptor_statement_copy copy +constructor and raptor_free_statement destructor. +Previously these were internal to raptor.

+ +

The rapper utility was modified to add a feature form: +-f xmlns:PREFIX="URI" +allowing the setting of output serializer namespaces.

+ +

The namespace URI string constants exported by raptor are now of +type unsigned char*.

+ + +

Raptor 1.4.2 Changes

+ +

Make raptor_xml_escape_string fail correctly when +given bad UTF-8 to escape.

+ + +

Raptor 1.4.1 Changes

+ +

Fixed a buffer overrun in decoding a URI scheme in +raptor_uri constructors such as +raptor_new_uri.

+ +

Fixed a crash in RSS enclosures crash when the url +attribute seen on a non-<enclosure> element

+ +

raptor_xml_escape_string return value has changed to +be an int, returning <0 on failure. This allows the empty string +encoding an empty string case to work and be distinguished from an +error. +

+ + +

Raptor 1.4.0 Changes

+ +

A release with the major new feature of providing serializing of +RDF triples to syntaxes. It also added a new support class for I/O +streams and had other minor fixes.

+ +

Added a Raptor Serializer class (raptor_serializer) +with similar style to Parser (raptor_parser). Two +serializers are provided, for RDF/XML and N-Triples. The serializing +can be done to files, C FILE* or to strings. The +raptor_iostream class that provides this also allows writing +to any other form by creating a custom iostream. +

+ +

The new raptor_serializer class functions added are: +raptor_serializers_enumerate, +raptor_serializer_syntax_name_check, +raptor_new_serializer, +raptor_free_serializer, +raptor_serialize_start, +raptor_serialize_start_to_filename, +raptor_serialize_start_to_string, +raptor_serialize_start_to_file_handle, +raptor_serialize_statement, +raptor_serialize_end, +raptor_serializer_get_iostream, +raptor_serializer_set_error_handler, +raptor_serializer_set_warning_handler and +raptor_serializer_get_locator +

+ +

Added a Raptor I/O stream abstraction in +raptor_iostream class to support serializing of RDF to +multiple output streams such as to filenames, to C standard I/O +FILE* handles and to strings especially for +cross-language use. A raptor_iostream_handler can +be used to construct a user-defined iostream. +

+ +

The new raptor_iostream class functions added are: +raptor_new_iostream_from_handler, +raptor_new_iostream_to_sink, +raptor_new_iostream_to_filename, +raptor_new_iostream_to_file_handle, +raptor_new_iostream_to_string, +raptor_free_iostream, +raptor_iostream_write_bytes, +raptor_iostream_write_byte, +raptor_iostream_write_end, +raptor_iostream_write_string, +raptor_iostream_write_counted_string, +raptor_iostream_get_bytes_written_count, +raptor_iostream_write_decimal and +raptor_iostream_format_hexadecimal. +

+ + +

The rapper utility was modified to use serializer +class so that the output formats supported are now N-Triples +(-o ntriples) - the default, and RDF/XML (-o +rdfxml).

+ + +

Raptor now exports more static namespace URI strings for +general application use: +raptor_xml_namespace_uri, +raptor_rdf_namespace_uri, +raptor_rdf_schema_namespace_uri, +raptor_xmlschema_datatypes_namespace_uri, +raptor_owl_namespace_uri, +and the length +raptor_rdf_namespace_uri_len. +

+ +

The raptor_stringbuffer class gained a new method +raptor_stringbuffer_copy_to_string +which allows efficient copy-out of a constructed string. +

+ +

The raptor_www class gained a new method +raptor_www_fetch_to_string to allow retrieving of +web content as a single string. +

+ +

RSS tag soup parser gained support for generating triples for +enclosures, after a patch from Suzan Foster. Changes made include +correcting the enclosures namespace and tidying some memory leaks. +

+ + +

Raptor 1.3.3 Changes

+ +

A release with major improvements along with several minor fixes.

+ +

Raptor's License was changed from LGPL 2.1/MPL 1.1 to +LGPL 2.1/Apache 2

+ +

Thanks to Chris Pointon for several patches to make Raptor +easier to build under Win32 which were applied, with some slight +modifications.

+ +

Increased WWW content retrieval buffer size from 256 bytes to 4K +since this was causing problems for even moderate size documents.

+ +

After testing raptor on a very large RDF/XML file with many +rdf:ID values, the check for duplicate values was found +to be inefficient in memory and slow. The implementation was +improved to be more memory efficient and a new parser feature +check_rdf_id was added to disable checking (default is +enabled).

+ +

Added a new Unicode NFC checker to replace the functionality +formally available by calling the GNOME glib function +g_utf8_normalize. This new checker is done via several tables and +adds approximately 50K to the object size of the library when +compiled on x86. This code and tables can be disabled with configure +option --disable-nfc-check causing all checks to +succeed.

+ +

Fix the exporting of +raptor_xml_literal_datatype_uri_string and +raptor_xml_literal_datatype_uri_string_len as constants +for use by applications. Previously raptor.h wasn't doing this +correctly.

+ +

Added raptor_calloc_memory for allocating zeroed +memory inside raptor, for use by applications passing memory in/out +of raptor.

+ +

Added a new configure option --enable-parsers to +allow the selection of the required RDF parsers from any of those +supported (RDF/XML, Turtle, N-Triples, RSS tag soup). +

+ +

Reorganised the sources to split parsing support from RDF/XML +to support compiling without this parser.

+ +

Updated the RSS Tag Soup parser to start to handle the Atom 0.3 +currently being standardised by the +IETF Atom Publishing Format and Protocol +working group. +

+ +

Altered the Turtle parser to work with large source documents that +exceeded bison limits. Thanks to Geoff Chappell for providing a fix for +this.

+ +

Rewrote the URI parsing to create an internal structure and +improved the relative URI resolving in preparation for future work +such as potentially supporting URI canonicalisation such as proposed +to be used by Atom.

+ + +

Raptor 1.3.2 Changes

+ +

A release with some minor fixes.

+ +

Added a new configure option +--with-expat-source=DIR +to allow the use of external expat source trees in either the old or +newer directory structure style. (Patch from Mark Smith).

+ +

Added raptor_alloc_memory for handlers that need to +allocate memory in the same heap as raptor uses for +raptor_free_memory. This is mostly useful for allocating +memory that is freed by raptor in error, ID and statement handlers +on win32 which has separate heaps for different DLLs.

+ +

A bug was fixed where errors which happened when fetching WWW +content were always printed to stderr. They are now passed to the +main error routines which allows applications to retrieve them.

+ +

Accessor functions were added for parts of the public +raptor_locator structure which makes it possible to get +structured error information from language bindings via Redland +(Patch from Edd Dumbill). The new functions are:

+ +
    +
  • int raptor_locator_line(raptor_locator *locator);
  • +
  • int raptor_locator_column(raptor_locator *locator);
  • +
  • int raptor_locator_byte(raptor_locator *locator);
  • +
  • const char * raptor_locator_file(raptor_locator *locator);
  • +
  • const char * raptor_locator_uri(raptor_locator *locator);
  • +
+ +

The Unicode Normal Form C (NFC) checking via the GNOME glib +library function g_utf8_normalize is broken, comparing +the data it says is failed against other NFC checkers. It is also +slower than need be since it is doing full normalizing rather than +just checking for NFC, and adds a rather large dependency for just +one function. A new portable checker will be added in a later +release.

+ + + + +

Raptor 1.3.1 Changes

+ +

A release primarily to fix some win32 and portability issues.

+ +

raptor.h now includes stdarg.h

+ +

Corrected the raptor_print_statement declaration in +raptor.h for the argument statement to have one less 'const' which +matches the actual code.

+ +

Made several portability fixes for compiling natively on win32 +which doesn't quite do POSIX or C99.

+ +

Changed the support for file: URIs and converting to and from +filenames. It now %-escapes spaces and % characters on conversion +to and from filenames with +raptor_uri_uri_string_to_filename, +raptor_uri_uri_string_to_filename_fragment +and +raptor_uri_filename_to_uri_string. +For Win32, more tests were added and the +format of URIs supported corrected to use the file:///c: +form rather than file://c|/

+ +

URIs that resolve to directories now return an error when lstat is +available to check.

+ + + +

Parser Changes

+ +

The +Turtle +parser was updated to only allow language with non-datatyped literals, +allow a '_' immediately after a ':' in qnames and to make a bare ':' +qname work correctly. +

+ +

The Turtle parser was fixed to re-initialise correctly when +performing multiple parsings. The other parsers already did this +correctly.

+ +

Added a warning to the RDF/XML parser for unknown +rdf:parseType values, when parsing in lax mode - which +is the default. It now tells the user when the parsing is working as +'Literal' mode by finding an unknown value. This is controlled by a +new parser feature warn_other_parsetypes which is default set true +in lax mode. Parser modes are controlled by the +raptor_set_parser_strict method.

+ + + +

Raptor 1.3.0 Changes

+ +

A release primarily to provide support for +the new Rasqal +RDF query library but with some new features and fixes.

+ + +

Parser Changes

+ +

Added a new constructor + raptor_new_parser_for_content to guess the parser to use +from hints in URIs or content, using a new utility function +raptor_guess_parser_name.

+ +

Additional checks were added to the RDF/XML parser for +RDF-namespaced names in element and attributes and if they are +forbidden giving an error otherwise if unknown, giving a warning.

+ +

The +Turtle +parser was updated to correct the collections syntax, allow '-' in +names and QNames and to add integer literals. This parser now correctly +uses raptor_generate_id when a blank identifier name is +needed.

+ +

Completed parser feature support by adding raptor_get_feature, +raptor_feature_from_uri, and +raptor_features_enumerate to get values and enable +discovery of supported features at run time. +raptor_set_feature was changed to give return a success +value

+ +

Added a new method raptor_get_mime_type to get the +MIME type of the syntax for a parser

+ +

raptor_parse_uri_with_connection (which is called by +raptor_parse_uri) now sets the HTTP Accept: +header to the MIME type of the parser in WWW requests using the new +raptor_www_set_http_accept(). +

+ + +

rapper changes

+ +

Added options -f/--feature for setting +features and -g/--guess for guessing syntax +from some content or identifiers. See rapper(1) +for all rapper options.

+ + +

Utility function changes

+ +

Added raptor_syntax_name_check to check for valid +syntax language names.
+

+ +

Added raptor_free_memory to free memory returned by +raptor functions.

+ +

Added Unicode utility functions raptor_unicode_char_to_utf8 and +raptor_utf8_to_unicode_char.

+ +

Exported URI string raptor_xml_literal_datatype_uri_string.

+ +

Deprecated raptor_print_statement_detailed always +intended to be internal.

+ + +

WWW Class changes

+ +

Added support to set the HTTP Accept: header for curl +and libxml2 when retrieving HTTP content by the new +raptor_www_set_http_accept method. +

+ + +

New classes - Sequence and Stringbuffer

+ +

Added a utility class raptor_sequence providing +simple sequences that can handle stacks and queues

+ +

Added a utility class raptor_stringbuffer +for constructing strings from substrings appended or prepended.

+ + + +

Raptor 0.9.0 - Raptor 1.2.0 Changes

+ +

Release notes for 1.2.0 and earlier are in the +NEWS page or +ChangeLog +

+ + + +
+ +

Copyright (C) 2003-2023 Dave Beckett
Copyright (C) 2003-2005 University of Bristol

+ + + diff --git a/UPGRADING.html b/UPGRADING.html new file mode 100644 index 0000000..98f187f --- /dev/null +++ b/UPGRADING.html @@ -0,0 +1,159 @@ + + + + + Raptor RDF Syntax Library - Upgrading to the Raptor V2 API + + + +

Raptor RDF Syntax Library - Upgrading to the Raptor V2 API

+ +

Raptor V2 is a major new version of the Raptor V1 API with many +cleanups and changes that include adding, removing and re-ordering +parameters, adding and removing return types as well as renaming the +functions. +

+ +

The headers and libraries install to different places or names so +that Raptor V1 and Raptor V2 can both be present (including headers) +on the same system without clashing. However, if you do try linking +the same binary with both libraries, the symbols will clash and the +program will fail in mysterious ways if it runs at all. There are +only two installed files that overlap - the rapper +utility and it's manual page. +

+ + +

Configuration and compiling changes

+ +

Raptor V2 uses pkg-config(1) to provide the compile +and link parameters whereas Raptor V1 supports that as well as a +script raptor-config. The recommended linking approach +is now as follows: +

+
+  cc -o prog prog.c  `pkg-config raptor2 --cflags` `pkg-config raptor2 --libs`
+
+

Shown here as a compile in link all in one line but you typically +split that into two stages. +

+
+  cc -c `pkg-config raptor2 --cflags` raptor-module.c
+  ...
+  cc -o prog raptor-module.c ... other modules ... `pkg-config raptor2 --libs`
+
+ + +

Code changes

+ +

There are significant API changes, which are described in the +Release Notes in long summary form with +some background to why, in the ChangeLog in +very long form. The reference manual contains +a section +describing what was added, deleted, renamed and otherwise changed for +both the functions exported from the library, as well as the +typedefs and enum values. +

+ +

There is no fully automatic way to handle updating the code +however there is a perl script provided in the docs directory that +renames what it can, and otherwise inserts a WARNING comment near +code that needs manual updating. This cannot be automated in some +places such as when the fields of the raptor_statement object were +replaced with raptor_term pointers. The script is used like +perl docs/upgrade-script.pl source files for example

+
+  $ perl docs/upgrade-script.pl prog.c
+
+ +

and then edit the file prog.c and search for WARNING: +for any places that manual editing is needed. +

+ + +

Handling Raptor V1 or Raptor V2 in the same code

+ +

If you need to handle both APIs in the same codebase as +alternatives, it is recommended that you use the following approach. +

+ +

+Create an application #define that records the choice of +which API you want to use. You can do this triggered on whichever +raptor.h is in the include path by #ifdef +RAPTOR_V2_AVAILABLE but that may be dangerous if both +libraries and headers are present. A better choice is an application +specific define that is determined by a configuration step. +

+ +

Once the choice is made, it is recommended you convert the +code to the Raptor V2 API and then add backwards-compatible macros +for the changed functions: +

+ +
+#ifdef APP_WANTS_RAPTOR_V2
+/* nop */
+
+#else
+#define raptor_v2_function(arg1, arg2, arg3) raptor_v1_function(arg2, arg3)
+
+#endif
+
+ +

Where the code cannot be done by simple expansion such as use of +raptor_init() and raptor_finish() in V1 +that are replaced by the functions around the world object in V2, use +an #ifdef that provides the two code paths. +

+ +

rasqal +in GIT (will be 0.9.20) uses this approach. +

+ +

Another approach if the Raptor V1 code is in a separate module / +source file is to copy it and make a V2 version and then choose the +file to use at configure or build time. +

+ +

librdf 1.0.11 uses this approach. +

+ +

Either way, basing the interface on the V2 APIs makes it clear +what to remove when V1 is no longer supported. +

+ + +

Packaging recommendations for distributors

+ +

Since Raptor V2 probably needs to be installed in parallel with V1 +for some time, at least for the different libraries and headers, both +need to be packaged such that no files clash. +

+ +

There are, however, two files that are shared after a 'make install': +rapper(1) and rapper.1 the manual page. +

+ +

For packaging systems that split the installation into multiple +packages (libraries, headers, docs, debug files), these two files +should be in a package of their own that replace and conflict with +the earlier files. (This is what I have done with the Debian +packages raptor-utils and raptor2-utils). For packaging systems that +do not use multiple packages, you will have to either leave these +files out of the V2 package or migrate them from the V1 package to +the V2 package using dependencies to ensure there are no conflicts. +

+ +

The advantage of making the V2 version of rapper is that it means +the command-line utility under the well known name uses the latest +Raptor code. +

+ +
+ +

Copyright 2010-2023 Dave Beckett

+ + + diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..0c69179 --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,1253 @@ +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. + +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) + +# Copyright (C) 2002-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.16' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.16.5], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.16.5])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# Copyright (C) 2011-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_AR([ACT-IF-FAIL]) +# ------------------------- +# Try to determine the archiver interface, and trigger the ar-lib wrapper +# if it is needed. If the detection of archiver interface fails, run +# ACT-IF-FAIL (default is to abort configure with a proper error message). +AC_DEFUN([AM_PROG_AR], +[AC_BEFORE([$0], [LT_INIT])dnl +AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([ar-lib])dnl +AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) +: ${AR=ar} + +AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], + [AC_LANG_PUSH([C]) + am_cv_ar_interface=ar + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], + [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([am_ar_try]) + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + ]) + AC_LANG_POP([C])]) + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + m4_default([$1], + [AC_MSG_ERROR([could not determine $AR interface])]) + ;; +esac +AC_SUBST([AR])dnl +]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is '.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + + +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if( + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl +]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST([install_sh])]) + +# Copyright (C) 2003-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAKE_INCLUDE() +# ----------------- +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. +AC_DEFUN([AM_MAKE_INCLUDE], +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + AC_MSG_WARN(['missing' script is too old or missing]) +fi +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) + +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) + +# Copyright (C) 2009-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_SILENT_RULES([DEFAULT]) +# -------------------------- +# Enable less verbose build rules; with the default set to DEFAULT +# ("yes" being less verbose, "no" or empty being verbose). +AC_DEFUN([AM_SILENT_RULES], +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +esac +dnl +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) +dnl do not support nested variable expansions. +dnl See automake bug#9928 and bug#10237. +am_make=${MAKE-make} +AC_CACHE_CHECK([whether $am_make supports nested variables], + [am_cv_make_support_nested_variables], + [if AS_ECHO([['TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi]) +if test $am_cv_make_support_nested_variables = yes; then + dnl Using '$V' instead of '$(V)' breaks IRIX make. + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AC_SUBST([AM_V])dnl +AM_SUBST_NOTMAKE([AM_V])dnl +AC_SUBST([AM_DEFAULT_V])dnl +AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl +AC_SUBST([AM_DEFAULT_VERBOSITY])dnl +AM_BACKSLASH='\' +AC_SUBST([AM_BACKSLASH])dnl +_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl +]) + +# Copyright (C) 2001-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor 'install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in "make install-strip", and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +# +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' + +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done + rm -rf conftest.dir + + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([build/gtk-doc.m4]) +m4_include([build/libtool.m4]) +m4_include([build/ltoptions.m4]) +m4_include([build/ltsugar.m4]) +m4_include([build/ltversion.m4]) +m4_include([build/lt~obsolete.m4]) +m4_include([build/pkg.m4]) diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..f68d661 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,434 @@ +#!/bin/sh +# +# autogen.sh - Generates initial makefiles from a pristine source tree +# +# USAGE: +# autogen.sh [configure options] +# +# Configuration is affected by environment variables as follows: +# +# DRYRUN +# If set to any value it will do no configuring but will emit the +# programs that would be run. +# e.g. DRYRUN=1 ./autogen.sh +# +# NOCONFIGURE +# If set to any value it will generate all files but not invoke the +# generated configure script. +# e.g. NOCONFIGURE=1 ./autogen.sh +# +# AUTOMAKE ACLOCAL AUTOCONF AUTOHEADER LIBTOOLIZE GTKDOCIZE +# If set (named after program) then this overrides any searching for +# the programs on the current PATH. +# e.g. AUTOMAKE=automake-1.7 ACLOCAL=aclocal-1.7 ./autogen.sh +# +# CONFIG_DIR (default ../config) +# The directory where fresh GNU config.guess and config.sub can be +# found for automatic copying in-place. +# +# PATH +# Where the programs are searched for +# +# SRCDIR (default .) +# Source directory +# +# This script is based on similar scripts used in various tools +# commonly made available via CVS and used with GNU automake. +# Try 'locate autogen.sh' on your system and see what you get. +# +# This script is in the public domain +# + +# Directory for the sources +SRCDIR=${SRCDIR-.} + +# Where the GNU config.sub, config.guess might be found +CONFIG_DIR=${CONFIG_DIR-../config} + +# GIT sub modules file +GITMODULES='.gitmodules' + +# The programs required for configuring which will be searched for +# in the current PATH. +# Set an envariable of the same name in uppercase, to override scan +# +programs="automake aclocal autoconf autoheader libtoolize" +confs=`find . -name configure.ac -print | grep -v /releases/` + +gtkdoc_args= +if grep "^GTK_DOC_CHECK" $confs >/dev/null; then + programs="$programs gtkdocize" + gtkdoc_args="--enable-gtk-doc" +fi +if grep "^AC_CHECK_PROGS.SWIG" $confs >/dev/null; then + programs="$programs swig" +fi +ltdl_args= +if grep "^AC_LIBLTDL_" $confs >/dev/null; then + ltdl_args="--ltdl" +fi +silent_args= +if grep "^AM_SILENT_RULES" $confs >/dev/null; then + silent_args="--enable-silent-rules" +fi + +# Some dependencies for autotools: +# automake 1.13 requires autoconf 2.65 +# automake 1.12 requires autoconf 2.62 +# automake 1.11 requires autoconf 2.62 (needed for AM_SILENT_RULES) +automake_min_vers=011102 +aclocal_min_vers=$automake_min_vers +autoconf_min_vers=026200 +autoheader_min_vers=$autoconf_min_vers +# libtool 2.2 required for LT_INIT language fix +libtoolize_min_vers=020200 +gtkdocize_min_vers=010300 +swig_min_vers=010324 + +# Default program arguments +automake_args="--gnu --add-missing --force --copy -Wall" +aclocal_args="-Wall" +autoconf_args="-Wall" +libtoolize_args="--force --copy --automake $ltdl_args" +gtkdocize_args="--copy" +# --enable-gtk-doc does no harm if it's not available +configure_args="--enable-maintainer-mode $gtkdoc_args $silent_args" + + +# You should not need to edit below here +###################################################################### + + +# number comparisons may need a C locale +LANG=C +LC_NUMERIC=C + + +program=`basename $0` + +if test "X$DRYRUN" != X; then + DRYRUN=echo +fi + +cat > autogen-get-version.pl <&1 |") || next; + while() { + chomp; + next if @vnums; # drain pipe if we got a vnums + # Add optional leading g + next unless /^g?\$mname/i; + my(\$v)=/(\S+)\$/i; \$v =~ s/-.*\$//; + @vnums=grep { defined \$_ && !/^\s*\$/} map { s/\D//g; \$_; } split(/\./, \$v); + } + close(PIPE); + last if @vnums; +} + +@vnums=(@vnums, 0, 0, 0)[0..2]; +\$vn=join('', map { sprintf('%02d', \$_) } @vnums); +print "\$vn\n"; +exit 0; +EOF + +autogen_get_version="`pwd`/autogen-get-version.pl" + +trap "rm -f $autogen_get_version" 0 1 9 15 + + +update_prog_version() { + dir=$1 + prog=$2 + + # If there exists an envariable PROG in uppercase, use that and do not scan + ucprog=`echo $prog | tr 'a-z' 'A-Z' ` + eval env=\$${ucprog} + if test X$env != X; then + prog_name=$env + prog_vers=`perl $autogen_get_version $prog_name $prog` + + if test X$prog_vers = X; then + prog_vers=0 + fi + eval ${prog}_name=${prog_name} + eval ${prog}_vers=${prog_vers} + eval ${prog}_dir=environment + return + fi + + eval prog_name=\$${prog}_name + eval prog_vers=\$${prog}_vers + eval prog_dir=\$${prog}_dir + if test X$prog_vers = X; then + prog_vers=0 + fi + + save_PATH="$PATH" + + cd "$dir" + PATH=".:$PATH" + + nameglob="$prog*" + if [ -x /usr/bin/uname ]; then + if [ `/usr/bin/uname` = 'Darwin' -a $prog = 'libtoolize' ] ; then + nameglob="g$nameglob" + fi + fi + names=`ls $nameglob 2>/dev/null` + if [ "X$names" != "X" ]; then + for name in $names; do + vers=`perl $autogen_get_version $dir/$name $prog` + if [ "X$vers" = "X" ]; then + continue + fi + + if expr $vers '>' $prog_vers >/dev/null; then + prog_name=$name + prog_vers=$vers + prog_dir="$dir" + fi + done + fi + + eval ${prog}_name=${prog_name} + eval ${prog}_vers=${prog_vers} + eval ${prog}_dir=${prog_dir} + + PATH="$save_PATH" +} + + +check_prog_version() { + prog=$1 + + eval min=\$${prog}_min_vers + + eval prog_name=\$${prog}_name + eval prog_vers=\$${prog}_vers + eval prog_dir=\$${prog}_dir + + echo "$program: $prog program '$prog_name' V $prog_vers (min $min) in $prog_dir" 1>&2 + + rc=1 + if test $prog_vers != 0; then + if expr $prog_vers '<' $min >/dev/null; then + echo "$program: ERROR: \`$prog' version $prog_vers in $prog_dir is too old." + echo " (version $min or newer is required)" + rc=0 + else + # Things are ok, so set the ${prog} name + eval ${prog}=${prog_name} + fi + else + echo "$program: ERROR: You must have \`$prog' installed to compile this package." + echo " (version $min or newer is required)" + rc=0 + fi + + return $rc +} + + +# Find newest version of programs in the current PATH +save_args=${1+"$*"} +save_ifs="$IFS" +IFS=":" +set - $PATH +IFS="$save_ifs" + +echo "$program: Looking for programs: $programs" + +here=`pwd` +while [ $# -ne 0 ] ; do + dir=$1 + shift + if [ ! -d "$dir" ]; then + continue + fi + + for prog in $programs; do + update_prog_version "$dir" $prog + done +done +cd $here + +set - $save_args +# END Find programs + + +# Check the versions meet the requirements +for prog in $programs; do + if check_prog_version $prog; then + exit 1 + fi +done + +echo "$program: Dependencies satisfied" + +if test -d $SRCDIR/libltdl; then + touch $SRCDIR/libltdl/NO-AUTO-GEN +fi + +config_dir= +if test -d $CONFIG_DIR; then + config_dir=`cd $CONFIG_DIR; pwd` +fi + + +# Initialise and/or update GIT submodules +if test -f $GITMODULES ; then + echo " " + modules=`sed -n -e 's/^.*path = \(.*\)/\1/p' $GITMODULES` + for module in $modules; do + if test `ls -1 $module | wc -l` -eq 0; then + echo "$program: Initializing git submodule in $module" + $DRYRUN git submodule init $module + fi + done + echo "$program: Updating git submodules: $modules" + $DRYRUN git submodule update +fi + +for coin in `find $SRCDIR -name configure.ac -print | grep -v /releases/` +do + status=0 + dir=`dirname $coin` + if test -f "$dir/NO-AUTO-GEN"; then + echo "$program: Skipping $dir -- flagged as no auto-generation" + else + echo " " + echo $program: Processing directory $dir + ( cd "$dir" + + # Ensure that these are created by the versions on this system + # (indirectly via automake) + $DRYRUN rm -f ltconfig ltmain.sh libtool stamp-h* + # Made by automake + $DRYRUN rm -f missing depcomp + # automake junk + $DRYRUN rm -rf autom4te*.cache + + config_macro_dir=`sed -ne 's/^AC_CONFIG_MACRO_DIR(\([^)]*\).*/\1/p' configure.ac` + if test "X$config_macro_dir" = X; then + config_macro_dir=. + else + aclocal_args="$aclocal_args -I $config_macro_dir " + fi + + config_aux_dir=`sed -ne 's/^AC_CONFIG_AUX_DIR(\([^)]*\).*/\1/p' configure.ac` + if test "X$config_aux_dir" = X; then + config_aux_dir=. + fi + + if test "X$config_dir" != X; then + echo "$program: Updating config.guess and config.sub" + for file in config.guess config.sub; do + cfile=$config_dir/$file + xfile=$config_aux_dir/$file + if test -f $cfile; then + $DRYRUN rm -f $xfile + $DRYRUN cp -p $cfile $xfile + fi + done + fi + + echo "$program: Running $libtoolize $libtoolize_args" + $DRYRUN rm -f ltmain.sh libtool + eval $DRYRUN $libtoolize $libtoolize_args + status=$? + if test $status != 0; then + break + fi + + if grep "^GTK_DOC_CHECK" configure.ac >/dev/null; then + # gtkdocize junk + $DRYRUN rm -rf gtk-doc.make + echo "$program: Running $gtkdocize $gtkdocize_args" + $DRYRUN $gtkdocize $gtkdocize_args + status=$? + if test $status != 0; then + break + fi + fi + + for docs in NEWS README; do + if test ! -f $docs; then + echo "$program: Creating empty $docs file to allow configure to work" + $DRYRUN touch -t 200001010000 $docs + fi + done + + echo "$program: Running $aclocal $aclocal_args" + $DRYRUN $aclocal $aclocal_args + if grep "^A[CM]_CONFIG_HEADER" configure.ac >/dev/null; then + echo "$program: Running $autoheader" + $DRYRUN $autoheader + status=$? + if test $status != 0; then + break + fi + fi + echo "$program: Running $automake $automake_args" + $DRYRUN $automake $automake_args + status=$? + if test $status != 0; then + break + fi + + echo "$program: Running $autoconf $autoconf_args" + $DRYRUN $autoconf $autoconf_args + status=$? + if test $status != 0; then + break + fi + ) + fi + + if test $status != 0; then + echo "$program: FAILED to configure $dir" + exit $status + fi + +done + + + +rm -f config.cache + +AUTOMAKE=$automake +AUTOCONF=$autoconf +ACLOCAL=$aclocal +export AUTOMAKE AUTOCONF ACLOCAL + +if test "X$NOCONFIGURE" = X; then + echo " " + if test -z "$*"; then + echo "$program: WARNING: Running \`configure' with no arguments." + echo "If you wish to pass any to it, please specify them on the" + echo "\`$program' command line." + fi + + echo "$program: Running ./configure $configure_args $@" + if test "X$DRYRUN" = X; then + $DRYRUN ./configure $configure_args "$@" \ + && echo "$program: Now type \`make' to compile this package" || exit 1 + else + $DRYRUN ./configure $configure_args "$@" + fi +fi + +exit $status diff --git a/build/ar-lib b/build/ar-lib new file mode 100755 index 0000000..c349042 --- /dev/null +++ b/build/ar-lib @@ -0,0 +1,271 @@ +#! /bin/sh +# Wrapper for Microsoft lib.exe + +me=ar-lib +scriptversion=2019-07-04.01; # UTC + +# Copyright (C) 2010-2021 Free Software Foundation, Inc. +# Written by Peter Rosin . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + + +# func_error message +func_error () +{ + echo "$me: $1" 1>&2 + exit 1 +} + +file_conv= + +# func_file_conv build_file +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv in + mingw) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin | msys) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_at_file at_file operation archive +# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE +# for each of them. +# When interpreting the content of the @FILE, do NOT use func_file_conv, +# since the user would need to supply preconverted file names to +# binutils ar, at least for MinGW. +func_at_file () +{ + operation=$2 + archive=$3 + at_file_contents=`cat "$1"` + eval set x "$at_file_contents" + shift + + for member + do + $AR -NOLOGO $operation:"$member" "$archive" || exit $? + done +} + +case $1 in + '') + func_error "no command. Try '$0 --help' for more information." + ;; + -h | --h*) + cat <. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build/config.guess b/build/config.guess new file mode 100755 index 0000000..7f76b62 --- /dev/null +++ b/build/config.guess @@ -0,0 +1,1754 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright 1992-2022 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). +# +# Originally written by Per Bothner; maintained since 2000 by Ben Elliston. +# +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess +# +# Please send patches to . + + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright 1992-2022 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +# Just in case it came from the environment. +GUESS= + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +case $UNAME_SYSTEM in +Linux|GNU|GNU/*) + LIBC=unknown + + set_cc_for_build + cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #elif defined(__GLIBC__) + LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif + #endif + EOF + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu + fi + ;; +esac + +# Note: order is significant - the case branches are not exclusive. + +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + echo unknown)` + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine=${arch}${endian}-unknown + ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. + case $UNAME_MACHINE_ARCH in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # Determine ABI tags. + case $UNAME_MACHINE_ARCH in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case $UNAME_VERSION in + Debian*) + release='-gnu' + ;; + *) + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + GUESS=$machine-${os}${release}${abi-} + ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; + *:ekkoBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; + *:SolidBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; + macppc:MirBSD:*:*) + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; + *:MirBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; + *:Sortix:*:*) + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; + alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case $ALPHA_CPU_TYPE in + "EV4 (21064)") + UNAME_MACHINE=alpha ;; + "EV4.5 (21064)") + UNAME_MACHINE=alpha ;; + "LCA4 (21066/21068)") + UNAME_MACHINE=alpha ;; + "EV5 (21164)") + UNAME_MACHINE=alphaev5 ;; + "EV5.6 (21164A)") + UNAME_MACHINE=alphaev56 ;; + "EV5.6 (21164PC)") + UNAME_MACHINE=alphapca56 ;; + "EV5.7 (21164PC)") + UNAME_MACHINE=alphapca57 ;; + "EV6 (21264)") + UNAME_MACHINE=alphaev6 ;; + "EV6.7 (21264A)") + UNAME_MACHINE=alphaev67 ;; + "EV6.8CB (21264C)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8AL (21264B)") + UNAME_MACHINE=alphaev68 ;; + "EV6.8CX (21264D)") + UNAME_MACHINE=alphaev68 ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE=alphaev69 ;; + "EV7 (21364)") + UNAME_MACHINE=alphaev7 ;; + "EV7.9 (21364A)") + UNAME_MACHINE=alphaev79 ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; + Amiga*:UNIX_System_V:4.0:*) + GUESS=m68k-unknown-sysv4 + ;; + *:[Aa]miga[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; + *:[Mm]orph[Oo][Ss]:*:*) + GUESS=$UNAME_MACHINE-unknown-morphos + ;; + *:OS/390:*:*) + GUESS=i370-ibm-openedition + ;; + *:z/VM:*:*) + GUESS=s390-ibm-zvmoe + ;; + *:OS400:*:*) + GUESS=powerpc-ibm-os400 + ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + GUESS=arm-unknown-riscos + ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + GUESS=hppa1.1-hitachi-hiuxmpp + ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; + NILE*:*:*:dcosx) + GUESS=pyramid-pyramid-svr4 + ;; + DRS?6000:unix:4.0:6*) + GUESS=sparc-icl-nx6 + ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; + s390x:SunOS:*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; + sun4H:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH=x86_64 + fi + fi + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; + sun4*:SunOS:*:*) + case `/usr/bin/arch -k` in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; + sun3*:SunOS:*:*) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in + sun3) + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; + sun4) + GUESS=sparc-sun-sunos$UNAME_RELEASE + ;; + esac + ;; + aushp:SunOS:*:*) + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; + m68k:machten:*:*) + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; + powerpc:machten:*:*) + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; + RISC*:Mach:*:*) + GUESS=mips-dec-mach_bsd4.3 + ;; + RISC*:ULTRIX:*:*) + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; + VAX*:ULTRIX*:*:*) + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; + Motorola:PowerMAX_OS:*:*) + GUESS=powerpc-motorola-powermax + ;; + Motorola:*:4.3:PL8-*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + GUESS=powerpc-harris-powermax + ;; + Night_Hawk:Power_UNIX:*:*) + GUESS=powerpc-harris-powerunix + ;; + m88k:CX/UX:7*:*) + GUESS=m88k-harris-cxux7 + ;; + m88k:*:4*:R4*) + GUESS=m88k-motorola-sysv4 + ;; + m88k:*:3*:R3*) + GUESS=m88k-motorola-sysv3 + ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x + then + GUESS=m88k-dg-dgux$UNAME_RELEASE + else + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE + fi + else + GUESS=i586-dg-dgux$UNAME_RELEASE + fi + ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + GUESS=m88k-dolphin-sysv3 + ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + GUESS=m88k-motorola-sysv3 + ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + GUESS=m88k-tektronix-sysv3 + ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + GUESS=m68k-tektronix-bsd + ;; + *:IRIX*:*:*) + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + GUESS=i386-ibm-aix + ;; + ia64:AIX:*:*) + if test -x /usr/bin/oslevel ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + GUESS=$SYSTEM_NAME + else + GUESS=rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + GUESS=rs6000-ibm-aix3.2.4 + else + GUESS=rs6000-ibm-aix3.2 + fi + ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE + fi + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; + *:AIX:*:*) + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + GUESS=rs6000-bull-bosx + ;; + DPX/2?00:B.O.S.:*:*) + GUESS=m68k-bull-sysv3 + ;; + 9000/[34]??:4.3bsd:1.*:*) + GUESS=m68k-hp-bsd + ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + GUESS=m68k-hp-bsd4.4 + ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if test -x /usr/bin/getconf; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case $sc_cpu_version in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case $sc_kernel_bits in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if test "$HP_ARCH" = hppa2.0w + then + set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH=hppa2.0w + else + HP_ARCH=hppa64 + fi + fi + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; + 3050*:HI-UX:*:*) + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; + 9000/8??:4.3bsd:*:*) + GUESS=hppa1.0-hp-bsd + ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; + hp8??:OSF1:*:*) + GUESS=hppa1.0-hp-osf + ;; + i*86:OSF1:*:*) + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk + else + GUESS=$UNAME_MACHINE-unknown-osf1 + fi + ;; + parisc*:Lites*:*:*) + GUESS=hppa1.1-hp-lites + ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + GUESS=c1-convex-bsd + ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + GUESS=c34-convex-bsd + ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + GUESS=c38-convex-bsd + ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + GUESS=c4-convex-bsd + ;; + CRAY*Y-MP:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; + CRAY*[A-Z]90:*:*:*) + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; + CRAY*T3E:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; + CRAY*SV1:*:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; + *:UNICOS/mp:*:*) + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; + sparc*:BSD/OS:*:*) + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; + *:BSD/OS:*:*) + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case $UNAME_PROCESSOR in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; + i*:CYGWIN*:*) + GUESS=$UNAME_MACHINE-pc-cygwin + ;; + *:MINGW64*:*) + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; + *:MINGW*:*) + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; + *:MSYS*:*) + GUESS=$UNAME_MACHINE-pc-msys + ;; + i*:PW*:*) + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; + *:Interix*:*) + case $UNAME_MACHINE in + x86) + GUESS=i586-pc-interix$UNAME_RELEASE + ;; + authenticamd | genuineintel | EM64T) + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; + IA64) + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; + esac ;; + i*:UWIN*:*) + GUESS=$UNAME_MACHINE-pc-uwin + ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + GUESS=x86_64-pc-cygwin + ;; + prep*:SunOS:5.*:*) + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; + *:GNU:*:*) + # the GNU system + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; + aarch64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arm*:Linux:*:*) + set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi + else + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf + fi + fi + ;; + avr32*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + cris:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + crisv32:Linux:*:*) + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; + e2k:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + frv:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + hexagon:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:Linux:*:*) + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; + ia64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + k1om:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m32r*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + m68*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + mips:Linux:*:* | mips64:Linux:*:*) + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" + #undef CPU + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + MIPS_ENDIAN= + #else + MIPS_ENDIAN= + #endif + #endif +EOF + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + openrisc*:Linux:*:*) + GUESS=or1k-unknown-linux-$LIBC + ;; + or32:Linux:*:* | or1k*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + padre:Linux:*:*) + GUESS=sparc-unknown-linux-$LIBC + ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + GUESS=hppa64-unknown-linux-$LIBC + ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; + esac + ;; + ppc64:Linux:*:*) + GUESS=powerpc64-unknown-linux-$LIBC + ;; + ppc:Linux:*:*) + GUESS=powerpc-unknown-linux-$LIBC + ;; + ppc64le:Linux:*:*) + GUESS=powerpc64le-unknown-linux-$LIBC + ;; + ppcle:Linux:*:*) + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + s390:Linux:*:* | s390x:Linux:*:*) + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; + sh64*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sh*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + tile*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + vax:Linux:*:*) + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; + x86_64:Linux:*:*) + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; + xtensa*:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + GUESS=i386-sequent-sysv4 + ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; + i*86:XTS-300:*:STOP) + GUESS=$UNAME_MACHINE-unknown-stop + ;; + i*86:atheos:*:*) + GUESS=$UNAME_MACHINE-unknown-atheos + ;; + i*86:syllable:*:*) + GUESS=$UNAME_MACHINE-pc-syllable + ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; + i*86:*DOS:*:*) + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL + fi + ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL + else + GUESS=$UNAME_MACHINE-pc-sysv32 + fi + ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configure will decide that + # this is a cross-build. + GUESS=i586-pc-msdosdjgpp + ;; + Intel:Mach:3*:*) + GUESS=i386-pc-mach3 + ;; + paragon:*:*:*) + GUESS=i860-intel-osf1 + ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 + fi + ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + GUESS=m68010-convergent-sysv + ;; + mc68k:UNIX:SYSTEM5:3.51m) + GUESS=m68k-convergent-sysv + ;; + M680?0:D-NIX:5.3:*) + GUESS=m68k-diab-dnix + ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; + mc68030:UNIX_System_V:4.*:*) + GUESS=m68k-atari-sysv4 + ;; + TSUNAMI:LynxOS:2.*:*) + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; + rs6000:LynxOS:2.*:*) + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; + SM[BE]S:UNIX_SV:*:*) + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; + RM*:ReliantUNIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + RM*:SINIX-*:*:*) + GUESS=mips-sni-sysv4 + ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + GUESS=$UNAME_MACHINE-sni-sysv4 + else + GUESS=ns32k-sni-sysv + fi + ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + GUESS=i586-unisys-sysv4 + ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + GUESS=hppa1.1-stratus-sysv4 + ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + GUESS=i860-stratus-sysv4 + ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=$UNAME_MACHINE-stratus-vos + ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + GUESS=hppa1.1-stratus-vos + ;; + mc68*:A/UX:*:*) + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; + news*:NEWS-OS:6*:*) + GUESS=mips-sony-newsos6 + ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE + else + GUESS=mips-unknown-sysv$UNAME_RELEASE + fi + ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + GUESS=powerpc-be-beos + ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + GUESS=powerpc-apple-beos + ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + GUESS=i586-pc-beos + ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + GUESS=i586-pc-haiku + ;; + x86_64:Haiku:*:*) + GUESS=x86_64-unknown-haiku + ;; + SX-4:SUPER-UX:*:*) + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; + SX-5:SUPER-UX:*:*) + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; + SX-6:SUPER-UX:*:*) + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; + SX-7:SUPER-UX:*:*) + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; + SX-8:SUPER-UX:*:*) + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; + SX-8R:SUPER-UX:*:*) + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; + SX-ACE:SUPER-UX:*:*) + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; + Power*:Rhapsody:*:*) + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; + *:Rhapsody:*:*) + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build + fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE + fi + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = x86; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; + *:QNX:*:4*) + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; + NSE-*:NONSTOP_KERNEL:*:*) + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; + *:NonStop-UX:*:*) + GUESS=mips-compaq-nonstopux + ;; + BS2000:POSIX*:*:*) + GUESS=bs2000-siemens-sysv + ;; + DS/*:UNIX_System_V:*:*) + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "${cputype-}" = 386; then + UNAME_MACHINE=i386 + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype + fi + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; + *:TOPS-10:*:*) + GUESS=pdp10-unknown-tops10 + ;; + *:TENEX:*:*) + GUESS=pdp10-unknown-tenex + ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + GUESS=pdp10-dec-tops20 + ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + GUESS=pdp10-xkl-tops20 + ;; + *:TOPS-20:*:*) + GUESS=pdp10-unknown-tops20 + ;; + *:ITS:*:*) + GUESS=pdp10-unknown-its + ;; + SEI:*:*:SEIUX) + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; + *:DragonFly:*:*) + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; + esac ;; + *:XENIX:*:SysV) + GUESS=i386-pc-xenix + ;; + i*86:skyos:*:*) + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; + i*86:rdos:*:*) + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; + x86_64:VMkernel:*:*) + GUESS=$UNAME_MACHINE-unknown-esx + ;; + amd64:Isilon\ OneFS:*:*) + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" < +#include +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include +#if defined(_SIZE_T_) || defined(SIGLOST) +#include +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 <&2 </dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" +EOF +fi + +exit 1 + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build/config.sub b/build/config.sub new file mode 100755 index 0000000..dba16e8 --- /dev/null +++ b/build/config.sub @@ -0,0 +1,1890 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright 1992-2022 Free Software Foundation, Inc. + +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-03' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 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, see . +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). + + +# Please send patches to . +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS + +Canonicalize a configuration name. + +Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright 1992-2022 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo "$1" + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 + ;; + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 + ;; + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac + ;; + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac + ;; + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac + ;; +esac + +# Decode 1-component or ad-hoc basic machines +case $basic_machine in + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond + ;; + op50n) + cpu=hppa1.1 + vendor=oki + ;; + op60c) + cpu=hppa1.1 + vendor=oki + ;; + ibm*) + cpu=i370 + vendor=ibm + ;; + orion105) + cpu=clipper + vendor=highlevel + ;; + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple + ;; + pmac | pmac-mpw) + cpu=powerpc + vendor=apple + ;; + + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + cpu=m68000 + vendor=att + ;; + 3b*) + cpu=we32k + vendor=att + ;; + bluegene*) + cpu=powerpc + vendor=ibm + basic_os=cnk + ;; + decsystem10* | dec10*) + cpu=pdp10 + vendor=dec + basic_os=tops10 + ;; + decsystem20* | dec20*) + cpu=pdp10 + vendor=dec + basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + cpu=m68k + vendor=motorola + ;; + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 + ;; + encore | umax | mmax) + cpu=ns32k + vendor=encore + ;; + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} + ;; + fx2800) + cpu=i860 + vendor=alliant + ;; + genix) + cpu=ns32k + vendor=ns + ;; + h3050r* | hiux*) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + cpu=m68000 + vendor=hp + ;; + hp9k3[2-9][0-9]) + cpu=m68k + vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + cpu=hppa1.1 + vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + cpu=hppa1.0 + vendor=hp + ;; + i*86v32) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 + ;; + i*86v4*) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 + ;; + i*86v) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv + ;; + i*86sol2) + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 + ;; + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} + ;; + iris | iris4d) + cpu=mips + vendor=sgi + case $basic_os in + irix*) + ;; + *) + basic_os=irix4 + ;; + esac + ;; + miniframe) + cpu=m68000 + vendor=convergent + ;; + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + basic_os=mint + ;; + news-3600 | risc-news) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) + ;; + ns2*) + basic_os=nextstep2 + ;; + *) + basic_os=nextstep3 + ;; + esac + ;; + np1) + cpu=np1 + vendor=gould + ;; + op50n-* | op60c-*) + cpu=hppa1.1 + vendor=oki + basic_os=proelf + ;; + pa-hitachi) + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 + ;; + pbd) + cpu=sparc + vendor=tti + ;; + pbb) + cpu=m68k + vendor=tti + ;; + pc532) + cpu=ns32k + vendor=pc532 + ;; + pn) + cpu=pn + vendor=gould + ;; + power) + cpu=power + vendor=ibm + ;; + ps2) + cpu=i386 + vendor=ibm + ;; + rm[46]00) + cpu=mips + vendor=siemens + ;; + rtpc | rtpc-*) + cpu=romp + vendor=ibm + ;; + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} + ;; + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks + ;; + tower | tower-32) + cpu=m68k + vendor=ncr + ;; + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu + ;; + w65) + cpu=w65 + vendor=wdc + ;; + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf + ;; + none) + cpu=none + vendor=none + ;; + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine + ;; + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <&2 + exit 1 + ;; + esac + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $vendor in + digital*) + vendor=dec + ;; + commodore*) + vendor=cbm + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if test x$basic_os != x +then + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) + vendor=acorn + ;; + *-sunos*) + vendor=sun + ;; + *-cnk* | *-aix*) + vendor=ibm + ;; + *-beos*) + vendor=be + ;; + *-hpux*) + vendor=hp + ;; + *-mpeix*) + vendor=hp + ;; + *-hiux*) + vendor=hitachi + ;; + *-unos*) + vendor=crds + ;; + *-dgux*) + vendor=dg + ;; + *-luna*) + vendor=omron + ;; + *-genix*) + vendor=ns + ;; + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) + vendor=ibm + ;; + s390-* | s390x-*) + vendor=ibm + ;; + *-ptx*) + vendor=sequent + ;; + *-tpf*) + vendor=ibm + ;; + *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; + *-aux*) + vendor=apple + ;; + *-hms*) + vendor=hitachi + ;; + *-mpw* | *-macos*) + vendor=apple + ;; + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; + *-vos*) + vendor=stratus + ;; + esac + ;; +esac + +echo "$cpu-$vendor-${kernel:+$kernel-}$os" +exit + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/build/depcomp b/build/depcomp new file mode 100755 index 0000000..715e343 --- /dev/null +++ b/build/depcomp @@ -0,0 +1,791 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1999-2021 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Avoid interferences from the environment. +gccflag= dashmflag= + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The second -e expression handles DOS-style file names with drive + # letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the "deleted header file" problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. +## Some versions of gcc put a space before the ':'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like '#:fec' to the end of the + # dependency line. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" + echo >> "$depfile" + # The second pass generates a dummy entry for each header file. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" + ;; + +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts '$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" + rm -f "$tmpdepfile" + ;; + +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using '\' : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi + + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + set_dir_from "$object" + set_base_from "$object" + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + make_dummy_depfile + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" + + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/'"$tab"'\1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/'"$tab"'/ + G + p +}' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for ':' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. + "$@" $dashmflag | + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove '-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build/gtk-doc.m4 b/build/gtk-doc.m4 new file mode 100644 index 0000000..2d12f01 --- /dev/null +++ b/build/gtk-doc.m4 @@ -0,0 +1,113 @@ +# -*- mode: autoconf -*- +# +# gtk-doc.m4 - configure macro to check for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2007-2017 Stefan Sauer +# +# 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 3 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, see . +# +# As a special exception, the above copyright owner gives unlimited +# permission to copy, distribute and modify the configure scripts that +# are the output of Autoconf when processing the Macro. You need not +# follow the terms of the GNU General Public License when using or +# distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. + +# serial 2 + +dnl Usage: +dnl GTK_DOC_CHECK([minimum-gtk-doc-version]) +AC_DEFUN([GTK_DOC_CHECK], +[ + AC_REQUIRE([PKG_PROG_PKG_CONFIG]) + AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first + AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first + + ifelse([$1],[],[gtk_doc_requires="gtk-doc"],[gtk_doc_requires="gtk-doc >= $1"]) + AC_MSG_CHECKING([for gtk-doc]) + PKG_CHECK_EXISTS([$gtk_doc_requires],[have_gtk_doc=yes],[have_gtk_doc=no]) + AC_MSG_RESULT($have_gtk_doc) + + if test "$have_gtk_doc" = "no"; then + AC_MSG_WARN([ + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found.]) + fi + + dnl check for tools we added during development + dnl Use AC_CHECK_PROG to avoid the check target using an absolute path that + dnl may not be writable by the user. Currently, automake requires that the + dnl test name must end in '.test'. + dnl https://bugzilla.gnome.org/show_bug.cgi?id=701638 + AC_CHECK_PROG([GTKDOC_CHECK],[gtkdoc-check],[gtkdoc-check.test]) + AC_PATH_PROG([GTKDOC_CHECK_PATH],[gtkdoc-check]) + AC_PATH_PROGS([GTKDOC_REBASE],[gtkdoc-rebase],[true]) + AC_PATH_PROG([GTKDOC_MKPDF],[gtkdoc-mkpdf]) + + dnl for overriding the documentation installation directory + AC_ARG_WITH([html-dir], + AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),, + [with_html_dir='${datadir}/gtk-doc/html']) + HTML_DIR="$with_html_dir" + AC_SUBST([HTML_DIR]) + + dnl enable/disable documentation building + AC_ARG_ENABLE([gtk-doc], + AS_HELP_STRING([--enable-gtk-doc], + [use gtk-doc to build documentation [[default=no]]]),, + [enable_gtk_doc=no]) + + AC_MSG_CHECKING([whether to build gtk-doc documentation]) + AC_MSG_RESULT($enable_gtk_doc) + + if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then + AC_MSG_ERROR([ + You must have $gtk_doc_requires installed to build documentation for + $PACKAGE_NAME. Please install gtk-doc or disable building the + documentation by adding '--disable-gtk-doc' to '[$]0'.]) + fi + + dnl don't check for glib if we build glib + if test "x$PACKAGE_NAME" != "xglib"; then + dnl don't fail if someone does not have glib + PKG_CHECK_MODULES(GTKDOC_DEPS, glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0,,[:]) + fi + + dnl enable/disable output formats + AC_ARG_ENABLE([gtk-doc-html], + AS_HELP_STRING([--enable-gtk-doc-html], + [build documentation in html format [[default=yes]]]),, + [enable_gtk_doc_html=yes]) + AC_ARG_ENABLE([gtk-doc-pdf], + AS_HELP_STRING([--enable-gtk-doc-pdf], + [build documentation in pdf format [[default=no]]]),, + [enable_gtk_doc_pdf=no]) + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + if test -z "$AM_DEFAULT_VERBOSITY"; then + AM_DEFAULT_VERBOSITY=1 + fi + AC_SUBST([AM_DEFAULT_VERBOSITY]) + + AM_CONDITIONAL([HAVE_GTK_DOC], [test x$have_gtk_doc = xyes]) + AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_HTML], [test x$enable_gtk_doc_html = xyes]) + AM_CONDITIONAL([GTK_DOC_BUILD_PDF], [test x$enable_gtk_doc_pdf = xyes]) + AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"]) + AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"]) +]) diff --git a/build/install-sh b/build/install-sh new file mode 100755 index 0000000..ec298b5 --- /dev/null +++ b/build/install-sh @@ -0,0 +1,541 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2020-11-14.01; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# 'make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +tab=' ' +nl=' +' +IFS=" $tab$nl" + +# Set DOITPROG to "echo" to test this script. + +doit=${DOITPROG-} +doit_exec=${doit:-exec} + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +is_target_a_directory=possibly + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. + -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -p) cpprog="$cpprog -p";; + + -s) stripcmd=$stripprog;; + + -S) backupsuffix="$2" + shift;; + + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) is_target_a_directory=never;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call 'install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for 'test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename. + if test -d "$dst"; then + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac + dstdir_status=0 + else + dstdir=`dirname "$dst"` + test -d "$dstdir" + dstdir_status=$? + fi + fi + + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + oIFS=$IFS + IFS=/ + set -f + set fnord $dstdir + shift + set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + set +f && + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build/libtool.m4 b/build/libtool.m4 new file mode 100644 index 0000000..e7b6833 --- /dev/null +++ b/build/libtool.m4 @@ -0,0 +1,8427 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996-2001, 2003-2019, 2021-2022 Free Software +# Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool 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, see . +]) + +# serial 59 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_PREPARE_CC_BASENAME +# ----------------------- +m4_defun([_LT_PREPARE_CC_BASENAME], [ +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in @S|@*""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} +])# _LT_PREPARE_CC_BASENAME + + +# _LT_CC_BASENAME(CC) +# ------------------- +# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, +# but that macro is also expanded into generated libtool script, which +# arranges for $SED and $ECHO to be set by different means. +m4_defun([_LT_CC_BASENAME], +[m4_require([_LT_PREPARE_CC_BASENAME])dnl +AC_REQUIRE([_LT_DECL_SED])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl +func_cc_basename $1 +cc_basename=$func_cc_basename_result +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl +dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_DECL_FILECMD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_WITH_SYSROOT])dnl +m4_require([_LT_CMD_TRUNCATE])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi +]) +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from 'configure', and 'config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# 'config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain=$ac_aux_dir/ltmain.sh +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the 'libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to 'config.status' so that its +# declaration there will have the same value as in 'configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags='_LT_TAGS'dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into 'config.status', and then the shell code to quote escape them in +# for loops in 'config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# '#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test 0 = "$lt_write_fail" && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +'$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2011 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test 0 != $[#] +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try '$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try '$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test yes = "$silent" && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +_LT_COPYING +_LT_LIBTOOL_TAGS + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +_LT_PREPARE_MUNGE_PATH_LIST +_LT_PREPARE_CC_BASENAME + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + $SED '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [Go], [_LT_LANG(GO)], + [Java], [_LT_LANG(GCJ)], + [Fortran 77], [_LT_LANG(F77)], + [Fortran], [_LT_LANG(FC)], + [Windows Resource], [_LT_LANG(RC)], + [m4_ifdef([_LT_LANG_]$1[_CONFIG], + [_LT_LANG($1)], + [m4_fatal([$0: unsupported language: "$1"])])])dnl +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +m4_ifndef([AC_PROG_GO], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_GO. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ +m4_defun([AC_PROG_GO], +[AC_LANG_PUSH(Go)dnl +AC_ARG_VAR([GOC], [Go compiler command])dnl +AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl +_AC_ARG_VAR_LDFLAGS()dnl +AC_CHECK_TOOL(GOC, gccgo) +if test -z "$GOC"; then + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) + fi +fi +if test -z "$GOC"; then + AC_CHECK_PROG(GOC, gccgo, gccgo, false) +fi +])#m4_defun +])#m4_ifndef + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([AC_PROG_GO], + [LT_LANG(GO)], + [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi]) + + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS=$save_LDFLAGS + ]) + + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR $AR_FLAGS libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&AS_MESSAGE_LOG_FD + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[[012]],*|,*powerpc*-darwin[[5-8]]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES([TAG]) +# --------------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test yes = "$lt_cv_ld_force_load"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], + [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + _LT_TAGVAR(module_expsym_cmds, $1)="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + m4_if([$1], [CXX], +[ if test yes != "$lt_cv_apple_cc_single_mod"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" + _LT_TAGVAR(archive_expsym_cmds, $1)="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) +# ---------------------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +# Store the results from the different compilers for each TAGNAME. +# Allow to override them for all tags through lt_cv_aix_libpath. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ + lt_aix_libpath_sed='[ + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }]' + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi],[]) + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib + fi + ]) + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) +fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script that will find a shell with a builtin +# printf (that we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case $ECHO in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_WITH_SYSROOT +# ---------------- +AC_DEFUN([_LT_WITH_SYSROOT], +[m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([for sysroot]) +AC_ARG_WITH([sysroot], +[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], + [Search for dependent libraries within DIR (or the compiler's sysroot + if not specified).])], +[], [with_sysroot=no]) + +dnl lt_sysroot will always be passed unquoted. We quote it here +dnl in case the user passed a directory name. +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + AC_MSG_RESULT([$with_sysroot]) + AC_MSG_ERROR([The sysroot must be an absolute path.]) + ;; +esac + + AC_MSG_RESULT([${lt_sysroot:-no}]) +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl +[dependent libraries, and where our libraries should be installed.])]) + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `$FILECMD conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + emul=elf + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `$FILECMD conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `$FILECMD conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `$FILECMD conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock +])# _LT_ENABLE_LOCK + + +# _LT_PROG_AR +# ----------- +m4_defun([_LT_PROG_AR], +[AC_CHECK_TOOLS(AR, [ar], false) +: ${AR=ar} +_LT_DECL([], [AR], [1], [The archiver]) + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS +_LT_DECL([], [lt_ar_flags], [0], [Flags to create an archive (by configure)]) + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. +_LT_DECL([], [AR_FLAGS], [\@S|@{ARFLAGS-"\@S|@lt_ar_flags"}], + [Flags to create an archive]) + +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], + [lt_cv_ar_at_file=no + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], + [echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' + AC_TRY_EVAL([lt_ar_try]) + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + AC_TRY_EVAL([lt_ar_try]) + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + ]) + ]) + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi +_LT_DECL([], [archiver_list_spec], [1], + [How to feed a file listing to the archiver]) +])# _LT_PROG_AR + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[_LT_PROG_AR + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test yes = "[$]$2"; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS +]) + +if test yes = "[$]$2"; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n "$lt_cv_sys_max_cmd_len"; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes = "$cross_compiling"; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen=shl_load], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen=dlopen], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links=nottested +if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test no = "$hard_links"; then + AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", + [Define to the sub-directory where libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then + + # We can hardcode non-existent directories. + if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && + test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || + test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -z "$STRIP"; then + AC_MSG_RESULT([no]) +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac + fi +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_PREPARE_MUNGE_PATH_LIST +# --------------------------- +# Make sure func_munge_path_list() is defined correctly. +m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], +[[# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x@S|@2 in + x) + ;; + *:) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" + ;; + x:*) + eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" + ;; + *) + eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" + ;; + esac +} +]])# _LT_PREPARE_PATH_LIST + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +AC_ARG_VAR([LT_SYS_LIBRARY_PATH], +[User-defined run-time library search path.]) + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[[4-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[[01]] | aix4.[[01]].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a[(]lib.so.V[)]' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl* | *,icl*) + # Native MSVC or ICC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC and ICC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly* | midnightbsd*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[23]].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +AC_MSG_RESULT([$dynamic_linker]) +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[List of archive names. First name is the real one, the rest are links. + The last name is the one that the linker finds with -lNAME]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], + [Detected run-time system search path for libraries]) +_LT_DECL([], [configure_time_lt_sys_library_path], [2], + [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program that can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$1"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac]) +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program that can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test no = "$withval" || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], +[if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi]) +rm -f conftest.i conftest2.i conftest.out]) +])# _LT_PATH_DD + + +# _LT_CMD_TRUNCATE +# ---------------- +# find command to truncate a binary pipe +m4_defun([_LT_CMD_TRUNCATE], +[m4_require([_LT_PATH_DD]) +AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], +[printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) +_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], + [Command to truncate a binary pipe]) +])# _LT_CMD_TRUNCATE + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[[4-9]]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[[45]]*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='$FILECMD -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly* | midnightbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=$FILECMD + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=$FILECMD + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=$FILECMD + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method = "file_magic"]) +_LT_DECL([], [file_magic_glob], [1], + [How to find potential files when deplibs_check_method = "file_magic"]) +_LT_DECL([], [want_nocaseglob], [1], + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi]) +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB +# -------------------------------- +# how to determine the name of the shared library +# associated with a specific link library. +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], +[m4_require([_LT_DECL_EGREP]) +m4_require([_LT_DECL_OBJDUMP]) +m4_require([_LT_DECL_DLLTOOL]) +AC_CACHE_CHECK([how to associate runtime and link libraries], +lt_cv_sharedlib_from_linklib_cmd, +[lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac +]) +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], + [Command to associate shared and link libraries]) +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB + + +# _LT_PATH_MANIFEST_TOOL +# ---------------------- +# locate the manifest tool +m4_defun([_LT_PATH_MANIFEST_TOOL], +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], + [lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&AS_MESSAGE_LOG_FD + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest*]) +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl +])# _LT_PATH_MANIFEST_TOOL + + +# _LT_DLL_DEF_P([FILE]) +# --------------------- +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with func_dll_def_p in the libtool script +AC_DEFUN([_LT_DLL_DEF_P], +[dnl + test DEF = "`$SED -n dnl + -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace + -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments + -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl + -e q dnl Only consider the first "real" line + $1`" dnl +])# _LT_DLL_DEF_P + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM=-lm) + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++ or ICC, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx]" + else + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT@&t@_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT@&t@_DLSYM_CONST +#else +# define LT@&t@_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT@&t@_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[[]] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done +]) +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], + [Transform the output of nm into a list of symbols to manually relocate]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +_LT_DECL([nm_interface], [lt_cv_nm_interface], [1], + [The name lister interface]) +_LT_DECL([], [nm_file_list_spec], [1], + [Specify filename containing input files for $NM]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + mingw* | cygwin* | os2* | pw32* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly* | midnightbsd*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64, which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd* | netbsdelf*-gnu) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test yes = "$GCC"; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + case $host_os in + os2*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + nagfor*) + # NAG Fortran compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ F* | *Sun*Fortran*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Intel*\ [[CF]]*Compiler*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + *Portland\ Group*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac + +AC_CACHE_CHECK([for $compiler option to produce PIC], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + case $host_os in + aix[[4-9]]*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds + ;; + cygwin* | mingw* | cegcc*) + case $cc_basename in + cl* | icl*) + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + ;; + esac + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + _LT_TAGVAR(link_all_deplibs, $1)=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([[^)]]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=unsupported + fi + ;; + + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl* | icl*) + # Native MSVC or ICC + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC and ICC wrapper + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + esac + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly* | midnightbsd*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], + [lt_cv_irix_exported_symbol], + [save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + AC_LINK_IFELSE( + [AC_LANG_SOURCE( + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], + [C++], [[int foo (void) { return 0; }]], + [Fortran 77], [[ + subroutine foo + end]], + [Fortran], [[ + subroutine foo + end]])])], + [lt_cv_irix_exported_symbol=yes], + [lt_cv_irix_exported_symbol=no]) + LDFLAGS=$save_LDFLAGS]) + if test yes = "$lt_cv_irix_exported_symbol"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + _LT_TAGVAR(link_all_deplibs, $1)=no + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + _LT_TAGVAR(ld_shlibs, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + esac + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + ;; + + osf3*) + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $_LT_TAGVAR(archive_cmds, $1) in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + AC_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes + DIR into the resulting binary and the resulting library dependency is + "absolute", i.e impossible to change by setting $shlibpath_var if the + library is relocated]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [postlink_cmds], [2], + [Commands necessary for finishing linking programs]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC=$CC +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + +_LT_TAG_COMPILER +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report what library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC=$lt_save_CC +])# _LT_LANG_C_CONFIG + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PATH_MANIFEST_TOOL])dnl +if test -n "$CXX" && ( test no != "$CXX" && + ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || + (test g++ != "$CXX"))); then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_caught_CXX_error"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_CFLAGS=$CFLAGS + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + CFLAGS=$CXXFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + # We don't want -fno-exception when compiling C++ code, so set the + # no_builtin_flag separately + if test yes = "$GXX"; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test yes = "$GXX"; then + # Set up default GNU C++ configuration + + LT_PATH_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test yes = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='$wl' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + ;; + esac + + if test yes = "$GXX"; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag=$shared_flag' $wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + # The "-G" linker flag allows undefined symbols. + _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX([$1]) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared + # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + case $GXX,$cc_basename in + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + # Don't use ranlib + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + func_to_tool_file "$lt_outputfile"~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # g++ + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + shrext_cmds=.dll + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='@' + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd2.*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly* | midnightbsd*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test yes = "$GXX"; then + if test no = "$with_gnu_ld"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + if test yes = "$supports_anon_versioning"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test yes,no = "$GXX,$with_gnu_ld"; then + _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + else + # g++ 2.7 appears to require '-G' NOT '-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no + + _LT_TAGVAR(GCC, $1)=$GXX + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS + LDCXX=$LD + LD=$lt_save_LD + GCC=$lt_save_GCC + with_gnu_ld=$lt_save_with_gnu_ld + lt_cv_path_LDCXX=$lt_cv_path_LD + lt_cv_path_LD=$lt_save_path_LD + lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld + lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +fi # test yes != "$_lt_caught_CXX_error" + +AC_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_FUNC_STRIPNAME_CNF +# ---------------------- +# func_stripname_cnf prefix suffix name +# strip PREFIX and SUFFIX off of NAME. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +# +# This function is identical to the (non-XSI) version of func_stripname, +# except this one can be used by m4 code that may be executed by configure, +# rather than the libtool script. +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl +AC_REQUIRE([_LT_DECL_SED]) +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) +func_stripname_cnf () +{ + case @S|@2 in + .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; + *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; + esac +} # func_stripname_cnf +])# _LT_FUNC_STRIPNAME_CNF + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF +package foo +func foo() { +} +_LT_EOF +]) + +_lt_libdeps_save_CFLAGS=$CFLAGS +case "$CC $CFLAGS " in #( +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; +*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; +esac + +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + for p in `eval "$output_verbose_link_cmd"`; do + case $prev$p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test x-L = "$p" || + test x-R = "$p"; then + prev=$p + continue + fi + + # Expand the sysroot to ease extracting the directories later. + if test -z "$prev"; then + case $p in + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; + esac + fi + case $p in + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; + esac + if test no = "$pre_test_object_deps_done"; then + case $prev in + -L | -R) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)=$prev$p + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" + fi + fi + prev= + ;; + + *.lto.$objext) ;; # Ignore GCC LTO objects + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test no = "$pre_test_object_deps_done"; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)=$p + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)=$p + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext +CFLAGS=$_lt_libdeps_save_CFLAGS + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[case $host_os in +interix[[3-9]]*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test no = "$F77"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_F77"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${F77-"f77"} + CFLAGS=$FFLAGS + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$G77 + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_F77" + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test no = "$FC"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test yes != "$_lt_disable_FC"; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_GCC=$GCC + lt_save_CFLAGS=$CFLAGS + CC=${FC-"f95"} + CFLAGS=$FCFLAGS + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + aix[[4-9]]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu + _LT_TAGVAR(LD, $1)=$LD + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC=$lt_save_CC + CFLAGS=$lt_save_CFLAGS +fi # test yes != "$_lt_disable_FC" + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +CFLAGS=$GCJFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_GO_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Go compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_GO_CONFIG], +[AC_REQUIRE([LT_PROG_GO])dnl +AC_LANG_SAVE + +# Source file extension for Go test sources. +ac_ext=go + +# Object file extension for compiled Go test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="package main; func main() { }" + +# Code to be used in simple link tests +lt_simple_link_test_code='package main; func main() { }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC=yes +CC=${GOC-"gccgo"} +CFLAGS=$GOFLAGS +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_TAGVAR(LD, $1)=$LD +_LT_CC_BASENAME([$compiler]) + +# Go did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_GO_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to 'libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code=$lt_simple_compile_test_code + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_CFLAGS=$CFLAGS +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +CFLAGS= +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC=$lt_save_CC +CFLAGS=$lt_save_CFLAGS +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +AC_DEFUN([LT_PROG_GCJ], +[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], + [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], + [AC_CHECK_TOOL(GCJ, gcj,) + test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" + AC_SUBST(GCJFLAGS)])])[]dnl +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_GO +# ---------- +AC_DEFUN([LT_PROG_GO], +[AC_CHECK_TOOL(GOC, gccgo,) +]) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_OBJDUMP +# -------------- +# If we don't have a new enough Autoconf to choose the best objdump +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_OBJDUMP], +[AC_CHECK_TOOL(OBJDUMP, objdump, false) +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) +AC_SUBST([OBJDUMP]) +]) + +# _LT_DECL_DLLTOOL +# ---------------- +# Ensure DLLTOOL variable is set. +m4_defun([_LT_DECL_DLLTOOL], +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) +AC_SUBST([DLLTOOL]) +]) + +# _LT_DECL_FILECMD +# ---------------- +# Check for a file(cmd) program that can be used to detect file type and magic +m4_defun([_LT_DECL_FILECMD], +[AC_CHECK_TOOL([FILECMD], [file], [:]) +_LT_DECL([], [FILECMD], [1], [A file(cmd) program that detects file types]) +])# _LD_DECL_FILECMD + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f "$lt_ac_sed" && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test 10 -lt "$lt_ac_count" && break + lt_ac_count=`expr $lt_ac_count + 1` + if test "$lt_ac_count" -gt "$lt_ac_max"; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PATH_CONVERSION_FUNCTIONS +# ----------------------------- +# Determine what file name conversion functions should be used by +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed +# for certain cross-compile configurations and native mingw. +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_MSG_CHECKING([how to convert $build file names to $host format]) +AC_CACHE_VAL(lt_cv_to_host_file_cmd, +[case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac +]) +to_host_file_cmd=$lt_cv_to_host_file_cmd +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], + [0], [convert $build file names to $host format])dnl + +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, +[#assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac +]) +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], + [0], [convert $build files to toolchain format])dnl +])# _LT_PATH_CONVERSION_FUNCTIONS diff --git a/build/ltmain.sh b/build/ltmain.sh new file mode 100755 index 0000000..9b12fbb --- /dev/null +++ b/build/ltmain.sh @@ -0,0 +1,11448 @@ +#! /usr/bin/env sh +## DO NOT EDIT - This file generated from ./build-aux/ltmain.in +## by inline-source v2019-02-19.15 + +# libtool (GNU libtool) 2.4.7 +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool 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, see . + + +PROGRAM=libtool +PACKAGE=libtool +VERSION="2.4.7 Debian-2.4.7-5" +package_revision=2.4.7 + + +## ------ ## +## Usage. ## +## ------ ## + +# Run './libtool --help' for help with using this script from the +# command line. + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# After configure completes, it has a better idea of some of the +# shell tools we need than the defaults used by the functions shared +# with bootstrap, so set those here where they can still be over- +# ridden by the user, but otherwise take precedence. + +: ${AUTOCONF="autoconf"} +: ${AUTOMAKE="automake"} + + +## -------------------------- ## +## Source external libraries. ## +## -------------------------- ## + +# Much of our low-level functionality needs to be sourced from external +# libraries, which are installed to $pkgauxdir. + +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC + +# General shell script boiler plate, and helper functions. +# Written by Gary V. Vaughan, 2004 + +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + + +## ------ ## +## Usage. ## +## ------ ## + +# Evaluate this file near the top of your script to gain access to +# the functions and variables defined here: +# +# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh +# +# If you need to override any of the default environment variable +# settings, do that before evaluating this file. + + +## -------------------- ## +## Shell normalisation. ## +## -------------------- ## + +# Some shells need a little help to be as Bourne compatible as possible. +# Before doing anything else, make sure all that help has been provided! + +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac +fi + +# NLS nuisances: We save the old values in case they are required later. +_G_user_locale= +_G_safe_locale= +for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test set = \"\${$_G_var+set}\"; then + save_$_G_var=\$$_G_var + $_G_var=C + export $_G_var + _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" + _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" + fi" +done +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +# Make sure IFS has a sensible default +sp=' ' +nl=' +' +IFS="$sp $nl" + +# There are apparently some retarded systems that use ';' as a PATH separator! +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + + +## ------------------------- ## +## Locate command utilities. ## +## ------------------------- ## + + +# func_executable_p FILE +# ---------------------- +# Check that FILE is an executable regular file. +func_executable_p () +{ + test -f "$1" && test -x "$1" +} + + +# func_path_progs PROGS_LIST CHECK_FUNC [PATH] +# -------------------------------------------- +# Search for either a program that responds to --version with output +# containing "GNU", or else returned by CHECK_FUNC otherwise, by +# trying all the directories in PATH with each of the elements of +# PROGS_LIST. +# +# CHECK_FUNC should accept the path to a candidate program, and +# set $func_check_prog_result if it truncates its output less than +# $_G_path_prog_max characters. +func_path_progs () +{ + _G_progs_list=$1 + _G_check_func=$2 + _G_PATH=${3-"$PATH"} + + _G_path_prog_max=0 + _G_path_prog_found=false + _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} + for _G_dir in $_G_PATH; do + IFS=$_G_save_IFS + test -z "$_G_dir" && _G_dir=. + for _G_prog_name in $_G_progs_list; do + for _exeext in '' .EXE; do + _G_path_prog=$_G_dir/$_G_prog_name$_exeext + func_executable_p "$_G_path_prog" || continue + case `"$_G_path_prog" --version 2>&1` in + *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; + *) $_G_check_func $_G_path_prog + func_path_progs_result=$func_check_prog_result + ;; + esac + $_G_path_prog_found && break 3 + done + done + done + IFS=$_G_save_IFS + test -z "$func_path_progs_result" && { + echo "no acceptable sed could be found in \$PATH" >&2 + exit 1 + } +} + + +# We want to be able to use the functions in this file before configure +# has figured out where the best binaries are kept, which means we have +# to search for them ourselves - except when the results are already set +# where we skip the searches. + +# Unless the user overrides by setting SED, search the path for either GNU +# sed, or the sed that truncates its output the least. +test -z "$SED" && { + _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for _G_i in 1 2 3 4 5 6 7; do + _G_sed_script=$_G_sed_script$nl$_G_sed_script + done + echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed + _G_sed_script= + + func_check_prog_sed () + { + _G_path_prog=$1 + + _G_count=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo '' >> conftest.nl + "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" + rm -f conftest.sed + SED=$func_path_progs_result +} + + +# Unless the user overrides by setting GREP, search the path for either GNU +# grep, or the grep that truncates its output the least. +test -z "$GREP" && { + func_check_prog_grep () + { + _G_path_prog=$1 + + _G_count=0 + _G_path_prog_max=0 + printf 0123456789 >conftest.in + while : + do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo 'GREP' >> conftest.nl + "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break + diff conftest.out conftest.nl >/dev/null 2>&1 || break + _G_count=`expr $_G_count + 1` + if test "$_G_count" -gt "$_G_path_prog_max"; then + # Best one so far, save it but keep looking for a better one + func_check_prog_result=$_G_path_prog + _G_path_prog_max=$_G_count + fi + # 10*(2^10) chars as input seems more than enough + test 10 -lt "$_G_count" && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out + } + + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" + GREP=$func_path_progs_result +} + + +## ------------------------------- ## +## User overridable command paths. ## +## ------------------------------- ## + +# All uppercase variable names are used for environment variables. These +# variables can be overridden by the user before calling a script that +# uses them if a suitable command of that name is not already available +# in the command search PATH. + +: ${CP="cp -f"} +: ${ECHO="printf %s\n"} +: ${EGREP="$GREP -E"} +: ${FGREP="$GREP -F"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SHELL="${CONFIG_SHELL-/bin/sh}"} + + +## -------------------- ## +## Useful sed snippets. ## +## -------------------- ## + +sed_dirname='s|/[^/]*$||' +sed_basename='s|^.*/||' + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s|\([`"$\\]\)|\\\1|g' + +# Same as above, but do not quote variable references. +sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution that turns a string into a regex matching for the +# string literally. +sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' + +# Sed substitution that converts a w32 file name or path +# that contains forward slashes, into one that contains +# (escaped) backslashes. A very naive implementation. +sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' + +# Re-'\' parameter expansions in output of sed_double_quote_subst that +# were '\'-ed in input to the same. If an odd number of '\' preceded a +# '$' in input to sed_double_quote_subst, that '$' was protected from +# expansion. Since each input '\' is now two '\'s, look for any number +# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. +_G_bs='\\' +_G_bs2='\\\\' +_G_bs4='\\\\\\\\' +_G_dollar='\$' +sed_double_backslash="\ + s/$_G_bs4/&\\ +/g + s/^$_G_bs2$_G_dollar/$_G_bs&/ + s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g + s/\n//g" + +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + + +## ----------------- ## +## Global variables. ## +## ----------------- ## + +# Except for the global variables explicitly listed below, the following +# functions in the '^func_' namespace, and the '^require_' namespace +# variables initialised in the 'Resource management' section, sourcing +# this file will not pollute your global namespace with anything +# else. There's no portable way to scope variables in Bourne shell +# though, so actually running these functions will sometimes place +# results into a variable named after the function, and often use +# temporary variables in the '^_G_' namespace. If you are careful to +# avoid using those namespaces casually in your sourcing script, things +# should continue to work as you expect. And, of course, you can freely +# overwrite any of the functions or variables defined here before +# calling anything to customize them. + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. +EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. + +# Allow overriding, eg assuming that you follow the convention of +# putting '$debug_cmd' at the start of all your functions, you can get +# bash to show function call trace with: +# +# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name +debug_cmd=${debug_cmd-":"} +exit_cmd=: + +# By convention, finish your script with: +# +# exit $exit_status +# +# so that you can set exit_status to non-zero if you want to indicate +# something went wrong during execution without actually bailing out at +# the point of failure. +exit_status=$EXIT_SUCCESS + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath=$0 + +# The name of this program. +progname=`$ECHO "$progpath" |$SED "$sed_basename"` + +# Make sure we have an absolute progpath for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` + progdir=`cd "$progdir" && pwd` + progpath=$progdir/$progname + ;; + *) + _G_IFS=$IFS + IFS=${PATH_SEPARATOR-:} + for progdir in $PATH; do + IFS=$_G_IFS + test -x "$progdir/$progname" && break + done + IFS=$_G_IFS + test -n "$progdir" || progdir=`pwd` + progpath=$progdir/$progname + ;; +esac + + +## ----------------- ## +## Standard options. ## +## ----------------- ## + +# The following options affect the operation of the functions defined +# below, and should be set appropriately depending on run-time para- +# meters passed on the command line. + +opt_dry_run=false +opt_quiet=false +opt_verbose=false + +# Categories 'all' and 'none' are always available. Append any others +# you will pass as the first argument to func_warning from your own +# code. +warning_categories= + +# By default, display warnings according to 'opt_warning_types'. Set +# 'warning_func' to ':' to elide all warnings, or func_fatal_error to +# treat the next displayed warning as a fatal error. +warning_func=func_warn_and_continue + +# Set to 'all' to display all warnings, 'none' to suppress all +# warnings, or a space delimited list of some subset of +# 'warning_categories' to display only the listed warnings. +opt_warning_types=all + + +## -------------------- ## +## Resource management. ## +## -------------------- ## + +# This section contains definitions for functions that each ensure a +# particular resource (a file, or a non-empty configuration variable for +# example) is available, and if appropriate to extract default values +# from pertinent package files. Call them using their associated +# 'require_*' variable to ensure that they are executed, at most, once. +# +# It's entirely deliberate that calling these functions can set +# variables that don't obey the namespace limitations obeyed by the rest +# of this file, in order that that they be as useful as possible to +# callers. + + +# require_term_colors +# ------------------- +# Allow display of bold text on terminals that support it. +require_term_colors=func_require_term_colors +func_require_term_colors () +{ + $debug_cmd + + test -t 1 && { + # COLORTERM and USE_ANSI_COLORS environment variables take + # precedence, because most terminfo databases neglect to describe + # whether color sequences are supported. + test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} + + if test 1 = "$USE_ANSI_COLORS"; then + # Standard ANSI escape sequences + tc_reset='' + tc_bold=''; tc_standout='' + tc_red=''; tc_green='' + tc_blue=''; tc_cyan='' + else + # Otherwise trust the terminfo database after all. + test -n "`tput sgr0 2>/dev/null`" && { + tc_reset=`tput sgr0` + test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` + tc_standout=$tc_bold + test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` + test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` + test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` + test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` + test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` + } + fi + } + + require_term_colors=: +} + + +## ----------------- ## +## Function library. ## +## ----------------- ## + +# This section contains a variety of useful functions to call in your +# scripts. Take note of the portable wrappers for features provided by +# some modern shells, which will fall back to slower equivalents on +# less featureful shells. + + +# func_append VAR VALUE +# --------------------- +# Append VALUE onto the existing contents of VAR. + + # We should try to minimise forks, especially on Windows where they are + # unreasonably slow, so skip the feature probes when bash or zsh are + # being used: + if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then + : ${_G_HAVE_ARITH_OP="yes"} + : ${_G_HAVE_XSI_OPS="yes"} + # The += operator was introduced in bash 3.1 + case $BASH_VERSION in + [12].* | 3.0 | 3.0*) ;; + *) + : ${_G_HAVE_PLUSEQ_OP="yes"} + ;; + esac + fi + + # _G_HAVE_PLUSEQ_OP + # Can be empty, in which case the shell is probed, "yes" if += is + # useable or anything else if it does not work. + test -z "$_G_HAVE_PLUSEQ_OP" \ + && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ + && _G_HAVE_PLUSEQ_OP=yes + +if test yes = "$_G_HAVE_PLUSEQ_OP" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_append () + { + $debug_cmd + + eval "$1+=\$2" + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_append () + { + $debug_cmd + + eval "$1=\$$1\$2" + } +fi + + +# func_append_quoted VAR VALUE +# ---------------------------- +# Quote VALUE and append to the end of shell variable VAR, separated +# by a space. +if test yes = "$_G_HAVE_PLUSEQ_OP"; then + eval 'func_append_quoted () + { + $debug_cmd + + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" + }' +else + func_append_quoted () + { + $debug_cmd + + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" + } +fi + + +# func_append_uniq VAR VALUE +# -------------------------- +# Append unique VALUE onto the existing contents of VAR, assuming +# entries are delimited by the first character of VALUE. For example: +# +# func_append_uniq options " --another-option option-argument" +# +# will only append to $options if " --another-option option-argument " +# is not already present somewhere in $options already (note spaces at +# each end implied by leading space in second argument). +func_append_uniq () +{ + $debug_cmd + + eval _G_current_value='`$ECHO $'$1'`' + _G_delim=`expr "$2" : '\(.\)'` + + case $_G_delim$_G_current_value$_G_delim in + *"$2$_G_delim"*) ;; + *) func_append "$@" ;; + esac +} + + +# func_arith TERM... +# ------------------ +# Set func_arith_result to the result of evaluating TERMs. + test -z "$_G_HAVE_ARITH_OP" \ + && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ + && _G_HAVE_ARITH_OP=yes + +if test yes = "$_G_HAVE_ARITH_OP"; then + eval 'func_arith () + { + $debug_cmd + + func_arith_result=$(( $* )) + }' +else + func_arith () + { + $debug_cmd + + func_arith_result=`expr "$@"` + } +fi + + +# func_basename FILE +# ------------------ +# Set func_basename_result to FILE with everything up to and including +# the last / stripped. +if test yes = "$_G_HAVE_XSI_OPS"; then + # If this shell supports suffix pattern removal, then use it to avoid + # forking. Hide the definitions single quotes in case the shell chokes + # on unsupported syntax... + _b='func_basename_result=${1##*/}' + _d='case $1 in + */*) func_dirname_result=${1%/*}$2 ;; + * ) func_dirname_result=$3 ;; + esac' + +else + # ...otherwise fall back to using sed. + _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' + _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` + if test "X$func_dirname_result" = "X$1"; then + func_dirname_result=$3 + else + func_append func_dirname_result "$2" + fi' +fi + +eval 'func_basename () +{ + $debug_cmd + + '"$_b"' +}' + + +# func_dirname FILE APPEND NONDIR_REPLACEMENT +# ------------------------------------------- +# Compute the dirname of FILE. If nonempty, add APPEND to the result, +# otherwise set result to NONDIR_REPLACEMENT. +eval 'func_dirname () +{ + $debug_cmd + + '"$_d"' +}' + + +# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT +# -------------------------------------------------------- +# Perform func_basename and func_dirname in a single function +# call: +# dirname: Compute the dirname of FILE. If nonempty, +# add APPEND to the result, otherwise set result +# to NONDIR_REPLACEMENT. +# value returned in "$func_dirname_result" +# basename: Compute filename of FILE. +# value retuned in "$func_basename_result" +# For efficiency, we do not delegate to the functions above but instead +# duplicate the functionality here. +eval 'func_dirname_and_basename () +{ + $debug_cmd + + '"$_b"' + '"$_d"' +}' + + +# func_echo ARG... +# ---------------- +# Echo program name prefixed message. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_echo_all ARG... +# -------------------- +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + + +# func_echo_infix_1 INFIX ARG... +# ------------------------------ +# Echo program name, followed by INFIX on the first line, with any +# additional lines not showing INFIX. +func_echo_infix_1 () +{ + $debug_cmd + + $require_term_colors + + _G_infix=$1; shift + _G_indent=$_G_infix + _G_prefix="$progname: $_G_infix: " + _G_message=$* + + # Strip color escape sequences before counting printable length + for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" + do + test -n "$_G_tc" && { + _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` + _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` + } + done + _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes + + func_echo_infix_1_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_infix_1_IFS + $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 + _G_prefix=$_G_indent + done + IFS=$func_echo_infix_1_IFS +} + + +# func_error ARG... +# ----------------- +# Echo program name prefixed message to standard error. +func_error () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 +} + + +# func_fatal_error ARG... +# ----------------------- +# Echo program name prefixed message to standard error, and exit. +func_fatal_error () +{ + $debug_cmd + + func_error "$*" + exit $EXIT_FAILURE +} + + +# func_grep EXPRESSION FILENAME +# ----------------------------- +# Check whether EXPRESSION matches any line of FILENAME, without output. +func_grep () +{ + $debug_cmd + + $GREP "$1" "$2" >/dev/null 2>&1 +} + + +# func_len STRING +# --------------- +# Set func_len_result to the length of STRING. STRING may not +# start with a hyphen. + test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_len () + { + $debug_cmd + + func_len_result=${#1} + }' +else + func_len () + { + $debug_cmd + + func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` + } +fi + + +# func_mkdir_p DIRECTORY-PATH +# --------------------------- +# Make sure the entire path to DIRECTORY-PATH is available. +func_mkdir_p () +{ + $debug_cmd + + _G_directory_path=$1 + _G_dir_list= + + if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then + + # Protect directory names starting with '-' + case $_G_directory_path in + -*) _G_directory_path=./$_G_directory_path ;; + esac + + # While some portion of DIR does not yet exist... + while test ! -d "$_G_directory_path"; do + # ...make a list in topmost first order. Use a colon delimited + # list incase some portion of path contains whitespace. + _G_dir_list=$_G_directory_path:$_G_dir_list + + # If the last portion added has no slash in it, the list is done + case $_G_directory_path in */*) ;; *) break ;; esac + + # ...otherwise throw away the child directory and loop + _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` + done + _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` + + func_mkdir_p_IFS=$IFS; IFS=: + for _G_dir in $_G_dir_list; do + IFS=$func_mkdir_p_IFS + # mkdir can fail with a 'File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$_G_dir" 2>/dev/null || : + done + IFS=$func_mkdir_p_IFS + + # Bail out if we (or some other process) failed to create a directory. + test -d "$_G_directory_path" || \ + func_fatal_error "Failed to create '$1'" + fi +} + + +# func_mktempdir [BASENAME] +# ------------------------- +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, BASENAME is the basename for that directory. +func_mktempdir () +{ + $debug_cmd + + _G_template=${TMPDIR-/tmp}/${1-$progname} + + if test : = "$opt_dry_run"; then + # Return a directory name, but don't create it in dry-run mode + _G_tmpdir=$_G_template-$$ + else + + # If mktemp works, use that first and foremost + _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` + + if test ! -d "$_G_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + _G_tmpdir=$_G_template-${RANDOM-0}$$ + + func_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$_G_tmpdir" + umask $func_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$_G_tmpdir" || \ + func_fatal_error "cannot create temporary directory '$_G_tmpdir'" + fi + + $ECHO "$_G_tmpdir" +} + + +# func_normal_abspath PATH +# ------------------------ +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +func_normal_abspath () +{ + $debug_cmd + + # These SED scripts presuppose an absolute path with a trailing slash. + _G_pathcar='s|^/\([^/]*\).*$|\1|' + _G_pathcdr='s|^/[^/]*||' + _G_removedotparts=':dotsl + s|/\./|/|g + t dotsl + s|/\.$|/|' + _G_collapseslashes='s|/\{1,\}|/|g' + _G_finalslash='s|/*$|/|' + + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` + while :; do + # Processed it all yet? + if test / = "$func_normal_abspath_tpath"; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result"; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$_G_pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + + +# func_notquiet ARG... +# -------------------- +# Echo program name prefixed message only when not in quiet mode. +func_notquiet () +{ + $debug_cmd + + $opt_quiet || func_echo ${1+"$@"} + + # A bug in bash halts the script if the last line of a function + # fails when set -e is in force, so we need another command to + # work around that: + : +} + + +# func_relative_path SRCDIR DSTDIR +# -------------------------------- +# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. +func_relative_path () +{ + $debug_cmd + + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=$func_dirname_result + if test -z "$func_relative_path_tlibdir"; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test -n "$func_stripname_result"; then + func_append func_relative_path_result "/$func_stripname_result" + fi + + # Normalisation. If bindir is libdir, return '.' else relative path. + if test -n "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + fi + + test -n "$func_relative_path_result" || func_relative_path_result=. + + : +} + + +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () +{ + $debug_cmd + + $require_check_ifs_backslash + + func_quote_portable_result=$2 + + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break + ;; + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done + done + IFS=$func_quote_portable_old_IFS + ;; + *) ;; + esac + break + done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" + ;; + esac +} + + +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + ;; + *) + printf -v func_quotefast_eval_result %q "$1" + ;; + esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi + + +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; + esac + + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result + ;; + esac +} + + +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done +} + + +# func_stripname PREFIX SUFFIX NAME +# --------------------------------- +# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. +# PREFIX and SUFFIX must not contain globbing or regex special +# characters, hashes, percent signs, but SUFFIX may contain a leading +# dot (in which case that matches only a dot). +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_stripname () + { + $debug_cmd + + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are + # positional parameters, so assign one to ordinary variable first. + func_stripname_result=$3 + func_stripname_result=${func_stripname_result#"$1"} + func_stripname_result=${func_stripname_result%"$2"} + }' +else + func_stripname () + { + $debug_cmd + + case $2 in + .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; + *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; + esac + } +fi + + +# func_show_eval CMD [FAIL_EXP] +# ----------------------------- +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" + + $opt_dry_run || { + eval "$_G_cmd" + _G_status=$? + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_show_eval_locale CMD [FAIL_EXP] +# ------------------------------------ +# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + $debug_cmd + + _G_cmd=$1 + _G_fail_exp=${2-':'} + + $opt_quiet || { + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" + } + + $opt_dry_run || { + eval "$_G_user_locale + $_G_cmd" + _G_status=$? + eval "$_G_safe_locale" + if test 0 -ne "$_G_status"; then + eval "(exit $_G_status); $_G_fail_exp" + fi + } +} + + +# func_tr_sh +# ---------- +# Turn $1 into a string suitable for a shell variable name. +# Result is stored in $func_tr_sh_result. All characters +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, +# if $1 begins with a digit, a '_' is prepended as well. +func_tr_sh () +{ + $debug_cmd + + case $1 in + [0-9]* | *[!a-zA-Z0-9_]*) + func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` + ;; + * ) + func_tr_sh_result=$1 + ;; + esac +} + + +# func_verbose ARG... +# ------------------- +# Echo program name prefixed message in verbose mode only. +func_verbose () +{ + $debug_cmd + + $opt_verbose && func_echo "$*" + + : +} + + +# func_warn_and_continue ARG... +# ----------------------------- +# Echo program name prefixed warning message to standard error. +func_warn_and_continue () +{ + $debug_cmd + + $require_term_colors + + func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 +} + + +# func_warning CATEGORY ARG... +# ---------------------------- +# Echo program name prefixed warning message to standard error. Warning +# messages can be filtered according to CATEGORY, where this function +# elides messages where CATEGORY is not listed in the global variable +# 'opt_warning_types'. +func_warning () +{ + $debug_cmd + + # CATEGORY must be in the warning_categories list! + case " $warning_categories " in + *" $1 "*) ;; + *) func_internal_error "invalid warning category '$1'" ;; + esac + + _G_category=$1 + shift + + case " $opt_warning_types " in + *" $_G_category "*) $warning_func ${1+"$@"} ;; + esac +} + + +# func_sort_ver VER1 VER2 +# ----------------------- +# 'sort -V' is not generally available. +# Note this deviates from the version comparison in automake +# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a +# but this should suffice as we won't be specifying old +# version formats or redundant trailing .0 in bootstrap.conf. +# If we did want full compatibility then we should probably +# use m4_version_compare from autoconf. +func_sort_ver () +{ + $debug_cmd + + printf '%s\n%s\n' "$1" "$2" \ + | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n +} + +# func_lt_ver PREV CURR +# --------------------- +# Return true if PREV and CURR are in the correct order according to +# func_sort_ver, otherwise false. Use it like this: +# +# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." +func_lt_ver () +{ + $debug_cmd + + test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: +#! /bin/sh + +# A portable, pluggable option parser for Bourne shell. +# Written by Gary V. Vaughan, 2010 + +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. + +# Please report bugs or propose patches to: +# + +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC + + +## ------ ## +## Usage. ## +## ------ ## + +# This file is a library for parsing options in your shell scripts along +# with assorted other useful supporting features that you can make use +# of too. +# +# For the simplest scripts you might need only: +# +# #!/bin/sh +# . relative/path/to/funclib.sh +# . relative/path/to/options-parser +# scriptversion=1.0 +# func_options ${1+"$@"} +# eval set dummy "$func_options_result"; shift +# ...rest of your script... +# +# In order for the '--version' option to work, you will need to have a +# suitably formatted comment like the one at the top of this file +# starting with '# Written by ' and ending with '# Copyright'. +# +# For '-h' and '--help' to work, you will also need a one line +# description of your script's purpose in a comment directly above the +# '# Written by ' line, like the one at the top of this file. +# +# The default options also support '--debug', which will turn on shell +# execution tracing (see the comment above debug_cmd below for another +# use), and '--verbose' and the func_verbose function to allow your script +# to display verbose messages only when your user has specified +# '--verbose'. +# +# After sourcing this file, you can plug in processing for additional +# options by amending the variables from the 'Configuration' section +# below, and following the instructions in the 'Option parsing' +# section further down. + +## -------------- ## +## Configuration. ## +## -------------- ## + +# You should override these variables in your script after sourcing this +# file so that they reflect the customisations you have added to the +# option parser. + +# The usage line for option parsing errors and the start of '-h' and +# '--help' output messages. You can embed shell variables for delayed +# expansion at the time the message is displayed, but you will need to +# quote other shell meta-characters carefully to prevent them being +# expanded when the contents are evaled. +usage='$progpath [OPTION]...' + +# Short help message in response to '-h' and '--help'. Add to this or +# override it after sourcing this library to reflect the full set of +# options your script accepts. +usage_message="\ + --debug enable verbose shell tracing + -W, --warnings=CATEGORY + report the warnings falling in CATEGORY [all] + -v, --verbose verbosely report processing + --version print version information and exit + -h, --help print short or long help message and exit +" + +# Additional text appended to 'usage_message' in response to '--help'. +long_help_message=" +Warning categories include: + 'all' show all warnings + 'none' turn off all the warnings + 'error' warnings are treated as fatal errors" + +# Help message printed before fatal option parsing errors. +fatal_help="Try '\$progname --help' for more information." + + + +## ------------------------- ## +## Hook function management. ## +## ------------------------- ## + +# This section contains functions for adding, removing, and running hooks +# in the main code. A hook is just a list of function names that can be +# run in order later on. + +# func_hookable FUNC_NAME +# ----------------------- +# Declare that FUNC_NAME will run hooks added with +# 'func_add_hook FUNC_NAME ...'. +func_hookable () +{ + $debug_cmd + + func_append hookable_fns " $1" +} + + +# func_add_hook FUNC_NAME HOOK_FUNC +# --------------------------------- +# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must +# first have been declared "hookable" by a call to 'func_hookable'. +func_add_hook () +{ + $debug_cmd + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not accept hook functions." ;; + esac + + eval func_append ${1}_hooks '" $2"' +} + + +# func_remove_hook FUNC_NAME HOOK_FUNC +# ------------------------------------ +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. +func_remove_hook () +{ + $debug_cmd + + eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' +} + + +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + +# func_run_hooks FUNC_NAME [ARG]... +# --------------------------------- +# Run all hook functions registered to FUNC_NAME. +# It's assumed that the list of hook functions contains nothing more +# than a whitespace-delimited list of legal shell function names, and +# no effort is wasted trying to catch shell meta-characters or preserve +# whitespace. +func_run_hooks () +{ + $debug_cmd + + _G_rc_run_hooks=false + + case " $hookable_fns " in + *" $1 "*) ;; + *) func_fatal_error "'$1' does not support hook functions." ;; + esac + + eval _G_hook_fns=\$$1_hooks; shift + + for _G_hook in $_G_hook_fns; do + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi + done +} + + + +## --------------- ## +## Option parsing. ## +## --------------- ## + +# In order to add your own option parsing hooks, you must accept the +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: +# +# my_options_prep () +# { +# $debug_cmd +# +# # Extend the existing usage message. +# usage_message=$usage_message' +# -s, --silent don'\''t print informational messages +# ' +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. +# } +# func_add_hook func_options_prep my_options_prep +# +# +# my_silent_option () +# { +# $debug_cmd +# +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can +# # recognise in a loop before passing the remainder back to the +# # caller on the first unrecognised argument we encounter. +# while test $# -gt 0; do +# opt=$1; shift +# case $opt in +# --silent|-s) opt_silent=: +# args_changed=: +# ;; +# # Separate non-argument short options: +# -s*) func_split_short_opt "$_G_opt" +# set dummy "$func_split_short_opt_name" \ +# "-$func_split_short_opt_arg" ${1+"$@"} +# shift +# args_changed=: +# ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; +# esac +# done +# +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi +# } +# func_add_hook func_parse_options my_silent_option +# +# +# my_option_validation () +# { +# $debug_cmd +# +# $opt_silent && $opt_verbose && func_fatal_help "\ +# '--silent' and '--verbose' options are mutually exclusive." +# } +# func_add_hook func_validate_options my_option_validation +# +# You'll also need to manually amend $usage_message to reflect the extra +# options you parse. It's preferable to append if you can, so that +# multiple option parsing hooks can be added safely. + + +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + +# func_options [ARG]... +# --------------------- +# All the functions called inside func_options are hookable. See the +# individual implementations for details. +func_hookable func_options +func_options () +{ + $debug_cmd + + _G_options_quoted=false + + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done + + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } +} + + +# func_options_prep [ARG]... +# -------------------------- +# All initialisations required before starting the option parse loop. +# Note that when calling hook functions, we pass through the list of +# positional parameters. If a hook function modifies that list, and +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. +func_hookable func_options_prep +func_options_prep () +{ + $debug_cmd + + # Option defaults: + opt_verbose=false + opt_warning_types= + + func_run_hooks func_options_prep ${1+"$@"} + func_propagate_result func_run_hooks func_options_prep +} + + +# func_parse_options [ARG]... +# --------------------------- +# The main option parsing loop. +func_hookable func_parse_options +func_parse_options () +{ + $debug_cmd + + _G_parse_options_requote=false + # this just eases exit handling + while test $# -gt 0; do + # Defer to hook functions for initial option parsing, so they + # get priority in the event of reusing an option name. + func_run_hooks func_parse_options ${1+"$@"} + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi + + # Break out of the loop if we already parsed every option. + test $# -gt 0 || break + + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --debug|-x) debug_cmd='set -x' + func_echo "enabling shell trace mode" >&2 + $debug_cmd + ;; + + --no-warnings|--no-warning|--no-warn) + set dummy --warnings none ${1+"$@"} + shift + ;; + + --warnings|--warning|-W) + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi + case " $warning_categories $1" in + *" $1 "*) + # trailing space prevents matching last $1 above + func_append_uniq opt_warning_types " $1" + ;; + *all) + opt_warning_types=$warning_categories + ;; + *none) + opt_warning_types=none + warning_func=: + ;; + *error) + opt_warning_types=$warning_categories + warning_func=func_fatal_error + ;; + *) + func_fatal_error \ + "unsupported warning category: '$1'" + ;; + esac + shift + ;; + + --verbose|-v) opt_verbose=: ;; + --version) func_version ;; + -\?|-h) func_usage ;; + --help) func_help ;; + + # Separate optargs to long options (plugins may need this): + --*=*) func_split_equals "$_G_opt" + set dummy "$func_split_equals_lhs" \ + "$func_split_equals_rhs" ${1+"$@"} + shift + ;; + + # Separate optargs to short options: + -W*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + # Separate non-argument short options: + -\?*|-h*|-v*|-x*) + func_split_short_opt "$_G_opt" + set dummy "$func_split_short_opt_name" \ + "-$func_split_short_opt_arg" ${1+"$@"} + shift + ;; + + --) _G_parse_options_requote=: ; break ;; + -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; + esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi + done + + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi +} + + +# func_validate_options [ARG]... +# ------------------------------ +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +func_hookable func_validate_options +func_validate_options () +{ + $debug_cmd + + # Display all warnings if -W was not given. + test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" + + func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options + + # Bail if the options were screwed! + $exit_cmd $EXIT_FAILURE +} + + + +## ----------------- ## +## Helper functions. ## +## ----------------- ## + +# This section contains the helper functions used by the rest of the +# hookable option parser framework in ascii-betical order. + + +# func_fatal_help ARG... +# ---------------------- +# Echo program name prefixed message to standard error, followed by +# a help hint, and exit. +func_fatal_help () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + eval \$ECHO \""$fatal_help"\" + func_error ${1+"$@"} + exit $EXIT_FAILURE +} + + +# func_help +# --------- +# Echo long help message to standard output and exit. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message" + exit 0 +} + + +# func_missing_arg ARGNAME +# ------------------------ +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + $debug_cmd + + func_error "Missing argument for '$1'." + exit_cmd=exit +} + + +# func_split_equals STRING +# ------------------------ +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. +test -z "$_G_HAVE_XSI_OPS" \ + && (eval 'x=a/b/c; + test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ + && _G_HAVE_XSI_OPS=yes + +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=${1%%=*} + func_split_equals_rhs=${1#*=} + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_equals () + { + $debug_cmd + + func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` + func_split_equals_rhs= + test "x$func_split_equals_lhs=" = "x$1" \ + || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` + } +fi #func_split_equals + + +# func_split_short_opt SHORTOPT +# ----------------------------- +# Set func_split_short_opt_name and func_split_short_opt_arg shell +# variables after splitting SHORTOPT after the 2nd character. +if test yes = "$_G_HAVE_XSI_OPS" +then + # This is an XSI compatible shell, allowing a faster implementation... + eval 'func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_arg=${1#??} + func_split_short_opt_name=${1%"$func_split_short_opt_arg"} + }' +else + # ...otherwise fall back to using expr, which is often a shell builtin. + func_split_short_opt () + { + $debug_cmd + + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` + func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` + } +fi #func_split_short_opt + + +# func_usage +# ---------- +# Echo short help message to standard output and exit. +func_usage () +{ + $debug_cmd + + func_usage_message + $ECHO "Run '$progname --help |${PAGER-more}' for full usage" + exit 0 +} + + +# func_usage_message +# ------------------ +# Echo short help message to standard output. +func_usage_message () +{ + $debug_cmd + + eval \$ECHO \""Usage: $usage"\" + echo + $SED -n 's|^# || + /^Written by/{ + x;p;x + } + h + /^Written by/q' < "$progpath" + echo + eval \$ECHO \""$usage_message"\" +} + + +# func_version +# ------------ +# Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. +func_version () +{ + $debug_cmd + + printf '%s\n' "$progname $scriptversion" + $SED -n ' + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk + } + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt + } + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" + + exit $? +} + + +# Local variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-time-zone: "UTC" +# End: + +# Set a version string. +scriptversion='(GNU libtool) 2.4.7' + + +# func_echo ARG... +# ---------------- +# Libtool also displays the current mode in messages, so override +# funclib.sh func_echo with this custom definition. +func_echo () +{ + $debug_cmd + + _G_message=$* + + func_echo_IFS=$IFS + IFS=$nl + for _G_line in $_G_message; do + IFS=$func_echo_IFS + $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" + done + IFS=$func_echo_IFS +} + + +# func_warning ARG... +# ------------------- +# Libtool warnings are not categorized, so override funclib.sh +# func_warning with this simpler definition. +func_warning () +{ + $debug_cmd + + $warning_func ${1+"$@"} +} + + +## ---------------- ## +## Options parsing. ## +## ---------------- ## + +# Hook in the functions to make sure our own options are parsed during +# the option parsing loop. + +usage='$progpath [OPTION]... [MODE-ARG]...' + +# Short help message in response to '-h'. +usage_message="Options: + --config show all configuration variables + --debug enable verbose shell tracing + -n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --mode=MODE use operation mode MODE + --no-warnings equivalent to '-Wnone' + --preserve-dup-deps don't remove duplicate dependency libraries + --quiet, --silent don't print informational messages + --tag=TAG use configuration variables from tag TAG + -v, --verbose print more informational messages than default + --version print version information + -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] + -h, --help, --help-all print short, long, or detailed help message +" + +# Additional text appended to 'usage_message' in response to '--help'. +func_help () +{ + $debug_cmd + + func_usage_message + $ECHO "$long_help_message + +MODE must be one of the following: + + clean remove files from the build directory + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. When passed as first option, +'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. +Try '$progname --help --mode=MODE' for a more detailed description of MODE. + +When reporting a bug, please describe a test case to reproduce it and +include the following information: + + host-triplet: $host + shell: $SHELL + compiler: $LTCC + compiler flags: $LTCFLAGS + linker: $LD (gnu? $with_gnu_ld) + version: $progname $scriptversion Debian-2.4.7-5 + automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` + autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` + +Report bugs to . +GNU libtool home page: . +General help using GNU software: ." + exit 0 +} + + +# func_lo2o OBJECT-NAME +# --------------------- +# Transform OBJECT-NAME from a '.lo' suffix to the platform specific +# object suffix. + +lo2o=s/\\.lo\$/.$objext/ +o2lo=s/\\.$objext\$/.lo/ + +if test yes = "$_G_HAVE_XSI_OPS"; then + eval 'func_lo2o () + { + case $1 in + *.lo) func_lo2o_result=${1%.lo}.$objext ;; + * ) func_lo2o_result=$1 ;; + esac + }' + + # func_xform LIBOBJ-OR-SOURCE + # --------------------------- + # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) + # suffix to a '.lo' libtool-object suffix. + eval 'func_xform () + { + func_xform_result=${1%.*}.lo + }' +else + # ...otherwise fall back to using sed. + func_lo2o () + { + func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` + } + + func_xform () + { + func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` + } +fi + + +# func_fatal_configuration ARG... +# ------------------------------- +# Echo program name prefixed message to standard error, followed by +# a configuration failure hint, and exit. +func_fatal_configuration () +{ + func_fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." +} + + +# func_config +# ----------- +# Display the configuration for all the tags in this script. +func_config () +{ + re_begincf='^# ### BEGIN LIBTOOL' + re_endcf='^# ### END LIBTOOL' + + # Default configuration. + $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" + + # Now print the configurations for the tags. + for tagname in $taglist; do + $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" + done + + exit $? +} + + +# func_features +# ------------- +# Display the features supported by this script. +func_features () +{ + echo "host: $host" + if test yes = "$build_libtool_libs"; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test yes = "$build_old_libs"; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + + exit $? +} + + +# func_enable_tag TAGNAME +# ----------------------- +# Verify that TAGNAME is valid, and either flag an error and exit, or +# enable the TAGNAME tag. We also add TAGNAME to the global $taglist +# variable here. +func_enable_tag () +{ + # Global variable: + tagname=$1 + + re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" + re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" + sed_extractcf=/$re_begincf/,/$re_endcf/p + + # Validate tagname. + case $tagname in + *[!-_A-Za-z0-9,/]*) + func_fatal_error "invalid tag name: $tagname" + ;; + esac + + # Don't test for the "default" C tag, as we know it's + # there but not specially marked. + case $tagname in + CC) ;; + *) + if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then + taglist="$taglist $tagname" + + # Evaluate the configuration. Be careful to quote the path + # and the sed script, to avoid splitting on whitespace, but + # also don't use non-portable quotes within backquotes within + # quotes we have to do it in 2 steps: + extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` + eval "$extractedcf" + else + func_error "ignoring unknown tag $tagname" + fi + ;; + esac +} + + +# func_check_version_match +# ------------------------ +# Ensure that we are using m4 macros, and libtool script from the same +# release of libtool. +func_check_version_match () +{ + if test "$package_revision" != "$macro_revision"; then + if test "$VERSION" != "$macro_version"; then + if test -z "$macro_version"; then + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from an older release. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION +$progname: and run autoconf again. +_LT_EOF + fi + else + cat >&2 <<_LT_EOF +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, +$progname: but the definition of this LT_INIT comes from revision $macro_revision. +$progname: You should recreate aclocal.m4 with macros from revision $package_revision +$progname: of $PACKAGE $VERSION and run autoconf again. +_LT_EOF + fi + + exit $EXIT_MISMATCH + fi +} + + +# libtool_options_prep [ARG]... +# ----------------------------- +# Preparation for options parsed by libtool. +libtool_options_prep () +{ + $debug_mode + + # Option defaults: + opt_config=false + opt_dlopen= + opt_dry_run=false + opt_help=false + opt_mode= + opt_preserve_dup_deps=false + opt_quiet=false + + nonopt= + preserve_args= + + _G_rc_lt_options_prep=: + + _G_rc_lt_options_prep=: + + # Shorthand for --mode=foo, only valid as the first argument + case $1 in + clean|clea|cle|cl) + shift; set dummy --mode clean ${1+"$@"}; shift + ;; + compile|compil|compi|comp|com|co|c) + shift; set dummy --mode compile ${1+"$@"}; shift + ;; + execute|execut|execu|exec|exe|ex|e) + shift; set dummy --mode execute ${1+"$@"}; shift + ;; + finish|finis|fini|fin|fi|f) + shift; set dummy --mode finish ${1+"$@"}; shift + ;; + install|instal|insta|inst|ins|in|i) + shift; set dummy --mode install ${1+"$@"}; shift + ;; + link|lin|li|l) + shift; set dummy --mode link ${1+"$@"}; shift + ;; + uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) + shift; set dummy --mode uninstall ${1+"$@"}; shift + ;; + *) + _G_rc_lt_options_prep=false + ;; + esac + + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi +} +func_add_hook func_options_prep libtool_options_prep + + +# libtool_parse_options [ARG]... +# --------------------------------- +# Provide handling for libtool specific options. +libtool_parse_options () +{ + $debug_cmd + + _G_rc_lt_parse_options=false + + # Perform our own loop to consume as many options as possible in + # each iteration. + while test $# -gt 0; do + _G_match_lt_parse_options=: + _G_opt=$1 + shift + case $_G_opt in + --dry-run|--dryrun|-n) + opt_dry_run=: + ;; + + --config) func_config ;; + + --dlopen|-dlopen) + opt_dlopen="${opt_dlopen+$opt_dlopen +}$1" + shift + ;; + + --preserve-dup-deps) + opt_preserve_dup_deps=: ;; + + --features) func_features ;; + + --finish) set dummy --mode finish ${1+"$@"}; shift ;; + + --help) opt_help=: ;; + + --help-all) opt_help=': help-all' ;; + + --mode) test $# = 0 && func_missing_arg $_G_opt && break + opt_mode=$1 + case $1 in + # Valid mode arguments: + clean|compile|execute|finish|install|link|relink|uninstall) ;; + + # Catch anything else as an error + *) func_error "invalid argument for $_G_opt" + exit_cmd=exit + break + ;; + esac + shift + ;; + + --no-silent|--no-quiet) + opt_quiet=false + func_append preserve_args " $_G_opt" + ;; + + --no-warnings|--no-warning|--no-warn) + opt_warning=false + func_append preserve_args " $_G_opt" + ;; + + --no-verbose) + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --silent|--quiet) + opt_quiet=: + opt_verbose=false + func_append preserve_args " $_G_opt" + ;; + + --tag) test $# = 0 && func_missing_arg $_G_opt && break + opt_tag=$1 + func_append preserve_args " $_G_opt $1" + func_enable_tag "$1" + shift + ;; + + --verbose|-v) opt_quiet=false + opt_verbose=: + func_append preserve_args " $_G_opt" + ;; + + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; + esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: + done + + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi +} +func_add_hook func_parse_options libtool_parse_options + + + +# libtool_validate_options [ARG]... +# --------------------------------- +# Perform any sanity checks on option settings and/or unconsumed +# arguments. +libtool_validate_options () +{ + # save first non-option argument + if test 0 -lt $#; then + nonopt=$1 + shift + fi + + # preserve --debug + test : = "$debug_cmd" || func_append preserve_args " --debug" + + case $host in + # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 + # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 + *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps + ;; + esac + + $opt_help || { + # Sanity checks first: + func_check_version_match + + test yes != "$build_libtool_libs" \ + && test yes != "$build_old_libs" \ + && func_fatal_configuration "not configured to build any kind of library" + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$opt_dlopen" && test execute != "$opt_mode"; then + func_error "unrecognized option '-dlopen'" + $ECHO "$help" 1>&2 + exit $EXIT_FAILURE + fi + + # Change the help message to a mode-specific one. + generic_help=$help + help="Try '$progname --help --mode=$opt_mode' for more information." + } + + # Pass back the unparsed argument list + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result +} +func_add_hook func_validate_options libtool_validate_options + + +# Process options as early as possible so that --help and --version +# can return quickly. +func_options ${1+"$@"} +eval set dummy "$func_options_result"; shift + + + +## ----------- ## +## Main. ## +## ----------- ## + +magic='%%%MAGIC variable%%%' +magic_exe='%%%MAGIC EXE variable%%%' + +# Global variables. +extracted_archives= +extracted_serial=0 + +# If this variable is set in any of the actions, the command in it +# will be execed at the end. This prevents here-documents from being +# left over by shells. +exec_cmd= + + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# func_generated_by_libtool +# True iff stdin has been generated by Libtool. This function is only +# a basic sanity check; it will hardly flush out determined imposters. +func_generated_by_libtool_p () +{ + $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 +} + +# 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 +# determined imposters. +func_lalib_p () +{ + test -f "$1" && + $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_lalib_unsafe_p file +# True iff FILE is a libtool '.la' library or '.lo' object file. +# This function implements the same check as func_lalib_p without +# resorting to external programs. To this end, it redirects stdin and +# closes it afterwards, without saving the original file descriptor. +# As a safety measure, use it only where a negative result would be +# fatal anyway. Works if 'file' does not exist. +func_lalib_unsafe_p () +{ + lalib_p=no + if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + for lalib_p_l in 1 2 3 4 + do + read lalib_p_line + case $lalib_p_line in + \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; + esac + done + exec 0<&5 5<&- + fi + test yes = "$lalib_p" +} + +# func_ltwrapper_script_p file +# True iff FILE is a libtool wrapper script +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_script_p () +{ + test -f "$1" && + $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p +} + +# func_ltwrapper_executable_p file +# True iff FILE is a libtool wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_executable_p () +{ + func_ltwrapper_exec_suffix= + case $1 in + *.exe) ;; + *) func_ltwrapper_exec_suffix=.exe ;; + esac + $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 +} + +# func_ltwrapper_scriptname file +# Assumes file is an ltwrapper_executable +# uses $file to determine the appropriate filename for a +# temporary ltwrapper_script. +func_ltwrapper_scriptname () +{ + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper +} + +# func_ltwrapper_p file +# True iff FILE is a libtool wrapper script or wrapper executable +# This function is only a basic sanity check; it will hardly flush out +# determined imposters. +func_ltwrapper_p () +{ + func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" +} + + +# func_execute_cmds commands fail_cmd +# Execute tilde-delimited COMMANDS. +# If FAIL_CMD is given, eval that upon failure. +# FAIL_CMD may read-access the current command in variable CMD! +func_execute_cmds () +{ + $debug_cmd + + save_ifs=$IFS; IFS='~' + for cmd in $1; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + func_show_eval "$cmd" "${2-:}" + done + IFS=$save_ifs +} + + +# func_source file +# Source FILE, adding directory component if necessary. +# Note that it is not necessary on cygwin/mingw to append a dot to +# FILE even if both FILE and FILE.exe exist: automatic-append-.exe +# behavior happens only for exec(3), not for open(2)! Also, sourcing +# 'FILE.' does not work on cygwin managed mounts. +func_source () +{ + $debug_cmd + + case $1 in + */* | *\\*) . "$1" ;; + *) . "./$1" ;; + esac +} + + +# func_resolve_sysroot PATH +# Replace a leading = in PATH with a sysroot. Store the result into +# func_resolve_sysroot_result +func_resolve_sysroot () +{ + func_resolve_sysroot_result=$1 + case $func_resolve_sysroot_result in + =*) + func_stripname '=' '' "$func_resolve_sysroot_result" + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result + ;; + esac +} + +# func_replace_sysroot PATH +# If PATH begins with the sysroot, replace it with = and +# store the result into func_replace_sysroot_result. +func_replace_sysroot () +{ + case $lt_sysroot:$1 in + ?*:"$lt_sysroot"*) + func_stripname "$lt_sysroot" '' "$1" + func_replace_sysroot_result='='$func_stripname_result + ;; + *) + # Including no sysroot. + func_replace_sysroot_result=$1 + ;; + esac +} + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $debug_cmd + + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_append_quoted CC_quoted "$arg" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with '--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=$1 + if test yes = "$build_libtool_libs"; then + write_lobj=\'$2\' + else + write_lobj=none + fi + + if test yes = "$build_old_libs"; then + write_oldobj=\'$3\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T </dev/null` + if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | + $SED -e "$sed_naive_backslashify"` + else + func_convert_core_file_wine_to_w32_result= + fi + fi +} +# end: func_convert_core_file_wine_to_w32 + + +# func_convert_core_path_wine_to_w32 ARG +# Helper function used by path conversion functions when $build is *nix, and +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly +# configured wine environment available, with the winepath program in $build's +# $PATH. Assumes ARG has no leading or trailing path separator characters. +# +# ARG is path to be converted from $build format to win32. +# Result is available in $func_convert_core_path_wine_to_w32_result. +# Unconvertible file (directory) names in ARG are skipped; if no directory names +# are convertible, then the result may be empty. +func_convert_core_path_wine_to_w32 () +{ + $debug_cmd + + # unfortunately, winepath doesn't convert paths, only file names + func_convert_core_path_wine_to_w32_result= + if test -n "$1"; then + oldIFS=$IFS + IFS=: + for func_convert_core_path_wine_to_w32_f in $1; do + IFS=$oldIFS + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" + if test -n "$func_convert_core_file_wine_to_w32_result"; then + if test -z "$func_convert_core_path_wine_to_w32_result"; then + func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result + else + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" + fi + fi + done + IFS=$oldIFS + fi +} +# end: func_convert_core_path_wine_to_w32 + + +# func_cygpath ARGS... +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or +# (2), returns the Cygwin file name or path in func_cygpath_result (input +# file name or path is assumed to be in w32 format, as previously converted +# from $build's *nix or MSYS format). In case (3), returns the w32 file name +# or path in func_cygpath_result (input file name or path is assumed to be in +# Cygwin format). Returns an empty string on error. +# +# ARGS are passed to cygpath, with the last one being the file name or path to +# be converted. +# +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH +# environment variable; do not put it in $PATH. +func_cygpath () +{ + $debug_cmd + + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` + if test "$?" -ne 0; then + # on failure, ensure result is empty + func_cygpath_result= + fi + else + func_cygpath_result= + func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" + fi +} +#end: func_cygpath + + +# func_convert_core_msys_to_w32 ARG +# Convert file name or path ARG from MSYS format to w32 format. Return +# result in func_convert_core_msys_to_w32_result. +func_convert_core_msys_to_w32 () +{ + $debug_cmd + + # awkward: cmd appends spaces to result + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` +} +#end: func_convert_core_msys_to_w32 + + +# func_convert_file_check ARG1 ARG2 +# Verify that ARG1 (a file name in $build format) was converted to $host +# format in ARG2. Otherwise, emit an error message, but continue (resetting +# func_to_host_file_result to ARG1). +func_convert_file_check () +{ + $debug_cmd + + if test -z "$2" && test -n "$1"; then + func_error "Could not determine host file name corresponding to" + func_error " '$1'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback: + func_to_host_file_result=$1 + fi +} +# end func_convert_file_check + + +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH +# Verify that FROM_PATH (a path in $build format) was converted to $host +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting +# func_to_host_file_result to a simplistic fallback value (see below). +func_convert_path_check () +{ + $debug_cmd + + if test -z "$4" && test -n "$3"; then + func_error "Could not determine the host path corresponding to" + func_error " '$3'" + func_error "Continuing, but uninstalled executables may not work." + # Fallback. This is a deliberately simplistic "conversion" and + # should not be "improved". See libtool.info. + if test "x$1" != "x$2"; then + lt_replace_pathsep_chars="s|$1|$2|g" + func_to_host_path_result=`echo "$3" | + $SED -e "$lt_replace_pathsep_chars"` + else + func_to_host_path_result=$3 + fi + fi +} +# end func_convert_path_check + + +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT +# and appending REPL if ORIG matches BACKPAT. +func_convert_path_front_back_pathsep () +{ + $debug_cmd + + case $4 in + $1 ) func_to_host_path_result=$3$func_to_host_path_result + ;; + esac + case $4 in + $2 ) func_append func_to_host_path_result "$3" + ;; + esac +} +# end func_convert_path_front_back_pathsep + + +################################################## +# $build to $host FILE NAME CONVERSION FUNCTIONS # +################################################## +# invoked via '$to_host_file_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# Result will be available in $func_to_host_file_result. + + +# func_to_host_file ARG +# Converts the file name ARG from $build format to $host format. Return result +# in func_to_host_file_result. +func_to_host_file () +{ + $debug_cmd + + $to_host_file_cmd "$1" +} +# end func_to_host_file + + +# func_to_tool_file ARG LAZY +# converts the file name ARG from $build format to toolchain format. Return +# result in func_to_tool_file_result. If the conversion in use is listed +# in (the comma separated) LAZY, no conversion takes place. +func_to_tool_file () +{ + $debug_cmd + + case ,$2, in + *,"$to_tool_file_cmd",*) + func_to_tool_file_result=$1 + ;; + *) + $to_tool_file_cmd "$1" + func_to_tool_file_result=$func_to_host_file_result + ;; + esac +} +# end func_to_tool_file + + +# func_convert_file_noop ARG +# Copy ARG to func_to_host_file_result. +func_convert_file_noop () +{ + func_to_host_file_result=$1 +} +# end func_convert_file_noop + + +# func_convert_file_msys_to_w32 ARG +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_file_result. +func_convert_file_msys_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_to_host_file_result=$func_convert_core_msys_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_w32 + + +# func_convert_file_cygwin_to_w32 ARG +# Convert file name ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_file_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use + # LT_CYGPATH in this case. + func_to_host_file_result=`cygpath -m "$1"` + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_cygwin_to_w32 + + +# func_convert_file_nix_to_w32 ARG +# Convert file name ARG from *nix to w32 format. Requires a wine environment +# and a working winepath. Returns result in func_to_host_file_result. +func_convert_file_nix_to_w32 () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_file_wine_to_w32 "$1" + func_to_host_file_result=$func_convert_core_file_wine_to_w32_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_w32 + + +# func_convert_file_msys_to_cygwin ARG +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_file_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + func_convert_core_msys_to_w32 "$1" + func_cygpath -u "$func_convert_core_msys_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_msys_to_cygwin + + +# func_convert_file_nix_to_cygwin ARG +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result +# in func_to_host_file_result. +func_convert_file_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_file_result=$1 + if test -n "$1"; then + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. + func_convert_core_file_wine_to_w32 "$1" + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" + func_to_host_file_result=$func_cygpath_result + fi + func_convert_file_check "$1" "$func_to_host_file_result" +} +# end func_convert_file_nix_to_cygwin + + +############################################# +# $build to $host PATH CONVERSION FUNCTIONS # +############################################# +# invoked via '$to_host_path_cmd ARG' +# +# In each case, ARG is the path to be converted from $build to $host format. +# The result will be available in $func_to_host_path_result. +# +# Path separators are also converted from $build format to $host format. If +# ARG begins or ends with a path separator character, it is preserved (but +# converted to $host format) on output. +# +# All path conversion functions are named using the following convention: +# file name conversion function : func_convert_file_X_to_Y () +# path conversion function : func_convert_path_X_to_Y () +# where, for any given $build/$host combination the 'X_to_Y' value is the +# same. If conversion functions are added for new $build/$host combinations, +# the two new functions must follow this pattern, or func_init_to_host_path_cmd +# will break. + + +# func_init_to_host_path_cmd +# Ensures that function "pointer" variable $to_host_path_cmd is set to the +# appropriate value, based on the value of $to_host_file_cmd. +to_host_path_cmd= +func_init_to_host_path_cmd () +{ + $debug_cmd + + if test -z "$to_host_path_cmd"; then + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" + to_host_path_cmd=func_convert_path_$func_stripname_result + fi +} + + +# func_to_host_path ARG +# Converts the path ARG from $build format to $host format. Return result +# in func_to_host_path_result. +func_to_host_path () +{ + $debug_cmd + + func_init_to_host_path_cmd + $to_host_path_cmd "$1" +} +# end func_to_host_path + + +# func_convert_path_noop ARG +# Copy ARG to func_to_host_path_result. +func_convert_path_noop () +{ + func_to_host_path_result=$1 +} +# end func_convert_path_noop + + +# func_convert_path_msys_to_w32 ARG +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic +# conversion to w32 is not available inside the cwrapper. Returns result in +# func_to_host_path_result. +func_convert_path_msys_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from ARG. MSYS + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; + # and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_msys_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_msys_to_w32 + + +# func_convert_path_cygwin_to_w32 ARG +# Convert path ARG from Cygwin to w32 format. Returns result in +# func_to_host_file_result. +func_convert_path_cygwin_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_cygwin_to_w32 + + +# func_convert_path_nix_to_w32 ARG +# Convert path ARG from *nix to w32 format. Requires a wine environment and +# a working winepath. Returns result in func_to_host_file_result. +func_convert_path_nix_to_w32 () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_to_host_path_result=$func_convert_core_path_wine_to_w32_result + func_convert_path_check : ";" \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" + fi +} +# end func_convert_path_nix_to_w32 + + +# func_convert_path_msys_to_cygwin ARG +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. +# Returns result in func_to_host_file_result. +func_convert_path_msys_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # See func_convert_path_msys_to_w32: + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_msys_to_cygwin + + +# func_convert_path_nix_to_cygwin ARG +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in +# func_to_host_file_result. +func_convert_path_nix_to_cygwin () +{ + $debug_cmd + + func_to_host_path_result=$1 + if test -n "$1"; then + # Remove leading and trailing path separator characters from + # ARG. msys behavior is inconsistent here, cygpath turns them + # into '.;' and ';.', and winepath ignores them completely. + func_stripname : : "$1" + func_to_host_path_tmp1=$func_stripname_result + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" + func_to_host_path_result=$func_cygpath_result + func_convert_path_check : : \ + "$func_to_host_path_tmp1" "$func_to_host_path_result" + func_convert_path_front_back_pathsep ":*" "*:" : "$1" + fi +} +# end func_convert_path_nix_to_cygwin + + +# func_dll_def_p FILE +# True iff FILE is a Windows DLL '.def' file. +# Keep in sync with _LT_DLL_DEF_P in libtool.m4 +func_dll_def_p () +{ + $debug_cmd + + func_dll_def_p_tmp=`$SED -n \ + -e 's/^[ ]*//' \ + -e '/^\(;.*\)*$/d' \ + -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ + -e q \ + "$1"` + test DEF = "$func_dll_def_p_tmp" +} + + +# func_mode_compile arg... +func_mode_compile () +{ + $debug_cmd + + # Get the compilation command and the source file. + base_compile= + srcfile=$nonopt # always keep a non-empty value in "srcfile" + suppress_opt=yes + suppress_output= + arg_mode=normal + libobj= + later= + pie_flag= + + for arg + do + case $arg_mode in + arg ) + # do not "continue". Instead, add this to base_compile + lastarg=$arg + arg_mode=normal + ;; + + target ) + libobj=$arg + arg_mode=normal + continue + ;; + + normal ) + # Accept any command-line options. + case $arg in + -o) + test -n "$libobj" && \ + func_fatal_error "you cannot specify '-o' more than once" + arg_mode=target + continue + ;; + + -pie | -fpie | -fPIE) + func_append pie_flag " $arg" + continue + ;; + + -shared | -static | -prefer-pic | -prefer-non-pic) + func_append later " $arg" + continue + ;; + + -no-suppress) + suppress_opt=no + continue + ;; + + -Xcompiler) + arg_mode=arg # the next one goes into the "base_compile" arg list + continue # The current "srcfile" will either be retained or + ;; # replaced later. I would guess that would be a bug. + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + lastarg= + save_ifs=$IFS; IFS=, + for arg in $args; do + IFS=$save_ifs + func_append_quoted lastarg "$arg" + done + IFS=$save_ifs + func_stripname ' ' '' "$lastarg" + lastarg=$func_stripname_result + + # Add the arguments to base_compile. + func_append base_compile " $lastarg" + continue + ;; + + *) + # Accept the current argument as the source file. + # The previous "srcfile" becomes the current argument. + # + lastarg=$srcfile + srcfile=$arg + ;; + esac # case $arg + ;; + esac # case $arg_mode + + # Aesthetically quote the previous argument. + func_append_quoted base_compile "$lastarg" + done # for arg + + case $arg_mode in + arg) + func_fatal_error "you must specify an argument for -Xcompile" + ;; + target) + func_fatal_error "you must specify a target with '-o'" + ;; + *) + # Get the name of the library object. + test -z "$libobj" && { + func_basename "$srcfile" + libobj=$func_basename_result + } + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + case $libobj in + *.[cCFSifmso] | \ + *.ada | *.adb | *.ads | *.asm | \ + *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ + *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) + func_xform "$libobj" + libobj=$func_xform_result + ;; + esac + + case $libobj in + *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; + *) + func_fatal_error "cannot determine name of library object from '$libobj'" + ;; + esac + + func_infer_tag $base_compile + + for arg in $later; do + case $arg in + -shared) + test yes = "$build_libtool_libs" \ + || func_fatal_configuration "cannot build a shared library" + build_old_libs=no + continue + ;; + + -static) + build_libtool_libs=no + build_old_libs=yes + continue + ;; + + -prefer-pic) + pic_mode=yes + continue + ;; + + -prefer-non-pic) + pic_mode=no + continue + ;; + esac + done + + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ + && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ + && func_warning "libobj name '$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname=$func_basename_result + xdir=$func_dirname_result + lobj=$xdir$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test yes = "$build_old_libs"; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test no = "$compiler_c_o"; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext + lockfile=$output_obj.lock + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test yes = "$need_locks"; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test warn = "$need_locks"; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + func_append removelist " $output_obj" + $ECHO "$srcfile" > "$lockfile" + fi + + $opt_dry_run || $RM $removelist + func_append removelist " $lockfile" + trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 + + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 + srcfile=$func_to_tool_file_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result + + # Only build a PIC object if we are building libtool libraries. + if test yes = "$build_libtool_libs"; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + if test no != "$pic_mode"; then + command="$base_compile $qsrcfile $pic_flag" + else + # Don't build PIC code + command="$base_compile $qsrcfile" + fi + + func_mkdir_p "$xdir$objdir" + + if test -z "$output_obj"; then + # Place PIC objects in $objdir + func_append command " -o $lobj" + fi + + func_show_eval_locale "$command" \ + 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed, then go on to compile the next one + if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then + func_show_eval '$MV "$output_obj" "$lobj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + + # Allow error messages only from the first compilation. + if test yes = "$suppress_opt"; then + suppress_output=' >/dev/null 2>&1' + fi + fi + + # Only build a position-dependent object if we build old libraries. + if test yes = "$build_old_libs"; then + if test yes != "$pic_mode"; then + # Don't build PIC code + command="$base_compile $qsrcfile$pie_flag" + else + command="$base_compile $qsrcfile $pic_flag" + fi + if test yes = "$compiler_c_o"; then + func_append command " -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + func_append command "$suppress_output" + func_show_eval_locale "$command" \ + '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' + + if test warn = "$need_locks" && + test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then + $ECHO "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support '-c' and '-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + + # Just move the object if needed + if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then + func_show_eval '$MV "$output_obj" "$obj"' \ + 'error=$?; $opt_dry_run || $RM $removelist; exit $error' + fi + fi + + $opt_dry_run || { + func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" + + # Unlock the critical section if it was locked + if test no != "$need_locks"; then + removelist=$lockfile + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +$opt_help || { + test compile = "$opt_mode" && func_mode_compile ${1+"$@"} +} + +func_mode_help () +{ + # We need to display help for each of the modes. + case $opt_mode in + "") + # Generic help is extracted from the usage comments + # at the start of this file. + func_help + ;; + + clean) + $ECHO \ +"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... + +Remove files from the build directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, object or program, all the files associated +with it are deleted. Otherwise, only FILE itself is deleted using RM." + ;; + + compile) + $ECHO \ +"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -no-suppress do not suppress compiler output for multiple passes + -prefer-pic try to build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a '.o' file suitable for static linking + -static only build a '.o' file suitable for static linking + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a 'standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix '.c' with the +library object suffix, '.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to '-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the '--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the 'install' or 'cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE use a list of object files found in FILE to specify objects + -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with '-') are ignored. + +Every other argument is treated as a filename. Files ending in '.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in '.la', then a libtool library is created, +only library objects ('.lo' files) may be specified, and '-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created +using 'ar' and 'ranlib', or on Windows using 'lib'. + +If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode '$opt_mode'" + ;; + esac + + echo + $ECHO "Try '$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test : = "$opt_help"; then + func_mode_help + else + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | $SED -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for opt_mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + $SED '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $debug_cmd + + # The first argument is the command name. + cmd=$nonopt + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $opt_dlopen; do + test -f "$file" \ + || func_fatal_help "'$file' is not a file" + + dir= + case $file in + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$lib' is not a valid libtool archive" + + # Read the libtool library. + dlname= + library_names= + func_source "$file" + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && \ + func_warning "'$file' was not linked with '-export-dynamic'" + continue + fi + + func_dirname "$file" "" "." + dir=$func_dirname_result + + if test -f "$dir/$objdir/$dlname"; then + func_append dir "/$objdir" + else + if test ! -f "$dir/$dlname"; then + func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" + fi + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + func_dirname "$file" "" "." + dir=$func_dirname_result + ;; + + *) + func_warning "'-dlopen' is ignored for non-libtool libraries and objects" + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir=$absdir + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic=$magic + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case $file in + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file=$progdir/$program + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file=$progdir/$program + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_append_quoted args "$file" + done + + if $opt_dry_run; then + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" + echo "export $shlibpath_var" + fi + $ECHO "$cmd$args" + exit $EXIT_SUCCESS + else + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved environment variables + for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES + do + eval "if test \"\${save_$lt_var+set}\" = set; then + $lt_var=\$save_$lt_var; export $lt_var + else + $lt_unset $lt_var + fi" + done + + # Now prepare to actually exec the command. + exec_cmd=\$cmd$args + fi +} + +test execute = "$opt_mode" && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $debug_cmd + + libs= + libdirs= + admincmds= + + for opt in "$nonopt" ${1+"$@"} + do + if test -d "$opt"; then + func_append libdirs " $opt" + + elif test -f "$opt"; then + if func_lalib_unsafe_p "$opt"; then + func_append libs " $opt" + else + func_warning "'$opt' is not a valid libtool archive" + fi + + else + func_fatal_error "invalid argument '$opt'" + fi + done + + if test -n "$libs"; then + if test -n "$lt_sysroot"; then + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" + else + sysroot_cmd= + fi + + # Remove sysroot references + if $opt_dry_run; then + for lib in $libs; do + echo "removing references to $lt_sysroot and '=' prefixes from $lib" + done + else + tmpdir=`func_mktempdir` + for lib in $libs; do + $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ + > $tmpdir/tmp-la + mv -f $tmpdir/tmp-la $lib + done + ${RM}r "$tmpdir" + fi + fi + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + func_execute_cmds "$finish_cmds" 'admincmds="$admincmds +'"$cmd"'"' + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $opt_dry_run || eval "$cmds" || func_append admincmds " + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_quiet && exit $EXIT_SUCCESS + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use the '-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the '$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the '$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the '$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" + fi + echo + + echo "See any operating system documentation about shared libraries for" + case $host in + solaris2.[6789]|solaris2.1[0-9]) + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" + echo "pages." + ;; + *) + echo "more information, such as the ld(1) and ld.so(8) manual pages." + ;; + esac + echo "----------------------------------------------------------------------" + fi + exit $EXIT_SUCCESS +} + +test finish = "$opt_mode" && func_mode_finish ${1+"$@"} + + +# func_mode_install arg... +func_mode_install () +{ + $debug_cmd + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || + # Allow the use of GNU shtool's install command. + case $nonopt in *shtool*) :;; *) false;; esac + then + # Aesthetically quote it. + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=false + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + func_append files " $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=: ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test X-m = "X$prev" && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" + if test -n "$arg2"; then + func_quote_arg pretty "$arg2" + fi + func_append install_shared_prog " $func_quote_arg_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the '$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=: + if $isdir; then + destdir=$dest + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir=$func_dirname_result + destname=$func_basename_result + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "'$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "'$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + func_append staticlibs " $file" + ;; + + *.la) + func_resolve_sysroot "$file" + file=$func_resolve_sysroot_result + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$file" \ + || func_fatal_help "'$file' is not a valid libtool archive" + + library_names= + old_library= + relink_command= + func_source "$file" + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) func_append current_libdirs " $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) func_append future_libdirs " $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir=$func_dirname_result + func_append dir "$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking '$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname=$1 + shift + + srcname=$realname + test -n "$relink_command" && srcname=${realname}T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme=$stripme + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme= + ;; + esac + ;; + os2*) + case $realname in + *_dll.a) + tstripme= + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try 'ln -sf' first, because the 'ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib=$destdir/$realname + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name=$func_basename_result + instname=$dir/${name}i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && func_append staticlibs " $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # Deduce the name of the destination old-style object file. + case $destfile in + *.lo) + func_lo2o "$destfile" + staticdest=$func_lo2o_result + ;; + *.$objext) + staticdest=$destfile + destfile= + ;; + *) + func_fatal_help "cannot copy a libtool object to '$destfile'" + ;; + esac + + # Install the libtool object if requested. + test -n "$destfile" && \ + func_show_eval "$install_prog $file $destfile" 'exit $?' + + # Install the old object if enabled. + if test yes = "$build_old_libs"; then + # Deduce the name of the old-style object file. + func_lo2o "$file" + staticobj=$func_lo2o_result + func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' + fi + exit $EXIT_SUCCESS + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile=$destdir/$destname + else + func_basename "$file" + destfile=$func_basename_result + destfile=$destdir/$destfile + fi + + # If the file is missing, and there is a .exe on the end, strip it + # because it is most likely a libtool script we actually want to + # install + stripped_ext= + case $file in + *.exe) + if test ! -f "$file"; then + func_stripname '' '.exe' "$file" + file=$func_stripname_result + stripped_ext=.exe + fi + ;; + esac + + # Do a test to see if this is really a libtool program. + case $host in + *cygwin* | *mingw*) + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + wrapper=$func_ltwrapper_scriptname_result + else + func_stripname '' '.exe' "$file" + wrapper=$func_stripname_result + fi + ;; + *) + wrapper=$file + ;; + esac + if func_ltwrapper_script_p "$wrapper"; then + notinst_deplibs= + relink_command= + + func_source "$wrapper" + + # Check the variables that should have been set. + test -z "$generated_by_libtool_version" && \ + func_fatal_error "invalid libtool wrapper script '$wrapper'" + + finalize=: + for lib in $notinst_deplibs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + func_source "$lib" + fi + libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "'$lib' has not been installed in '$libdir'" + finalize=false + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test no = "$fast_install" && test -n "$relink_command"; then + $opt_dry_run || { + if $finalize; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file=$func_basename_result + outputname=$tmpdir/$file + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_quiet || { + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink '$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file=$outputname + else + func_warning "cannot relink '$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name=$func_basename_result + + # Set up the ranlib parameters. + oldlib=$destdir/$name + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + + func_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $tool_oldlib" 'exit $?' + fi + + # Do each command in the postinstall commands. + func_execute_cmds "$old_postinstall_cmds" 'exit $?' + done + + test -n "$future_libdirs" && \ + func_warning "remember to run '$progname --finish$future_libdirs'" + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + $opt_dry_run && current_libdirs=" -n$current_libdirs" + exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' + else + exit $EXIT_SUCCESS + fi +} + +test install = "$opt_mode" && func_mode_install ${1+"$@"} + + +# func_generate_dlsyms outputname originator pic_p +# Extract symbols from dlprefiles and create ${outputname}S.o with +# a dlpreopen symbol table. +func_generate_dlsyms () +{ + $debug_cmd + + my_outputname=$1 + my_originator=$2 + my_pic_p=${3-false} + my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` + my_dlsyms= + + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + my_dlsyms=${my_outputname}S.c + else + func_error "not configured to extract global symbols from dlpreopened files" + fi + fi + + if test -n "$my_dlsyms"; then + case $my_dlsyms in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist=$output_objdir/$my_outputname.nm + + func_show_eval "$RM $nlist ${nlist}S ${nlist}T" + + # Parse the name list into a source file. + func_verbose "creating $output_objdir/$my_dlsyms" + + $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ +/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ +/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* External symbol declarations for the compiler. */\ +" + + if test yes = "$dlself"; then + func_verbose "generating symbol list for '$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 + func_verbose "extracting global C symbols from '$func_to_tool_file_result'" + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $opt_dry_run || { + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + if test -n "$export_symbols_regex"; then + $opt_dry_run || { + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + } + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols=$output_objdir/$outputname.exp + $opt_dry_run || { + $RM $export_symbols + eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' + ;; + esac + } + else + $opt_dry_run || { + eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' + eval '$MV "$nlist"T "$nlist"' + case $host in + *cygwin* | *mingw* | *cegcc* ) + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' + ;; + esac + } + fi + fi + + for dlprefile in $dlprefiles; do + func_verbose "extracting global C symbols from '$dlprefile'" + func_basename "$dlprefile" + name=$func_basename_result + case $host in + *cygwin* | *mingw* | *cegcc* ) + # if an import library, we need to obtain dlname + if func_win32_import_lib_p "$dlprefile"; then + func_tr_sh "$dlprefile" + eval "curr_lafile=\$libfile_$func_tr_sh_result" + dlprefile_dlbasename= + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then + # Use subshell, to avoid clobbering current variable values + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` + if test -n "$dlprefile_dlname"; then + func_basename "$dlprefile_dlname" + dlprefile_dlbasename=$func_basename_result + else + # no lafile. user explicitly requested -dlpreopen . + $sharedlib_from_linklib_cmd "$dlprefile" + dlprefile_dlbasename=$sharedlib_from_linklib_result + fi + fi + $opt_dry_run || { + if test -n "$dlprefile_dlbasename"; then + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' + else + func_warning "Could not compute DLL name from $name" + eval '$ECHO ": $name " >> "$nlist"' + fi + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + } + else # not an import lib + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + fi + ;; + *) + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + ;; + esac + done + + $opt_dry_run || { + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $MV "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if $GREP -v "^: " < "$nlist" | + if sort -k 3 /dev/null 2>&1; then + sort -k 3 + else + sort +2 + fi | + uniq > "$nlist"S; then + : + else + $GREP -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$my_dlsyms" + fi + + func_show_eval '$RM "${nlist}I"' + if test -n "$global_symbol_to_import"; then + eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' + fi + + echo >> "$output_objdir/$my_dlsyms" "\ + +/* The mapping between symbol names and symbols. */ +typedef struct { + const char *name; + void *address; +} lt_dlsymlist; +extern LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[];\ +" + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ +static void lt_syminit(void) +{ + LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; + for (; symbol->name; ++symbol) + {" + $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" + echo >> "$output_objdir/$my_dlsyms" "\ + } +}" + fi + echo >> "$output_objdir/$my_dlsyms" "\ +LT_DLSYM_CONST lt_dlsymlist +lt_${my_prefix}_LTX_preloaded_symbols[] = +{ {\"$my_originator\", (void *) 0}," + + if test -s "$nlist"I; then + echo >> "$output_objdir/$my_dlsyms" "\ + {\"@INIT@\", (void *) <_syminit}," + fi + + case $need_lib_prefix in + no) + eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + *) + eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" + ;; + esac + echo >> "$output_objdir/$my_dlsyms" "\ + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_${my_prefix}_LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + } # !$opt_dry_run + + pic_flag_for_symtable= + case "$compile_command " in + *" -static "*) ;; + *) + case $host in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; + *-*-hpux*) + pic_flag_for_symtable=" $pic_flag" ;; + *) + $my_pic_p && pic_flag_for_symtable=" $pic_flag" + ;; + esac + ;; + esac + symtab_cflags= + for arg in $LTCFLAGS; do + case $arg in + -pie | -fpie | -fPIE) ;; + *) func_append symtab_cflags " $arg" ;; + esac + done + + # Now compile the dynamic symbol file. + func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' + + # Clean up the generated files. + func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' + + # Transform the symbol file into the correct name. + symfileobj=$output_objdir/${my_outputname}S.$objext + case $host in + *cygwin* | *mingw* | *cegcc* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for '$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_cygming_gnu_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is a GNU/binutils-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_gnu_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` + test -n "$func_cygming_gnu_implib_tmp" +} + +# func_cygming_ms_implib_p ARG +# This predicate returns with zero status (TRUE) if +# ARG is an MS-style import library. Returns +# with nonzero status (FALSE) otherwise. +func_cygming_ms_implib_p () +{ + $debug_cmd + + func_to_tool_file "$1" func_convert_file_msys_to_w32 + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` + test -n "$func_cygming_ms_implib_tmp" +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $debug_cmd + + win32_libid_type=unknown + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + case $nm_interface in + "MS dumpbin") + if func_cygming_ms_implib_p "$1" || + func_cygming_gnu_implib_p "$1" + then + win32_nmres=import + else + win32_nmres= + fi + ;; + *) + func_to_tool_file "$1" func_convert_file_msys_to_w32 + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | + $SED -n -e ' + 1,100{ + / I /{ + s|.*|import| + p + q + } + }'` + ;; + esac + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + +# func_cygming_dll_for_implib ARG +# +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib () +{ + $debug_cmd + + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` +} + +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs +# +# The is the core of a fallback implementation of a +# platform-specific function to extract the name of the +# DLL associated with the specified import library LIBNAME. +# +# SECTION_NAME is either .idata$6 or .idata$7, depending +# on the platform and compiler that created the implib. +# +# Echos the name of the DLL associated with the +# specified import library. +func_cygming_dll_for_implib_fallback_core () +{ + $debug_cmd + + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | + $SED '/^Contents of section '"$match_literal"':/{ + # Place marker at beginning of archive member dllname section + s/.*/====MARK====/ + p + d + } + # These lines can sometimes be longer than 43 characters, but + # are always uninteresting + /:[ ]*file format pe[i]\{,1\}-/d + /^In archive [^:]*:/d + # Ensure marker is printed + /^====MARK====/p + # Remove all lines with less than 43 characters + /^.\{43\}/!d + # From remaining lines, remove first 43 characters + s/^.\{43\}//' | + $SED -n ' + # Join marker and all lines until next marker into a single line + /^====MARK====/ b para + H + $ b para + b + :para + x + s/\n//g + # Remove the marker + s/^====MARK====// + # Remove trailing dots and whitespace + s/[\. \t]*$// + # Print + /./p' | + # we now have a list, one entry per line, of the stringified + # contents of the appropriate section of all members of the + # archive that possess that section. Heuristic: eliminate + # all those that have a first or second character that is + # a '.' (that is, objdump's representation of an unprintable + # character.) This should work for all archives with less than + # 0x302f exports -- but will fail for DLLs whose name actually + # begins with a literal '.' or a single character followed by + # a '.'. + # + # Of those that remain, print the first one. + $SED -e '/^\./d;/^.\./d;q' +} + +# func_cygming_dll_for_implib_fallback ARG +# Platform-specific function to extract the +# name of the DLL associated with the specified +# import library ARG. +# +# This fallback implementation is for use when $DLLTOOL +# does not support the --identify-strict option. +# Invoked by eval'ing the libtool variable +# $sharedlib_from_linklib_cmd +# Result is available in the variable +# $sharedlib_from_linklib_result +func_cygming_dll_for_implib_fallback () +{ + $debug_cmd + + if func_cygming_gnu_implib_p "$1"; then + # binutils import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` + elif func_cygming_ms_implib_p "$1"; then + # ms-generated import library + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` + else + # unknown + sharedlib_from_linklib_result= + fi +} + + +# func_extract_an_archive dir oldlib +func_extract_an_archive () +{ + $debug_cmd + + f_ex_an_ar_dir=$1; shift + f_ex_an_ar_oldlib=$1 + if test yes = "$lock_old_archive_extraction"; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test yes = "$lock_old_archive_extraction"; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $debug_cmd + + my_gentop=$1; shift + my_oldlibs=${1+"$@"} + my_oldobjs= + my_xlib= + my_xabs= + my_xdir= + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib=$func_basename_result + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir=$my_gentop/$my_xlib_u + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + func_basename "$darwin_archive" + darwin_base_archive=$func_basename_result + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches; do + func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" + $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" + cd "unfat-$$/$darwin_base_archive-$darwin_arch" + func_extract_an_archive "`pwd`" "$darwin_base_archive" + cd "$darwin_curdir" + $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result=$my_oldobjs +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory where it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=$qECHO + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ that is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options that match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + case \" \$* \" in + *\\ --lt-*) + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done ;; + esac + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test yes = "$fast_install"; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + \$ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # fixup the dll searchpath if we need to. + # + # Fix the DLL searchpath if we need to. Do this before prepending + # to shlibpath, because on Windows, both are PATH and uninstalled + # libraries must come first. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + # Export our shlibpath_var if we have one. + if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_emit_cwrapperexe_src +# emit the source code for a wrapper executable on stdout +# Must ONLY be called from within func_mode_link because +# it depends on a number of variable set therein. +func_emit_cwrapperexe_src () +{ + cat < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) + +/* declarations of non-ANSI functions */ +#if defined __MINGW32__ +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined __CYGWIN__ +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined other_platform || defined ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined _MSC_VER +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +#elif defined __MINGW32__ +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined __CYGWIN__ +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined other platforms ... */ +#endif + +#if defined PATH_MAX +# define LT_PATHMAX PATH_MAX +#elif defined MAXPATHLEN +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ + defined __OS2__ +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free (stale); stale = 0; } \ +} while (0) + +#if defined LT_DEBUGWRAPPER +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + size_t tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined HAVE_DOS_BASED_FILE_SYSTEM + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined HAVE_DOS_BASED_FILE_SYSTEM + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = (size_t) (q - p); + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (STREQ (str, pat)) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + size_t len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + size_t orig_value_len = strlen (orig_value); + size_t add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + size_t len = strlen (new_value); + while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[--len] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -n -e ' +s/^\(.\{79\}\)\(..*\)/\1\ +\2/ +h +s/\([\\"]\)/\\\1/g +s/$/\\n/ +s/\([^\n]*\).*/ fputs ("\1", f);/p +g +D' + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $debug_cmd + + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_suncc_cstd_abi +# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! +# Several compiler flags select an ABI that is incompatible with the +# Cstd library. Avoid specifying it if any are in CXXFLAGS. +func_suncc_cstd_abi () +{ + $debug_cmd + + case " $compile_command " in + *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) + suncc_use_cstd_abi=no + ;; + *) + suncc_use_cstd_abi=yes + ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $debug_cmd + + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # what system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll that has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + os2dllname= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=false + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module=$wl-single_module + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test yes != "$build_libtool_libs" \ + && func_fatal_configuration "cannot build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg=$1 + shift + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir=$arg + prev= + continue + ;; + dlfiles|dlprefiles) + $preload || { + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=: + } + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test no = "$dlself"; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test dlprefiles = "$prev"; then + dlself=yes + elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test dlfiles = "$prev"; then + func_append dlfiles " $arg" + else + func_append dlprefiles " $arg" + fi + prev= + continue + ;; + esac + ;; + expsyms) + export_symbols=$arg + test -f "$arg" \ + || func_fatal_error "symbol file '$arg' does not exist" + prev= + continue + ;; + expsyms_regex) + export_symbols_regex=$arg + prev= + continue + ;; + framework) + case $host in + *-*-darwin*) + case "$deplibs " in + *" $qarg.ltframework "*) ;; + *) func_append deplibs " $qarg.ltframework" # this is fixed later + ;; + esac + ;; + esac + prev= + continue + ;; + inst_prefix) + inst_prefix_dir=$arg + prev= + continue + ;; + mllvm) + # Clang does not use LLVM to link, so we can simply discard any + # '-mllvm $arg' options when doing the link step. + prev= + continue + ;; + objectlist) + if test -f "$arg"; then + save_arg=$arg + moreargs= + for fil in `cat "$save_arg"` + do +# func_append moreargs " $fil" + arg=$fil + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + if test none != "$pic_object"; then + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + fi + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + done + else + func_fatal_error "link input file '$arg' does not exist" + fi + arg=$save_arg + prev= + continue + ;; + os2dllname) + os2dllname=$arg + prev= + continue + ;; + precious_regex) + precious_files_regex=$arg + prev= + continue + ;; + release) + release=-$arg + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case $arg in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + if test rpath = "$prev"; then + case "$rpath " in + *" $arg "*) ;; + *) func_append rpath " $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) func_append xrpath " $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds=$arg + prev= + continue + ;; + weak) + func_append weak_libs " $arg" + prev= + continue + ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; + xcclinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + func_append compiler_flags " $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + func_append linker_flags " $qarg" + func_append compiler_flags " $wl$qarg" + prev= + func_append compile_command " $wl$qarg" + func_append finalize_command " $wl$qarg" + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi # test -n "$prev" + + prevarg=$arg + + case $arg in + -all-static) + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + func_fatal_error "'-allow-undefined' must not be used because it is the default" + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test X-export-symbols = "X$arg"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname "-L" '' "$arg" + if test -z "$func_stripname_result"; then + if test "$#" -gt 0; then + func_fatal_error "require no space between '-L' and '$1'" + else + func_fatal_error "need path for '-L' option" + fi + fi + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + test -z "$absdir" && \ + func_fatal_error "cannot determine absolute directory name of '$dir'" + dir=$absdir + ;; + esac + case "$deplibs " in + *" -L$dir "* | *" $arg "*) + # Will only happen for absolute or sysroot arguments + ;; + *) + # Preserve sysroot, but never include relative directories + case $dir in + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; + *) func_append deplibs " -L$dir" ;; + esac + func_append lib_search_path " $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + ::) dllsearchpath=$dir;; + *) func_append dllsearchpath ":$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test X-lc = "X$arg" || test X-lm = "X$arg"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test X-lc = "X$arg" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) + # Do not include libc due to us having libc/libc_r. + test X-lc = "X$arg" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + func_append deplibs " System.ltframework" + continue + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + test X-lc = "X$arg" && continue + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + test X-lc = "X$arg" && continue + ;; + esac + elif test X-lc_r = "X$arg"; then + case $host in + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) + # Do not include libc_r directly, use -pthread flag. + continue + ;; + esac + fi + func_append deplibs " $arg" + continue + ;; + + -mllvm) + prev=mllvm + continue + ;; + + -module) + module=yes + continue + ;; + + # Tru64 UNIX uses -model [arg] to determine the layout of C++ + # classes, name mangling, and exception handling. + # Darwin uses the -arch flag to determine output architecture. + -model|-arch|-isysroot|--sysroot) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + prev=xcompiler + continue + ;; + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + func_append compiler_flags " $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + continue + ;; + + -multi_module) + single_module=$wl-multi_module + continue + ;; + + -no-fast-install) + fast_install=no + continue + ;; + + -no-install) + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + # The PATH hackery in wrapper scripts is required on Windows + # and Darwin in order for the loader to find any dlls it needs. + func_warning "'-no-install' is ignored for $host" + func_warning "assuming '-no-fast-install' instead" + fast_install=no + ;; + *) no_install=yes ;; + esac + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -objectlist) + prev=objectlist + continue + ;; + + -os2dllname) + prev=os2dllname + continue + ;; + + -o) prev=output ;; + + -precious-files-regex) + prev=precious_regex + continue + ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + func_stripname '-R' '' "$arg" + dir=$func_stripname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + =*) + func_stripname '=' '' "$dir" + dir=$lt_sysroot$func_stripname_result + ;; + *) + func_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + continue + ;; + + -shared) + # The effects of -shared are defined in a previous loop. + continue + ;; + + -shrext) + prev=shrext + continue + ;; + + -static | -static-libtool-libs) + # The effects of -static are defined in a previous loop. + # We used to do the same as -all-static on platforms that + # didn't have a PIC flag, but the assumption that the effects + # would be equivalent was wrong. It would break on at least + # Digital Unix and AIX. + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + -version-number) + prev=vinfo + vinfo_number=yes + continue + ;; + + -weak) + prev=weak + continue + ;; + + -Wc,*) + func_stripname '-Wc,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Wl,*) + func_stripname '-Wl,' '' "$arg" + args=$func_stripname_result + arg= + save_ifs=$IFS; IFS=, + for flag in $args; do + IFS=$save_ifs + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" + done + IFS=$save_ifs + func_stripname ' ' '' "$arg" + arg=$func_stripname_result + ;; + + -Xassembler) + prev=xassembler + continue + ;; + + -Xcompiler) + prev=xcompiler + continue + ;; + + -Xlinker) + prev=xlinker + continue + ;; + + -XCClinker) + prev=xcclinker + continue + ;; + + # -msg_* for osf cc + -msg_*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # -fstack-protector* stack protector flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization + # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + # -fsanitize=* Clang/GCC memory and address sanitizer + # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ + # -Wa,* Pass flags directly to the assembler + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ + -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + func_append compile_command " $arg" + func_append finalize_command " $arg" + func_append compiler_flags " $arg" + continue + ;; + + -Z*) + if test os2 = "`expr $host : '.*\(os2\)'`"; then + # OS/2 uses -Zxxx to specify OS/2-specific options + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case $arg in + -Zlinker | -Zstack) + prev=xcompiler + ;; + esac + continue + else + # Otherwise treat like 'Some other compiler flag' below + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + fi + ;; + + # Some other compiler flag. + -* | +*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + ;; + + *.$objext) + # A standard object. + func_append objs " $arg" + ;; + + *.lo) + # A libtool-controlled object. + + # Check to see that this really is a libtool object. + if func_lalib_unsafe_p "$arg"; then + pic_object= + non_pic_object= + + # Read the .lo file + func_source "$arg" + + if test -z "$pic_object" || + test -z "$non_pic_object" || + test none = "$pic_object" && + test none = "$non_pic_object"; then + func_fatal_error "cannot find name of object for '$arg'" + fi + + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + test none = "$pic_object" || { + # Prepend the subdirectory the object is found in. + pic_object=$xdir$pic_object + + if test dlfiles = "$prev"; then + if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then + func_append dlfiles " $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test dlprefiles = "$prev"; then + # Preload the old-style object. + func_append dlprefiles " $pic_object" + prev= + fi + + # A PIC object. + func_append libobjs " $pic_object" + arg=$pic_object + } + + # Non-PIC object. + if test none != "$non_pic_object"; then + # Prepend the subdirectory the object is found in. + non_pic_object=$xdir$non_pic_object + + # A standard non-PIC object + func_append non_pic_objects " $non_pic_object" + if test -z "$pic_object" || test none = "$pic_object"; then + arg=$non_pic_object + fi + else + # If the PIC object exists, use it instead. + # $xdir was prepended to $pic_object above. + non_pic_object=$pic_object + func_append non_pic_objects " $non_pic_object" + fi + else + # Only an error if not doing a dry-run. + if $opt_dry_run; then + # Extract subdirectory from the argument. + func_dirname "$arg" "/" "" + xdir=$func_dirname_result + + func_lo2o "$arg" + pic_object=$xdir$objdir/$func_lo2o_result + non_pic_object=$xdir$func_lo2o_result + func_append libobjs " $pic_object" + func_append non_pic_objects " $non_pic_object" + else + func_fatal_error "'$arg' is not a valid libtool object" + fi + fi + ;; + + *.$libext) + # An archive. + func_append deplibs " $arg" + func_append old_deplibs " $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + func_resolve_sysroot "$arg" + if test dlfiles = "$prev"; then + # This library was specified with -dlopen. + func_append dlfiles " $func_resolve_sysroot_result" + prev= + elif test dlprefiles = "$prev"; then + # The library was specified with -dlpreopen. + func_append dlprefiles " $func_resolve_sysroot_result" + prev= + else + func_append deplibs " $func_resolve_sysroot_result" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result + ;; + esac # arg + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + done # argument parsing loop + + test -n "$prev" && \ + func_fatal_help "the '$prevarg' option requires an argument" + + if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + func_append compile_command " $arg" + func_append finalize_command " $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + func_basename "$output" + outputname=$func_basename_result + libobjs_save=$libobjs + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + # Definition is injected by LT_CONFIG during libtool generation. + func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" + + func_dirname "$output" "/" "" + output_objdir=$func_dirname_result$objdir + func_to_tool_file "$output_objdir/" + tool_output_objdir=$func_to_tool_file_result + # Create the object directory. + func_mkdir_p "$output_objdir" + + # Determine the type of output + case $output in + "") + func_fatal_help "you must specify an output file" + ;; + *.$libext) linkmode=oldlib ;; + *.lo | *.$objext) linkmode=obj ;; + *.la) linkmode=lib ;; + *) linkmode=prog ;; # Anything else should be a program. + esac + + specialdeplibs= + + libs= + # Find all interdependent deplibs by searching for libraries + # that are linked more than once (e.g. -la -lb -la) + for deplib in $deplibs; do + if $opt_preserve_dup_deps; then + case "$libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append libs " $deplib" + done + + if test lib = "$linkmode"; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; + esac + func_append pre_post_deps " $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + notinst_path= # paths that contain not-installed libtool libraries + + case $linkmode in + lib) + passes="conv dlpreopen link" + for file in $dlfiles $dlprefiles; do + case $file in + *.la) ;; + *) + func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" + ;; + esac + done + ;; + prog) + compile_deplibs= + finalize_deplibs= + alldeplibs=false + newdlfiles= + newdlprefiles= + passes="conv scan dlopen dlpreopen link" + ;; + *) passes="conv" + ;; + esac + + for pass in $passes; do + # The preopen pass in lib mode reverses $deplibs; put it back here + # so that -L comes before libs that need it for instance... + if test lib,link = "$linkmode,$pass"; then + ## FIXME: Find the place where the list is rebuilt in the wrong + ## order, and fix it there properly + tmp_deplibs= + for deplib in $deplibs; do + tmp_deplibs="$deplib $tmp_deplibs" + done + deplibs=$tmp_deplibs + fi + + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass"; then + libs=$deplibs + deplibs= + fi + if test prog = "$linkmode"; then + case $pass in + dlopen) libs=$dlfiles ;; + dlpreopen) libs=$dlprefiles ;; + link) + libs="$deplibs %DEPLIBS%" + test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" + ;; + esac + fi + if test lib,dlpreopen = "$linkmode,$pass"; then + # Collect and forward deplibs of preopened libtool libs + for lib in $dlprefiles; do + # Ignore non-libtool-libs + dependency_libs= + func_resolve_sysroot "$lib" + case $lib in + *.la) func_source "$func_resolve_sysroot_result" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + func_basename "$deplib" + deplib_base=$func_basename_result + case " $weak_libs " in + *" $deplib_base "*) ;; + *) func_append deplibs " $deplib" ;; + esac + done + done + libs=$dlprefiles + fi + if test dlopen = "$pass"; then + # Collect dlpreopened libraries + save_deplibs=$deplibs + deplibs= + fi + + for deplib in $libs; do + lib= + found=false + case $deplib in + -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append compiler_flags " $deplib" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -l*) + if test lib != "$linkmode" && test prog != "$linkmode"; then + func_warning "'-l' is ignored for archives/objects" + continue + fi + func_stripname '-l' '' "$deplib" + name=$func_stripname_result + if test lib = "$linkmode"; then + searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" + else + searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" + fi + for searchdir in $searchdirs; do + for search_ext in .la $std_shrext .so .a; do + # Search the libtool library + lib=$searchdir/lib$name$search_ext + if test -f "$lib"; then + if test .la = "$search_ext"; then + found=: + else + found=false + fi + break 2 + fi + done + done + if $found; then + # deplib is a libtool library + # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, + # We need to do some special things here, and not later. + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $deplib "*) + if func_lalib_p "$lib"; then + library_names= + old_library= + func_source "$lib" + for l in $old_library $library_names; do + ll=$l + done + if test "X$ll" = "X$old_library"; then # only static version available + found=false + func_dirname "$lib" "" "." + ladir=$func_dirname_result + lib=$ladir/$old_library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + fi + ;; + *) ;; + esac + fi + else + # deplib doesn't seem to be a libtool library + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" + fi + continue + fi + ;; # -l + *.ltframework) + if test prog,link = "$linkmode,$pass"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + deplibs="$deplib $deplibs" + if test lib = "$linkmode"; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) func_append new_inherited_linker_flags " $deplib" ;; + esac + fi + fi + continue + ;; + -L*) + case $linkmode in + lib) + deplibs="$deplib $deplibs" + test conv = "$pass" && continue + newdependency_libs="$deplib $newdependency_libs" + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + prog) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + if test scan = "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + *) + func_warning "'-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test link = "$pass"; then + func_stripname '-R' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + dir=$func_resolve_sysroot_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) func_append xrpath " $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) + func_resolve_sysroot "$deplib" + lib=$func_resolve_sysroot_result + ;; + *.$libext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # Linking convenience modules into shared libraries is allowed, + # but linking other static libraries is non-portable. + case " $dlpreconveniencelibs " in + *" $deplib "*) ;; + *) + valid_a_lib=false + case $deplibs_check_method in + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=: + fi + ;; + pass_all) + valid_a_lib=: + ;; + esac + if $valid_a_lib; then + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + else + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + fi + ;; + esac + continue + ;; + prog) + if test link != "$pass"; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test conv = "$pass"; then + deplibs="$deplib $deplibs" + elif test prog = "$linkmode"; then + if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + func_append newdlprefiles " $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + func_append newdlfiles " $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=: + continue + ;; + esac # case $deplib + + $found || test -f "$lib" \ + || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" + + # Check to see that this really is a libtool archive. + func_lalib_unsafe_p "$lib" \ + || func_fatal_error "'$lib' is not a valid libtool archive" + + func_dirname "$lib" "" "." + ladir=$func_dirname_result + + dlname= + dlopen= + dlpreopen= + libdir= + library_names= + old_library= + inherited_linker_flags= + # If the library was installed with an old release of libtool, + # it will not redefine variables installed, or shouldnotlink + installed=yes + shouldnotlink=no + avoidtemprpath= + + + # Read the .la file + func_source "$lib" + + # Convert "-framework foo" to "foo.ltframework" + if test -n "$inherited_linker_flags"; then + tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test lib,link = "$linkmode,$pass" || + test prog,scan = "$linkmode,$pass" || + { test prog != "$linkmode" && test lib != "$linkmode"; }; then + test -n "$dlopen" && func_append dlfiles " $dlopen" + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" + fi + + if test conv = "$pass"; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + # It is a libtool convenience library, so add in its objects. + func_append convenience " $ladir/$objdir/$old_library" + func_append old_convenience " $ladir/$objdir/$old_library" + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done + elif test prog != "$linkmode" && test lib != "$linkmode"; then + func_fatal_error "'$lib' is not a convenience library" + fi + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + if test -n "$old_library" && + { test yes = "$prefer_static_libs" || + test built,no = "$prefer_static_libs,$installed"; }; then + linklib=$old_library + else + for l in $old_library $library_names; do + linklib=$l + done + fi + if test -z "$linklib"; then + func_fatal_error "cannot find name of link library for '$lib'" + fi + + # This library was specified with -dlopen. + if test dlopen = "$pass"; then + test -z "$libdir" \ + && func_fatal_error "cannot -dlopen a convenience library: '$lib'" + if test -z "$dlname" || + test yes != "$dlopen_support" || + test no = "$build_libtool_libs" + then + # If there is no dlname, no dlopen support or we're linking + # statically, we need to preload. We also need to preload any + # dependent libraries so libltdl's deplib preloader doesn't + # bomb out in the load deplibs phase. + func_append dlprefiles " $lib $dependency_libs" + else + func_append newdlfiles " $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + func_warning "cannot determine absolute directory name of '$ladir'" + func_warning "passing it literally to the linker, although it might fail" + abs_ladir=$ladir + fi + ;; + esac + func_basename "$lib" + laname=$func_basename_result + + # Find the relevant object directory and library name. + if test yes = "$installed"; then + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library '$lib' was moved." + dir=$ladir + absdir=$abs_ladir + libdir=$abs_ladir + else + dir=$lt_sysroot$libdir + absdir=$lt_sysroot$libdir + fi + test yes = "$hardcode_automatic" && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir=$ladir + absdir=$abs_ladir + # Remove this search path later + func_append notinst_path " $abs_ladir" + else + dir=$ladir/$objdir + absdir=$abs_ladir/$objdir + # Remove this search path later + func_append notinst_path " $abs_ladir" + fi + fi # $installed = yes + func_stripname 'lib' '.la' "$laname" + name=$func_stripname_result + + # This library was specified with -dlpreopen. + if test dlpreopen = "$pass"; then + if test -z "$libdir" && test prog = "$linkmode"; then + func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" + fi + case $host in + # special handling for platforms with PE-DLLs. + *cygwin* | *mingw* | *cegcc* ) + # Linker will automatically link against shared library if both + # static and shared are present. Therefore, ensure we extract + # symbols from the import library if a shared library is present + # (otherwise, the dlopen module name will be incorrect). We do + # this by putting the import library name into $newdlprefiles. + # We recover the dlopen module name by 'saving' the la file + # name in a special purpose variable, and (later) extracting the + # dlname from the la file. + if test -n "$dlname"; then + func_tr_sh "$dir/$linklib" + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" + func_append newdlprefiles " $dir/$linklib" + else + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + fi + ;; + * ) + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + func_append newdlprefiles " $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + func_append dlpreconveniencelibs " $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + func_append newdlprefiles " $dir/$dlname" + else + func_append newdlprefiles " $dir/$linklib" + fi + ;; + esac + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test lib = "$linkmode"; then + deplibs="$dir/$old_library $deplibs" + elif test prog,link = "$linkmode,$pass"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test prog = "$linkmode" && test link != "$pass"; then + func_append newlib_search_path " $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=false + if test no != "$link_all_deplibs" || test -z "$library_names" || + test no = "$build_libtool_libs"; then + linkalldeplibs=: + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result" + func_append newlib_search_path " $func_resolve_sysroot_result" + ;; + esac + # Need to link against all dependency_libs? + if $linkalldeplibs; then + deplibs="$deplib $deplibs" + else + # Need to hardcode shared library paths + # or/and link against static libraries + newdependency_libs="$deplib $newdependency_libs" + fi + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $deplib "*) func_append specialdeplibs " $deplib" ;; + esac + fi + func_append tmp_libs " $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test prog,link = "$linkmode,$pass"; then + if test -n "$library_names" && + { { test no = "$prefer_static_libs" || + test built,yes = "$prefer_static_libs,$installed"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then + # Make sure the rpath contains only unique directories. + case $temp_rpath: in + *"$absdir:"*) ;; + *) func_append temp_rpath "$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if $alldeplibs && + { test pass_all = "$deplibs_check_method" || + { test yes = "$build_libtool_libs" && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test built = "$use_static_libs" && test yes = "$installed"; then + use_static_libs=no + fi + if test -n "$library_names" && + { test no = "$use_static_libs" || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw* | *cegcc* | *os2*) + # No point in relinking DLLs because paths are not encoded + func_append notinst_deplibs " $lib" + need_relink=no + ;; + *) + if test no = "$installed"; then + func_append notinst_deplibs " $lib" + need_relink=yes + fi + ;; + esac + # This is a shared library + + # Warn about portability, can't link against -module's on some + # systems (darwin). Don't bleat about dlopened modules though! + dlopenmodule= + for dlpremoduletest in $dlprefiles; do + if test "X$dlpremoduletest" = "X$lib"; then + dlopenmodule=$dlpremoduletest + break + fi + done + if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then + echo + if test prog = "$linkmode"; then + $ECHO "*** Warning: Linking the executable $output against the loadable module" + else + $ECHO "*** Warning: Linking the shared library $output against the loadable module" + fi + $ECHO "*** $linklib is not portable!" + fi + if test lib = "$linkmode" && + test yes = "$hardcode_into_libs"; then + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) func_append compile_rpath " $absdir" ;; + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + shift + realname=$1 + shift + libname=`eval "\\$ECHO \"$libname_spec\""` + # use dlname if we got it. it's perfectly good, no? + if test -n "$dlname"; then + soname=$dlname + elif test -n "$soname_spec"; then + # bleh windows + case $host in + *cygwin* | mingw* | *cegcc* | *os2*) + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + esac + eval soname=\"$soname_spec\" + else + soname=$realname + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot=$soname + func_basename "$soroot" + soname=$func_basename_result + func_stripname 'lib' '.dll' "$soname" + newlib=libimp-$func_stripname_result.a + + # If the library has no export list, then create one now + if test -f "$output_objdir/$soname-def"; then : + else + func_verbose "extracting exported symbol list from '$soname'" + func_execute_cmds "$extract_expsyms_cmds" 'exit $?' + fi + + # Create $newlib + if test -f "$output_objdir/$newlib"; then :; else + func_verbose "generating import library for '$soname'" + func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' + fi + # make sure the library variables are pointing to the new library + dir=$output_objdir + linklib=$newlib + fi # test -n "$old_archive_from_expsyms_cmds" + + if test prog = "$linkmode" || test relink != "$opt_mode"; then + add_shlibpath= + add_dir= + add= + lib_linked=yes + case $hardcode_action in + immediate | unsupported) + if test no = "$hardcode_direct"; then + add=$dir/$linklib + case $host in + *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; + *-*-sysv4*uw2*) add_dir=-L$dir ;; + *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ + *-*-unixware7*) add_dir=-L$dir ;; + *-*-darwin* ) + # if the lib is a (non-dlopened) module then we cannot + # link against it, someone is ignoring the earlier warnings + if /usr/bin/file -L $add 2> /dev/null | + $GREP ": [^:]* bundle" >/dev/null; then + if test "X$dlopenmodule" != "X$lib"; then + $ECHO "*** Warning: lib $linklib is a module, not a shared library" + if test -z "$old_library"; then + echo + echo "*** And there doesn't seem to be a static archive available" + echo "*** The link will probably fail, sorry" + else + add=$dir/$old_library + fi + elif test -n "$old_library"; then + add=$dir/$old_library + fi + fi + esac + elif test no = "$hardcode_minus_L"; then + case $host in + *-*-sunos*) add_shlibpath=$dir ;; + esac + add_dir=-L$dir + add=-l$name + elif test no = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + relink) + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$dir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$absdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + add_shlibpath=$dir + add=-l$name + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test yes != "$lib_linked"; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) func_append compile_shlibpath "$add_shlibpath:" ;; + esac + fi + if test prog = "$linkmode"; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test yes != "$hardcode_direct" && + test yes != "$hardcode_minus_L" && + test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + fi + fi + fi + + if test prog = "$linkmode" || test relink = "$opt_mode"; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test yes = "$hardcode_direct" && + test no = "$hardcode_direct_absolute"; then + add=$libdir/$linklib + elif test yes = "$hardcode_minus_L"; then + add_dir=-L$libdir + add=-l$name + elif test yes = "$hardcode_shlibpath_var"; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) func_append finalize_shlibpath "$libdir:" ;; + esac + add=-l$name + elif test yes = "$hardcode_automatic"; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib"; then + add=$inst_prefix_dir$libdir/$linklib + else + add=$libdir/$linklib + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir=-L$libdir + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + func_append add_dir " -L$inst_prefix_dir$libdir" + ;; + esac + fi + add=-l$name + fi + + if test prog = "$linkmode"; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test prog = "$linkmode"; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test unsupported != "$hardcode_direct"; then + test -n "$old_library" && linklib=$old_library + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test yes = "$build_libtool_libs"; then + # Not a shared library + if test pass_all != "$deplibs_check_method"; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + echo + $ECHO "*** Warning: This system cannot link to static lib archive $lib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + if test yes = "$module"; then + echo "*** But as you try to build a module library, libtool will still create " + echo "*** a static module, that should work as long as the dlopening application" + echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test lib = "$linkmode"; then + if test -n "$dependency_libs" && + { test yes != "$hardcode_into_libs" || + test yes = "$build_old_libs" || + test yes = "$link_static"; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) func_append xrpath " $temp_xrpath";; + esac;; + *) func_append temp_deplibs " $libdir";; + esac + done + dependency_libs=$temp_deplibs + fi + + func_append newlib_search_path " $absdir" + # Link against this library + test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + func_resolve_sysroot "$func_stripname_result";; + *) func_resolve_sysroot "$deplib" ;; + esac + if $opt_preserve_dup_deps; then + case "$tmp_libs " in + *" $func_resolve_sysroot_result "*) + func_append specialdeplibs " $func_resolve_sysroot_result" ;; + esac + fi + func_append tmp_libs " $func_resolve_sysroot_result" + done + + if test no != "$link_all_deplibs"; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + path= + case $deplib in + -L*) path=$deplib ;; + *.la) + func_resolve_sysroot "$deplib" + deplib=$func_resolve_sysroot_result + func_dirname "$deplib" "" "." + dir=$func_dirname_result + # We need an absolute path. + case $dir in + [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + func_warning "cannot determine absolute directory name of '$dir'" + absdir=$dir + fi + ;; + esac + if $GREP "^installed=no" $deplib > /dev/null; then + case $host in + *-*-darwin*) + depdepl= + eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` + if test -n "$deplibrary_names"; then + for tmp in $deplibrary_names; do + depdepl=$tmp + done + if test -f "$absdir/$objdir/$depdepl"; then + depdepl=$absdir/$objdir/$depdepl + darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + if test -z "$darwin_install_name"; then + darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` + fi + func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" + func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" + path= + fi + fi + ;; + *) + path=-L$absdir/$objdir + ;; + esac + else + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + test "$absdir" != "$libdir" && \ + func_warning "'$deplib' seems to be moved" + + path=-L$absdir + fi + ;; + esac + case " $deplibs " in + *" $path "*) ;; + *) deplibs="$path $deplibs" ;; + esac + done + fi # link_all_deplibs != no + fi # linkmode = lib + done # for deplib in $libs + if test link = "$pass"; then + if test prog = "$linkmode"; then + compile_deplibs="$new_inherited_linker_flags $compile_deplibs" + finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" + else + compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs=$newdependency_libs + if test dlpreopen = "$pass"; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test dlopen != "$pass"; then + test conv = "$pass" || { + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) func_append lib_search_path " $dir" ;; + esac + done + newlib_search_path= + } + + if test prog,link = "$linkmode,$pass"; then + vars="compile_deplibs finalize_deplibs" + else + vars=deplibs + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) func_append tmp_libs " $deplib" ;; + esac + ;; + *) func_append tmp_libs " $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + + # Add Sun CC postdeps if required: + test CXX = "$tagname" && { + case $host_os in + linux*) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) # Sun C++ 5.9 + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + + solaris*) + func_cc_basename "$CC" + case $func_cc_basename_result in + CC* | sunCC*) + func_suncc_cstd_abi + + if test no != "$suncc_use_cstd_abi"; then + func_append postdeps ' -library=Cstd -library=Crun' + fi + ;; + esac + ;; + esac + } + + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i= + ;; + esac + if test -n "$i"; then + func_append tmp_libs " $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test prog = "$linkmode"; then + dlfiles=$newdlfiles + fi + if test prog = "$linkmode" || test lib = "$linkmode"; then + dlprefiles=$newdlprefiles + fi + + case $linkmode in + oldlib) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for archives" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for archives" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for archives" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for archives" + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for archives" + + test -n "$release" && \ + func_warning "'-release' is ignored for archives" + + test -n "$export_symbols$export_symbols_regex" && \ + func_warning "'-export-symbols' is ignored for archives" + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs=$output + func_append objs "$old_deplibs" + ;; + + lib) + # Make sure we only generate libraries of the form 'libNAME.la'. + case $outputname in + lib*) + func_stripname 'lib' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + ;; + *) + test no = "$module" \ + && func_fatal_help "libtool library '$output' must begin with 'lib'" + + if test no != "$need_lib_prefix"; then + # Add the "lib" prefix for modules if required + func_stripname '' '.la' "$outputname" + name=$func_stripname_result + eval shared_ext=\"$shrext_cmds\" + eval libname=\"$libname_spec\" + else + func_stripname '' '.la' "$outputname" + libname=$func_stripname_result + fi + ;; + esac + + if test -n "$objs"; then + if test pass_all != "$deplibs_check_method"; then + func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" + else + echo + $ECHO "*** Warning: Linking the shared library $output against the non-libtool" + $ECHO "*** objects $objs is not portable!" + func_append libobjs " $objs" + fi + fi + + test no = "$dlself" \ + || func_warning "'-dlopen self' is ignored for libtool libraries" + + set dummy $rpath + shift + test 1 -lt "$#" \ + && func_warning "ignoring multiple '-rpath's for a libtool library" + + install_libdir=$1 + + oldlibs= + if test -z "$rpath"; then + if test yes = "$build_libtool_libs"; then + # Building a libtool convenience library. + # Some compilers have problems with a '.al' extension so + # convenience libraries should have the same extension an + # archive normally would. + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + + test -n "$vinfo" && \ + func_warning "'-version-info/-version-number' is ignored for convenience libraries" + + test -n "$release" && \ + func_warning "'-release' is ignored for convenience libraries" + else + + # Parse the version information argument. + save_ifs=$IFS; IFS=: + set dummy $vinfo 0 0 0 + shift + IFS=$save_ifs + + test -n "$7" && \ + func_fatal_help "too many parameters to '-version-info'" + + # convert absolute version numbers to libtool ages + # this retains compatibility with .la files and attempts + # to make the code below a bit more comprehensible + + case $vinfo_number in + yes) + number_major=$1 + number_minor=$2 + number_revision=$3 + # + # There are really only two kinds -- those that + # use the current revision as the major version + # and those that subtract age and use age as + # a minor version. But, then there is irix + # that has an extra 1 added just for fun + # + case $version_type in + # correct linux to gnu/linux during the next big refactor + darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_revision + ;; + freebsd-aout|qnx|sunos) + current=$number_major + revision=$number_minor + age=0 + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age=$number_minor + revision=$number_minor + lt_irix_increment=no + ;; + *) + func_fatal_configuration "$modename: unknown library version type '$version_type'" + ;; + esac + ;; + no) + current=$1 + revision=$2 + age=$3 + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT '$current' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION '$revision' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE '$age' must be a nonnegative integer" + func_fatal_error "'$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE '$age' is greater than the current interface number '$current'" + func_fatal_error "'$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + # On Darwin other compilers + case $CC in + nagfor*) + verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" + ;; + *) + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + esac + ;; + + freebsd-aout) + major=.$current + versuffix=.$current.$revision + ;; + + freebsd-elf | midnightbsd-elf) + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + irix | nonstopux) + if test no = "$lt_irix_increment"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring=$verstring_prefix$major.$revision + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test 0 -ne "$loop"; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring_prefix$major.$iface:$verstring + done + + # Before this point, $major must not contain '.'. + major=.$major + versuffix=$major.$revision + ;; + + linux) # correct to gnu/linux during the next big refactor + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision + ;; + + osf) + func_arith $current - $age + major=.$func_arith_result + versuffix=.$current.$age.$revision + verstring=$current.$age.$revision + + # Add in all the interfaces that we are compatible with. + loop=$age + while test 0 -ne "$loop"; do + func_arith $current - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring=$verstring:$iface.0 + done + + # Make executables depend on our current version. + func_append verstring ":$current.0" + ;; + + qnx) + major=.$current + versuffix=.$current + ;; + + sco) + major=.$current + versuffix=.$current + ;; + + sunos) + major=.$current + versuffix=.$current.$revision + ;; + + windows) + # Use '-' rather than '.', since we only want one + # extension on DOS 8.3 file systems. + func_arith $current - $age + major=$func_arith_result + versuffix=-$major + ;; + + *) + func_fatal_configuration "unknown library version type '$version_type'" + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + case $version_type in + darwin) + # we can't check for "0.0" in archive_cmds due to quoting + # problems, so we reset it completely + verstring= + ;; + *) + verstring=0.0 + ;; + esac + if test no = "$need_version"; then + versuffix= + else + versuffix=.0.0 + fi + fi + + # Remove version info from name if versioning should be avoided + if test yes,no = "$avoid_version,$need_version"; then + major= + versuffix= + verstring= + fi + + # Check to see if the archive will have undefined symbols. + if test yes = "$allow_undefined"; then + if test unsupported = "$allow_undefined_flag"; then + if test yes = "$build_old_libs"; then + func_warning "undefined symbols not allowed in $host shared libraries; building static only" + build_libtool_libs=no + else + func_fatal_error "can't build $host shared library unless -no-undefined is specified" + fi + fi + else + # Don't allow undefined symbols. + allow_undefined_flag=$no_undefined_flag + fi + + fi + + func_generate_dlsyms "$libname" "$libname" : + func_append libobjs " $symfileobj" + test " " = "$libobjs" && libobjs= + + if test relink != "$opt_mode"; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext | *.gcno) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) + if test -n "$precious_files_regex"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + func_append removelist " $p" + ;; + *) ;; + esac + done + test -n "$removelist" && \ + func_show_eval "${RM}r \$removelist" + fi + + # Now set the variables for building old libraries. + if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then + func_append oldlibs " $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + func_replace_sysroot "$libdir" + func_append temp_xrpath " -R$func_replace_sysroot_result" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles=$dlfiles + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) func_append dlfiles " $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles=$dlprefiles + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) func_append dlprefiles " $lib" ;; + esac + done + + if test yes = "$build_libtool_libs"; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + func_append deplibs " System.ltframework" + ;; + *-*-netbsd*) + # Don't link with libc until the a.out ld.so is fixed. + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) + # Do not include libc due to us having libc/libc_r. + ;; + *-*-sco3.2v5* | *-*-sco5v6*) + # Causes problems with __ctype + ;; + *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) + # Compiler inserts libc in the correct place for threads to work + ;; + *) + # Add libc to deplibs on all other systems if necessary. + if test yes = "$build_libtool_need_lc"; then + func_append deplibs " -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release= + versuffix= + major= + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + $nocaseglob + else + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` + fi + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib=$potent_lib + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | $SED 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; + *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + case $a_deplib in + -l*) + func_stripname -l '' "$a_deplib" + name=$func_stripname_result + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + case " $predeps $postdeps " in + *" $a_deplib "*) + func_append newdeplibs " $a_deplib" + a_deplib= + ;; + esac + fi + if test -n "$a_deplib"; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib=$potent_lib # see symlink-check above in file_magic test + if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + func_append newdeplibs " $a_deplib" + a_deplib= + break 2 + fi + done + done + fi + if test -n "$a_deplib"; then + droppeddeps=yes + echo + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because I did check the linker path looking for a file starting" + if test -z "$potlib"; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + ;; + *) + # Add a -L argument. + func_append newdeplibs " $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs= + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test yes = "$allow_libtool_libs_with_static_runtimes"; then + for i in $predeps $postdeps; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test none = "$deplibs_check_method"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test yes = "$droppeddeps"; then + if test yes = "$module"; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using 'nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** 'nm' from GNU binutils and a full rebuild may help." + fi + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test no = "$allow_undefined"; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test no = "$build_old_libs"; then + oldlibs=$output_objdir/$libname.$libext + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + deplibs=$new_libs + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test yes = "$build_libtool_libs"; then + # Remove $wl instances when linking with ld. + # FIXME: should test the right _cmds variable. + case $archive_cmds in + *\$LD\ *) wl= ;; + esac + if test yes = "$hardcode_into_libs"; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath=$finalize_rpath + test relink = "$opt_mode" || rpath=$compile_rpath$rpath + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + func_replace_sysroot "$libdir" + libdir=$func_replace_sysroot_result + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append dep_rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath=$finalize_shlibpath + test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + shift + realname=$1 + shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname=$realname + fi + if test -z "$dlname"; then + dlname=$soname + fi + + lib=$output_objdir/$realname + linknames= + for link + do + func_append linknames " $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols=$output_objdir/$libname.uexp + func_append delfiles " $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw* | cegcc*) + if test -n "$export_symbols" && test -z "$export_symbols_regex"; then + # exporting using user supplied symfile + func_dll_def_p "$export_symbols" || { + # and it's NOT already a .def file. Must figure out + # which of the given symbols are data symbols and tag + # them as such. So, trigger use of export_symbols_cmds. + # export_symbols gets reassigned inside the "prepare + # the list of exported symbols" if statement, so the + # include_expsyms logic still works. + orig_export_symbols=$export_symbols + export_symbols= + always_export_symbols=yes + } + fi + ;; + esac + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + cmds=$export_symbols_cmds + save_ifs=$IFS; IFS='~' + for cmd1 in $cmds; do + IFS=$save_ifs + # Take the normal branch if the nm_file_list_spec branch + # doesn't work or if tool conversion is not needed. + case $nm_file_list_spec~$to_tool_file_cmd in + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) + try_normal_branch=yes + eval cmd=\"$cmd1\" + func_len " $cmd" + len=$func_len_result + ;; + *) + try_normal_branch=no + ;; + esac + if test yes = "$try_normal_branch" \ + && { test "$len" -lt "$max_cmd_len" \ + || test "$max_cmd_len" -le -1; } + then + func_show_eval "$cmd" 'exit $?' + skipped_export=false + elif test -n "$nm_file_list_spec"; then + func_basename "$output" + output_la=$func_basename_result + save_libobjs=$libobjs + save_output=$output + output=$output_objdir/$output_la.nm + func_to_tool_file "$output" + libobjs=$nm_file_list_spec$func_to_tool_file_result + func_append delfiles " $output" + func_verbose "creating $NM input file list: $output" + for obj in $save_libobjs; do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > "$output" + eval cmd=\"$cmd1\" + func_show_eval "$cmd" 'exit $?' + output=$save_output + libobjs=$save_libobjs + skipped_export=false + else + # The command line is too long to execute in one step. + func_verbose "using reloadable object file for export list..." + skipped_export=: + # Break out early, otherwise skipped_export may be + # set to false by a later but shorter cmd. + break + fi + done + IFS=$save_ifs + if test -n "$export_symbols_regex" && test : != "$skipped_export"; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test : != "$skipped_export" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + + tmp_deplibs= + for test_deplib in $deplibs; do + case " $convenience " in + *" $test_deplib "*) ;; + *) + func_append tmp_deplibs " $test_deplib" + ;; + esac + done + deplibs=$tmp_deplibs + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec" && + test yes = "$compiler_needs_object" && + test -z "$libobjs"; then + # extract the archives, so we have objects to list. + # TODO: could optimize this to just extract one archive. + whole_archive_flag_spec= + fi + if test -n "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + else + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + fi + + if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + func_append linker_flags " $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? + fi + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + eval test_cmds=\"$module_expsym_cmds\" + cmds=$module_expsym_cmds + else + eval test_cmds=\"$module_cmds\" + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval test_cmds=\"$archive_expsym_cmds\" + cmds=$archive_expsym_cmds + else + eval test_cmds=\"$archive_cmds\" + cmds=$archive_cmds + fi + fi + + if test : != "$skipped_export" && + func_len " $test_cmds" && + len=$func_len_result && + test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # or, if using GNU ld and skipped_export is not :, use a linker + # script. + + # Save the value of $output and $libobjs because we want to + # use them later. If we have whole_archive_flag_spec, we + # want to use save_libobjs as it was before + # whole_archive_flag_spec was expanded, because we can't + # assume the linker understands whole_archive_flag_spec. + # This may have to be revisited, in case too many + # convenience libraries get linked in and end up exceeding + # the spec. + if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then + save_libobjs=$libobjs + fi + save_output=$output + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then + output=$output_objdir/$output_la.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + echo ')' >> $output + func_append delfiles " $output" + func_to_tool_file "$output" + output=$func_to_tool_file_result + elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then + output=$output_objdir/$output_la.lnk + func_verbose "creating linker input file list: $output" + : > $output + set x $save_libobjs + shift + firstobj= + if test yes = "$compiler_needs_object"; then + firstobj="$1 " + shift + fi + for obj + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" >> $output + done + func_append delfiles " $output" + func_to_tool_file "$output" + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-$k.$objext + eval test_cmds=\"$reload_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + if test -z "$objlist" || + test "$len" -lt "$max_cmd_len"; then + func_append objlist " $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test 1 -eq "$k"; then + # The first file doesn't have a previous command to add. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-$k.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-$k.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + func_append delfiles " $output" + + else + output= + fi + + ${skipped_export-false} && { + func_verbose "generating symbol list for '$libname.la'" + export_symbols=$output_objdir/$libname.exp + $opt_dry_run || $RM $export_symbols + libobjs=$output + # Append the command to create the export file. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" + fi + } + + test -n "$save_libobjs" && + func_verbose "creating a temporary reloadable object file: $output" + + # Loop through the commands generated above and execute them. + save_ifs=$IFS; IFS='~' + for cmd in $concat_cmds; do + IFS=$save_ifs + $opt_quiet || { + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + if test -n "$export_symbols_regex" && ${skipped_export-false}; then + func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + func_show_eval '$MV "${export_symbols}T" "$export_symbols"' + fi + fi + + ${skipped_export-false} && { + if test -n "$export_symbols" && test -n "$include_expsyms"; then + tmp_export_symbols=$export_symbols + test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for '$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands, which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + func_append delfiles " $export_symbols $output_objdir/$libname.filter" + export_symbols=$output_objdir/$libname.def + $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols + fi + } + + libobjs=$output + # Restore the value of output. + output=$save_output + + if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + test "X$libobjs" = "X " && libobjs= + fi + # Expand the library linking commands again to reset the + # value of $libobjs for piecewise linking. + + # Do each of the archive commands. + if test yes = "$module" && test -n "$module_cmds"; then + if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then + cmds=$module_expsym_cmds + else + cmds=$module_cmds + fi + else + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + cmds=$archive_expsym_cmds + else + cmds=$archive_cmds + fi + fi + fi + + if test -n "$delfiles"; then + # Append the command to remove temporary files to $cmds. + eval cmds=\"\$cmds~\$RM $delfiles\" + fi + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append libobjs " $func_extract_archives_result" + test "X$libobjs" = "X " && libobjs= + fi + + save_ifs=$IFS; IFS='~' + for cmd in $cmds; do + IFS=$sp$nl + eval cmd=\"$cmd\" + IFS=$save_ifs + $opt_quiet || { + func_quote_arg expand,pretty "$cmd" + eval "func_echo $func_quote_arg_result" + } + $opt_dry_run || eval "$cmd" || { + lt_exit=$? + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + ( cd "$output_objdir" && \ + $RM "${realname}T" && \ + $MV "${realname}U" "$realname" ) + fi + + exit $lt_exit + } + done + IFS=$save_ifs + + # Restore the uninstalled library and exit + if test relink = "$opt_mode"; then + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? + + if test -n "$convenience"; then + if test -z "$whole_archive_flag_spec"; then + func_show_eval '${RM}r "$gentop"' + fi + fi + + exit $EXIT_SUCCESS + fi + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test yes = "$module" || test yes = "$export_dynamic"; then + # On all known operating systems, these are identical. + dlname=$soname + fi + fi + ;; + + obj) + if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then + func_warning "'-dlopen' is ignored for objects" + fi + + case " $deplibs" in + *\ -l* | *\ -L*) + func_warning "'-l' and '-L' are ignored for objects" ;; + esac + + test -n "$rpath" && \ + func_warning "'-rpath' is ignored for objects" + + test -n "$xrpath" && \ + func_warning "'-R' is ignored for objects" + + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for objects" + + test -n "$release" && \ + func_warning "'-release' is ignored for objects" + + case $output in + *.lo) + test -n "$objs$old_deplibs" && \ + func_fatal_error "cannot build library object '$output' from non-libtool objects" + + libobj=$output + func_lo2o "$libobj" + obj=$func_lo2o_result + ;; + *) + libobj= + obj=$output + ;; + esac + + # Delete the old objects. + $opt_dry_run || $RM $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # if reload_cmds runs $LD directly, get rid of -Wl from + # whole_archive_flag_spec and hope we can get by with turning comma + # into space. + case $reload_cmds in + *\$LD[\ \$]*) wl= ;; + esac + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" + test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` + reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags + else + gentop=$output_objdir/${obj}x + func_append generated " $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # If we're not building shared, we need to use non_pic_objs + test yes = "$build_libtool_libs" || libobjs=$non_pic_objects + + # Create the old-style object. + reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs + + output=$obj + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + test yes = "$build_libtool_libs" || { + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + } + + if test -n "$pic_flag" || test default != "$pic_mode"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output=$libobj + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "'-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "'-release' is ignored for programs" + + $preload \ + && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ + && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test CXX = "$tagname"; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + func_append compile_command " $wl-bind_at_load" + func_append finalize_command " $wl-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + func_append new_libs " -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) func_append new_libs " $deplib" ;; + esac + ;; + *) func_append new_libs " $deplib" ;; + esac + done + compile_deplibs=$new_libs + + + func_append compile_command " $compile_deplibs" + func_append finalize_command " $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) func_append finalize_rpath " $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) func_append perm_rpath " $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + ::) dllsearchpath=$libdir;; + *) func_append dllsearchpath ":$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + ::) dllsearchpath=$testbindir;; + *) func_append dllsearchpath ":$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath=$rpath + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs=$libdir + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + func_append rpath " $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) func_append finalize_perm_rpath " $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir=$hardcode_libdirs + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath=$rpath + + if test -n "$libobjs" && test yes = "$build_old_libs"; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" false + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=: + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=false + ;; + *cygwin* | *mingw* ) + test yes = "$build_libtool_libs" || wrappers_required=false + ;; + *) + if test no = "$need_relink" || test yes != "$build_libtool_libs"; then + wrappers_required=false + fi + ;; + esac + $wrappers_required || { + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command=$compile_command$compile_rpath + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Delete the generated files. + if test -f "$output_objdir/${outputname}S.$objext"; then + func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' + fi + + exit $exit_status + } + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + func_append rpath "$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + func_append rpath "$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test yes = "$no_install"; then + # We don't need to create a wrapper script. + link_command=$compile_var$compile_command$compile_rpath + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + exit $EXIT_SUCCESS + fi + + case $hardcode_action,$fast_install in + relink,*) + # Fast installation is not supported + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "'$output' will be relinked during installation" + ;; + *,yes) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + ;; + *,no) + link_command=$compile_var$compile_command$compile_rpath + relink_command=$finalize_var$finalize_command$finalize_rpath + ;; + *,needless) + link_command=$finalize_var$compile_command$finalize_rpath + relink_command= + ;; + esac + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + if test -n "$postlink_cmds"; then + func_to_tool_file "$output_objdir/$outputname" + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` + func_execute_cmds "$postlink_cmds" 'exit $?' + fi + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_arg pretty "$var_value" + relink_command="$var=$func_quote_arg_result; export $var; $relink_command" + fi + done + func_quote eval cd "`pwd`" + func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" + relink_command=$func_quote_arg_unquoted_result + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource=$output_path/$objdir/lt-$output_name.c + cwrapper=$output_path/$output_name.exe + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host"; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + case $build_libtool_libs in + convenience) + oldobjs="$libobjs_save $symfileobj" + addlibs=$convenience + build_libtool_libs=no + ;; + module) + oldobjs=$libobjs_save + addlibs=$old_convenience + build_libtool_libs=no + ;; + *) + oldobjs="$old_deplibs $non_pic_objects" + $preload && test -f "$symfileobj" \ + && func_append oldobjs " $symfileobj" + addlibs=$old_convenience + ;; + esac + + if test -n "$addlibs"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $addlibs + func_append oldobjs " $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + + func_extract_archives $gentop $dlprefiles + func_append oldobjs " $func_extract_archives_result" + fi + + # POSIX demands no paths to be encoded in archives. We have + # to avoid creating archives with duplicate basenames if we + # might have to extract them afterwards, e.g., when creating a + # static archive out of a convenience library, or when linking + # the entirety of a libtool archive into another (currently + # not supported by libtool). + if (for obj in $oldobjs + do + func_basename "$obj" + $ECHO "$func_basename_result" + done | sort | sort -uc >/dev/null 2>&1); then + : + else + echo "copying selected object files to avoid basename conflicts..." + gentop=$output_objdir/${outputname}x + func_append generated " $gentop" + func_mkdir_p "$gentop" + save_oldobjs=$oldobjs + oldobjs= + counter=1 + for obj in $save_oldobjs + do + func_basename "$obj" + objbase=$func_basename_result + case " $oldobjs " in + " ") oldobjs=$obj ;; + *[\ /]"$objbase "*) + while :; do + # Make sure we don't pick an alternate name that also + # overlaps. + newobj=lt$counter-$objbase + func_arith $counter + 1 + counter=$func_arith_result + case " $oldobjs " in + *[\ /]"$newobj "*) ;; + *) if test ! -f "$gentop/$newobj"; then break; fi ;; + esac + done + func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" + func_append oldobjs " $gentop/$newobj" + ;; + *) func_append oldobjs " $obj" ;; + esac + done + fi + func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 + tool_oldlib=$func_to_tool_file_result + eval cmds=\"$old_archive_cmds\" + + func_len " $cmds" + len=$func_len_result + if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + elif test -n "$archiver_list_spec"; then + func_verbose "using command file archive linking..." + for obj in $oldobjs + do + func_to_tool_file "$obj" + $ECHO "$func_to_tool_file_result" + done > $output_objdir/$libname.libcmd + func_to_tool_file "$output_objdir/$libname.libcmd" + oldobjs=" $archiver_list_spec$func_to_tool_file_result" + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + oldobjs= + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + eval test_cmds=\"$old_archive_cmds\" + func_len " $test_cmds" + len0=$func_len_result + len=$len0 + for obj in $save_oldobjs + do + func_len " $obj" + func_arith $len + $func_len_result + len=$func_arith_result + func_append objlist " $obj" + if test "$len" -lt "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj"; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" + objlist= + len=$len0 + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test -z "$oldobjs"; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + func_execute_cmds "$cmds" 'exit $?' + done + + test -n "$generated" && \ + func_show_eval "${RM}r$generated" + + # Now create the libtool archive. + case $output in + *.la) + old_library= + test yes = "$build_old_libs" && old_library=$libname.$libext + func_verbose "creating $output" + + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_arg pretty,unquoted "$var_value" + relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" + fi + done + # Quote the link command for shipping. + func_quote eval cd "`pwd`" + relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" + func_quote_arg pretty,unquoted "$relink_command" + relink_command=$func_quote_arg_unquoted_result + if test yes = "$hardcode_automatic"; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test yes = "$installed"; then + if test -z "$install_libdir"; then + break + fi + output=$output_objdir/${outputname}i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name=$func_basename_result + func_resolve_sysroot "$deplib" + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` + test -z "$libdir" && \ + func_fatal_error "'$deplib' is not a valid libtool archive" + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" + ;; + -L*) + func_stripname -L '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -L$func_replace_sysroot_result" + ;; + -R*) + func_stripname -R '' "$deplib" + func_replace_sysroot "$func_stripname_result" + func_append newdependency_libs " -R$func_replace_sysroot_result" + ;; + *) func_append newdependency_libs " $deplib" ;; + esac + done + dependency_libs=$newdependency_libs + newdlfiles= + + for lib in $dlfiles; do + case $lib in + *.la) + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" + ;; + *) func_append newdlfiles " $lib" ;; + esac + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + *.la) + # Only pass preopened files to the pseudo-archive (for + # eventual linking with the app. that links it) if we + # didn't already link the preopened objects directly into + # the library: + func_basename "$lib" + name=$func_basename_result + eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` + test -z "$libdir" && \ + func_fatal_error "'$lib' is not a valid libtool archive" + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" + ;; + esac + done + dlprefiles=$newdlprefiles + else + newdlfiles= + for lib in $dlfiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlfiles " $abs" + done + dlfiles=$newdlfiles + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; + *) abs=`pwd`"/$lib" ;; + esac + func_append newdlprefiles " $abs" + done + dlprefiles=$newdlprefiles + fi + $RM $output + # place dlname in correct position for cygwin + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test -n "$bindir"; then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result/$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test no,yes = "$installed,$need_relink"; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +if test link = "$opt_mode" || test relink = "$opt_mode"; then + func_mode_link ${1+"$@"} +fi + + +# func_mode_uninstall arg... +func_mode_uninstall () +{ + $debug_cmd + + RM=$nonopt + files= + rmforce=false + exit_status=0 + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic=$magic + + for arg + do + case $arg in + -f) func_append RM " $arg"; rmforce=: ;; + -*) func_append RM " $arg" ;; + *) func_append files " $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + for file in $files; do + func_dirname "$file" "" "." + dir=$func_dirname_result + if test . = "$dir"; then + odir=$objdir + else + odir=$dir/$objdir + fi + func_basename "$file" + name=$func_basename_result + test uninstall = "$opt_mode" && odir=$dir + + # Remember odir for removal later, being careful to avoid duplicates + if test clean = "$opt_mode"; then + case " $rmdirs " in + *" $odir "*) ;; + *) func_append rmdirs " $odir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif $rmforce; then + continue + fi + + rmfiles=$file + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + func_append rmfiles " $odir/$n" + done + test -n "$old_library" && func_append rmfiles " $odir/$old_library" + + case $opt_mode in + clean) + case " $library_names " in + *" $dlname "*) ;; + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; + esac + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' + fi + # FIXME: should reinstall the best remaining shared library. + ;; + esac + fi + ;; + + *.lo) + # Possibly a libtool object, so verify it. + if func_lalib_p "$file"; then + + # Read the .lo file + func_source $dir/$name + + # Add PIC object to the list of files to remove. + if test -n "$pic_object" && test none != "$pic_object"; then + func_append rmfiles " $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && test none != "$non_pic_object"; then + func_append rmfiles " $dir/$non_pic_object" + fi + fi + ;; + + *) + if test clean = "$opt_mode"; then + noexename=$name + case $file in + *.exe) + func_stripname '' '.exe' "$file" + file=$func_stripname_result + func_stripname '' '.exe' "$name" + noexename=$func_stripname_result + # $file with .exe has already been added to rmfiles, + # add $file without .exe + func_append rmfiles " $file" + ;; + esac + # Do a test to see if this is a libtool program. + if func_ltwrapper_p "$file"; then + if func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + relink_command= + func_source $func_ltwrapper_scriptname_result + func_append rmfiles " $func_ltwrapper_scriptname_result" + else + relink_command= + func_source $dir/$noexename + fi + + # note $name still contains .exe if it was in $file originally + # as does the version of $file that was added into $rmfiles + func_append rmfiles " $odir/$name $odir/${name}S.$objext" + if test yes = "$fast_install" && test -n "$relink_command"; then + func_append rmfiles " $odir/lt-$name" + fi + if test "X$noexename" != "X$name"; then + func_append rmfiles " $odir/lt-$noexename.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + + # Try to remove the $objdir's in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then + func_mode_uninstall ${1+"$@"} +fi + +test -z "$opt_mode" && { + help=$generic_help + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode '$opt_mode'" + +if test -n "$exec_cmd"; then + eval exec "$exec_cmd" + exit $EXIT_FAILURE +fi + +exit $exit_status + + +# The TAGs below are defined such that we never get into a situation +# where we disable both kinds of libraries. Given conflicting +# choices, we go for a static library, that is the most portable, +# since we can't tell whether shared libraries were disabled because +# the user asked for that or because the platform doesn't support +# them. This is particularly important on AIX, because we don't +# support having both static and shared libraries enabled at the same +# time on that platform, so we default to a shared-only configuration. +# If a disable-shared tag is given, we'll fallback to a static-only +# configuration. But we'll never go from static-only to shared-only. + +# ### BEGIN LIBTOOL TAG CONFIG: disable-shared +build_libtool_libs=no +build_old_libs=yes +# ### END LIBTOOL TAG CONFIG: disable-shared + +# ### BEGIN LIBTOOL TAG CONFIG: disable-static +build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` +# ### END LIBTOOL TAG CONFIG: disable-static + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End: diff --git a/build/ltoptions.m4 b/build/ltoptions.m4 new file mode 100644 index 0000000..b0b5e9c --- /dev/null +++ b/build/ltoptions.m4 @@ -0,0 +1,437 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004-2005, 2007-2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 8 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option '$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl 'shared' nor 'disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], + [_LT_WITH_AIX_SONAME([aix])]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the 'shared' and +# 'disable-shared' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the 'static' and +# 'disable-static' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the 'fast-install' +# and 'disable-fast-install' LT_INIT options. +# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the 'disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_AIX_SONAME([DEFAULT]) +# ---------------------------------- +# implement the --with-aix-soname flag, and support the `aix-soname=aix' +# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT +# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. +m4_define([_LT_WITH_AIX_SONAME], +[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl +shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[[5-9]]*,yes) + AC_MSG_CHECKING([which variant of shared library versioning to provide]) + AC_ARG_WITH([aix-soname], + [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], + [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], + [case $withval in + aix|svr4|both) + ;; + *) + AC_MSG_ERROR([Unknown argument to --with-aix-soname]) + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname], + [AC_CACHE_VAL([lt_cv_with_aix_soname], + [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) + with_aix_soname=$lt_cv_with_aix_soname]) + AC_MSG_RESULT([$with_aix_soname]) + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + +_LT_DECL([], [shared_archive_member_spec], [0], + [Shared archive member basename, for filename based shared library versioning on AIX])dnl +])# _LT_WITH_AIX_SONAME + +LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) +LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the 'pic-only' and 'no-pic' +# LT_INIT options. +# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac], + [pic_mode=m4_default([$1], [default])]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +AU_DEFUN([AC_LIBTOOL_PICMODE], +[_LT_SET_OPTION([LT_INIT], [pic-only]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the 'pic-only' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff --git a/build/ltsugar.m4 b/build/ltsugar.m4 new file mode 100644 index 0000000..902508b --- /dev/null +++ b/build/ltsugar.m4 @@ -0,0 +1,124 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007-2008, 2011-2019, 2021-2022 Free Software +# Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 6 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59, which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +# Needed until we can rely on m4_combine added in Autoconf 2.62. +m4_define([lt_combine], +[m4_if(m4_eval([$# > 3]), [1], + [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl +[[m4_foreach([_Lt_prefix], [$2], + [m4_foreach([_Lt_suffix], + ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, + [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff --git a/build/ltversion.m4 b/build/ltversion.m4 new file mode 100644 index 0000000..b155d0a --- /dev/null +++ b/build/ltversion.m4 @@ -0,0 +1,24 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, +# Inc. +# Written by Scott James Remnant, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# @configure_input@ + +# serial 4245 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.4.7]) +m4_define([LT_PACKAGE_REVISION], [2.4.7]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.4.7' +macro_revision='2.4.7' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/build/lt~obsolete.m4 b/build/lt~obsolete.m4 new file mode 100644 index 0000000..0f7a875 --- /dev/null +++ b/build/lt~obsolete.m4 @@ -0,0 +1,99 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004-2005, 2007, 2009, 2011-2019, 2021-2022 Free +# Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/build/missing b/build/missing new file mode 100755 index 0000000..1fe1611 --- /dev/null +++ b/build/missing @@ -0,0 +1,215 @@ +#! /bin/sh +# Common wrapper for a few potentially missing GNU programs. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try '$0 --help' for more information" + exit 1 +fi + +case $1 in + + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; + + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man + +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" + exit 1 + ;; + +esac + +# Run the given program, remember its exit status. +"$@"; st=$? + +# If it succeeded, we are done. +test $st -eq 0 && exit 0 + +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi + +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st + +# Local variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/build/pkg.m4 b/build/pkg.m4 new file mode 100644 index 0000000..c5b26b5 --- /dev/null +++ b/build/pkg.m4 @@ -0,0 +1,214 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR + + +# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, +# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------- +# Retrieves the value of the pkg-config variable for the given module. +AC_DEFUN([PKG_CHECK_VAR], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl + +_PKG_CONFIG([$1], [variable="][$3]["], [$2]) +AS_VAR_COPY([$1], [pkg_cv_][$1]) + +AS_VAR_IF([$1], [""], [$5], [$4])dnl +])# PKG_CHECK_VAR diff --git a/build/test-driver b/build/test-driver new file mode 100755 index 0000000..be73b80 --- /dev/null +++ b/build/test-driver @@ -0,0 +1,153 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2018-03-07.03; # UTC + +# Copyright (C) 2011-2021 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <"$log_file" +"$@" >>"$log_file" 2>&1 +estatus=$? + +if test $enable_hard_errors = no && test $estatus -eq 99; then + tweaked_estatus=1 +else + tweaked_estatus=$estatus +fi + +case $tweaked_estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>"$log_file" + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: diff --git a/configure b/configure new file mode 100755 index 0000000..fea68ab --- /dev/null +++ b/configure @@ -0,0 +1,20961 @@ +#! /bin/sh +# From configure.ac Revision: . +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.71 for Raptor RDF Parser and Serializer library 2.0.16. +# +# Report bugs to . +# +# +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else \$as_nop + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : + +else \$as_nop + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 +test -x / || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null +then : + as_have_required=yes +else $as_nop + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : + +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$as_shell as_have_required=yes + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : + break 2 +fi +fi + done;; + esac + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi + + + if test "x$CONFIG_SHELL" != x +then : + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 +fi + + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." + else + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: https://bugs.librdf.org/ about your system, including +$0: any error possibly output before this message. Then +$0: install a modern shell, or manually run the script +$0: under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='Raptor RDF Parser and Serializer library' +PACKAGE_TARNAME='raptor2' +PACKAGE_VERSION='2.0.16' +PACKAGE_STRING='Raptor RDF Parser and Serializer library 2.0.16' +PACKAGE_BUGREPORT='https://bugs.librdf.org/' +PACKAGE_URL='' + +ac_unique_file="src/raptor_general.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_STDIO_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_header_c_list= +ac_c_werror_flag= +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +GTK_DOC_USE_REBASE_FALSE +GTK_DOC_USE_REBASE_TRUE +GTK_DOC_USE_LIBTOOL_FALSE +GTK_DOC_USE_LIBTOOL_TRUE +GTK_DOC_BUILD_PDF_FALSE +GTK_DOC_BUILD_PDF_TRUE +GTK_DOC_BUILD_HTML_FALSE +GTK_DOC_BUILD_HTML_TRUE +ENABLE_GTK_DOC_FALSE +ENABLE_GTK_DOC_TRUE +HAVE_GTK_DOC_FALSE +HAVE_GTK_DOC_TRUE +GTKDOC_DEPS_LIBS +GTKDOC_DEPS_CFLAGS +HTML_DIR +GTKDOC_MKPDF +GTKDOC_REBASE +GTKDOC_CHECK_PATH +GTKDOC_CHECK +abs_top_builddir +abs_top_srcdir +RAPTOR_XML_PARSER +RAPTOR_WWW_LIBRARY +RAPTOR_SERIALIZERS +RAPTOR_PARSERS +RECHO_C +RECHO_N +MEM_LIBS +MEM +PKG_CONFIG_REQUIRES +RAPTOR_LDFLAGS +RAPTOR_LIBTOOLLIBS +RAPTOR_XML_LIBXML_FALSE +RAPTOR_XML_LIBXML_TRUE +PARSEDATE_FALSE +PARSEDATE_TRUE +LIBOBJS +RAPTOR_ICU_NFC_FALSE +RAPTOR_ICU_NFC_TRUE +RAPTOR_RSS_COMMON_FALSE +RAPTOR_RSS_COMMON_TRUE +RAPTOR_SERIALIZER_NQUADS_FALSE +RAPTOR_SERIALIZER_NQUADS_TRUE +RAPTOR_SERIALIZER_JSON_FALSE +RAPTOR_SERIALIZER_JSON_TRUE +RAPTOR_SERIALIZER_HTML_FALSE +RAPTOR_SERIALIZER_HTML_TRUE +RAPTOR_SERIALIZER_DOT_FALSE +RAPTOR_SERIALIZER_DOT_TRUE +RAPTOR_SERIALIZER_ATOM_FALSE +RAPTOR_SERIALIZER_ATOM_TRUE +RAPTOR_SERIALIZER_RSS_1_0_FALSE +RAPTOR_SERIALIZER_RSS_1_0_TRUE +RAPTOR_SERIALIZER_MKR_FALSE +RAPTOR_SERIALIZER_MKR_TRUE +RAPTOR_SERIALIZER_TURTLE_FALSE +RAPTOR_SERIALIZER_TURTLE_TRUE +RAPTOR_SERIALIZER_RDFXML_ABBREV_FALSE +RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE +RAPTOR_SERIALIZER_NTRIPLES_FALSE +RAPTOR_SERIALIZER_NTRIPLES_TRUE +RAPTOR_SERIALIZER_RDFXML_FALSE +RAPTOR_SERIALIZER_RDFXML_TRUE +LIBRDFA_FALSE +LIBRDFA_TRUE +RAPTOR_PARSER_NQUADS_FALSE +RAPTOR_PARSER_NQUADS_TRUE +RAPTOR_PARSER_JSON_FALSE +RAPTOR_PARSER_JSON_TRUE +RAPTOR_PARSER_RDFA_FALSE +RAPTOR_PARSER_RDFA_TRUE +RAPTOR_PARSER_GUESS_FALSE +RAPTOR_PARSER_GUESS_TRUE +RAPTOR_PARSER_GRDDL_FALSE +RAPTOR_PARSER_GRDDL_TRUE +RAPTOR_PARSER_RSS_FALSE +RAPTOR_PARSER_RSS_TRUE +RAPTOR_PARSER_TRIG_FALSE +RAPTOR_PARSER_TRIG_TRUE +RAPTOR_PARSER_TURTLE_FALSE +RAPTOR_PARSER_TURTLE_TRUE +RAPTOR_PARSER_NTRIPLES_FALSE +RAPTOR_PARSER_NTRIPLES_TRUE +RAPTOR_PARSER_RDFXML_FALSE +RAPTOR_PARSER_RDFXML_TRUE +ICU_LIBS +ICU_CFLAGS +LIBCURL_LIBS +LIBCURL_CFLAGS +CURL_CONFIG +XSLT_LIBS +XSLT_CFLAGS +XSLT_CONFIG +LIBXML_LIBS +LIBXML_CFLAGS +XML_CONFIG +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH +PKG_CONFIG +GETOPT_FALSE +GETOPT_TRUE +STRCASECMP_FALSE +STRCASECMP_TRUE +NEED_STRTOK_R_FALSE +NEED_STRTOK_R_TRUE +RAPTOR_LIBTOOL_VERSION +RAPTOR_VERSION_DECIMAL +RAPTOR_VERSION_RELEASE +RAPTOR_VERSION_MINOR +RAPTOR_VERSION_MAJOR +RAPTOR_VERSION +RECHO +JING +PERL +TAR +BISON +LEXLIB +LEX_OUTPUT_ROOT +LEX +LT_SYS_LIBRARY_PATH +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +MANIFEST_TOOL +RANLIB +DLLTOOL +OBJDUMP +FILECMD +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +LIBTOOL +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +ac_ct_AR +AR +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +RPM_RELEASE +RELEASE_VERSION_FALSE +RELEASE_VERSION_TRUE +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V +CSCOPE +ETAGS +CTAGS +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +runstatedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL +am__quote' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_silent_rules +enable_maintainer_mode +enable_release +enable_dependency_tracking +enable_shared +enable_static +with_pic +enable_fast_install +with_aix_soname +with_gnu_ld +with_sysroot +enable_libtool_lock +enable_largefile +with_xml2_config +with_xslt_config +with_curl_config +with_www_config +with_yajl +enable_parsers +enable_serializers +with_xml_names +with_www +with_memory_signing +enable_debug +with_html_dir +enable_gtk_doc +enable_gtk_doc_html +enable_gtk_doc_pdf +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +LT_SYS_LIBRARY_PATH +PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR +LIBXML_CFLAGS +LIBXML_LIBS +XSLT_CFLAGS +XSLT_LIBS +LIBCURL_CFLAGS +LIBCURL_LIBS +ICU_CFLAGS +ICU_LIBS +GTKDOC_DEPS_CFLAGS +GTKDOC_DEPS_LIBS' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: \`$ac_useropt'" + ac_useropt_orig=$ac_useropt + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir runstatedir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +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 Raptor RDF Parser and Serializer library 2.0.16 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/raptor2] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of Raptor RDF Parser and Serializer library 2.0.16:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-maintainer-mode + enable make rules and dependencies not useful (and + sometimes confusing) to the casual installer + --enable-release Turn on optimizations (for maintainer). + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build + --enable-shared[=PKGS] build shared libraries [default=yes] + --enable-static[=PKGS] build static libraries [default=yes] + --enable-fast-install[=PKGS] + optimize for fast installation [default=yes] + --disable-libtool-lock avoid locking (might break parallel builds) + --disable-largefile omit support for large files + --enable-parsers=LIST Use RDF parsers (default=all) + --enable-serializers=LIST Use RDF serializers (default=all) + --enable-debug Enable debug messages (default no). + --enable-gtk-doc use gtk-doc to build documentation [[default=no]] + --enable-gtk-doc-html build documentation in html format [[default=yes]] + --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] + --with-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. + --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --with-sysroot[=DIR] Search for dependent libraries within DIR (or the + compiler's sysroot if not specified). + --with-xml2-config=PATH Location of libxml xml2-config + --with-xslt-config=PATH Location of libxslt xslt-config + --with-curl-config=PATH Location of libcurl curl-config + --with-libwww-config=PATH Location of W3C libwww libwww-config + --with-yajl=DIR YAJL installation directory or 'no' to disable (default=auto) + --with-xml-names=1.1|1.0 Select XML version name checking (default=1.0) + --with-www=NAME Use WWW library - curl (default), xml, libfetch, none + --with-memory-signing Sign allocated memory (default=no) + --with-html-dir=PATH path to installed docs + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + LT_SYS_LIBRARY_PATH + User-defined run-time library search path. + PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path + LIBXML_CFLAGS + C compiler flags for LIBXML, overriding pkg-config + LIBXML_LIBS linker flags for LIBXML, overriding pkg-config + XSLT_CFLAGS C compiler flags for XSLT, overriding pkg-config + XSLT_LIBS linker flags for XSLT, overriding pkg-config + LIBCURL_CFLAGS + C compiler flags for LIBCURL, overriding pkg-config + LIBCURL_LIBS + linker flags for LIBCURL, overriding pkg-config + ICU_CFLAGS C compiler flags for ICU, overriding pkg-config + ICU_LIBS linker flags for ICU, overriding pkg-config + GTKDOC_DEPS_CFLAGS + C compiler flags for GTKDOC_DEPS, overriding pkg-config + GTKDOC_DEPS_LIBS + linker flags for GTKDOC_DEPS, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +Raptor RDF Parser and Serializer library configure 2.0.16 +generated by GNU Autoconf 2.71 + +Copyright (C) 2021 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. */ + +#include +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main (void) +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + +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 Raptor RDF Parser and Serializer library $as_me 2.0.16, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" + # Save into config.log some information that might help in debugging. + { + echo + + printf "%s\n" "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + printf "%s\n" "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + printf "%s\n" "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + printf "%s\n" "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + printf "%s\n" "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +printf "%s\n" "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h + +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + ac_site_files="$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" +else + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +fi + +for ac_site_file in $ac_site_files +do + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif + +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" + +# Auxiliary files required by this configure script. +ac_aux_files="ltmain.sh compile ar-lib config.guess config.sub missing install-sh" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/build" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_config_headers="$ac_config_headers src/raptor_config.h" + + + +am__api_version='1.16' + + + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test ${ac_cv_path_install+y}; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + + +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` + + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" +fi +# Use eval to expand $SHELL +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " +else + am_missing_run= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the 'STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test ${ac_cv_path_mkdir+y}; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='raptor2' + VERSION='2.0.16' + + +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h + + +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + + +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + + +libxml_min_version=2.6.8 + +libxslt_min_version=1.0.18 + +libcurl_min_version=7.12.0 +libcurl_min_vernum=071200 + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test ${enable_maintainer_mode+y} +then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else $as_nop + USE_MAINTAINER_MODE=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + +release_version=no +# Check whether --enable-release was given. +if test ${enable_release+y} +then : + enableval=$enable_release; \ + if test "$enableval" = "yes"; then \ + release_version=yes +fi; +fi + + + if test $release_version = yes; then + RELEASE_VERSION_TRUE= + RELEASE_VERSION_FALSE='#' +else + RELEASE_VERSION_TRUE='#' + RELEASE_VERSION_FALSE= +fi + +if test "$USE_MAINTAINER_MODE" = yes -a $release_version = no; then + CFLAGS=`echo $CFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` + CXXFLAGS=`echo $CXXFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` + CPPFLAGS=`echo $CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` + fi +RPM_RELEASE=SNAP +if test "$release_version" = "yes"; then + RPM_RELEASE=1 +fi + + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; +esac + +# Do 'set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + + + + + + + + + + +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + +# Check whether --enable-dependency-tracking was given. +if test ${enable_dependency_tracking+y} +then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else $as_nop + ac_file='' +fi +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + + + if test -n "$ac_tool_prefix"; then + for ac_prog in ar lib "link -lib" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar lib "link -lib" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +printf %s "checking the archiver ($AR) interface... " >&6; } +if test ${am_cv_ar_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + am_cv_ar_interface=ar + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int some_variable = 0; +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=ar + else + am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 + (eval $am_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test "$ac_status" -eq 0; then + am_cv_ar_interface=lib + else + am_cv_ar_interface=unknown + fi + fi + rm -f conftest.lib libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +printf "%s\n" "$am_cv_ar_interface" >&6; } + +case $am_cv_ar_interface in +ar) + ;; +lib) + # Microsoft lib, so override with the ar-lib wrapper script. + # FIXME: It is wrong to rewrite AR. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__AR in this case, + # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something + # similar. + AR="$am_aux_dir/ar-lib $AR" + ;; +unknown) + as_fn_error $? "could not determine $AR interface" "$LINENO" 5 + ;; +esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion -version; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_compiler_gnu=yes +else $as_nop + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+y} +ac_save_CFLAGS=$CFLAGS +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +else $as_nop + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is clang" >&5 +printf %s "checking whether $CC is clang... " >&6; } +CC_IS_CLANG=no +if $CC 2>&1 | grep clang >/dev/null 2>&1; then + CC_IS_CLANG=yes +else + : +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC_IS_CLANG" >&5 +printf "%s\n" "$CC_IS_CLANG" >&6; } + +case `pwd` in + *\ * | *\ *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.4.7' +macro_revision='2.4.7' + + + + + + + + + + + + + + +ltmain=$ac_aux_dir/ltmain.sh + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case $ECHO in + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_SED" || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_GREP" || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP" || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 + then ac_cv_path_FGREP="$GREP -F" + else + if test -z "$FGREP"; then + ac_path_FGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_FGREP" || continue +# Check for GNU ac_path_FGREP and select it if it is found. + # Check for GNU $ac_path_FGREP +case `"$ac_path_FGREP" --version 2>&1` in +*GNU*) + ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" + "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test ${with_gnu_ld+y} +then : + withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes +else $as_nop + with_gnu_ld=no +fi + +ac_prog=ld +if test yes = "$GCC"; then + # Check if gcc -print-prog-name=ld gives a path. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return, which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD=$ac_prog + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test yes = "$with_gnu_ld"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } +fi +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$LD"; then + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD=$ac_dir/$ac_prog + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +printf "%s\n" "$LD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM=$NM +else + lt_nm_to_check=${ac_tool_prefix}nm + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + tmp_nm=$ac_dir/$lt_tmp_nm + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the 'sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty + case $build_os in + mingw*) lt_bad_file=conftest.nm/nofile ;; + *) lt_bad_file=/dev/null ;; + esac + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in + *$lt_bad_file* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break 2 + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break 2 + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS=$lt_save_ifs + done + : ${lt_cv_path_NM=no} +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } +if test no != "$lt_cv_path_NM"; then + NM=$lt_cv_path_NM +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DUMPBIN"; then + ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols -headers" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test : != "$DUMPBIN"; then + NM=$DUMPBIN + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop + i=0 + teststring=ABCD + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + bitrig* | darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + os2*) + # The test takes a long time on OS/2. + lt_cv_sys_max_cmd_len=8192 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + # Make teststring a little bigger before we do anything with it. + # a 1K string should be a reasonable start. + for i in 1 2 3 4 5 6 7 8; do + teststring=$teststring$teststring + done + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + while { test X`env echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test 17 != "$i" # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n "$lt_cv_sys_max_cmd_len"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 + ;; + esac + ;; + *-*-cygwin* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin + ;; + *-*-cygwin* ) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; + * ) # otherwise, assume *nix + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin + ;; + esac + ;; + * ) # unhandled hosts (and "normal" native builds) + lt_cv_to_host_file_cmd=func_convert_file_noop + ;; +esac + +fi + +to_host_file_cmd=$lt_cv_to_host_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + #assume ordinary cross tools, or native build. +lt_cv_to_tool_file_cmd=func_convert_file_noop +case $host in + *-*-mingw* ) + case $build in + *-*-mingw* ) # actually msys + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 + ;; + esac + ;; +esac + +fi + +to_tool_file_cmd=$lt_cv_to_tool_file_cmd +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_reload_flag='-r' +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + if test yes != "$GCC"; then + reload_cmds=false + fi + ;; + darwin*) + if test yes = "$GCC"; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}file", so it can be a program name with args. +set dummy ${ac_tool_prefix}file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="${ac_tool_prefix}file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_FILECMD"; then + ac_ct_FILECMD=$FILECMD + # Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_FILECMD"; then + ac_cv_prog_ac_ct_FILECMD="$ac_ct_FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_FILECMD=$ac_cv_prog_ac_ct_FILECMD +if test -n "$ac_ct_FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FILECMD" >&5 +printf "%s\n" "$ac_ct_FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_FILECMD" = x; then + FILECMD=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + FILECMD=$ac_ct_FILECMD + fi +else + FILECMD="$ac_cv_prog_FILECMD" +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OBJDUMP"; then + ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OBJDUMP="objdump" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# 'unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# that responds to the $file_magic_cmd with a given extended regex. +# If you have 'file' or equivalent on your system and you're not sure +# whether 'pass_all' will *always* work, you probably want this one. + +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +bsdi[45]*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + lt_cv_file_magic_cmd='$FILECMD -L' + lt_cv_file_magic_test_file=/shlib/libc.so + ;; + +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly* | midnightbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=$FILECMD + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=$FILECMD + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=$FILECMD + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd* | bitrig*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +os2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } + +file_magic_glob= +want_nocaseglob=no +if test "$build" = "$host"; then + case $host_os in + mingw* | pw32*) + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then + want_nocaseglob=yes + else + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` + fi + ;; + esac +fi + +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + + + + + + + + + + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ac_tool_prefix}dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DLLTOOL=$ac_cv_prog_DLLTOOL +if test -n "$DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DLLTOOL"; then + ac_ct_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DLLTOOL"; then + ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DLLTOOL="dlltool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL +if test -n "$ac_ct_DLLTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DLLTOOL" = x; then + DLLTOOL="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DLLTOOL=$ac_ct_DLLTOOL + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + +test -z "$DLLTOOL" && DLLTOOL=dlltool + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_sharedlib_from_linklib_cmd='unknown' + +case $host_os in +cygwin* | mingw* | pw32* | cegcc*) + # two different shell functions defined in ltmain.sh; + # decide which one to use based on capabilities of $DLLTOOL + case `$DLLTOOL --help 2>&1` in + *--identify-strict*) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib + ;; + *) + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback + ;; + esac + ;; +*) + # fallback: assume linklib IS sharedlib + lt_cv_sharedlib_from_linklib_cmd=$ECHO + ;; +esac + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO + + + + + + + +if test -n "$ac_tool_prefix"; then + for ac_prog in ar + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="$ac_tool_prefix$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$AR" && break + done +fi +if test -z "$AR"; then + ac_ct_AR=$AR + for ac_prog in ar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$ac_ct_AR" && break +done + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +fi + +: ${AR=ar} + + + + + + +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because thats what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. + +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS + + + + + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ar_at_file=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + echo conftest.$ac_objext > conftest.lst + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -eq "$ac_status"; then + # Ensure the archiver fails upon bogus file names. + rm -f conftest.$ac_objext libconftest.a + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 + (eval $lt_ar_try) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if test 0 -ne "$ac_status"; then + lt_cv_ar_at_file=@ + fi + fi + rm -f conftest.* libconftest.a + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } + +if test no = "$lt_cv_ar_at_file"; then + archiver_list_spec= +else + archiver_list_spec=$lt_cv_ar_at_file +fi + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + bitrig* | openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[ABCDGISTW]' + ;; +hpux*) + if test ia64 = "$host_cpu"; then + symcode='[ABCDEGRST]' + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac + +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Gets list of data symbols to import. + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" + # Adjust the below global symbol transforms to fixup imported variables. + lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" + lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" + lt_c_name_lib_hook="\ + -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ + -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" +else + # Disable hooks by default. + lt_cv_sys_global_symbol_to_import= + lt_cdecl_hook= + lt_c_name_hook= + lt_c_name_lib_hook= +fi + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ +$lt_cdecl_hook\ +" -e 's/^T .* \(.*\)$/extern int \1();/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ +$lt_c_name_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" + +# Transform an extracted symbol line into symbol name with lib prefix and +# symbol address. +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ +$lt_c_name_lib_hook\ +" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ +" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ +" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function, + # D for any global variable and I for any imported variable. + # Also find C++ and __fastcall symbols from MSVC++ or ICC, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK '"\ +" {last_section=section; section=\$ 3};"\ +" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ +" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ +" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ +" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ +" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ +" \$ 0!~/External *\|/{next};"\ +" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ +" {if(hide[section]) next};"\ +" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ +" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ +" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ +" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ +" ' prfx=^$ac_symprfx" + else + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + fi + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" + + # Check to see that the pipe works correctly. + pipe_works=no + + rm -f conftest* + cat > conftest.$ac_ext <<_LT_EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(void); +void nm_test_func(void){} +#ifdef __cplusplus +} +#endif +int main(){nm_test_var='a';nm_test_func();return(0);} +_LT_EOF + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5 + if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ +#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE +/* DATA imports from DLLs on WIN32 can't be const, because runtime + relocations are performed -- see ld's documentation on pseudo-relocs. */ +# define LT_DLSYM_CONST +#elif defined __osf__ +/* This system does not cope well with relocations in const data. */ +# define LT_DLSYM_CONST +#else +# define LT_DLSYM_CONST const +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' + + cat <<_LT_EOF >> conftest.$ac_ext + +/* The mapping between symbol names and symbols. */ +LT_DLSYM_CONST struct { + const char *name; + void *address; +} +lt__PROGRAM__LTX_preloaded_symbols[] = +{ + { "@PROGRAM@", (void *) 0 }, +_LT_EOF + $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext + cat <<\_LT_EOF >> conftest.$ac_ext + {0, (void *) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_globsym_save_LIBS=$LIBS + lt_globsym_save_CFLAGS=$CFLAGS + LIBS=conftstm.$ac_objext + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest$ac_exeext; then + pipe_works=yes + fi + LIBS=$lt_globsym_save_LIBS + CFLAGS=$lt_globsym_save_CFLAGS + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test yes = "$pipe_works"; then + break + else + lt_cv_sys_global_symbol_pipe= + fi +done + +fi + +if test -z "$lt_cv_sys_global_symbol_pipe"; then + lt_cv_sys_global_symbol_to_cdecl= +fi +if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } +fi + +# Response file support. +if test "$lt_cv_nm_interface" = "MS dumpbin"; then + nm_file_list_spec='@' +elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then + nm_file_list_spec='@' +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } + +# Check whether --with-sysroot was given. +if test ${with_sysroot+y} +then : + withval=$with_sysroot; +else $as_nop + with_sysroot=no +fi + + +lt_sysroot= +case $with_sysroot in #( + yes) + if test yes = "$GCC"; then + lt_sysroot=`$CC --print-sysroot 2>/dev/null` + fi + ;; #( + /*) + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` + ;; #( + no|'') + ;; #( + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } + as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 + ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +: ${lt_DD:=$DD} +if test -z "$lt_DD"; then + ac_path_lt_DD_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_lt_DD" || continue +if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: +fi + $ac_path_lt_DD_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_lt_DD"; then + : + fi +else + ac_cv_path_lt_DD=$lt_DD +fi + +rm -f conftest.i conftest2.i conftest.out +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop + printf 0123456789abcdef0123456789abcdef >conftest.i +cat conftest.i conftest.i >conftest2.i +lt_cv_truncate_bin= +if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then + cmp -s conftest.i conftest.out \ + && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" +fi +rm -f conftest.i conftest2.i conftest.out +test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } + + + + + + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + +# Check whether --enable-libtool-lock was given. +if test ${enable_libtool_lock+y} +then : + enableval=$enable_libtool_lock; +fi + +test no = "$enable_libtool_lock" || enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out what ABI is being produced by ac_compile, and set mode + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE=32 + ;; + *ELF-64*) + HPUX_IA64_MODE=64 + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test yes = "$lt_cv_prog_gnu_ld"; then + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +mips64*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + emul=elf + case `$FILECMD conftest.$ac_objext` in + *32-bit*) + emul="${emul}32" + ;; + *64-bit*) + emul="${emul}64" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *MSB*) + emul="${emul}btsmip" + ;; + *LSB*) + emul="${emul}ltsmip" + ;; + esac + case `$FILECMD conftest.$ac_objext` in + *N32*) + emul="${emul}n32" + ;; + esac + LD="${LD-ld} -m $emul" + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. Note that the listed cases only cover the + # situations where additional linker options are needed (such as when + # doing 32-bit compilation for a host where ld defaults to 64-bit, or + # vice versa); the common cases where no linker options are needed do + # not appear in the list. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + case `$FILECMD conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; + powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + powerpcle-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -belf" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_cc_needs_belf=yes +else $as_nop + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } + if test yes != "$lt_cv_cc_needs_belf"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS=$SAVE_CFLAGS + fi + ;; +*-*solaris*) + # Find out what ABI is being produced by ac_compile, and set linker + # options accordingly. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `$FILECMD conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) + case $host in + i?86-*-solaris*|x86_64-*-solaris*) + LD="${LD-ld} -m elf_x86_64" + ;; + sparc*-*-solaris*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + # GNU ld 2.21 introduced _sol2 emulations. Use them if available. + if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then + LD=${LD-ld}_sol2 + fi + ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; +esac + +need_locks=$enable_libtool_lock + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. +set dummy ${ac_tool_prefix}mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$MANIFEST_TOOL"; then + ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL +if test -n "$MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MANIFEST_TOOL"; then + ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL + # Extract the first word of "mt", so it can be a program name with args. +set dummy mt; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_MANIFEST_TOOL"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL +if test -n "$ac_ct_MANIFEST_TOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_MANIFEST_TOOL" = x; then + MANIFEST_TOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL + fi +else + MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" +fi + +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_path_mainfest_tool=no + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out + cat conftest.err >&5 + if $GREP 'Manifest Tool' conftest.out > /dev/null; then + lt_cv_path_mainfest_tool=yes + fi + rm -f conftest* +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } +if test yes != "$lt_cv_path_mainfest_tool"; then + MANIFEST_TOOL=: +fi + + + + + + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$LIPO"; then + ac_cv_prog_LIPO="$LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LIPO="${ac_tool_prefix}lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_LIPO"; then + ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LIPO="lipo" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OTOOL"; then + ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL="${ac_tool_prefix}otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OTOOL"; then + ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL="otool" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$OTOOL64"; then + ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_OTOOL64"; then + ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OTOOL64="otool64" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_apple_cc_single_mod=no + if test -z "$LT_MULTI_MODULE"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + # If there is a non-empty error log, and "single_module" + # appears in it, assume the flag caused a linker warning + if test -s conftest.err && $GREP single_module conftest.err; then + cat conftest.err >&5 + # Otherwise, if the output was created with a 0 exit code from + # the compiler, it worked. + elif test -f libconftest.dylib && test 0 = "$_lt_result"; then + lt_cv_apple_cc_single_mod=yes + else + cat conftest.err >&5 + fi + rm -rf libconftest.dylib* + rm -f conftest.* + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_ld_exported_symbols_list=yes +else $as_nop + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -s conftest.err && $GREP force_load conftest.err; then + cat conftest.err >&5 + elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test yes = "$lt_cv_apple_cc_single_mod"; then + _lt_dar_single_mod='$single_module' + fi + if test yes = "$lt_cv_ld_exported_symbols_list"; then + _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' + fi + if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + + + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h + +fi + + + + + +# Set options + + + + enable_dlopen=no + + + enable_win32_dll=no + + + # Check whether --enable-shared was given. +if test ${enable_shared+y} +then : + enableval=$enable_shared; p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_shared=yes +fi + + + + + + + + + + # Check whether --enable-static was given. +if test ${enable_static+y} +then : + enableval=$enable_static; p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_static=yes +fi + + + + + + + + + + +# Check whether --with-pic was given. +if test ${with_pic+y} +then : + withval=$with_pic; lt_p=${PACKAGE-default} + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + pic_mode=default +fi + + + + + + + + + # Check whether --enable-fast-install was given. +if test ${enable_fast_install+y} +then : + enableval=$enable_fast_install; p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + enable_fast_install=yes +fi + + + + + + + + + shared_archive_member_spec= +case $host,$enable_shared in +power*-*-aix[5-9]*,yes) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + +# Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +then : + withval=$with_aix_soname; case $withval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_with_aix_soname=aix +fi + + with_aix_soname=$lt_cv_with_aix_soname +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } + if test aix != "$with_aix_soname"; then + # For the AIX way of multilib, we name the shared archive member + # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', + # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. + # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, + # the AIX toolchain works better with OBJECT_MODE set (default 32). + if test 64 = "${OBJECT_MODE-32}"; then + shared_archive_member_spec=shr_64 + else + shared_archive_member_spec=shr + fi + fi + ;; +*) + with_aix_soname=aix + ;; +esac + + + + + + + + + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS=$ltmain + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +test -z "$LN_S" && LN_S="ln -s" + + + + + + + + + + + + + + +if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop + rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). +libext=a + +with_gnu_ld=$lt_cv_prog_gnu_ld + +old_CC=$CC +old_CFLAGS=$CFLAGS + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +func_cc_basename $compiler +cc_basename=$func_cc_basename_result + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/${ac_tool_prefix}file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD=$MAGIC_CMD + lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS=$lt_save_ifs + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/file"; then + lt_cv_path_MAGIC_CMD=$ac_dir/"file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD=$lt_cv_path_MAGIC_CMD + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS=$lt_save_ifs + MAGIC_CMD=$lt_save_MAGIC_CMD + ;; +esac +fi + +MAGIC_CMD=$lt_cv_path_MAGIC_CMD +if test -n "$MAGIC_CMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC=$CC +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test yes = "$GCC"; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + + + if test yes = "$GCC"; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + lt_prog_compiler_pic='-fPIC' + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the '-m68020' flag to GCC prevents building anything better, + # like '-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + if test -n "$lt_prog_compiler_pic"; then + lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" + fi + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test ia64 = "$host_cpu"; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + case $cc_basename in + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + case $host_os in + os2*) + lt_prog_compiler_static='$wl-static' + ;; + esac + ;; + + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static='$wl-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + case $cc_basename in + # old Intel for x86_64, which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # flang / f18. f95 an alias for gfortran or flang on Debian + flang* | f18* | f95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + nagfor*) + # NAG Fortran compiler + lt_prog_compiler_wl='-Wl,-Wl,,' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ F* | *Sun*Fortran*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Qoption ld ' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Intel*\ [CF]*Compiler*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + *Portland\ Group*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + esac + ;; + esac + ;; + + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms that do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic=$lt_prog_compiler_pic +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } +lt_prog_compiler_pic=$lt_cv_prog_compiler_pic + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_pic_works"; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_static_works=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } + +if test yes = "$lt_cv_prog_compiler_static_works"; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler_c_o=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links=nottested +if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then + # do not overwrite the value of need_locks provided by the user + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } + if test no = "$hard_links"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_separator= + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + inherit_rpath=no + link_all_deplibs=unknown + module_cmds= + module_expsym_cmds= + old_archive_from_new_cmds= + old_archive_from_expsyms_cmds= + thread_safe_flag_spec= + whole_archive_flag_spec= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ' (' and ')$', so one must not match beginning or + # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', + # as well as any symbol that contains 'd'. + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + if test yes != "$GCC"; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) + with_gnu_ld=yes + ;; + openbsd* | bitrig*) + with_gnu_ld=no + ;; + linux* | k*bsd*-gnu | gnu*) + link_all_deplibs=no + ;; + esac + + ld_shlibs=yes + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test yes = "$with_gnu_ld"; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test yes = "$lt_use_gnu_ld_interface"; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='$wl' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='$wl--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test ia64 != "$host_cpu"; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='$wl--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file, use it as + # is; otherwise, prepend EXPORTS... + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + file_list_spec='@' + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test linux-dietlibc = "$host_os"; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test no = "$tmp_diet" + then + tmp_addflag=' $pic_flag' + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + nagfor*) # NAGFOR 5.3 + tmp_sharedflag='-Wl,-shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | $SED 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + tcc*) + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + export_dynamic_flag_spec='-rdynamic' + ;; + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test yes = "$supports_anon_versioning"; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test no = "$ld_shlibs"; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix[4-9]*) + if test ia64 = "$host_cpu"; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag= + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to GNU nm, but means don't demangle to AIX nm. + # Without the "-l" option, or with the "-B" option, AIX nm treats + # weak defined symbols like other global defined symbols, whereas + # GNU nm marks them as "W". + # While the 'weak' keyword is ignored in the Export File, we need + # it in the Import File for the 'aix-soname' feature, so we have + # to replace the "-B" option with "-P" for AIX nm. + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # have runtime linking enabled, and use it for executables. + # For shared libraries, we enable/disable runtime linking + # depending on the kind of the shared library created - + # when "with_aix_soname,aix_use_runtimelinking" is: + # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables + # "aix,yes" lib.so shared, rtl:yes, for executables + # lib.a static archive + # "both,no" lib.so.V(shr.o) shared, rtl:yes + # lib.a(lib.so.V) shared, rtl:no, for executables + # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a(lib.so.V) shared, rtl:no + # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables + # lib.a static archive + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then + aix_use_runtimelinking=yes + break + fi + done + if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then + # With aix-soname=svr4, we create the lib.so.V shared archives only, + # so we don't have lib.a shared libs to link our executables. + # We have to force runtime linking in this case. + aix_use_runtimelinking=yes + LDFLAGS="$LDFLAGS -Wl,-brtl" + fi + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='$wl-f,' + case $with_aix_soname,$aix_use_runtimelinking in + aix,*) ;; # traditional, no import file + svr4,* | *,yes) # use import file + # The Import File defines what to hardcode. + hardcode_direct=no + hardcode_direct_absolute=no + ;; + esac + + if test yes = "$GCC"; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`$CC -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test yes = "$aix_use_runtimelinking"; then + shared_flag="$shared_flag "'$wl-G' + fi + # Need to ensure runtime linking is disabled for the traditional + # shared library, or the linker may eventually find shared libraries + # /with/ Import File - we do not want to mix them. + shared_flag_aix='-shared' + shared_flag_svr4='-shared $wl-G' + else + # not using gcc + if test ia64 = "$host_cpu"; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test yes = "$aix_use_runtimelinking"; then + shared_flag='$wl-G' + else + shared_flag='$wl-bM:SRE' + fi + shared_flag_aix='$wl-bM:SRE' + shared_flag_svr4='$wl-G' + fi + fi + + export_dynamic_flag_spec='$wl-bexpall' + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag + else + if test ia64 = "$host_cpu"; then + hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + if test set = "${lt_cv_aix_libpath+set}"; then + aix_libpath=$lt_cv_aix_libpath +else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + + lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\([^ ]*\) *$/\1/ + p + } + }' + lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + # Check for a 64-bit object if we didn't find anything. + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if test -z "$lt_cv_aix_libpath_"; then + lt_cv_aix_libpath_=/usr/lib:/lib + fi + +fi + + aix_libpath=$lt_cv_aix_libpath_ +fi + + hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' $wl-bernotok' + allow_undefined_flag=' $wl-berok' + if test yes = "$with_gnu_ld"; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' + # -brtl affects multiple linker settings, -berok does not and is overridden later + compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' + if test svr4 != "$with_aix_soname"; then + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' + fi + if test aix != "$with_aix_soname"; then + archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' + else + # used by -dlpreopen to get the symbols + archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' + fi + archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++ or Intel C++ Compiler. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + case $cc_basename in + cl* | icl*) + # Native MSVC or ICC + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + always_export_symbols=yes + file_list_spec='@' + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then + cp "$export_symbols" "$output_objdir/$soname.def"; + echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; + else + $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; + fi~ + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + linknames=' + # The linker will not automatically build a static lib if we build a DLL. + # _LT_TAGVAR(old_archive_from_new_cmds, )='true' + enable_shared_with_static_runtimes=yes + exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + # Don't use ranlib + old_postinstall_cmds='chmod 644 $oldlib' + postlink_cmds='lt_outputfile="@OUTPUT@"~ + lt_tool_outputfile="@TOOL_OUTPUT@"~ + case $lt_outputfile in + *.exe|*.EXE) ;; + *) + lt_outputfile=$lt_outputfile.exe + lt_tool_outputfile=$lt_tool_outputfile.exe + ;; + esac~ + if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; + $RM "$lt_outputfile.manifest"; + fi' + ;; + *) + # Assume MSVC and ICC wrapper + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=.dll + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + enable_shared_with_static_runtimes=yes + ;; + esac + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + if test yes = "$lt_cv_ld_force_load"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag=$_lt_dar_allow_undefined + case $cc_basename in + ifort*|nagfor*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test yes = "$_lt_dar_can_shared"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2.*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly* | midnightbsd*) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test yes = "$GCC"; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='$wl-E' + ;; + + hpux10*) + if test yes,no = "$GCC,$with_gnu_ld"; then + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + + hpux11*) + if test yes,no = "$GCC,$with_gnu_ld"; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_prog_compiler__b=no + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS=$save_LDFLAGS + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } + +if test yes = "$lt_cv_prog_compiler__b"; then + archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test no = "$with_gnu_ld"; then + hardcode_libdir_flag_spec='$wl+b $wl$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='$wl-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test yes = "$GCC"; then + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + # This should be the same for all languages, so no per-tag cache variable. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo (void) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_irix_exported_symbol=yes +else $as_nop + lt_cv_irix_exported_symbol=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } + if test yes = "$lt_cv_irix_exported_symbol"; then + archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' + fi + link_all_deplibs=no + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + linux*) + case $cc_basename in + tcc*) + # Fabrice Bellard et al's Tiny C Compiler + ld_shlibs=yes + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + ;; + esac + ;; + + netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd* | bitrig*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + export_dynamic_flag_spec='$wl-E' + else + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='$wl-rpath,$libdir' + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + shrext_cmds=.dll + archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ + $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ + $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ + $ECHO EXPORTS >> $output_objdir/$libname.def~ + prefix_cmds="$SED"~ + if test EXPORTS = "`$SED 1q $export_symbols`"; then + prefix_cmds="$prefix_cmds -e 1d"; + fi~ + prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ + cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ + $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ + emximp -o $lib $output_objdir/$libname.def' + old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + enable_shared_with_static_runtimes=yes + file_list_spec='@' + ;; + + osf3*) + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test yes = "$GCC"; then + allow_undefined_flag=' $wl-expect_unresolved $wl\*' + archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test yes = "$GCC"; then + wlarc='$wl' + archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + else + case `$CC -V 2>&1` in + *"Compilers 5.0"*) + wlarc='' + archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' + ;; + *) + wlarc='$wl' + archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' + ;; + esac + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands '-z linker_flag'. GCC discards it without '$wl', + # but is careful enough not to reorder. + # Supported since Solaris 2.6 (maybe 2.5.1?) + if test yes = "$GCC"; then + whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; + esac + link_all_deplibs=yes + ;; + + sunos4*) + if test sequent = "$host_vendor"; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + case $host_vendor in + sni) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds='$CC -r -o $output$reload_objs' + hardcode_direct=no + ;; + motorola) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag='$wl-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We CANNOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='$wl-z,text' + allow_undefined_flag='$wl-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='$wl-R,$libdir' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='$wl-Bexport' + runpath_var='LD_RUN_PATH' + + if test yes = "$GCC"; then + archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac + + if test sni = "$host_vendor"; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + export_dynamic_flag_spec='$wl-Blargedynsym' + ;; + esac + fi + fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } +test no = "$ld_shlibs" && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test yes,yes = "$GCC,$enable_shared"; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } + +if test yes = "$GCC"; then + case $host_os in + darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; + *) lt_awk_arg='/^libraries:/' ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + *) lt_sed_strip_eq='s|=/|/|g' ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary... + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + # ...but if some path component already ends with the multilib dir we assume + # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). + case "$lt_multi_os_dir; $lt_search_path_spec " in + "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) + lt_multi_os_dir= + ;; + esac + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" + elif test -n "$lt_multi_os_dir"; then + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS = " "; FS = "/|\n";} { + lt_foo = ""; + lt_count = 0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo = "/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's|/\([A-Za-z]:\)|\1|g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=.so +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + + + +case $host_os in +aix3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='$libname$release$shared_ext$major' + ;; + +aix[4-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test ia64 = "$host_cpu"; then + # AIX 5 supports IA64 + library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line '#! .'. This would cause the generated library to + # depend on '.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # Using Import Files as archive members, it is possible to support + # filename-based versioning of shared library archives on AIX. While + # this would work for both with and without runtime linking, it will + # prevent static linking of such archives. So we do filename-based + # shared library versioning with .so extension only, which is used + # when both runtime linking and shared linking is enabled. + # Unfortunately, runtime linking may impact performance, so we do + # not want this to be the default eventually. Also, we use the + # versioned .so libs for executables only if there is the -brtl + # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # To allow for filename-based versioning support, we need to create + # libNAME.so.V as an archive file, containing: + # *) an Import File, referring to the versioned filename of the + # archive as well as the shared archive member, telling the + # bitwidth (32 or 64) of that shared object, and providing the + # list of exported symbols of that shared object, eventually + # decorated with the 'weak' keyword + # *) the shared object with the F_LOADONLY flag set, to really avoid + # it being seen by the linker. + # At run time we better use the real file rather than another symlink, + # but for link time we create the symlink libNAME.so -> libNAME.so.V + + case $with_aix_soname,$aix_use_runtimelinking in + # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + aix,yes) # traditional libtool + dynamic_linker='AIX unversionable lib.so' + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + aix,no) # traditional AIX only + dynamic_linker='AIX lib.a(lib.so.V)' + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + ;; + svr4,*) # full svr4 only + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,yes) # both, prefer svr4 + dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" + library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' + # unpreferred sharedlib libNAME.a needs extra handling + postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' + postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' + # We do not specify a path in Import Files, so LIBPATH fires. + shlibpath_overrides_runpath=yes + ;; + *,no) # both, prefer aix + dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" + library_names_spec='$libname$release.a $libname.a' + soname_spec='$libname$release$shared_ext$major' + # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling + postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' + postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' + ;; + esac + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='$libname$shared_ext' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32* | cegcc*) + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + + case $GCC,$cc_basename in + yes,*) + # gcc + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + ;; + esac + dynamic_linker='Win32 ld.exe' + ;; + + *,cl* | *,icl*) + # Native MSVC or ICC + libname_spec='$name' + soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='$libname.dll.lib' + + case $build_os in + mingw*) + sys_lib_search_path_spec= + lt_save_ifs=$IFS + IFS=';' + for lt_path in $LIB + do + IFS=$lt_save_ifs + # Let DOS variable expansion print the short 8.3 style file name. + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" + done + IFS=$lt_save_ifs + # Convert to MSYS style. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + ;; + cygwin*) + # Convert to unix form, then to dos form, then back to unix form + # but this time dos style (no spaces!) so that the unix form looks + # like /cygdrive/c/PROGRA~1:/cygdr... + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ;; + *) + sys_lib_search_path_spec=$LIB + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # FIXME: find the short name or the path components, as spaces are + # common. (e.g. "Program Files" -> "PROGRA~1") + ;; + esac + + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + shlibpath_overrides_runpath=yes + dynamic_linker='Win32 link.exe' + ;; + + *) + # Assume MSVC and ICC wrapper + library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' + dynamic_linker='Win32 ld.exe' + ;; + esac + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' + soname_spec='$libname$release$major$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd* | dragonfly* | midnightbsd*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[23].*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2.*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +haiku*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=no + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + if test 32 = "$HPUX_IA64_MODE"; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + sys_lib_dlsearch_path_spec=/usr/lib/hpux32 + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + sys_lib_dlsearch_path_spec=/usr/lib/hpux64 + fi + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test yes = "$lt_cv_prog_gnu_ld"; then + version_type=linux # correct to gnu/linux during the next big refactor + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" + sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +linux*android*) + version_type=none # Android doesn't support versioned libraries. + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext' + soname_spec='$libname$release$shared_ext' + finish_cmds= + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + dynamic_linker='Android linker' + # Don't embed -rpath directories since the linker doesn't support them. + hardcode_libdir_flag_spec='-L$libdir' + ;; + +# This must be glibc/ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + + # Some binutils ld are patched to set DT_RUNPATH + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command + # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, + # even though it is searched at run-time. Try to do the best guess by + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=qnx + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' + ;; + +openbsd* | bitrig*) + version_type=sunos + sys_lib_dlsearch_path_spec=/usr/lib + need_lib_prefix=no + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then + need_version=no + else + need_version=yes + fi + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +os2*) + libname_spec='$name' + version_type=windows + shrext_cmds=.dll + need_version=no + need_lib_prefix=no + # OS/2 can only load a DLL with a base name of 8 characters or less. + soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; + v=$($ECHO $release$versuffix | tr -d .-); + n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); + $ECHO $n$v`$shared_ext' + library_names_spec='${libname}_dll.$libext' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=BEGINLIBPATH + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; + fi' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $RM \$dlpath' + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='$libname$release$shared_ext$major' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + +rdos*) + dynamic_linker=no + ;; + +solaris*) + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test yes = "$with_gnu_ld"; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec; then + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' + soname_spec='$libname$shared_ext.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=sco + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + if test yes = "$with_gnu_ld"; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux # correct to gnu/linux during the next big refactor + need_lib_prefix=no + need_version=no + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +uts4*) + version_type=linux # correct to gnu/linux during the next big refactor + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' + soname_spec='$libname$release$shared_ext$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } +test no = "$dynamic_linker" && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test yes = "$GCC"; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then + sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec +fi + +if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then + sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec +fi + +# remember unaugmented sys_lib_dlsearch_path content for libtool script decls... +configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec + +# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code +func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" + +# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool +configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test yes = "$hardcode_automatic"; then + + # We can hardcode non-existent directories. + if test no != "$hardcode_direct" && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && + test no != "$hardcode_minus_L"; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } + +if test relink = "$hardcode_action" || + test yes = "$inherit_rpath"; then + # Fast installation is not supported + enable_fast_install=no +elif test yes = "$shlibpath_overrides_runpath" || + test no = "$enable_shared"; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test yes != "$enable_dlopen"; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen=load_add_on + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen=LoadLibrary + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + + lt_cv_dlopen=dyld + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + +fi + + ;; + + tpf*) + # Don't try to run any link tests for TPF. We know it's impossible + # because TPF is a cross-compiler, and we know how we open DSOs. + lt_cv_dlopen=dlopen + lt_cv_dlopen_libs= + lt_cv_dlopen_self=no + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = xyes +then : + lt_cv_dlopen=shl_load +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char shl_load (); +int +main (void) +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_shl_load=yes +else $as_nop + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : + lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld +else $as_nop + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = xyes +then : + lt_cv_dlopen=dlopen +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dl_dlopen=yes +else $as_nop + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dlopen (); +int +main (void) +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_svld_dlopen=yes +else $as_nop + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : + lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char dld_link (); +int +main (void) +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_dld_dld_link=yes +else $as_nop + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : + lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld +fi + + +fi + + +fi + + +fi + + +fi + + +fi + + ;; + esac + + if test no = "$lt_cv_dlopen"; then + enable_dlopen=no + else + enable_dlopen=yes + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS=$CPPFLAGS + test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS=$LDFLAGS + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS=$LIBS + LIBS="$lt_cv_dlopen_libs $LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } + + if test yes = "$lt_cv_dlopen_self"; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test yes = "$cross_compiling"; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisibility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +int fnord () __attribute__((visibility("default"))); +#endif + +int fnord () { return 42; } +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else + { + if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS=$save_CPPFLAGS + LDFLAGS=$save_LDFLAGS + LIBS=$save_LIBS + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi +fi + + + + + + + + + + + + + # Report what library types will actually be built + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } + test no = "$can_build_shared" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test yes = "$enable_shared" && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test ia64 != "$host_cpu"; then + case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in + yes,aix,yes) ;; # shared object as lib.so file only + yes,svr4,*) ;; # shared object as lib.so archive member only + yes,*) enable_static=no ;; # shared object in lib.a archive as well + esac + fi + ;; + esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test yes = "$enable_shared" || enable_static=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC + + + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + SET_MAKE= +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +FLEX_MIN_VERSION=2.5.19 +FLEX_REC_VERSION=2.5.36 + +# Do not want AM_PROG_LEX which adds 'missing' to LEX if it's not around +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LEX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 +printf "%s\n" "$LEX" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + + if test "x$LEX" != "x:"; then + cat >conftest.l <<_ACEOF +%{ +#ifdef __cplusplus +extern "C" +#endif +int yywrap(void); +%} +%% +a { ECHO; } +b { REJECT; } +c { yymore (); } +d { yyless (1); } +e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ +#ifdef __cplusplus + yyless ((yyinput () != 0)); +#else + yyless ((input () != 0)); +#endif + } +f { unput (yytext[0]); } +. { BEGIN INITIAL; } +%% +#ifdef YYTEXT_POINTER +extern char *yytext; +#endif +int +yywrap (void) +{ + return 1; +} +int +main (void) +{ + return ! yylex (); +} +_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex output file root" >&5 +printf %s "checking for lex output file root... " >&6; } +if test ${ac_cv_prog_lex_root+y} +then : + printf %s "(cached) " >&6 +else $as_nop + +ac_cv_prog_lex_root=unknown +{ { ac_try="$LEX conftest.l" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$LEX conftest.l") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 +printf "%s\n" "$ac_cv_prog_lex_root" >&6; } +if test "$ac_cv_prog_lex_root" = unknown +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot find output from $LEX; giving up on $LEX" >&5 +printf "%s\n" "$as_me: WARNING: cannot find output from $LEX; giving up on $LEX" >&2;} + LEX=: LEXLIB= +fi +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +if test ${LEXLIB+y} +then : + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for lex library" >&5 +printf %s "checking for lex library... " >&6; } +if test ${ac_cv_lib_lex+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ac_save_LIBS="$LIBS" + ac_found=false + for ac_cv_lib_lex in 'none needed' -lfl -ll 'not found'; do + case $ac_cv_lib_lex in #( + 'none needed') : + ;; #( + 'not found') : + break ;; #( + *) : + LIBS="$ac_cv_lib_lex $ac_save_LIBS" ;; #( + *) : + ;; +esac + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_found=: +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + if $ac_found; then + break + fi + done + LIBS="$ac_save_LIBS" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 +printf "%s\n" "$ac_cv_lib_lex" >&6; } + if test "$ac_cv_lib_lex" = 'not found' +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: required lex library not found; giving up on $LEX" >&5 +printf "%s\n" "$as_me: WARNING: required lex library not found; giving up on $LEX" >&2;} + LEX=: LEXLIB= +elif test "$ac_cv_lib_lex" = 'none needed' +then : + LEXLIB='' +else $as_nop + LEXLIB=$ac_cv_lib_lex +fi + +fi + + +if test "$LEX" != : +then : + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 +printf %s "checking whether yytext is a pointer... " >&6; } +if test ${ac_cv_prog_lex_yytext_pointer+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define YYTEXT_POINTER 1 +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_lex_yytext_pointer=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 +printf "%s\n" "$ac_cv_prog_lex_yytext_pointer" >&6; } +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +printf "%s\n" "#define YYTEXT_POINTER 1" >>confdefs.h + +fi + +fi +rm -f conftest.l $LEX_OUTPUT_ROOT.c + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking flex" >&5 +printf %s "checking flex... " >&6; } +if test "$USE_MAINTAINER_MODE" = yes; then + # maintainer mode - flex is required + if test "X$LEX" = "X:" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not present" >&5 +printf "%s\n" "not present" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Please get flex from https://github.com/westes/flex" >&5 +printf "%s\n" "$as_me: WARNING: Please get flex from https://github.com/westes/flex" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)" >&5 +printf "%s\n" "$as_me: WARNING: version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "flex not present +See \`config.log' for more details" "$LINENO" 5; } + fi + + # some kind of lexer is present + if echo "$LEX" | grep flex >/dev/null 2>&1; then + # flex is present + FLEX_VERSION=`$LEX -V 2>&1 | $AWK '{print $2}'` + FLEX_VERSION_DEC=`echo $FLEX_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + + FLEX_MIN_VERSION_DEC=`echo $FLEX_MIN_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + + if test $FLEX_VERSION_DEC -ge $FLEX_MIN_VERSION_DEC; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FLEX_VERSION - OK" >&5 +printf "%s\n" "$FLEX_VERSION - OK" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: version $FLEX_VERSION - too old" >&5 +printf "%s\n" "version $FLEX_VERSION - too old" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Please get flex from https://github.com/westes/flex" >&5 +printf "%s\n" "$as_me: WARNING: Please get flex from https://github.com/westes/flex" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)" >&5 +printf "%s\n" "$as_me: WARNING: version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "flex is too old +See \`config.log' for more details" "$LINENO" 5; } + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: present - but is not flex" >&5 +printf "%s\n" "present - but is not flex" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Please get flex from https://github.com/westes/flex" >&5 +printf "%s\n" "$as_me: WARNING: Please get flex from https://github.com/westes/flex" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)" >&5 +printf "%s\n" "$as_me: WARNING: version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "$LEX is not not flex +See \`config.log' for more details" "$LINENO" 5; } + fi +else + # not maintainer mode; flex is not required + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not present - not required for non maintainer builds" >&5 +printf "%s\n" "not present - not required for non maintainer builds" >&6; } + LEX="$SHELL $missing_dir/missing flex" + LEX_OUTPUT_ROOT=lex.yy + + LEXLIB='' + + FLEX_VERSION_DEC=00000 +fi + +printf "%s\n" "#define FLEX_VERSION_DECIMAL $FLEX_VERSION_DEC" >>confdefs.h + + + +BISON_MIN_VERSION=3.4.0 +BISON_REC_VERSION=3.7.2 +BISON_MIN_VERSION_DEC=`echo $BISON_MIN_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + +if test "$USE_MAINTAINER_MODE" = yes; then + # Match these styles of versions + # GNU Bison version 1.28 + # bison (GNU Bison) 1.875 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU bison newer than $BISON_MIN_VERSION" >&5 +printf %s "checking for GNU bison newer than $BISON_MIN_VERSION... " >&6; } +if test ${ac_cv_path_BISON+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$BISON"; then + ac_path_BISON_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in bison3 bison + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_BISON="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_BISON" || continue +bison_version=`$ac_path_BISON --version 2>&1 | sed -ne 's/^.*GNU Bison[^0-9]*//p'` + bison_version_dec=`echo $bison_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + test "$bison_version_dec" -ge $BISON_MIN_VERSION_DEC \ + && ac_cv_path_BISON=$ac_path_BISON ac_cv_version_BISON=$bison_version ac_cv_version_dec_BISON=$bison_version_dec + $ac_path_BISON_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_BISON"; then + as_fn_error $? "could not find new enough GNU Bison" "$LINENO" 5 + fi +else + ac_cv_path_BISON=$BISON +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_BISON" >&5 +printf "%s\n" "$ac_cv_path_BISON" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Using GNU Bison $ac_cv_version_BISON ($ac_cv_version_dec_BISON) at $ac_cv_path_BISON" >&5 +printf "%s\n" "$as_me: Using GNU Bison $ac_cv_version_BISON ($ac_cv_version_dec_BISON) at $ac_cv_path_BISON" >&6;} +else + # not maintainer mode, do not need bison + ac_cv_path_BISON=: +fi +BISON=$ac_cv_path_BISON + + +# Find a tar command for 'make dist' +for ac_prog in gnutar gtar tar +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_TAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$TAR"; then + ac_cv_prog_TAR="$TAR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_TAR="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +TAR=$ac_cv_prog_TAR +if test -n "$TAR"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $TAR" >&5 +printf "%s\n" "$TAR" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$TAR" && break +done + +for ac_prog in perl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PERL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PERL="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +printf "%s\n" "$PERL" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$PERL" && break +done + +# Used in tests/feeds +for ac_prog in jing +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_JING+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$JING"; then + ac_cv_prog_JING="$JING" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_JING="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +JING=$ac_cv_prog_JING +if test -n "$JING"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $JING" >&5 +printf "%s\n" "$JING" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$JING" && break +done + + + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +for ac_prog in echo +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RECHO+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RECHO"; then + ac_cv_prog_RECHO="$RECHO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RECHO="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RECHO=$ac_cv_prog_RECHO +if test -n "$RECHO"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RECHO" >&5 +printf "%s\n" "$RECHO" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$RECHO" && break +done + +RECHO_C= +RECHO_N= +case `$RECHO -n x` in + -n*) + case `$RECHO 'xy\c'` in + *c*) + ;; + xy) + RECHO_C='\c' + ;; + esac;; + *) + RECHO_N='-n' + ;; +esac + + + + + + +# GCC warning options +# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html +# +# Too noisy: +# -Wmissing-field-initializers : too noisy in raptor_rss_common.c +# -Wsystem-headers : not debugging system +# -Wunused-parameter : variables can be marked __attribute__('unused') +possible_warnings="\ +-std=c11 \ +-Wall \ +-Wc++-compat \ +-Wextra \ +-Wpedantic \ +-Wunused \ +\ +-Waggregate-return \ +-Wbad-function-cast \ +-Wcast-align \ +-Wdeclaration-after-statement \ +-Wdisabled-optimization \ +-Wdiv-by-zero \ +-Wendif-labels \ +-Werror-implicit-function-declaration \ +-Wfloat-equal \ +-Wformat=2 \ +-Wframe-larger-than=4096 \ +-Winit-self \ +-Winline \ +-Wmissing-declarations \ +-Wmissing-format-attribute \ +-Wmissing-noreturn \ +-Wmissing-prototypes \ +-Wnested-externs \ +-Wold-style-definition \ +-Wpacked \ +-Wpointer-arith \ +-Wredundant-decls \ +-Wshadow \ +-Wsign-compare \ +-Wstrict-overflow \ +-Wstrict-prototypes \ +-Wswitch-enum \ +-Wunreachable-code \ +-Wunsafe-loop-optimizations \ +-Wwrite-strings \ +\ +-Wno-missing-field-initializers \ +-Wno-system-headers \ +-Wno-unused-parameter \ +-Wswitch-bool \ +-Wlogical-not-parentheses \ +-Wsizeof-array-argument \ +-Wbool-compare \ +-Wc90-c99-compat \ +-Wc99-c11-compat \ +" + +extra_compiler_cflags="" + +# compiler specific warnings +if test $CC_IS_CLANG = yes; then + # Always enable this for Clang + # -Wno-nullability-completeness : too noisy on OSX reporting + # warnings in stdio.h + extra_compiler_cflags="$extra_compiler_cflags \ +-Wno-nullability-completeness \ +" +fi + +# OS specific warnings +case "${host_os}" in + darwin*) + # Apple gcc/clang specific: + # -Wshorten-64-to-32 + possible_warnings="$possible_warnings \ +-Wshorten-64-to-32 \ +" + ;; + *) + # -Wundef : too noisy on OSX 10.12+ e.g. stdio.h fails + possible_warnings="$possible_warnings \ +-Wundef \ +" + ;; +esac + +warning_cflags= +if test "$USE_MAINTAINER_MODE" = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for supported $CC warning flags" >&5 +printf %s "checking for supported $CC warning flags... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $warning_cflags" >&5 +printf "%s\n" "$warning_cflags" >&6; } + for warning in $possible_warnings; do + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $warning" >&5 +printf %s "checking whether $CC supports $warning... " >&6; } + + ## backup CFLAGS and werror status + redland_save_CFLAGS="$CFLAGS" + redland_save_ac_c_werror_flag="${ac_c_werror_flag}" + +ac_c_werror_flag=yes + + CFLAGS="$CFLAGS $warning" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + redland_cc_flag=yes +else $as_nop + redland_cc_flag=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + ## restore CFLAGS and werror status + CFLAGS="$redland_save_CFLAGS" + ac_c_werror_flag="${redland_save_ac_c_werror_flag}" + + if test "X$redland_cc_flag" = "Xyes"; then + warning_cflags="$warning_cflags $warning" + else + : + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $redland_cc_flag" >&5 +printf "%s\n" "$redland_cc_flag" >&6; } + + done + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking $CC supports warning flags" >&5 +printf %s "checking $CC supports warning flags... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $warning_cflags" >&5 +printf "%s\n" "$warning_cflags" >&6; } +fi + +if test "$USE_MAINTAINER_MODE" = yes; then + +printf "%s\n" "#define MAINTAINER_MODE 1" >>confdefs.h + + CPPFLAGS="$warning_cflags $CPPFLAGS" +fi +# Extra compiler flags to always add +CPPFLAGS="$extra_compiler_cflags $CPPFLAGS" + + +ac_fn_c_check_header_compile "$LINENO" "errno.h" "ac_cv_header_errno_h" "$ac_includes_default" +if test "x$ac_cv_header_errno_h" = xyes +then : + printf "%s\n" "#define HAVE_ERRNO_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default" +if test "x$ac_cv_header_getopt_h" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" +if test "x$ac_cv_header_limits_h" = xyes +then : + printf "%s\n" "#define HAVE_LIMITS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "setjmp.h" "ac_cv_header_setjmp_h" "$ac_includes_default" +if test "x$ac_cv_header_setjmp_h" = xyes +then : + printf "%s\n" "#define HAVE_SETJMP_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" +if test "x$ac_cv_header_stddef_h" = xyes +then : + printf "%s\n" "#define HAVE_STDDEF_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" +if test "x$ac_cv_header_stdlib_h" = xyes +then : + printf "%s\n" "#define HAVE_STDLIB_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" +if test "x$ac_cv_header_strings_h" = xyes +then : + printf "%s\n" "#define HAVE_STRINGS_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" +if test "x$ac_cv_header_string_h" = xyes +then : + printf "%s\n" "#define HAVE_STRING_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_param_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_stat_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_STAT_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_time_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "time.h" "ac_cv_header_time_h" "$ac_includes_default" +if test "x$ac_cv_header_time_h" = xyes +then : + printf "%s\n" "#define HAVE_TIME_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h + +fi + +ac_fn_c_check_func "$LINENO" "stat" "ac_cv_func_stat" +if test "x$ac_cv_func_stat" = xyes +then : + printf "%s\n" "#define HAVE_STAT 1" >>confdefs.h + +fi + +ac_fn_c_check_header_compile "$LINENO" "fetch.h" "ac_cv_header_fetch_h" "#include +#ifdef HAVE_SYS_PARAM_H +#include +#endif + +" +if test "x$ac_cv_header_fetch_h" = xyes +then : + printf "%s\n" "#define HAVE_FETCH_H 1" >>confdefs.h + +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else $as_nop + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +printf "%s\n" "#define const /**/" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + +int +main (void) +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +int +main (void) +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_bigendian=yes +else $as_nop + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes +then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +unsigned short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + unsigned short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + unsigned short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + unsigned short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main (void) +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else $as_nop + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __FUNCTION__ is available" >&5 +printf %s "checking whether __FUNCTION__ is available... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int main(void) { printf(__FUNCTION__); } +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +printf "%s\n" "#define HAVE___FUNCTION__ 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + +version_major=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\1/'` +version_minor=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\2/'` +version_release=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\3/'` + +version_decimal=`expr $version_major \* 10000 + $version_minor \* 100 + $version_release` + +# The minimum runtime API version that is supported. MUST be updated at +# an API break as well as changing the libtool version +min_version_decimal=20000 + + +printf "%s\n" "#define RAPTOR_VERSION_MAJOR $version_major" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_VERSION_MINOR $version_minor" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_VERSION_RELEASE $version_release" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_VERSION_DECIMAL $version_decimal" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_MIN_VERSION_DECIMAL $min_version_decimal" >>confdefs.h + + +# for raptor-config.in +RAPTOR_VERSION_MAJOR=$version_major +RAPTOR_VERSION_MINOR=$version_minor +RAPTOR_VERSION_RELEASE=$version_release +RAPTOR_VERSION_DECIMAL=$version_decimal + + + + + + +# Libtool versioning +# +# CURRENT +# The most recent interface number that this library implements. +# +# REVISION +# The implementation number of the CURRENT interface. +# +# AGE +# The difference between the newest and oldest interfaces that this +# library implements. In other words, the library implements all the +# interface numbers in the range from number `CURRENT - AGE' to +# `CURRENT'. +# +# Rules: +# 1. Start with version information of `0:0:0' for each libtool library. +# +# 2. Update the version information only immediately before a public +# release of your software. More frequent updates are unnecessary, +# and only guarantee that the current interface number gets larger +# faster. +# +# 3. If the library source code has changed at all since the last +# update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). +# +# 4. If any interfaces have been added, removed, or changed since the +# last update, increment CURRENT, and set REVISION to 0. +# +# 5. If any interfaces have been added since the last public release, +# then increment AGE. +# +# 6. If any interfaces have been removed since the last public release, +# then set AGE to 0. +# +# syntax: CURRENT[:REVISION[:AGE]] +RAPTOR_LIBTOOL_VERSION=0:0:0 + + + +ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" +if test "x$ac_cv_func_gettimeofday" = xyes +then : + printf "%s\n" "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getopt" "ac_cv_func_getopt" +if test "x$ac_cv_func_getopt" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "getopt_long" "ac_cv_func_getopt_long" +if test "x$ac_cv_func_getopt_long" = xyes +then : + printf "%s\n" "#define HAVE_GETOPT_LONG 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "vsnprintf" "ac_cv_func_vsnprintf" +if test "x$ac_cv_func_vsnprintf" = xyes +then : + printf "%s\n" "#define HAVE_VSNPRINTF 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "isascii" "ac_cv_func_isascii" +if test "x$ac_cv_func_isascii" = xyes +then : + printf "%s\n" "#define HAVE_ISASCII 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "setjmp" "ac_cv_func_setjmp" +if test "x$ac_cv_func_setjmp" = xyes +then : + printf "%s\n" "#define HAVE_SETJMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "qsort_r" "ac_cv_func_qsort_r" +if test "x$ac_cv_func_qsort_r" = xyes +then : + printf "%s\n" "#define HAVE_QSORT_R 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "qsort_s" "ac_cv_func_qsort_s" +if test "x$ac_cv_func_qsort_s" = xyes +then : + printf "%s\n" "#define HAVE_QSORT_S 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "stricmp" "ac_cv_func_stricmp" +if test "x$ac_cv_func_stricmp" = xyes +then : + printf "%s\n" "#define HAVE_STRICMP 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" +if test "x$ac_cv_func_strcasecmp" = xyes +then : + printf "%s\n" "#define HAVE_STRCASECMP 1" >>confdefs.h + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking strtok_r" >&5 +printf %s "checking strtok_r... " >&6; } +have_strtok_r=no +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_STRING_H +#include +#endif +int main(void) { return strtok_r(); } + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_strtok_r=yes + +printf "%s\n" "#define HAVE_STRTOK_R 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + + if test "$have_strtok_r" = "no"; then + NEED_STRTOK_R_TRUE= + NEED_STRTOK_R_FALSE='#' +else + NEED_STRTOK_R_TRUE='#' + NEED_STRTOK_R_FALSE= +fi + + +oCPPFLAGS="$CPPFLAGS" +CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" +ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf" +if test "x$ac_cv_func_vasprintf" = xyes +then : + printf "%s\n" "#define HAVE_VASPRINTF 1" >>confdefs.h + +fi + +CPPFLAGS="$oCPPFLAGS" + + + if test $ac_cv_func_strcasecmp = no -a $ac_cv_func_stricmp = no; then + STRCASECMP_TRUE= + STRCASECMP_FALSE='#' +else + STRCASECMP_TRUE='#' + STRCASECMP_FALSE= +fi + + if test $ac_cv_func_getopt = no -a $ac_cv_func_getopt_long = no; then + GETOPT_TRUE= + GETOPT_FALSE='#' +else + GETOPT_TRUE='#' + GETOPT_FALSE= +fi + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether need to declare optind" >&5 +printf %s "checking whether need to declare optind... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef HAVE_GETOPT_H +#include +#endif +int +main (void) +{ +int x=optind; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else $as_nop + +printf "%s\n" "#define NEED_OPTIND_DECLARATION 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + + +if test $ac_cv_func_vsnprintf = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether vsnprintf has C99 compatible return value" >&5 +printf %s "checking whether vsnprintf has C99 compatible return value... " >&6; } + if test "$cross_compiling" = yes +then : + +printf "%s\n" "#define CHECK_VSNPRINTF_RUNTIME 1" >>confdefs.h + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#include + +static int is_c99(char *buf, char *s, ...) { + va_list args; + int r; + va_start(args, s); + r = vsnprintf(buf, buf ? 5 : 0, s, args); + va_end(args); + + return (r == 7); +} + +int main(void) { + char buffer[32]; + return (is_c99(NULL, "1234567") ? 0 : 10) + + (is_c99(buffer, "1234567") ? 0 : 1); +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + +printf "%s\n" "#define HAVE_C99_VSNPRINTF 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi + +# Save LIBS +oLIBS="$LIBS" + +RAPTOR_LDFLAGS= + +# Check whether --enable-largefile was given. +if test ${enable_largefile+y} +then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +printf %s "checking for special C compiler options needed for large files... " >&6; } +if test ${ac_cv_sys_largefile_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test ${ac_cv_sys_file_offset_bits+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } +if test ${ac_cv_sys_large_files+y} +then : + printf %s "(cached) " >&6 +else $as_nop + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +printf "%s\n" "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h +;; +esac +rm -rf conftest* + fi +fi + + + + + + + + + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + PKG_CONFIG="" + fi +fi + +PKG_CONFIG_REQUIRES= + + +# Check whether --with-xml2-config was given. +if test ${with_xml2_config+y} +then : + withval=$with_xml2_config; xml2_config="$withval" +else $as_nop + xml2_config="" +fi + + +if test "X$xml2_config" != "Xno" ; then + if test "X$xml2_config" != "X" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $xml2_config" >&5 +printf %s "checking for $xml2_config... " >&6; } + + if test -x $xml2_config ; then + XML_CONFIG=$xml2_config + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + as_fn_error $? "xml2-config not found at specified path $xml2_config" "$LINENO" 5 + fi + fi + if test "X$XML_CONFIG" = "X" ; then + for ac_prog in xml2-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_XML_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$XML_CONFIG"; then + ac_cv_prog_XML_CONFIG="$XML_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_XML_CONFIG="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +XML_CONFIG=$ac_cv_prog_XML_CONFIG +if test -n "$XML_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XML_CONFIG" >&5 +printf "%s\n" "$XML_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$XML_CONFIG" && break +done + + fi +fi + +libxml_source=no +if test "X$XML_CONFIG" != "X"; then + LIBXML_CFLAGS=`$XML_CONFIG --cflags` + LIBXML_LIBS=`$XML_CONFIG --libs` + + CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" + LIBS="$LIBS $LIBXML_LIBS" + ac_fn_c_check_func "$LINENO" "xmlCreatePushParserCtxt" "ac_cv_func_xmlCreatePushParserCtxt" +if test "x$ac_cv_func_xmlCreatePushParserCtxt" = xyes +then : + have_xmlCreatePushParserCtxt=yes +else $as_nop + have_xmlCreatePushParserCtxt=no +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libxml via xml2-config" >&5 +printf %s "checking for libxml via xml2-config... " >&6; } + if test $have_xmlCreatePushParserCtxt = yes; then + libxml_source="xml2-config" + LIBXML_VERSION=`$XML_CONFIG --version` + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" +else + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LIBXML" >&5 +printf %s "checking for LIBXML... " >&6; } + +if test -n "$LIBXML_CFLAGS"; then + pkg_cv_LIBXML_CFLAGS="$LIBXML_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBXML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBXML_LIBS"; then + pkg_cv_LIBXML_LIBS="$LIBXML_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxml-2.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libxml-2.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBXML_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBXML_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1` + else + LIBXML_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBXML_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + : +else + LIBXML_CFLAGS=$pkg_cv_LIBXML_CFLAGS + LIBXML_LIBS=$pkg_cv_LIBXML_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + LIBXML_VERSION=`$PKG_CONFIG libxml-2.0 --modversion` + libxml_source="pkg-config" + +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libxml via pkg-config" >&5 +printf %s "checking for libxml via pkg-config... " >&6; } +fi + +if test "$libxml_source" != "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - $LIBXML_VERSION" >&5 +printf "%s\n" "yes - $LIBXML_VERSION" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no - not found" >&5 +printf "%s\n" "no - not found" >&6; } +fi + + + +# Check whether --with-xslt-config was given. +if test ${with_xslt_config+y} +then : + withval=$with_xslt_config; xslt_config="$withval" +else $as_nop + xslt_config="" +fi + + +if test "X$xslt_config" != "Xno" ; then + if test "X$xslt_config" != "X" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $xslt_config" >&5 +printf %s "checking for $xslt_config... " >&6; } + + if test -x $xslt_config ; then + XSLT_CONFIG=$xslt_config + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + as_fn_error $? "xslt-config not found at specified path $xslt_config" "$LINENO" 5 + fi + fi + if test "X$XSLT_CONFIG" = "X" ; then + for ac_prog in xslt-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_XSLT_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$XSLT_CONFIG"; then + ac_cv_prog_XSLT_CONFIG="$XSLT_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_XSLT_CONFIG="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +XSLT_CONFIG=$ac_cv_prog_XSLT_CONFIG +if test -n "$XSLT_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XSLT_CONFIG" >&5 +printf "%s\n" "$XSLT_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$XSLT_CONFIG" && break +done + + fi +fi + +if test "X$XSLT_CONFIG" != "X"; then + XSLT_CFLAGS=`$XSLT_CONFIG --cflags` + XSLT_LIBS=`$XSLT_CONFIG --libs` + + CPPFLAGS="$XSLT_CFLAGS $CPPFLAGS" + LIBS="$LIBS $XSLT_LIBS" + + ac_fn_c_check_func "$LINENO" "xsltSaveResultToString" "ac_cv_func_xsltSaveResultToString" +if test "x$ac_cv_func_xsltSaveResultToString" = xyes +then : + have_xsltSaveResultToString=yes +else $as_nop + have_xsltSaveResultToString=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libxslt via xslt-config" >&5 +printf %s "checking for libxslt via xslt-config... " >&6; } + if test $have_xsltSaveResultToString = yes; then + have_libxslt=1 + LIBXSLT_VERSION=`$XSLT_CONFIG --version` + libxslt_version_dec=`echo $LIBXSLT_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + libxslt_min_version_dec=`echo $libxslt_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + 3)};'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - version $LIBXSLT_VERSION" >&5 +printf "%s\n" "yes - version $LIBXSLT_VERSION" >&6; } + if test $libxslt_version_dec -lt $libxslt_min_version_dec; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using libxslt $LIBXSLT_VERSION is unsupported - $libxslt_min_version or newer required." >&5 +printf "%s\n" "$as_me: WARNING: Using libxslt $LIBXSLT_VERSION is unsupported - $libxslt_min_version or newer required." >&2;} + have_libxslt=0 + fi + fi + + ac_fn_c_check_func "$LINENO" "xsltInit" "ac_cv_func_xsltInit" +if test "x$ac_cv_func_xsltInit" = xyes +then : + +fi + + + ac_fn_c_check_header_compile "$LINENO" "libxslt/xslt.h" "ac_cv_header_libxslt_xslt_h" "$ac_includes_default" +if test "x$ac_cv_header_libxslt_xslt_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBXSLT_XSLT_H 1" >>confdefs.h + +fi + + if test "$ac_cv_header_libxslt_xslt_h" = no ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libxslt library found but not headers - disabling" >&5 +printf "%s\n" "$as_me: WARNING: libxslt library found but not headers - disabling" >&2;} + have_libxslt_lib=0 + have_libxslt=0 + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" +else + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XSLT" >&5 +printf %s "checking for XSLT... " >&6; } + +if test -n "$XSLT_CFLAGS"; then + pkg_cv_XSLT_CFLAGS="$XSLT_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxslt > \$libxslt_min_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libxslt > $libxslt_min_version") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_XSLT_CFLAGS=`$PKG_CONFIG --cflags "libxslt > $libxslt_min_version" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$XSLT_LIBS"; then + pkg_cv_XSLT_LIBS="$XSLT_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libxslt > \$libxslt_min_version\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libxslt > $libxslt_min_version") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_XSLT_LIBS=`$PKG_CONFIG --libs "libxslt > $libxslt_min_version" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + XSLT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxslt > $libxslt_min_version" 2>&1` + else + XSLT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxslt > $libxslt_min_version" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$XSLT_PKG_ERRORS" >&5 + + have_libxslt=0 +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + have_libxslt=0 +else + XSLT_CFLAGS=$pkg_cv_XSLT_CFLAGS + XSLT_LIBS=$pkg_cv_XSLT_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + have_libxslt=1 +fi +fi + + +# Check whether --with-curl-config was given. +if test ${with_curl_config+y} +then : + withval=$with_curl_config; curl_config="$withval" +else $as_nop + curl_config="" +fi + + +if test "X$curl_config" != "Xno" ; then + if test "X$curl_config" != "X" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $curl_config" >&5 +printf %s "checking for $curl_config... " >&6; } + + if test -f $curl_config ; then + CURL_CONFIG=$curl_config + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no - searching PATH" >&5 +printf "%s\n" "no - searching PATH" >&6; } + fi + fi + if test "X$CURL_CONFIG" = "X" ; then + for ac_prog in curl-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CURL_CONFIG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CURL_CONFIG"; then + ac_cv_prog_CURL_CONFIG="$CURL_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CURL_CONFIG="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CURL_CONFIG=$ac_cv_prog_CURL_CONFIG +if test -n "$CURL_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CURL_CONFIG" >&5 +printf "%s\n" "$CURL_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$CURL_CONFIG" && break +done + + fi +fi + +libcurl_source=no +if test "X$CURL_CONFIG" != "X"; then + LIBCURL_CFLAGS=`$CURL_CONFIG --cflags` + LIBCURL_LIBS=`$CURL_CONFIG --libs` + + CPPFLAGS="$LIBCURL_CFLAGS $CPPFLAGS" + LIBS="$LIBS $LIBCURL_LIBS" + ac_fn_c_check_header_compile "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default" +if test "x$ac_cv_header_curl_curl_h" = xyes +then : + +fi + + ac_fn_c_check_func "$LINENO" "curl_easy_init" "ac_cv_func_curl_easy_init" +if test "x$ac_cv_func_curl_easy_init" = xyes +then : + have_curl_easy_init=yes +else $as_nop + have_curl_easy_init=no +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcurl via curl-config" >&5 +printf %s "checking for libcurl via curl-config... " >&6; } + if test $have_curl_easy_init = yes; then + libcurl_source="curl-config" + LIBCURL_VERSION=`$CURL_CONFIG --version | sed -e 's/^libcurl *//'` + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" +else + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LIBCURL" >&5 +printf %s "checking for LIBCURL... " >&6; } + +if test -n "$LIBCURL_CFLAGS"; then + pkg_cv_LIBCURL_CFLAGS="$LIBCURL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBCURL_CFLAGS=`$PKG_CONFIG --cflags "libcurl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$LIBCURL_LIBS"; then + pkg_cv_LIBCURL_LIBS="$LIBCURL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libcurl\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libcurl") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_LIBCURL_LIBS=`$PKG_CONFIG --libs "libcurl" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LIBCURL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libcurl" 2>&1` + else + LIBCURL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libcurl" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$LIBCURL_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + : +else + LIBCURL_CFLAGS=$pkg_cv_LIBCURL_CFLAGS + LIBCURL_LIBS=$pkg_cv_LIBCURL_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + LIBCURL_VERSION=`$PKG_CONFIG libcurl --modversion` + libcurl_source="pkg-config" + +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcurl via pkg-config" >&5 +printf %s "checking for libcurl via pkg-config... " >&6; } +fi + +if test "$libcurl_source" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no - not found" >&5 +printf "%s\n" "no - not found" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - $LIBCURL_VERSION" >&5 +printf "%s\n" "yes - $LIBCURL_VERSION" >&6; } +fi + + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ICU" >&5 +printf %s "checking for ICU... " >&6; } + +if test -n "$ICU_CFLAGS"; then + pkg_cv_ICU_CFLAGS="$ICU_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc\""; } >&5 + ($PKG_CONFIG --exists --print-errors "icu-uc") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-uc" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$ICU_LIBS"; then + pkg_cv_ICU_LIBS="$ICU_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"icu-uc\""; } >&5 + ($PKG_CONFIG --exists --print-errors "icu-uc") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_ICU_LIBS=`$PKG_CONFIG --libs "icu-uc" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + ICU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "icu-uc" 2>&1` + else + ICU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "icu-uc" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$ICU_PKG_ERRORS" >&5 + + have_icu=no +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + have_icu=no +else + ICU_CFLAGS=$pkg_cv_ICU_CFLAGS + ICU_LIBS=$pkg_cv_ICU_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + + have_icu=yes + ICU_UC_VERSION=`$PKG_CONFIG icu-uc --modversion` + +fi +ICU_UC_MAJOR_VERSION=`echo "$ICU_UC_VERSION" | sed -e 's/\..*$//'` + +printf "%s\n" "#define ICU_UC_MAJOR_VERSION $ICU_UC_MAJOR_VERSION" >>confdefs.h + + + +# Check whether --with-www-config was given. +if test ${with_www_config+y} +then : + withval=$with_www_config; libwww_config="$withval" +else $as_nop + libwww_config="" +fi + + +if test "X$libwww_config" != "Xno" -a "X$libwww_config" != "X" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libwww is no longer supported" >&5 +printf "%s\n" "$as_me: WARNING: libwww is no longer supported" >&2;} +fi + + +have_libxml=0 +need_libxml=0 + +oCPPFLAGS="$CPPFLAGS" +if test "X$libxml_source" != X; then + CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" + LIBS="$LIBS $LIBXML_LIBS" + ac_fn_c_check_func "$LINENO" "xmlCreatePushParserCtxt" "ac_cv_func_xmlCreatePushParserCtxt" +if test "x$ac_cv_func_xmlCreatePushParserCtxt" = xyes +then : + have_xmlCreatePushParserCtxt=yes +else $as_nop + have_xmlCreatePushParserCtxt=no +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking libxml library" >&5 +printf %s "checking libxml library... " >&6; } + if test $have_xmlCreatePushParserCtxt = yes; then + have_libxml=1 + libxml_version_dec=`echo $LIBXML_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + libxml_min_version_dec=`echo $libxml_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - version $LIBXML_VERSION" >&5 +printf "%s\n" "yes - version $LIBXML_VERSION" >&6; } + if test $libxml_version_dec -lt $libxml_min_version_dec; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using libxml $LIBXML_VERSION is unsupported - $libxml_min_version or newer required." >&5 +printf "%s\n" "$as_me: WARNING: Using libxml $LIBXML_VERSION is unsupported - $libxml_min_version or newer required." >&2;} + have_libxml=0 + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + + ac_fn_c_check_header_compile "$LINENO" "libxml/nanohttp.h" "ac_cv_header_libxml_nanohttp_h" "$ac_includes_default" +if test "x$ac_cv_header_libxml_nanohttp_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBXML_NANOHTTP_H 1" >>confdefs.h + +fi + + ac_fn_c_check_header_compile "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default" +if test "x$ac_cv_header_libxml_parser_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBXML_PARSER_H 1" >>confdefs.h + +fi + + ac_fn_c_check_header_compile "$LINENO" "libxml/hash.h" "ac_cv_header_libxml_hash_h" "#ifdef HAVE_LIBXML_PARSER_H +#include +#endif + +" +if test "x$ac_cv_header_libxml_hash_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBXML_HASH_H 1" >>confdefs.h + +fi +ac_fn_c_check_header_compile "$LINENO" "libxml/SAX2.h" "ac_cv_header_libxml_SAX2_h" "#ifdef HAVE_LIBXML_PARSER_H +#include +#endif + +" +if test "x$ac_cv_header_libxml_SAX2_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBXML_SAX2_H 1" >>confdefs.h + +fi + + + if test "$ac_cv_header_libxml_parser_h" = no -a "$ac_cv_header_gnome_xml_parser_h" = no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: libxml library found but not headers - disabling" >&5 +printf "%s\n" "$as_me: WARNING: libxml library found but not headers - disabling" >&2;} + have_libxml=0 + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libxml xmlEntity has name_length field" >&5 +printf %s "checking if libxml xmlEntity has name_length field... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif + +int +main (void) +{ +xmlEntity foo; foo.name_length=0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define RAPTOR_LIBXML_ENTITY_NAME_LENGTH 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libxml xmlEntity has etype field" >&5 +printf %s "checking if libxml xmlEntity has etype field... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif + +int +main (void) +{ +xmlEntity foo; foo.etype=0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define RAPTOR_LIBXML_ENTITY_ETYPE 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libxml xmlSAXHandler has initialized field" >&5 +printf %s "checking if libxml xmlSAXHandler has initialized field... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif + +int +main (void) +{ +xmlSAXHandler foo; foo.initialized=0 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libxml xmlSAXHandler has externalSubset field" >&5 +printf %s "checking if libxml xmlSAXHandler has externalSubset field... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif + +int +main (void) +{ +xmlSAXHandler foo; foo.externalSubset=NULL + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + + ac_fn_c_check_func "$LINENO" "xmlSAX2InternalSubset" "ac_cv_func_xmlSAX2InternalSubset" +if test "x$ac_cv_func_xmlSAX2InternalSubset" = xyes +then : + printf "%s\n" "#define HAVE_XMLSAX2INTERNALSUBSET 1" >>confdefs.h + +fi +ac_fn_c_check_func "$LINENO" "xmlCtxtUseOptions" "ac_cv_func_xmlCtxtUseOptions" +if test "x$ac_cv_func_xmlCtxtUseOptions" = xyes +then : + printf "%s\n" "#define HAVE_XMLCTXTUSEOPTIONS 1" >>confdefs.h + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libxml has parser option XML_PARSE_NONET" >&5 +printf %s "checking if libxml has parser option XML_PARSE_NONET... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif + +int +main (void) +{ +xmlParserOption foo; foo = XML_PARSE_NONET + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define RAPTOR_LIBXML_XML_PARSE_NONET 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ac_fn_c_check_header_compile "$LINENO" "libxml/HTMLparser.h" "ac_cv_header_libxml_HTMLparser_h" "$ac_includes_default" +if test "x$ac_cv_header_libxml_HTMLparser_h" = xyes +then : + printf "%s\n" "#define HAVE_LIBXML_HTMLPARSER_H 1" >>confdefs.h + +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libxml has parser option HTML_PARSE_NONET" >&5 +printf %s "checking if libxml has parser option HTML_PARSE_NONET... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef HAVE_LIBXML_HTMLPARSER_H +#include +#endif + +int +main (void) +{ +htmlParserOption foo; foo = HTML_PARSE_NONET + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define RAPTOR_LIBXML_HTML_PARSE_NONET 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + fi + +fi +CPPFLAGS="$oCPPFLAGS" +LIBS="$oLIBS" + + + +# Check whether --with-yajl was given. +if test ${with_yajl+y} +then : + withval=$with_yajl; yajl_prefix="$withval" +else $as_nop + yajl_prefix="none" +fi + + +if test "x$yajl_prefix" != "xno" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl installation" >&5 +printf %s "checking for yajl installation... " >&6; } + + if test "x$yajl_prefix" = "xyes" ; then + yajl_prefix="none" + fi + + # Nothing given - search + if test "X$yajl_prefix" = "Xnone" ; then + for dir in /opt/local /usr/local /usr; do + if test -r $dir/include/yajl/yajl_parse.h; then + yajl_prefix=$dir + break + fi + done + fi + + if test "X$yajl_prefix" = "Xnone" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found. Get it from https://lloyd.github.com/yajl/ and use --with-yajl=DIR if necessary to configure the installation directory." >&5 +printf "%s\n" "not found. Get it from https://lloyd.github.com/yajl/ and use --with-yajl=DIR if necessary to configure the installation directory." >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $yajl_prefix" >&5 +printf "%s\n" "$yajl_prefix" >&6; } + + if test "$yajl_prefix" = "/usr"; then + yajl_prefix= + else + LDFLAGS="-L$yajl_prefix/lib $LDFLAGS" + CPPFLAGS="-I$yajl_prefix/include $CPPFLAGS" + fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_parse in -lyajl" >&5 +printf %s "checking for yajl_parse in -lyajl... " >&6; } +if test ${ac_cv_lib_yajl_yajl_parse+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lyajl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char yajl_parse (); +int +main (void) +{ +return yajl_parse (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_yajl_yajl_parse=yes +else $as_nop + ac_cv_lib_yajl_yajl_parse=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_parse" >&5 +printf "%s\n" "$ac_cv_lib_yajl_yajl_parse" >&6; } +if test "x$ac_cv_lib_yajl_yajl_parse" = xyes +then : + libyajl=1 +else $as_nop + libyajl=0 +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for yajl_tree_parse in -lyajl" >&5 +printf %s "checking for yajl_tree_parse in -lyajl... " >&6; } +if test ${ac_cv_lib_yajl_yajl_tree_parse+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lyajl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char yajl_tree_parse (); +int +main (void) +{ +return yajl_tree_parse (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_yajl_yajl_tree_parse=yes +else $as_nop + ac_cv_lib_yajl_yajl_tree_parse=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_tree_parse" >&5 +printf "%s\n" "$ac_cv_lib_yajl_yajl_tree_parse" >&6; } +if test "x$ac_cv_lib_yajl_yajl_tree_parse" = xyes +then : + yajl_api_version=2 +else $as_nop + yajl_api_version=1 +fi + + ac_fn_c_check_header_compile "$LINENO" "yajl/yajl_parse.h" "ac_cv_header_yajl_yajl_parse_h" "$ac_includes_default" +if test "x$ac_cv_header_yajl_yajl_parse_h" = xyes +then : + printf "%s\n" "#define HAVE_YAJL_YAJL_PARSE_H 1" >>confdefs.h + +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking YAJL API version" >&5 +printf %s "checking YAJL API version... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $yajl_api_version" >&5 +printf "%s\n" "$yajl_api_version" >&6; } + if test $yajl_api_version = 2; then + +printf "%s\n" "#define HAVE_YAJL2 1" >>confdefs.h + + fi + + fi +fi +CPPFLAGS="$oCPPFLAGS" +LIBS="$oLIBS" + + +rdfxml_parser=no +ntriples_parser=no +turtle_parser=no +trig_parser=no +rss_parser=no +grddl_parser=no +guess_parser=yes +rdfa_parser=no +json_parser=no +nquads_parser=no + +rdf_parsers_available="rdfxml ntriples turtle trig guess rss-tag-soup rdfa nquads" +rdf_parsers_enabled= + + +grddl_parser_ok=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking GRDDL parser requirements" >&5 +printf %s "checking GRDDL parser requirements... " >&6; } +if test $have_libxml = 1 -a $have_libxslt = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + grddl_parser_ok=yes + rdf_parsers_available="$rdf_parsers_available grddl" +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no - libxml2 and libxslt are both not available" >&5 +printf "%s\n" "no - libxml2 and libxslt are both not available" >&6; } +fi + +json_parser_ok=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking JSON parser requirements" >&5 +printf %s "checking JSON parser requirements... " >&6; } +if test "X$ac_cv_header_yajl_yajl_parse_h" = Xyes -a "X$ac_cv_lib_yajl_yajl_parse" = Xyes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + json_parser_ok=yes + rdf_parsers_available="$rdf_parsers_available json" +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no - libyajl is not available" >&5 +printf "%s\n" "no - libyajl is not available" >&6; } +fi + + + +# This is needed because autoheader can't work out which computed +# symbols must be pulled from acconfig.h into config.h.in +if test "x" = "y"; then + +printf "%s\n" "#define RAPTOR_PARSER_RDFXML 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_NTRIPLES 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_TURTLE 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_TRIG 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_RSS 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_GRDDL 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_GUESS 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_RDFA 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_JSON 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_PARSER_NQUADS 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking RDF parsers required" >&5 +printf %s "checking RDF parsers required... " >&6; } +# Check whether --enable-parsers was given. +if test ${enable_parsers+y} +then : + enableval=$enable_parsers; parsers="$enableval" +fi + +if test "X$parsers" = Xall -o "X$parsers" = X; then + parsers="$rdf_parsers_available" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: all" >&5 +printf "%s\n" "all" >&6; } +elif test "X$parsers" = Xnone; then + parsers= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $parsers" >&5 +printf "%s\n" "$parsers" >&6; } +fi + +for parser in $parsers; do + p=$parser + if test $p = rss-tag-soup; then + p=rss + fi + + if test $p = grddl; then + if test $grddl_parser_ok != yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: GRDDL parser is not available" >&5 +printf "%s\n" "$as_me: WARNING: GRDDL parser is not available" >&2;} + continue + fi + fi + + if test $p = json; then + if test $json_parser_ok != yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: YAJL is not available" >&5 +printf "%s\n" "$as_me: WARNING: YAJL is not available" >&2;} + continue + fi + fi + + eval $p'_parser=yes' + NAME=`echo $p | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + n=RAPTOR_PARSER_${NAME} + printf "%s\n" "#define $n 1" >>confdefs.h + + rdf_parsers_enabled="$rdf_parsers_enabled $parser" +done + +use_nfc=no +if test $rdfxml_parser = yes; then + need_libxml=1 + use_nfc=yes +fi + +if test $rss_parser = yes; then + need_libxml=1 +fi + +need_libxslt=0 +if test $grddl_parser = yes; then + need_libxml=1 + need_libxslt=1 +fi + +need_librdfa=no +if test $rdfa_parser = yes; then + need_libxml=1 + need_librdfa=yes +fi + +need_libyajl=0 +if test $json_parser = yes; then + need_libyajl=1 +fi + + if test $rdfxml_parser = yes; then + RAPTOR_PARSER_RDFXML_TRUE= + RAPTOR_PARSER_RDFXML_FALSE='#' +else + RAPTOR_PARSER_RDFXML_TRUE='#' + RAPTOR_PARSER_RDFXML_FALSE= +fi + + if test $ntriples_parser = yes; then + RAPTOR_PARSER_NTRIPLES_TRUE= + RAPTOR_PARSER_NTRIPLES_FALSE='#' +else + RAPTOR_PARSER_NTRIPLES_TRUE='#' + RAPTOR_PARSER_NTRIPLES_FALSE= +fi + + if test $turtle_parser = yes; then + RAPTOR_PARSER_TURTLE_TRUE= + RAPTOR_PARSER_TURTLE_FALSE='#' +else + RAPTOR_PARSER_TURTLE_TRUE='#' + RAPTOR_PARSER_TURTLE_FALSE= +fi + + if test $trig_parser = yes; then + RAPTOR_PARSER_TRIG_TRUE= + RAPTOR_PARSER_TRIG_FALSE='#' +else + RAPTOR_PARSER_TRIG_TRUE='#' + RAPTOR_PARSER_TRIG_FALSE= +fi + + if test $rss_parser = yes; then + RAPTOR_PARSER_RSS_TRUE= + RAPTOR_PARSER_RSS_FALSE='#' +else + RAPTOR_PARSER_RSS_TRUE='#' + RAPTOR_PARSER_RSS_FALSE= +fi + + if test $grddl_parser = yes; then + RAPTOR_PARSER_GRDDL_TRUE= + RAPTOR_PARSER_GRDDL_FALSE='#' +else + RAPTOR_PARSER_GRDDL_TRUE='#' + RAPTOR_PARSER_GRDDL_FALSE= +fi + + if test $guess_parser = yes; then + RAPTOR_PARSER_GUESS_TRUE= + RAPTOR_PARSER_GUESS_FALSE='#' +else + RAPTOR_PARSER_GUESS_TRUE='#' + RAPTOR_PARSER_GUESS_FALSE= +fi + + if test $rdfa_parser = yes; then + RAPTOR_PARSER_RDFA_TRUE= + RAPTOR_PARSER_RDFA_FALSE='#' +else + RAPTOR_PARSER_RDFA_TRUE='#' + RAPTOR_PARSER_RDFA_FALSE= +fi + + if test $json_parser = yes; then + RAPTOR_PARSER_JSON_TRUE= + RAPTOR_PARSER_JSON_FALSE='#' +else + RAPTOR_PARSER_JSON_TRUE='#' + RAPTOR_PARSER_JSON_FALSE= +fi + + if test $nquads_parser = yes; then + RAPTOR_PARSER_NQUADS_TRUE= + RAPTOR_PARSER_NQUADS_FALSE='#' +else + RAPTOR_PARSER_NQUADS_TRUE='#' + RAPTOR_PARSER_NQUADS_FALSE= +fi + + + if test $need_librdfa = yes; then + LIBRDFA_TRUE= + LIBRDFA_FALSE='#' +else + LIBRDFA_TRUE='#' + LIBRDFA_FALSE= +fi + + + +rdfxml_serializer=no +ntriples_serializer=no +rdfxml_abbrev_serializer=no +turtle_serializer=no +mkr_serializer=no +rss_1_0_serializer=no +atom_serializer=no +dot_serializer=no +html_serializer=no +json_serializer=no +nquads_serializer=no + +rdf_serializers_available="rdfxml rdfxml-abbrev turtle mkr ntriples rss-1.0 dot html json atom nquads" + +# This is needed because autoheader can't work out which computed +# symbols must be pulled from acconfig.h into config.h.in +if test "x" = "y"; then + +printf "%s\n" "#define RAPTOR_SERIALIZER_RDFXML 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_NTRIPLES 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_RDFXML_ABBREV 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_TURTLE 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_MKR 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_RSS_1_0 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_ATOM 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_DOT 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_HTML 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_JSON 1" >>confdefs.h + + +printf "%s\n" "#define RAPTOR_SERIALIZER_NQUADS 1" >>confdefs.h + +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking RDF serializers required" >&5 +printf %s "checking RDF serializers required... " >&6; } +# Check whether --enable-serializers was given. +if test ${enable_serializers+y} +then : + enableval=$enable_serializers; serializers="$enableval" +fi + +if test "X$serializers" = Xall -o "X$serializers" = X; then + serializers="$rdf_serializers_available" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: all" >&5 +printf "%s\n" "all" >&6; } +elif test "X$serializers" = Xnone; then + serializers= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $serializers" >&5 +printf "%s\n" "$serializers" >&6; } +fi + +for serializer in $serializers; do + s=`echo $serializer | tr '.-' '__'` + eval $s'_serializer=yes' + NAME=`echo $s | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + n=RAPTOR_SERIALIZER_${NAME} + printf "%s\n" "#define $n 1" >>confdefs.h + + rdf_serializers_enabled="$rdf_serializers_enabled $serializer" +done + + if test $rdfxml_serializer = yes; then + RAPTOR_SERIALIZER_RDFXML_TRUE= + RAPTOR_SERIALIZER_RDFXML_FALSE='#' +else + RAPTOR_SERIALIZER_RDFXML_TRUE='#' + RAPTOR_SERIALIZER_RDFXML_FALSE= +fi + + if test $ntriples_serializer = yes; then + RAPTOR_SERIALIZER_NTRIPLES_TRUE= + RAPTOR_SERIALIZER_NTRIPLES_FALSE='#' +else + RAPTOR_SERIALIZER_NTRIPLES_TRUE='#' + RAPTOR_SERIALIZER_NTRIPLES_FALSE= +fi + + if test $rdfxml_abbrev_serializer = yes; then + RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE= + RAPTOR_SERIALIZER_RDFXML_ABBREV_FALSE='#' +else + RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE='#' + RAPTOR_SERIALIZER_RDFXML_ABBREV_FALSE= +fi + + if test $turtle_serializer = yes; then + RAPTOR_SERIALIZER_TURTLE_TRUE= + RAPTOR_SERIALIZER_TURTLE_FALSE='#' +else + RAPTOR_SERIALIZER_TURTLE_TRUE='#' + RAPTOR_SERIALIZER_TURTLE_FALSE= +fi + + if test $mkr_serializer = yes; then + RAPTOR_SERIALIZER_MKR_TRUE= + RAPTOR_SERIALIZER_MKR_FALSE='#' +else + RAPTOR_SERIALIZER_MKR_TRUE='#' + RAPTOR_SERIALIZER_MKR_FALSE= +fi + + if test $rss_1_0_serializer = yes; then + RAPTOR_SERIALIZER_RSS_1_0_TRUE= + RAPTOR_SERIALIZER_RSS_1_0_FALSE='#' +else + RAPTOR_SERIALIZER_RSS_1_0_TRUE='#' + RAPTOR_SERIALIZER_RSS_1_0_FALSE= +fi + + if test $atom_serializer = yes; then + RAPTOR_SERIALIZER_ATOM_TRUE= + RAPTOR_SERIALIZER_ATOM_FALSE='#' +else + RAPTOR_SERIALIZER_ATOM_TRUE='#' + RAPTOR_SERIALIZER_ATOM_FALSE= +fi + + if test $dot_serializer = yes; then + RAPTOR_SERIALIZER_DOT_TRUE= + RAPTOR_SERIALIZER_DOT_FALSE='#' +else + RAPTOR_SERIALIZER_DOT_TRUE='#' + RAPTOR_SERIALIZER_DOT_FALSE= +fi + + if test $html_serializer = yes; then + RAPTOR_SERIALIZER_HTML_TRUE= + RAPTOR_SERIALIZER_HTML_FALSE='#' +else + RAPTOR_SERIALIZER_HTML_TRUE='#' + RAPTOR_SERIALIZER_HTML_FALSE= +fi + + if test $json_serializer = yes; then + RAPTOR_SERIALIZER_JSON_TRUE= + RAPTOR_SERIALIZER_JSON_FALSE='#' +else + RAPTOR_SERIALIZER_JSON_TRUE='#' + RAPTOR_SERIALIZER_JSON_FALSE= +fi + + if test $nquads_serializer = yes; then + RAPTOR_SERIALIZER_NQUADS_TRUE= + RAPTOR_SERIALIZER_NQUADS_FALSE='#' +else + RAPTOR_SERIALIZER_NQUADS_TRUE='#' + RAPTOR_SERIALIZER_NQUADS_FALSE= +fi + + + if test $rss_1_0_serializer = yes -o $rss_parser = yes; then + RAPTOR_RSS_COMMON_TRUE= + RAPTOR_RSS_COMMON_FALSE='#' +else + RAPTOR_RSS_COMMON_TRUE='#' + RAPTOR_RSS_COMMON_FALSE= +fi + + +need_icu=no +if test $use_nfc = yes -a $have_icu = yes; then + need_icu=yes + +printf "%s\n" "#define RAPTOR_ICU_NFC 1" >>confdefs.h + +fi + if test $need_icu = yes; then + RAPTOR_ICU_NFC_TRUE= + RAPTOR_ICU_NFC_FALSE='#' +else + RAPTOR_ICU_NFC_TRUE='#' + RAPTOR_ICU_NFC_FALSE= +fi + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking XML names version" >&5 +printf %s "checking XML names version... " >&6; } + +# Check whether --with-xml-names was given. +if test ${with_xml_names+y} +then : + withval=$with_xml_names; xml_names="$withval" +else $as_nop + xml_names="1.0" +fi + +if test $xml_names = 1.1; then + +printf "%s\n" "#define RAPTOR_XML_1_1 1" >>confdefs.h + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $xml_names" >&5 +printf "%s\n" "$xml_names" >&6; } + + +have_libcurl=0 +have_libfetch=0 +need_libcurl=0 +need_libxml_www=0 +need_libfetch=0 + +if test "X$CURL_CONFIG" != X; then + CPPFLAGS="$CPPFLAGS $LIBCURL_CFLAGS" + LIBS="$LIBS $LIBCURL_LIBS" + ac_fn_c_check_header_compile "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default" +if test "x$ac_cv_header_curl_curl_h" = xyes +then : + +fi + + ac_fn_c_check_func "$LINENO" "curl_easy_init" "ac_cv_func_curl_easy_init" +if test "x$ac_cv_func_curl_easy_init" = xyes +then : + have_curl_easy_init=yes +else $as_nop + have_curl_easy_init=no +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libcurl library" >&5 +printf %s "checking for libcurl library... " >&6; } + if test $have_curl_easy_init = yes -a "$ac_cv_header_curl_curl_h" = yes; then + libcurl_min_version_dec=`echo $libcurl_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + libcurl_version_dec=`echo $LIBCURL_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + if test $libcurl_version_dec -lt $libcurl_min_version_dec; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using libcurl $LIBCURL_VERSION is unsupported - $libcurl_min_version or newer required." >&5 +printf "%s\n" "$as_me: WARNING: Using libcurl $LIBCURL_VERSION is unsupported - $libcurl_min_version or newer required." >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no - version $LIBCURL_VERSION is too old" >&5 +printf "%s\n" "no - version $LIBCURL_VERSION is too old" >&6; } + else + have_libcurl=1 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes - version $LIBCURL_VERSION via $libcurl_source" >&5 +printf "%s\n" "yes - version $LIBCURL_VERSION via $libcurl_source" >&6; } + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi +fi +LIBS="$oLIBS" +CPPFLAGS="$oCPPFLAGS" + + +if test "X$ac_cv_header_curl_curl_h" = Xyes; then + +printf "%s\n" "#define HAVE_CURL_CURL_H 1" >>confdefs.h + +fi + +if test $ac_cv_header_fetch_h = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fetchXGetURL in -lfetch" >&5 +printf %s "checking for fetchXGetURL in -lfetch... " >&6; } +if test ${ac_cv_lib_fetch_fetchXGetURL+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfetch $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char fetchXGetURL (); +int +main (void) +{ +return fetchXGetURL (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_fetch_fetchXGetURL=yes +else $as_nop + ac_cv_lib_fetch_fetchXGetURL=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fetch_fetchXGetURL" >&5 +printf "%s\n" "$ac_cv_lib_fetch_fetchXGetURL" >&6; } +if test "x$ac_cv_lib_fetch_fetchXGetURL" = xyes +then : + have_libfetch=1 +fi + + LIBS="$oLIBS" +fi + + + +# Check whether --with-www was given. +if test ${with_www+y} +then : + withval=$with_www; www="$withval" +else $as_nop + www="curl" +fi + + +for www_name in $www curl xml libfetch none; do + case $www_name in + curl) + if test $have_libcurl = 1; then + need_libcurl=1 + +printf "%s\n" "#define RAPTOR_WWW_LIBCURL 1" >>confdefs.h + + break + fi + ;; + + xml) + if test $have_libxml = 1; then + need_libxml=1 + need_libxml_www=1 + +printf "%s\n" "#define RAPTOR_WWW_LIBXML 1" >>confdefs.h + + break + fi + ;; + + libfetch) + if test $have_libfetch = 1; then + need_libfetch=1 + +printf "%s\n" "#define RAPTOR_WWW_LIBFETCH 1" >>confdefs.h + + break + fi + ;; + + none|no) + need_libcurl=0 + need_libxml_www=0 + +printf "%s\n" "#define RAPTOR_WWW_NONE 1" >>confdefs.h + + break + ;; + + *) + as_fn_error $? "No such WWW library $www_name" "$LINENO" 5 + ;; +esac +done + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking WWW libraries available" >&5 +printf %s "checking WWW libraries available... " >&6; } +www_libraries_available= +if test $have_libcurl = 1; then + www_libraries_available="$www_libraries_available libcurl $LIBCURL_VERSION" +fi +if test $have_libxml = 1; then + www_libraries_available="$www_libraries_available libxml $LIBXML_VERSION" +fi +if test $have_libfetch = 1; then + www_libraries_available="$www_libraries_available libfetch" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $www_libraries_available" >&5 +printf "%s\n" "$www_libraries_available" >&6; } + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking WWW library to use" >&5 +printf %s "checking WWW library to use... " >&6; } +www_library= +RAPTOR_WWW_LIBRARY=none +if test $need_libcurl = 1; then + www_library="libcurl $LIBCURL_VERSION via $libcurl_source" + RAPTOR_WWW_LIBRARY=libcurl +elif test $need_libxml_www = 1; then + www_library="libxml $LIBXML_VERSION via $libxml_source" + RAPTOR_WWW_LIBRARY=libxml +elif test $need_libfetch = 1; then + www_library="libfetch" + RAPTOR_WWW_LIBRARY=libfetch +else + www_library=none +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $www_library" >&5 +printf "%s\n" "$www_library" >&6; } +if test "X$www_library" = Xnone; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: No WWW library in use - only file: URLs will work" >&5 +printf "%s\n" "$as_me: WARNING: No WWW library in use - only file: URLs will work" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Install libcurl, libxml2 or BSD libfetch for WWW access" >&5 +printf "%s\n" "$as_me: WARNING: Install libcurl, libxml2 or BSD libfetch for WWW access" >&2;} +fi + +if test $need_libcurl = 1; then + CPPFLAGS="$CPPFLAGS $LIBCURL_CFLAGS" + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $LIBCURL_LIBS" + + if test libcurl_source = "pkg-config"; then + if test "X$PKG_CONFIG_REQUIRES" != X; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libcurl >= $libcurl_min_version" + fi + + case " $LIBOBJS " in + *" raptor_www_curl.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS raptor_www_curl.$ac_objext" + ;; +esac + +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking NFC library to use" >&5 +printf %s "checking NFC library to use... " >&6; } +nfc_library=none +if test $need_icu = yes; then + CPPFLAGS="$CPPFLAGS $ICU_CFLAGS" + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $ICU_LIBS" + case " $LIBOBJS " in + *" raptor_nfc_icu.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS raptor_nfc_icu.$ac_objext" + ;; +esac + + nfc_library="ICU UC $ICU_UC_VERSION" +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $nfc_library" >&5 +printf "%s\n" "$nfc_library" >&6; } + + +have_lininn=no +have_inn_parsedate=no + +oCPPFLAGS="$CPPFLAGS" +if test -d /usr/include/inn; then + CPPFLAGS="$CPPFLAGS -I/usr/include/inn" +fi +ac_fn_c_check_header_compile "$LINENO" "libinn.h" "ac_cv_header_libinn_h" "$ac_includes_default" +if test "x$ac_cv_header_libinn_h" = xyes +then : + +fi + +CPPFLAGS="$oCPPFLAGS" + +oCPPFLAGS="$CPPFLAGS" +if test $ac_cv_header_libinn_h = yes; then + CPPFLAGS="$CPPFLAGS -I/usr/include/inn" + LIBS="$LIBS -L/usr/lib/news -linn" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for HashMessageID in -linn" >&5 +printf %s "checking for HashMessageID in -linn... " >&6; } +if test ${ac_cv_lib_inn_HashMessageID+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-linn $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char HashMessageID (); +int +main (void) +{ +return HashMessageID (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_inn_HashMessageID=yes +else $as_nop + ac_cv_lib_inn_HashMessageID=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_inn_HashMessageID" >&5 +printf "%s\n" "$ac_cv_lib_inn_HashMessageID" >&6; } +if test "x$ac_cv_lib_inn_HashMessageID" = xyes +then : + have_libinn=yes +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking parsedate in libinn" >&5 +printf %s "checking parsedate in libinn... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif +#include + +int +main (void) +{ + parsedate("Sun Jun 12 00:04:09 BST 2005", NULL) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + +printf "%s\n" "#define HAVE_INN_PARSEDATE 1" >>confdefs.h + + have_inn_parsedate=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +CPPFLAGS="$oCPPFLAGS" +LIBS="$oLIBS" + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking date parsing source" >&5 +printf %s "checking date parsing source... " >&6; } +raptor_parsedate_needed=no +if test $have_inn_parsedate = yes; then + CPPFLAGS="$CPPFLAGS -I/usr/include/inn" + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS -L/usr/lib/news -linn" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: INN parsedate" >&5 +printf "%s\n" "INN parsedate" >&6; } +else + if test $need_libcurl = 1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: libcurl curl_getdate" >&5 +printf "%s\n" "libcurl curl_getdate" >&6; } + else + raptor_parsedate_needed=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: raptor parsedate" >&5 +printf "%s\n" "raptor parsedate" >&6; } + fi +fi + + if test $raptor_parsedate_needed = yes; then + PARSEDATE_TRUE= + PARSEDATE_FALSE='#' +else + PARSEDATE_TRUE='#' + PARSEDATE_FALSE= +fi + +if test $raptor_parsedate_needed = yes; then + +printf "%s\n" "#define HAVE_RAPTOR_PARSE_DATE 1" >>confdefs.h + +fi + + +if test $need_libfetch = 1; then + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS -lfetch" + case " $LIBOBJS " in + *" raptor_www_libfetch.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS raptor_www_libfetch.$ac_objext" + ;; +esac + +fi + + +RAPTOR_XML_PARSER=none +if test $need_libxml = 1; then + if test $have_libxml = 1; then + +printf "%s\n" "#define RAPTOR_XML_LIBXML 1" >>confdefs.h + + else + as_fn_error $? "libxml2 is not available - please get it from https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home" "$LINENO" 5 + fi + if test $need_libxml_www = 1; then + case " $LIBOBJS " in + *" raptor_www_libxml.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS raptor_www_libxml.$ac_objext" + ;; +esac + + fi + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $LIBXML_LIBS" + CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" + + if test libxml_source = "pkg-config"; then + if test "X$PKG_CONFIG_REQUIRES" != X; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libxml-2.0 >= $libxml_min_version" + fi + RAPTOR_XML_PARSER=libxml +fi + if test $need_libxml = 1; then + RAPTOR_XML_LIBXML_TRUE= + RAPTOR_XML_LIBXML_FALSE='#' +else + RAPTOR_XML_LIBXML_TRUE='#' + RAPTOR_XML_LIBXML_FALSE= +fi + + + +if test $need_libxslt = 1; then + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $XSLT_LIBS" + CPPFLAGS="$CPPFLAGS $XSLT_CFLAGS" +fi + +if test $need_libyajl = 1; then + if test "x$yajl_prefix" != "x"; then + CPPFLAGS="-I$yajl_prefix/include $CPPFLAGS" + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS -L$yajl_prefix/lib" + fi + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS -lyajl" +fi + +RAPTOR_LIBTOOLLIBS=libraptor2.la + + + +xml_parser="none needed" +if test $need_libxml = 1; then + xml_parser="libxml $LIBXML_VERSION via $libxml_source" +fi + + +# Restore LIBS +LIBS="$oLIBS" + +# Make final changes to cflags +MEM= +MEM_LIBS= +CPPFLAGS="-DRAPTOR_INTERNAL=1 $CPPFLAGS" + + +# Check whether --with-memory-signing was given. +if test ${with_memory_signing+y} +then : + withval=$with_memory_signing; use_memory_signing="$withval" +else $as_nop + use_memory_signing="no" +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking using memory signing" >&5 +printf %s "checking using memory signing... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $use_memory_signing" >&5 +printf "%s\n" "$use_memory_signing" >&6; }; +if test "$use_memory_signing" = yes; then + MEM=-DRAPTOR_MEMORY_SIGN=1 + MEM_LIBS= +fi + +debug_messages=no + +# Check whether --enable-debug was given. +if test ${enable_debug+y} +then : + enableval=$enable_debug; debug_messages=$enableval +fi + +if test "$debug_messages" = "yes"; then + +printf "%s\n" "#define RAPTOR_DEBUG 1" >>confdefs.h + +fi + + + + + + + + + + + + + + +# Features +# lists +RAPTOR_PARSERS=$rdf_parsers_enabled + +RAPTOR_SERIALIZERS=$rdf_serializers_enabled + +# single values or none + + + +abs_top_srcdir=`cd $srcdir; pwd` + +abs_top_builddir=`pwd` + + +# Check whether --enable-silent-rules was given. +if test ${enable_silent_rules+y} +then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + + +ac_config_files="$ac_config_files Makefile raptor2.spec raptor2.rdf data/Makefile docs/Makefile docs/version.xml examples/Makefile scripts/Makefile src/raptor2.h src/Makefile tests/Makefile tests/feeds/Makefile tests/grddl/Makefile tests/ntriples/Makefile tests/ntriples-2013/Makefile tests/nquads-2013/Makefile tests/rdfa/Makefile tests/rdfa11/Makefile tests/json/Makefile tests/rdfxml/Makefile tests/turtle/Makefile tests/mkr/Makefile tests/turtle-2013/Makefile tests/trig/Makefile utils/Makefile librdfa/Makefile raptor2.pc" + + + + + + gtk_doc_requires="gtk-doc >= 1.3" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gtk-doc" >&5 +printf %s "checking for gtk-doc... " >&6; } + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$gtk_doc_requires\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$gtk_doc_requires") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + have_gtk_doc=yes +else + have_gtk_doc=no +fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $have_gtk_doc" >&5 +printf "%s\n" "$have_gtk_doc" >&6; } + + if test "$have_gtk_doc" = "no"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found." >&5 +printf "%s\n" "$as_me: WARNING: + You will not be able to create source packages with 'make dist' + because $gtk_doc_requires is not found." >&2;} + fi + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_GTKDOC_CHECK+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$GTKDOC_CHECK"; then + ac_cv_prog_GTKDOC_CHECK="$GTKDOC_CHECK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_GTKDOC_CHECK="gtkdoc-check.test" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GTKDOC_CHECK=$ac_cv_prog_GTKDOC_CHECK +if test -n "$GTKDOC_CHECK"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK" >&5 +printf "%s\n" "$GTKDOC_CHECK" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # Extract the first word of "gtkdoc-check", so it can be a program name with args. +set dummy gtkdoc-check; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GTKDOC_CHECK_PATH+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $GTKDOC_CHECK_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_CHECK_PATH="$GTKDOC_CHECK_PATH" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_CHECK_PATH="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_CHECK_PATH=$ac_cv_path_GTKDOC_CHECK_PATH +if test -n "$GTKDOC_CHECK_PATH"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_CHECK_PATH" >&5 +printf "%s\n" "$GTKDOC_CHECK_PATH" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + for ac_prog in gtkdoc-rebase +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GTKDOC_REBASE+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $GTKDOC_REBASE in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_REBASE="$GTKDOC_REBASE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_REBASE="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_REBASE=$ac_cv_path_GTKDOC_REBASE +if test -n "$GTKDOC_REBASE"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_REBASE" >&5 +printf "%s\n" "$GTKDOC_REBASE" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$GTKDOC_REBASE" && break +done +test -n "$GTKDOC_REBASE" || GTKDOC_REBASE="true" + + # Extract the first word of "gtkdoc-mkpdf", so it can be a program name with args. +set dummy gtkdoc-mkpdf; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_GTKDOC_MKPDF+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $GTKDOC_MKPDF in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTKDOC_MKPDF="$GTKDOC_MKPDF" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_GTKDOC_MKPDF="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GTKDOC_MKPDF=$ac_cv_path_GTKDOC_MKPDF +if test -n "$GTKDOC_MKPDF"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GTKDOC_MKPDF" >&5 +printf "%s\n" "$GTKDOC_MKPDF" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + +# Check whether --with-html-dir was given. +if test ${with_html_dir+y} +then : + withval=$with_html_dir; +else $as_nop + with_html_dir='${datadir}/gtk-doc/html' +fi + + HTML_DIR="$with_html_dir" + + + # Check whether --enable-gtk-doc was given. +if test ${enable_gtk_doc+y} +then : + enableval=$enable_gtk_doc; +else $as_nop + enable_gtk_doc=no +fi + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build gtk-doc documentation" >&5 +printf %s "checking whether to build gtk-doc documentation... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_gtk_doc" >&5 +printf "%s\n" "$enable_gtk_doc" >&6; } + + if test "x$enable_gtk_doc" = "xyes" && test "$have_gtk_doc" = "no"; then + as_fn_error $? " + You must have $gtk_doc_requires installed to build documentation for + $PACKAGE_NAME. Please install gtk-doc or disable building the + documentation by adding '--disable-gtk-doc' to '$0'." "$LINENO" 5 + fi + + if test "x$PACKAGE_NAME" != "xglib"; then + +pkg_failed=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTKDOC_DEPS" >&5 +printf %s "checking for GTKDOC_DEPS... " >&6; } + +if test -n "$GTKDOC_DEPS_CFLAGS"; then + pkg_cv_GTKDOC_DEPS_CFLAGS="$GTKDOC_DEPS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$GTKDOC_DEPS_LIBS"; then + pkg_cv_GTKDOC_DEPS_LIBS="$GTKDOC_DEPS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GTKDOC_DEPS_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` + else + GTKDOC_DEPS_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.10.0 gobject-2.0 >= 2.10.0" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$GTKDOC_DEPS_PKG_ERRORS" >&5 + + : +elif test $pkg_failed = untried; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + : +else + GTKDOC_DEPS_CFLAGS=$pkg_cv_GTKDOC_DEPS_CFLAGS + GTKDOC_DEPS_LIBS=$pkg_cv_GTKDOC_DEPS_LIBS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +fi + fi + + # Check whether --enable-gtk-doc-html was given. +if test ${enable_gtk_doc_html+y} +then : + enableval=$enable_gtk_doc_html; +else $as_nop + enable_gtk_doc_html=yes +fi + + # Check whether --enable-gtk-doc-pdf was given. +if test ${enable_gtk_doc_pdf+y} +then : + enableval=$enable_gtk_doc_pdf; +else $as_nop + enable_gtk_doc_pdf=no +fi + + + if test -z "$GTKDOC_MKPDF"; then + enable_gtk_doc_pdf=no + fi + + if test -z "$AM_DEFAULT_VERBOSITY"; then + AM_DEFAULT_VERBOSITY=1 + fi + + + if test x$have_gtk_doc = xyes; then + HAVE_GTK_DOC_TRUE= + HAVE_GTK_DOC_FALSE='#' +else + HAVE_GTK_DOC_TRUE='#' + HAVE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc = xyes; then + ENABLE_GTK_DOC_TRUE= + ENABLE_GTK_DOC_FALSE='#' +else + ENABLE_GTK_DOC_TRUE='#' + ENABLE_GTK_DOC_FALSE= +fi + + if test x$enable_gtk_doc_html = xyes; then + GTK_DOC_BUILD_HTML_TRUE= + GTK_DOC_BUILD_HTML_FALSE='#' +else + GTK_DOC_BUILD_HTML_TRUE='#' + GTK_DOC_BUILD_HTML_FALSE= +fi + + if test x$enable_gtk_doc_pdf = xyes; then + GTK_DOC_BUILD_PDF_TRUE= + GTK_DOC_BUILD_PDF_FALSE='#' +else + GTK_DOC_BUILD_PDF_TRUE='#' + GTK_DOC_BUILD_PDF_FALSE= +fi + + if test -n "$LIBTOOL"; then + GTK_DOC_USE_LIBTOOL_TRUE= + GTK_DOC_USE_LIBTOOL_FALSE='#' +else + GTK_DOC_USE_LIBTOOL_TRUE='#' + GTK_DOC_USE_LIBTOOL_FALSE= +fi + + if test -n "$GTKDOC_REBASE"; then + GTK_DOC_USE_REBASE_TRUE= + GTK_DOC_USE_REBASE_FALSE='#' +else + GTK_DOC_USE_REBASE_TRUE='#' + GTK_DOC_USE_REBASE_FALSE= +fi + + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RELEASE_VERSION_TRUE}" && test -z "${RELEASE_VERSION_FALSE}"; then + as_fn_error $? "conditional \"RELEASE_VERSION\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +if test -z "${NEED_STRTOK_R_TRUE}" && test -z "${NEED_STRTOK_R_FALSE}"; then + as_fn_error $? "conditional \"NEED_STRTOK_R\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${STRCASECMP_TRUE}" && test -z "${STRCASECMP_FALSE}"; then + as_fn_error $? "conditional \"STRCASECMP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GETOPT_TRUE}" && test -z "${GETOPT_FALSE}"; then + as_fn_error $? "conditional \"GETOPT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_RDFXML_TRUE}" && test -z "${RAPTOR_PARSER_RDFXML_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_RDFXML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_NTRIPLES_TRUE}" && test -z "${RAPTOR_PARSER_NTRIPLES_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_NTRIPLES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_TURTLE_TRUE}" && test -z "${RAPTOR_PARSER_TURTLE_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_TURTLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_TRIG_TRUE}" && test -z "${RAPTOR_PARSER_TRIG_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_TRIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_RSS_TRUE}" && test -z "${RAPTOR_PARSER_RSS_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_RSS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_GRDDL_TRUE}" && test -z "${RAPTOR_PARSER_GRDDL_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_GRDDL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_GUESS_TRUE}" && test -z "${RAPTOR_PARSER_GUESS_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_GUESS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_RDFA_TRUE}" && test -z "${RAPTOR_PARSER_RDFA_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_RDFA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_JSON_TRUE}" && test -z "${RAPTOR_PARSER_JSON_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_JSON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_PARSER_NQUADS_TRUE}" && test -z "${RAPTOR_PARSER_NQUADS_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_PARSER_NQUADS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBRDFA_TRUE}" && test -z "${LIBRDFA_FALSE}"; then + as_fn_error $? "conditional \"LIBRDFA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_RDFXML_TRUE}" && test -z "${RAPTOR_SERIALIZER_RDFXML_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_RDFXML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_NTRIPLES_TRUE}" && test -z "${RAPTOR_SERIALIZER_NTRIPLES_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_NTRIPLES\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE}" && test -z "${RAPTOR_SERIALIZER_RDFXML_ABBREV_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_RDFXML_ABBREV\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_TURTLE_TRUE}" && test -z "${RAPTOR_SERIALIZER_TURTLE_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_TURTLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_MKR_TRUE}" && test -z "${RAPTOR_SERIALIZER_MKR_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_MKR\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_RSS_1_0_TRUE}" && test -z "${RAPTOR_SERIALIZER_RSS_1_0_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_RSS_1_0\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_ATOM_TRUE}" && test -z "${RAPTOR_SERIALIZER_ATOM_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_ATOM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_DOT_TRUE}" && test -z "${RAPTOR_SERIALIZER_DOT_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_DOT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_HTML_TRUE}" && test -z "${RAPTOR_SERIALIZER_HTML_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_HTML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_JSON_TRUE}" && test -z "${RAPTOR_SERIALIZER_JSON_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_JSON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_SERIALIZER_NQUADS_TRUE}" && test -z "${RAPTOR_SERIALIZER_NQUADS_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_SERIALIZER_NQUADS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_RSS_COMMON_TRUE}" && test -z "${RAPTOR_RSS_COMMON_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_RSS_COMMON\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_ICU_NFC_TRUE}" && test -z "${RAPTOR_ICU_NFC_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_ICU_NFC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PARSEDATE_TRUE}" && test -z "${PARSEDATE_FALSE}"; then + as_fn_error $? "conditional \"PARSEDATE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${RAPTOR_XML_LIBXML_TRUE}" && test -z "${RAPTOR_XML_LIBXML_FALSE}"; then + as_fn_error $? "conditional \"RAPTOR_XML_LIBXML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${HAVE_GTK_DOC_TRUE}" && test -z "${HAVE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"HAVE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${ENABLE_GTK_DOC_TRUE}" && test -z "${ENABLE_GTK_DOC_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_GTK_DOC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_HTML_TRUE}" && test -z "${GTK_DOC_BUILD_HTML_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_HTML\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_BUILD_PDF_TRUE}" && test -z "${GTK_DOC_BUILD_PDF_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_BUILD_PDF\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_LIBTOOL_TRUE}" && test -z "${GTK_DOC_USE_LIBTOOL_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_LIBTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${GTK_DOC_USE_REBASE_TRUE}" && test -z "${GTK_DOC_USE_REBASE_FALSE}"; then + as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else $as_nop + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. +as_nl=' +' +export as_nl +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi + +# The user is always right. +if ${PATH_SEPARATOR+false} :; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + printf "%s\n" "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else $as_nop + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else $as_nop + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -pR'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -pR' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -pR' + fi +else + as_ln_s='cp -pR' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by Raptor RDF Parser and Serializer library $as_me 2.0.16, which was +generated by GNU Autoconf 2.71. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config='$ac_cs_config_escaped' +ac_cs_version="\\ +Raptor RDF Parser and Serializer library config.status 2.0.16 +configured by $0, generated by GNU Autoconf 2.71, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2021 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + printf "%s\n" "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + printf "%s\n" "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + printf "%s\n" "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + printf "%s\n" "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' +lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' +want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' +DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' +sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`' +nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' +lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' +lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' +configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +PATH_SEPARATOR \ +SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +FILECMD \ +OBJDUMP \ +deplibs_check_method \ +file_magic_cmd \ +file_magic_glob \ +want_nocaseglob \ +DLLTOOL \ +sharedlib_from_linklib_cmd \ +AR \ +archiver_list_spec \ +STRIP \ +RANLIB \ +CC \ +CFLAGS \ +compiler \ +lt_cv_sys_global_symbol_pipe \ +lt_cv_sys_global_symbol_to_cdecl \ +lt_cv_sys_global_symbol_to_import \ +lt_cv_sys_global_symbol_to_c_name_address \ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ +lt_cv_nm_interface \ +nm_file_list_spec \ +lt_cv_truncate_bin \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_pic \ +lt_prog_compiler_wl \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +MANIFEST_TOOL \ +DSYMUTIL \ +NMEDIT \ +LIPO \ +OTOOL \ +OTOOL64 \ +shrext_cmds \ +export_dynamic_flag_spec \ +whole_archive_flag_spec \ +compiler_needs_object \ +with_gnu_ld \ +allow_undefined_flag \ +no_undefined_flag \ +hardcode_libdir_flag_spec \ +hardcode_libdir_separator \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postlink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +configure_time_dlsearch_path \ +configure_time_lt_sys_library_path; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' + +# See if we are running on zsh, and set the options that allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + RM='$RM' + ofile='$ofile' + + + + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "src/raptor_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/raptor_config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "raptor2.spec") CONFIG_FILES="$CONFIG_FILES raptor2.spec" ;; + "raptor2.rdf") CONFIG_FILES="$CONFIG_FILES raptor2.rdf" ;; + "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;; + "docs/version.xml") CONFIG_FILES="$CONFIG_FILES docs/version.xml" ;; + "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; + "src/raptor2.h") CONFIG_FILES="$CONFIG_FILES src/raptor2.h" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + "tests/feeds/Makefile") CONFIG_FILES="$CONFIG_FILES tests/feeds/Makefile" ;; + "tests/grddl/Makefile") CONFIG_FILES="$CONFIG_FILES tests/grddl/Makefile" ;; + "tests/ntriples/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntriples/Makefile" ;; + "tests/ntriples-2013/Makefile") CONFIG_FILES="$CONFIG_FILES tests/ntriples-2013/Makefile" ;; + "tests/nquads-2013/Makefile") CONFIG_FILES="$CONFIG_FILES tests/nquads-2013/Makefile" ;; + "tests/rdfa/Makefile") CONFIG_FILES="$CONFIG_FILES tests/rdfa/Makefile" ;; + "tests/rdfa11/Makefile") CONFIG_FILES="$CONFIG_FILES tests/rdfa11/Makefile" ;; + "tests/json/Makefile") CONFIG_FILES="$CONFIG_FILES tests/json/Makefile" ;; + "tests/rdfxml/Makefile") CONFIG_FILES="$CONFIG_FILES tests/rdfxml/Makefile" ;; + "tests/turtle/Makefile") CONFIG_FILES="$CONFIG_FILES tests/turtle/Makefile" ;; + "tests/mkr/Makefile") CONFIG_FILES="$CONFIG_FILES tests/mkr/Makefile" ;; + "tests/turtle-2013/Makefile") CONFIG_FILES="$CONFIG_FILES tests/turtle-2013/Makefile" ;; + "tests/trig/Makefile") CONFIG_FILES="$CONFIG_FILES tests/trig/Makefile" ;; + "utils/Makefile") CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;; + "librdfa/Makefile") CONFIG_FILES="$CONFIG_FILES librdfa/Makefile" ;; + "raptor2.pc") CONFIG_FILES="$CONFIG_FILES raptor2.pc" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`printf "%s\n" "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + printf "%s\n" "/* $configure_input */" >&1 \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Older Autoconf quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac + shift + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf + do + # Strip MF so we end up with the name of the file. + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X"$am_mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +printf "%s\n" X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? + done + if test $am_rc -ne 0; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options that allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}"; then + setopt NO_GLOB_SUBST + fi + + cfgfile=${ofile}T + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL +# Generated automatically by $as_me ($PACKAGE) $VERSION +# NOTE: Changes made to this file will be lost: look at ltmain.sh. + +# Provide generalized library-building support services. +# Written by Gordon Matzigkeit, 1996 + +# Copyright (C) 2014 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool 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 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program or library that is built +# using GNU Libtool, you may include this file under the same +# distribution terms that you use for the rest of that program. +# +# GNU Libtool 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, see . + + +# The names of the tagged configurations supported by this script. +available_tags='' + +# Configured defaults for sys_lib_dlsearch_path munging. +: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} + +# ### BEGIN LIBTOOL CONFIG + +# Which release of libtool.m4 was used? +macro_version=$macro_version +macro_revision=$macro_revision + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# What type of objects to build. +pic_mode=$pic_mode + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# Shared archive member basename,for filename based shared library versioning on AIX. +shared_archive_member_spec=$shared_archive_member_spec + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# The PATH separator for the build system. +PATH_SEPARATOR=$lt_PATH_SEPARATOR + +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# A sed program that does not truncate output. +SED=$lt_SED + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="\$SED -e 1s/^X//" + +# A grep program that handles long lines. +GREP=$lt_GREP + +# An ERE matcher. +EGREP=$lt_EGREP + +# A literal string matcher. +FGREP=$lt_FGREP + +# A BSD- or MS-compatible name lister. +NM=$lt_NM + +# Whether we need soft or hard links. +LN_S=$lt_LN_S + +# What is the maximum length of a command? +max_cmd_len=$max_cmd_len + +# Object file suffix (normally "o"). +objext=$ac_objext + +# Executable file suffix (normally ""). +exeext=$exeext + +# whether the shell understands "unset". +lt_unset=$lt_unset + +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL + +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP + +# convert \$build file names to \$host format. +to_host_file_cmd=$lt_cv_to_host_file_cmd + +# convert \$build files to toolchain format. +to_tool_file_cmd=$lt_cv_to_tool_file_cmd + +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + +# An object symbol dumper. +OBJDUMP=$lt_OBJDUMP + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method + +# Command to use when deplibs_check_method = "file_magic". +file_magic_cmd=$lt_file_magic_cmd + +# How to find potential files when deplibs_check_method = "file_magic". +file_magic_glob=$lt_file_magic_glob + +# Find potential files using nocaseglob when deplibs_check_method = "file_magic". +want_nocaseglob=$lt_want_nocaseglob + +# DLL creation program. +DLLTOOL=$lt_DLLTOOL + +# Command to associate shared and link libraries. +sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd + +# The archiver. +AR=$lt_AR + +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + +# Flags to create an archive. +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} + +# How to feed a file listing to the archiver. +archiver_list_spec=$lt_archiver_list_spec + +# A symbol stripping program. +STRIP=$lt_STRIP + +# Commands used to install an old-style archive. +RANLIB=$lt_RANLIB +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm into a list of symbols to manually relocate. +global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name lister interface. +nm_interface=$lt_lt_cv_nm_interface + +# Specify filename containing input files for \$NM. +nm_file_list_spec=$lt_nm_file_list_spec + +# The root where to search for dependent libraries,and where our libraries should be installed. +lt_sysroot=$lt_sysroot + +# Command to truncate a binary pipe. +lt_truncate_bin=$lt_lt_cv_truncate_bin + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Manifest tool. +MANIFEST_TOOL=$lt_MANIFEST_TOOL + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Detected run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path + +# Explicit LT_SYS_LIBRARY_PATH set during ./configure time. +configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds + +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag + +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes +# DIR into the resulting binary and the resulting library dependency is +# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# library is relocated. +hardcode_direct_absolute=$hardcode_direct_absolute + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Set to "yes" if building a shared library automatically hardcodes DIR +# into the library and all subsequent libraries and executables linked +# against it. +hardcode_automatic=$hardcode_automatic + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds + +# Commands necessary for finishing linking programs. +postlink_cmds=$lt_postlink_cmds + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# ### END LIBTOOL CONFIG + +_LT_EOF + + cat <<'_LT_EOF' >> "$cfgfile" + +# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE + +# func_munge_path_list VARIABLE PATH +# ----------------------------------- +# VARIABLE is name of variable containing _space_ separated list of +# directories to be munged by the contents of PATH, which is string +# having a format: +# "DIR[:DIR]:" +# string "DIR[ DIR]" will be prepended to VARIABLE +# ":DIR[:DIR]" +# string "DIR[ DIR]" will be appended to VARIABLE +# "DIRP[:DIRP]::[DIRA:]DIRA" +# string "DIRP[ DIRP]" will be prepended to VARIABLE and string +# "DIRA[ DIRA]" will be appended to VARIABLE +# "DIR[:DIR]" +# VARIABLE will be replaced by "DIR[ DIR]" +func_munge_path_list () +{ + case x$2 in + x) + ;; + *:) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" + ;; + x:*) + eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" + ;; + *::*) + eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" + eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" + ;; + *) + eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" + ;; + esac +} + + +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +func_cc_basename () +{ + for cc_temp in $*""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac + done + func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +} + + +# ### END FUNCTIONS SHARED WITH CONFIGURE + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test set != "${COLLECT_NAMES+set}"; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + + +ltmain=$ac_aux_dir/ltmain.sh + + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + $SED '$q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" + + ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: +Raptor build summary: + RDF parsers available : $rdf_parsers_available + RDF parsers enabled :$rdf_parsers_enabled + RDF serializers available : $rdf_serializers_available + RDF serializers enabled :$rdf_serializers_enabled + XML parser : $xml_parser + WWW library : $www_library + NFC check library : $nfc_library +" >&5 +printf "%s\n" " +Raptor build summary: + RDF parsers available : $rdf_parsers_available + RDF parsers enabled :$rdf_parsers_enabled + RDF serializers available : $rdf_serializers_available + RDF serializers enabled :$rdf_serializers_enabled + XML parser : $xml_parser + WWW library : $www_library + NFC check library : $nfc_library +" >&6; } + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..da04890 --- /dev/null +++ b/configure.ac @@ -0,0 +1,1384 @@ +dnl -*- Mode: autoconf -*- +dnl +dnl configure.ac - autoconf file for Raptor +dnl (Process this file with autoconf to produce a configure script.) +dnl +dnl Copyright (C) 2000-2023 David Beckett https://www.dajobe.org/ +dnl Copyright (C) 2000-2005 University of Bristol, UK https://www.bristol.ac.uk/ +dnl +dnl This package is Free Software and part of Redland https://librdf.org/ +dnl +dnl It is licensed under the following three licenses as alternatives: +dnl 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +dnl 2. GNU General Public License (GPL) V2 or any newer version +dnl 3. Apache License, V2.0 or any newer version +dnl +dnl You may not use this file except in compliance with at least one of +dnl the above three licenses. +dnl +dnl See LICENSE.html or LICENSE.txt at the top of this package for the +dnl complete terms and further detail along with the license texts for +dnl the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +dnl +dnl + + +AC_PREREQ([2.62]) +AC_INIT([Raptor RDF Parser and Serializer library], [2.0.16], [https://bugs.librdf.org/], [raptor2]) +AC_CONFIG_SRCDIR([src/raptor_general.c]) +AC_CONFIG_HEADERS([src/raptor_config.h]) +AC_CONFIG_AUX_DIR(build) +AC_CONFIG_MACRO_DIR(build) +AM_INIT_AUTOMAKE([1.11 check-news std-options -Wobsolete -Wportability -Wsyntax -Wunsupported -Wextra-portability]) + +libxml_min_version=2.6.8 + +libxslt_min_version=1.0.18 + +libcurl_min_version=7.12.0 +libcurl_min_vernum=071200 + +AC_REVISION($Revision: $)dnl + +AM_MAINTAINER_MODE + +release_version=no +AC_ARG_ENABLE(release, [ --enable-release Turn on optimizations (for maintainer). ], \ + if test "$enableval" = "yes"; then \ + release_version=yes +fi;) + +AM_CONDITIONAL(RELEASE_VERSION, test $release_version = yes) +if test "$USE_MAINTAINER_MODE" = yes -a $release_version = no; then + dnl need to change quotes to allow square brackets + changequote(<<, >>)dnl + CFLAGS=`echo $CFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` + CXXFLAGS=`echo $CXXFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` + CPPFLAGS=`echo $CPPFLAGS | sed -e "s/-O[A-Za-z0-9]*//"` + changequote([, ])dnl +fi +RPM_RELEASE=SNAP +if test "$release_version" = "yes"; then + RPM_RELEASE=1 +fi +AC_SUBST(RPM_RELEASE) + + +dnl Checks for programs. +AC_CANONICAL_HOST +AM_SANITY_CHECK +AM_PROG_AR +AC_PROG_CC +AM_PROG_CC_C_O +AC_MSG_CHECKING(whether $CC is clang) +CC_IS_CLANG=no +if $CC 2>&1 | grep clang >/dev/null 2>&1; then + CC_IS_CLANG=yes +else + : +fi +AC_MSG_RESULT($CC_IS_CLANG) + +dnl Initialize libtool +LT_INIT + +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +FLEX_MIN_VERSION=2.5.19 +FLEX_REC_VERSION=2.5.36 + +# Do not want AM_PROG_LEX which adds 'missing' to LEX if it's not around +AC_PROG_LEX(noyywrap) +AC_MSG_CHECKING(flex) +if test "$USE_MAINTAINER_MODE" = yes; then + # maintainer mode - flex is required + if test "X$LEX" = "X:" ; then + AC_MSG_RESULT(not present) + AC_MSG_WARN(Please get flex from https://github.com/westes/flex) + AC_MSG_WARN(version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)) + AC_MSG_FAILURE(flex not present) + fi + + # some kind of lexer is present + if echo "$LEX" | grep flex >/dev/null 2>&1; then + # flex is present + FLEX_VERSION=`$LEX -V 2>&1 | $AWK '{print $2}'` + FLEX_VERSION_DEC=`echo $FLEX_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + + FLEX_MIN_VERSION_DEC=`echo $FLEX_MIN_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + + if test $FLEX_VERSION_DEC -ge $FLEX_MIN_VERSION_DEC; then + AC_MSG_RESULT($FLEX_VERSION - OK) + else + AC_MSG_RESULT(version $FLEX_VERSION - too old) + AC_MSG_WARN(Please get flex from https://github.com/westes/flex) + AC_MSG_WARN(version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)) + AC_MSG_FAILURE(flex is too old) + fi + else + AC_MSG_RESULT(present - but is not flex) + AC_MSG_WARN(Please get flex from https://github.com/westes/flex) + AC_MSG_WARN(version $FLEX_MIN_VERSION ($FLEX_REC_VERSION recommended)) + AC_MSG_FAILURE($LEX is not not flex) + fi +else + # not maintainer mode; flex is not required + AC_MSG_RESULT(not present - not required for non maintainer builds) + LEX="$SHELL $missing_dir/missing flex" + AC_SUBST(LEX_OUTPUT_ROOT, lex.yy) + AC_SUBST(LEXLIB, '') + FLEX_VERSION_DEC=00000 +fi +AC_DEFINE_UNQUOTED(FLEX_VERSION_DECIMAL, $FLEX_VERSION_DEC, [Flex version as a decimal]) + + +BISON_MIN_VERSION=3.4.0 +BISON_REC_VERSION=3.7.2 +BISON_MIN_VERSION_DEC=`echo $BISON_MIN_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + +if test "$USE_MAINTAINER_MODE" = yes; then + # Match these styles of versions + # GNU Bison version 1.28 + # bison (GNU Bison) 1.875 + AC_CACHE_CHECK([for GNU bison newer than $BISON_MIN_VERSION], [ac_cv_path_BISON], + [AC_PATH_PROGS_FEATURE_CHECK([BISON], [bison3 bison], + [[bison_version=`$ac_path_BISON --version 2>&1 | sed -ne 's/^.*GNU Bison[^0-9]*//p'` + bison_version_dec=`echo $bison_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + test "$bison_version_dec" -ge $BISON_MIN_VERSION_DEC \ + && ac_cv_path_BISON=$ac_path_BISON ac_cv_version_BISON=$bison_version ac_cv_version_dec_BISON=$bison_version_dec]], + [AC_MSG_ERROR([could not find new enough GNU Bison])])]) + AC_MSG_NOTICE([Using GNU Bison $ac_cv_version_BISON ($ac_cv_version_dec_BISON) at $ac_cv_path_BISON]) +else + # not maintainer mode, do not need bison + ac_cv_path_BISON=: +fi +AC_SUBST([BISON], [$ac_cv_path_BISON]) + +# Find a tar command for 'make dist' +AC_CHECK_PROGS(TAR, gnutar gtar tar) +AC_CHECK_PROGS(PERL, perl) +# Used in tests/feeds +AC_CHECK_PROGS(JING, jing) + +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) + +AC_CHECK_PROGS(RECHO, echo) +RECHO_C= +RECHO_N= +case `$RECHO -n x` in + -n*) + case `$RECHO 'xy\c'` in + *c*) + ;; + xy) + RECHO_C='\c' + ;; + esac;; + *) + RECHO_N='-n' + ;; +esac + + + +dnl compiler checks + +AC_DEFUN([REDLAND_CC_TRY_FLAG], [ + AC_MSG_CHECKING([whether $CC supports $1]) + + ## backup CFLAGS and werror status + redland_save_CFLAGS="$CFLAGS" + redland_save_ac_c_werror_flag="${ac_c_werror_flag}" + AC_LANG_WERROR + + CFLAGS="$CFLAGS $1" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([ ])], [redland_cc_flag=yes], [redland_cc_flag=no]) + + ## restore CFLAGS and werror status + CFLAGS="$redland_save_CFLAGS" + ac_c_werror_flag="${redland_save_ac_c_werror_flag}" + + if test "X$redland_cc_flag" = "Xyes"; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , :, [$3]) + fi + AC_MSG_RESULT($redland_cc_flag) +]) + +# GCC warning options +# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html +# +# Too noisy: +# -Wmissing-field-initializers : too noisy in raptor_rss_common.c +# -Wsystem-headers : not debugging system +# -Wunused-parameter : variables can be marked __attribute__('unused') +possible_warnings="\ +-std=c11 \ +-Wall \ +-Wc++-compat \ +-Wextra \ +-Wpedantic \ +-Wunused \ +\ +-Waggregate-return \ +-Wbad-function-cast \ +-Wcast-align \ +-Wdeclaration-after-statement \ +-Wdisabled-optimization \ +-Wdiv-by-zero \ +-Wendif-labels \ +-Werror-implicit-function-declaration \ +-Wfloat-equal \ +-Wformat=2 \ +-Wframe-larger-than=4096 \ +-Winit-self \ +-Winline \ +-Wmissing-declarations \ +-Wmissing-format-attribute \ +-Wmissing-noreturn \ +-Wmissing-prototypes \ +-Wnested-externs \ +-Wold-style-definition \ +-Wpacked \ +-Wpointer-arith \ +-Wredundant-decls \ +-Wshadow \ +-Wsign-compare \ +-Wstrict-overflow \ +-Wstrict-prototypes \ +-Wswitch-enum \ +-Wunreachable-code \ +-Wunsafe-loop-optimizations \ +-Wwrite-strings \ +\ +-Wno-missing-field-initializers \ +-Wno-system-headers \ +-Wno-unused-parameter \ +-Wswitch-bool \ +-Wlogical-not-parentheses \ +-Wsizeof-array-argument \ +-Wbool-compare \ +-Wc90-c99-compat \ +-Wc99-c11-compat \ +" + +extra_compiler_cflags="" + +# compiler specific warnings +if test $CC_IS_CLANG = yes; then + # Always enable this for Clang + # -Wno-nullability-completeness : too noisy on OSX reporting + # warnings in stdio.h + extra_compiler_cflags="$extra_compiler_cflags \ +-Wno-nullability-completeness \ +" +fi + +# OS specific warnings +case "${host_os}" in + darwin*) + # Apple gcc/clang specific: + # -Wshorten-64-to-32 + possible_warnings="$possible_warnings \ +-Wshorten-64-to-32 \ +" + ;; + *) + # -Wundef : too noisy on OSX 10.12+ e.g. stdio.h fails + possible_warnings="$possible_warnings \ +-Wundef \ +" + ;; +esac + +warning_cflags= +if test "$USE_MAINTAINER_MODE" = yes; then + AC_MSG_CHECKING(for supported $CC warning flags) + AC_MSG_RESULT($warning_cflags) + for warning in $possible_warnings; do + REDLAND_CC_TRY_FLAG([$warning], [warning_cflags="$warning_cflags $warning"]) + done + AC_MSG_CHECKING($CC supports warning flags) + AC_MSG_RESULT($warning_cflags) +fi + +if test "$USE_MAINTAINER_MODE" = yes; then + AC_DEFINE([MAINTAINER_MODE], [1], [Define to 1 if maintainer mode is enabled.]) + CPPFLAGS="$warning_cflags $CPPFLAGS" +fi +# Extra compiler flags to always add +CPPFLAGS="$extra_compiler_cflags $CPPFLAGS" + + +dnl Checks for header files. +AC_CHECK_HEADERS(errno.h fcntl.h getopt.h limits.h setjmp.h stddef.h stdlib.h strings.h string.h sys/param.h sys/stat.h sys/time.h time.h unistd.h) +AC_CHECK_FUNCS(stat) +dnl FreeBSD fetch.h needs stdio.h and sys/param.h first +AC_CHECK_HEADERS(fetch.h,,, + [#include +#ifdef HAVE_SYS_PARAM_H +#include +#endif +]) + + + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_BIGENDIAN +AC_C_INLINE + +AC_MSG_CHECKING(whether __FUNCTION__ is available) +AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include +int main(void) { printf(__FUNCTION__); }])], + [AC_DEFINE([HAVE___FUNCTION__], [1], [Is __FUNCTION__ available]) + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) + + +dnl need to change quotes to allow square brackets +changequote(<<, >>)dnl +version_major=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\1/'` +version_minor=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\2/'` +version_release=`echo $VERSION | sed -e 's/^\([^\.]*\)\.\([^\.]*\)\.\(.*\)$/\3/'` +changequote([, ])dnl + +version_decimal=`expr $version_major \* 10000 + $version_minor \* 100 + $version_release` + +# The minimum runtime API version that is supported. MUST be updated at +# an API break as well as changing the libtool version +min_version_decimal=20000 + +AC_DEFINE_UNQUOTED(RAPTOR_VERSION_MAJOR, $version_major, [Major version number]) +AC_DEFINE_UNQUOTED(RAPTOR_VERSION_MINOR, $version_minor, [Minor version number]) +AC_DEFINE_UNQUOTED(RAPTOR_VERSION_RELEASE, $version_release, [Release version number]) +AC_DEFINE_UNQUOTED(RAPTOR_VERSION_DECIMAL, $version_decimal, [Release version as a decimal]) +AC_DEFINE_UNQUOTED(RAPTOR_MIN_VERSION_DECIMAL, $min_version_decimal, [Minimum supported package version]) + +# for raptor-config.in +RAPTOR_VERSION_MAJOR=$version_major +RAPTOR_VERSION_MINOR=$version_minor +RAPTOR_VERSION_RELEASE=$version_release +RAPTOR_VERSION_DECIMAL=$version_decimal +AC_SUBST(RAPTOR_VERSION) +AC_SUBST(RAPTOR_VERSION_MAJOR) +AC_SUBST(RAPTOR_VERSION_MINOR) +AC_SUBST(RAPTOR_VERSION_RELEASE) +AC_SUBST(RAPTOR_VERSION_DECIMAL) + +# Libtool versioning +# +# CURRENT +# The most recent interface number that this library implements. +# +# REVISION +# The implementation number of the CURRENT interface. +# +# AGE +# The difference between the newest and oldest interfaces that this +# library implements. In other words, the library implements all the +# interface numbers in the range from number `CURRENT - AGE' to +# `CURRENT'. +# +# Rules: +# 1. Start with version information of `0:0:0' for each libtool library. +# +# 2. Update the version information only immediately before a public +# release of your software. More frequent updates are unnecessary, +# and only guarantee that the current interface number gets larger +# faster. +# +# 3. If the library source code has changed at all since the last +# update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). +# +# 4. If any interfaces have been added, removed, or changed since the +# last update, increment CURRENT, and set REVISION to 0. +# +# 5. If any interfaces have been added since the last public release, +# then increment AGE. +# +# 6. If any interfaces have been removed since the last public release, +# then set AGE to 0. +# +# syntax: CURRENT[:REVISION[:AGE]] +RAPTOR_LIBTOOL_VERSION=0:0:0 +AC_SUBST(RAPTOR_LIBTOOL_VERSION) + + +dnl Checks for library functions. +AC_CHECK_FUNCS(gettimeofday getopt getopt_long vsnprintf isascii setjmp qsort_r qsort_s stricmp strcasecmp) + +AC_MSG_CHECKING(strtok_r) +have_strtok_r=no +AC_COMPILE_IFELSE([AC_LANG_SOURCE([ +#ifdef HAVE_STRING_H +#include +#endif +int main(void) { return strtok_r(); } +])], + [AC_MSG_RESULT(yes) + have_strtok_r=yes + AC_DEFINE([HAVE_STRTOK_R], [1], [have the strtok_r function])], + [AC_MSG_RESULT(no)]) + +dnl librdfa +AM_CONDITIONAL([NEED_STRTOK_R], [test "$have_strtok_r" = "no"]) + +dnl Check for GNU extension functions +oCPPFLAGS="$CPPFLAGS" +CPPFLAGS="-D_GNU_SOURCE $CPPFLAGS" +AC_CHECK_FUNCS(vasprintf) +CPPFLAGS="$oCPPFLAGS" + + +AM_CONDITIONAL(STRCASECMP, test $ac_cv_func_strcasecmp = no -a $ac_cv_func_stricmp = no) +AM_CONDITIONAL(GETOPT, test $ac_cv_func_getopt = no -a $ac_cv_func_getopt_long = no) + + +AC_MSG_CHECKING(whether need to declare optind) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_GETOPT_H +#include +#endif]], [[int x=optind;]])], + [AC_MSG_RESULT(no)], + [AC_DEFINE([NEED_OPTIND_DECLARATION], [1], [need 'extern int optind' declaration?]) + AC_MSG_RESULT(yes)]) + + + +if test $ac_cv_func_vsnprintf = yes; then + AC_MSG_CHECKING([whether vsnprintf has C99 compatible return value]) + AC_RUN_IFELSE([AC_LANG_SOURCE([[#include +#ifdef HAVE_STDLIB_H +#include +#endif +#include + +static int is_c99(char *buf, char *s, ...) { + va_list args; + int r; + va_start(args, s); + r = vsnprintf(buf, buf ? 5 : 0, s, args); + va_end(args); + + return (r == 7); +} + +int main(void) { + char buffer[32]; + return (is_c99(NULL, "1234567") ? 0 : 10) + + (is_c99(buffer, "1234567") ? 0 : 1); +}]])], + [AC_DEFINE([HAVE_C99_VSNPRINTF], [1], [vsnprintf has C99 compatible return value]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])], + [AC_DEFINE([CHECK_VSNPRINTF_RUNTIME], [1], [have to check C99 vsnprintf at runtime because cross compiling])]) +fi + +# Save LIBS +oLIBS="$LIBS" + +RAPTOR_LDFLAGS= + +AC_SYS_LARGEFILE + + +PKG_PROG_PKG_CONFIG + +PKG_CONFIG_REQUIRES= + +dnl libxml - required +AC_ARG_WITH(xml2-config, [ --with-xml2-config=PATH Location of libxml xml2-config []], xml2_config="$withval", xml2_config="") + +if test "X$xml2_config" != "Xno" ; then + if test "X$xml2_config" != "X" ; then + AC_MSG_CHECKING(for $xml2_config) + + if test -x $xml2_config ; then + XML_CONFIG=$xml2_config + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR([xml2-config not found at specified path $xml2_config]) + fi + fi + if test "X$XML_CONFIG" = "X" ; then + AC_CHECK_PROGS(XML_CONFIG, xml2-config) + fi +fi + +libxml_source=no +if test "X$XML_CONFIG" != "X"; then + LIBXML_CFLAGS=`$XML_CONFIG --cflags` + LIBXML_LIBS=`$XML_CONFIG --libs` + + CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" + LIBS="$LIBS $LIBXML_LIBS" + AC_CHECK_FUNC(xmlCreatePushParserCtxt, have_xmlCreatePushParserCtxt=yes, have_xmlCreatePushParserCtxt=no) + + AC_MSG_CHECKING(for libxml via xml2-config) + if test $have_xmlCreatePushParserCtxt = yes; then + libxml_source="xml2-config" + LIBXML_VERSION=`$XML_CONFIG --version` + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" +else + PKG_CHECK_MODULES([LIBXML],[libxml-2.0],[ + LIBXML_VERSION=`$PKG_CONFIG libxml-2.0 --modversion` + libxml_source="pkg-config" + ], [:]) + AC_MSG_CHECKING(for libxml via pkg-config) +fi + +if test "$libxml_source" != "no"; then + AC_MSG_RESULT(yes - $LIBXML_VERSION) +else + AC_MSG_RESULT(no - not found) +fi + + +dnl xslt +AC_ARG_WITH(xslt-config, [ --with-xslt-config=PATH Location of libxslt xslt-config []], xslt_config="$withval", xslt_config="") + +if test "X$xslt_config" != "Xno" ; then + if test "X$xslt_config" != "X" ; then + AC_MSG_CHECKING(for $xslt_config) + + if test -x $xslt_config ; then + XSLT_CONFIG=$xslt_config + AC_MSG_RESULT(yes) + else + AC_MSG_ERROR([xslt-config not found at specified path $xslt_config]) + fi + fi + if test "X$XSLT_CONFIG" = "X" ; then + AC_CHECK_PROGS(XSLT_CONFIG, xslt-config) + fi +fi + +if test "X$XSLT_CONFIG" != "X"; then + XSLT_CFLAGS=`$XSLT_CONFIG --cflags` + XSLT_LIBS=`$XSLT_CONFIG --libs` + + CPPFLAGS="$XSLT_CFLAGS $CPPFLAGS" + LIBS="$LIBS $XSLT_LIBS" + + AC_CHECK_FUNC(xsltSaveResultToString, have_xsltSaveResultToString=yes, have_xsltSaveResultToString=no) + AC_MSG_CHECKING(for libxslt via xslt-config) + if test $have_xsltSaveResultToString = yes; then + have_libxslt=1 + LIBXSLT_VERSION=`$XSLT_CONFIG --version` + libxslt_version_dec=`echo $LIBXSLT_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + libxslt_min_version_dec=`echo $libxslt_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + 3)};'` + AC_MSG_RESULT(yes - version $LIBXSLT_VERSION) + if test $libxslt_version_dec -lt $libxslt_min_version_dec; then + AC_MSG_WARN(Using libxslt $LIBXSLT_VERSION is unsupported - $libxslt_min_version or newer required.) + have_libxslt=0 + fi + fi + + AC_CHECK_FUNC(xsltInit) + + AC_CHECK_HEADERS(libxslt/xslt.h) + if test "$ac_cv_header_libxslt_xslt_h" = no ; then + AC_MSG_WARN(libxslt library found but not headers - disabling) + have_libxslt_lib=0 + have_libxslt=0 + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" +else + PKG_CHECK_MODULES([XSLT], [libxslt > $libxslt_min_version], [have_libxslt=1], [have_libxslt=0]) +fi + +dnl curl +AC_ARG_WITH(curl-config, [ --with-curl-config=PATH Location of libcurl curl-config []], curl_config="$withval", curl_config="") + +if test "X$curl_config" != "Xno" ; then + if test "X$curl_config" != "X" ; then + AC_MSG_CHECKING(for $curl_config) + + if test -f $curl_config ; then + CURL_CONFIG=$curl_config + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no - searching PATH) + fi + fi + if test "X$CURL_CONFIG" = "X" ; then + AC_CHECK_PROGS(CURL_CONFIG, curl-config) + fi +fi + +libcurl_source=no +if test "X$CURL_CONFIG" != "X"; then + LIBCURL_CFLAGS=`$CURL_CONFIG --cflags` + LIBCURL_LIBS=`$CURL_CONFIG --libs` + + CPPFLAGS="$LIBCURL_CFLAGS $CPPFLAGS" + LIBS="$LIBS $LIBCURL_LIBS" + AC_CHECK_HEADER(curl/curl.h) + AC_CHECK_FUNC(curl_easy_init, have_curl_easy_init=yes, have_curl_easy_init=no) + + AC_MSG_CHECKING(for libcurl via curl-config) + if test $have_curl_easy_init = yes; then + libcurl_source="curl-config" + LIBCURL_VERSION=`$CURL_CONFIG --version | sed -e 's/^libcurl *//'` + fi + CPPFLAGS="$oCPPFLAGS" + LIBS="$oLIBS" +else + PKG_CHECK_MODULES([LIBCURL],[libcurl],[ + LIBCURL_VERSION=`$PKG_CONFIG libcurl --modversion` + libcurl_source="pkg-config" + ], [:]) + AC_MSG_CHECKING(for libcurl via pkg-config) +fi + +if test "$libcurl_source" = "no"; then + AC_MSG_RESULT(no - not found) +else + AC_MSG_RESULT(yes - $LIBCURL_VERSION) +fi + +PKG_CHECK_MODULES([ICU], [icu-uc], [ + have_icu=yes + ICU_UC_VERSION=`$PKG_CONFIG icu-uc --modversion` +], [have_icu=no]) +ICU_UC_MAJOR_VERSION=`echo "$ICU_UC_VERSION" | sed -e 's/\..*$//'` +AC_DEFINE_UNQUOTED(ICU_UC_MAJOR_VERSION, $ICU_UC_MAJOR_VERSION, [ICU UC major version]) + +AC_ARG_WITH(www-config, [ --with-libwww-config=PATH Location of W3C libwww libwww-config []], libwww_config="$withval", libwww_config="") + +if test "X$libwww_config" != "Xno" -a "X$libwww_config" != "X" ; then + AC_MSG_WARN(libwww is no longer supported) +fi + + +have_libxml=0 +need_libxml=0 + +oCPPFLAGS="$CPPFLAGS" +if test "X$libxml_source" != X; then + CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" + LIBS="$LIBS $LIBXML_LIBS" + AC_CHECK_FUNC(xmlCreatePushParserCtxt, have_xmlCreatePushParserCtxt=yes, have_xmlCreatePushParserCtxt=no) + AC_MSG_CHECKING(libxml library) + if test $have_xmlCreatePushParserCtxt = yes; then + have_libxml=1 + libxml_version_dec=`echo $LIBXML_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + libxml_min_version_dec=`echo $libxml_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + AC_MSG_RESULT(yes - version $LIBXML_VERSION) + if test $libxml_version_dec -lt $libxml_min_version_dec; then + AC_MSG_WARN(Using libxml $LIBXML_VERSION is unsupported - $libxml_min_version or newer required.) + have_libxml=0 + fi + else + AC_MSG_RESULT(no) + fi + + AC_CHECK_HEADERS(libxml/nanohttp.h) + AC_CHECK_HEADERS(libxml/parser.h) + AC_CHECK_HEADERS(libxml/hash.h libxml/SAX2.h,,, + [#ifdef HAVE_LIBXML_PARSER_H +#include +#endif +]) + + if test "$ac_cv_header_libxml_parser_h" = no -a "$ac_cv_header_gnome_xml_parser_h" = no; then + AC_MSG_WARN(libxml library found but not headers - disabling) + have_libxml=0 + else + AC_MSG_CHECKING(if libxml xmlEntity has name_length field) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif +]], [[xmlEntity foo; foo.name_length=0]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([RAPTOR_LIBXML_ENTITY_NAME_LENGTH], [1], [does libxml struct xmlEntity have a field name_length])], + [AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(if libxml xmlEntity has etype field) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif +]], [[xmlEntity foo; foo.etype=0]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([RAPTOR_LIBXML_ENTITY_ETYPE], [1], [does libxml struct xmlEntity have a field etype])], + [AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(if libxml xmlSAXHandler has initialized field) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif +]], [[xmlSAXHandler foo; foo.initialized=0]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED], [1], [does libxml xmlSAXHandler have initialized field])], + [AC_MSG_RESULT(no)]) + + AC_MSG_CHECKING(if libxml xmlSAXHandler has externalSubset field) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif +]], [[xmlSAXHandler foo; foo.externalSubset=NULL]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET], [1], [does libxml xmlSAXHandler have externalSubset field])], + [AC_MSG_RESULT(no)]) + + AC_CHECK_FUNCS(xmlSAX2InternalSubset xmlCtxtUseOptions) + + AC_MSG_CHECKING(if libxml has parser option XML_PARSE_NONET) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_LIBXML_PARSER_H +#include +#endif +]], [[xmlParserOption foo; foo = XML_PARSE_NONET]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([RAPTOR_LIBXML_XML_PARSE_NONET], [1], [does libxml have XML_PARSE_NONET])], + [AC_MSG_RESULT(no)]) + AC_CHECK_HEADERS(libxml/HTMLparser.h) + AC_MSG_CHECKING(if libxml has parser option HTML_PARSE_NONET) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef HAVE_LIBXML_HTMLPARSER_H +#include +#endif +]], [[htmlParserOption foo; foo = HTML_PARSE_NONET]])], + [AC_MSG_RESULT(yes) + AC_DEFINE([RAPTOR_LIBXML_HTML_PARSE_NONET], [1], [does libxml have HTML_PARSE_NONET])], + [AC_MSG_RESULT(no)]) + fi + +fi +CPPFLAGS="$oCPPFLAGS" +LIBS="$oLIBS" + +dnl Check for JSON library + +AC_ARG_WITH(yajl, [ --with-yajl=DIR YAJL installation directory or 'no' to disable (default=auto)], yajl_prefix="$withval", yajl_prefix="none") + +if test "x$yajl_prefix" != "xno" ; then + AC_MSG_CHECKING(for yajl installation) + + if test "x$yajl_prefix" = "xyes" ; then + yajl_prefix="none" + fi + + # Nothing given - search + if test "X$yajl_prefix" = "Xnone" ; then + for dir in /opt/local /usr/local /usr; do + if test -r $dir/include/yajl/yajl_parse.h; then + yajl_prefix=$dir + break + fi + done + fi + + if test "X$yajl_prefix" = "Xnone" ; then + AC_MSG_RESULT(not found. Get it from https://lloyd.github.com/yajl/ and use --with-yajl=DIR if necessary to configure the installation directory.) + else + AC_MSG_RESULT($yajl_prefix) + + if test "$yajl_prefix" = "/usr"; then + yajl_prefix= + else + LDFLAGS="-L$yajl_prefix/lib $LDFLAGS" + CPPFLAGS="-I$yajl_prefix/include $CPPFLAGS" + fi + + AC_CHECK_LIB(yajl, yajl_parse, libyajl=1, libyajl=0) + AC_CHECK_LIB(yajl, yajl_tree_parse, yajl_api_version=2, yajl_api_version=1) + AC_CHECK_HEADERS(yajl/yajl_parse.h) + + AC_MSG_CHECKING(YAJL API version) + AC_MSG_RESULT($yajl_api_version) + if test $yajl_api_version = 2; then + AC_DEFINE_UNQUOTED(HAVE_YAJL2, 1, [YAJL has API version 2]) + fi + + fi +fi +CPPFLAGS="$oCPPFLAGS" +LIBS="$oLIBS" + + +dnl RDF Parsers +rdfxml_parser=no +ntriples_parser=no +turtle_parser=no +trig_parser=no +rss_parser=no +grddl_parser=no +guess_parser=yes +rdfa_parser=no +json_parser=no +nquads_parser=no + +rdf_parsers_available="rdfxml ntriples turtle trig guess rss-tag-soup rdfa nquads" +rdf_parsers_enabled= + + +grddl_parser_ok=no +AC_MSG_CHECKING(GRDDL parser requirements) +if test $have_libxml = 1 -a $have_libxslt = 1; then + AC_MSG_RESULT(yes) + grddl_parser_ok=yes + rdf_parsers_available="$rdf_parsers_available grddl" +else + AC_MSG_RESULT(no - libxml2 and libxslt are both not available) +fi + +json_parser_ok=no +AC_MSG_CHECKING(JSON parser requirements) +if test "X$ac_cv_header_yajl_yajl_parse_h" = Xyes -a "X$ac_cv_lib_yajl_yajl_parse" = Xyes; then + AC_MSG_RESULT(yes) + json_parser_ok=yes + rdf_parsers_available="$rdf_parsers_available json" +else + AC_MSG_RESULT(no - libyajl is not available) +fi + + + +# This is needed because autoheader can't work out which computed +# symbols must be pulled from acconfig.h into config.h.in +if test "x" = "y"; then + AC_DEFINE(RAPTOR_PARSER_RDFXML, 1, [Building RDF/XML parser]) + AC_DEFINE(RAPTOR_PARSER_NTRIPLES, 1, [Building N-Triples parser]) + AC_DEFINE(RAPTOR_PARSER_TURTLE, 1, [Building Turtle parser]) + AC_DEFINE(RAPTOR_PARSER_TRIG, 1, [Building TRiG parser]) + AC_DEFINE(RAPTOR_PARSER_RSS, 1, [Building RSS Tag Soup parser]) + AC_DEFINE(RAPTOR_PARSER_GRDDL, 1, [Building GRDDL parser]) + AC_DEFINE(RAPTOR_PARSER_GUESS, 1, [Building guess parser]) + AC_DEFINE(RAPTOR_PARSER_RDFA, 1, [Building RDFA parser]) + AC_DEFINE(RAPTOR_PARSER_JSON, 1, [Building JSON parser]) + AC_DEFINE(RAPTOR_PARSER_NQUADS, 1, [Building N-Quads parser]) +fi + +AC_MSG_CHECKING(RDF parsers required) +AC_ARG_ENABLE(parsers, [ --enable-parsers=LIST Use RDF parsers (default=all)], parsers="$enableval") +if test "X$parsers" = Xall -o "X$parsers" = X; then + parsers="$rdf_parsers_available" + AC_MSG_RESULT(all) +elif test "X$parsers" = Xnone; then + parsers= + AC_MSG_RESULT(none) +else + AC_MSG_RESULT($parsers) +fi + +for parser in $parsers; do + p=$parser + if test $p = rss-tag-soup; then + p=rss + fi + + if test $p = grddl; then + if test $grddl_parser_ok != yes; then + AC_MSG_WARN(GRDDL parser is not available) + continue + fi + fi + + if test $p = json; then + if test $json_parser_ok != yes; then + AC_MSG_WARN(YAJL is not available) + continue + fi + fi + + eval $p'_parser=yes' + NAME=`echo $p | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + n=RAPTOR_PARSER_${NAME} + AC_DEFINE_UNQUOTED($n) + rdf_parsers_enabled="$rdf_parsers_enabled $parser" +done + +use_nfc=no +if test $rdfxml_parser = yes; then + need_libxml=1 + use_nfc=yes +fi + +if test $rss_parser = yes; then + need_libxml=1 +fi + +need_libxslt=0 +if test $grddl_parser = yes; then + need_libxml=1 + need_libxslt=1 +fi + +need_librdfa=no +if test $rdfa_parser = yes; then + need_libxml=1 + need_librdfa=yes +fi + +need_libyajl=0 +if test $json_parser = yes; then + need_libyajl=1 +fi + +AM_CONDITIONAL(RAPTOR_PARSER_RDFXML, test $rdfxml_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_NTRIPLES, test $ntriples_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_TURTLE, test $turtle_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_TRIG, test $trig_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_RSS, test $rss_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_GRDDL, test $grddl_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_GUESS, test $guess_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_RDFA, test $rdfa_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_JSON, test $json_parser = yes) +AM_CONDITIONAL(RAPTOR_PARSER_NQUADS, test $nquads_parser = yes) + +AM_CONDITIONAL(LIBRDFA, test $need_librdfa = yes) + + +dnl RDF Serializers +rdfxml_serializer=no +ntriples_serializer=no +rdfxml_abbrev_serializer=no +turtle_serializer=no +mkr_serializer=no +rss_1_0_serializer=no +atom_serializer=no +dot_serializer=no +html_serializer=no +json_serializer=no +nquads_serializer=no + +rdf_serializers_available="rdfxml rdfxml-abbrev turtle mkr ntriples rss-1.0 dot html json atom nquads" + +# This is needed because autoheader can't work out which computed +# symbols must be pulled from acconfig.h into config.h.in +if test "x" = "y"; then + AC_DEFINE(RAPTOR_SERIALIZER_RDFXML, 1, [Building RDF/XML serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_NTRIPLES, 1, [Building N-Triples serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_RDFXML_ABBREV, 1, [Building RDF/XML-abbreviated serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_TURTLE, 1, [Building Turtle serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_MKR, 1, [Building mKR serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_RSS_1_0, 1, [Building RSS 1.0 serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_ATOM, 1, [Building Atom 1.0 serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_DOT, 1, [Building GraphViz DOT serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_HTML, 1, [Building HTML Table serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_JSON, 1, [Building JSON serializer]) + AC_DEFINE(RAPTOR_SERIALIZER_NQUADS, 1, [Building N-Quads serializer]) +fi + +AC_MSG_CHECKING(RDF serializers required) +AC_ARG_ENABLE(serializers, [ --enable-serializers=LIST Use RDF serializers (default=all)], serializers="$enableval") +if test "X$serializers" = Xall -o "X$serializers" = X; then + serializers="$rdf_serializers_available" + AC_MSG_RESULT(all) +elif test "X$serializers" = Xnone; then + serializers= + AC_MSG_RESULT(none) +else + AC_MSG_RESULT($serializers) +fi + +for serializer in $serializers; do + s=`echo $serializer | tr '.-' '__'` + eval $s'_serializer=yes' + NAME=`echo $s | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + n=RAPTOR_SERIALIZER_${NAME} + AC_DEFINE_UNQUOTED($n) + rdf_serializers_enabled="$rdf_serializers_enabled $serializer" +done + +AM_CONDITIONAL(RAPTOR_SERIALIZER_RDFXML, test $rdfxml_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_NTRIPLES, test $ntriples_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_RDFXML_ABBREV, test $rdfxml_abbrev_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_TURTLE, test $turtle_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_MKR, test $mkr_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_RSS_1_0, test $rss_1_0_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_ATOM, test $atom_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_DOT, test $dot_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_HTML, test $html_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_JSON, test $json_serializer = yes) +AM_CONDITIONAL(RAPTOR_SERIALIZER_NQUADS, test $nquads_serializer = yes) + +AM_CONDITIONAL(RAPTOR_RSS_COMMON, test $rss_1_0_serializer = yes -o $rss_parser = yes) + +dnl Enable NFC code only if enabled and used (rdfxml) +need_icu=no +if test $use_nfc = yes -a $have_icu = yes; then + need_icu=yes + AC_DEFINE([RAPTOR_ICU_NFC], 1, [Use ICU for Unicode NFC check]) +fi +AM_CONDITIONAL(RAPTOR_ICU_NFC, test $need_icu = yes) + + + +AC_MSG_CHECKING(XML names version) +AC_ARG_WITH(xml-names, [ --with-xml-names=1.1|1.0 Select XML version name checking (default=1.0)], xml_names="$withval", xml_names="1.0") +if test $xml_names = 1.1; then + AC_DEFINE(RAPTOR_XML_1_1, 1, [Check XML 1.1 Names]) +fi +AC_MSG_RESULT($xml_names) + + +have_libcurl=0 +have_libfetch=0 +need_libcurl=0 +need_libxml_www=0 +need_libfetch=0 + +if test "X$CURL_CONFIG" != X; then + CPPFLAGS="$CPPFLAGS $LIBCURL_CFLAGS" + LIBS="$LIBS $LIBCURL_LIBS" + AC_CHECK_HEADER(curl/curl.h) + AC_CHECK_FUNC(curl_easy_init, have_curl_easy_init=yes, have_curl_easy_init=no) + + AC_MSG_CHECKING(for libcurl library) + if test $have_curl_easy_init = yes -a "$ac_cv_header_curl_curl_h" = yes; then + libcurl_min_version_dec=`echo $libcurl_min_version | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + libcurl_version_dec=`echo $LIBCURL_VERSION | $AWK -F. '{printf("%d\n", 10000*$1 + 100*$2 + $3)};'` + if test $libcurl_version_dec -lt $libcurl_min_version_dec; then + AC_MSG_WARN(Using libcurl $LIBCURL_VERSION is unsupported - $libcurl_min_version or newer required.) + AC_MSG_RESULT(no - version $LIBCURL_VERSION is too old) + else + have_libcurl=1 + AC_MSG_RESULT(yes - version $LIBCURL_VERSION via $libcurl_source) + fi + else + AC_MSG_RESULT(no) + fi +fi +LIBS="$oLIBS" +CPPFLAGS="$oCPPFLAGS" + + +if test "X$ac_cv_header_curl_curl_h" = Xyes; then + AC_DEFINE([HAVE_CURL_CURL_H], 1, [Have curl/curl.h]) +fi + +if test $ac_cv_header_fetch_h = yes; then + AC_CHECK_LIB(fetch, fetchXGetURL, have_libfetch=1) + LIBS="$oLIBS" +fi + + +AC_ARG_WITH(www, [ --with-www=NAME Use WWW library - curl (default), xml, libfetch, none], www="$withval", www="curl") + +for www_name in $www curl xml libfetch none; do + case $www_name in + curl) + if test $have_libcurl = 1; then + need_libcurl=1 + AC_DEFINE([RAPTOR_WWW_LIBCURL], 1, [Have libcurl WWW library]) + break + fi + ;; + + xml) + if test $have_libxml = 1; then + need_libxml=1 + need_libxml_www=1 + AC_DEFINE([RAPTOR_WWW_LIBXML], 1, [Have libxml available as a WWW library]) + break + fi + ;; + + libfetch) + if test $have_libfetch = 1; then + need_libfetch=1 + AC_DEFINE([RAPTOR_WWW_LIBFETCH], 1, [Have libfetch WWW library]) + break + fi + ;; + + none|no) + need_libcurl=0 + need_libxml_www=0 + AC_DEFINE([RAPTOR_WWW_NONE], 1, [No WWW library]) + break + ;; + + *) + AC_MSG_ERROR(No such WWW library $www_name) + ;; +esac +done + +AC_MSG_CHECKING(WWW libraries available) +www_libraries_available= +if test $have_libcurl = 1; then + www_libraries_available="$www_libraries_available libcurl $LIBCURL_VERSION" +fi +if test $have_libxml = 1; then + www_libraries_available="$www_libraries_available libxml $LIBXML_VERSION" +fi +if test $have_libfetch = 1; then + www_libraries_available="$www_libraries_available libfetch" +fi +AC_MSG_RESULT($www_libraries_available) + + +AC_MSG_CHECKING(WWW library to use) +www_library= +RAPTOR_WWW_LIBRARY=none +if test $need_libcurl = 1; then + www_library="libcurl $LIBCURL_VERSION via $libcurl_source" + RAPTOR_WWW_LIBRARY=libcurl +elif test $need_libxml_www = 1; then + www_library="libxml $LIBXML_VERSION via $libxml_source" + RAPTOR_WWW_LIBRARY=libxml +elif test $need_libfetch = 1; then + www_library="libfetch" + RAPTOR_WWW_LIBRARY=libfetch +else + www_library=none +fi +AC_MSG_RESULT($www_library) +if test "X$www_library" = Xnone; then + AC_MSG_WARN([No WWW library in use - only file: URLs will work]) + AC_MSG_WARN([Install libcurl, libxml2 or BSD libfetch for WWW access]) +fi + +if test $need_libcurl = 1; then + CPPFLAGS="$CPPFLAGS $LIBCURL_CFLAGS" + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $LIBCURL_LIBS" + + if test libcurl_source = "pkg-config"; then + if test "X$PKG_CONFIG_REQUIRES" != X; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libcurl >= $libcurl_min_version" + fi + + AC_LIBOBJ(raptor_www_curl) +fi + + +dnl ICU for NFC check +AC_MSG_CHECKING(NFC library to use) +nfc_library=none +if test $need_icu = yes; then + CPPFLAGS="$CPPFLAGS $ICU_CFLAGS" + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $ICU_LIBS" + AC_LIBOBJ(raptor_nfc_icu) + nfc_library="ICU UC $ICU_UC_VERSION" +fi +AC_MSG_RESULT($nfc_library) + + +have_lininn=no +have_inn_parsedate=no + +oCPPFLAGS="$CPPFLAGS" +if test -d /usr/include/inn; then + CPPFLAGS="$CPPFLAGS -I/usr/include/inn" +fi +AC_CHECK_HEADER(libinn.h) +CPPFLAGS="$oCPPFLAGS" + +oCPPFLAGS="$CPPFLAGS" +if test $ac_cv_header_libinn_h = yes; then + CPPFLAGS="$CPPFLAGS -I/usr/include/inn" + LIBS="$LIBS -L/usr/lib/news -linn" + AC_CHECK_LIB(inn, HashMessageID, have_libinn=yes) + + AC_MSG_CHECKING(parsedate in libinn) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif +#include +]], [[ parsedate("Sun Jun 12 00:04:09 BST 2005", NULL) ]])], + [AC_DEFINE([HAVE_INN_PARSEDATE], [1], [INN parsedate function present]) + have_inn_parsedate=yes + AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no)]) +fi +CPPFLAGS="$oCPPFLAGS" +LIBS="$oLIBS" + + +AC_MSG_CHECKING(date parsing source) +raptor_parsedate_needed=no +if test $have_inn_parsedate = yes; then + CPPFLAGS="$CPPFLAGS -I/usr/include/inn" + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS -L/usr/lib/news -linn" + AC_MSG_RESULT(INN parsedate) +else + if test $need_libcurl = 1; then + AC_MSG_RESULT(libcurl curl_getdate) + else + raptor_parsedate_needed=yes + AC_MSG_RESULT(raptor parsedate) + fi +fi + +AM_CONDITIONAL(PARSEDATE, test $raptor_parsedate_needed = yes) +if test $raptor_parsedate_needed = yes; then + AC_DEFINE([HAVE_RAPTOR_PARSE_DATE], 1, [Raptor raptor_parse_date available]) +fi + + +if test $need_libfetch = 1; then + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS -lfetch" + AC_LIBOBJ(raptor_www_libfetch) +fi + + +RAPTOR_XML_PARSER=none +if test $need_libxml = 1; then + if test $have_libxml = 1; then + AC_DEFINE(RAPTOR_XML_LIBXML, 1, [Use libxml XML parser]) + else + AC_MSG_ERROR(libxml2 is not available - please get it from https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home) + fi + if test $need_libxml_www = 1; then + AC_LIBOBJ(raptor_www_libxml) + fi + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $LIBXML_LIBS" + CPPFLAGS="$LIBXML_CFLAGS $CPPFLAGS" + + if test libxml_source = "pkg-config"; then + if test "X$PKG_CONFIG_REQUIRES" != X; then + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," + fi + PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libxml-2.0 >= $libxml_min_version" + fi + RAPTOR_XML_PARSER=libxml +fi +AM_CONDITIONAL(RAPTOR_XML_LIBXML, test $need_libxml = 1) + + +if test $need_libxslt = 1; then + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS $XSLT_LIBS" + CPPFLAGS="$CPPFLAGS $XSLT_CFLAGS" +fi + +if test $need_libyajl = 1; then + if test "x$yajl_prefix" != "x"; then + CPPFLAGS="-I$yajl_prefix/include $CPPFLAGS" + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS -L$yajl_prefix/lib" + fi + RAPTOR_LDFLAGS="$RAPTOR_LDFLAGS -lyajl" +fi + +RAPTOR_LIBTOOLLIBS=libraptor2.la +AC_SUBST(RAPTOR_LIBTOOLLIBS) + + +xml_parser="none needed" +if test $need_libxml = 1; then + xml_parser="libxml $LIBXML_VERSION via $libxml_source" +fi + + +# Restore LIBS +LIBS="$oLIBS" + +# Make final changes to cflags +MEM= +MEM_LIBS= +CPPFLAGS="-DRAPTOR_INTERNAL=1 $CPPFLAGS" + +AC_ARG_WITH(memory-signing, [ --with-memory-signing Sign allocated memory (default=no)], use_memory_signing="$withval", use_memory_signing="no") +AC_MSG_CHECKING(using memory signing) +AC_MSG_RESULT($use_memory_signing); +if test "$use_memory_signing" = yes; then + MEM=-DRAPTOR_MEMORY_SIGN=1 + MEM_LIBS= +fi + +debug_messages=no + +AC_ARG_ENABLE(debug, [ --enable-debug Enable debug messages (default no). ], debug_messages=$enableval) +if test "$debug_messages" = "yes"; then + AC_DEFINE([RAPTOR_DEBUG], [1], [Define to 1 if debug messages are enabled.]) +fi + + + +AC_SUBST(RAPTOR_LDFLAGS) + +AC_SUBST(PKG_CONFIG_REQUIRES) + +AC_SUBST(MEM) +AC_SUBST(MEM_LIBS) + +AC_SUBST(RECHO) +AC_SUBST(RECHO_N) +AC_SUBST(RECHO_C) + +# Features +# lists +RAPTOR_PARSERS=$rdf_parsers_enabled +AC_SUBST(RAPTOR_PARSERS) +RAPTOR_SERIALIZERS=$rdf_serializers_enabled +AC_SUBST(RAPTOR_SERIALIZERS) +# single values or none +AC_SUBST(RAPTOR_WWW_LIBRARY) +AC_SUBST(RAPTOR_XML_PARSER) + +abs_top_srcdir=`cd $srcdir; pwd` +AC_SUBST(abs_top_srcdir) +abs_top_builddir=`pwd` +AC_SUBST(abs_top_builddir) + +dnl automake 1.11 +AM_SILENT_RULES([no]) + +AC_CONFIG_FILES([Makefile +raptor2.spec +raptor2.rdf +data/Makefile +docs/Makefile +docs/version.xml +examples/Makefile +scripts/Makefile +src/raptor2.h +src/Makefile +tests/Makefile +tests/feeds/Makefile +tests/grddl/Makefile +tests/ntriples/Makefile +tests/ntriples-2013/Makefile +tests/nquads-2013/Makefile +tests/rdfa/Makefile +tests/rdfa11/Makefile +tests/json/Makefile +tests/rdfxml/Makefile +tests/turtle/Makefile +tests/mkr/Makefile +tests/turtle-2013/Makefile +tests/trig/Makefile +utils/Makefile +librdfa/Makefile +raptor2.pc]) + +dnl Check for gtk-doc and docbook +GTK_DOC_CHECK([1.3]) + +AC_OUTPUT + +AC_MSG_RESULT([ +Raptor build summary: + RDF parsers available : $rdf_parsers_available + RDF parsers enabled :$rdf_parsers_enabled + RDF serializers available : $rdf_serializers_available + RDF serializers enabled :$rdf_serializers_enabled + XML parser : $xml_parser + WWW library : $www_library + NFC check library : $nfc_library +]) diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..508a53a --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1 @@ +EXTRA_DIST=dc.rdf diff --git a/data/Makefile.in b/data/Makefile.in new file mode 100644 index 0000000..560fac7 --- /dev/null +++ b/data/Makefile.in @@ -0,0 +1,492 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = data +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = dc.rdf +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu data/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/data/dc.rdf b/data/dc.rdf new file mode 100644 index 0000000..d0799b6 --- /dev/null +++ b/data/dc.rdf @@ -0,0 +1,8 @@ + + + + Dave Beckett's Home Page + Dave Beckett + + diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..54dc0b8 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,158 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor docs +# +# Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + + +# The name of the module. +DOC_MODULE=raptor2 + +# The top-level SGML file. +DOC_MAIN_SGML_FILE=raptor-docs.xml + +# Extra options to supply to gtkdoc-scan +SCAN_OPTIONS= --deprecated-guards="RAPTOR_DISABLE_DEPRECATED" + +# The directory containing the source code. Relative to $(srcdir) +DOC_SOURCE_DIR=../src + +# Used for dependencies +HFILE_GLOB=$(builddir)/raptor-fake.h +CFILE_GLOB=$(top_srcdir)/src/raptor_*.c + +IGNORE_CFILES= \ +n3_lexer.c \ +n3_parser.c \ +raptor_nfc_test.c \ +raptor_rss_common.c \ +raptor_xsd.c \ +turtle_lexer.c \ +turtle_parser.c \ +turtle_common.c \ +parsedate.c \ +strcasecmp.c + +# Use fixed version of raptor2.h +EXTRA_HFILES=$(builddir)/raptor-fake.h + +# Headers to ignore: yes raptor2.h is intended to be in this list +# since it is added as a fixed file raptor-fake.h by EXTRA_HFILES above +IGNORE_HFILES= \ + n3_common.h \ + n3_lexer.h \ + n3_parser.h \ + parsedate.h \ + raptor.h \ + raptor2.h \ + raptor_config.h \ + raptor_internal.h \ + raptor_nfc.h \ + raptor_rss.h \ + turtle_common.h \ + turtle_lexer.h \ + turtle_parser.h \ + git-version.h + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +AM_CPPFLAGS = +GTKDOC_LIBS = + +# Extra options to supply to gtkdoc-mkdb +MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files="$(IGNORE_CFILES)" + +# Extra options to supply to gtkdoc-mktmpl +MKTMPL_OPTIONS= + +# Non-autogenerated (XML, other) files to be included in $(DOC_MAIN_SGML_FILE) +content_files = \ + raptor-changes.xml \ + raptor-formats.xml \ + raptor-parsers.xml \ + raptor-serializers.xml \ + raptor-tutorial-intro.xml \ + raptor-tutorial-querying-functionality.xml \ + raptor-tutorial-parsing.xml \ + raptor-tutorial-serializing.xml \ + version.xml \ + rdfprint.c \ + rdfcat.c \ + rdfserialize.c + +# Images to copy into HTML directory +HTML_IMAGES = + +# Extra options to supply to gtkdoc-fixref +FIXXREF_OPTIONS= + +# gtkdoc might not define this +DISTCLEANFILES= + +include $(top_srcdir)/gtk-doc.make + +man_MANS = libraptor2.3 + +EXTRA_DIST+= \ +libraptor2.html \ +raptor1-eol.html \ +$(man_MANS) \ +version.xml.in \ +upgrade-script.pl \ +raptor-changes.tsv + +DISTCLEANFILES+= \ +raptor-fake.h + +raptor-fake.h: $(top_builddir)/src/raptor2.h $(top_srcdir)/scripts/fix-gtkdoc-header.pl + $(PERL) $(top_srcdir)/scripts/fix-gtkdoc-header.pl < $< > $@ + +if MAINTAINER_MODE +libraptor2.html: $(srcdir)/libraptor2.3 $(top_srcdir)/scripts/fix-groff-xhtml.pl + -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(top_srcdir)/scripts/fix-groff-xhtml.pl $@ + +rdfcat.c: $(top_srcdir)/examples/rdfcat.c + $(install_sh_DATA) $? $@ + +rdfprint.c: $(top_srcdir)/examples/rdfprint.c + $(install_sh_DATA) $? $@ + +rdfserialize.c: $(top_srcdir)/examples/rdfserialize.c + $(install_sh_DATA) $? $@ + +raptor-tutorial-parsing.xml: rdfcat.c + +raptor-tutorial-serializing.xml: rdfprint.c rdfserialize.c + +raptor-changes.xml: $(srcdir)/raptor-changes.tsv $(top_srcdir)/scripts/process-changes.pl + $(PERL) $(top_srcdir)/scripts/process-changes.pl --docbook-xml $@ $(PACKAGE) $(srcdir)/raptor-changes.tsv + +raptor-formats.xml: $(top_builddir)/scripts/build-formats$(EXEEXT) + $(top_builddir)/scripts/build-formats$(EXEEXT) > $@ + +$(top_builddir)/scripts/build-formats$(EXEEXT): + cd $(top_builddir)/scripts && $(MAKE) build-formats$(EXEEXT) + +upgrade-script.pl: $(top_srcdir)/scripts/process-changes.pl $(srcdir)/raptor-changes.tsv + $(PERL) $(top_srcdir)/scripts/process-changes.pl --upgrade-script $@ $(PACKAGE) $(srcdir)/raptor-changes.tsv + +endif + +dist-hook-local: docs diff --git a/docs/Makefile.in b/docs/Makefile.in new file mode 100644 index 0000000..25d896c --- /dev/null +++ b/docs/Makefile.in @@ -0,0 +1,1023 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor docs +# +# Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +# -*- mode: makefile -*- +# +# gtk-doc.make - make rules for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2004-2007 Damon Chaplin +# 2007-2017 Stefan Sauer +# +# 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 3 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, see . + +#################################### +# Everything below here is generic # +#################################### +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = docs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = version.xml +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man3dir = $(mandir)/man3 +am__installdirs = "$(DESTDIR)$(man3dir)" +NROFF = nroff +MANS = $(man_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/version.xml.in \ + $(top_srcdir)/gtk-doc.make +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# The name of the module. +DOC_MODULE = raptor2 + +# The top-level SGML file. +DOC_MAIN_SGML_FILE = raptor-docs.xml + +# Extra options to supply to gtkdoc-scan +SCAN_OPTIONS = --deprecated-guards="RAPTOR_DISABLE_DEPRECATED" + +# The directory containing the source code. Relative to $(srcdir) +DOC_SOURCE_DIR = ../src + +# Used for dependencies +HFILE_GLOB = $(builddir)/raptor-fake.h +CFILE_GLOB = $(top_srcdir)/src/raptor_*.c +IGNORE_CFILES = \ +n3_lexer.c \ +n3_parser.c \ +raptor_nfc_test.c \ +raptor_rss_common.c \ +raptor_xsd.c \ +turtle_lexer.c \ +turtle_parser.c \ +turtle_common.c \ +parsedate.c \ +strcasecmp.c + + +# Use fixed version of raptor2.h +EXTRA_HFILES = $(builddir)/raptor-fake.h + +# Headers to ignore: yes raptor2.h is intended to be in this list +# since it is added as a fixed file raptor-fake.h by EXTRA_HFILES above +IGNORE_HFILES = \ + n3_common.h \ + n3_lexer.h \ + n3_parser.h \ + parsedate.h \ + raptor.h \ + raptor2.h \ + raptor_config.h \ + raptor_internal.h \ + raptor_nfc.h \ + raptor_rss.h \ + turtle_common.h \ + turtle_lexer.h \ + turtle_parser.h \ + git-version.h + + +# CFLAGS and LDFLAGS for compiling scan program. Only needed +# if $(DOC_MODULE).types is non-empty. +AM_CPPFLAGS = +GTKDOC_LIBS = + +# Extra options to supply to gtkdoc-mkdb +MKDB_OPTIONS = --sgml-mode --output-format=xml --ignore-files="$(IGNORE_CFILES)" + +# Extra options to supply to gtkdoc-mktmpl +MKTMPL_OPTIONS = + +# Non-autogenerated (XML, other) files to be included in $(DOC_MAIN_SGML_FILE) +content_files = \ + raptor-changes.xml \ + raptor-formats.xml \ + raptor-parsers.xml \ + raptor-serializers.xml \ + raptor-tutorial-intro.xml \ + raptor-tutorial-querying-functionality.xml \ + raptor-tutorial-parsing.xml \ + raptor-tutorial-serializing.xml \ + version.xml \ + rdfprint.c \ + rdfcat.c \ + rdfserialize.c + + +# Images to copy into HTML directory +HTML_IMAGES = + +# Extra options to supply to gtkdoc-fixref +FIXXREF_OPTIONS = + +# gtkdoc might not define this +DISTCLEANFILES = raptor-fake.h +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +@GTK_DOC_USE_LIBTOOL_FALSE@GTKDOC_RUN = +@GTK_DOC_USE_LIBTOOL_TRUE@GTKDOC_RUN = $(LIBTOOL) --mode=execute + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) +TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) +SETUP_FILES = \ + $(content_files) \ + $(expand_content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +EXTRA_DIST = $(HTML_IMAGES) $(SETUP_FILES) libraptor2.html \ + raptor1-eol.html $(man_MANS) version.xml.in upgrade-script.pl \ + raptor-changes.tsv +DOC_STAMPS = setup-build.stamp scan-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + sgml.stamp html.stamp pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).actions \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test +@GTK_DOC_BUILD_HTML_FALSE@HTML_BUILD_STAMP = +@GTK_DOC_BUILD_HTML_TRUE@HTML_BUILD_STAMP = html-build.stamp +@GTK_DOC_BUILD_PDF_FALSE@PDF_BUILD_STAMP = +@GTK_DOC_BUILD_PDF_TRUE@PDF_BUILD_STAMP = pdf-build.stamp + +#### setup #### +GTK_DOC_V_SETUP = $(GTK_DOC_V_SETUP_@AM_V@) +GTK_DOC_V_SETUP_ = $(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) +GTK_DOC_V_SETUP_0 = @echo " DOC Preparing build"; + +#### scan #### +GTK_DOC_V_SCAN = $(GTK_DOC_V_SCAN_@AM_V@) +GTK_DOC_V_SCAN_ = $(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) +GTK_DOC_V_SCAN_0 = @echo " DOC Scanning header files"; +GTK_DOC_V_INTROSPECT = $(GTK_DOC_V_INTROSPECT_@AM_V@) +GTK_DOC_V_INTROSPECT_ = $(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) +GTK_DOC_V_INTROSPECT_0 = @echo " DOC Introspecting gobjects"; + +#### xml #### +GTK_DOC_V_XML = $(GTK_DOC_V_XML_@AM_V@) +GTK_DOC_V_XML_ = $(GTK_DOC_V_XML_@AM_DEFAULT_V@) +GTK_DOC_V_XML_0 = @echo " DOC Building XML"; + +#### html #### +GTK_DOC_V_HTML = $(GTK_DOC_V_HTML_@AM_V@) +GTK_DOC_V_HTML_ = $(GTK_DOC_V_HTML_@AM_DEFAULT_V@) +GTK_DOC_V_HTML_0 = @echo " DOC Building HTML"; +GTK_DOC_V_XREF = $(GTK_DOC_V_XREF_@AM_V@) +GTK_DOC_V_XREF_ = $(GTK_DOC_V_XREF_@AM_DEFAULT_V@) +GTK_DOC_V_XREF_0 = @echo " DOC Fixing cross-references"; + +#### pdf #### +GTK_DOC_V_PDF = $(GTK_DOC_V_PDF_@AM_V@) +GTK_DOC_V_PDF_ = $(GTK_DOC_V_PDF_@AM_DEFAULT_V@) +GTK_DOC_V_PDF_0 = @echo " DOC Building PDF"; +man_MANS = libraptor2.3 +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/gtk-doc.make $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu docs/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; +$(top_srcdir)/gtk-doc.make $(am__empty): + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +version.xml: $(top_builddir)/config.status $(srcdir)/version.xml.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man3: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man3dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man3dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man3dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.3[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man3dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man3dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man3dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man3dir)" || exit $$?; }; \ + done; } + +uninstall-man3: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man3dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.3[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^3][0-9a-z]*$$,3,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man3dir)'; $(am__uninstall_files_from_dir) +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook +check-am: all-am +check: check-am +@ENABLE_GTK_DOC_FALSE@all-local: +all-am: Makefile $(MANS) all-local +installdirs: + for dir in "$(DESTDIR)$(man3dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-local + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man3 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic \ + maintainer-clean-local + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local uninstall-man + +uninstall-man: uninstall-man3 + +.MAKE: install-am install-strip + +.PHONY: all all-am all-local check check-am clean clean-generic \ + clean-libtool clean-local cscopelist-am ctags-am dist-hook \ + distclean distclean-generic distclean-libtool distclean-local \ + distdir dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-data-local \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-man3 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + maintainer-clean-local mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-local uninstall-man uninstall-man3 + +.PRECIOUS: Makefile + + +gtkdoc-check.test: Makefile + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ + chmod +x $@ + +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +.PHONY: all-gtk-doc + +@ENABLE_GTK_DOC_TRUE@all-local: all-gtk-doc + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +setup-build.stamp: + -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ + fi + $(AM_V_at)touch setup-build.stamp + +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) + $(GTK_DOC_V_SCAN)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + $(AM_V_at)touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent + $(GTK_DOC_V_XML)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + $(AM_V_at)touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +$(DOC_MAIN_SGML_FILE): sgml-build.stamp + @true + +xml/gtkdocentities.ent: Makefile + $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + ) > $@ + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ + mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$$?" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + -@test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + test -f $$file && cp $$file $(abs_builddir)/html; \ + done; + $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + $(AM_V_at)touch html-build.stamp + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ + mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + $(AM_V_at)touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @rm -rf .libs + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ + rm -f $(DOC_MODULE).types; \ + fi + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ + rm -f $(DOC_MODULE)-sections.txt; \ + fi + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +@HAVE_GTK_DOC_TRUE@dist-check-gtkdoc: docs +@HAVE_GTK_DOC_FALSE@dist-check-gtkdoc: +@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc is needed to run 'make dist'. ***" +@HAVE_GTK_DOC_FALSE@ @echo "*** gtk-doc was not found when 'configure' ran. ***" +@HAVE_GTK_DOC_FALSE@ @echo "*** please install gtk-doc and rerun 'configure'. ***" +@HAVE_GTK_DOC_FALSE@ @false + +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local + @mkdir $(distdir)/html + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs + +raptor-fake.h: $(top_builddir)/src/raptor2.h $(top_srcdir)/scripts/fix-gtkdoc-header.pl + $(PERL) $(top_srcdir)/scripts/fix-gtkdoc-header.pl < $< > $@ + +@MAINTAINER_MODE_TRUE@libraptor2.html: $(srcdir)/libraptor2.3 $(top_srcdir)/scripts/fix-groff-xhtml.pl +@MAINTAINER_MODE_TRUE@ -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(top_srcdir)/scripts/fix-groff-xhtml.pl $@ + +@MAINTAINER_MODE_TRUE@rdfcat.c: $(top_srcdir)/examples/rdfcat.c +@MAINTAINER_MODE_TRUE@ $(install_sh_DATA) $? $@ + +@MAINTAINER_MODE_TRUE@rdfprint.c: $(top_srcdir)/examples/rdfprint.c +@MAINTAINER_MODE_TRUE@ $(install_sh_DATA) $? $@ + +@MAINTAINER_MODE_TRUE@rdfserialize.c: $(top_srcdir)/examples/rdfserialize.c +@MAINTAINER_MODE_TRUE@ $(install_sh_DATA) $? $@ + +@MAINTAINER_MODE_TRUE@raptor-tutorial-parsing.xml: rdfcat.c + +@MAINTAINER_MODE_TRUE@raptor-tutorial-serializing.xml: rdfprint.c rdfserialize.c + +@MAINTAINER_MODE_TRUE@raptor-changes.xml: $(srcdir)/raptor-changes.tsv $(top_srcdir)/scripts/process-changes.pl +@MAINTAINER_MODE_TRUE@ $(PERL) $(top_srcdir)/scripts/process-changes.pl --docbook-xml $@ $(PACKAGE) $(srcdir)/raptor-changes.tsv + +@MAINTAINER_MODE_TRUE@raptor-formats.xml: $(top_builddir)/scripts/build-formats$(EXEEXT) +@MAINTAINER_MODE_TRUE@ $(top_builddir)/scripts/build-formats$(EXEEXT) > $@ + +@MAINTAINER_MODE_TRUE@$(top_builddir)/scripts/build-formats$(EXEEXT): +@MAINTAINER_MODE_TRUE@ cd $(top_builddir)/scripts && $(MAKE) build-formats$(EXEEXT) + +@MAINTAINER_MODE_TRUE@upgrade-script.pl: $(top_srcdir)/scripts/process-changes.pl $(srcdir)/raptor-changes.tsv +@MAINTAINER_MODE_TRUE@ $(PERL) $(top_srcdir)/scripts/process-changes.pl --upgrade-script $@ $(PACKAGE) $(srcdir)/raptor-changes.tsv + +dist-hook-local: docs + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/docs/html/home.png b/docs/html/home.png new file mode 100644 index 0000000..3966a91 Binary files /dev/null and b/docs/html/home.png differ diff --git a/docs/html/index.html b/docs/html/index.html new file mode 100644 index 0000000..53824b7 --- /dev/null +++ b/docs/html/index.html @@ -0,0 +1,249 @@ + + + + +Raptor RDF Syntax Library Manual: Raptor RDF Syntax Library Manual + + + + + + + +
+
+
+
+
+

+Dave Beckett +

+ +
+

Manual for Raptor 2.0.16 +

+
+
+
+

+ This documentation is Free Software / Open Source - you can + redistribute it and/or modify it under the same licenses as + Raptor. + It is licensed under the following three licenses as alternatives: +

+
    +
  1. GNU Lesser General Public License (LGPL) V2.1 or any newer version

  2. +
  3. GNU General Public License (GPL) V2 or any newer version

  4. +
  5. Apache License, V2.0 or any newer version

  6. +
+

+ You may not use this documentation except in compliance with at + least one of the above three licenses. See the + Raptor + site for the full license terms. +

+
+
+
+
+
+
Raptor Overview
+
I. Raptor Tutorial
+
+
Initialising and Finishing using the Library
+
Listing built-in functionality
+
Parsing syntaxes to RDF Triples
+
+
Introduction
+
Create the Parser object
+
Parser options
+
Set RDF statement callback handler
+
Set parsing log message handlers
+
Set the identifier creator handler
+
Set namespace declared handler
+
Set the parsing strictness
+
Provide syntax content to parse
+
+
Parse the content from a URI (raptor_parser_parse_uri())
+
Parse the content of a URI using an existing WWW connection (raptor_parser_parse_uri_with_connection())
+
Parse the content of a C FILE* (raptor_parser_parse_file_stream())
+
Parse the content of a file URI (raptor_parser_parse_file())
+
Parse chunks of syntax content provided by the application (raptor_parser_parse_start() and raptor_parser_parse_chunk())
+
+
Restrict parser network access
+
+
Filtering parser network requests with option RAPTOR_OPTION_NO_NET
+
Filtering parser network requests with raptor_www_set_uri_filter()
+
Filtering parser network requests with raptor_parser_set_uri_filter()
+
Setting timeout for parser network requests with option RAPTOR_OPTION_WWW_TIMEOUT
+
+
Querying parser static information
+
Querying parser run-time information
+
Aborting parsing
+
Destroy the parser
+
Parsing example code
+
+
Serializing RDF triples to a syntax
+
+
Introduction
+
Create the Serializer object
+
Serializer options
+
Declare namespaces
+
Set error and warning handlers
+
Provide a destination for the serialized syntax
+
+
Serialize to a filename (raptor_serializer_start_to_filename())
+
Serialize to a string (raptor_serializer_start_to_string())
+
Serialize to a FILE* file handle (raptor_serializer_start_to_file_handle())
+
Serialize to an raptor_iostream (raptor_serializer_start_to_iostream())
+
+
Get or construct RDF Statements (Triples)
+
Send RDF Triples to serializer
+
Querying serializer run-time information
+
Destroy the serializer
+
Serializing example code
+
+
+
II. Raptor Reference Manual
+
+
Parsers in Raptor (syntax to triples)
+
+
Introduction
+
GRDDL parser (name grddl)
+
Guess parser (name guess)
+
JSON parser (name json)
+
N-Triples parser (name ntriples)
+
RDFa parser - (name rdfa)
+
RDF/XML parser - default (name rdfxml)
+
RSS Tag Soup parser (name rss-tag-soup)
+
TRiG parser (name trig)
+
Turtle Terse RDF Triple Language parser (name turtle)
+
+
Serializers in Raptor (triples to syntax)
+
+
Introduction
+
Atom 1.0 serializer (name atom)
+
JSON serializers (name json and name json-triples)
+
mKR serializer - default (name mkr)
+
N-Quads serializer - default (name nquads)
+
N-Triples serializer - default (name ntriples)
+
RDF/XML serializer (name rdfxml)
+
RDF/XML (Abbreviated) serializer (name rdfxml-abbrev)
+
RDF/XML (XMP Profile) serializer (name rdfxml-xmp)
+
Turtle serializer (name turtle)
+
RSS 1.0 serializer (name rss-1.0)
+
GraphViz dot serializer (name dot)
+
+
+section-world +
+
+section-general +
+
+section-memory +
+
+section-avltree +
+
+section-constants +
+
+section-option +
+
+section-iostream +
+
+section-locator +
+
+section-parser +
+
+section-sax2 +
+
+section-sequence +
+
+section-serializer +
+
+section-stringbuffer +
+
+section-triples +
+
+section-unicode +
+
+section-uri +
+
+section-www +
+
+section-xml-namespace +
+
+section-xml-qname +
+
+section-xml +
+
Syntax Formats supported in Raptor
+
+
Introduction
+
MIME Types by Parser
+
MIME Types by Serializer
+
MIME Types Index
+
+
API Changes
+
+
Introduction
+
Changes between raptor2 1.4.21 and 2.0.0
+
+
New functions, types, enums and constants
+
Deleted functions, types, enums and constants
+
Renamed functions, enums and constants
+
Changed functions and types
+
+
Changes between raptor2 2.0.3 and 2.0.4
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.4 and 2.0.5
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.5 and 2.0.6
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.6 and 2.0.7
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.7 and 2.0.8
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.9 and 2.0.10
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.10 and 2.0.11
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.11 and 2.0.12
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.13 and 2.0.14
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.14 and 2.0.15
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.15 and 2.0.16
+
+
New functions, types, enums and constants
+
Deleted functions, types, enums and constants
+
+
+
+
Index
+
+
+ + + \ No newline at end of file diff --git a/docs/html/introduction.html b/docs/html/introduction.html new file mode 100644 index 0000000..c3ea48d --- /dev/null +++ b/docs/html/introduction.html @@ -0,0 +1,38 @@ + + + + +Raptor Overview: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Raptor Overview

+

+Raptor +is a free software / Open Source C library that provides +a set of parsers and serializers that +generate Resource Description Framework (RDF) triples +by parsing syntaxes or serialize the triples into a syntax. +It also includes supporting functionality for managing Unicode, +UTF-8, URIs, retrieving from URIs and reading and writing XML. +

+
+ + + \ No newline at end of file diff --git a/docs/html/ix01.html b/docs/html/ix01.html new file mode 100644 index 0000000..e42ebd2 --- /dev/null +++ b/docs/html/ix01.html @@ -0,0 +1,887 @@ + + + + +Index: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + +
+

+Index

+
+

R

+
+
raptor_alloc_memory, raptor_alloc_memory () +
+
raptor_avltree, raptor_avltree +
+
raptor_avltree_add, raptor_avltree_add () +
+
raptor_avltree_bitflags, enum raptor_avltree_bitflags +
+
raptor_avltree_delete, raptor_avltree_delete () +
+
raptor_avltree_iterator, raptor_avltree_iterator +
+
raptor_avltree_iterator_get, raptor_avltree_iterator_get () +
+
raptor_avltree_iterator_is_end, raptor_avltree_iterator_is_end () +
+
raptor_avltree_iterator_next, raptor_avltree_iterator_next () +
+
raptor_avltree_print, raptor_avltree_print () +
+
raptor_avltree_remove, raptor_avltree_remove () +
+
raptor_avltree_search, raptor_avltree_search () +
+
raptor_avltree_set_print_handler, raptor_avltree_set_print_handler () +
+
raptor_avltree_size, raptor_avltree_size () +
+
raptor_avltree_trim, raptor_avltree_trim () +
+
raptor_avltree_visit, raptor_avltree_visit () +
+
raptor_avltree_visit_handler, raptor_avltree_visit_handler () +
+
raptor_bnodeid_ntriples_write, raptor_bnodeid_ntriples_write () +
+
raptor_calloc_memory, raptor_calloc_memory () +
+
raptor_copyright_string, raptor_copyright_string +
+
raptor_data_compare_arg_handler, raptor_data_compare_arg_handler () +
+
raptor_data_compare_handler, raptor_data_compare_handler () +
+
raptor_data_context_free_handler, raptor_data_context_free_handler () +
+
raptor_data_context_print_handler, raptor_data_context_print_handler () +
+
raptor_data_free_handler, raptor_data_free_handler () +
+
raptor_data_malloc_handler, raptor_data_malloc_handler () +
+
raptor_data_print_handler, raptor_data_print_handler () +
+
raptor_domain, enum raptor_domain +
+
raptor_domain_get_label, raptor_domain_get_label () +
+
raptor_escaped_write_bitflags, enum raptor_escaped_write_bitflags +
+
raptor_free_avltree, raptor_free_avltree () +
+
raptor_free_avltree_iterator, raptor_free_avltree_iterator () +
+
raptor_free_iostream, raptor_free_iostream () +
+
raptor_free_memory, raptor_free_memory () +
+
raptor_free_namespace, raptor_free_namespace () +
+
raptor_free_namespaces, raptor_free_namespaces () +
+
raptor_free_option_description, raptor_free_option_description () +
+
raptor_free_parser, raptor_free_parser () +
+
raptor_free_qname, raptor_free_qname () +
+
raptor_free_sax2, raptor_free_sax2 () +
+
raptor_free_sequence, raptor_free_sequence () +
+
raptor_free_serializer, raptor_free_serializer () +
+
raptor_free_statement, raptor_free_statement () +
+
raptor_free_stringbuffer, raptor_free_stringbuffer () +
+
raptor_free_term, raptor_free_term () +
+
raptor_free_uri, raptor_free_uri () +
+
raptor_free_world, raptor_free_world () +
+
raptor_free_www, raptor_free_www () +
+
raptor_free_xml_element, raptor_free_xml_element () +
+
raptor_free_xml_writer, raptor_free_xml_writer () +
+
raptor_generate_bnodeid_handler, raptor_generate_bnodeid_handler () +
+
raptor_graph_mark_flags, enum raptor_graph_mark_flags +
+
raptor_graph_mark_handler, raptor_graph_mark_handler () +
+
raptor_home_url_string, raptor_home_url_string +
+
raptor_iostream, raptor_iostream +
+
raptor_iostream_counted_string_write, raptor_iostream_counted_string_write () +
+
raptor_iostream_decimal_write, raptor_iostream_decimal_write () +
+
raptor_iostream_finish_func, raptor_iostream_finish_func () +
+
raptor_iostream_handler, raptor_iostream_handler +
+
raptor_iostream_hexadecimal_write, raptor_iostream_hexadecimal_write () +
+
raptor_iostream_init_func, raptor_iostream_init_func () +
+
raptor_iostream_read_bytes, raptor_iostream_read_bytes () +
+
raptor_iostream_read_bytes_func, raptor_iostream_read_bytes_func () +
+
raptor_iostream_read_eof, raptor_iostream_read_eof () +
+
raptor_iostream_read_eof_func, raptor_iostream_read_eof_func () +
+
raptor_iostream_string_write, raptor_iostream_string_write () +
+
raptor_iostream_tell, raptor_iostream_tell () +
+
raptor_iostream_write_byte, raptor_iostream_write_byte () +
+
raptor_iostream_write_bytes, raptor_iostream_write_bytes () +
+
raptor_iostream_write_bytes_func, raptor_iostream_write_bytes_func () +
+
raptor_iostream_write_byte_func, raptor_iostream_write_byte_func () +
+
raptor_iostream_write_end, raptor_iostream_write_end () +
+
raptor_iostream_write_end_func, raptor_iostream_write_end_func () +
+
raptor_license_string, raptor_license_string +
+
raptor_locator, raptor_locator +
+
raptor_locator_byte, raptor_locator_byte () +
+
raptor_locator_column, raptor_locator_column () +
+
raptor_locator_file, raptor_locator_file () +
+
raptor_locator_format, raptor_locator_format () +
+
raptor_locator_line, raptor_locator_line () +
+
raptor_locator_print, raptor_locator_print () +
+
raptor_locator_uri, raptor_locator_uri () +
+
raptor_log_handler, raptor_log_handler () +
+
raptor_log_level, enum raptor_log_level +
+
raptor_log_level_get_label, raptor_log_level_get_label () +
+
raptor_log_message, raptor_log_message +
+
raptor_namespace, raptor_namespace +
+
raptor_namespaces_clear, raptor_namespaces_clear () +
+
raptor_namespaces_end_for_depth, raptor_namespaces_end_for_depth () +
+
raptor_namespaces_find_namespace, raptor_namespaces_find_namespace () +
+
raptor_namespaces_find_namespace_by_uri, raptor_namespaces_find_namespace_by_uri () +
+
raptor_namespaces_get_default_namespace, raptor_namespaces_get_default_namespace () +
+
raptor_namespaces_init, raptor_namespaces_init () +
+
raptor_namespaces_namespace_in_scope, raptor_namespaces_namespace_in_scope () +
+
raptor_namespaces_start_namespace, raptor_namespaces_start_namespace () +
+
raptor_namespaces_start_namespace_full, raptor_namespaces_start_namespace_full () +
+
raptor_namespace_format_as_xml, raptor_namespace_format_as_xml () +
+
raptor_namespace_get_counted_prefix, raptor_namespace_get_counted_prefix () +
+
raptor_namespace_get_prefix, raptor_namespace_get_prefix () +
+
raptor_namespace_get_uri, raptor_namespace_get_uri () +
+
raptor_namespace_handler, raptor_namespace_handler () +
+
raptor_namespace_stack, raptor_namespace_stack +
+
raptor_namespace_stack_start_namespace, raptor_namespace_stack_start_namespace () +
+
raptor_namespace_write, raptor_namespace_write () +
+
raptor_new_avltree, raptor_new_avltree () +
+
raptor_new_avltree_iterator, raptor_new_avltree_iterator () +
+
raptor_new_iostream_from_filename, raptor_new_iostream_from_filename () +
+
raptor_new_iostream_from_file_handle, raptor_new_iostream_from_file_handle () +
+
raptor_new_iostream_from_handler, raptor_new_iostream_from_handler () +
+
raptor_new_iostream_from_sink, raptor_new_iostream_from_sink () +
+
raptor_new_iostream_from_string, raptor_new_iostream_from_string () +
+
raptor_new_iostream_to_filename, raptor_new_iostream_to_filename () +
+
raptor_new_iostream_to_file_handle, raptor_new_iostream_to_file_handle () +
+
raptor_new_iostream_to_sink, raptor_new_iostream_to_sink () +
+
raptor_new_iostream_to_string, raptor_new_iostream_to_string () +
+
raptor_new_namespace, raptor_new_namespace () +
+
raptor_new_namespaces, raptor_new_namespaces () +
+
raptor_new_namespace_from_uri, raptor_new_namespace_from_uri () +
+
raptor_new_parser, raptor_new_parser () +
+
raptor_new_parser_for_content, raptor_new_parser_for_content () +
+
raptor_new_qname, raptor_new_qname () +
+
raptor_new_qname_from_namespace_local_name, raptor_new_qname_from_namespace_local_name () +
+
raptor_new_qname_from_namespace_uri, raptor_new_qname_from_namespace_uri () +
+
raptor_new_sax2, raptor_new_sax2 () +
+
raptor_new_sequence, raptor_new_sequence () +
+
raptor_new_sequence_with_context, raptor_new_sequence_with_context () +
+
raptor_new_serializer, raptor_new_serializer () +
+
raptor_new_statement, raptor_new_statement () +
+
raptor_new_statement_from_nodes, raptor_new_statement_from_nodes () +
+
raptor_new_stringbuffer, raptor_new_stringbuffer () +
+
raptor_new_term_from_blank, raptor_new_term_from_blank () +
+
raptor_new_term_from_counted_blank, raptor_new_term_from_counted_blank () +
+
raptor_new_term_from_counted_literal, raptor_new_term_from_counted_literal () +
+
raptor_new_term_from_counted_string, raptor_new_term_from_counted_string () +
+
raptor_new_term_from_counted_uri_string, raptor_new_term_from_counted_uri_string () +
+
raptor_new_term_from_literal, raptor_new_term_from_literal () +
+
raptor_new_term_from_uri, raptor_new_term_from_uri () +
+
raptor_new_term_from_uri_string, raptor_new_term_from_uri_string () +
+
raptor_new_uri, raptor_new_uri () +
+
raptor_new_uri_for_rdf_concept, raptor_new_uri_for_rdf_concept () +
+
raptor_new_uri_for_retrieval, raptor_new_uri_for_retrieval () +
+
raptor_new_uri_for_xmlbase, raptor_new_uri_for_xmlbase () +
+
raptor_new_uri_from_counted_string, raptor_new_uri_from_counted_string () +
+
raptor_new_uri_from_id, raptor_new_uri_from_id () +
+
raptor_new_uri_from_uri_local_name, raptor_new_uri_from_uri_local_name () +
+
raptor_new_uri_from_uri_or_file_string, raptor_new_uri_from_uri_or_file_string () +
+
raptor_new_uri_relative_to_base, raptor_new_uri_relative_to_base () +
+
raptor_new_uri_relative_to_base_counted, raptor_new_uri_relative_to_base_counted () +
+
raptor_new_world, raptor_new_world +
+
raptor_new_www, raptor_new_www () +
+
raptor_new_www_with_connection, raptor_new_www_with_connection () +
+
raptor_new_xml_element, raptor_new_xml_element () +
+
raptor_new_xml_element_from_namespace_local_name, raptor_new_xml_element_from_namespace_local_name () +
+
raptor_new_xml_writer, raptor_new_xml_writer () +
+
raptor_option, enum raptor_option +
+
raptor_option_description, raptor_option_description +
+
raptor_option_get_count, raptor_option_get_count () +
+
raptor_option_get_value_type_label, raptor_option_get_value_type_label () +
+
raptor_option_value_type, enum raptor_option_value_type +
+
raptor_owl_namespace_uri, raptor_owl_namespace_uri +
+
RAPTOR_OWL_URI, RAPTOR_OWL_URI +
+
raptor_parser, raptor_parser +
+
raptor_parser_get_accept_header, raptor_parser_get_accept_header () +
+
raptor_parser_get_description, raptor_parser_get_description () +
+
raptor_parser_get_graph, raptor_parser_get_graph () +
+
raptor_parser_get_locator, raptor_parser_get_locator () +
+
raptor_parser_get_name, raptor_parser_get_name () +
+
raptor_parser_get_option, raptor_parser_get_option () +
+
raptor_parser_get_world, raptor_parser_get_world () +
+
raptor_parser_parse_abort, raptor_parser_parse_abort () +
+
raptor_parser_parse_chunk, raptor_parser_parse_chunk () +
+
raptor_parser_parse_file, raptor_parser_parse_file () +
+
raptor_parser_parse_file_stream, raptor_parser_parse_file_stream () +
+
raptor_parser_parse_iostream, raptor_parser_parse_iostream () +
+
raptor_parser_parse_start, raptor_parser_parse_start () +
+
raptor_parser_parse_uri, raptor_parser_parse_uri () +
+
raptor_parser_parse_uri_with_connection, raptor_parser_parse_uri_with_connection () +
+
raptor_parser_set_graph_mark_handler, raptor_parser_set_graph_mark_handler () +
+
raptor_parser_set_namespace_handler, raptor_parser_set_namespace_handler () +
+
raptor_parser_set_option, raptor_parser_set_option () +
+
raptor_parser_set_statement_handler, raptor_parser_set_statement_handler () +
+
raptor_parser_set_uri_filter, raptor_parser_set_uri_filter () +
+
raptor_qname, raptor_qname +
+
raptor_qname_copy, raptor_qname_copy () +
+
raptor_qname_equal, raptor_qname_equal () +
+
raptor_qname_format_as_xml, raptor_qname_format_as_xml () +
+
raptor_qname_get_counted_value, raptor_qname_get_counted_value () +
+
raptor_qname_get_local_name, raptor_qname_get_local_name () +
+
raptor_qname_get_namespace, raptor_qname_get_namespace () +
+
raptor_qname_get_value, raptor_qname_get_value () +
+
raptor_qname_string_to_uri, raptor_qname_string_to_uri () +
+
raptor_qname_to_counted_name, raptor_qname_to_counted_name () +
+
raptor_qname_write, raptor_qname_write () +
+
RAPTOR_RDF_MS_URI, RAPTOR_RDF_MS_URI +
+
raptor_rdf_namespace_uri, raptor_rdf_namespace_uri +
+
raptor_rdf_namespace_uri_len, raptor_rdf_namespace_uri_len +
+
raptor_rdf_schema_namespace_uri, raptor_rdf_schema_namespace_uri +
+
raptor_rdf_schema_namespace_uri_len, raptor_rdf_schema_namespace_uri_len +
+
RAPTOR_RDF_SCHEMA_URI, RAPTOR_RDF_SCHEMA_URI +
+
raptor_sax2, raptor_sax2 +
+
raptor_sax2_cdata_handler, raptor_sax2_cdata_handler () +
+
raptor_sax2_characters_handler, raptor_sax2_characters_handler () +
+
raptor_sax2_comment_handler, raptor_sax2_comment_handler () +
+
raptor_sax2_end_element_handler, raptor_sax2_end_element_handler () +
+
raptor_sax2_external_entity_ref_handler, raptor_sax2_external_entity_ref_handler () +
+
raptor_sax2_inscope_base_uri, raptor_sax2_inscope_base_uri () +
+
raptor_sax2_inscope_xml_language, raptor_sax2_inscope_xml_language () +
+
raptor_sax2_parse_chunk, raptor_sax2_parse_chunk () +
+
raptor_sax2_parse_start, raptor_sax2_parse_start () +
+
raptor_sax2_set_cdata_handler, raptor_sax2_set_cdata_handler () +
+
raptor_sax2_set_characters_handler, raptor_sax2_set_characters_handler () +
+
raptor_sax2_set_comment_handler, raptor_sax2_set_comment_handler () +
+
raptor_sax2_set_end_element_handler, raptor_sax2_set_end_element_handler () +
+
raptor_sax2_set_external_entity_ref_handler, raptor_sax2_set_external_entity_ref_handler () +
+
raptor_sax2_set_namespace_handler, raptor_sax2_set_namespace_handler () +
+
raptor_sax2_set_start_element_handler, raptor_sax2_set_start_element_handler () +
+
raptor_sax2_set_unparsed_entity_decl_handler, raptor_sax2_set_unparsed_entity_decl_handler () +
+
raptor_sax2_set_uri_filter, raptor_sax2_set_uri_filter () +
+
raptor_sax2_start_element_handler, raptor_sax2_start_element_handler () +
+
raptor_sax2_unparsed_entity_decl_handler, raptor_sax2_unparsed_entity_decl_handler () +
+
raptor_sequence, raptor_sequence +
+
raptor_sequence_delete_at, raptor_sequence_delete_at () +
+
raptor_sequence_get_at, raptor_sequence_get_at () +
+
raptor_sequence_join, raptor_sequence_join () +
+
raptor_sequence_next_permutation, raptor_sequence_next_permutation () +
+
raptor_sequence_pop, raptor_sequence_pop () +
+
raptor_sequence_print, raptor_sequence_print () +
+
raptor_sequence_push, raptor_sequence_push () +
+
raptor_sequence_reverse, raptor_sequence_reverse () +
+
raptor_sequence_set_at, raptor_sequence_set_at () +
+
raptor_sequence_shift, raptor_sequence_shift () +
+
raptor_sequence_size, raptor_sequence_size () +
+
raptor_sequence_sort, raptor_sequence_sort () +
+
raptor_sequence_sort_r, raptor_sequence_sort_r () +
+
raptor_sequence_swap, raptor_sequence_swap () +
+
raptor_sequence_unshift, raptor_sequence_unshift () +
+
raptor_serializer, raptor_serializer +
+
raptor_serializer_flush, raptor_serializer_flush () +
+
raptor_serializer_get_description, raptor_serializer_get_description () +
+
raptor_serializer_get_iostream, raptor_serializer_get_iostream () +
+
raptor_serializer_get_locator, raptor_serializer_get_locator () +
+
raptor_serializer_get_option, raptor_serializer_get_option () +
+
raptor_serializer_get_world, raptor_serializer_get_world () +
+
raptor_serializer_serialize_end, raptor_serializer_serialize_end () +
+
raptor_serializer_serialize_statement, raptor_serializer_serialize_statement () +
+
raptor_serializer_set_namespace, raptor_serializer_set_namespace () +
+
raptor_serializer_set_namespace_from_namespace, raptor_serializer_set_namespace_from_namespace () +
+
raptor_serializer_set_option, raptor_serializer_set_option () +
+
raptor_serializer_start_to_filename, raptor_serializer_start_to_filename () +
+
raptor_serializer_start_to_file_handle, raptor_serializer_start_to_file_handle () +
+
raptor_serializer_start_to_iostream, raptor_serializer_start_to_iostream () +
+
raptor_serializer_start_to_string, raptor_serializer_start_to_string () +
+
raptor_short_copyright_string, raptor_short_copyright_string +
+
raptor_snprintf, raptor_snprintf () +
+
raptor_sort_r, raptor_sort_r () +
+
raptor_statement, raptor_statement +
+
raptor_statement_clear, raptor_statement_clear () +
+
raptor_statement_compare, raptor_statement_compare () +
+
raptor_statement_copy, raptor_statement_copy () +
+
raptor_statement_equals, raptor_statement_equals () +
+
raptor_statement_handler, raptor_statement_handler () +
+
raptor_statement_init, raptor_statement_init () +
+
raptor_statement_ntriples_write, raptor_statement_ntriples_write () +
+
raptor_statement_print, raptor_statement_print () +
+
raptor_statement_print_as_ntriples, raptor_statement_print_as_ntriples () +
+
raptor_stringbuffer, raptor_stringbuffer +
+
raptor_stringbuffer_append_counted_string, raptor_stringbuffer_append_counted_string () +
+
raptor_stringbuffer_append_decimal, raptor_stringbuffer_append_decimal () +
+
raptor_stringbuffer_append_hexadecimal, raptor_stringbuffer_append_hexadecimal () +
+
raptor_stringbuffer_append_string, raptor_stringbuffer_append_string () +
+
raptor_stringbuffer_append_stringbuffer, raptor_stringbuffer_append_stringbuffer () +
+
raptor_stringbuffer_append_uri_escaped_counted_string, raptor_stringbuffer_append_uri_escaped_counted_string () +
+
raptor_stringbuffer_as_string, raptor_stringbuffer_as_string () +
+
raptor_stringbuffer_copy_to_string, raptor_stringbuffer_copy_to_string () +
+
raptor_stringbuffer_length, raptor_stringbuffer_length () +
+
raptor_stringbuffer_prepend_counted_string, raptor_stringbuffer_prepend_counted_string () +
+
raptor_stringbuffer_prepend_string, raptor_stringbuffer_prepend_string () +
+
raptor_stringbuffer_write, raptor_stringbuffer_write () +
+
raptor_string_escaped_write, raptor_string_escaped_write () +
+
raptor_string_ntriples_write, raptor_string_ntriples_write () +
+
raptor_string_python_write, raptor_string_python_write () +
+
raptor_syntax_bitflags, enum raptor_syntax_bitflags +
+
raptor_syntax_description, raptor_syntax_description +
+
raptor_syntax_description_validate, raptor_syntax_description_validate () +
+
raptor_term, raptor_term +
+
raptor_term_blank_value, raptor_term_blank_value +
+
raptor_term_compare, raptor_term_compare () +
+
raptor_term_copy, raptor_term_copy () +
+
raptor_term_equals, raptor_term_equals () +
+
raptor_term_escaped_write, raptor_term_escaped_write () +
+
raptor_term_literal_value, raptor_term_literal_value +
+
raptor_term_ntriples_write, raptor_term_ntriples_write () +
+
raptor_term_to_counted_string, raptor_term_to_counted_string () +
+
raptor_term_to_string, raptor_term_to_string () +
+
raptor_term_to_turtle_counted_string, raptor_term_to_turtle_counted_string () +
+
raptor_term_to_turtle_string, raptor_term_to_turtle_string () +
+
raptor_term_turtle_write, raptor_term_turtle_write () +
+
raptor_term_type, enum raptor_term_type +
+
raptor_term_value, raptor_term_value +
+
raptor_type_q, raptor_type_q +
+
raptor_unichar, raptor_unichar +
+
raptor_unicode_check_utf8_string, raptor_unicode_check_utf8_string () +
+
raptor_unicode_is_xml10_namechar, raptor_unicode_is_xml10_namechar () +
+
raptor_unicode_is_xml10_namestartchar, raptor_unicode_is_xml10_namestartchar () +
+
raptor_unicode_is_xml11_namechar, raptor_unicode_is_xml11_namechar () +
+
raptor_unicode_is_xml11_namestartchar, raptor_unicode_is_xml11_namestartchar () +
+
raptor_unicode_utf8_string_get_char, raptor_unicode_utf8_string_get_char () +
+
raptor_unicode_utf8_string_put_char, raptor_unicode_utf8_string_put_char () +
+
raptor_unicode_utf8_strlen, raptor_unicode_utf8_strlen () +
+
raptor_unicode_utf8_substr, raptor_unicode_utf8_substr () +
+
raptor_uri, raptor_uri +
+
raptor_uri_as_counted_string, raptor_uri_as_counted_string () +
+
raptor_uri_as_string, raptor_uri_as_string () +
+
raptor_uri_compare, raptor_uri_compare () +
+
raptor_uri_copy, raptor_uri_copy () +
+
raptor_uri_counted_filename_to_uri_string, raptor_uri_counted_filename_to_uri_string () +
+
raptor_uri_equals, raptor_uri_equals () +
+
raptor_uri_escaped_write, raptor_uri_escaped_write () +
+
raptor_uri_filename_exists, raptor_uri_filename_exists () +
+
raptor_uri_filename_to_uri_string, raptor_uri_filename_to_uri_string () +
+
raptor_uri_file_exists, raptor_uri_file_exists () +
+
raptor_uri_filter_func, raptor_uri_filter_func () +
+
raptor_uri_get_world, raptor_uri_get_world () +
+
raptor_uri_print, raptor_uri_print () +
+
raptor_uri_resolve_uri_reference, raptor_uri_resolve_uri_reference () +
+
raptor_uri_to_counted_string, raptor_uri_to_counted_string () +
+
raptor_uri_to_relative_counted_uri_string, raptor_uri_to_relative_counted_uri_string () +
+
raptor_uri_to_relative_uri_string, raptor_uri_to_relative_uri_string () +
+
raptor_uri_to_string, raptor_uri_to_string () +
+
raptor_uri_to_turtle_counted_string, raptor_uri_to_turtle_counted_string () +
+
raptor_uri_to_turtle_string, raptor_uri_to_turtle_string () +
+
raptor_uri_turtle_write, raptor_uri_turtle_write () +
+
raptor_uri_uri_string_is_absolute, raptor_uri_uri_string_is_absolute () +
+
raptor_uri_uri_string_is_file_uri, raptor_uri_uri_string_is_file_uri () +
+
raptor_uri_uri_string_to_counted_filename_fragment, raptor_uri_uri_string_to_counted_filename_fragment () +
+
raptor_uri_uri_string_to_filename, raptor_uri_uri_string_to_filename () +
+
raptor_uri_uri_string_to_filename_fragment, raptor_uri_uri_string_to_filename_fragment () +
+
raptor_uri_write, raptor_uri_write () +
+
raptor_vasprintf, raptor_vasprintf () +
+
RAPTOR_VERSION, RAPTOR_VERSION +
+
raptor_version_decimal, raptor_version_decimal +
+
RAPTOR_VERSION_MAJOR, RAPTOR_VERSION_MAJOR +
+
raptor_version_major, raptor_version_major +
+
RAPTOR_VERSION_MINOR, RAPTOR_VERSION_MINOR +
+
raptor_version_minor, raptor_version_minor +
+
RAPTOR_VERSION_RELEASE, RAPTOR_VERSION_RELEASE +
+
raptor_version_release, raptor_version_release +
+
RAPTOR_VERSION_STRING, RAPTOR_VERSION_STRING +
+
raptor_version_string, raptor_version_string +
+
raptor_vsnprintf, raptor_vsnprintf () +
+
raptor_vsnprintf2, raptor_vsnprintf2 () +
+
raptor_world, raptor_world +
+
raptor_world_flag, enum raptor_world_flag +
+
raptor_world_generate_bnodeid, raptor_world_generate_bnodeid () +
+
raptor_world_get_option_description, raptor_world_get_option_description () +
+
raptor_world_get_option_from_uri, raptor_world_get_option_from_uri () +
+
raptor_world_get_parsers_count, raptor_world_get_parsers_count () +
+
raptor_world_get_parser_description, raptor_world_get_parser_description () +
+
raptor_world_get_serializers_count, raptor_world_get_serializers_count () +
+
raptor_world_get_serializer_description, raptor_world_get_serializer_description () +
+
raptor_world_guess_parser_name, raptor_world_guess_parser_name () +
+
raptor_world_is_parser_name, raptor_world_is_parser_name () +
+
raptor_world_is_serializer_name, raptor_world_is_serializer_name () +
+
raptor_world_open, raptor_world_open () +
+
raptor_world_set_flag, raptor_world_set_flag () +
+
raptor_world_set_generate_bnodeid_handler, raptor_world_set_generate_bnodeid_handler () +
+
raptor_world_set_generate_bnodeid_parameters, raptor_world_set_generate_bnodeid_parameters () +
+
raptor_world_set_libxslt_security_preferences, raptor_world_set_libxslt_security_preferences () +
+
raptor_world_set_log_handler, raptor_world_set_log_handler () +
+
raptor_www, raptor_www +
+
raptor_www_abort, raptor_www_abort () +
+
raptor_www_content_type_handler, raptor_www_content_type_handler () +
+
raptor_www_fetch, raptor_www_fetch () +
+
raptor_www_fetch_to_string, raptor_www_fetch_to_string () +
+
raptor_www_final_uri_handler, raptor_www_final_uri_handler () +
+
raptor_www_get_connection, raptor_www_get_connection () +
+
raptor_www_get_final_uri, raptor_www_get_final_uri () +
+
raptor_www_set_connection_timeout, raptor_www_set_connection_timeout () +
+
raptor_www_set_content_type_handler, raptor_www_set_content_type_handler () +
+
raptor_www_set_final_uri_handler, raptor_www_set_final_uri_handler () +
+
raptor_www_set_http_accept, raptor_www_set_http_accept () +
+
raptor_www_set_http_accept2, raptor_www_set_http_accept2 () +
+
raptor_www_set_http_cache_control, raptor_www_set_http_cache_control () +
+
raptor_www_set_proxy, raptor_www_set_proxy () +
+
raptor_www_set_proxy2, raptor_www_set_proxy2 () +
+
raptor_www_set_ssl_cert_options, raptor_www_set_ssl_cert_options () +
+
raptor_www_set_ssl_verify_options, raptor_www_set_ssl_verify_options () +
+
raptor_www_set_uri_filter, raptor_www_set_uri_filter () +
+
raptor_www_set_user_agent, raptor_www_set_user_agent () +
+
raptor_www_set_user_agent2, raptor_www_set_user_agent2 () +
+
raptor_www_set_write_bytes_handler, raptor_www_set_write_bytes_handler () +
+
raptor_www_write_bytes_handler, raptor_www_write_bytes_handler () +
+
raptor_xmlschema_datatypes_namespace_uri, raptor_xmlschema_datatypes_namespace_uri +
+
RAPTOR_XMLSCHEMA_DATATYPES_URI, RAPTOR_XMLSCHEMA_DATATYPES_URI +
+
raptor_xml_element, raptor_xml_element +
+
raptor_xml_element_declare_namespace, raptor_xml_element_declare_namespace () +
+
raptor_xml_element_get_attributes, raptor_xml_element_get_attributes () +
+
raptor_xml_element_get_attributes_count, raptor_xml_element_get_attributes_count () +
+
raptor_xml_element_get_language, raptor_xml_element_get_language () +
+
raptor_xml_element_get_name, raptor_xml_element_get_name () +
+
raptor_xml_element_is_empty, raptor_xml_element_is_empty () +
+
raptor_xml_element_set_attributes, raptor_xml_element_set_attributes () +
+
raptor_xml_element_write, raptor_xml_element_write () +
+
raptor_xml_escape_string, raptor_xml_escape_string () +
+
raptor_xml_escape_string_any, raptor_xml_escape_string_any () +
+
raptor_xml_escape_string_any_write, raptor_xml_escape_string_any_write () +
+
raptor_xml_escape_string_write, raptor_xml_escape_string_write () +
+
raptor_xml_literal_datatype_uri_string, raptor_xml_literal_datatype_uri_string +
+
raptor_xml_literal_datatype_uri_string_len, raptor_xml_literal_datatype_uri_string_len +
+
raptor_xml_namespace_string_parse, raptor_xml_namespace_string_parse () +
+
raptor_xml_namespace_uri, raptor_xml_namespace_uri +
+
raptor_xml_name_check, raptor_xml_name_check () +
+
raptor_xml_writer, raptor_xml_writer +
+
raptor_xml_writer_cdata, raptor_xml_writer_cdata () +
+
raptor_xml_writer_cdata_counted, raptor_xml_writer_cdata_counted () +
+
raptor_xml_writer_comment, raptor_xml_writer_comment () +
+
raptor_xml_writer_comment_counted, raptor_xml_writer_comment_counted () +
+
raptor_xml_writer_empty_element, raptor_xml_writer_empty_element () +
+
raptor_xml_writer_end_element, raptor_xml_writer_end_element () +
+
raptor_xml_writer_flush, raptor_xml_writer_flush () +
+
raptor_xml_writer_get_depth, raptor_xml_writer_get_depth () +
+
raptor_xml_writer_get_option, raptor_xml_writer_get_option () +
+
raptor_xml_writer_newline, raptor_xml_writer_newline () +
+
raptor_xml_writer_raw, raptor_xml_writer_raw () +
+
raptor_xml_writer_raw_counted, raptor_xml_writer_raw_counted () +
+
raptor_xml_writer_set_option, raptor_xml_writer_set_option () +
+
raptor_xml_writer_start_element, raptor_xml_writer_start_element () +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/left-insensitive.png b/docs/html/left-insensitive.png new file mode 100644 index 0000000..2cd8c16 Binary files /dev/null and b/docs/html/left-insensitive.png differ diff --git a/docs/html/left.png b/docs/html/left.png new file mode 100644 index 0000000..1ca1664 Binary files /dev/null and b/docs/html/left.png differ diff --git a/docs/html/parser-grddl.html b/docs/html/parser-grddl.html new file mode 100644 index 0000000..cd429cf --- /dev/null +++ b/docs/html/parser-grddl.html @@ -0,0 +1,102 @@ + + + + +GRDDL parser (name grddl): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+GRDDL parser (name grddl)

+

A parser for the +Gleaning Resource Descriptions from Dialects of Languages (GRDDL), +W3C Proposed Recommendation of 2007-07-16 which allows reading XHTML +and XML as RDF triples by using profiles in the document that declare +XSLT transforms from the XHTML or XML content into RDF/XML or other +RDF syntax which can then be parsed.

+

The GRDDL parser is rather complex and different from the other +parsers in that it retrieves URIs, reads HTML documents (possibly +with errors), transforms the documents with XSLT and turns the result +into a single graph. The default configuration of the GRDDL parser +also reads microformats (hcard, hcalendar) and follows <link> +tags that point to RDF/XML. Parts of the GRDDL process can be +altered by configuration, which are describe below. +

+

The GRDDL parser defines 'base', 'Base' and 'url' XSLT parameters +with the value of the base URI to allow some XSLT sheets to work. These +set of parameters cannot be disabled. +

+

If the XSLT transform returns an empty string, no further +processing of the result is done, and a warning is generated. The +xsl:output method is mapped to result document mime types as follows: +'text' to text/plain; 'xml' to application/xml and 'html' to text/html. +Any result that is of type 'application/xml' or unknown mime type +is assumed to be RDF/XML. +

+

The URIs that are processed during GRDDL operations can be checked +and skipped if required using a handler set with the +raptor_parser_set_uri_filter() +function. If the handler returns non-0, the URI is rejected. +This uses +raptor_www_set_uri_filter() +internally. +

+

If the value of option +RAPTOR_OPTION_WWW_TIMEOUT +if set to a number >0, it is used as the timeout in seconds +for retrieving of URIs during GRDDL processing. +This uses +raptor_www_set_connection_timeout() +internally. +

+

The hardcoded support for hcard and hcalendar +microformats can be disabled by setting parser option +RAPTOR_OPTION_MICROFORMATS +to 0 +or using +raptor_parser_set_option() +with option +RAPTOR_OPTION_STRICT +and a boolean value of 1. +

+

The GRDDL parser by default will try an XML parser on the +content followed by a lax HTML parser. This can be disabled by +setting parser option +RAPTOR_OPTION_HTML_TAG_SOUP +to 0 +or using +raptor_parser_set_option() +with option +RAPTOR_OPTION_STRICT +and a boolean value of 1. +

+

The GRDDL parser by default will try to look for an HTML +<link> tag that points to RDF/XML. This can be disabled by +setting parser option +RAPTOR_OPTION_HTML_LINK +to 0 +or using +raptor_parser_set_option() +with option +RAPTOR_OPTION_STRICT +and a boolean value of 1. +

+
+ + + \ No newline at end of file diff --git a/docs/html/parser-guess.html b/docs/html/parser-guess.html new file mode 100644 index 0000000..98730ff --- /dev/null +++ b/docs/html/parser-guess.html @@ -0,0 +1,42 @@ + + + + +Guess parser (name guess): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Guess parser (name guess)

+

+This is a special parser that picks the actual parser to use based +on the content type, the content bytes or the content identifier. The +content name can be either from a local file or from a URI. +

+

If the protocol that delivered the content (such as HTTP) +provided a Content Type (aka MIME Type) then +this will be the primary means for identifying th ecotnent. +

+

The secondary means to identify the content are the bytes of +the content (if available), otherwise the content identifier is used, +which is the least reliable. +

+
+ + + \ No newline at end of file diff --git a/docs/html/parser-json.html b/docs/html/parser-json.html new file mode 100644 index 0000000..4c88093 --- /dev/null +++ b/docs/html/parser-json.html @@ -0,0 +1,34 @@ + + + + +JSON parser (name json): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+JSON parser (name json)

+

A parser for both the +resource-centric RDF/JSON syntax as defined by Talis at +RDF/JSON Specification +and the triples-centric format based on the SPARQL results in JSON format. +

+
+ + + \ No newline at end of file diff --git a/docs/html/parser-ntriples.html b/docs/html/parser-ntriples.html new file mode 100644 index 0000000..59f55bf --- /dev/null +++ b/docs/html/parser-ntriples.html @@ -0,0 +1,35 @@ + + + + +N-Triples parser (name ntriples): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+N-Triples parser (name ntriples)

+

A parser for the +N-Triples +syntax as used by the +W3C RDF Core working group +for the RDF Test Cases. +

+
+ + + \ No newline at end of file diff --git a/docs/html/parser-rdfa.html b/docs/html/parser-rdfa.html new file mode 100644 index 0000000..8a47fc3 --- /dev/null +++ b/docs/html/parser-rdfa.html @@ -0,0 +1,43 @@ + + + + +RDFa parser - (name rdfa): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+RDFa parser - (name rdfa)

+

+A parser for the +RDFa +syntax, W3C Candidate Recommendation 20 June 2008 which allows reading XHTML +and XML as RDF triples by interpreting attributes on elements to +describe which ones have RDF semantics. This is implemented via +librdfa +linked inside Raptor, written by Manu Sporny of Digital Bazaar, +and licensed with the same license as Raptor. +

+

+This parser is beta quality and passes all but 4 of the RDFa tests as +of Raptor 1.4.18. +

+
+ + + \ No newline at end of file diff --git a/docs/html/parser-rdfxml.html b/docs/html/parser-rdfxml.html new file mode 100644 index 0000000..437de0d --- /dev/null +++ b/docs/html/parser-rdfxml.html @@ -0,0 +1,42 @@ + + + + +RDF/XML parser - default (name rdfxml): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+RDF/XML parser - default (name rdfxml)

+

+A parser for the standard +RDF/XML syntax +as revised by the +W3C RDF Core working group.

+

This is the default parser in Raptor.

+

Features of this parser:

+
+
+ + + \ No newline at end of file diff --git a/docs/html/parser-rss-tag-soup.html b/docs/html/parser-rss-tag-soup.html new file mode 100644 index 0000000..f6215c4 --- /dev/null +++ b/docs/html/parser-rss-tag-soup.html @@ -0,0 +1,46 @@ + + + + +RSS Tag Soup parser (name rss-tag-soup): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+RSS Tag Soup parser (name rss-tag-soup)

+

A parser for the multiple XML RSS formats that use the elements +such as channel, item, +title, description +in different ways. +This includes support for the Atom 1.0 syndication format defined in IETF +RFC 4287 +

+

The parser attempts to turn the input into +RSS 1.0 +RDF triples in the RSS 1.0 model of a syndication feed. +This includes triples for RSS Enclosures. +

+

+True RSS 1.0 when +wanted to be used as a full RDF vocabulary, is best parsed by the +RDF/XML parser (name rdfxml). +

+
+ + + \ No newline at end of file diff --git a/docs/html/parser-trig.html b/docs/html/parser-trig.html new file mode 100644 index 0000000..6ddd213 --- /dev/null +++ b/docs/html/parser-trig.html @@ -0,0 +1,35 @@ + + + + +TRiG parser (name trig): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+TRiG parser (name trig)

+

A parser for the +TriG - Turtle with Named Graphs +syntax. +

+

The parser is alpha quality and may not support the entire TRiG +specification.

+
+ + + \ No newline at end of file diff --git a/docs/html/parser-turtle.html b/docs/html/parser-turtle.html new file mode 100644 index 0000000..6eea534 --- /dev/null +++ b/docs/html/parser-turtle.html @@ -0,0 +1,34 @@ + + + + +Turtle Terse RDF Triple Language parser (name turtle): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Turtle Terse RDF Triple Language parser (name turtle)

+

A parser for the +Turtle Terse RDF Triple Language +syntax, designed as a useful subset of +Notation 3. +

+
+ + + \ No newline at end of file diff --git a/docs/html/raptor-formats-types-by-parser.html b/docs/html/raptor-formats-types-by-parser.html new file mode 100644 index 0000000..b9b3237 --- /dev/null +++ b/docs/html/raptor-formats-types-by-parser.html @@ -0,0 +1,102 @@ + + + + +MIME Types by Parser: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+MIME Types by Parser

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Gleaning Resource Descriptions from Dialects of Languages (grddl)

    +
  • text/html with q 0.2

  • +
  • application/xhtml+xml with q 0.4

  • +

N-Quads (nquads)

  • text/x-nquads with q 1.0

N-Triples (ntriples)

    +
  • application/n-triples with q 1.0

  • +
  • text/plain with q 0.1

  • +

RDF/A via librdfa (rdfa)

    +
  • text/html with q 0.6

  • +
  • application/xhtml+xml with q 0.8

  • +

RDF/JSON (either Triples or Resource-Centric) (json)

    +
  • application/json with q 0.1

  • +
  • text/json with q 0.1

  • +

RDF/XML (rdfxml)

    +
  • application/rdf+xml with q 1.0

  • +
  • text/rdf with q 0.6

  • +

RSS Tag Soup (rss-tag-soup)

    +
  • application/rss with q 0.8

  • +
  • application/rss+xml with q 0.8

  • +
  • text/rss with q 0.8

  • +
  • application/xml with q 0.3

  • +
  • text/xml with q 0.3

  • +
  • application/atom+xml with q 0.3

  • +

TriG - Turtle with Named Graphs (trig)

  • application/x-trig with q 1.0

Turtle Terse RDF Triple Language (turtle)

    +
  • text/turtle with q 1.0

  • +
  • application/x-turtle with q 1.0

  • +
  • application/turtle with q 1.0

  • +
  • text/n3 with q 0.3

  • +
  • text/rdf+n3 with q 0.3

  • +
  • application/rdf+n3 with q 0.3

  • +
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor-formats-types-by-serializer.html b/docs/html/raptor-formats-types-by-serializer.html new file mode 100644 index 0000000..91155ba --- /dev/null +++ b/docs/html/raptor-formats-types-by-serializer.html @@ -0,0 +1,124 @@ + + + + +MIME Types by Serializer: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+MIME Types by Serializer

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Atom 1.0 (atom)

  • application/atom+xml with q 1.0

GraphViz DOT format (dot)

  • text/x-graphviz with q 0.5

HTML Table (html)

    +
  • application/xhtml+xml with q 1.0

  • +
  • text/html with q 1.0

  • +

N-Quads (nquads)

  • text/x-nquads with q 1.0

N-Triples (ntriples)

    +
  • application/n-triples with q 1.0

  • +
  • text/plain with q 0.1

  • +

RDF/JSON Resource-Centric (json)

    +
  • application/json with q 1.0

  • +
  • text/json with q 0.1

  • +

RDF/JSON Triples (json-triples)

    +
  • application/json with q 0.0

  • +
  • text/json with q 0.1

  • +

RDF/XML (rdfxml)

    +
  • application/rdf+xml with q 1.0

  • +
  • text/rdf with q 0.6

  • +

RDF/XML (Abbreviated) (rdfxml-abbrev)

  • application/rdf+xml with q 0.0

RDF/XML (XMP Profile) (rdfxml-xmp)

  • application/rdf+xml with q 0.0

RSS 1.0 (rss-1.0)

    +
  • application/rss+xml with q 1.0

  • +
  • application/rss with q 0.3

  • +
  • text/rss with q 0.3

  • +
  • application/xml with q 0.3

  • +
  • text/xml with q 0.3

  • +

Turtle Terse RDF Triple Language (turtle)

    +
  • text/turtle with q 1.0

  • +
  • application/turtle with q 1.0

  • +
  • application/x-turtle with q 0.8

  • +
  • text/n3 with q 0.3

  • +
  • text/rdf+n3 with q 0.3

  • +
  • application/rdf+n3 with q 0.3

  • +

mKR my Knowledge Representation Language (mkr)

    +
  • text/mkr with q 1.0

  • +
  • application/mkr with q 1.0

  • +
  • application/x-mkr with q 0.8

  • +
  • text/n3 with q 0.3

  • +
  • text/rdf+n3 with q 0.3

  • +
  • application/rdf+n3 with q 0.3

  • +
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor-formats-types-index.html b/docs/html/raptor-formats-types-index.html new file mode 100644 index 0000000..5efbec2 --- /dev/null +++ b/docs/html/raptor-formats-types-index.html @@ -0,0 +1,228 @@ + + + + +MIME Types Index: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+MIME Types Index

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

application/atom+xml

    +
  • Atom 1.0 Serializer (atom) with q 1.0

  • +
  • RSS Tag Soup Parser (rss-tag-soup) with q 0.3

  • +

application/json

    +
  • RDF/JSON Resource-Centric Serializer (json) with q 1.0

  • +
  • RDF/JSON (either Triples or Resource-Centric) Parser (json) with q 0.1

  • +
  • RDF/JSON Triples Serializer (json-triples) with q 0.0

  • +

application/mkr

    +
  • mKR my Knowledge Representation Language Serializer (mkr) with q 1.0

  • +
  • No parser.

  • +

application/n-triples

    +
  • N-Triples Parser (ntriples) with q 1.0

  • +
  • N-Triples Serializer (ntriples) with q 1.0

  • +

application/rdf+n3

    +
  • Turtle Terse RDF Triple Language Parser (turtle) with q 0.3

  • +
  • Turtle Terse RDF Triple Language Serializer (turtle) with q 0.3

  • +
  • mKR my Knowledge Representation Language Serializer (mkr) with q 0.3

  • +

application/rdf+xml

    +
  • RDF/XML Parser (rdfxml) with q 1.0

  • +
  • RDF/XML Serializer (rdfxml) with q 1.0

  • +
  • RDF/XML (XMP Profile) Serializer (rdfxml-xmp) with q 0.0

  • +
  • RDF/XML (Abbreviated) Serializer (rdfxml-abbrev) with q 0.0

  • +

application/rss

    +
  • RSS Tag Soup Parser (rss-tag-soup) with q 0.8

  • +
  • RSS 1.0 Serializer (rss-1.0) with q 0.3

  • +

application/rss+xml

    +
  • RSS 1.0 Serializer (rss-1.0) with q 1.0

  • +
  • RSS Tag Soup Parser (rss-tag-soup) with q 0.8

  • +

application/turtle

    +
  • Turtle Terse RDF Triple Language Parser (turtle) with q 1.0

  • +
  • Turtle Terse RDF Triple Language Serializer (turtle) with q 1.0

  • +

application/x-mkr

    +
  • mKR my Knowledge Representation Language Serializer (mkr) with q 0.8

  • +
  • No parser.

  • +

application/x-trig

    +
  • TriG - Turtle with Named Graphs Parser (trig) with q 1.0

  • +
  • No serializer.

  • +

application/x-turtle

    +
  • Turtle Terse RDF Triple Language Parser (turtle) with q 1.0

  • +
  • Turtle Terse RDF Triple Language Serializer (turtle) with q 0.8

  • +

application/xhtml+xml

    +
  • HTML Table Serializer (html) with q 1.0

  • +
  • RDF/A via librdfa Parser (rdfa) with q 0.8

  • +
  • Gleaning Resource Descriptions from Dialects of Languages Parser (grddl) with q 0.4

  • +

application/xml

    +
  • RSS Tag Soup Parser (rss-tag-soup) with q 0.3

  • +
  • RSS 1.0 Serializer (rss-1.0) with q 0.3

  • +

text/html

    +
  • HTML Table Serializer (html) with q 1.0

  • +
  • RDF/A via librdfa Parser (rdfa) with q 0.6

  • +
  • Gleaning Resource Descriptions from Dialects of Languages Parser (grddl) with q 0.2

  • +

text/json

    +
  • RDF/JSON (either Triples or Resource-Centric) Parser (json) with q 0.1

  • +
  • RDF/JSON Triples Serializer (json-triples) with q 0.1

  • +
  • RDF/JSON Resource-Centric Serializer (json) with q 0.1

  • +

text/mkr

    +
  • mKR my Knowledge Representation Language Serializer (mkr) with q 1.0

  • +
  • No parser.

  • +

text/n3

    +
  • Turtle Terse RDF Triple Language Parser (turtle) with q 0.3

  • +
  • Turtle Terse RDF Triple Language Serializer (turtle) with q 0.3

  • +
  • mKR my Knowledge Representation Language Serializer (mkr) with q 0.3

  • +

text/plain

    +
  • N-Triples Parser (ntriples) with q 0.1

  • +
  • N-Triples Serializer (ntriples) with q 0.1

  • +

text/rdf

    +
  • RDF/XML Parser (rdfxml) with q 0.6

  • +
  • RDF/XML Serializer (rdfxml) with q 0.6

  • +

text/rdf+n3

    +
  • Turtle Terse RDF Triple Language Parser (turtle) with q 0.3

  • +
  • Turtle Terse RDF Triple Language Serializer (turtle) with q 0.3

  • +
  • mKR my Knowledge Representation Language Serializer (mkr) with q 0.3

  • +

text/rss

    +
  • RSS Tag Soup Parser (rss-tag-soup) with q 0.8

  • +
  • RSS 1.0 Serializer (rss-1.0) with q 0.3

  • +

text/turtle

    +
  • Turtle Terse RDF Triple Language Parser (turtle) with q 1.0

  • +
  • Turtle Terse RDF Triple Language Serializer (turtle) with q 1.0

  • +

text/x-graphviz

    +
  • GraphViz DOT format Serializer (dot) with q 0.5

  • +
  • No parser.

  • +

text/x-nquads

    +
  • N-Quads Parser (nquads) with q 1.0

  • +
  • N-Quads Serializer (nquads) with q 1.0

  • +

text/xml

    +
  • RSS Tag Soup Parser (rss-tag-soup) with q 0.3

  • +
  • RSS 1.0 Serializer (rss-1.0) with q 0.3

  • +
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor-formats.html b/docs/html/raptor-formats.html new file mode 100644 index 0000000..adf86ae --- /dev/null +++ b/docs/html/raptor-formats.html @@ -0,0 +1,44 @@ + + + + +Syntax Formats supported in Raptor: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Syntax Formats supported in Raptor

+ +

This chapter describes the syntax formats supported +by parsers and serializers in Raptor. +

+
+

+Introduction

+

+The parsers and serializers in raptor can handle different MIME Types with different levels of quality (Q). A Q of 1.0 indicates that the parser or serializer will be able to read or write the full format with high quality, and it should be the prefered parser or serializer for that mime type. Lower Q values indicate either additional mime type support (for parsing) or less-preferred mime types (for serializing). A serializer typically has just 1 mime type of Q 1.0; the preferred type.

+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor-parsers.html b/docs/html/raptor-parsers.html new file mode 100644 index 0000000..d230eeb --- /dev/null +++ b/docs/html/raptor-parsers.html @@ -0,0 +1,55 @@ + + + + +Parsers in Raptor (syntax to triples): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Parsers in Raptor (syntax to triples)

+ +
+

+Introduction

+

This section describes the parsers that can be compiled into +Raptor and their options. The exact parsers supported may vary +by different builds of raptor and can be queried at run-time by +use of the +raptor_world_get_parser_description +function

+

The options that may be set on parsers can also +be queried at run-time with the +raptor_world_get_option_description +function.

+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor-serializers.html b/docs/html/raptor-serializers.html new file mode 100644 index 0000000..6c23693 --- /dev/null +++ b/docs/html/raptor-serializers.html @@ -0,0 +1,56 @@ + + + + +Serializers in Raptor (triples to syntax): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Serializers in Raptor (triples to syntax)

+ +
+

+Introduction

+

This section describes the serializers that can be compiled into +Raptor and their options. The exact serializers supported may vary +by different builds of raptor and can be queried at run-time by use of the +raptor_world_get_serializer_description +function

+

The optional options that may be set on parsers can also +be queried at run-time with the +raptor_world_get_option_description +function.

+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-1-4-21-to-2-0-0.html b/docs/html/raptor2-changes-1-4-21-to-2-0-0.html new file mode 100644 index 0000000..00874ca --- /dev/null +++ b/docs/html/raptor2-changes-1-4-21-to-2-0-0.html @@ -0,0 +1,968 @@ + + + + +Changes between raptor2 1.4.21 and 2.0.0: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 1.4.21 and 2.0.0

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+ + +
+
+

+Deleted functions, types, enums and constants

+
+

Functions

+ +
+
+

Types

+
    +
  • raptor_error_handlers - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler()

  • +
  • raptor_free_uri_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_libxml_flags - replaced by raptor_world_set_flags() with raptor_world_flag

  • +
  • raptor_message_handler - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler()

  • +
  • raptor_message_handler_closure - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler()

  • +
  • raptor_new_uri_for_rdf_concept_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_new_uri_from_uri_local_name_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_new_uri_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_new_uri_relative_to_base_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_ntriples_parser - replaced by raptor_parser

  • +
  • raptor_ntriples_term_type - replaced by raptor_term_type

  • +
  • raptor_uri_as_counted_string_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_uri_as_string_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_uri_compare_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_uri_copy_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_uri_equals_func - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_uri_handler - Entire URI implementation is internal and not replaceable.

  • +
  • raptor_uri_source - URI source was useless.

  • +
+
+
+

Enums and Constants

+
    +
  • RAPTOR_FEATURE_ASSUME_IS_RDF - Never used.

  • +
  • RAPTOR_FEATURE_START_URI - Never used.

  • +
  • RAPTOR_GENID_TYPE_BAGID - There is just one type of generated ID now.

  • +
  • RAPTOR_GENID_TYPE_BNODEID - There is just one type of generated ID now.

  • +
  • RAPTOR_IDENTIFIER_TYPE_ORDINAL - Deprecated value deleted.

  • +
  • RAPTOR_URI_SOURCE_ATTRIBUTE - URI source concept removed.

  • +
  • RAPTOR_URI_SOURCE_BLANK_ID - URI source concept removed.

  • +
  • RAPTOR_URI_SOURCE_ELEMENT - URI source concept removed.

  • +
  • RAPTOR_URI_SOURCE_GENERATED - URI source concept removed.

  • +
  • RAPTOR_URI_SOURCE_ID - URI source concept removed.

  • +
  • RAPTOR_URI_SOURCE_NOT_URI - URI source concept removed.

  • +
  • RAPTOR_URI_SOURCE_UNKNOWN - URI source concept removed.

  • +
  • RAPTOR_URI_SOURCE_URI - URI source concept removed.

  • +
+
+
+
+

+Renamed functions, enums and constants

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1.4.21 function2.0.0 functionNotes
raptor_format_locator raptor_locator_format  
raptor_get_feature_count raptor_option_get_count  
raptor_get_locator raptor_parser_get_locator  
raptor_get_name raptor_parser_get_name  
raptor_guess_parser_name_v2 raptor_world_guess_parser_name  
raptor_namespace_copy raptor_namespace_stack_start_namespace  
raptor_namespaces_format raptor_namespace_format_as_xml  
raptor_namespaces_qname_from_uri raptor_new_qname_from_namespace_uri  
raptor_new_namespace_parts_from_string raptor_xml_namespace_string_parse  
raptor_new_parser_for_content_v2 raptor_new_parser_for_content  
raptor_new_parser_v2 raptor_new_parser  
raptor_new_qname_from_namespace_local_name_v2 raptor_new_qname_from_namespace_local_name  
raptor_new_serializer_v2 raptor_new_serializer  
raptor_new_uri_from_id_v2 raptor_new_uri_from_id  
raptor_new_uri_from_uri_local_name_v2 raptor_new_uri_from_uri_local_name  
raptor_new_uri_relative_to_base_v2 raptor_new_uri_relative_to_base  
raptor_new_uri_v2 raptor_new_uri  
raptor_parse_abort raptor_parser_parse_abort  
raptor_parse_chunk raptor_parser_parse_chunk  
raptor_parse_file raptor_parser_parse_file  
raptor_parse_file_stream raptor_parser_parse_file_stream  
raptor_parse_uri raptor_parser_parse_uri  
raptor_parse_uri_with_connection raptor_parser_parse_uri_with_connection  
raptor_serialize_end raptor_serializer_serialize_end  
raptor_serialize_set_namespace raptor_serializer_set_namespace  
raptor_serialize_set_namespace_from_namespace raptor_serializer_set_namespace_from_namespace  
raptor_serialize_start raptor_serializer_start_to_iostream  
raptor_serialize_start_to_file_handle raptor_serializer_start_to_file_handle  
raptor_serialize_start_to_filename raptor_serializer_start_to_filename  
raptor_serialize_start_to_iostream raptor_serializer_start_to_iostream  
raptor_serialize_start_to_string raptor_serializer_start_to_string  
raptor_serializer_syntax_name_check_v2 raptor_world_is_serializer_name  
raptor_set_namespace_handler raptor_parser_set_namespace_handler  
raptor_set_statement_handler raptor_parser_set_statement_handler  
raptor_start_parse raptor_parser_parse_start  
raptor_uri_is_file_uri raptor_uri_uri_string_is_file_uri  
raptor_utf8_check raptor_unicode_check_utf8_string  
raptor_www_free raptor_free_www  
raptor_www_new_v2 raptor_new_www  
raptor_www_new_with_connection_v2 raptor_new_www_with_connection  
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1.4.21 enum / constant2.0.0 enum / constantNotes
RAPTOR_FEATURE_ALLOW_BAGID RAPTOR_OPTION_ALLOW_BAGID  
RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES  
RAPTOR_FEATURE_ALLOW_OTHER_PARSETYPES RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES  
RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST  
RAPTOR_FEATURE_ATOM_ENTRY_URI RAPTOR_OPTION_ATOM_ENTRY_URI  
RAPTOR_FEATURE_BNODE_BORDER RAPTOR_OPTION_BNODE_BORDER  
RAPTOR_FEATURE_BNODE_FILL RAPTOR_OPTION_BNODE_FILL  
RAPTOR_FEATURE_CHECK_RDF_ID RAPTOR_OPTION_CHECK_RDF_ID  
RAPTOR_FEATURE_HTML_LINK RAPTOR_OPTION_HTML_LINK  
RAPTOR_FEATURE_HTML_TAG_SOUP RAPTOR_OPTION_HTML_TAG_SOUP  
RAPTOR_FEATURE_JSON_CALLBACK RAPTOR_OPTION_JSON_CALLBACK  
RAPTOR_FEATURE_JSON_EXTRA_DATA RAPTOR_OPTION_JSON_EXTRA_DATA  
RAPTOR_FEATURE_LAST RAPTOR_OPTION_LAST  
RAPTOR_FEATURE_LITERAL_BORDER RAPTOR_OPTION_LITERAL_BORDER  
RAPTOR_FEATURE_LITERAL_FILL RAPTOR_OPTION_LITERAL_FILL  
RAPTOR_FEATURE_MICROFORMATS RAPTOR_OPTION_MICROFORMATS  
RAPTOR_FEATURE_NON_NFC_FATAL RAPTOR_OPTION_NON_NFC_FATAL  
RAPTOR_FEATURE_NORMALIZE_LANGUAGE RAPTOR_OPTION_NORMALIZE_LANGUAGE  
RAPTOR_FEATURE_NO_NET RAPTOR_OPTION_NO_NET  
RAPTOR_FEATURE_PREFIX_ELEMENTS RAPTOR_OPTION_PREFIX_ELEMENTS  
RAPTOR_FEATURE_RELATIVE_URIS RAPTOR_OPTION_RELATIVE_URIS  
RAPTOR_FEATURE_RESOURCE_BORDER RAPTOR_OPTION_RESOURCE_BORDER  
RAPTOR_FEATURE_RESOURCE_FILL RAPTOR_OPTION_RESOURCE_FILL  
RAPTOR_FEATURE_RSS_TRIPLES RAPTOR_OPTION_RSS_TRIPLES  
RAPTOR_FEATURE_SCANNING RAPTOR_OPTION_SCANNING  
RAPTOR_FEATURE_WARN_OTHER_PARSETYPES RAPTOR_OPTION_WARN_OTHER_PARSETYPES  
RAPTOR_FEATURE_WRITER_AUTO_EMPTY RAPTOR_OPTION_WRITER_AUTO_EMPTY  
RAPTOR_FEATURE_WRITER_AUTO_INDENT RAPTOR_OPTION_WRITER_AUTO_INDENT  
RAPTOR_FEATURE_WRITER_INDENT_WIDTH RAPTOR_OPTION_WRITER_INDENT_WIDTH  
RAPTOR_FEATURE_WRITER_XML_DECLARATION RAPTOR_OPTION_WRITER_XML_DECLARATION  
RAPTOR_FEATURE_WRITER_XML_VERSION RAPTOR_OPTION_WRITER_XML_VERSION  
RAPTOR_FEATURE_WRITE_BASE_URI RAPTOR_OPTION_WRITE_BASE_URI  
RAPTOR_FEATURE_WWW_HTTP_CACHE_CONTROL RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL  
RAPTOR_FEATURE_WWW_HTTP_USER_AGENT RAPTOR_OPTION_WWW_HTTP_USER_AGENT  
RAPTOR_FEATURE_WWW_TIMEOUT RAPTOR_OPTION_WWW_TIMEOUT  
RAPTOR_IDENTIFIER_TYPE_ANONYMOUS RAPTOR_TERM_TYPE_BLANK  
RAPTOR_IDENTIFIER_TYPE_LITERAL RAPTOR_TERM_TYPE_LITERAL  
RAPTOR_IDENTIFIER_TYPE_PREDICATE RAPTOR_TERM_TYPE_URI  
RAPTOR_IDENTIFIER_TYPE_RESOURCE RAPTOR_TERM_TYPE_URI  
RAPTOR_IDENTIFIER_TYPE_UNKNOWN RAPTOR_TERM_TYPE_UNKNOWN  
RAPTOR_IDENTIFIER_TYPE_XML_LITERAL RAPTOR_TERM_TYPE_LITERAL  
RAPTOR_LIBXML_FLAGS_GENERIC_ERROR_SAVE RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE Flag setting is done by raptor_world_set_flags()
RAPTOR_LIBXML_FLAGS_STRUCTURED_ERROR_SAVE RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE Flag setting is done by raptor_world_set_flags()
RAPTOR_LOG_LEVEL_WARNING RAPTOR_LOG_LEVEL_WARN  
RAPTOR_NTRIPLES_TERM_TYPE_BLANK_NODE RAPTOR_TERM_TYPE_BLANK  
RAPTOR_NTRIPLES_TERM_TYPE_LITERAL RAPTOR_TERM_TYPE_LITERAL  
RAPTOR_NTRIPLES_TERM_TYPE_URI_REF RAPTOR_TERM_TYPE_URI  
+
+
+

+Changed functions and types

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1.4.21 function2.0.0 functionNotes
raptor_feature raptor_feature_from_uri(raptor_uri *uri) raptor_option raptor_world_get_option_from_uri(raptor_world* world, raptor_uri *uri)  
raptor_feature raptor_feature_from_uri_v2(raptor_world* world, raptor_uri *uri) raptor_option raptor_world_get_option_from_uri(raptor_world* world, raptor_uri *uri)  
int raptor_features_enumerate(const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_PARSER +
int raptor_features_enumerate_v2(raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_PARSER +
int raptor_format_locator_v2(raptor_world* world, char* buffer, size_t length, raptor_locator* locator) int raptor_locator_format(char* buffer, size_t length, raptor_locator* locator)  
void raptor_free_uri_v2(raptor_world* world, raptor_uri *uri) void raptor_free_uri(raptor_uri *uri)  
int raptor_get_feature(raptor_parser *parser, raptor_feature feature) int raptor_parser_get_option(raptor_parser *parser, raptor_option option, char** string_p, int* integer_p)  
const char* raptor_get_label(raptor_parser *rdf_parser) raptor_syntax_description* raptor_parser_get_description(raptor_parser* rdf_parser) Use label field of returned description.
const char* raptor_get_mime_type(raptor_parser *rdf_parser) raptor_syntax_description* raptor_parser_get_description(raptor_parser* rdf_parser) Use the mime_types array field of returned raptor_syntax_description +
int raptor_get_need_base_uri(raptor_parser *rdf_parser) raptor_syntax_description* raptor_parser_get_description(raptor_parser* rdf_parser) Use the RAPTOR_SYNTAX_NEED_BASE_URI bitflag in the flags field of the returned raptor_syntax_description +
const char* raptor_guess_parser_name(raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) const char* raptor_world_guess_parser_name(raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier)  
int raptor_iostream_format_hexadecimal(raptor_iostream* iostr, unsigned int integer, int width) int raptor_iostream_hexadecimal_write(unsigned int integer, int width, raptor_iostream* iostr)  
int raptor_iostream_read_bytes(raptor_iostream* iostr, void *ptr, size_t size, size_t nmemb) int raptor_iostream_read_bytes(void *ptr, size_t size, size_t nmemb, raptor_iostream* iostr)  
int raptor_iostream_write_byte(raptor_iostream *iostr, const int byte) int raptor_iostream_write_byte(const int byte, raptor_iostream *iostr)  
int raptor_iostream_write_bytes(raptor_iostream *iostr, const void *ptr, size_t size, size_t nmemb) int raptor_iostream_write_bytes(const void *ptr, size_t size, size_t nmemb, raptor_iostream *iostr)  
int raptor_iostream_write_counted_string(raptor_iostream *iostr, const void *string, size_t len) int raptor_iostream_counted_string_write(const void *string, size_t len, raptor_iostream *iostr)  
int raptor_iostream_write_decimal(raptor_iostream* iostr, int integer) int raptor_iostream_decimal_write(int integer, raptor_iostream* iostr)  
void raptor_iostream_write_end(raptor_iostream *iostr) int raptor_iostream_write_end(raptor_iostream *iostr)  
int raptor_iostream_write_namespace(raptor_iostream* iostr, raptor_namespace *ns) int raptor_namespace_write(raptor_namespace *ns, raptor_iostream* iostr)  
int raptor_iostream_write_qname(raptor_iostream* iostr, raptor_qname *qname) int raptor_qname_write(raptor_qname *qname, raptor_iostream* iostr)  
void raptor_iostream_write_statement_ntriples(raptor_iostream* iostr, const raptor_statement *statement) int raptor_statement_ntriples_write(const raptor_statement *statement, raptor_iostream* iostr, int write_graph_term) Gains extra flag arg to decide whether to write any graph term.
int raptor_iostream_write_string(raptor_iostream *iostr, const void *string) int raptor_iostream_string_write(const void *string, raptor_iostream *iostr)  
int raptor_iostream_write_string_ntriples(raptor_iostream *iostr, const unsigned char* string, size_t len, const char delim) int raptor_string_ntriples_write(const unsigned char* string, size_t len, const char delim, raptor_iostream *iostr)  
int raptor_iostream_write_string_python(raptor_iostream *iostr, const unsigned char* string, size_t len, const char delim, int flags) int raptor_string_python_write(const unsigned char* string, size_t len, const char delim, int flags, raptor_iostream *iostr)  
int raptor_iostream_write_stringbuffer(raptor_iostream* iostr, raptor_stringbuffer *sb) int raptor_stringbuffer_write(raptor_stringbuffer *sb, raptor_iostream* iostr)  
int raptor_iostream_write_uri(raptor_iostream *iostr, raptor_uri *uri) int raptor_uri_write(raptor_uri *uri, raptor_iostream *iostr)  
int raptor_iostream_write_uri_v2(raptor_world* world, raptor_iostream *iostr, raptor_uri *uri) int raptor_uri_write(raptor_uri *uri, raptor_iostream *iostr)  
int raptor_iostream_write_xml_any_escaped_string(raptor_iostream* iostr, const unsigned char* string, size_t len, char quote, int xml_version, raptor_simple_message_handler error_handler, void *error_data) int raptor_xml_escape_string_any_write(const unsigned char* string, size_t len, char quote, int xml_version, raptor_iostream* iostr)  
int raptor_iostream_write_xml_element(raptor_iostream *iostr, raptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, int is_end, raptor_simple_message_handler error_handler, void *error_data, int depth) int raptor_xml_element_write(raptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, int is_end, int depth, raptor_iostream *iostr)  
int raptor_iostream_write_xml_escaped_string(raptor_iostream* iostr, const unsigned char* string, size_t len, char quote, raptor_simple_message_handler error_handler, void *error_data) int raptor_xml_escape_string_write(const unsigned char* string, size_t len, char quote, raptor_iostream* iostr)  
const char* raptor_locator_uri_v2(raptor_world* world, raptor_locator *locator) const char* raptor_locator_uri(raptor_locator *locator)  
int raptor_namespaces_init(raptor_namespace_stack *nstack, const raptor_uri_handler *uri_handler, void *uri_context, raptor_simple_message_handler error_handler, void *error_data, int defaults) int raptor_namespaces_init(raptor_world* world, raptor_namespace_stack *nstack, int defaults)  
int raptor_namespaces_init_v2(raptor_world* world, raptor_namespace_stack *nstack, raptor_simple_message_handler error_handler, void *error_data, int defaults) int raptor_namespaces_init(raptor_world* world, raptor_namespace_stack *nstack, int defaults)  
raptor_iostream* raptor_new_iostream_from_file_handle(FILE *handle) raptor_iostream* raptor_new_iostream_from_file_handle(raptor_world* world, FILE *handle)  
raptor_iostream* raptor_new_iostream_from_filename(const char* filename) raptor_iostream* raptor_new_iostream_from_filename(raptor_world* world, const char* filename)  
raptor_iostream* raptor_new_iostream_from_handler(void *context, const raptor_iostream_handler *handler) raptor_iostream* raptor_new_iostream_from_handler(raptor_world* world, void *user_data, const raptor_iostream_handler* const handler)  
raptor_iostream* raptor_new_iostream_from_handler2(void *user_data, const raptor_iostream_handler2* const handler2) raptor_iostream* raptor_new_iostream_from_handler(raptor_world* world, void *user_data, const raptor_iostream_handler* const handler)  
raptor_iostream* raptor_new_iostream_from_sink(void) raptor_iostream* raptor_new_iostream_from_sink(raptor_world* world)  
raptor_iostream* raptor_new_iostream_from_string(void *string, size_t length) raptor_iostream* raptor_new_iostream_from_string(raptor_world* world, void *string, size_t length)  
raptor_iostream* raptor_new_iostream_to_file_handle(FILE *handle) raptor_iostream* raptor_new_iostream_to_file_handle(raptor_world* world, FILE *handle)  
raptor_iostream* raptor_new_iostream_to_filename(const char* filename) raptor_iostream* raptor_new_iostream_to_filename(raptor_world* world, const char* filename)  
raptor_iostream* raptor_new_iostream_to_sink(void) raptor_iostream* raptor_new_iostream_to_sink(raptor_world* world)  
raptor_iostream* raptor_new_iostream_to_string(void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)) raptor_iostream* raptor_new_iostream_to_string(raptor_world* world, void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size))  
raptor_namespace_stack* raptor_new_namespaces(const raptor_uri_handler *uri_handler, void *uri_context, raptor_simple_message_handler error_handler, void *error_data, int defaults) raptor_namespace_stack* raptor_new_namespaces(raptor_world* world, int defaults)  
raptor_namespace_stack* raptor_new_namespaces_v2(raptor_world* world, raptor_simple_message_handler error_handler, void *error_data, int defaults) raptor_namespace_stack* raptor_new_namespaces(raptor_world* world, int defaults)  
raptor_parser* raptor_new_parser(const char* name) raptor_parser* raptor_new_parser(raptor_world* world, const char* name)  
raptor_parser* raptor_new_parser_for_content(raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) raptor_parser* raptor_new_parser_for_content(raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier)  
raptor_qname* raptor_new_qname(raptor_namespace_stack *nstack, const unsigned char* name, const unsigned char* value, raptor_simple_message_handler error_handler, void *error_data) raptor_qname* raptor_new_qname(raptor_namespace_stack *nstack, const unsigned char* name, const unsigned char* value)  
raptor_qname* raptor_new_qname_from_namespace_local_name(raptor_namespace *ns, const unsigned char* local_name, const unsigned char* value) raptor_qname* raptor_new_qname_from_namespace_local_name(raptor_world* world, raptor_namespace *ns, const unsigned char* local_name, const unsigned char* value)  
raptor_sax2* raptor_new_sax2(void *user_data, raptor_error_handlers* error_handlers) raptor_sax2* raptor_new_sax2(raptor_world *world, raptor_locator *locator, void* user_data)  
raptor_sequence* raptor_new_sequence(raptor_sequence_free_handler* free_handler, raptor_sequence_print_handler* print_handler) raptor_sequence* raptor_new_sequence(raptor_data_free_handler free_handler, raptor_data_print_handler print_handler)  
raptor_sequence* raptor_new_sequence_v2(raptor_sequence_free_handler_v2* free_handler, raptor_sequence_print_handler_v2* print_handler, void* handler_context) raptor_sequence* raptor_new_sequence(raptor_data_free_handler free_handler, raptor_data_print_handler print_handler)  
raptor_serializer* raptor_new_serializer(const char* name) raptor_serializer* raptor_new_serializer(raptor_world* world, const char* name)  
raptor_uri* raptor_new_uri(const unsigned char* uri_string) raptor_uri* raptor_new_uri(raptor_world* world, const unsigned char* uri_string)  
raptor_uri* raptor_new_uri_for_rdf_concept(const char* name) raptor_uri* raptor_new_uri_for_rdf_concept(raptor_world* world, const unsigned char* name)  
raptor_uri* raptor_new_uri_for_rdf_concept_v2(raptor_world* world, const char* name) raptor_uri* raptor_new_uri_for_rdf_concept(raptor_world* world, const unsigned char* name)  
raptor_uri* raptor_new_uri_for_retrieval_v2(raptor_world* world, raptor_uri* old_uri) raptor_uri* raptor_new_uri_for_retrieval(raptor_uri* old_uri)  
raptor_uri* raptor_new_uri_for_xmlbase_v2(raptor_world* world, raptor_uri* old_uri) raptor_uri* raptor_new_uri_for_xmlbase(raptor_uri* old_uri)  
raptor_uri* raptor_new_uri_from_id(raptor_uri *base_uri, const unsigned char* id) raptor_uri* raptor_new_uri_from_id(raptor_world* world, raptor_uri *base_uri, const unsigned char* id)  
raptor_uri* raptor_new_uri_from_uri_local_name(raptor_uri *uri, const unsigned char* local_name) raptor_uri* raptor_new_uri_from_uri_local_name(raptor_world* world, raptor_uri *uri, const unsigned char* local_name)  
raptor_uri* raptor_new_uri_relative_to_base(raptor_uri *base_uri, const unsigned char* uri_string) raptor_uri* raptor_new_uri_relative_to_base(raptor_world* world, raptor_uri *base_uri, const unsigned char* uri_string)  
raptor_xml_writer* raptor_new_xml_writer(raptor_namespace_stack *nstack, const raptor_uri_handler *uri_handler, void *uri_context, raptor_iostream* iostr, raptor_simple_message_handler error_handler, void *error_data, int canonicalize) raptor_xml_writer* raptor_new_xml_writer(raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr)  
raptor_xml_writer* raptor_new_xml_writer_v2(raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr, raptor_simple_message_handler error_handler, void *error_data, int canonicalize) raptor_xml_writer* raptor_new_xml_writer(raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr)  
const unsigned char* raptor_parser_get_feature_string(raptor_parser *parser, raptor_feature feature) const unsigned char* raptor_parser_get_option(raptor_parser *parser, raptor_option option, char** string_p, int* integer_p)  
int raptor_parser_set_feature_string(raptor_parser *parser, raptor_feature feature, const unsigned char* value) int raptor_parser_set_option(raptor_parser *parser, raptor_option option, char* string, int integer)  
int raptor_parsers_enumerate(const unsigned int counter, const char* *name, const char* *label) raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, unsigned int counter)  
int raptor_parsers_enumerate_v2(raptor_world* world, const unsigned int counter, const char* *name, const char* *label) raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, const unsigned int counter)  
void raptor_print_locator(FILE *stream, raptor_locator* locator) int raptor_locator_print(raptor_locator* locator, FILE *stream)  
void raptor_print_locator_v2(raptor_world* world, FILE *stream, raptor_locator* locator) void raptor_locator_print(raptor_locator* locator, FILE *stream)  
void raptor_print_statement(const raptor_statement * statement, FILE *stream) int raptor_statement_print(const raptor_statement * statement, FILE *stream)  
void raptor_print_statement_as_ntriples(const raptor_statement * statement, FILE *stream) int raptor_statement_print_as_ntriples(const raptor_statement * statement, FILE *stream)  
void raptor_print_statement_as_ntriples_v2(const raptor_statement_v2 * statement, FILE *stream) int raptor_statement_print_as_ntriples(const raptor_statement * statement, FILE *stream)  
void raptor_print_statement_v2(const raptor_statement_v2 * statement, FILE *stream) int raptor_statement_print(const raptor_statement * statement, FILE *stream)  
raptor_uri* raptor_qname_string_to_uri(raptor_namespace_stack *nstack, const unsigned char* name, size_t name_len, raptor_simple_message_handler error_handler, void *error_data) raptor_uri* raptor_qname_string_to_uri(raptor_namespace_stack *nstack, const unsigned char* name, size_t name_len)  
void raptor_sequence_print(raptor_sequence* seq, FILE* fh) int raptor_sequence_print(raptor_sequence* seq, FILE* fh)  
void raptor_sequence_sort(raptor_sequence* seq, int(*compare)(const void *, const void *)) void raptor_sequence_sort(raptor_sequence* seq, raptor_data_compare_handler compare)  
int raptor_serialize_statement(raptor_serializer* rdf_serializer, const raptor_statement *statement) int raptor_serializer_serialize_statement(raptor_serializer* rdf_serializer, raptor_statement *statement)  
int raptor_serializer_features_enumerate(const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_SERIALIZER +
int raptor_serializer_features_enumerate_v2(raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_SERIALIZER +
int raptor_serializer_get_feature(raptor_serializer *serializer, raptor_feature feature) int raptor_serializer_get_option(raptor_serializer *serializer, raptor_option option)  
const unsigned char* raptor_serializer_get_feature_string(raptor_serializer *serializer, raptor_feature feature) int raptor_serializer_get_option(raptor_serializer *serializer, raptor_option option, char** string_p, int* integer_p)  
int raptor_serializer_set_feature(raptor_serializer *serializer, raptor_feature feature, int value) int raptor_serializer_set_option(raptor_serializer *serializer, raptor_option option, char* string, int integer)  
int raptor_serializer_set_feature_string(raptor_serializer *serializer, raptor_feature feature, const unsigned char* value) int raptor_serializer_set_option(raptor_serializer *serializer, raptor_option option, char* string, int integer)  
int raptor_serializer_syntax_name_check(const char* name) int raptor_world_is_serializer_name(raptor_world* world, const char* name)  
int raptor_serializers_enumerate(const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) const raptor_syntax_description* raptor_world_get_serializer_description(raptor_world* world, unsigned int counter)  
int raptor_serializers_enumerate_v2(raptor_world* world, const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) const raptor_syntax_description* raptor_world_get_serializer_description(raptor_world* world, const unsigned int counter)  
void raptor_set_default_generate_id_parameters(raptor_parser* rdf_parser, char* prefix, int base) void raptor_world_set_generate_bnodeid_parameters(raptor_world* world, char* prefix, int base)  
int raptor_set_feature(raptor_parser *parser, raptor_feature feature, int value) int raptor_parser_set_option(raptor_parser *parser, raptor_option option, char* string, int integer)  
void raptor_set_generate_id_handler(raptor_parser* parser, void *user_data, raptor_generate_id_handler handler) void raptor_world_set_generate_bnodeid_handler(raptor_world* world, void *user_data, raptor_generate_bnodeid_handler handler)  
void raptor_set_graph_handler(raptor_parser* parser, void *user_data, raptor_graph_handler handler) void raptor_parser_set_graph_mark_handler(raptor_parser* parser, void *user_data, raptor_graph_mark_handler handler)  
void raptor_set_libxslt_security_preferences(void *security_preferences) int raptor_world_set_libxslt_security_preferences(raptor_world *world, void *security_preferences)  
int raptor_statement_compare_v2(const raptor_statement_v2 *s1, const raptor_statement_v2 *s2) int raptor_statement_compare(const raptor_statement *s1, const raptor_statement *s2)  
int raptor_syntax_name_check(const char* name) int raptor_world_is_parser_name(raptor_world* world, const char *name)  
int raptor_syntax_name_check_v2(raptor_world* world, const char* name) int raptor_world_is_parser_name(raptor_world* world, const char *name)  
int raptor_syntaxes_enumerate(const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, const unsigned int counter)  
int raptor_syntaxes_enumerate_v2(raptor_world* world, const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, const unsigned int counter)  
int raptor_unicode_char_to_utf8(raptor_unichar c, unsigned char* output) int raptor_unicode_utf8_string_put_char(raptor_unichar c, unsigned char* output, size_t length)  
unsigned char* raptor_uri_as_counted_string_v2(raptor_world* world, raptor_uri *uri, size_t* len_p) unsigned char* raptor_uri_as_counted_string(raptor_uri *uri, size_t* len_p)  
unsigned char* raptor_uri_as_string_v2(raptor_world* world, raptor_uri *uri) unsigned char* raptor_uri_as_string(raptor_uri *uri)  
int raptor_uri_compare_v2(raptor_world* world, raptor_uri* uri1, raptor_uri* uri2) int raptor_uri_compare(raptor_uri* uri1, raptor_uri* uri2)  
raptor_uri* raptor_uri_copy_v2(raptor_world* world, raptor_uri *uri) raptor_uri* raptor_uri_copy(raptor_uri *uri)  
int raptor_uri_equals_v2(raptor_world* world, raptor_uri* uri1, raptor_uri* uri2) int raptor_uri_equals(raptor_uri* uri1, raptor_uri* uri2)  
void raptor_uri_print(const raptor_uri* uri, FILE *stream) int raptor_uri_print(const raptor_uri* uri, FILE *stream)  
void raptor_uri_print_v2(raptor_world* world, const raptor_uri* uri, FILE *stream) int raptor_uri_print(const raptor_uri* uri, FILE *stream)  
void raptor_uri_resolve_uri_reference(const unsigned char* base_uri, const unsigned char* reference_uri, unsigned char* buffer, size_t length) size_t raptor_uri_resolve_uri_reference(const unsigned char* base_uri, const unsigned char* reference_uri, unsigned char* buffer, size_t length)  
unsigned char* raptor_uri_to_counted_string_v2(raptor_world* world, raptor_uri *uri, size_t *len_p) unsigned char* raptor_uri_to_counted_string(raptor_uri *uri, size_t *len_p)  
unsigned char* raptor_uri_to_relative_counted_uri_string_v2(raptor_world* world, raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p) unsigned char* raptor_uri_to_relative_counted_uri_string(raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p)  
unsigned char* raptor_uri_to_relative_uri_string_v2(raptor_world* world, raptor_uri *base_uri, raptor_uri *reference_uri) unsigned char* raptor_uri_to_relative_uri_string(raptor_uri *base_uri, raptor_uri *reference_uri)  
unsigned char* raptor_uri_to_string_v2(raptor_world* world, raptor_uri *uri) unsigned char* raptor_uri_to_string(raptor_uri *uri)  
int raptor_utf8_to_unicode_char(raptor_unichar* output, const unsigned char* input, int length) int raptor_unicode_utf8_string_get_char(const unsigned char* input, size_t length, raptor_unichar* output)  
void raptor_world_set_libxml_flags(raptor_world *world, int flags) int raptor_world_set_flag(raptor_world *world, raptor_world_flag flag, int value)  
void raptor_world_set_libxslt_security_preferences(raptor_world *world, void *security_preferences) int raptor_world_set_libxslt_security_preferences(raptor_world *world, void *security_preferences)  
int raptor_www_fetch_to_string(raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)) int raptor_www_fetch_to_string(raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, raptor_data_malloc_handler const malloc_handler)  
raptor_www* raptor_www_new(void) raptor_www* raptor_new_www(raptor_world* world)  
raptor_www* raptor_www_new_with_connection(void* connection) raptor_www* raptor_new_www_with_connection(raptor_world* world, void* connection)  
int raptor_xml_any_escape_string(const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, int xml_version, raptor_simple_message_handler error_handler, void *error_data) int raptor_xml_escape_string_any(raptor_world* world, const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, int xml_version)  
int raptor_xml_escape_string(const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, raptor_simple_message_handler error_handler, void *error_data) int raptor_xml_escape_string(raptor_world *world, const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote)  
int raptor_xml_writer_features_enumerate(const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_XML_WRITER +
int raptor_xml_writer_features_enumerate_v2(raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_XML_WRITER +
int raptor_xml_writer_get_feature(raptor_xml_writer *xml_writer, raptor_feature feature) int raptor_xml_writer_get_option(raptor_xml_writer *xml_writer, raptor_option option, char** string_p, int* integer_p)  
const unsigned char* raptor_xml_writer_get_feature_string(raptor_xml_writer *xml_writer, raptor_feature feature) const unsigned char* raptor_xml_writer_get_option(raptor_xml_writer *xml_writer, raptor_option option, char** string_p, int* integer_p)  
int raptor_xml_writer_set_feature(raptor_xml_writer *xml_writer, raptor_feature feature, int value) int raptor_xml_writer_set_option(raptor_xml_writer *xml_writer, raptor_option option, char* string, int integer)  
int raptor_xml_writer_set_feature_string(raptor_xml_writer *xml_writer, raptor_feature feature, const unsigned char* value) int raptor_xml_writer_set_option(raptor_xml_writer *xml_writer, raptor_option option, char* string, int integer)  
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1.4.21 type2.0.0 typeNotes
raptor_feature raptor_option And new option RAPTOR_OPTION_STRICT added.
raptor_graph_handler raptor_graph_mark_handler  
raptor_identifier raptor_term Fields changed to be simpler raptor_term_type and raptor_term_value +
raptor_identifier_type raptor_term_type Removed several enum values to leave just URI, blank and literal types.
raptor_iostream_handler2 raptor_iostream_handler  
raptor_iostream_write_end_func raptor_iostream_write_end_func handler returns an int
raptor_log_level raptor_log_level Added RAPTOR_LOG_LEVEL_TRACE, RAPTOR_LOG_LEVEL_DEBUG, RAPTOR_LOG_LEVEL_INFO. RAPTOR_LOG_LEVEL_WARNING renamed RAPTOR_LOG_LEVEL_WARN +
raptor_sequence_free_function raptor_data_free_handler  
raptor_sequence_free_handler_v2 raptor_data_context_free_handler  
raptor_sequence_print_handler raptor_data_print_handler  
raptor_sequence_print_handler_v2 raptor_data_context_print_handler  
raptor_simple_message_handler raptor_log_handler Replaced by generic raptor log mechanism. See raptor_world_set_log_handler()
raptor_statement raptor_statement fields changed to use raptor_term +
raptor_statement_handler raptor_statement_handler added const
raptor_statement_v2 raptor_statement Fields changed to be a 3 or 4 tuple of raptor_term +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-10-to-2-0-11.html b/docs/html/raptor2-changes-2-0-10-to-2-0-11.html new file mode 100644 index 0000000..e2c30e4 --- /dev/null +++ b/docs/html/raptor2-changes-2-0-10-to-2-0-11.html @@ -0,0 +1,40 @@ + + + + +Changes between raptor2 2.0.10 and 2.0.11: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.10 and 2.0.11

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-11-to-2-0-12.html b/docs/html/raptor2-changes-2-0-11-to-2-0-12.html new file mode 100644 index 0000000..c6744e7 --- /dev/null +++ b/docs/html/raptor2-changes-2-0-11-to-2-0-12.html @@ -0,0 +1,37 @@ + + + + +Changes between raptor2 2.0.11 and 2.0.12: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.11 and 2.0.12

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-13-to-2-0-14.html b/docs/html/raptor2-changes-2-0-13-to-2-0-14.html new file mode 100644 index 0000000..45223da --- /dev/null +++ b/docs/html/raptor2-changes-2-0-13-to-2-0-14.html @@ -0,0 +1,37 @@ + + + + +Changes between raptor2 2.0.13 and 2.0.14: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.13 and 2.0.14

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-14-to-2-0-15.html b/docs/html/raptor2-changes-2-0-14-to-2-0-15.html new file mode 100644 index 0000000..d3eb0c4 --- /dev/null +++ b/docs/html/raptor2-changes-2-0-14-to-2-0-15.html @@ -0,0 +1,46 @@ + + + + +Changes between raptor2 2.0.14 and 2.0.15: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.14 and 2.0.15

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+ +
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-15-to-2-0-16.html b/docs/html/raptor2-changes-2-0-15-to-2-0-16.html new file mode 100644 index 0000000..e223dfd --- /dev/null +++ b/docs/html/raptor2-changes-2-0-15-to-2-0-16.html @@ -0,0 +1,58 @@ + + + + +Changes between raptor2 2.0.15 and 2.0.16: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.15 and 2.0.16

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+
+

Enums and Constants

+ +
+
+
+

+Deleted functions, types, enums and constants

+
+

Functions

+
    +
  • raptor_www_set_http_accept - Deprecated for raptor_www_set_http_accept2

  • +
  • raptor_www_set_proxy - Deprecated for raptor_www_set_proxy2

  • +
  • raptor_www_set_user_agent - Deprecated for raptor_www_set_user_agent2

  • +
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-3-to-2-0-4.html b/docs/html/raptor2-changes-2-0-3-to-2-0-4.html new file mode 100644 index 0000000..12d7110 --- /dev/null +++ b/docs/html/raptor2-changes-2-0-3-to-2-0-4.html @@ -0,0 +1,40 @@ + + + + +Changes between raptor2 2.0.3 and 2.0.4: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.3 and 2.0.4

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-4-to-2-0-5.html b/docs/html/raptor2-changes-2-0-4-to-2-0-5.html new file mode 100644 index 0000000..3f3e4fe --- /dev/null +++ b/docs/html/raptor2-changes-2-0-4-to-2-0-5.html @@ -0,0 +1,43 @@ + + + + +Changes between raptor2 2.0.4 and 2.0.5: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.4 and 2.0.5

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-5-to-2-0-6.html b/docs/html/raptor2-changes-2-0-5-to-2-0-6.html new file mode 100644 index 0000000..f9dc725 --- /dev/null +++ b/docs/html/raptor2-changes-2-0-5-to-2-0-6.html @@ -0,0 +1,41 @@ + + + + +Changes between raptor2 2.0.5 and 2.0.6: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.5 and 2.0.6

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-6-to-2-0-7.html b/docs/html/raptor2-changes-2-0-6-to-2-0-7.html new file mode 100644 index 0000000..7ec966a --- /dev/null +++ b/docs/html/raptor2-changes-2-0-6-to-2-0-7.html @@ -0,0 +1,53 @@ + + + + +Changes between raptor2 2.0.6 and 2.0.7: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.6 and 2.0.7

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+ +
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-7-to-2-0-8.html b/docs/html/raptor2-changes-2-0-7-to-2-0-8.html new file mode 100644 index 0000000..c14e764 --- /dev/null +++ b/docs/html/raptor2-changes-2-0-7-to-2-0-8.html @@ -0,0 +1,45 @@ + + + + +Changes between raptor2 2.0.7 and 2.0.8: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.7 and 2.0.8

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes-2-0-9-to-2-0-10.html b/docs/html/raptor2-changes-2-0-9-to-2-0-10.html new file mode 100644 index 0000000..e252cd7 --- /dev/null +++ b/docs/html/raptor2-changes-2-0-9-to-2-0-10.html @@ -0,0 +1,45 @@ + + + + +Changes between raptor2 2.0.9 and 2.0.10: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Changes between raptor2 2.0.9 and 2.0.10

+
+

+New functions, types, enums and constants

+
+

Functions

+ +
+ +
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-changes.html b/docs/html/raptor2-changes.html new file mode 100644 index 0000000..197e317 --- /dev/null +++ b/docs/html/raptor2-changes.html @@ -0,0 +1,76 @@ + + + + +API Changes: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+API Changes

+ +

This chapter describes the API changes for raptor2. +

+
+

+Introduction

+

+The following sections describe the changes in the API between +versions including additions, deletions, renames (retaining the same +number of parameters, types and return value type) and more complex +changes to functions, types, enums and constants. +

+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-avltree.html b/docs/html/raptor2-section-avltree.html new file mode 100644 index 0000000..c76017d --- /dev/null +++ b/docs/html/raptor2-section-avltree.html @@ -0,0 +1,799 @@ + + + + +section-avltree: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-avltree

+

section-avltree

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_avltree * + +raptor_new_avltree () +
+void + +raptor_free_avltree () +
+int + +raptor_avltree_add () +
+int + +raptor_avltree_delete () +
+int + +raptor_avltree_print () +
+void * + +raptor_avltree_remove () +
+void * + +raptor_avltree_search () +
+void + +raptor_avltree_set_print_handler () +
+int + +raptor_avltree_size () +
+void + +raptor_avltree_trim () +
+int + +raptor_avltree_visit () +
+raptor_avltree_iterator * + +raptor_new_avltree_iterator () +
+void + +raptor_free_avltree_iterator () +
+void * + +raptor_avltree_iterator_get () +
+int + +raptor_avltree_iterator_is_end () +
+int + +raptor_avltree_iterator_next () +
+int + +(*raptor_avltree_visit_handler) () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
typedefraptor_avltree
enumraptor_avltree_bitflags
typedefraptor_avltree_iterator
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_avltree ()

+
raptor_avltree *
+raptor_new_avltree (raptor_data_compare_handler compare_handler,
+                    raptor_data_free_handler free_handler,
+                    unsigned int flags);
+

AVL Tree Constructor

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

compare_handler

item comparison handler for ordering

 

free_handler

item free handler (or NULL)

 

flags

AVLTree flags - bitmask of raptor_avltree_bitflags flags.

 
+
+
+

Returns

+

new AVL Tree or NULL on failure

+
+
+
+
+

raptor_free_avltree ()

+
void
+raptor_free_avltree (raptor_avltree *tree);
+

AVL Tree destructor

+
+

Parameters

+
+++++ + + + + + +

tree

AVLTree object

 
+
+
+
+
+

raptor_avltree_add ()

+
int
+raptor_avltree_add (raptor_avltree *tree,
+                    void *p_data);
+

add an item to an AVL Tree

+

The item added becomes owned by the AVL Tree, and will be freed by +the free_handler argument given to raptor_new_avltree().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

tree

AVL Tree object

 

p_data

pointer to data item

 
+
+
+

Returns

+

0 on success, >0 if equivalent item exists (and the old element remains in the tree), <0 on failure

+
+
+
+
+

raptor_avltree_delete ()

+
int
+raptor_avltree_delete (raptor_avltree *tree,
+                       void *p_data);
+

Remove an item from an AVL Tree and free it

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

tree

AVL Tree object

 

p_data

pointer to data item

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_avltree_print ()

+
int
+raptor_avltree_print (raptor_avltree *tree,
+                      FILE *stream);
+

Print the items in the tree in order to a stream (for debugging)

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

tree

AVL Tree

 

stream

stream to print to

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_avltree_remove ()

+
void *
+raptor_avltree_remove (raptor_avltree *tree,
+                       void *p_data);
+

Remove an item from an AVL Tree and return it

+

The item removed is no longer owned by the AVL Tree and is +owned by the caller.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

tree

AVL Tree object

 

p_data

pointer to data item

 
+
+
+

Returns

+

object or NULL on failure or if not found

+
+
+
+
+

raptor_avltree_search ()

+
void *
+raptor_avltree_search (raptor_avltree *tree,
+                       const void *p_data);
+

Find an item in an AVL Tree

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

tree

AVL Tree object

 

p_data

pointer to data item

 
+
+
+

Returns

+

shared pointer to item (still owned by AVL Tree) or NULL on failure or if not found

+
+
+
+
+

raptor_avltree_set_print_handler ()

+
void
+raptor_avltree_set_print_handler (raptor_avltree *tree,
+                                  raptor_data_print_handler print_handler);
+

Set the handler for printing an item in a tree

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

tree

AVL Tree object

 

print_handler

print function

 
+
+
+
+
+

raptor_avltree_size ()

+
int
+raptor_avltree_size (raptor_avltree *tree);
+

Get the number of items in the AVL Tree

+
+

Parameters

+
+++++ + + + + + +

tree

AVL Tree object

 
+
+
+

Returns

+

number of items in tree

+
+
+
+
+

raptor_avltree_trim ()

+
void
+raptor_avltree_trim (raptor_avltree *tree);
+

Delete all nodes from an AVL tree but keep the shell.

+
+

Parameters

+
+++++ + + + + + +

tree

AVLTree object

 
+
+
+
+
+

raptor_avltree_visit ()

+
int
+raptor_avltree_visit (raptor_avltree *tree,
+                      raptor_avltree_visit_handler visit_handler,
+                      void *user_data);
+

Perform an in-order visit of the items in the AVL Tree

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

tree

AVL Tree object

 

visit_handler

visit function to call at each item

 

user_data

user data pointer fo visit function

 
+
+
+

Returns

+

non-0 if traversal was terminated early by visit_handler +

+
+
+
+
+

raptor_new_avltree_iterator ()

+
raptor_avltree_iterator *
+raptor_new_avltree_iterator (raptor_avltree *tree,
+                             void *range,
+                             raptor_data_free_handler range_free_handler,
+                             int direction);
+

Get an in-order iterator for the start of a range, or the entire contents

+

If range is NULL, the entire tree is walked in order. If range +specifies a range (i.e. the tree comparison function will 'match' +(return 0 for) range and /several/ nodes), the iterator will be +placed at the leftmost child matching range, and +raptor_avltree_iterator_next will iterate over all nodes (and only +nodes) that match range.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

tree

raptor_avltree object

 

range

range

 

range_free_handler

function to free range +object

 

direction

<0 to go 'backwards' otherwise 'forwards'

 
+
+
+

Returns

+

a new raptor_avltree_iterator object or NULL on failure

+
+
+
+
+

raptor_free_avltree_iterator ()

+
void
+raptor_free_avltree_iterator (raptor_avltree_iterator *iterator);
+

AVL Tree Iterator destructor

+
+

Parameters

+
+++++ + + + + + +

iterator

AVL Tree iterator object

 
+
+
+
+
+

raptor_avltree_iterator_get ()

+
void *
+raptor_avltree_iterator_get (raptor_avltree_iterator *iterator);
+

Get current iteration object

+
+

Parameters

+
+++++ + + + + + +

iterator

AVL Tree iterator object

 
+
+
+

Returns

+

object or NULL if iteration is finished

+
+
+
+
+

raptor_avltree_iterator_is_end ()

+
int
+raptor_avltree_iterator_is_end (raptor_avltree_iterator *iterator);
+

Test if an iteration is finished

+
+

Parameters

+
+++++ + + + + + +

iterator

AVL Tree iterator object

 
+
+
+

Returns

+

non-0 if iteration is finished

+
+
+
+
+

raptor_avltree_iterator_next ()

+
int
+raptor_avltree_iterator_next (raptor_avltree_iterator *iterator);
+

Move iteration to next/prev object

+
+

Parameters

+
+++++ + + + + + +

iterator

AVL Tree iterator object

 
+
+
+

Returns

+

non-0 if iteration is finished

+
+
+
+
+

raptor_avltree_visit_handler ()

+
int
+(*raptor_avltree_visit_handler) (int depth,
+                                 void *data,
+                                 void *user_data);
+

AVL Tree visitor function as given to raptor_avltree_visit()

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

depth

depth of object in tree

 

data

data object being visited

 

user_data

user data arg to raptor_avltree_visit()

 
+
+
+

Returns

+

non-0 to terminate visit early.

+
+
+
+
+

Types and Values

+
+

raptor_avltree

+
typedef struct raptor_avltree_s raptor_avltree;
+
+

AVL Tree

+
+
+
+

enum raptor_avltree_bitflags

+

Bit flags for AVL Tree class constructor raptor_new_avltree()

+
+

Members

+
+++++ + + + + + +

RAPTOR_AVLTREE_FLAG_REPLACE_DUPLICATES

+

If set raptor_avltree_add() will replace any duplicate items. If not set, raptor_avltree_add() will not replace them and will return status >0 when adding a duplicate. (Default is not set)

+
 
+
+
+
+
+

raptor_avltree_iterator

+
typedef struct raptor_avltree_iterator_s raptor_avltree_iterator;
+
+

AVL Tree Iterator as created by raptor_new_avltree_iterator()

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-constants.html b/docs/html/raptor2-section-constants.html new file mode 100644 index 0000000..460e8ca --- /dev/null +++ b/docs/html/raptor2-section-constants.html @@ -0,0 +1,138 @@ + + + + +section-constants: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-constants

+

section-constants

+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
extern const unsigned int raptor_rdf_namespace_uri_len
extern const unsigned int raptor_rdf_schema_namespace_uri_len
extern const unsigned int raptor_xml_literal_datatype_uri_string_len
#defineRAPTOR_RDF_MS_URI
#defineRAPTOR_RDF_SCHEMA_URI
#defineRAPTOR_XMLSCHEMA_DATATYPES_URI
#defineRAPTOR_OWL_URI
+
+
+

Description

+
+
+

Functions

+

+
+
+

Types and Values

+
+

raptor_rdf_namespace_uri_len

+
extern const unsigned int raptor_rdf_namespace_uri_len;
+
+

Length of raptor_rdf_namespace_uri string

+
+
+
+

raptor_rdf_schema_namespace_uri_len

+
extern const unsigned int raptor_rdf_schema_namespace_uri_len;
+
+
+
+
+

raptor_xml_literal_datatype_uri_string_len

+
extern const unsigned int raptor_xml_literal_datatype_uri_string_len;
+
+

Length of raptor_xml_literal_datatype_uri_string

+
+
+
+

RAPTOR_RDF_MS_URI

+
#define RAPTOR_RDF_MS_URI raptor_rdf_namespace_uri
+
+

RDF Namespace URI (rdf:).

+

Copy with raptor_uri_copy() to use.

+
+
+
+

RAPTOR_RDF_SCHEMA_URI

+
#define RAPTOR_RDF_SCHEMA_URI raptor_rdf_schema_namespace_uri
+
+

RDF Schema Namespace URI (rdfs:).

+

Copy with raptor_uri_copy() to use.

+
+
+
+

RAPTOR_XMLSCHEMA_DATATYPES_URI

+
#define RAPTOR_XMLSCHEMA_DATATYPES_URI raptor_xmlschema_datatypes_namespace_uri
+
+

XML Schema Datatypes URI (xsd:).

+

Copy with raptor_uri_copy() to use.

+
+
+
+

RAPTOR_OWL_URI

+
#define RAPTOR_OWL_URI raptor_owl_namespace_uri
+
+

OWL Namespace URI (owl:).

+

Copy with raptor_uri_copy() to use.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-general.html b/docs/html/raptor2-section-general.html new file mode 100644 index 0000000..8903e5d --- /dev/null +++ b/docs/html/raptor2-section-general.html @@ -0,0 +1,1496 @@ + + + + +section-general: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-general

+

section-general

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+void + +(*raptor_statement_handler) () +
+int + +raptor_snprintf () +
+int + +raptor_vasprintf () +
+char * + +raptor_vsnprintf () +
+int + +raptor_vsnprintf2 () +
+void + +raptor_sort_r () +
+void + +(*raptor_log_handler) () +
const char * + +raptor_log_level_get_label () +
const char * + +raptor_domain_get_label () +
+int + +(*raptor_data_compare_handler) () +
+int + +(*raptor_data_compare_arg_handler) () +
+void + +(*raptor_data_context_free_handler) () +
+int + +(*raptor_data_context_print_handler) () +
+void + +(*raptor_data_free_handler) () +
+void * + +(*raptor_data_malloc_handler) () +
+int + +(*raptor_data_print_handler) () +
+char * + +(*raptor_generate_bnodeid_handler) () +
+int + +raptor_syntax_description_validate () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineRAPTOR_VERSION
#defineRAPTOR_VERSION_MAJOR
#defineRAPTOR_VERSION_MINOR
#defineRAPTOR_VERSION_RELEASE
#defineRAPTOR_VERSION_STRING
extern const unsigned int raptor_version_major
extern const unsigned int raptor_version_minor
extern const unsigned int raptor_version_release
extern const unsigned int raptor_version_decimal
extern const char * const raptor_copyright_string
extern const char * const raptor_home_url_string
extern const char * const raptor_license_string
extern const char * const raptor_short_copyright_string
extern const char * const raptor_version_string
extern const unsigned char * const raptor_owl_namespace_uri
extern const unsigned char * const raptor_rdf_namespace_uri
extern const unsigned char * const raptor_rdf_schema_namespace_uri
extern const unsigned char * const raptor_xml_literal_datatype_uri_string
extern const unsigned char * const raptor_xml_namespace_uri
extern const unsigned char * const raptor_xmlschema_datatypes_namespace_uri
 raptor_log_message
enumraptor_log_level
enumraptor_domain
enumraptor_syntax_bitflags
 raptor_syntax_description
 raptor_type_q
+
+
+

Description

+
+
+

Functions

+
+

raptor_statement_handler ()

+
void
+(*raptor_statement_handler) (void *user_data,
+                             raptor_statement *statement);
+

Statement (triple) reporting handler function.

+

This handler function set with +raptor_parser_set_statement_handler() on a parser receives +statements as the parsing proceeds. The statement + argument to the +handler is shared and must be copied by the caller with +raptor_statement_copy().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

user_data

user data

 

statement

statement to report

 
+
+
+
+
+

raptor_snprintf ()

+
int
+raptor_snprintf (char *buffer,
+                 size_t size,
+                 const char *format,
+                 ...);
+

Format output into an allocated sized buffer

+

This provides a portable version snprintf() over variants on +different systems.

+

If buffer + is NULL, calculates the number of bytes needed to +allocate for buffer and do no formatting.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

buffer

buffer (or NULL)

 

size

bufer size (or 0)

 

format

printf-style format string

 

...

format arguments

 
+
+
+

Returns

+

number of bytes allocated (excluding NUL) or 0 on failure

+
+
+
+
+

raptor_vasprintf ()

+
int
+raptor_vasprintf (char **ret,
+                  const char *format,
+                  va_list arguments);
+

Format output into a new buffer and return it

+

This is a wrapper around the (GNU) vasprintf function that is not +always avaiable.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

ret

pointer to store buffer

 

format

printf-style format string

 

arguments

format arguments list

 
+
+
+

Returns

+

number of bytes allocated (excluding NUL) or < 0 on failure

+
+
+
+
+

raptor_vsnprintf ()

+
char *
+raptor_vsnprintf (const char *format,
+                  va_list arguments);
+

raptor_vsnprintf is deprecated and should not be used in newly-written code.

+

Format output for a variable arguments list into a newly allocated buffer

+

Deprecated +: This does not actually conform to vsnprintf's calling +convention and does not return the allocated buffer length. Use +raptor_vsnprintf2() or raptor_vasprintf() instead.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

format

printf-style format string

 

arguments

variable arguments list

 
+
+
+

Returns

+

a newly allocated string as the formatted result or NULL on failure

+
+
+
+
+

raptor_vsnprintf2 ()

+
int
+raptor_vsnprintf2 (char *buffer,
+                   size_t size,
+                   const char *format,
+                   va_list arguments);
+

Format output for a variable arguments list into an allocated sized buffer.

+

This is a wrapper around system versions of vsnprintf with +different call and return conventions.

+

If buffer + is NULL or size is 0 or the buffer size is too small, +returns the number of bytes that would be needed for buffer

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

buffer

buffer (or NULL)

 

size

size of buffer (or 0)

 

format

printf-style format string

 

arguments

variable arguments list

 
+
+
+

Returns

+

number of bytes allocated (excluding NUL) or <0 on failure

+
+
+
+
+

raptor_sort_r ()

+
void
+raptor_sort_r (void *base,
+               size_t nel,
+               size_t width,
+               raptor_data_compare_arg_handler compar,
+               void *user_data);
+

Sort an array with an extra user data arg for the comparison funciton.

+

Sorts data at base + of nel + elememnts of width width + using +comparison function comp + that takes args (void* data1, void* +data2, user_data +) and returns <0, 0, or >0 for object comparison.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

base

the array to be sorted

 

nel

the number of elements in the array

 

width

the size in bytes of each element of the array

 

compar

comparison function

 

user_data

a pointer to be passed to the comparison function

 
+
+
+
+
+

raptor_log_handler ()

+
void
+(*raptor_log_handler) (void *user_data,
+                       raptor_log_message *message);
+

Handler function for log messages with location

+

Used during parsing and serializing for errors and warnings that +may include location information. Handlers may be set +by raptor_world_set_log_handler().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

user_data

user data

 

message

log message

 
+
+
+
+
+

raptor_log_level_get_label ()

+
const char *
+raptor_log_level_get_label (raptor_log_level level);
+

Get label for a log message level

+
+

Parameters

+
+++++ + + + + + +

level

log message level

 
+
+
+

Returns

+

label string or NULL if level is not valid

+
+
+
+
+

raptor_domain_get_label ()

+
const char *
+raptor_domain_get_label (raptor_domain domain);
+

Get label for a domain

+
+

Parameters

+
+++++ + + + + + +

domain

domain

 
+
+
+

Returns

+

label string or NULL if domain is not valid

+
+
+
+
+

raptor_data_compare_handler ()

+
int
+(*raptor_data_compare_handler) (const void *data1,
+                                const void *data2);
+

Function to compare two data objects - signature like strcmp() and function pssed to qsort()

+

Designed to be passed into generic data structure constructors +like raptor_new_avltree().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

data1

first data object

 

data2

second data object

 
+
+
+

Returns

+

compare value <0 if data1 +is before data2 +, =0 if equal, >0 if data1 +is after data2 +

+
+
+
+
+

raptor_data_compare_arg_handler ()

+
int
+(*raptor_data_compare_arg_handler) (const void *data1,
+                                    const void *data2,
+                                    void *user_data);
+

Function to compare two data objects with a user data argument

+

Designed to be used with raptor_sort_r() and compatible functions +such as raptor_sequence_sort_r() which uses it.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

data1

first object

 

data2

second object

 

user_data

user data argument

 
+
+
+

Returns

+

compare value <0 if data1 +is before data2 +, =0 if equal, >0 if data1 +is after data2 +

+
+
+
+
+

raptor_data_context_free_handler ()

+
void
+(*raptor_data_context_free_handler) (void *context,
+                                     void *object);
+

Handler function for freeing a sequence item with a contextual pointer.

+

Set by raptor_new_sequence_with_context().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

context data for the free function

 

object

object to free

 
+
+
+
+
+

raptor_data_context_print_handler ()

+
int
+(*raptor_data_context_print_handler) (void *context,
+                                      void *object,
+                                      FILE *fh);
+

Function function for printing an object with data context to a stream.

+

Set by raptor_new_sequence_with_context()

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

context

context data for the print function

 

object

object to print

 

fh

FILE* to print to

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_data_free_handler ()

+
void
+(*raptor_data_free_handler) (void *data);
+

Typedef for function to free a data object - signature like free()

+

Designed to be passed into generic data structure constructors +like raptor_new_avltree(). If data + is NULL, nothing should be done.

+
+

Parameters

+
+++++ + + + + + +

data

data object or NULL

 
+
+
+
+
+

raptor_data_malloc_handler ()

+
void *
+(*raptor_data_malloc_handler) (size_t size);
+

Typedef for a function to allocate memory - signature like malloc()

+

Designed to be passed into constructors +like raptor_www_fetch_to_string

+
+

Parameters

+
+++++ + + + + + +

size

data size

 
+
+
+

Returns

+

pointer to newly allocated memory or NULL on failure

+
+
+
+
+

raptor_data_print_handler ()

+
int
+(*raptor_data_print_handler) (void *object,
+                              FILE *fh);
+

Handler function for printing an object to a stream.

+

Set by raptor_new_sequence()

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

object

object to print

 

fh

FILE* to print to

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_generate_bnodeid_handler ()

+
char *
+(*raptor_generate_bnodeid_handler) (void *user_data,
+                                    unsigned char *user_bnodeid);
+

Generate a blank node identifier handler function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

user_data

user data

 

user_bnodeid

a user-specified ID or NULL if none available.

 
+
+
+

Returns

+

new blank node ID to use

+
+
+
+
+

raptor_syntax_description_validate ()

+
int
+raptor_syntax_description_validate (raptor_syntax_description *desc);
+

Validate a syntax description has the required fields (name, labels) and update counts

+
+

Parameters

+
+++++ + + + + + +

desc

description

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

Types and Values

+
+

RAPTOR_VERSION

+
#define RAPTOR_VERSION 20016
+
+

Raptor library version number

+

Format: major * 10000 + minor * 100 + release

+
+
+
+

RAPTOR_VERSION_MAJOR

+
#define RAPTOR_VERSION_MAJOR 2
+
+

Raptor library major version

+
+
+
+

RAPTOR_VERSION_MINOR

+
#define RAPTOR_VERSION_MINOR 0
+
+

Raptor library minor version

+
+
+
+

RAPTOR_VERSION_RELEASE

+
#define RAPTOR_VERSION_RELEASE 16
+
+

Raptor library release

+
+
+
+

RAPTOR_VERSION_STRING

+
#define RAPTOR_VERSION_STRING "2.0.16"
+
+

Raptor library version string

+
+
+
+

raptor_version_major

+
extern const unsigned int raptor_version_major;
+
+

Library major version number as a decimal integer.

+
+
+
+

raptor_version_minor

+
extern const unsigned int raptor_version_minor;
+
+

Library minor version number as a decimal integer.

+
+
+
+

raptor_version_release

+
extern const unsigned int raptor_version_release;
+
+

Library release version number as a decimal integer.

+
+
+
+

raptor_version_decimal

+
extern const unsigned int raptor_version_decimal;
+
+

Library full version as a decimal integer.

+

See also raptor_version_string.

+
+
+
+

raptor_copyright_string

+
extern const char * const raptor_copyright_string;
+
+

Copyright string (multiple lines).

+
+
+
+

raptor_home_url_string

+
extern const char * const raptor_home_url_string;
+
+

Raptor home page URL.

+
+
+
+

raptor_license_string

+
extern const char * const raptor_license_string;
+
+

Raptor license string.

+
+
+
+

raptor_short_copyright_string

+
extern const char * const raptor_short_copyright_string;
+
+

Short copyright string (one line).

+
+
+
+

raptor_version_string

+
extern const char * const raptor_version_string;
+
+

Library full version as a string.

+

See also raptor_version_decimal.

+
+
+
+

raptor_owl_namespace_uri

+
extern const unsigned char * const raptor_owl_namespace_uri;
+
+

OWL (owl:) Namespace URI string.

+
+
+
+

raptor_rdf_namespace_uri

+
extern const unsigned char * const raptor_rdf_namespace_uri;
+
+

RDF Namespace (rdf:) URI string.

+
+
+
+

raptor_rdf_schema_namespace_uri

+
extern const unsigned char * const raptor_rdf_schema_namespace_uri;
+
+

RDF Schema (rdfs:) Namespace URI string.

+
+
+
+

raptor_xml_literal_datatype_uri_string

+
extern const unsigned char * const raptor_xml_literal_datatype_uri_string;
+
+

XML Literal datatype (rdf:XMLLiteral) URI string.

+
+
+
+

raptor_xml_namespace_uri

+
extern const unsigned char * const raptor_xml_namespace_uri;
+
+

XML Namespace (xml:) URI string.

+
+
+
+

raptor_xmlschema_datatypes_namespace_uri

+
extern const unsigned char * const raptor_xmlschema_datatypes_namespace_uri;
+
+

XML Schema datatypes (xsd:) namespace URI string.

+
+
+
+

raptor_log_message

+
typedef struct {
+  int code;
+  raptor_domain domain;
+  raptor_log_level level;
+  raptor_locator *locator;
+  const char *text;
+} raptor_log_message;
+
+

Log message.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

int code;

error code or < 0 if not used or known

 

raptor_domain domain;

message domain or RAPTOR_DOMAIN_NONE if not used or known

 

raptor_log_level level;

log message level

 

raptor_locator *locator;

location associated with message or NULL if not known

 

const char *text;

message string

 
+
+
+
+
+

enum raptor_log_level

+

Log levels

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

RAPTOR_LOG_LEVEL_NONE

+

Internal

+
 

RAPTOR_LOG_LEVEL_TRACE

+

very fine-grained tracing messages information

+
 

RAPTOR_LOG_LEVEL_DEBUG

+

fine-grained tracing messages suitable for debugging

+
 

RAPTOR_LOG_LEVEL_INFO

+

coarse-grained information messages

+
 

RAPTOR_LOG_LEVEL_WARN

+

warning messages of potentially harmful problems

+
 

RAPTOR_LOG_LEVEL_ERROR

+

error messages where the application can continue

+
 

RAPTOR_LOG_LEVEL_FATAL

+

fatal error message where the application will likely abort

+
 

RAPTOR_LOG_LEVEL_LAST

+

Internal

+
 
+
+
+
+
+

enum raptor_domain

+

Log domain

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

RAPTOR_DOMAIN_NONE

+

Internal

+
 

RAPTOR_DOMAIN_IOSTREAM

+

I/O stream

+
 

RAPTOR_DOMAIN_NAMESPACE

+

XML Namespace / namespace stack

+
 

RAPTOR_DOMAIN_PARSER

+

RDF Parser

+
 

RAPTOR_DOMAIN_QNAME

+

XML QName

+
 

RAPTOR_DOMAIN_SAX2

+

XML SAX2

+
 

RAPTOR_DOMAIN_SERIALIZER

+

RDF Serializer

+
 

RAPTOR_DOMAIN_TERM

+

RDF Term

+
 

RAPTOR_DOMAIN_TURTLE_WRITER

+

Turtle Writer

+
 

RAPTOR_DOMAIN_URI

+

RDF Uri

+
 

RAPTOR_DOMAIN_WORLD

+

RDF world

+
 

RAPTOR_DOMAIN_WWW

+

WWW

+
 

RAPTOR_DOMAIN_XML_WRITER

+

XML Writer

+
 

RAPTOR_DOMAIN_LAST

+

Internal

+
 
+
+
+
+
+

enum raptor_syntax_bitflags

+

Bit flags for raptor_syntax_description flags field

+
+

Members

+
+++++ + + + + + +

RAPTOR_SYNTAX_NEED_BASE_URI

+

the syntax requires a base URI

+
 
+
+
+
+
+

raptor_syntax_description

+
typedef struct {
+  const char* names;
+  unsigned int names_count;
+
+  const char* label;
+
+  const raptor_type_q* mime_types;
+  unsigned int mime_types_count;
+
+  const char* uri_strings;
+  unsigned int uri_strings_count;
+
+  unsigned int flags;
+} raptor_syntax_description;
+
+

Description of a syntax or file format.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

const char *names;

array of syntax names - the first one (required) is the public name, the rest are aliases. The array is NULL terminated.

 

unsigned int names_count;

size of names +array

 

const char *label;

long descriptive label for syntax

 

const raptor_type_q *mime_types;

Array of (MIME type, Q) values associated with the syntax (or NULL). If present the array is NULL terminated.

 

unsigned int mime_types_count;

size of mime_types +array

 

const char *uri_strings;

array of URIs identifying the syntax (or NULL). The first one if present is the main URI, the rest are aliases. The array is NULL terminated.

 

unsigned int uri_strings_count;

size of uri_strings +array

 

unsigned int flags;

See raptor_syntax_bitflags for the bits

 
+
+
+
+
+

raptor_type_q

+
typedef struct {
+  const char* mime_type;
+  size_t mime_type_len;
+  unsigned char q;
+} raptor_type_q;
+
+

(MIME Type, Q) pair

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

const char *mime_type;

MIME type string

 

size_t mime_type_len;

length of mime_type +

 

unsigned char q;

Q value 0-10 standing for decimal 0.0-1.0

 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-iostream.html b/docs/html/raptor2-section-iostream.html new file mode 100644 index 0000000..6bc7eb1 --- /dev/null +++ b/docs/html/raptor2-section-iostream.html @@ -0,0 +1,1749 @@ + + + + +section-iostream: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-iostream

+

section-iostream

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+int + +(*raptor_iostream_init_func) () +
+void + +(*raptor_iostream_finish_func) () +
+int + +(*raptor_iostream_write_byte_func) () +
+int + +(*raptor_iostream_write_bytes_func) () +
+int + +(*raptor_iostream_write_end_func) () +
+int + +(*raptor_iostream_read_bytes_func) () +
+int + +(*raptor_iostream_read_eof_func) () +
+raptor_iostream * + +raptor_new_iostream_from_handler () +
+raptor_iostream * + +raptor_new_iostream_from_sink () +
+raptor_iostream * + +raptor_new_iostream_from_filename () +
+raptor_iostream * + +raptor_new_iostream_from_file_handle () +
+raptor_iostream * + +raptor_new_iostream_from_string () +
+raptor_iostream * + +raptor_new_iostream_to_sink () +
+raptor_iostream * + +raptor_new_iostream_to_filename () +
+raptor_iostream * + +raptor_new_iostream_to_file_handle () +
+raptor_iostream * + +raptor_new_iostream_to_string () +
+void + +raptor_free_iostream () +
+int + +raptor_iostream_hexadecimal_write () +
+int + +raptor_iostream_read_bytes () +
+int + +raptor_iostream_read_eof () +
unsigned long + +raptor_iostream_tell () +
+int + +raptor_iostream_counted_string_write () +
+int + +raptor_iostream_decimal_write () +
+int + +raptor_iostream_string_write () +
+int + +raptor_iostream_write_byte () +
+int + +raptor_iostream_write_bytes () +
+int + +raptor_iostream_write_end () +
+int + +raptor_bnodeid_ntriples_write () +
+int + +raptor_string_escaped_write () +
+int + +raptor_term_escaped_write () +
+int + +raptor_uri_escaped_write () +
+int + +raptor_string_ntriples_write () +
+int + +raptor_string_python_write () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
typedefraptor_iostream
 raptor_iostream_handler
enumraptor_escaped_write_bitflags
+
+
+

Description

+
+
+

Functions

+
+

raptor_iostream_init_func ()

+
int
+(*raptor_iostream_init_func) (void *context);
+

Handler function for raptor_iostream initialising.

+
+

Parameters

+
+++++ + + + + + +

context

stream context data

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_iostream_finish_func ()

+
void
+(*raptor_iostream_finish_func) (void *context);
+

Handler function for raptor_iostream terminating.

+
+

Parameters

+
+++++ + + + + + +

context

stream context data

 
+
+
+
+
+

raptor_iostream_write_byte_func ()

+
int
+(*raptor_iostream_write_byte_func) (void *context,
+                                    const int byte);
+

Handler function for implementing raptor_iostream_write_byte().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

context

stream context data

 

byte

byte to write

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_iostream_write_bytes_func ()

+
int
+(*raptor_iostream_write_bytes_func) (void *context,
+                                     const void *ptr,
+                                     size_t size,
+                                     size_t nmemb);
+

Handler function for implementing raptor_iostream_write_bytes().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

context

stream context data

 

ptr

pointer to bytes to write

 

size

size of item

 

nmemb

number of items

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_iostream_write_end_func ()

+
int
+(*raptor_iostream_write_end_func) (void *context);
+

Handler function for implementing raptor_iostream_write_end().

+
+

Parameters

+
+++++ + + + + + +

context

stream context data

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_iostream_read_bytes_func ()

+
int
+(*raptor_iostream_read_bytes_func) (void *context,
+                                    void *ptr,
+                                    size_t size,
+                                    size_t nmemb);
+

Handler function for implementing raptor_iostream_read_bytes().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

context

stream context data

 

ptr

pointer to buffer to read into

 

size

size of buffer

 

nmemb

number of items

 
+
+
+

Returns

+

number of items read, 0 or < size +on EOF, <0 on failure

+
+
+
+
+

raptor_iostream_read_eof_func ()

+
int
+(*raptor_iostream_read_eof_func) (void *context);
+

Handler function for implementing raptor_iostream_read_eof().

+
+

Parameters

+
+++++ + + + + + +

context

stream context data

 
+
+
+

Returns

+

non-0 if EOF

+
+
+
+
+

raptor_new_iostream_from_handler ()

+
raptor_iostream *
+raptor_new_iostream_from_handler (raptor_world *world,
+                                  void *user_data,
+                                  const raptor_iostream_handler * const handler);
+

Create a new iostream over a user-defined handler

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

user_data

pointer to context information to pass in to calls

 

handler

pointer to handler methods

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_new_iostream_from_sink ()

+
raptor_iostream *
+raptor_new_iostream_from_sink (raptor_world *world);
+

Create a new read iostream from a sink, returning no data.

+

Provides an I/O source that returns end of input immediately on +reads, and throw away all writes. Same as +raptor_new_iostream_to_sink()

+
+

Parameters

+
+++++ + + + + + +

world

raptor world

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_new_iostream_from_filename ()

+
raptor_iostream *
+raptor_new_iostream_from_filename (raptor_world *world,
+                                   const char *filename);
+

Constructor - create a new iostream reading from a filename.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor world

 

filename

Input filename to open and read from

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_new_iostream_from_file_handle ()

+
raptor_iostream *
+raptor_new_iostream_from_file_handle (raptor_world *world,
+                                      FILE *handle);
+

Constructor - create a new iostream reading from a file_handle.

+

The handle + must already be open for reading. +NOTE: This does not fclose the handle + when it is finished.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor world

 

handle

Input file_handle to open and read from

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_new_iostream_from_string ()

+
raptor_iostream *
+raptor_new_iostream_from_string (raptor_world *world,
+                                 void *string,
+                                 size_t length);
+

Constructor - create a new iostream reading from a string.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor world

 

string

pointer to string

 

length

length of string

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_new_iostream_to_sink ()

+
raptor_iostream *
+raptor_new_iostream_to_sink (raptor_world *world);
+

Create a new write iostream to a sink, throwing away all data.

+

Provides an that throw away all writes and returns end of input +immediately on reads. Same as raptor_new_iostream_from_sink()

+
+

Parameters

+
+++++ + + + + + +

world

raptor_world object

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_new_iostream_to_filename ()

+
raptor_iostream *
+raptor_new_iostream_to_filename (raptor_world *world,
+                                 const char *filename);
+

Constructor - create a new iostream writing to a filename.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor world

 

filename

Output filename to open and write to

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_new_iostream_to_file_handle ()

+
raptor_iostream *
+raptor_new_iostream_to_file_handle (raptor_world *world,
+                                    FILE *handle);
+

Constructor - create a new iostream writing to a FILE*.

+

The handle + must already be open for writing. +NOTE: This does not fclose the handle + when it is finished.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor world

 

handle

FILE* handle to write to

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_new_iostream_to_string ()

+
raptor_iostream *
+raptor_new_iostream_to_string (raptor_world *world,
+                               void **string_p,
+                               size_t *length_p,
+                               raptor_data_malloc_handler const malloc_handler);
+

Constructor - create a new iostream writing to a string.

+

If malloc_handler + is null, raptor will allocate it using it's +own memory allocator. *string_p + is set to NULL on failure (and +*length_p + to 0 if length_p + is not NULL).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

world

raptor world

 

string_p

pointer to location to hold string

 

length_p

pointer to location to hold length of string (or NULL)

 

malloc_handler

pointer to malloc() to use to make string (or NULL)

 
+
+
+

Returns

+

new raptor_iostream object or NULL on failure

+
+
+
+
+

raptor_free_iostream ()

+
void
+raptor_free_iostream (raptor_iostream *iostr);
+

Destructor - destroy an iostream.

+
+

Parameters

+
+++++ + + + + + +

iostr

iostream object

 
+
+
+
+
+

raptor_iostream_hexadecimal_write ()

+
int
+raptor_iostream_hexadecimal_write (unsigned int integer,
+                                   int width,
+                                   raptor_iostream *iostr);
+

Write an integer in hexadecimal to the iostream.

+

Always 0-fills the entire field and writes in uppercase A-F

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

integer

unsigned integer to format as hexadecimal

 

width

field width

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_iostream_read_bytes ()

+
int
+raptor_iostream_read_bytes (void *ptr,
+                            size_t size,
+                            size_t nmemb,
+                            raptor_iostream *iostr);
+

Read bytes to the iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

ptr

start of buffer to read objects into

 

size

size of object

 

nmemb

number of objects to read

 

iostr

raptor iostream

 
+
+
+

Returns

+

number of objects read, 0 or less than nmemb on EOF, <0 on failure

+
+
+
+
+

raptor_iostream_read_eof ()

+
int
+raptor_iostream_read_eof (raptor_iostream *iostr);
+

Check if an read iostream has ended

+
+

Parameters

+
+++++ + + + + + +

iostr

raptor read iostream

 
+
+
+

Returns

+

non-0 if EOF (or not a read iostream)

+
+
+
+
+

raptor_iostream_tell ()

+
unsigned long
+raptor_iostream_tell (raptor_iostream *iostr);
+

Get the offset in the iostream.

+
+

Parameters

+
+++++ + + + + + +

iostr

raptor iostream

 
+
+
+

Returns

+

offset in iostream

+
+
+
+
+

raptor_iostream_counted_string_write ()

+
int
+raptor_iostream_counted_string_write (const void *string,
+                                      size_t len,
+                                      raptor_iostream *iostr);
+

Write a counted string to the iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

string

string

 

len

string length

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_iostream_decimal_write ()

+
int
+raptor_iostream_decimal_write (int integer,
+                               raptor_iostream *iostr);
+

Write an integer in decimal to the iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

integer

integer to format as decimal

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_iostream_string_write ()

+
int
+raptor_iostream_string_write (const void *string,
+                              raptor_iostream *iostr);
+

Write a NULL-terminated string to the iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

string

string

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_iostream_write_byte ()

+
int
+raptor_iostream_write_byte (const int byte,
+                            raptor_iostream *iostr);
+

Write a byte to the iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

byte

byte to write

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_iostream_write_bytes ()

+
int
+raptor_iostream_write_bytes (const void *ptr,
+                             size_t size,
+                             size_t nmemb,
+                             raptor_iostream *iostr);
+

Write bytes to the iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

ptr

start of objects to write

 

size

size of object

 

nmemb

number of objects

 

iostr

raptor iostream

 
+
+
+

Returns

+

number of objects actually written, which may be less than nmemb. <0 on failure

+
+
+
+
+

raptor_iostream_write_end ()

+
int
+raptor_iostream_write_end (raptor_iostream *iostr);
+

End writing to the iostream.

+
+

Parameters

+
+++++ + + + + + +

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_bnodeid_ntriples_write ()

+
int
+raptor_bnodeid_ntriples_write (const char *bnodeid,
+                               size_t len,
+                               raptor_iostream *iostr);
+

Write a blank node ID in a form legal for N-Triples with _: prefix

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

bnodeid

bnode ID to write

 

len

length of bnode ID

 

iostr

raptor_iostream to write to

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_string_escaped_write ()

+
int
+raptor_string_escaped_write (const char *string,
+                             size_t len,
+                             const char delim,
+                             unsigned int flags,
+                             raptor_iostream *iostr);
+

Write a UTF-8 string formatted using different escapes to a raptor_iostream

+

Supports writing escapes in the Python, N-Triples, Turtle, JSON, mKR, +SPARQL styles to an iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

string

UTF-8 string to write

 

len

length of UTF-8 string

 

delim

Terminating delimiter character for string (such as " or >) or \0 for no escaping.

 

flags

bit flags - see raptor_escaped_write_bitflags

 

iostr

raptor_iostream to write to

 
+
+
+

Returns

+

non-0 on failure such as bad UTF-8 encoding.

+
+
+
+
+

raptor_term_escaped_write ()

+
int
+raptor_term_escaped_write (const raptor_term *term,
+                           unsigned int flags,
+                           raptor_iostream *iostr);
+

Write a raptor_term formatted with escapes to a raptor_iostream

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

term

term to write

 

flags

bit flags - see raptor_escaped_write_bitflags

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_uri_escaped_write ()

+
int
+raptor_uri_escaped_write (raptor_uri *uri,
+                          raptor_uri *base_uri,
+                          unsigned int flags,
+                          raptor_iostream *iostr);
+

Write a raptor_uri formatted with escapes to a raptor_iostream

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

uri

uri to write

 

base_uri

base uri to write relative to (or NULL)

 

flags

bit flags - see raptor_escaped_write_bitflags

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_string_ntriples_write ()

+
int
+raptor_string_ntriples_write (const char *string,
+                              size_t len,
+                              const char delim,
+                              raptor_iostream *iostr);
+

Write an UTF-8 string using N-Triples escapes to an iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

string

UTF-8 string to write

 

len

length of UTF-8 string

 

delim

Terminating delimiter character for string (such as " or >) +or \0 for no escaping.

 

iostr

raptor_iostream to write to

 
+
+
+

Returns

+

non-0 on failure such as bad UTF-8 encoding.

+
+
+
+
+

raptor_string_python_write ()

+
int
+raptor_string_python_write (const char *string,
+                            size_t len,
+                            const char delim,
+                            unsigned int mode,
+                            raptor_iostream *iostr);
+

raptor_string_python_write is deprecated and should not be used in newly-written code.

+

Write a UTF-8 string using Python-style escapes (N-Triples, Turtle, JSON, mKR) to a raptor_iostream

+

Deprecated +: use raptor_string_escaped_write() where the features +requested are bits that can be individually chosen.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

string

UTF-8 string to write

 

len

length of UTF-8 string

 

delim

Terminating delimiter character for string (such as " or >) +or \0 for no escaping.

 

mode

mode 0=N-Triples mode, 1=Turtle (allow raw UTF-8), 2=Turtle long string (allow raw UTF-8), 3=JSON

 

iostr

raptor_iostream to write to

 
+
+
+

Returns

+

non-0 on failure such as bad UTF-8 encoding.

+
+
+
+
+

Types and Values

+
+

raptor_iostream

+
raptor_iostream* raptor_iostream;
+
+

Raptor I/O Stream class

+
+
+
+

raptor_iostream_handler

+
typedef struct {
+  int version;
+
+  /* V1 functions */
+  raptor_iostream_init_func         init;
+  raptor_iostream_finish_func       finish;
+  raptor_iostream_write_byte_func   write_byte;
+  raptor_iostream_write_bytes_func  write_bytes;
+  raptor_iostream_write_end_func    write_end;
+
+  /* V2 functions */
+  raptor_iostream_read_bytes_func   read_bytes;
+  raptor_iostream_read_eof_func     read_eof;
+} raptor_iostream_handler;
+
+

I/O stream implementation handler structure.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

int version;

interface version. Presently 1 or 2.

 

raptor_iostream_init_func init;

initialisation handler - optional, called at most once (V1)

 

raptor_iostream_finish_func finish;

finishing handler - optional, called at most once (V1)

 

raptor_iostream_write_byte_func write_byte;

write byte handler - required (for writing) (V1)

 

raptor_iostream_write_bytes_func write_bytes;

write bytes handler - required (for writing) (V1)

 

raptor_iostream_write_end_func write_end;

write end handler - optional (for writing), called at most once (V1)

 

raptor_iostream_read_bytes_func read_bytes;

read bytes handler - required (for reading) (V2)

 

raptor_iostream_read_eof_func read_eof;

read EOF handler - required (for reading) (V2)

 
+
+
+
+
+

enum raptor_escaped_write_bitflags

+

Bit flags for raptor_string_escaped_write() and friends.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_BF

+

Allow \b \f,

+
 

RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_TNRU

+

Allow \t \n \r \u \U

+
 

RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8

+

Use UTF-8 instead of \u \U for U+0080 or larger (will always use \u for U+0000..U+001F and U+007F)

+
 

RAPTOR_ESCAPED_WRITE_BITFLAG_SPARQL_URI_ESCAPES

+

Must escape x00-x20<>\"{}|^` in URIs

+
 

RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL

+

N-Triples literal

+
 

RAPTOR_ESCAPED_WRITE_NTRIPLES_URI

+

N-Triples URI

+
 

RAPTOR_ESCAPED_WRITE_SPARQL_LITERAL

+

SPARQL literal: allows raw UTF8 for printable literals

+
 

RAPTOR_ESCAPED_WRITE_SPARQL_LONG_LITERAL

+

SPARQL long literal: no BS-escapes allowed

+
 

RAPTOR_ESCAPED_WRITE_SPARQL_URI

+

SPARQL uri: have to escape certain characters

+
 

RAPTOR_ESCAPED_WRITE_TURTLE_URI

+

Turtle 2013 URIs (like SPARQL)

+
 

RAPTOR_ESCAPED_WRITE_TURTLE_LITERAL

+

Turtle 2013 literals (like SPARQL)

+
 

RAPTOR_ESCAPED_WRITE_TURTLE_LONG_LITERAL

+

Turtle 2013 long literals (like SPARQL)

+
 

RAPTOR_ESCAPED_WRITE_JSON_LITERAL

+

JSON literals: UTF-8 plus \b \f \t \r \n, \uXXXX only, no \U

+
 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-locator.html b/docs/html/raptor2-section-locator.html new file mode 100644 index 0000000..785782e --- /dev/null +++ b/docs/html/raptor2-section-locator.html @@ -0,0 +1,384 @@ + + + + +section-locator: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-locator

+

section-locator

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+int + +raptor_locator_print () +
+int + +raptor_locator_format () +
+int + +raptor_locator_line () +
+int + +raptor_locator_column () +
+int + +raptor_locator_byte () +
const char * + +raptor_locator_file () +
const char * + +raptor_locator_uri () +
+
+
+

Types and Values

+
++++ + + + + +
 raptor_locator
+
+
+

Description

+
+
+

Functions

+
+

raptor_locator_print ()

+
int
+raptor_locator_print (raptor_locator *locator,
+                      FILE *stream);
+

Print a raptor locator to a stream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

locator

raptor_locator to print

 

stream

stream to print to

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_locator_format ()

+
int
+raptor_locator_format (char *buffer,
+                       size_t length,
+                       raptor_locator *locator);
+

Format a raptor locator as a string.

+

If buffer is NULL or length + is insufficient for the size of +the locator, returns the number of additional bytes required +in the buffer to write the locator. Writes a terminating '\0'.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

buffer

buffer to store format

 

length

size of buffer (excluding NUL)

 

locator

raptor_locator to format

 
+
+
+

Returns

+

0 on success, >0 if additional bytes required in buffer, <0 on failure

+
+
+
+
+

raptor_locator_line ()

+
int
+raptor_locator_line (raptor_locator *locator);
+

Get line number from locator.

+
+

Parameters

+
+++++ + + + + + +

locator

locator

 
+
+
+

Returns

+

integer line number, or -1 if there is no line number available

+
+
+
+
+

raptor_locator_column ()

+
int
+raptor_locator_column (raptor_locator *locator);
+

Get column number from locator.

+
+

Parameters

+
+++++ + + + + + +

locator

locator

 
+
+
+

Returns

+

integer column number, or -1 if there is no column number available

+
+
+
+
+

raptor_locator_byte ()

+
int
+raptor_locator_byte (raptor_locator *locator);
+

Get the locator byte offset from locator.

+
+

Parameters

+
+++++ + + + + + +

locator

locator

 
+
+
+

Returns

+

integer byte number, or -1 if there is no byte offset available

+
+
+
+
+

raptor_locator_file ()

+
const char *
+raptor_locator_file (raptor_locator *locator);
+

Get file name from locator.

+
+

Parameters

+
+++++ + + + + + +

locator

locator

 
+
+
+

Returns

+

string file name, or NULL if there is no filename available

+
+
+
+
+

raptor_locator_uri ()

+
const char *
+raptor_locator_uri (raptor_locator *locator);
+

Get URI from locator.

+

Returns a pointer to a shared string version of the URI in +the locator. This must be copied if it is needed.

+
+

Parameters

+
+++++ + + + + + +

locator

locator

 
+
+
+

Returns

+

string URI, or NULL if there is no URI available

+
+
+
+
+

Types and Values

+
+

raptor_locator

+
typedef struct {
+  raptor_uri *uri;
+  const char *file;
+  int line;
+  int column;
+  int byte;
+
+} raptor_locator;
+
+

Location information for an error, warning or information message.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

raptor_uri *uri;

URI of location (or NULL)

 

const char *file;

Filename of location (or NULL)

 

int line;

Line number of location (or <0 for no line)

 

int column;

Column number of location (or <0 for no column)

 

int byte;

Byte number of location (or <0 for no byte)

 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-memory.html b/docs/html/raptor2-section-memory.html new file mode 100644 index 0000000..6a067a9 --- /dev/null +++ b/docs/html/raptor2-section-memory.html @@ -0,0 +1,183 @@ + + + + +section-memory: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-memory

+

section-memory

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + +
+void + +raptor_free_memory () +
+void * + +raptor_alloc_memory () +
+void * + +raptor_calloc_memory () +
+
+
+

Description

+
+
+

Functions

+
+

raptor_free_memory ()

+
void
+raptor_free_memory (void *ptr);
+

Free memory allocated inside raptor.

+

Some systems require memory allocated in a library to +be deallocated in that library. This function allows +memory allocated by raptor to be freed.

+

Examples include the result of the '_to_' methods that returns +allocated memory such as raptor_uri_filename_to_uri_string, +raptor_uri_filename_to_uri_string +and raptor_uri_uri_string_to_filename_fragment

+
+

Parameters

+
+++++ + + + + + +

ptr

memory pointer

 
+
+
+
+
+

raptor_alloc_memory ()

+
void *
+raptor_alloc_memory (size_t size);
+

Allocate memory inside raptor.

+

Some systems require memory allocated in a library to +be deallocated in that library. This function allows +memory to be allocated inside the raptor shared library +that can be freed inside raptor either internally or via +raptor_free_memory.

+

Examples include using this in the raptor_world_generate_bnodeid() handler +code to create new strings that will be used internally +as short identifiers and freed later on by the parsers.

+
+

Parameters

+
+++++ + + + + + +

size

size of memory to allocate

 
+
+
+

Returns

+

the address of the allocated memory or NULL on failure

+
+
+
+
+

raptor_calloc_memory ()

+
void *
+raptor_calloc_memory (size_t nmemb,
+                      size_t size);
+

Allocate zeroed array of items inside raptor.

+

Some systems require memory allocated in a library to +be deallocated in that library. This function allows +memory to be allocated inside the raptor shared library +that can be freed inside raptor either internally or via +raptor_free_memory.

+

Examples include using this in the raptor_world_generate_bnodeid() handler +code to create new strings that will be used internally +as short identifiers and freed later on by the parsers.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

nmemb

number of members

 

size

size of item

 
+
+
+

Returns

+

the address of the allocated memory or NULL on failure

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-option.html b/docs/html/raptor2-section-option.html new file mode 100644 index 0000000..66284a9 --- /dev/null +++ b/docs/html/raptor2-section-option.html @@ -0,0 +1,731 @@ + + + + +section-option: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-option

+

section-option

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + +
unsigned int + +raptor_option_get_count () +
const char * + +raptor_option_get_value_type_label () +
+raptor_option_description * + +raptor_world_get_option_description () +
+void + +raptor_free_option_description () +
+raptor_option + +raptor_world_get_option_from_uri () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + +
enumraptor_option
 raptor_option_description
enumraptor_option_value_type
+
+
+

Description

+
+
+

Functions

+
+

raptor_option_get_count ()

+
unsigned int
+raptor_option_get_count (void);
+

Get the count of options defined.

+

This is prefered to the compile time-only symbol RAPTOR_OPTION_LAST +and returns a count of the number of options which is +RAPTOR_OPTION_LAST + 1.

+
+

Returns

+

count of options in the raptor_option enumeration

+
+
+
+
+

raptor_option_get_value_type_label ()

+
const char *
+raptor_option_get_value_type_label (const raptor_option_value_type type);
+

Get a label for a value type

+
+

Parameters

+
+++++ + + + + + +

type

value type

 
+
+
+

Returns

+

label for type or NULL for invalid type

+
+
+
+
+

raptor_world_get_option_description ()

+
raptor_option_description *
+raptor_world_get_option_description (raptor_world *world,
+                                     const raptor_domain domain,
+                                     const raptor_option option);
+

Get a description of an option for a domain.

+

The returned description must be freed with +raptor_free_option_description().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor world object

 

domain

domain

 

option

option enumeration (0+)

 
+
+
+

Returns

+

option description or NULL on failure or if option is unknown

+
+
+
+
+

raptor_free_option_description ()

+
void
+raptor_free_option_description (raptor_option_description *option_description);
+

Destructor - free an option description object.

+
+

Parameters

+
+++++ + + + + + +

option_description

option description

 
+
+
+
+
+

raptor_world_get_option_from_uri ()

+
raptor_option
+raptor_world_get_option_from_uri (raptor_world *world,
+                                  raptor_uri *uri);
+

Get an option ID from a URI

+

Option URIs are the concatenation of the string +"http://feature.librdf.org/raptor-" plus the short name.

+

They are automatically returned for any option described with +raptor_world_get_option_description().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor_world instance

 

uri

option URI

 
+
+
+

Returns

+

< 0 if the option is unknown or on error

+
+
+
+
+

Types and Values

+
+

enum raptor_option

+

Raptor parser, serializer or XML writer options.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

RAPTOR_OPTION_SCANNING

+

If true (default false), the RDF/XML +parser will look for embedded rdf:RDF elements inside the XML +content, and not require that the XML start with an rdf:RDF root +element.

+
 

RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES

+

If true (default true) +then the RDF/XML parser will allow non-XML namespaced attributes +to be accepted as well as rdf: namespaced ones. For example, +'about' and 'ID' will be interpreted as if they were rdf:about +and rdf:ID respectively.

+
 

RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES

+

If true (default true) +then the RDF/XML parser will allow unknown parsetypes to be +present and will pass them on to the user. Unimplemented at +present.

+
 

RAPTOR_OPTION_ALLOW_BAGID

+

If true (default true) then the +RDF/XML parser will support the rdf:bagID attribute that was +removed from the RDF/XML language when it was revised. This +support may be removed in future.

+
 

RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST

+

If true (default false) +then the RDF/XML parser will generate the idList rdf:type +rdf:List triple in the handling of rdf:parseType="Collection". +This triple was removed during the revising of RDF/XML after +collections were initially added.

+
 

RAPTOR_OPTION_NORMALIZE_LANGUAGE

+

If true (default true) then +XML language values such as from xml:lang will be normalized to +lowercase.

+
 

RAPTOR_OPTION_NON_NFC_FATAL

+

If true (default false) then +illegal Unicode Normal Form C in literals will give a fatal +error, otherwise just a warning.

+
 

RAPTOR_OPTION_WARN_OTHER_PARSETYPES

+

If true (default true) then + +the RDF/XML parser will warn about unknown rdf:parseType values.

+
 

RAPTOR_OPTION_CHECK_RDF_ID

+

If true (default true) then the +RDF/XML will check rdf:ID attribute values for duplicates and +cause an error if any are found.

+
 

RAPTOR_OPTION_RELATIVE_URIS

+

If true (default true) then +relative URIs will be used wherever possible when serializing.

+
 

RAPTOR_OPTION_WRITER_AUTO_INDENT

+

Automatically indent elements when +seriailizing.

+
 

RAPTOR_OPTION_WRITER_AUTO_EMPTY

+

Automatically detect and +abbreviate empty elements when serializing.

+
 

RAPTOR_OPTION_WRITER_INDENT_WIDTH

+

Integer number of spaces to use +for each indent level when serializing with auto indent.

+
 

RAPTOR_OPTION_WRITER_XML_VERSION

+

Integer XML version XML 1.0 (10) or XML 1.1 (11)

+
 

RAPTOR_OPTION_WRITER_XML_DECLARATION

+

Write XML 1.0 or 1.1 declaration.

+
 

RAPTOR_OPTION_NO_NET

+

Deny network requests inside other requests.

+
 

RAPTOR_OPTION_RESOURCE_BORDER

+

Border color of resource +nodes for GraphViz DOT serializer.

+
 

RAPTOR_OPTION_LITERAL_BORDER

+

Border color of literal nodes +for GraphViz DOT serializer.

+
 

RAPTOR_OPTION_BNODE_BORDER

+

Border color of blank nodes for +GraphViz DOT serializer.

+
 

RAPTOR_OPTION_RESOURCE_FILL

+

Fill color of resource nodes +for GraphViz DOT serializer.

+
 

RAPTOR_OPTION_LITERAL_FILL

+

Fill color of literal nodes for +GraphViz DOT serializer.

+
 

RAPTOR_OPTION_BNODE_FILL

+

Fill color of blank nodes for +GraphViz DOT serializer.

+
 

RAPTOR_OPTION_HTML_TAG_SOUP

+

Use a lax HTML parser if an XML parser +fails when read HTML for GRDDL parser.

+
 

RAPTOR_OPTION_MICROFORMATS

+

Look for microformats for GRDDL parser.

+
 

RAPTOR_OPTION_HTML_LINK

+

Look for head <link> to type rdf/xml +for GRDDL parser.

+
 

RAPTOR_OPTION_WWW_TIMEOUT

+

Set timeout for internal WWW URI requests +for GRDDL parser.

+
 

RAPTOR_OPTION_WRITE_BASE_URI

+

Write base + directive for Turtle/N3.

+
 

RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL

+

HTTP Cache-Control: header

+
 

RAPTOR_OPTION_WWW_HTTP_USER_AGENT

+

HTTP User-Agent: header

+
 

RAPTOR_OPTION_JSON_CALLBACK

+

JSON serializer callback function.

+
 

RAPTOR_OPTION_JSON_EXTRA_DATA

+

JSON serializer extra top-level data

+
 

RAPTOR_OPTION_RSS_TRIPLES

+

Atom/RSS serializer writes extra RDF triples it finds (none, rdf-xml, atom-triples)

+
 

RAPTOR_OPTION_ATOM_ENTRY_URI

+

Atom entry URI. If given, generate an Atom Entry Document with the item having the given URI, otherwise generate an Atom Feed Document with any items found.

+
 

RAPTOR_OPTION_PREFIX_ELEMENTS

+

Integer. If set, generate Atom/RSS1.0 documents with prefixed elements, otherwise unprefixed.

+
 

RAPTOR_OPTION_STRICT

+

Boolean. If set, operate in strict conformance mode.

+
 

RAPTOR_OPTION_WWW_CERT_FILENAME

+

String. SSL client certificate filename

+
 

RAPTOR_OPTION_WWW_CERT_TYPE

+

String. SSL client certificate type

+
 

RAPTOR_OPTION_WWW_CERT_PASSPHRASE

+

String. SSL client certificate passphrase

+
 

RAPTOR_OPTION_NO_FILE

+

Deny file reading requests inside other requests.

+
 

RAPTOR_OPTION_WWW_SSL_VERIFY_PEER

+

Integer. SSL verify peer - non-0 to verify peer SSL certificate (default)

+
 

RAPTOR_OPTION_WWW_SSL_VERIFY_HOST

+

Integer. SSL verify host - 0 none, 1 CN match, 2 host match (default). Other values are ignored.

+
 

RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES

+

When reading XML, load external entities.

+
 

RAPTOR_OPTION_LAST

+

Internal

+
 
+
+
+
+
+

raptor_option_description

+
typedef struct {
+  raptor_domain domain;
+  raptor_option option;
+  raptor_option_value_type value_type;
+  const char* name;
+  size_t name_len;
+  const char* label;
+  raptor_uri* uri;
+} raptor_option_description;
+
+

Description of an option for a domain.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

raptor_domain domain;

domain ID

 

raptor_option option;

option ID

 

raptor_option_value_type value_type;

data type of option value

 

const char *name;

short name for option

 

size_t name_len;

length of name +

 

const char *label;

description of option

 

raptor_uri *uri;

URI identifying option

 
+
+
+
+
+

enum raptor_option_value_type

+

Option value types.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

RAPTOR_OPTION_VALUE_TYPE_BOOL

+

Boolean integer value. Non-0 is true

+
 

RAPTOR_OPTION_VALUE_TYPE_INT

+

Decimal integer value

+
 

RAPTOR_OPTION_VALUE_TYPE_STRING

+

String value

+
 

RAPTOR_OPTION_VALUE_TYPE_URI

+

URI String value.

+
 

RAPTOR_OPTION_VALUE_TYPE_LAST

+

internal

+
 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-parser.html b/docs/html/raptor2-section-parser.html new file mode 100644 index 0000000..141d70e --- /dev/null +++ b/docs/html/raptor2-section-parser.html @@ -0,0 +1,1286 @@ + + + + +section-parser: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-parser

+

section-parser

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_parser * + +raptor_new_parser () +
+raptor_parser * + +raptor_new_parser_for_content () +
+void + +raptor_free_parser () +
+void + +(*raptor_graph_mark_handler) () +
+void + +(*raptor_namespace_handler) () +
+void + +raptor_parser_set_statement_handler () +
+void + +raptor_parser_set_graph_mark_handler () +
+void + +raptor_parser_set_namespace_handler () +
const raptor_syntax_description * + +raptor_parser_get_description () +
+raptor_locator * + +raptor_parser_get_locator () +
+void + +raptor_parser_parse_abort () +
+int + +raptor_parser_parse_chunk () +
+int + +raptor_parser_parse_file () +
+int + +raptor_parser_parse_file_stream () +
+int + +raptor_parser_parse_iostream () +
+int + +raptor_parser_parse_start () +
+int + +raptor_parser_parse_uri () +
+int + +raptor_parser_parse_uri_with_connection () +
+raptor_uri * + +raptor_parser_get_graph () +
const char * + +raptor_parser_get_name () +
+int + +raptor_parser_set_option () +
+int + +raptor_parser_get_option () +
const char * + +raptor_parser_get_accept_header () +
+void + +raptor_parser_set_uri_filter () +
+raptor_world * + +raptor_parser_get_world () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
typedefraptor_parser
enumraptor_graph_mark_flags
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_parser ()

+
raptor_parser *
+raptor_new_parser (raptor_world *world,
+                   const char *name);
+

Constructor - create a new raptor_parser object.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

world object

 

name

the parser name or NULL for default parser

 
+
+
+

Returns

+

a new raptor_parser object or NULL on failure

+
+
+
+
+

raptor_new_parser_for_content ()

+
raptor_parser *
+raptor_new_parser_for_content (raptor_world *world,
+                               raptor_uri *uri,
+                               const char *mime_type,
+                               const char *buffer,
+                               size_t len,
+                               const unsigned char *identifier);
+

Constructor - create a new raptor_parser.

+

Uses raptor_world_guess_parser_name() to find a parser by scoring +recognition of the syntax by a block of characters, the content +identifier or a mime type. The content identifier is typically a +filename or URI or some other identifier.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

world

world object

 

uri

URI identifying the syntax (or NULL)

 

mime_type

mime type identifying the content (or NULL)

 

buffer

buffer of content to guess (or NULL)

 

len

length of buffer

 

identifier

identifier of content (or NULL)

 
+
+
+

Returns

+

a new raptor_parser object or NULL on failure

+
+
+
+
+

raptor_free_parser ()

+
void
+raptor_free_parser (raptor_parser *parser);
+

Destructor - destroy a raptor_parser object.

+
+

Parameters

+
+++++ + + + + + +

parser

raptor_parser object

 
+
+
+
+
+

raptor_graph_mark_handler ()

+
void
+(*raptor_graph_mark_handler) (void *user_data,
+                              raptor_uri *graph,
+                              int flags);
+

Graph start/end mark handler function.

+

Records start and end of graphs happening in a stream of generated +raptor_statement via the statement handler. The callback starts a +graph when flags + has RAPTOR_GRAPH_MARK_START bit set.

+

The start and ends may be either declared in the syntax via some +keyword or mechanism such as TRiG {} syntax when flags + has bit +RAPTOR_GRAPH_MARK_DECLARED set, or be implied by the start/end of +the data in other syntaxes, and the bit will be unset.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

user_data

user data

 

graph

graph to report, NULL for the default graph

 

flags

bitmask of raptor_graph_mark_flags flags

 
+
+
+
+
+

raptor_namespace_handler ()

+
void
+(*raptor_namespace_handler) (void *user_data,
+                             raptor_namespace *nspace);
+

XML Namespace declaration reporting handler set by +raptor_parser_set_namespace_handler().

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

user_data

user data

 

nspace

raptor_namespace declared

 
+
+
+
+
+

raptor_parser_set_statement_handler ()

+
void
+raptor_parser_set_statement_handler (raptor_parser *parser,
+                                     void *user_data,
+                                     raptor_statement_handler handler);
+

Set the statement handler function for the parser.

+

Use this to set the function to receive statements as the parsing +proceeds. The statement argument to handler + is shared and must be +copied by the caller with raptor_statement_copy().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

parser

raptor_parser parser object

 

user_data

user data pointer for callback

 

handler

new statement callback function

 
+
+
+
+
+

raptor_parser_set_graph_mark_handler ()

+
void
+raptor_parser_set_graph_mark_handler (raptor_parser *parser,
+                                      void *user_data,
+                                      raptor_graph_mark_handler handler);
+

Set the graph mark handler function for the parser.

+

See raptor_graph_mark_handler and raptor_graph_mark_flags for +the marks that may be returned by the handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

parser

raptor_parser parser object

 

user_data

user data pointer for callback

 

handler

new graph callback function

 
+
+
+
+
+

raptor_parser_set_namespace_handler ()

+
void
+raptor_parser_set_namespace_handler (raptor_parser *parser,
+                                     void *user_data,
+                                     raptor_namespace_handler handler);
+

Set the namespace handler function for the parser.

+

When a prefix/namespace is seen in a parser, call the given +handler + with the prefix string and the raptor_uri namespace URI. +Either can be NULL for the default prefix or default namespace.

+

The handler function does not deal with duplicates so any +namespace may be declared multiple times.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

parser

raptor_parser parser object

 

user_data

user data pointer for callback

 

handler

new namespace callback function

 
+
+
+
+
+

raptor_parser_get_description ()

+
const raptor_syntax_description *
+raptor_parser_get_description (raptor_parser *rdf_parser);
+

Get description of the syntaxes of the parser.

+

The returned description is static and lives as long as the raptor +library (raptor world).

+
+

Parameters

+
+++++ + + + + + +

rdf_parser

raptor_parser parser object

 
+
+
+

Returns

+

description of syntax

+
+
+
+
+

raptor_parser_get_locator ()

+
raptor_locator *
+raptor_parser_get_locator (raptor_parser *rdf_parser);
+

Get the current raptor locator object.

+
+

Parameters

+
+++++ + + + + + +

rdf_parser

raptor parser

 
+
+
+

Returns

+

raptor locator

+
+
+
+
+

raptor_parser_parse_abort ()

+
void
+raptor_parser_parse_abort (raptor_parser *rdf_parser);
+

Abort an ongoing parsing.

+

Causes any ongoing generation of statements by a parser to be +terminated and the parser to return controlto the application +as soon as draining any existing buffers.

+

Most useful inside raptor_parser_parse_file() or +raptor_parser_parse_uri() when the Raptor library is directing the +parsing and when one of the callback handlers such as as set by +raptor_parser_set_statement_handler() requires to return to the main +application code.

+
+

Parameters

+
+++++ + + + + + +

rdf_parser

raptor_parser parser object

 
+
+
+
+
+

raptor_parser_parse_chunk ()

+
int
+raptor_parser_parse_chunk (raptor_parser *rdf_parser,
+                           const char *buffer,
+                           size_t len,
+                           int is_end);
+

Parse a block of content into triples.

+

This method can only be called after raptor_parser_parse_start() has +initialised the parser.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

rdf_parser

RDF parser

 

buffer

content to parse

 

len

length of buffer

 

is_end

non-0 if this is the end of the content (such as EOF)

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_parser_parse_file ()

+
int
+raptor_parser_parse_file (raptor_parser *rdf_parser,
+                          raptor_uri *uri,
+                          raptor_uri *base_uri);
+

Parse RDF content at a file URI.

+

If uri + is NULL (source is stdin), then the base_uri + is required.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

rdf_parser

parser

 

uri

URI of RDF content or NULL to read from standard input

 

base_uri

the base URI to use (or NULL if the same)

 
+
+
+

Returns

+

non 0 on failure

+
+
+
+
+

raptor_parser_parse_file_stream ()

+
int
+raptor_parser_parse_file_stream (raptor_parser *rdf_parser,
+                                 FILE *stream,
+                                 const char *filename,
+                                 raptor_uri *base_uri);
+

Parse RDF content from a FILE*.

+

After draining the FILE* stream (EOF), fclose is not called on it.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

rdf_parser

parser

 

stream

FILE* of RDF content

 

filename

filename of content or NULL if it has no name

 

base_uri

the base URI to use

 
+
+
+

Returns

+

non 0 on failure

+
+
+
+
+

raptor_parser_parse_iostream ()

+
int
+raptor_parser_parse_iostream (raptor_parser *rdf_parser,
+                              raptor_iostream *iostr,
+                              raptor_uri *base_uri);
+

Parse content from an iostream

+

If the parser requires a base URI and base_uri + is NULL, an error +will be generated and the function will fail.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

rdf_parser

parser

 

iostr

iostream to read from

 

base_uri

the base URI to use (or NULL)

 
+
+
+

Returns

+

non 0 on failure, <0 if a required base URI was missing

+
+
+
+
+

raptor_parser_parse_start ()

+
int
+raptor_parser_parse_start (raptor_parser *rdf_parser,
+                           raptor_uri *uri);
+

Start a parse of content with base URI.

+

Parsers that need a base URI can be identified using a syntax +description returned by raptor_world_get_parser_description() +statically or raptor_parser_get_description() on a constructed +parser.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

rdf_parser

RDF parser

 

uri

base URI or may be NULL if no base URI is required

 
+
+
+

Returns

+

non-0 on failure, <0 if a required base URI was missing

+
+
+
+
+

raptor_parser_parse_uri ()

+
int
+raptor_parser_parse_uri (raptor_parser *rdf_parser,
+                         raptor_uri *uri,
+                         raptor_uri *base_uri);
+

Parse the RDF content at URI.

+

Sends an HTTP Accept: header whent the URI is of the HTTP protocol, +see raptor_parser_parse_uri_with_connection() for details including +how the base_uri + is used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

rdf_parser

parser

 

uri

URI of RDF content

 

base_uri

the base URI to use (or NULL if the same)

 
+
+
+

Returns

+

non 0 on failure

+
+
+
+
+

raptor_parser_parse_uri_with_connection ()

+
int
+raptor_parser_parse_uri_with_connection
+                               (raptor_parser *rdf_parser,
+                                raptor_uri *uri,
+                                raptor_uri *base_uri,
+                                void *connection);
+

Parse RDF content at URI using existing WWW connection.

+

If base_uri + is not given and during resolution of the URI, a +protocol redirection occurs, the final resolved URI will be +used as the base URI. If redirection does not occur, the +base URI will be uri +.

+

If base_uri + is given, it overrides the process above.

+

When connection + is NULL and a MIME Type exists for the parser +type, this type is sent in an HTTP Accept: header in the form +Accept: MIME-TYPE along with a wildcard of 0.1 quality, so MIME-TYPE is +prefered rather than the sole answer. The latter part may not be +necessary but should ensure an HTTP 200 response.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

rdf_parser

parser

 

uri

URI of RDF content

 

base_uri

the base URI to use (or NULL if the same)

 

connection

connection object pointer or NULL to create a new one

 
+
+
+

Returns

+

non 0 on failure

+
+
+
+
+

raptor_parser_get_graph ()

+
raptor_uri *
+raptor_parser_get_graph (raptor_parser *rdf_parser);
+

Get the current graph for the parser

+

The returned URI is owned by the caller and must be freed with +raptor_free_uri()

+
+

Parameters

+
+++++ + + + + + +

rdf_parser

parser

 
+
+
+

Returns

+

raptor_uri* graph name or NULL for the default graph

+
+
+
+
+

raptor_parser_get_name ()

+
const char *
+raptor_parser_get_name (raptor_parser *rdf_parser);
+

Get the name of a parser.

+

Use raptor_parser_get_description() to get the alternate names and +aliases as well as other descriptive values.

+
+

Parameters

+
+++++ + + + + + +

rdf_parser

raptor_parser parser object

 
+
+
+

Returns

+

the short name for the parser.

+
+
+
+
+

raptor_parser_set_option ()

+
int
+raptor_parser_set_option (raptor_parser *parser,
+                          raptor_option option,
+                          const char *string,
+                          int integer);
+

Set parser option.

+

If string + is not NULL and the option type is numeric, the string +value is converted to an integer and used in preference to integer +.

+

If string + is NULL and the option type is not numeric, an error is +returned.

+

The string + values used are copied.

+

The allowed options are available via +raptor_world_get_option_description().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

parser

raptor_parser parser object

 

option

option to set from enumerated raptor_option values

 

string

string option value (or NULL)

 

integer

integer option value

 
+
+
+

Returns

+

non 0 on failure or if the option is unknown

+
+
+
+
+

raptor_parser_get_option ()

+
int
+raptor_parser_get_option (raptor_parser *parser,
+                          raptor_option option,
+                          char **string_p,
+                          int *integer_p);
+

Get parser option.

+

Any string value returned in *string_p + is shared and must +be copied by the caller.

+

The allowed options are available via +raptor_world_get_option_description().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

parser

raptor_parser parser object

 

option

option to get value

 

string_p

pointer to where to store string value

 

integer_p

pointer to where to store integer value

 
+
+
+

Returns

+

option value or < 0 for an illegal option

+
+
+
+
+

raptor_parser_get_accept_header ()

+
const char *
+raptor_parser_get_accept_header (raptor_parser *rdf_parser);
+

Get an HTTP Accept value for the parser.

+

The returned string must be freed by the caller such as with +raptor_free_memory().

+
+

Parameters

+
+++++ + + + + + +

rdf_parser

parser

 
+
+
+

Returns

+

a new Accept: header string or NULL on failure

+
+
+
+
+

raptor_parser_set_uri_filter ()

+
void
+raptor_parser_set_uri_filter (raptor_parser *parser,
+                              raptor_uri_filter_func filter,
+                              void *user_data);
+

Set URI filter function for WWW retrieval.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

parser

parser object

 

filter

URI filter function

 

user_data

User data to pass to filter function

 
+
+
+
+
+

raptor_parser_get_world ()

+
raptor_world *
+raptor_parser_get_world (raptor_parser *rdf_parser);
+

Get the raptor_world object associated with a parser.

+
+

Parameters

+
+++++ + + + + + +

rdf_parser

parser

 
+
+
+

Returns

+

raptor_world* pointer

+
+
+
+
+

Types and Values

+
+

raptor_parser

+
raptor_parser* raptor_parser;
+
+

Raptor Parser class

+
+
+
+

enum raptor_graph_mark_flags

+

Graph mark handler bitmask flags

+
+

Members

+
+++++ + + + + + + + + + + + + +

RAPTOR_GRAPH_MARK_START

+

mark is start of graph (otherwise is end)

+
 

RAPTOR_GRAPH_MARK_DECLARED

+

mark was declared in syntax rather than implict

+
 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-sax2.html b/docs/html/raptor2-section-sax2.html new file mode 100644 index 0000000..b564be5 --- /dev/null +++ b/docs/html/raptor2-section-sax2.html @@ -0,0 +1,1018 @@ + + + + +section-sax2: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-sax2

+

section-sax2

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_sax2 * + +raptor_new_sax2 () +
+void + +raptor_free_sax2 () +
+void + +(*raptor_sax2_start_element_handler) () +
+void + +(*raptor_sax2_end_element_handler) () +
+void + +(*raptor_sax2_characters_handler) () +
+void + +(*raptor_sax2_cdata_handler) () +
+void + +(*raptor_sax2_comment_handler) () +
+void + +(*raptor_sax2_unparsed_entity_decl_handler) () +
+int + +(*raptor_sax2_external_entity_ref_handler) () +
+void + +raptor_sax2_set_start_element_handler () +
+void + +raptor_sax2_set_end_element_handler () +
+void + +raptor_sax2_set_characters_handler () +
+void + +raptor_sax2_set_cdata_handler () +
+void + +raptor_sax2_set_comment_handler () +
+void + +raptor_sax2_set_unparsed_entity_decl_handler () +
+void + +raptor_sax2_set_external_entity_ref_handler () +
+void + +raptor_sax2_set_namespace_handler () +
+void + +raptor_sax2_set_uri_filter () +
+void + +raptor_sax2_parse_start () +
+int + +raptor_sax2_parse_chunk () +
const unsigned char * + +raptor_sax2_inscope_xml_language () +
+raptor_uri * + +raptor_sax2_inscope_base_uri () +
+
+
+

Types and Values

+
++++ + + + + +
typedefraptor_sax2
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_sax2 ()

+
raptor_sax2 *
+raptor_new_sax2 (raptor_world *world,
+                 raptor_locator *locator,
+                 void *user_data);
+

Constructor - Create a new SAX2 with error handlers

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor world

 

locator

raptor locator to use for errors

 

user_data

pointer context information to pass to SAX handlers

 
+
+
+

Returns

+

new raptor_sax2 object or NULL on failure

+
+
+
+
+

raptor_free_sax2 ()

+
void
+raptor_free_sax2 (raptor_sax2 *sax2);
+

Destructor - destroy a SAX2 object

+
+

Parameters

+
+++++ + + + + + +

sax2

SAX2 object

 
+
+
+
+
+

raptor_sax2_start_element_handler ()

+
void
+(*raptor_sax2_start_element_handler) (void *user_data,
+                                      raptor_xml_element *xml_element);
+

SAX2 start element handler

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

user_data

user data

 

xml_element

XML element

 
+
+
+
+
+

raptor_sax2_end_element_handler ()

+
void
+(*raptor_sax2_end_element_handler) (void *user_data,
+                                    raptor_xml_element *xml_element);
+

SAX2 end element handler

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

user_data

user data

 

xml_element

XML element

 
+
+
+
+
+

raptor_sax2_characters_handler ()

+
void
+(*raptor_sax2_characters_handler) (void *user_data,
+                                   raptor_xml_element *xml_element,
+                                   const char *s,
+                                   int len);
+

SAX2 characters handler

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

user_data

user data

 

xml_element

XML element

 

s

string

 

len

string len

 
+
+
+
+
+

raptor_sax2_cdata_handler ()

+
void
+(*raptor_sax2_cdata_handler) (void *user_data,
+                              raptor_xml_element *xml_element,
+                              const char *s,
+                              int len);
+

SAX2 CDATA section handler

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

user_data

user data

 

xml_element

XML element

 

s

string

 

len

string len

 
+
+
+
+
+

raptor_sax2_comment_handler ()

+
void
+(*raptor_sax2_comment_handler) (void *user_data,
+                                raptor_xml_element *xml_element,
+                                const char *s);
+

SAX2 XML comment handler

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

user_data

user data

 

xml_element

XML element

 

s

string

 
+
+
+
+
+

raptor_sax2_unparsed_entity_decl_handler ()

+
void
+(*raptor_sax2_unparsed_entity_decl_handler)
+                               (void *user_data,
+                                const unsigned char *entityName,
+                                const unsigned char *base,
+                                const unsigned char *systemId,
+                                const unsigned char *publicId,
+                                const unsigned char *notationName);
+

SAX2 unparsed entity (NDATA) handler

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

user_data

user data

 

entityName

entity name

 

base

base URI

 

systemId

system ID

 

publicId

public ID

 

notationName

notation name

 
+
+
+
+
+

raptor_sax2_external_entity_ref_handler ()

+
int
+(*raptor_sax2_external_entity_ref_handler)
+                               (void *user_data,
+                                const unsigned char *context,
+                                const unsigned char *base,
+                                const unsigned char *systemId,
+                                const unsigned char *publicId);
+

SAX2 external entity reference handler

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

user_data

user data

 

context

context

 

base

base URI

 

systemId

system ID

 

publicId

public ID

 
+
+
+

Returns

+

0 if processing should not continue because of a +fatal error in the handling of the external entity.

+
+
+
+
+

raptor_sax2_set_start_element_handler ()

+
void
+raptor_sax2_set_start_element_handler (raptor_sax2 *sax2,
+                                       raptor_sax2_start_element_handler handler);
+

Set SAX2 start element handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

SAX2 object

 

handler

start element handler

 
+
+
+
+
+

raptor_sax2_set_end_element_handler ()

+
void
+raptor_sax2_set_end_element_handler (raptor_sax2 *sax2,
+                                     raptor_sax2_end_element_handler handler);
+

Set SAX2 end element handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

SAX2 object

 

handler

end element handler

 
+
+
+
+
+

raptor_sax2_set_characters_handler ()

+
void
+raptor_sax2_set_characters_handler (raptor_sax2 *sax2,
+                                    raptor_sax2_characters_handler handler);
+

Set SAX2 characters handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

SAX2 object

 

handler

characters handler

 
+
+
+
+
+

raptor_sax2_set_cdata_handler ()

+
void
+raptor_sax2_set_cdata_handler (raptor_sax2 *sax2,
+                               raptor_sax2_cdata_handler handler);
+

Set SAX2 CDATA handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

SAX2 object

 

handler

CDATA handler

 
+
+
+
+
+

raptor_sax2_set_comment_handler ()

+
void
+raptor_sax2_set_comment_handler (raptor_sax2 *sax2,
+                                 raptor_sax2_comment_handler handler);
+

Set SAX2 XML comment handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

SAX2 object

 

handler

comment handler

 
+
+
+
+
+

raptor_sax2_set_unparsed_entity_decl_handler ()

+
void
+raptor_sax2_set_unparsed_entity_decl_handler
+                               (raptor_sax2 *sax2,
+                                raptor_sax2_unparsed_entity_decl_handler handler);
+

Set SAX2 XML unparsed entity declaration handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

SAX2 object

 

handler

unparsed entity declaration handler

 
+
+
+
+
+

raptor_sax2_set_external_entity_ref_handler ()

+
void
+raptor_sax2_set_external_entity_ref_handler
+                               (raptor_sax2 *sax2,
+                                raptor_sax2_external_entity_ref_handler handler);
+

Set SAX2 XML entity reference handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

SAX2 object

 

handler

entity reference handler

 
+
+
+
+
+

raptor_sax2_set_namespace_handler ()

+
void
+raptor_sax2_set_namespace_handler (raptor_sax2 *sax2,
+                                   raptor_namespace_handler handler);
+

Set the XML namespace handler function.

+

When a prefix/namespace is seen in an XML parser, call the given +handler + with the prefix string and the raptor_uri namespace URI. +Either can be NULL for the default prefix or default namespace.

+

The handler function does not deal with duplicates so any +namespace may be declared multiple times when a namespace is seen +in different parts of a document.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

raptor_sax2 object

 

handler

new namespace callback function

 
+
+
+
+
+

raptor_sax2_set_uri_filter ()

+
void
+raptor_sax2_set_uri_filter (raptor_sax2 *sax2,
+                            raptor_uri_filter_func filter,
+                            void *user_data);
+

Set URI filter function for SAX2 internal retrievals.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

sax2

SAX2 object

 

filter

URI filter function

 

user_data

User data to pass to filter function

 
+
+
+
+
+

raptor_sax2_parse_start ()

+
void
+raptor_sax2_parse_start (raptor_sax2 *sax2,
+                         raptor_uri *base_uri);
+

Start an XML SAX2 parse.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sax2

sax2 object

 

base_uri

base URI

 
+
+
+
+
+

raptor_sax2_parse_chunk ()

+
int
+raptor_sax2_parse_chunk (raptor_sax2 *sax2,
+                         const char *buffer,
+                         size_t len,
+                         int is_end);
+

Parse a chunk of XML data generating SAX2 events

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

sax2

sax2 object

 

buffer

input buffer

 

len

input buffer lenght

 

is_end

non-0 if end of data

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_sax2_inscope_xml_language ()

+
const unsigned char *
+raptor_sax2_inscope_xml_language (raptor_sax2 *sax2);
+

Get the in-scope XML language

+

The result is a language string which may be "" if xml:lang="" is +given. NULL is returned only if there is no xml:lang in any outer +scope.

+
+

Parameters

+
+++++ + + + + + +

sax2

SAX2 object

 
+
+
+

Returns

+

shared pointer to the XML language or NULL if none is in scope.

+
+
+
+
+

raptor_sax2_inscope_base_uri ()

+
raptor_uri *
+raptor_sax2_inscope_base_uri (raptor_sax2 *sax2);
+

Get the in-scope base URI

+
+

Parameters

+
+++++ + + + + + +

sax2

SAX2 object

 
+
+
+

Returns

+

the in-scope base URI shared object or NULL if none is in scope.

+
+
+
+
+

Types and Values

+
+

raptor_sax2

+
typedef struct raptor_sax2_s raptor_sax2;
+
+

Raptor SAX2 class

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-sequence.html b/docs/html/raptor2-section-sequence.html new file mode 100644 index 0000000..7542fde --- /dev/null +++ b/docs/html/raptor2-section-sequence.html @@ -0,0 +1,870 @@ + + + + +section-sequence: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-sequence

+

section-sequence

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_sequence * + +raptor_new_sequence () +
+raptor_sequence * + +raptor_new_sequence_with_context () +
+void + +raptor_free_sequence () +
+void * + +raptor_sequence_delete_at () +
+void * + +raptor_sequence_get_at () +
+int + +raptor_sequence_join () +
+int + +raptor_sequence_next_permutation () +
+void * + +raptor_sequence_pop () +
+int + +raptor_sequence_print () +
+int + +raptor_sequence_push () +
+int + +raptor_sequence_reverse () +
+int + +raptor_sequence_set_at () +
+int + +raptor_sequence_shift () +
+int + +raptor_sequence_size () +
+void + +raptor_sequence_sort () +
+void + +raptor_sequence_sort_r () +
+int + +raptor_sequence_swap () +
+void * + +raptor_sequence_unshift () +
+
+
+

Types and Values

+
++++ + + + + +
typedefraptor_sequence
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_sequence ()

+
raptor_sequence *
+raptor_new_sequence (raptor_data_free_handler free_handler,
+                     raptor_data_print_handler print_handler);
+

Constructor - create a new sequence with the given handlers.

+

This creates a sequence over objects that need only the item data +pointers in order to print or free the objects.

+

For example sequences of strings could use handlers (free, NULL) +and sequences of raptor_uri could use (raptor_free_uri, +raptor_print_uri)

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

free_handler

handler to free a sequence item

 

print_handler

handler to print a sequence item to a FILE*

 
+
+
+

Returns

+

a new raptor_sequence or NULL on failure

+
+
+
+
+

raptor_new_sequence_with_context ()

+
raptor_sequence *
+raptor_new_sequence_with_context (raptor_data_context_free_handler free_handler,
+                                  raptor_data_context_print_handler print_handler,
+                                  void *handler_context);
+

Constructor - create a new sequence with the given handlers and handler context.

+

This creates a sequence over objects that need context + item data +pointers in order to print or free the objects.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

free_handler

handler to free a sequence item

 

print_handler

handler to print a sequence item to a FILE*

 

handler_context

context information to pass to free/print handlers

 
+
+
+

Returns

+

a new raptor_sequence or NULL on failure

+
+
+
+
+

raptor_free_sequence ()

+
void
+raptor_free_sequence (raptor_sequence *seq);
+

Destructor - free a raptor_sequence

+
+

Parameters

+
+++++ + + + + + +

seq

sequence to destroy

 
+
+
+
+
+

raptor_sequence_delete_at ()

+
void *
+raptor_sequence_delete_at (raptor_sequence *seq,
+                           int idx);
+

Remove an item from a position a sequence, returning it

+

The item at the offset idx + in the sequence is replaced with a +NULL pointer and any existing item is returned. The caller +owns the resulting item.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

seq

sequence object

 

idx

index into sequence to operate at

 
+
+
+

Returns

+

NULL on failure

+
+
+
+
+

raptor_sequence_get_at ()

+
void *
+raptor_sequence_get_at (raptor_sequence *seq,
+                        int idx);
+

Retrieve an item at offset index + in the sequence.

+

This is efficient to perform. raptor_sequence is optimised +to append/remove from the end of the sequence.

+

After this call the item is still owned by the sequence.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

seq

sequence to use

 

idx

index of item to get

 
+
+
+

Returns

+

the object or NULL if index +is out of range (0... sequence size - 1)

+
+
+
+
+

raptor_sequence_join ()

+
int
+raptor_sequence_join (raptor_sequence *dest,
+                      raptor_sequence *src);
+

Join two sequences moving all items from one sequence to the end of another.

+

After this operation, sequence src will be empty (zero size) but +will have the same item capacity as before.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

dest

raptor_sequence destination sequence

 

src

raptor_sequence source sequence

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_sequence_next_permutation ()

+
int
+raptor_sequence_next_permutation (raptor_sequence *seq,
+                                  raptor_data_compare_handler compare);
+

Get the next permutation of a sequence in lexicographic order

+

Assumes the initial order of the items is lexicographically +increasing. This function alters the order of the items until the +last permuatation is done at which point the contents is reset to +the intial order.

+

Algorithm used is described in http://en.wikipedia.org/wiki/Permutation

+

The comparison function compare + is compatible with that used for +qsort() and provides the addresses of pointers to the data that +must be dereferenced to get to the stored sequence data.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

seq

int seq

 

compare

comparison function

 
+
+
+

Returns

+

non-0 at the last permutation

+
+
+
+
+

raptor_sequence_pop ()

+
void *
+raptor_sequence_pop (raptor_sequence *seq);
+

Retrieve the item at the end of the sequence.

+

Ownership of the item is transferred to the caller, +i.e. caller is responsible of freeing the item.

+
+

Parameters

+
+++++ + + + + + +

seq

sequence to use

 
+
+
+

Returns

+

the object or NULL if the sequence is empty

+
+
+
+
+

raptor_sequence_print ()

+
int
+raptor_sequence_print (raptor_sequence *seq,
+                       FILE *fh);
+

Print the sequence contents using the print_handler to print the data items.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

seq

sequence to sort

 

fh

file handle

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_sequence_push ()

+
int
+raptor_sequence_push (raptor_sequence *seq,
+                      void *data);
+

Add an item to the end of the sequence.

+

The sequence takes ownership of the pushed item and frees it with the +free_handler. On failure, the item is freed immediately.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

seq

sequence to add to

 

data

item to add

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_sequence_reverse ()

+
int
+raptor_sequence_reverse (raptor_sequence *seq,
+                         int start_index,
+                         int length);
+

Reverse a range of elements

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

seq

sequence

 

start_index

starting index

 

length

number of elements to reverse

 
+
+
+

Returns

+

non-0 if arguments are out of range

+
+
+
+
+

raptor_sequence_set_at ()

+
int
+raptor_sequence_set_at (raptor_sequence *seq,
+                        int idx,
+                        void *data);
+

Replace/set an item in a sequence.

+

The item at the offset idx + in the sequence is replaced with the +new item data + (which may be NULL). Any existing item is freed +with the sequence's free_handler. If necessary the sequence +is extended (with NULLs) to handle a larger offset.

+

The sequence takes ownership of the new data item. On failure, the +item is freed immediately.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

seq

sequence object

 

idx

index into sequence to operate at

 

data

new data item.

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_sequence_shift ()

+
int
+raptor_sequence_shift (raptor_sequence *seq,
+                       void *data);
+

Add an item to the start of the sequence.

+

The sequence takes ownership of the shifted item and frees it with the +free_handler. On failure, the item is freed immediately.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

seq

sequence to add to

 

data

item to add

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_sequence_size ()

+
int
+raptor_sequence_size (raptor_sequence *seq);
+

Get the number of items in a sequence.

+
+

Parameters

+
+++++ + + + + + +

seq

sequence object

 
+
+
+

Returns

+

the sequence size (>=0)

+
+
+
+
+

raptor_sequence_sort ()

+
void
+raptor_sequence_sort (raptor_sequence *seq,
+                      raptor_data_compare_handler compare);
+

Sort a sequence inline

+

The comparison function compare + is compatible with that used for +qsort() and provides the addresses of pointers to the data that +must be dereferenced to get to the stored sequence data.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

seq

sequence to sort

 

compare

comparison function with args (a, b)

 
+
+
+
+
+

raptor_sequence_sort_r ()

+
void
+raptor_sequence_sort_r (raptor_sequence *seq,
+                        raptor_data_compare_arg_handler compare,
+                        void *user_data);
+

Sort a sequence inline with user data

+

The comparison function compare_r + is compatible with that used +for raptor_sort_r() and provides the addresses of pointers to the +data that must be dereferenced to get to the stored sequence data.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

seq

sequence to sort

 

compare

comparison function with args (a, b, user data)

 

user_data

User data argument for compare +

 
+
+
+
+
+

raptor_sequence_swap ()

+
int
+raptor_sequence_swap (raptor_sequence *seq,
+                      int i,
+                      int j);
+

Swap a pair of elements in a sequence

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

seq

sequence

 

i

first data index

 

j

second data index

 
+
+
+

Returns

+

non-0 if arguments are out of range

+
+
+
+
+

raptor_sequence_unshift ()

+
void *
+raptor_sequence_unshift (raptor_sequence *seq);
+

Retrieve the item at the start of the sequence.

+

Ownership of the item is transferred to the caller, +i.e. caller is responsible of freeing the item.

+
+

Parameters

+
+++++ + + + + + +

seq

sequence to use

 
+
+
+

Returns

+

the object or NULL if the sequence is empty

+
+
+
+
+

Types and Values

+
+

raptor_sequence

+
raptor_sequence* raptor_sequence;
+
+

Raptor sequence class

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-serializer.html b/docs/html/raptor2-section-serializer.html new file mode 100644 index 0000000..ed4bbbe --- /dev/null +++ b/docs/html/raptor2-section-serializer.html @@ -0,0 +1,811 @@ + + + + +section-serializer: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-serializer

+

section-serializer

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_serializer * + +raptor_new_serializer () +
+void + +raptor_free_serializer () +
+int + +raptor_serializer_start_to_iostream () +
+int + +raptor_serializer_start_to_filename () +
+int + +raptor_serializer_start_to_string () +
+int + +raptor_serializer_start_to_file_handle () +
+int + +raptor_serializer_set_namespace () +
+int + +raptor_serializer_set_namespace_from_namespace () +
+int + +raptor_serializer_serialize_statement () +
+int + +raptor_serializer_serialize_end () +
+int + +raptor_serializer_flush () +
const raptor_syntax_description * + +raptor_serializer_get_description () +
+raptor_iostream * + +raptor_serializer_get_iostream () +
+raptor_locator * + +raptor_serializer_get_locator () +
+int + +raptor_serializer_set_option () +
+int + +raptor_serializer_get_option () +
+raptor_world * + +raptor_serializer_get_world () +
+
+
+

Types and Values

+
++++ + + + + +
typedefraptor_serializer
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_serializer ()

+
raptor_serializer *
+raptor_new_serializer (raptor_world *world,
+                       const char *name);
+

Constructor - create a new raptor_serializer object.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor_world object

 

name

the serializer name or NULL for default syntax

 
+
+
+

Returns

+

a new raptor_serializer object or NULL on failure

+
+
+
+
+

raptor_free_serializer ()

+
void
+raptor_free_serializer (raptor_serializer *rdf_serializer);
+

Destructor - destroy a raptor_serializer object.

+
+

Parameters

+
+++++ + + + + + +

rdf_serializer

raptor_serializer object

 
+
+
+
+
+

raptor_serializer_start_to_iostream ()

+
int
+raptor_serializer_start_to_iostream (raptor_serializer *rdf_serializer,
+                                     raptor_uri *uri,
+                                     raptor_iostream *iostream);
+

Start serialization to an iostream with given base URI

+

The passed in iostream + does not become owned by the serializer +and can be used by the caller after serializing is done. It +must be destroyed by the caller.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

rdf_serializer

the raptor_serializer

 

uri

base URI or NULL if no base URI is required

 

iostream

raptor_iostream to write serialization to

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_serializer_start_to_filename ()

+
int
+raptor_serializer_start_to_filename (raptor_serializer *rdf_serializer,
+                                     const char *filename);
+

Start serializing to a filename.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

rdf_serializer

the raptor_serializer

 

filename

filename to serialize to

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_serializer_start_to_string ()

+
int
+raptor_serializer_start_to_string (raptor_serializer *rdf_serializer,
+                                   raptor_uri *uri,
+                                   void **string_p,
+                                   size_t *length_p);
+

Start serializing to a string.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

rdf_serializer

the raptor_serializer

 

uri

base URI or NULL if no base URI is required

 

string_p

pointer to location to hold string

 

length_p

pointer to location to hold length of string (or NULL)

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_serializer_start_to_file_handle ()

+
int
+raptor_serializer_start_to_file_handle
+                               (raptor_serializer *rdf_serializer,
+                                raptor_uri *uri,
+                                FILE *fh);
+

Start serializing to a FILE*.

+

NOTE: This does not fclose the handle when it is finished.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

rdf_serializer

the raptor_serializer

 

uri

base URI or NULL if no base URI is required

 

fh

FILE* to serialize to

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_serializer_set_namespace ()

+
int
+raptor_serializer_set_namespace (raptor_serializer *rdf_serializer,
+                                 raptor_uri *uri,
+                                 const char *prefix);
+

set a namespace uri/prefix mapping for serializing.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

rdf_serializer

the raptor_serializer

 

uri

raptor_uri of namespace or NULL

 

prefix

prefix to use or NULL

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_serializer_set_namespace_from_namespace ()

+
int
+raptor_serializer_set_namespace_from_namespace
+                               (raptor_serializer *rdf_serializer,
+                                raptor_namespace *nspace);
+

Set a namespace uri/prefix mapping for serializing from an existing namespace.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

rdf_serializer

the raptor_serializer

 

nspace

raptor_namespace to set

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_serializer_serialize_statement ()

+
int
+raptor_serializer_serialize_statement (raptor_serializer *rdf_serializer,
+                                       raptor_statement *statement);
+

Serialize a statement.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

rdf_serializer

the raptor_serializer

 

statement

raptor_statement to serialize to a syntax

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_serializer_serialize_end ()

+
int
+raptor_serializer_serialize_end (raptor_serializer *rdf_serializer);
+

End a serialization.

+
+

Parameters

+
+++++ + + + + + +

rdf_serializer

the raptor_serializer

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_serializer_flush ()

+
int
+raptor_serializer_flush (raptor_serializer *rdf_serializer);
+

Flush the current serializer output and free any pending state

+

In serializers that can generate blocks of content, this causes +the writing of any current pending block. For example in Turtle +this may write all pending triples.

+
+

Parameters

+
+++++ + + + + + +

rdf_serializer

raptor serializer

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_serializer_get_description ()

+
const raptor_syntax_description *
+raptor_serializer_get_description (raptor_serializer *rdf_serializer);
+

Get description of the syntaxes of the serializer.

+

The returned description is static and lives as long as the raptor +library (raptor world).

+
+

Parameters

+
+++++ + + + + + +

rdf_serializer

raptor_serializer serializer object

 
+
+
+

Returns

+

description of syntax

+
+
+
+
+

raptor_serializer_get_iostream ()

+
raptor_iostream *
+raptor_serializer_get_iostream (raptor_serializer *serializer);
+

Get the current serializer iostream.

+
+

Parameters

+
+++++ + + + + + +

serializer

raptor_serializer object

 
+
+
+

Returns

+

the serializer's current iostream or NULL if

+
+
+
+
+

raptor_serializer_get_locator ()

+
raptor_locator *
+raptor_serializer_get_locator (raptor_serializer *rdf_serializer);
+

Get the serializer raptor locator object.

+
+

Parameters

+
+++++ + + + + + +

rdf_serializer

raptor serializer

 
+
+
+

Returns

+

raptor locator

+
+
+
+
+

raptor_serializer_set_option ()

+
int
+raptor_serializer_set_option (raptor_serializer *serializer,
+                              raptor_option option,
+                              const char *string,
+                              int integer);
+

Set serializer option.

+

If string + is not NULL and the option type is numeric, the string +value is converted to an integer and used in preference to integer +.

+

If string + is NULL and the option type is not numeric, an error is +returned.

+

The string + values used are copied.

+

The allowed options are available via +raptor_world_get_option_description().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

serializer

raptor_serializer serializer object

 

option

option to set from enumerated raptor_option values

 

string

string option value (or NULL)

 

integer

integer option value

 
+
+
+

Returns

+

non 0 on failure or if the option is unknown

+
+
+
+
+

raptor_serializer_get_option ()

+
int
+raptor_serializer_get_option (raptor_serializer *serializer,
+                              raptor_option option,
+                              char **string_p,
+                              int *integer_p);
+

Get serializer option.

+

Any string value returned in *string_p + is shared and must +be copied by the caller.

+

The allowed options are available via +raptor_world_get_option_description().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

serializer

raptor_serializer serializer object

 

option

option to get value

 

string_p

pointer to where to store string value

 

integer_p

pointer to where to store integer value

 
+
+
+

Returns

+

option value or < 0 for an illegal option

+
+
+
+
+

raptor_serializer_get_world ()

+
raptor_world *
+raptor_serializer_get_world (raptor_serializer *rdf_serializer);
+

Get the raptor_world object associated with a serializer.

+
+

Parameters

+
+++++ + + + + + +

rdf_serializer

raptor serializer

 
+
+
+

Returns

+

raptor_world* pointer

+
+
+
+
+

Types and Values

+
+

raptor_serializer

+
raptor_serializer* raptor_serializer;
+
+

Raptor Serializer class

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-stringbuffer.html b/docs/html/raptor2-section-stringbuffer.html new file mode 100644 index 0000000..9d142ca --- /dev/null +++ b/docs/html/raptor2-section-stringbuffer.html @@ -0,0 +1,701 @@ + + + + +section-stringbuffer: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-stringbuffer

+

section-stringbuffer

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_stringbuffer * + +raptor_new_stringbuffer () +
+void + +raptor_free_stringbuffer () +
+int + +raptor_stringbuffer_append_counted_string () +
+int + +raptor_stringbuffer_append_decimal () +
+int + +raptor_stringbuffer_append_hexadecimal () +
+int + +raptor_stringbuffer_append_string () +
+int + +raptor_stringbuffer_append_stringbuffer () +
+int + +raptor_stringbuffer_append_uri_escaped_counted_string () +
+int + +raptor_stringbuffer_prepend_counted_string () +
+int + +raptor_stringbuffer_prepend_string () +
unsigned char * + +raptor_stringbuffer_as_string () +
+size_t + +raptor_stringbuffer_length () +
+int + +raptor_stringbuffer_copy_to_string () +
+int + +raptor_stringbuffer_write () +
+
+
+

Types and Values

+
++++ + + + + +
typedefraptor_stringbuffer
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_stringbuffer ()

+
raptor_stringbuffer *
+raptor_new_stringbuffer (void);
+

Create a new stringbuffer.

+
+

Returns

+

pointer to a raptor_stringbuffer object or NULL on failure

+
+
+
+
+

raptor_free_stringbuffer ()

+
void
+raptor_free_stringbuffer (raptor_stringbuffer *stringbuffer);
+

Destroy a stringbuffer.

+
+

Parameters

+
+++++ + + + + + +

stringbuffer

stringbuffer object to destroy.

 
+
+
+
+
+

raptor_stringbuffer_append_counted_string ()

+
int
+raptor_stringbuffer_append_counted_string
+                               (raptor_stringbuffer *stringbuffer,
+                                const char *string,
+                                size_t length,
+                                int do_copy);
+

Add a counted string to the stringbuffer.

+

If string + is NULL or length + is 0, no work is performed.

+

If do_copy + is non-0, the passed-in string is copied into new memory +otherwise the stringbuffer becomes the owner of the string pointer +and will free it when the stringbuffer is destroyed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

stringbuffer

raptor stringbuffer

 

string

string

 

length

length of string

 

do_copy

non-0 to copy the string

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_stringbuffer_append_decimal ()

+
int
+raptor_stringbuffer_append_decimal (raptor_stringbuffer *stringbuffer,
+                                    int integer);
+

Add an integer in decimal to the stringbuffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stringbuffer

raptor stringbuffer

 

integer

integer to format as decimal and add

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_stringbuffer_append_hexadecimal ()

+
int
+raptor_stringbuffer_append_hexadecimal
+                               (raptor_stringbuffer *stringbuffer,
+                                int hex);
+

Add an integer formatted in hexdecimal (base 16) to the stringbuffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stringbuffer

raptor stringbuffer

 

hex

integer to format

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_stringbuffer_append_string ()

+
int
+raptor_stringbuffer_append_string (raptor_stringbuffer *stringbuffer,
+                                   const char *string,
+                                   int do_copy);
+

Add a string to the stringbuffer.

+

If string + is NULL, no work is performed.

+

If do_copy + is non-0, the passed-in string is copied into new memory +otherwise the stringbuffer becomes the owner of the string pointer +and will free it when the stringbuffer is destroyed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

stringbuffer

raptor stringbuffer

 

string

string

 

do_copy

non-0 to copy the string

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_stringbuffer_append_stringbuffer ()

+
int
+raptor_stringbuffer_append_stringbuffer
+                               (raptor_stringbuffer *stringbuffer,
+                                raptor_stringbuffer *append);
+

Add a stringbuffer to the stringbuffer.

+

This function removes the content from the appending stringbuffer, +making it empty and appends it to the supplied stringbuffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

stringbuffer

raptor_stringbuffer

 

append

raptor_stringbuffer to append

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_stringbuffer_append_uri_escaped_counted_string ()

+
int
+raptor_stringbuffer_append_uri_escaped_counted_string
+                               (raptor_stringbuffer *sb,
+                                const char *string,
+                                size_t length,
+                                int space_is_plus);
+

Add a URI-escaped version of string + to the stringbuffer.

+

If string + is NULL or length + is 0, no work is performed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

sb

raptor stringbuffer

 

string

string

 

length

length of string

 

space_is_plus

if non-0, escape spaces as '+' otherwise percent-encode them

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_stringbuffer_prepend_counted_string ()

+
int
+raptor_stringbuffer_prepend_counted_string
+                               (raptor_stringbuffer *stringbuffer,
+                                const char *string,
+                                size_t length,
+                                int do_copy);
+

If do_copy is non-0, the passed-in string is copied into new memory +otherwise the stringbuffer becomes the owner of the string pointer +and will free it when the stringbuffer is destroyed.

+

Add a string to the start of the stringbuffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

stringbuffer

raptor stringbuffer

 

string

string

 

length

length of string

 

do_copy

non-0 to copy the string

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_stringbuffer_prepend_string ()

+
int
+raptor_stringbuffer_prepend_string (raptor_stringbuffer *stringbuffer,
+                                    const char *string,
+                                    int do_copy);
+

Add a string to the start of the stringbuffer.

+

If do_copy is non-0, the passed-in string is copied into new memory +otherwise the stringbuffer becomes the owner of the string pointer +and will free it when the stringbuffer is destroyed.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

stringbuffer

raptor stringbuffer

 

string

string

 

do_copy

non-0 to copy the string

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_stringbuffer_as_string ()

+
unsigned char *
+raptor_stringbuffer_as_string (raptor_stringbuffer *stringbuffer);
+

Return the stringbuffer as a C string.

+

Note: the return value is a to a shared string that the stringbuffer +allocates and manages.

+
+

Parameters

+
+++++ + + + + + +

stringbuffer

raptor stringbuffer

 
+
+
+

Returns

+

NULL on failure or stringbuffer is empty, otherwise +a pointer to a shared copy of the string.

+
+
+
+
+

raptor_stringbuffer_length ()

+
size_t
+raptor_stringbuffer_length (raptor_stringbuffer *stringbuffer);
+

Return the stringbuffer length.

+
+

Parameters

+
+++++ + + + + + +

stringbuffer

raptor stringbuffer

 
+
+
+

Returns

+

size of stringbuffer

+
+
+
+
+

raptor_stringbuffer_copy_to_string ()

+
int
+raptor_stringbuffer_copy_to_string (raptor_stringbuffer *stringbuffer,
+                                    unsigned char *string,
+                                    size_t length);
+

Copy the stringbuffer into a string.

+

Copies the underlying string to a pre-allocated buffer. The +output string is always '\0' terminated.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

stringbuffer

raptor stringbuffer

 

string

output string

 

length

size of output string

 
+
+
+

Returns

+

non-0 on failure such as stringbuffer is empty, buffer is too small

+
+
+
+
+

raptor_stringbuffer_write ()

+
int
+raptor_stringbuffer_write (raptor_stringbuffer *sb,
+                           raptor_iostream *iostr);
+

Write a stringbuffer to an iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

sb

raptor_stringbuffer to write

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

Types and Values

+
+

raptor_stringbuffer

+
raptor_stringbuffer* raptor_stringbuffer;
+
+

Raptor string buffer class

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-triples.html b/docs/html/raptor2-section-triples.html new file mode 100644 index 0000000..eeca662 --- /dev/null +++ b/docs/html/raptor2-section-triples.html @@ -0,0 +1,1704 @@ + + + + +section-triples: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-triples

+

section-triples

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_term * + +raptor_new_term_from_blank () +
+raptor_term * + +raptor_new_term_from_counted_blank () +
+raptor_term * + +raptor_new_term_from_literal () +
+raptor_term * + +raptor_new_term_from_counted_literal () +
+raptor_term * + +raptor_new_term_from_counted_uri_string () +
+raptor_term * + +raptor_new_term_from_uri () +
+raptor_term * + +raptor_new_term_from_uri_string () +
+raptor_term * + +raptor_new_term_from_counted_string () +
+raptor_term * + +raptor_term_copy () +
+int + +raptor_term_compare () +
+int + +raptor_term_equals () +
+void + +raptor_free_term () +
unsigned char * + +raptor_term_to_counted_string () +
unsigned char * + +raptor_term_to_string () +
+int + +raptor_term_ntriples_write () +
unsigned char * + +raptor_term_to_turtle_counted_string () +
unsigned char * + +raptor_term_to_turtle_string () +
+int + +raptor_term_turtle_write () +
+raptor_statement * + +raptor_new_statement () +
+raptor_statement * + +raptor_new_statement_from_nodes () +
+void + +raptor_free_statement () +
+raptor_statement * + +raptor_statement_copy () +
+int + +raptor_statement_compare () +
+int + +raptor_statement_equals () +
+void + +raptor_statement_init () +
+void + +raptor_statement_clear () +
+int + +raptor_statement_print () +
+int + +raptor_statement_print_as_ntriples () +
+int + +raptor_statement_ntriples_write () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + +
enumraptor_term_type
 raptor_term
 raptor_term_value
 raptor_term_blank_value
 raptor_term_literal_value
 raptor_statement
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_term_from_blank ()

+
raptor_term *
+raptor_new_term_from_blank (raptor_world *world,
+                            const unsigned char *blank);
+

Constructor - create a new blank node statement term from a UTF-8 encoded blank node ID

+

Takes a copy of the passed in blank +

+

If blank + is NULL or an empty string, creates a new internal +identifier and uses it. This will use the handler set with +raptor_world_set_generate_bnodeid_parameters()

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor world

 

blank

UTF-8 encoded blank node identifier (or NULL)

 
+
+
+

Returns

+

new term or NULL on failure

+
+
+
+
+

raptor_new_term_from_counted_blank ()

+
raptor_term *
+raptor_new_term_from_counted_blank (raptor_world *world,
+                                    const unsigned char *blank,
+                                    size_t length);
+

Constructor - create a new blank node statement term from a counted UTF-8 encoded blank node ID

+

Takes a copy of the passed in blank +

+

If blank + is NULL, creates a new internal identifier and uses it. +This will use the handler set with +raptor_world_set_generate_bnodeid_parameters()

+

Note: The blank + need not be NULL terminated - a NULL will be +added to the copied string used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor world

 

blank

UTF-8 encoded blank node identifier (or NULL)

 

length

length of identifier (or 0)

 
+
+
+

Returns

+

new term or NULL on failure

+
+
+
+
+

raptor_new_term_from_literal ()

+
raptor_term *
+raptor_new_term_from_literal (raptor_world *world,
+                              const unsigned char *literal,
+                              raptor_uri *datatype,
+                              const unsigned char *language);
+

Constructor - create a new literal statement term

+

Takes copies of the passed in literal +, datatype +, language +

+

Only one of language + or datatype + may be given. If both are +given, NULL is returned. If language + is the empty string, it is +the equivalent to NULL.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

world

raptor world

 

literal

UTF-8 encoded literal string (or NULL for empty literal)

 

datatype

literal datatype URI (or NULL)

 

language

literal language (or NULL)

 
+
+
+

Returns

+

new term or NULL on failure

+
+
+
+
+

raptor_new_term_from_counted_literal ()

+
raptor_term *
+raptor_new_term_from_counted_literal (raptor_world *world,
+                                      const unsigned char *literal,
+                                      size_t literal_len,
+                                      raptor_uri *datatype,
+                                      const unsigned char *language,
+                                      unsigned char language_len);
+

Constructor - create a new literal statement term from a counted UTF-8 encoded literal string

+

Takes copies of the passed in literal +, datatype +, language +

+

Only one of language + or datatype + may be given. If both are +given, NULL is returned. If language + is the empty string, it is +the equivalent to NULL.

+

Note: The literal + need not be NULL terminated - a NULL will be +added to the copied string used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

world

raptor world

 

literal

UTF-8 encoded literal string (or NULL for empty literal)

 

literal_len

length of literal

 

datatype

literal datatype URI (or NULL)

 

language

literal language (or NULL for no language)

 

language_len

literal language length

 
+
+
+

Returns

+

new term or NULL on failure

+
+
+
+
+

raptor_new_term_from_counted_uri_string ()

+
raptor_term *
+raptor_new_term_from_counted_uri_string
+                               (raptor_world *world,
+                                const char *uri_string,
+                                size_t length);
+

Constructor - create a new URI statement term from a UTF-8 encoded Unicode string

+

Note: The uri_string + need not be NULL terminated - a NULL will be +added to the copied string used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor world

 

uri_string

UTF-8 encoded URI string.

 

length

length of URI string

 
+
+
+

Returns

+

new term or NULL on failure

+
+
+
+
+

raptor_new_term_from_uri ()

+
raptor_term *
+raptor_new_term_from_uri (raptor_world *world,
+                          raptor_uri *uri);
+

Constructor - create a new URI statement term

+

Takes a copy (reference) of the passed in uri +

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor world

 

uri

uri

 
+
+
+

Returns

+

new term or NULL on failure

+
+
+
+
+

raptor_new_term_from_uri_string ()

+
raptor_term *
+raptor_new_term_from_uri_string (raptor_world *world,
+                                 const char *uri_string);
+

Constructor - create a new URI statement term from a UTF-8 encoded Unicode string

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor world

 

uri_string

UTF-8 encoded URI string.

 
+
+
+

Returns

+

new term or NULL on failure

+
+
+
+
+

raptor_new_term_from_counted_string ()

+
raptor_term *
+raptor_new_term_from_counted_string (raptor_world *world,
+                                     unsigned char *string,
+                                     size_t length);
+

Constructor - create a new term from a Turtle / N-Triples format string in UTF-8

+

See also raptor_term_to_counted_string() and raptor_term_to_string()

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor world

 

string

N-Triples format string (UTF-8)

 

length

length of string +(or 0)

 
+
+
+

Returns

+

new term or NULL on failure

+
+
+
+
+

raptor_term_copy ()

+
raptor_term *
+raptor_term_copy (raptor_term *term);
+

Copy constructor - get a copy of a statement term

+
+

Parameters

+
+++++ + + + + + +

term

raptor term

 
+
+
+

Returns

+

new term object or NULL on failure

+
+
+
+
+

raptor_term_compare ()

+
int
+raptor_term_compare (const raptor_term *t1,
+                     const raptor_term *t2);
+

Compare a pair of raptor_term

+

If types are different, the raptor_term_type order is used.

+

Resource and datatype URIs are compared with raptor_uri_compare(), +blank nodes and literals with strcmp(). If one literal has no +language, it is earlier than one with a language. If one literal +has no datatype, it is earlier than one with a datatype.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

t1

first term

 

t2

second term

 
+
+
+

Returns

+

<0 if t1 is before t2, 0 if equal, >0 if t1 is after t2

+
+
+
+
+

raptor_term_equals ()

+
int
+raptor_term_equals (raptor_term *t1,
+                    raptor_term *t2);
+

Compare a pair of raptor_term for equality

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

t1

first term

 

t2

second term

 
+
+
+

Returns

+

non-0 if the terms are equal

+
+
+
+
+

raptor_free_term ()

+
void
+raptor_free_term (raptor_term *term);
+

Destructor - destroy a raptor_term object.

+
+

Parameters

+
+++++ + + + + + +

term

raptor_term object

 
+
+
+
+
+

raptor_term_to_counted_string ()

+
unsigned char *
+raptor_term_to_counted_string (raptor_term *term,
+                               size_t *len_p);
+

Turns a raptor term into a N-Triples format counted string.

+

Turns the given term + into an N-Triples escaped string using all the +escapes as defined in http://www.w3.org/TR/rdf-testcases/ntriples

+

This function uses raptor_term_ntriples_write() to write to an +raptor_iostream which is the prefered way to write formatted +output.

+

See also raptor_new_term_from_counted_string() to reverse this.

+

See also raptor_term_to_turtle_string() to write as Turtle which +will include Turtle syntax such as 'true' for booleans and """quoting"""

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

term

raptor_term

 

len_p

Pointer to location to store length of new string (if not NULL)

 
+
+
+

Returns

+

the new string or NULL on failure. The length of +the new string is returned in *len_p +if len_p is not NULL.

+
+
+
+
+

raptor_term_to_string ()

+
unsigned char *
+raptor_term_to_string (raptor_term *term);
+

Turns a raptor term into a N-Triples format string.

+

Turns the given term + into an N-Triples escaped string using all the +escapes as defined in http://www.w3.org/TR/rdf-testcases/ntriples

+

See also raptor_new_term_from_counted_string() to reverse this.

+

See also raptor_term_to_turtle_string() to write as Turtle which +will include Turtle syntax such as 'true' for booleans and """quoting"""

+
+

Parameters

+
+++++ + + + + + +

term

raptor_term

 
+
+
+

Returns

+

the new string or NULL on failure.

+
+
+
+
+

raptor_term_ntriples_write ()

+
int
+raptor_term_ntriples_write (const raptor_term *term,
+                            raptor_iostream *iostr);
+

raptor_term_ntriples_write is deprecated and should not be used in newly-written code.

+

Write a raptor_term formatted in N-Triples format to a raptor_iostream

+

Deprecated +: Use raptor_term_escaped_write() that allows +configuring format detail flags.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

term

term to write

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_term_to_turtle_counted_string ()

+
unsigned char *
+raptor_term_to_turtle_counted_string (raptor_term *term,
+                                      raptor_namespace_stack *nstack,
+                                      raptor_uri *base_uri,
+                                      size_t *len_p);
+

Convert raptor_term to a string. +Caller has responsibility to free the string.

+

Note: This creates and destroys several internal objects for each +call so for more efficient writing, create a turtle serializer.

+

See also raptor_term_to_counted_string() which writes in simpler +N-Triples with no Turtle abbreviated forms, and is quicker.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

term

term

 

nstack

namespace stack

 

base_uri

base URI

 

len_p

Pointer to location to store length of new string (if not NULL)

 
+
+
+

Returns

+

the new string or NULL on failure. The length of +the new string is returned in *len_p +if len_p is not NULL.

+
+
+
+
+

raptor_term_to_turtle_string ()

+
unsigned char *
+raptor_term_to_turtle_string (raptor_term *term,
+                              raptor_namespace_stack *nstack,
+                              raptor_uri *base_uri);
+

Convert raptor_term to a string. +Caller has responsibility to free the string.

+

See also raptor_term_to_counted_string() which writes in simpler +N-Triples with no Turtle abbreviated forms, and is quicker.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

term

term

 

nstack

namespace stack

 

base_uri

base URI

 
+
+
+

Returns

+

the new string or NULL on failure.

+
+
+
+
+

raptor_term_turtle_write ()

+
int
+raptor_term_turtle_write (raptor_iostream *iostr,
+                          raptor_term *term,
+                          raptor_namespace_stack *nstack,
+                          raptor_uri *base_uri);
+

Write raptor_term to a stream in turtle syntax (using QNames).

+

Note: This creates and destroys several internal objects for each +call so for more efficient writing, create a turtle serializer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

iostr

iostream for writing

 

term

term

 

nstack

namespace stack

 

base_uri

base URI

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_new_statement ()

+
raptor_statement *
+raptor_new_statement (raptor_world *world);
+

Constructor - create a new raptor_statement.

+
+

Parameters

+
+++++ + + + + + +

world

raptor world

 
+
+
+

Returns

+

new raptor statement or NULL on failure

+
+
+
+
+

raptor_new_statement_from_nodes ()

+
raptor_statement *
+raptor_new_statement_from_nodes (raptor_world *world,
+                                 raptor_term *subject,
+                                 raptor_term *predicate,
+                                 raptor_term *object,
+                                 raptor_term *graph);
+

Constructor - create a new raptor_statement from a set of terms

+

The subject +, predicate +, object + and graph + become owned by the statement.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

world

raptor world

 

subject

subject term (or NULL)

 

predicate

predicate term (or NULL)

 

object

object term (or NULL)

 

graph

graph name term (or NULL)

 
+
+
+

Returns

+

new raptor statement or NULL on failure

+
+
+
+
+

raptor_free_statement ()

+
void
+raptor_free_statement (raptor_statement *statement);
+

Destructor

+
+

Parameters

+
+++++ + + + + + +

statement

statement

 
+
+
+
+
+

raptor_statement_copy ()

+
raptor_statement *
+raptor_statement_copy (raptor_statement *statement);
+

Copy a raptor_statement.

+
+

Parameters

+
+++++ + + + + + +

statement

statement to copy

 
+
+
+

Returns

+

a new raptor_statement or NULL on error

+
+
+
+
+

raptor_statement_compare ()

+
int
+raptor_statement_compare (const raptor_statement *s1,
+                          const raptor_statement *s2);
+

Compare a pair of raptor_statement

+

Uses raptor_term_compare() to check ordering between subjects, +predicates and objects of statements.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

s1

first statement

 

s2

second statement

 
+
+
+

Returns

+

<0 if s1 is before s2, 0 if equal, >0 if s1 is after s2

+
+
+
+
+

raptor_statement_equals ()

+
int
+raptor_statement_equals (const raptor_statement *s1,
+                         const raptor_statement *s2);
+

Compare a pair of raptor_statement for equality

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

s1

first statement

 

s2

second statement

 
+
+
+

Returns

+

non-0 if statements are equal

+
+
+
+
+

raptor_statement_init ()

+
void
+raptor_statement_init (raptor_statement *statement,
+                       raptor_world *world);
+

Initialize a static raptor_statement.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

statement

statement to initialize

 

world

raptor world

 
+
+
+
+
+

raptor_statement_clear ()

+
void
+raptor_statement_clear (raptor_statement *statement);
+

Empty a raptor_statement of terms.

+
+

Parameters

+
+++++ + + + + + +

statement

raptor_statement object

 
+
+
+
+
+

raptor_statement_print ()

+
int
+raptor_statement_print (const raptor_statement *statement,
+                        FILE *stream);
+

Print a raptor_statement to a stream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

statement

raptor_statement object to print

 

stream

FILE* stream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_statement_print_as_ntriples ()

+
int
+raptor_statement_print_as_ntriples (const raptor_statement *statement,
+                                    FILE *stream);
+

Print a raptor_statement in N-Triples form.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

statement

raptor_statement to print

 

stream

FILE* stream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_statement_ntriples_write ()

+
int
+raptor_statement_ntriples_write (const raptor_statement *statement,
+                                 raptor_iostream *iostr,
+                                 int write_graph_term);
+

Write a raptor_statement formatted in N-Triples or N-Quads format +to a raptor_iostream

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

statement

statement to write

 

iostr

raptor iostream

 

write_graph_term

flag to write graph term if present

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

Types and Values

+
+

enum raptor_term_type

+

Type of term in a raptor_statement

+

Node type 3 is unused but exists to preserve numeric compatibility +with librdf_node_type values.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

RAPTOR_TERM_TYPE_UNKNOWN

+

Internal

+
 

RAPTOR_TERM_TYPE_URI

+

RDF URI

+
 

RAPTOR_TERM_TYPE_LITERAL

+

RDF literal

+
 

RAPTOR_TERM_TYPE_BLANK

+

RDF blank node

+
 
+
+
+
+
+

raptor_term

+
typedef struct {
+  raptor_world* world;
+
+  int usage;
+
+  raptor_term_type type;
+
+  raptor_term_value value;
+} raptor_term;
+
+

An RDF statement term

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

raptor_world *world;

world

 

int usage;

usage reference count (if >0)

 

raptor_term_type type;

term type

 

raptor_term_value value;

term values per type

 
+
+
+
+
+

raptor_term_value

+

Term value - this typedef exists solely for use in raptor_term

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + +

raptor_uri *uri;

uri value when term type is RAPTOR_TERM_TYPE_URI

 

raptor_term_literal_value literal;

literal value when term type is RAPTOR_TERM_TYPE_LITERAL

 

raptor_term_blank_value blank;

blank value when term type is RAPTOR_TERM_TYPE_BLANK

 
+
+
+
+
+

raptor_term_blank_value

+
typedef struct {
+  unsigned char *string;
+  unsigned int string_len;
+} raptor_term_blank_value;
+
+

Blank term value - this typedef exists solely for use in raptor_term

+
+

Members

+
+++++ + + + + + + + + + + + + +

unsigned char *string;

literal string

 

unsigned int string_len;

length of string

 
+
+
+
+
+

raptor_term_literal_value

+
typedef struct {
+  unsigned char *string;
+  unsigned int string_len;
+
+  raptor_uri *datatype;
+
+  unsigned char *language;
+  unsigned char language_len;
+} raptor_term_literal_value;
+
+

Literal term value - this typedef exists solely for use in raptor_term

+

Either datatype + or language + may be non-NULL but not both.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

unsigned char *string;

literal string

 

unsigned int string_len;

length of string

 

raptor_uri *datatype;

datatype URI (or NULL)

 

unsigned char *language;

literal language (or NULL)

 

unsigned char language_len;

length of language

 
+
+
+
+
+

raptor_statement

+
typedef struct {
+  raptor_world* world;
+  int usage;
+  raptor_term* subject;
+  raptor_term* predicate;
+  raptor_term* object;
+  raptor_term* graph;
+} raptor_statement;
+
+

An RDF triple with optional graph name (quad)

+

See raptor_term for a description of how the fields may be used. +As returned by a parser statement_handler.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

raptor_world *world;

world pointer

 

int usage;

usage count

 

raptor_term *subject;

statement subject

 

raptor_term *predicate;

statement predicate

 

raptor_term *object;

statement object

 

raptor_term *graph;

statement graph name (or NULL if not present)

 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-unicode.html b/docs/html/raptor2-section-unicode.html new file mode 100644 index 0000000..4db381d --- /dev/null +++ b/docs/html/raptor2-section-unicode.html @@ -0,0 +1,482 @@ + + + + +section-unicode: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-unicode

+

section-unicode

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+int + +raptor_unicode_utf8_string_put_char () +
+int + +raptor_unicode_utf8_string_get_char () +
+int + +raptor_unicode_is_xml11_namestartchar () +
+int + +raptor_unicode_is_xml10_namestartchar () +
+int + +raptor_unicode_is_xml11_namechar () +
+int + +raptor_unicode_is_xml10_namechar () +
+int + +raptor_unicode_check_utf8_string () +
+int + +raptor_unicode_utf8_strlen () +
+size_t + +raptor_unicode_utf8_substr () +
+
+
+

Types and Values

+
++++ + + + + +
typedefraptor_unichar
+
+
+

Description

+
+
+

Functions

+
+

raptor_unicode_utf8_string_put_char ()

+
int
+raptor_unicode_utf8_string_put_char (raptor_unichar c,
+                                     unsigned char *output,
+                                     size_t length);
+

Encode a Unicode character to a UTF-8 string

+

If output + is NULL, then will calculate the length rather than +perform the encoding. This can be used by the called to allocate +space and then re-call this function with the new buffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

c

Unicode character

 

output

UTF-8 string buffer or NULL

 

length

length of output buffer

 
+
+
+

Returns

+

number of bytes encoded to output buffer or <0 on failure

+
+
+
+
+

raptor_unicode_utf8_string_get_char ()

+
int
+raptor_unicode_utf8_string_get_char (const char *input,
+                                     size_t length,
+                                     raptor_unichar *output);
+

Decode a UTF-8 encoded string to get a Unicode character.

+

If output is NULL, then will calculate the number of bytes that +will be used from the input buffer and not perform the conversion.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

input

UTF-8 string buffer

 

length

buffer size

 

output

Pointer to the Unicode character or NULL

 
+
+
+

Returns

+

bytes used from input buffer or <0 on failure: -1 input buffer too short or length error, -2 overlong UTF-8 sequence, -3 illegal code positions, -4 code out of range U+0000 to U+10FFFF. In cases -2, -3 and -4 the coded character is stored in the output.

+
+
+
+
+

raptor_unicode_is_xml11_namestartchar ()

+
int
+raptor_unicode_is_xml11_namestartchar (raptor_unichar c);
+

Check if Unicode character is legal to start an XML 1.1 Name

+

See Namespaces in XML 1.1 REC 2004-02-04 NameStartChar +updating

+Extensible Markup Language (XML) 1.1 REC 2004-02-04 sec 2.3, [4a] +

excluding the ':'

+
+

Parameters

+
+++++ + + + + + +

c

Unicode character to check

 
+
+
+

Returns

+

non-0 if legal

+
+
+
+
+

raptor_unicode_is_xml10_namestartchar ()

+
int
+raptor_unicode_is_xml10_namestartchar (raptor_unichar c);
+

Check if Unicode character is legal to start an XML 1.0 Name

+

See Namespaces in XML REC 1999-01-14 +updating

+Extensible Markup Language (XML) 1.0 (Third Edition) REC 2004-02-04

excluding the ':'

+
+

Parameters

+
+++++ + + + + + +

c

Unicode character to check

 
+
+
+

Returns

+

non-0 if legal

+
+
+
+
+

raptor_unicode_is_xml11_namechar ()

+
int
+raptor_unicode_is_xml11_namechar (raptor_unichar c);
+

Check if a Unicode codepoint is a legal to continue an XML 1.1 Name

+

See Namespaces in XML 1.1 REC 2004-02-04 +updating

+Extensible Markup Language (XML) 1.0 (Third Edition) REC 2004-02-04 sec 2.3, [4a] +

excluding the ':'

+
+

Parameters

+
+++++ + + + + + +

c

Unicode character

 
+
+
+

Returns

+

non-0 if legal

+
+
+
+
+

raptor_unicode_is_xml10_namechar ()

+
int
+raptor_unicode_is_xml10_namechar (raptor_unichar c);
+

Check if a Unicode codepoint is a legal to continue an XML 1.0 Name

+

See Namespaces in XML REC 1999-01-14 NCNameChar +updating

+Extensible Markup Language (XML) 1.0 (Third Edition) REC 2004-02-04

excluding the ':'

+
+

Parameters

+
+++++ + + + + + +

c

Unicode character

 
+
+
+

Returns

+

non-0 if legal

+
+
+
+
+

raptor_unicode_check_utf8_string ()

+
int
+raptor_unicode_check_utf8_string (const char *string,
+                                  size_t length);
+

Check a string is valid Unicode UTF-8.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

string

UTF-8 string

 

length

length of string

 
+
+
+

Returns

+

Non 0 if the string is UTF-8

+
+
+
+
+

raptor_unicode_utf8_strlen ()

+
int
+raptor_unicode_utf8_strlen (const char *string,
+                            size_t length);
+

Calculate the number of Unicode characters in the given UTF-8 encoded buffer

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

string

buffer

 

length

buffer length

 
+
+
+

Returns

+

number of characters or <0 if sequence is invalid

+
+
+
+
+

raptor_unicode_utf8_substr ()

+
size_t
+raptor_unicode_utf8_substr (unsigned char *dest,
+                            size_t *dest_length_p,
+                            const unsigned char *src,
+                            size_t src_length,
+                            int startingLoc,
+                            int length);
+

Get a unicode (UTF-8) substring of an existing UTF-8 string

+

If dest + is NULL, returns the number of bytes needed to write and +does no work.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

dest

destination string buffer to write to (or NULL)

 

dest_length_p

location to store actual destination length (or NULL)

 

src

source string

 

src_length

source length in bytes

 

startingLoc

starting location offset 0 for first Unicode character

 

length

number of Unicode characters to copy at offset startingLoc +(or < 0)

 
+
+
+

Returns

+

number of bytes used in destination string or 0 on failure

+
+
+
+
+

Types and Values

+
+

raptor_unichar

+
typedef unsigned long raptor_unichar;
+
+

raptor Unicode codepoint

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-uri.html b/docs/html/raptor2-section-uri.html new file mode 100644 index 0000000..38c4c86 --- /dev/null +++ b/docs/html/raptor2-section-uri.html @@ -0,0 +1,1675 @@ + + + + +section-uri: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-uri

+

section-uri

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_uri * + +raptor_new_uri () +
+raptor_uri * + +raptor_new_uri_from_counted_string () +
+raptor_uri * + +raptor_new_uri_from_uri_local_name () +
+raptor_uri * + +raptor_new_uri_from_uri_or_file_string () +
+raptor_uri * + +raptor_new_uri_relative_to_base () +
+raptor_uri * + +raptor_new_uri_relative_to_base_counted () +
+raptor_uri * + +raptor_new_uri_from_id () +
+raptor_uri * + +raptor_new_uri_for_rdf_concept () +
+raptor_uri * + +raptor_new_uri_for_xmlbase () +
+raptor_uri * + +raptor_new_uri_for_retrieval () +
+void + +raptor_free_uri () +
+int + +raptor_uri_compare () +
+int + +raptor_uri_equals () +
+raptor_uri * + +raptor_uri_copy () +
unsigned char * + +raptor_uri_as_string () +
unsigned char * + +raptor_uri_as_counted_string () +
unsigned char * + +raptor_uri_to_relative_counted_uri_string () +
unsigned char * + +raptor_uri_to_relative_uri_string () +
unsigned char * + +raptor_uri_to_counted_string () +
unsigned char * + +raptor_uri_to_string () +
+size_t + +raptor_uri_resolve_uri_reference () +
unsigned char * + +raptor_uri_counted_filename_to_uri_string () +
unsigned char * + +raptor_uri_filename_to_uri_string () +
+int + +raptor_uri_uri_string_is_absolute () +
+int + +raptor_uri_uri_string_is_file_uri () +
+char * + +raptor_uri_uri_string_to_filename () +
+char * + +raptor_uri_uri_string_to_filename_fragment () +
+char * + +raptor_uri_uri_string_to_counted_filename_fragment () +
+int + +raptor_uri_print () +
+raptor_world * + +raptor_uri_get_world () +
+int + +raptor_uri_write () +
+int + +raptor_uri_file_exists () +
+int + +raptor_uri_filename_exists () +
unsigned char * + +raptor_uri_to_turtle_counted_string () +
unsigned char * + +raptor_uri_to_turtle_string () +
+int + +raptor_uri_turtle_write () +
+
+
+

Types and Values

+
++++ + + + + +
typedefraptor_uri
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_uri ()

+
raptor_uri *
+raptor_new_uri (raptor_world *world,
+                const char *uri_string);
+

Constructor - create a raptor URI from a UTF-8 encoded Unicode string.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor_world object

 

uri_string

URI string.

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure.

+
+
+
+
+

raptor_new_uri_from_counted_string ()

+
raptor_uri *
+raptor_new_uri_from_counted_string (raptor_world *world,
+                                    const char *uri_string,
+                                    size_t length);
+

Constructor - create a raptor URI from a UTF-8 encoded Unicode string.

+

Note: The uri_string + need not be NULL terminated - a NULL will be +added to the copied string used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

uri_string

URI string.

 

length

length of URI string

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure.

+
+
+
+
+

raptor_new_uri_from_uri_local_name ()

+
raptor_uri *
+raptor_new_uri_from_uri_local_name (raptor_world *world,
+                                    raptor_uri *uri,
+                                    const char *local_name);
+

Constructor - create a raptor URI from an existing URI and a local name.

+

Creates a new URI from the concatenation of the local_name + to the +uri +. This is NOT relative URI resolution, which is done by the +raptor_new_uri_relative_to_base() constructor.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

uri

existing raptor_uri

 

local_name

local name

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure.

+
+
+
+
+

raptor_new_uri_from_uri_or_file_string ()

+
raptor_uri *
+raptor_new_uri_from_uri_or_file_string
+                               (raptor_world *world,
+                                raptor_uri *base_uri,
+                                const unsigned char *uri_or_file_string);
+

Constructor - create a raptor URI from a string that is a relative or absolute URI or a filename

+

If the uri_or_file_string + is a filename PATH that exists, the +result will be a URI file://PATH

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

base_uri

existing base URI

 

uri_or_file_string

URI string or filename

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure

+
+
+
+
+

raptor_new_uri_relative_to_base ()

+
raptor_uri *
+raptor_new_uri_relative_to_base (raptor_world *world,
+                                 raptor_uri *base_uri,
+                                 const char *uri_string);
+

Constructor - create a raptor URI from a base URI and a relative URI string.

+

Use raptor_new_uri_relative_to_base_counted() if the URI string length is known

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

base_uri

existing base URI

 

uri_string

relative URI string

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure.

+
+
+
+
+

raptor_new_uri_relative_to_base_counted ()

+
raptor_uri *
+raptor_new_uri_relative_to_base_counted
+                               (raptor_world *world,
+                                raptor_uri *base_uri,
+                                const char *uri_string,
+                                size_t uri_len);
+

Constructor - create a raptor URI from a base URI and a relative counted URI string.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

base_uri

existing base URI

 

uri_string

relative URI string

 

uri_len

length of URI string (or 0)

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure.

+
+
+
+
+

raptor_new_uri_from_id ()

+
raptor_uri *
+raptor_new_uri_from_id (raptor_world *world,
+                        raptor_uri *base_uri,
+                        const char *id);
+

Constructor - create a new URI from a base URI and RDF ID.

+

This creates a URI equivalent to concatenating base_uri + with

+
+

and id +.

+
+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

base_uri

existing base URI

 

id

RDF ID

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure.

+
+
+
+
+

raptor_new_uri_for_rdf_concept ()

+
raptor_uri *
+raptor_new_uri_for_rdf_concept (raptor_world *world,
+                                const char *name);
+

Constructor - create a raptor URI for the RDF namespace concept name.

+

Example: u=raptor_new_uri_for_rdf_concept("value") creates a new +URI for the rdf:value term.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor_world object

 

name

RDF namespace concept

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure

+
+
+
+
+

raptor_new_uri_for_xmlbase ()

+
raptor_uri *
+raptor_new_uri_for_xmlbase (raptor_uri *old_uri);
+

Constructor - create a URI suitable for use as an XML Base.

+

Takes an existing URI and ensures it has a path (default /) and has +no fragment or query arguments - XML base does not use these.

+
+

Parameters

+
+++++ + + + + + +

old_uri

URI to transform

 
+
+
+

Returns

+

new raptor_uri object or NULL on failure.

+
+
+
+
+

raptor_new_uri_for_retrieval ()

+
raptor_uri *
+raptor_new_uri_for_retrieval (raptor_uri *old_uri);
+

Constructor - create a URI suitable for retrieval.

+

Takes an existing URI and ensures it has a path (default /) and has +no fragment - URI retrieval does not use the fragment part.

+
+

Parameters

+
+++++ + + + + + +

old_uri

URI to transform

 
+
+
+

Returns

+

new raptor_uri object or NULL on failure.

+
+
+
+
+

raptor_free_uri ()

+
void
+raptor_free_uri (raptor_uri *uri);
+

Destructor - destroy a raptor_uri object

+
+

Parameters

+
+++++ + + + + + +

uri

URI to destroy

 
+
+
+
+
+

raptor_uri_compare ()

+
int
+raptor_uri_compare (raptor_uri *uri1,
+                    raptor_uri *uri2);
+

Compare two URIs, ala strcmp.

+

A NULL URI is always less than (never equal to) a non-NULL URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

uri1

URI 1 (may be NULL)

 

uri2

URI 2 (may be NULL)

 
+
+
+

Returns

+

-1 if uri1 < uri2, 0 if equal, 1 if uri1 > uri2

+
+
+
+
+

raptor_uri_equals ()

+
int
+raptor_uri_equals (raptor_uri *uri1,
+                   raptor_uri *uri2);
+

Check if two URIs are equal.

+

A NULL URI is not equal to a non-NULL URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

uri1

URI 1 (may be NULL)

 

uri2

URI 2 (may be NULL)

 
+
+
+

Returns

+

non-0 if the URIs are equal

+
+
+
+
+

raptor_uri_copy ()

+
raptor_uri *
+raptor_uri_copy (raptor_uri *uri);
+

Constructor - get a copy of a URI.

+
+

Parameters

+
+++++ + + + + + +

uri

URI object

 
+
+
+

Returns

+

a new raptor_uri object or NULL on failure

+
+
+
+
+

raptor_uri_as_string ()

+
unsigned char *
+raptor_uri_as_string (raptor_uri *uri);
+

Get a string representation of a URI.

+

Returns a shared pointer to a string representation of uri +. This +string is shared and must not be freed, otherwise see use the +raptor_uri_to_string() or raptor_uri_to_counted_string() methods.

+
+

Parameters

+
+++++ + + + + + +

uri

raptor_uri object

 
+
+
+

Returns

+

shared string representation of URI

+
+
+
+
+

raptor_uri_as_counted_string ()

+
unsigned char *
+raptor_uri_as_counted_string (raptor_uri *uri,
+                              size_t *len_p);
+

Get a string representation of a URI with count.

+

Returns a shared pointer to a string representation of uri + along +with the length of the string in len_p +, if not NULL. This +string is shared and must not be freed, otherwise see use the +raptor_uri_to_string() or raptor_uri_to_counted_string() methods.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

uri

URI object

 

len_p

address of length variable or NULL

 
+
+
+

Returns

+

shared string representation of URI

+
+
+
+
+

raptor_uri_to_relative_counted_uri_string ()

+
unsigned char *
+raptor_uri_to_relative_counted_uri_string
+                               (raptor_uri *base_uri,
+                                raptor_uri *reference_uri,
+                                size_t *length_p);
+

Get the counted relative URI string of a URI against a base URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

base_uri

The base absolute URI to resolve against (or NULL)

 

reference_uri

The reference absolute URI to use

 

length_p

Location to store the length of the relative URI string or NULL

 
+
+
+

Returns

+

A newly allocated relative URI string or NULL on failure

+
+
+
+
+

raptor_uri_to_relative_uri_string ()

+
unsigned char *
+raptor_uri_to_relative_uri_string (raptor_uri *base_uri,
+                                   raptor_uri *reference_uri);
+

Get the relative URI string of a URI against a base URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

base_uri

The base absolute URI to resolve against

 

reference_uri

The reference absolute URI to use

 
+
+
+

Returns

+

A newly allocated relative URI string or NULL on failure

+
+
+
+
+

raptor_uri_to_counted_string ()

+
unsigned char *
+raptor_uri_to_counted_string (raptor_uri *uri,
+                              size_t *len_p);
+

Get a new counted string for a URI.

+

If len_p + is not NULL, the length of the string is stored in it.

+

The memory allocated must be freed by the caller and +raptor_free_memory() should be used for best portability.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

uri

raptor_uri object

 

len_p

Pointer to length (or NULL)

 
+
+
+

Returns

+

new string or NULL on failure

+
+
+
+
+

raptor_uri_to_string ()

+
unsigned char *
+raptor_uri_to_string (raptor_uri *uri);
+

Get a new string for a URI.

+

The memory allocated must be freed by the caller and +raptor_free_memory() should be used for best portability.

+
+

Parameters

+
+++++ + + + + + +

uri

raptor_uri object

 
+
+
+

Returns

+

new string or NULL on failure

+
+
+
+
+

raptor_uri_resolve_uri_reference ()

+
size_t
+raptor_uri_resolve_uri_reference (const char *base_uri,
+                                  const unsigned char *reference_uri,
+                                  unsigned char *buffer,
+                                  size_t length);
+

Resolve a URI against a base URI to create a new absolute URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

base_uri

Base URI string

 

reference_uri

Reference URI string

 

buffer

Destination URI output buffer

 

length

Length of destination output buffer

 
+
+
+

Returns

+

length of resolved string or 0 on failure (such as buffer +too small)

+
+
+
+
+

raptor_uri_counted_filename_to_uri_string ()

+
unsigned char *
+raptor_uri_counted_filename_to_uri_string
+                               (const char *filename,
+                                size_t filename_len);
+

Converts a counted filename to a file: URI.

+

Handles the OS-specific escaping on turning filenames into URIs +and returns a new buffer that the caller must free(). Turns a +space in the filename into %20 and '%' into %25.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

filename

The filename to convert

 

filename_len

length of filename +or 0 to count it here

 
+
+
+

Returns

+

A newly allocated string with the URI or NULL on failure

+
+
+
+
+

raptor_uri_filename_to_uri_string ()

+
unsigned char *
+raptor_uri_filename_to_uri_string (const char *filename);
+

Converts a filename to a file: URI.

+

Handles the OS-specific escaping on turning filenames into URIs +and returns a new buffer that the caller must free(). Turns a +space in the filename into %20 and '%' into %25.

+
+

Parameters

+
+++++ + + + + + +

filename

The filename to convert

 
+
+
+

Returns

+

A newly allocated string with the URI or NULL on failure

+
+
+
+
+

raptor_uri_uri_string_is_absolute ()

+
int
+raptor_uri_uri_string_is_absolute (const unsigned char *uri_string);
+

Check if a uri string is an absolute URI

+
+

Parameters

+
+++++ + + + + + +

uri_string

uri to check write

 
+
+
+

Returns

+

>0 if absolute, 0 if not, < 0 on failure

+
+
+
+
+

raptor_uri_uri_string_is_file_uri ()

+
int
+raptor_uri_uri_string_is_file_uri (const unsigned char *uri_string);
+

Check if a URI string is a file: URI.

+
+

Parameters

+
+++++ + + + + + +

uri_string

The URI string to check

 
+
+
+

Returns

+

Non zero if URI string is a file: URI

+
+
+
+
+

raptor_uri_uri_string_to_filename ()

+
char *
+raptor_uri_uri_string_to_filename (const char *uri_string);
+

Convert a file: URI to a filename.

+

Handles the OS-specific file: URIs to filename mappings. Returns +a new buffer containing the filename that the caller must free.

+

See also raptor_uri_uri_string_to_counted_filename_fragment()

+
+

Parameters

+
+++++ + + + + + +

uri_string

The file: URI to convert

 
+
+
+

Returns

+

A newly allocated string with the filename or NULL on failure

+
+
+
+
+

raptor_uri_uri_string_to_filename_fragment ()

+
char *
+raptor_uri_uri_string_to_filename_fragment
+                               (const char *uri_string,
+                                unsigned char **fragment_p);
+

Convert a file: URI to a filename and fragment.

+

Handles the OS-specific file: URIs to filename mappings. Returns +a new buffer containing the filename that the caller must free.

+

If fragment_p + is given, a new string containing the URI fragment +is returned, or NULL if none is present

+

See also raptor_uri_uri_string_to_counted_filename_fragment()

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

uri_string

The file: URI to convert

 

fragment_p

Address of pointer to store any URI fragment or NULL

 
+
+
+

Returns

+

A newly allocated string with the filename or NULL on failure

+
+
+
+
+

raptor_uri_uri_string_to_counted_filename_fragment ()

+
char *
+raptor_uri_uri_string_to_counted_filename_fragment
+                               (const char *uri_string,
+                                size_t *len_p,
+                                unsigned char **fragment_p,
+                                size_t *fragment_len_p);
+

Convert a file: URI to a counted filename and counted fragment.

+

Handles the OS-specific file: URIs to filename mappings. Returns +a new buffer containing the filename that the caller must free.

+

If len_p + is present the length of the filename is returned

+

If fragment_p + is given, a new string containing the URI fragment +is returned, or NULL if none is present. If fragment_len_p + is present +the length is returned in it.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

uri_string

The file: URI to convert

 

len_p

address of filename length variable or NULL

 

fragment_p

Address of pointer to store any URI fragment or NULL

 

fragment_len_p

address of length variable or NULL

 
+
+
+

Returns

+

A newly allocated string with the filename or NULL on failure

+
+
+
+
+

raptor_uri_print ()

+
int
+raptor_uri_print (const raptor_uri *uri,
+                  FILE *stream);
+

Print a URI to a file handle.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

uri

URI to print

 

stream

The file handle to print to

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_uri_get_world ()

+
raptor_world *
+raptor_uri_get_world (raptor_uri *uri);
+

Get the raptor_world object associated with a raptor_uri.

+
+

Parameters

+
+++++ + + + + + +

uri

raptor_uri object

 
+
+
+

Returns

+

raptor_world object

+
+
+
+
+

raptor_uri_write ()

+
int
+raptor_uri_write (raptor_uri *uri,
+                  raptor_iostream *iostr);
+

Write a raptor URI to the iostream.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

uri

URI

 

iostr

raptor iostream

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_uri_file_exists ()

+
int
+raptor_uri_file_exists (raptor_uri *uri);
+

Check if a file: URI is a file that exists

+
+

Parameters

+
+++++ + + + + + +

uri

URI string

 
+
+
+

Returns

+

> 0 if file exists, 0 if does not exist, < 0 if not a file URI or error

+
+
+
+
+

raptor_uri_filename_exists ()

+
int
+raptor_uri_filename_exists (const unsigned char *path);
+

Check if path + points to a file that exists

+
+

Parameters

+
+++++ + + + + + +

path

file path

 
+
+
+

Returns

+

> 0 if file exists, 0 if does not exist, < 0 on error

+
+
+
+
+

raptor_uri_to_turtle_counted_string ()

+
unsigned char *
+raptor_uri_to_turtle_counted_string (raptor_world *world,
+                                     raptor_uri *uri,
+                                     raptor_namespace_stack *nstack,
+                                     raptor_uri *base_uri,
+                                     size_t *len_p);
+

Convert raptor_uri to a string. +Caller has responsibility to free the string.

+

Note: This creates and destroys several internal objects for each +call so for more efficient writing, create a turtle serializer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

world

world

 

uri

uri

 

nstack

namespace stack

 

base_uri

base URI

 

len_p

Pointer to location to store length of new string (if not NULL)

 
+
+
+

Returns

+

the new string or NULL on failure. The length of +the new string is returned in *len_p +if len_p is not NULL.

+
+
+
+
+

raptor_uri_to_turtle_string ()

+
unsigned char *
+raptor_uri_to_turtle_string (raptor_world *world,
+                             raptor_uri *uri,
+                             raptor_namespace_stack *nstack,
+                             raptor_uri *base_uri);
+

Convert raptor_uri to a string. +Caller has responsibility to free the string.

+

Note: This creates and destroys several internal objects for each +call so for more efficient writing, create a turtle serializer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

world

world

 

uri

uri

 

nstack

namespace stack

 

base_uri

base URI

 
+
+
+

Returns

+

the new string or NULL on failure.

+
+
+
+
+

raptor_uri_turtle_write ()

+
int
+raptor_uri_turtle_write (raptor_world *world,
+                         raptor_iostream *iostr,
+                         raptor_uri *uri,
+                         raptor_namespace_stack *nstack,
+                         raptor_uri *base_uri);
+

Write raptor_uri to a stream in turtle syntax (using QNames).

+

Note: This creates and destroys several internal objects for each +call so for more efficient writing, create a turtle serializer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

world

world

 

iostr

iostream for writing

 

uri

uri

 

nstack

namespace stack

 

base_uri

base URI

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

Types and Values

+
+

raptor_uri

+
raptor_uri* raptor_uri;
+
+

Raptor URI Class.

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-world.html b/docs/html/raptor2-section-world.html new file mode 100644 index 0000000..f14948a --- /dev/null +++ b/docs/html/raptor2-section-world.html @@ -0,0 +1,854 @@ + + + + +section-world: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-world

+

section-world

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
#defineraptor_new_world
+int + +raptor_world_open () +
+void + +raptor_free_world () +
+int + +raptor_world_set_flag () +
+int + +raptor_world_set_libxslt_security_preferences () +
+int + +raptor_world_set_log_handler () +
const raptor_syntax_description * + +raptor_world_get_parser_description () +
+int + +raptor_world_is_parser_name () +
const char * + +raptor_world_guess_parser_name () +
const raptor_syntax_description * + +raptor_world_get_serializer_description () +
+int + +raptor_world_is_serializer_name () +
unsigned char * + +raptor_world_generate_bnodeid () +
+void + +raptor_world_set_generate_bnodeid_handler () +
+void + +raptor_world_set_generate_bnodeid_parameters () +
+int + +raptor_world_get_parsers_count () +
+int + +raptor_world_get_serializers_count () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
typedefraptor_world
enumraptor_world_flag
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_world

+
#define raptor_new_world() raptor_new_world_internal(RAPTOR_VERSION)
+
+

Allocate a new raptor_world object.

+

Allocation of the world and initialization are decoupled to allow +changing settings on the world object before init.

+

Settings and configuration of the world may be made after creating +the object and before the world is initialized using methods such +as raptor_world_set_flag(), raptor_world_set_log_handler(), +raptor_world_set_generate_bnodeid_handler(). Some configuration +may not be changed after initialization.

+

The raptor_world is initialized with raptor_world_open().

+
+

Parameters

+
+++++ + + + + + +

version_decimal

raptor version as a decimal integer as defined by the macro RAPTOR_VERSION and static int raptor_version_decimal

 
+
+
+

Returns

+

uninitialized raptor_world object or NULL on failure

+
+
+
+
+

raptor_world_open ()

+
int
+raptor_world_open (raptor_world *world);
+

Initialise the raptor library.

+

Initializes a raptor_world object created by raptor_new_world(). +Allocation and initialization are decoupled to allow +changing settings on the world object before init.

+

The initialized world object is used with subsequent raptor API calls.

+
+

Parameters

+
+++++ + + + + + +

world

raptor_world object

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_free_world ()

+
void
+raptor_free_world (raptor_world *world);
+

Terminate the raptor library.

+

Destroys the raptor_world object and all related information.

+
+

Parameters

+
+++++ + + + + + +

world

raptor_world object

 
+
+
+
+
+

raptor_world_set_flag ()

+
int
+raptor_world_set_flag (raptor_world *world,
+                       raptor_world_flag flag,
+                       int value);
+

Set library-wide configuration

+

This function is used to control raptor-wide options across +classes. These options must be set before raptor_world_open() is +called explicitly or implicitly (by creating a raptor object). +There is no enumeration function for these flags because they are +not user options and must be set before the library is +initialised. For similar reasons, there is no get function.

+

See the raptor_world_flags documentation for full details of +what the flags mean.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

world

 

flag

flag

 

value

value

 
+
+
+

Returns

+

0 on success, non-0 on failure: <0 on errors (-1 if flag is unknown, -2 if value is illegal) and >0 if world is already opened

+
+
+
+
+

raptor_world_set_libxslt_security_preferences ()

+
int
+raptor_world_set_libxslt_security_preferences
+                               (raptor_world *world,
+                                void *security_preferences);
+

Set libxslt security preferences policy object

+

The security_preferences + object will NOT become owned by +raptor_world.

+

If libxslt is compiled into the library, security_preferences + +should be an xsltSecurityPrefsPtr and will be used to call +xsltSetCtxtSecurityPrefs() when an XSLT engine is initialised. +If security_preferences + is NULL, this will disable all raptor's +calls to xsltSetCtxtSecurityPrefs().

+

If libxslt is not compiled in, the object set here is not used.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

world

 

security_preferences

security preferences (an xsltSecurityPrefsPtr) or NULL

 
+
+
+

Returns

+

0 on success, non-0 on failure: <0 on errors and >0 if world is already opened

+
+
+
+
+

raptor_world_set_log_handler ()

+
int
+raptor_world_set_log_handler (raptor_world *world,
+                              void *user_data,
+                              raptor_log_handler handler);
+

Set the message (error, warning, info) handling function.

+

The function will receive callbacks when messages are generated

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

world object

 

user_data

user data to pass to function

 

handler

pointer to the function

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_world_get_parser_description ()

+
const raptor_syntax_description *
+raptor_world_get_parser_description (raptor_world *world,
+                                     unsigned int counter);
+

Get parser descriptive syntax information

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

world object

 

counter

index into the list of parsers

 
+
+
+

Returns

+

description or NULL if counter is out of range

+
+
+
+
+

raptor_world_is_parser_name ()

+
int
+raptor_world_is_parser_name (raptor_world *world,
+                             const char *name);
+

Check the name of a parser is known.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

world object

 

name

the syntax name

 
+
+
+

Returns

+

non 0 if name is a known syntax name

+
+
+
+
+

raptor_world_guess_parser_name ()

+
const char *
+raptor_world_guess_parser_name (raptor_world *world,
+                                raptor_uri *uri,
+                                const char *mime_type,
+                                const char *buffer,
+                                size_t len,
+                                const unsigned char *identifier);
+

Guess a parser name for content.

+

Find a parser by scoring recognition of the syntax by a block of +characters, the content identifier or a mime type. The content +identifier is typically a filename or URI or some other identifier.

+

If the guessing finds only low scores, NULL will be returned.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

world

world object

 

uri

URI identifying the syntax (or NULL)

 

mime_type

mime type identifying the content (or NULL)

 

buffer

buffer of content to guess (or NULL)

 

len

length of buffer

 

identifier

identifier of content (or NULL)

 
+
+
+

Returns

+

a parser name or NULL if no guess could be made

+
+
+
+
+

raptor_world_get_serializer_description ()

+
const raptor_syntax_description *
+raptor_world_get_serializer_description
+                               (raptor_world *world,
+                                unsigned int counter);
+

Get serializer descriptive syntax information

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

world object

 

counter

index into the list of serializers

 
+
+
+

Returns

+

description or NULL if counter is out of range

+
+
+
+
+

raptor_world_is_serializer_name ()

+
int
+raptor_world_is_serializer_name (raptor_world *world,
+                                 const char *name);
+

Check name of a serializer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor_world object

 

name

the syntax name

 
+
+
+

Returns

+

non 0 if name is a known syntax name

+
+
+
+
+

raptor_world_generate_bnodeid ()

+
unsigned char *
+raptor_world_generate_bnodeid (raptor_world *world);
+

Generate an new blank node ID

+
+

Parameters

+
+++++ + + + + + +

world

raptor_world object

 
+
+
+

Returns

+

newly allocated generated ID or NULL on failure

+
+
+
+
+

raptor_world_set_generate_bnodeid_handler ()

+
void
+raptor_world_set_generate_bnodeid_handler
+                               (raptor_world *world,
+                                void *user_data,
+                                raptor_generate_bnodeid_handler handler);
+

Set the generate ID handler function.

+

Sets the function to generate IDs for the library. The handler is +called with the user_data + parameter.

+

The final argument of the callback method is user_bnodeid, the value of +the rdf:nodeID attribute that the user provided if any (or NULL). +It can either be returned directly as the generated value when present or +modified. The passed in value must be free()d if it is not used.

+

If handler is NULL, the default method is used

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world world object

 

user_data

user data pointer for callback

 

handler

generate ID callback function

 
+
+
+
+
+

raptor_world_set_generate_bnodeid_parameters ()

+
void
+raptor_world_set_generate_bnodeid_parameters
+                               (raptor_world *world,
+                                char *prefix,
+                                int base);
+

Set default ID generation parameters.

+

Sets the parameters for the default algorithm used to generate IDs. +The default algorithm uses both prefix + and base + to generate a new +identifier. The exact identifier generated is not guaranteed to +be a strict concatenation of prefix + and base + but will use both +parts. The prefix + parameter is copied to generate an ID.

+

For finer control of the generated identifiers, use +raptor_world_set_generate_bnodeid_handler().

+

If prefix + is NULL, the default prefix is used (currently "genid") +If base + is less than 1, it is initialised to 1.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

prefix

prefix string

 

base

integer base identifier

 
+
+
+
+
+

raptor_world_get_parsers_count ()

+
int
+raptor_world_get_parsers_count (raptor_world *world);
+

Get number of parsers

+
+

Parameters

+
+++++ + + + + + +

world

world object

 
+
+
+

Returns

+

number of parsers or <0 on failure

+
+
+
+
+

raptor_world_get_serializers_count ()

+
int
+raptor_world_get_serializers_count (raptor_world *world);
+

Get number of serializers

+
+

Parameters

+
+++++ + + + + + +

world

world object

 
+
+
+

Returns

+

number of serializers or <0 on failure

+
+
+
+
+

Types and Values

+
+

raptor_world

+
typedef struct raptor_world_s raptor_world;
+
+

Raptor world class.

+
+
+
+

enum raptor_world_flag

+

Raptor world flags

+

These are used by raptor_world_set_flags() to control raptor-wide +options across classes. These must be set before +raptor_world_open() is called explicitly or implicitly (by +creating a raptor object). There is no enumeration function for +these flags because they are not user options and must be set +before the library is initialised. For similar reasons, there is +no get function.

+

If any libxml handler saving/restoring is enabled, any existing +handler and context is saved before parsing and restored +afterwards. Otherwise, no saving/restoring is performed.

+
+

Members

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE

+

if set (non-0 value) - save/restore the libxml generic error handler when raptor library initializes (default set)

+
 

RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE

+

if set (non-0 value) - save/restore the libxml structured error handler when raptor library terminates (default set)

+
 

RAPTOR_WORLD_FLAG_URI_INTERNING

+

if set (non-0 value) - each URI is saved interned in-memory and reused (default set)

+
 

RAPTOR_WORLD_FLAG_WWW_SKIP_INIT_FINISH

+

if set (non-0 value) the raptor will neither initialise or terminate the lower level WWW library. Usually in raptor initialising either curl_global_init (for libcurl) are called and in raptor cleanup, curl_global_cleanup is called. This flag allows the application finer control over these libraries such as setting other global options or potentially calling and terminating raptor several times. It does mean that applications which use this call must do their own extra work in order to allocate and free all resources to the system.

+
 
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-www.html b/docs/html/raptor2-section-www.html new file mode 100644 index 0000000..efcbdc2 --- /dev/null +++ b/docs/html/raptor2-section-www.html @@ -0,0 +1,1241 @@ + + + + +section-www: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-www

+

section-www

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_www * + +raptor_new_www () +
+raptor_www * + +raptor_new_www_with_connection () +
+void + +raptor_free_www () +
+void + +(*raptor_www_write_bytes_handler) () +
+void + +(*raptor_www_content_type_handler) () +
+int + +raptor_www_set_user_agent2 () +
+void + +raptor_www_set_user_agent () +
+int + +raptor_www_set_proxy2 () +
+void + +raptor_www_set_proxy () +
+int + +raptor_www_set_http_accept2 () +
+void + +raptor_www_set_http_accept () +
+int + +raptor_www_set_http_cache_control () +
+void + +raptor_www_set_write_bytes_handler () +
+void + +raptor_www_set_connection_timeout () +
+void + +raptor_www_set_content_type_handler () +
+int + +(*raptor_uri_filter_func) () +
+void + +raptor_www_set_uri_filter () +
+void + +(*raptor_www_final_uri_handler) () +
+raptor_uri * + +raptor_www_get_final_uri () +
+void + +raptor_www_set_final_uri_handler () +
+int + +raptor_www_fetch () +
+int + +raptor_www_fetch_to_string () +
+void * + +raptor_www_get_connection () +
+int + +raptor_www_set_ssl_cert_options () +
+int + +raptor_www_set_ssl_verify_options () +
+void + +raptor_www_abort () +
+
+
+

Types and Values

+
++++ + + + + +
typedefraptor_www
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_www ()

+
raptor_www *
+raptor_new_www (raptor_world *world);
+

Constructor - create a new raptor_www object.

+
+

Parameters

+
+++++ + + + + + +

world

raptor_world object

 
+
+
+

Returns

+

a new raptor_www or NULL on failure.

+
+
+
+
+

raptor_new_www_with_connection ()

+
raptor_www *
+raptor_new_www_with_connection (raptor_world *world,
+                                void *connection);
+

Constructor - create a new raptor_www object over an existing WWW connection.

+

At present this only works with a libcurl CURL handle object +when raptor is compiled with libcurl suppport. Otherwise the +connection + is ignored. This allows such things as setting +up special flags on the curl handle before passing into the constructor.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor_world object

 

connection

external WWW connection object.

 
+
+
+

Returns

+

a new raptor_www object or NULL on failure.

+
+
+
+
+

raptor_free_www ()

+
void
+raptor_free_www (raptor_www *www);
+

Destructor - destroy a raptor_www object.

+
+

Parameters

+
+++++ + + + + + +

www

WWW object.

 
+
+
+
+
+

raptor_www_write_bytes_handler ()

+
void
+(*raptor_www_write_bytes_handler) (raptor_www *www,
+                                   void *userdata,
+                                   const void *ptr,
+                                   size_t size,
+                                   size_t nmemb);
+

Receiving bytes of data from WWW retrieval handler.

+

Set by raptor_www_set_write_bytes_handler().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

www

WWW object

 

userdata

user data

 

ptr

data pointer

 

size

size of individual item

 

nmemb

number of items

 
+
+
+
+
+

raptor_www_content_type_handler ()

+
void
+(*raptor_www_content_type_handler) (raptor_www *www,
+                                    void *userdata,
+                                    const char *content_type);
+

Receiving Content-Type: header from WWW retrieval handler.

+

Set by raptor_www_set_content_type_handler().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

userdata

user data

 

content_type

content type seen

 
+
+
+
+
+

raptor_www_set_user_agent2 ()

+
int
+raptor_www_set_user_agent2 (raptor_www *www,
+                            const char *user_agent,
+                            size_t user_agent_len);
+

Set the user agent value, for HTTP requests typically.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

user_agent

User-Agent string

 

user_agent_len

Length of user_agent +string or 0 to count it here.

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_www_set_user_agent ()

+
void
+raptor_www_set_user_agent (raptor_www *www,
+                           const char *user_agent);
+

raptor_www_set_user_agent is deprecated and should not be used in newly-written code.

+

Set the user agent value, for HTTP requests typically.

+

Deprecated +: use raptor_www_set_user_agent2() which takes a length +parameter and returns a value to singify failure.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

www

WWW object

 

user_agent

User-Agent string

 
+
+
+
+
+

raptor_www_set_proxy2 ()

+
int
+raptor_www_set_proxy2 (raptor_www *www,
+                       const char *proxy,
+                       size_t proxy_len);
+

Set the proxy for the WWW object.

+

The proxy + usually a string of the form http://server.domain:port.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

proxy

proxy string.

 

proxy_len

Length of proxy +string or 0 to count it here.

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_www_set_proxy ()

+
void
+raptor_www_set_proxy (raptor_www *www,
+                      const char *proxy);
+

raptor_www_set_proxy is deprecated and should not be used in newly-written code.

+

Set the proxy for the WWW object.

+

The proxy + usually a string of the form http://server.domain:port.

+

Deprecated +: use raptor_www_set_proxy2() which takes an length +parameter and returns a value to singify failure.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

www

WWW object

 

proxy

proxy string.

 
+
+
+
+
+

raptor_www_set_http_accept2 ()

+
int
+raptor_www_set_http_accept2 (raptor_www *www,
+                             const char *value,
+                             size_t value_len);
+

Set HTTP Accept header.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

raptor_www class

 

value

Accept: header value or NULL to have an empty one.

 

value_len

Length of value +string or 0 to count it here.

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_www_set_http_accept ()

+
void
+raptor_www_set_http_accept (raptor_www *www,
+                            const char *value);
+

raptor_www_set_http_accept is deprecated and should not be used in newly-written code.

+

Set HTTP Accept header.

+

Deprecated +: use raptor_www_set_http_accept2() which takes an +length parameter and returns a value to singify failure.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

www

raptor_www class

 

value

Accept: header value or NULL to have an empty one.

 
+
+
+
+
+

raptor_www_set_http_cache_control ()

+
int
+raptor_www_set_http_cache_control (raptor_www *www,
+                                   const char *cache_control);
+

Set HTTP Cache-Control:header (default none)

+

The cache_control + value can be a string to set it, "" to send +a blank header or NULL to not set the header at all.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

www

WWW object

 

cache_control

Cache-Control header value (or NULL to disable)

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_www_set_write_bytes_handler ()

+
void
+raptor_www_set_write_bytes_handler (raptor_www *www,
+                                    raptor_www_write_bytes_handler handler,
+                                    void *user_data);
+

Set the handler to receive bytes written by the raptor_www implementation.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

handler

bytes handler function

 

user_data

bytes handler data

 
+
+
+
+
+

raptor_www_set_connection_timeout ()

+
void
+raptor_www_set_connection_timeout (raptor_www *www,
+                                   int timeout);
+

Set WWW connection timeout

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

www

WWW object

 

timeout

Timeout in seconds

 
+
+
+
+
+

raptor_www_set_content_type_handler ()

+
void
+raptor_www_set_content_type_handler (raptor_www *www,
+                                     raptor_www_content_type_handler handler,
+                                     void *user_data);
+

Set the handler to receive the HTTP Content-Type header value.

+

This is called if or when the value is discovered during retrieval +by the raptor_www implementation. Not all implementations provide +access to this.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

handler

content type handler function

 

user_data

content type handler data

 
+
+
+
+
+

raptor_uri_filter_func ()

+
int
+(*raptor_uri_filter_func) (void *user_data,
+                           raptor_uri *uri);
+

Callback function for raptor_www_set_uri_filter

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

user_data

user data

 

uri

raptor_uri URI to check

 
+
+
+

Returns

+

non-0 to filter the URI

+
+
+
+
+

raptor_www_set_uri_filter ()

+
void
+raptor_www_set_uri_filter (raptor_www *www,
+                           raptor_uri_filter_func filter,
+                           void *user_data);
+

Set URI filter function for WWW retrieval.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

filter

URI filter function

 

user_data

User data to pass to filter function

 
+
+
+
+
+

raptor_www_final_uri_handler ()

+
void
+(*raptor_www_final_uri_handler) (raptor_www *www,
+                                 void *userdata,
+                                 raptor_uri *final_uri);
+

Receiving the final resolved URI from a WWW retrieval

+

Set by raptor_www_set_final_uri_handler().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

userdata

user data

 

final_uri

final URI seen

 
+
+
+
+
+

raptor_www_get_final_uri ()

+
raptor_uri *
+raptor_www_get_final_uri (raptor_www *www);
+

Get the WWW final resolved URI.

+

This returns the URI used after any protocol redirection.

+
+

Parameters

+
+++++ + + + + + +

www

raptor_www object

 
+
+
+

Returns

+

a new URI or NULL if not known.

+
+
+
+
+

raptor_www_set_final_uri_handler ()

+
void
+raptor_www_set_final_uri_handler (raptor_www *www,
+                                  raptor_www_final_uri_handler handler,
+                                  void *user_data);
+

Set the handler to receive the HTTP Content-Type header value.

+

This is called if or when the value is discovered during retrieval +by the raptor_www implementation. Not all implementations provide +access to this.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

handler

content type handler function

 

user_data

content type handler data

 
+
+
+
+
+

raptor_www_fetch ()

+
int
+raptor_www_fetch (raptor_www *www,
+                  raptor_uri *uri);
+

Start a WWW content retrieval for the given URI, returning data via the write_bytes handler.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

www

WWW object

 

uri

URI to read from

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

raptor_www_fetch_to_string ()

+
int
+raptor_www_fetch_to_string (raptor_www *www,
+                            raptor_uri *uri,
+                            void **string_p,
+                            size_t *length_p,
+                            raptor_data_malloc_handler const malloc_handler);
+

Start a WWW content retrieval for the given URI, returning the data in a new string.

+

If malloc_handler + is null, raptor will allocate it using it's +own memory allocator. *string_p is set to NULL on failure (and +*length_p to 0 if length_p is not NULL).

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

www

raptor_www object

 

uri

raptor_uri to retrieve

 

string_p

pointer to location to hold string

 

length_p

pointer to location to hold length of string (or NULL)

 

malloc_handler

pointer to malloc() to use to make string (or NULL)

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_www_get_connection ()

+
void *
+raptor_www_get_connection (raptor_www *www);
+

Get WWW library connection object.

+

Return the internal WWW connection handle. For libcurl, this +returns the CURL handle and for libxml the context. Otherwise +it returns NULL.

+
+

Parameters

+
+++++ + + + + + +

www

raptor_www object

 
+
+
+

Returns

+

connection pointer

+
+
+
+
+

raptor_www_set_ssl_cert_options ()

+
int
+raptor_www_set_ssl_cert_options (raptor_www *www,
+                                 const char *cert_filename,
+                                 const char *cert_type,
+                                 const char *cert_passphrase);
+

Set SSL client certificate options (where supported)

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

www

WWW object

 

cert_filename

SSL client certificate file

 

cert_type

SSL client certificate type (default is "PEM")

 

cert_passphrase

SSL client certificate password

 
+
+
+

Returns

+

non-0 when setting options is not supported

+
+
+
+
+

raptor_www_set_ssl_verify_options ()

+
int
+raptor_www_set_ssl_verify_options (raptor_www *www,
+                                   int verify_peer,
+                                   int verify_host);
+

Set whether SSL verifies the authenticity of the peer's certificate

+

These options correspond to setting the curl +CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

www

WWW object

 

verify_peer

SSL verify peer - non-0 to verify peer SSL certificate (default)

 

verify_host

SSL verify host - 0 none, non-0 to require a CN match (default).

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_www_abort ()

+
void
+raptor_www_abort (raptor_www *www,
+                  const char *reason);
+

Abort an ongoing raptor WWW operation and pass back a reason.

+

This is typically used within one of the raptor WWW handlers +when retrieval need no longer continue due to another +processing issue or error.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

www

WWW object

 

reason

abort reason message

 
+
+
+
+
+

Types and Values

+
+

raptor_www

+
raptor_www* raptor_www;
+
+

Raptor WWW class

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-xml-namespace.html b/docs/html/raptor2-section-xml-namespace.html new file mode 100644 index 0000000..fc2bdb3 --- /dev/null +++ b/docs/html/raptor2-section-xml-namespace.html @@ -0,0 +1,1023 @@ + + + + +section-xml-namespace: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-xml-namespace

+

section-xml-namespace

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_namespace * + +raptor_new_namespace_from_uri () +
+raptor_namespace_stack * + +raptor_new_namespaces () +
+int + +raptor_namespaces_init () +
+void + +raptor_namespaces_clear () +
+void + +raptor_free_namespaces () +
+void + +raptor_namespaces_start_namespace () +
+int + +raptor_namespaces_start_namespace_full () +
+void + +raptor_namespaces_end_for_depth () +
+raptor_namespace * + +raptor_namespaces_get_default_namespace () +
+raptor_namespace * + +raptor_namespaces_find_namespace () +
+raptor_namespace * + +raptor_namespaces_find_namespace_by_uri () +
+int + +raptor_namespaces_namespace_in_scope () +
+raptor_namespace * + +raptor_new_namespace () +
+void + +raptor_free_namespace () +
+raptor_uri * + +raptor_namespace_get_uri () +
const unsigned char * + +raptor_namespace_get_prefix () +
const unsigned char * + +raptor_namespace_get_counted_prefix () +
+int + +raptor_namespace_write () +
+int + +raptor_namespace_stack_start_namespace () +
unsigned char * + +raptor_namespace_format_as_xml () +
+int + +raptor_xml_namespace_string_parse () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
typedefraptor_namespace
typedefraptor_namespace_stack
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_namespace_from_uri ()

+
raptor_namespace *
+raptor_new_namespace_from_uri (raptor_namespace_stack *nstack,
+                               const char *prefix,
+                               raptor_uri *ns_uri,
+                               int depth);
+

Constructor - create a new namespace from a prefix and URI object.

+

This declares but does not enable the namespace declaration (or 'start' it) +Use raptor_namespaces_start_namespace() to make the namespace +enabled and in scope for binding prefixes.

+

Alternatively use raptor_namespaces_start_namespace_full() can construct +and enable a namespace in one call.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

nstack

namespace stack

 

prefix

namespace prefix string

 

ns_uri

namespace URI

 

depth

depth of namespace in the stack

 
+
+
+

Returns

+

a new raptor_namespace or NULL on failure

+
+
+
+
+

raptor_new_namespaces ()

+
raptor_namespace_stack *
+raptor_new_namespaces (raptor_world *world,
+                       int defaults);
+

Constructor - create a new raptor_namespace_stack.

+

See raptor_namespaces_init() for the values of defaults +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

world

raptor_world object

 

defaults

namespaces to initialise

 
+
+
+

Returns

+

a new namespace stack or NULL on failure

+
+
+
+
+

raptor_namespaces_init ()

+
int
+raptor_namespaces_init (raptor_world *world,
+                        raptor_namespace_stack *nstack,
+                        int defaults);
+

Initialise an existing namespaces stack object

+

This sets up the stack optionally with some common RDF namespaces.

+

defaults + can be 0 for none, 1 for just XML, 2 for RDF, RDFS, OWL +and XSD (RDQL uses this) or 3+ undefined.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

nstack

raptor_namespace_stack to initialise

 

defaults

namespaces to initialise.

 
+
+
+

Returns

+

non-0 on error

+
+
+
+
+

raptor_namespaces_clear ()

+
void
+raptor_namespaces_clear (raptor_namespace_stack *nstack);
+

Empty a namespace stack of namespaces and any other resources.

+
+

Parameters

+
+++++ + + + + + +

nstack

namespace stack

 
+
+
+
+
+

raptor_free_namespaces ()

+
void
+raptor_free_namespaces (raptor_namespace_stack *nstack);
+

Destructor - destroy a namespace stack

+
+

Parameters

+
+++++ + + + + + +

nstack

namespace stack

 
+
+
+
+
+

raptor_namespaces_start_namespace ()

+
void
+raptor_namespaces_start_namespace (raptor_namespace_stack *nstack,
+                                   raptor_namespace *nspace);
+

Start a namespace on a stack of namespaces.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

nstack

namespace stack

 

nspace

namespace to start

 
+
+
+
+
+

raptor_namespaces_start_namespace_full ()

+
int
+raptor_namespaces_start_namespace_full
+                               (raptor_namespace_stack *nstack,
+                                const char *prefix,
+                                const unsigned char *ns_uri_string,
+                                int depth);
+

Create a new namespace and start it on a stack of namespaces.

+

See raptor_new_namespace() for the meanings of prefix +, +ns_uri_string + and depth + for namespaces.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

nstack

namespace stack

 

prefix

new namespace prefix (or NULL)

 

ns_uri_string

new namespace URI (or NULL)

 

depth

new namespace depth

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_namespaces_end_for_depth ()

+
void
+raptor_namespaces_end_for_depth (raptor_namespace_stack *nstack,
+                                 int depth);
+

End all namespaces at the given depth in the namespace stack.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

nstack

namespace stack

 

depth

depth

 
+
+
+
+
+

raptor_namespaces_get_default_namespace ()

+
raptor_namespace *
+raptor_namespaces_get_default_namespace
+                               (raptor_namespace_stack *nstack);
+

Get the current default namespace in-scope in a stack.

+
+

Parameters

+
+++++ + + + + + +

nstack

namespace stack

 
+
+
+

Returns

+

raptor_namespace or NULL if no default namespace is in scope

+
+
+
+
+

raptor_namespaces_find_namespace ()

+
raptor_namespace *
+raptor_namespaces_find_namespace (raptor_namespace_stack *nstack,
+                                  const char *prefix,
+                                  int prefix_length);
+

Find a namespace in a namespace stack by prefix.

+

Note that this uses the length + so that the prefix may be a prefix (sic) +of a longer string. If prefix + is NULL, the default namespace will +be returned if present, prefix_length + length is ignored in this case.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

nstack

namespace stack

 

prefix

namespace prefix to find

 

prefix_length

length of prefix.

 
+
+
+

Returns

+

raptor_namespace for the prefix or NULL on failure

+
+
+
+
+

raptor_namespaces_find_namespace_by_uri ()

+
raptor_namespace *
+raptor_namespaces_find_namespace_by_uri
+                               (raptor_namespace_stack *nstack,
+                                raptor_uri *ns_uri);
+

Find a namespace in a namespace stack by namespace URI.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

nstack

namespace stack

 

ns_uri

namespace URI to find

 
+
+
+

Returns

+

raptor_namespace for the URI or NULL on failure

+
+
+
+
+

raptor_namespaces_namespace_in_scope ()

+
int
+raptor_namespaces_namespace_in_scope (raptor_namespace_stack *nstack,
+                                      const raptor_namespace *nspace);
+

Test if a given namespace is in-scope in the namespace stack.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

nstack

namespace stack

 

nspace

namespace

 
+
+
+

Returns

+

non-0 if the namespace is in scope.

+
+
+
+
+

raptor_new_namespace ()

+
raptor_namespace *
+raptor_new_namespace (raptor_namespace_stack *nstack,
+                      const char *prefix,
+                      const unsigned char *ns_uri_string,
+                      int depth);
+

Constructor - create a new namespace from a prefix and URI string with a depth scope.

+

This declares but does not enable the namespace declaration (or 'start' it) +Use raptor_namespaces_start_namespace() to make the namespace +enabled and in scope for binding prefixes.

+

Alternatively use raptor_namespaces_start_namespace_full() can construct +and enable a namespace in one call.

+

The depth + is a way to use the stack of namespaces for providing scoped +namespaces where inner scope namespaces override outer scope namespaces. +This is primarily for RDF/XML and XML syntaxes that have hierarchical +elements. The main use of this is raptor_namespaces_end_for_depth() +to disable ('end') all namespaces at a given depth. Otherwise set this +to 0.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

nstack

namespace stack

 

prefix

namespace prefix string

 

ns_uri_string

namespace URI string

 

depth

depth of namespace in the stack

 
+
+
+

Returns

+

a new raptor_namespace or NULL on failure

+
+
+
+
+

raptor_free_namespace ()

+
void
+raptor_free_namespace (raptor_namespace *ns);
+

Destructor - destroy a namespace.

+
+

Parameters

+
+++++ + + + + + +

ns

namespace object

 
+
+
+
+
+

raptor_namespace_get_uri ()

+
raptor_uri *
+raptor_namespace_get_uri (const raptor_namespace *ns);
+

Get the namespace URI.

+
+

Parameters

+
+++++ + + + + + +

ns

namespace object

 
+
+
+

Returns

+

namespace URI or NULL

+
+
+
+
+

raptor_namespace_get_prefix ()

+
const unsigned char *
+raptor_namespace_get_prefix (const raptor_namespace *ns);
+

Get the namespace prefix.

+
+

Parameters

+
+++++ + + + + + +

ns

namespace object

 
+
+
+

Returns

+

prefix string or NULL

+
+
+
+
+

raptor_namespace_get_counted_prefix ()

+
const unsigned char *
+raptor_namespace_get_counted_prefix (const raptor_namespace *ns,
+                                     size_t *length_p);
+

Get the namespace prefix and length.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

ns

namespace object

 

length_p

pointer to store length or NULL

 
+
+
+

Returns

+

prefix string or NULL

+
+
+
+
+

raptor_namespace_write ()

+
int
+raptor_namespace_write (raptor_namespace *ns,
+                        raptor_iostream *iostr);
+

Write a formatted namespace to an iostream

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

ns

namespace to write

 

iostr

raptor iosteram

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_namespace_stack_start_namespace ()

+
int
+raptor_namespace_stack_start_namespace
+                               (raptor_namespace_stack *nstack,
+                                raptor_namespace *ns,
+                                int new_depth);
+

Copy an existing namespace to a namespace stack with a new depth +and start it.

+

The depth + is a way to use the stack of namespaces for providing scoped +namespaces where inner scope namespaces override outer scope namespaces. +This is primarily for RDF/XML and XML syntaxes that have hierarchical +elements. The main use of this is raptor_namespaces_end_for_depth() +to disable ('end') all namespaces at a given depth. If depths are +not being needed it is unlikely this call is ever needed to copy an +existing namespace at a new depth.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

nstack

namespace stack

 

ns

namespace

 

new_depth

new depth

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_namespace_format_as_xml ()

+
unsigned char *
+raptor_namespace_format_as_xml (const raptor_namespace *ns,
+                                size_t *length_p);
+

Format a namespace in an XML style into a newly allocated string.

+

Generates a string of the form xmlns:prefix="uri", +xmlns="uri", xmlns:prefix="" or xmlns="" depending on the +namespace's prefix or URI. Double quotes are always used.

+

If length_p + is not NULL, the length of the string is +stored in the address it points to.

+

See also raptor_xml_namespace_string_parse()

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

ns

namespace object

 

length_p

pointer to length (or NULL)

 
+
+
+

Returns

+

namespace formatted as newly allocated string or NULL on failure

+
+
+
+
+

raptor_xml_namespace_string_parse ()

+
int
+raptor_xml_namespace_string_parse (const char *string,
+                                   unsigned char **prefix,
+                                   unsigned char **uri_string);
+

Parse a string containing an XML style namespace declaration +into a namespace prefix and URI pair.

+

The string is of the form xmlns:prefix="uri", +xmlns="uri", xmlns:prefix="" or xmlns="". +The quotes can be single or double quotes.

+

Two values are returned from this function into *prefix + and +*uri_string +. Either but not both may be NULL.

+

See also raptor_namespace_format_as_xml()

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

string

string to parse

 

prefix

pointer to location to store namespace prefix

 

uri_string

pointer to location to store namespace URI

 
+
+
+

Returns

+

non-0 on failure.

+
+
+
+
+

Types and Values

+
+

raptor_namespace

+
raptor_namespace* raptor_namespace;
+
+

Raptor XML Namespace class

+
+
+
+

raptor_namespace_stack

+
raptor_namespace_stack* raptor_namespace_stack;
+
+

Raptor XML Namespace Stack class

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-xml-qname.html b/docs/html/raptor2-section-xml-qname.html new file mode 100644 index 0000000..cddab91 --- /dev/null +++ b/docs/html/raptor2-section-xml-qname.html @@ -0,0 +1,668 @@ + + + + +section-xml-qname: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-xml-qname

+

section-xml-qname

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_qname * + +raptor_new_qname () +
+raptor_qname * + +raptor_new_qname_from_namespace_local_name () +
+raptor_qname * + +raptor_new_qname_from_namespace_uri () +
+raptor_qname * + +raptor_qname_copy () +
+void + +raptor_free_qname () +
+int + +raptor_qname_equal () +
+raptor_uri * + +raptor_qname_string_to_uri () +
+int + +raptor_qname_write () +
unsigned char * + +raptor_qname_format_as_xml () +
const unsigned char * + +raptor_qname_get_counted_value () +
const unsigned char * + +raptor_qname_get_local_name () +
const raptor_namespace * + +raptor_qname_get_namespace () +
const unsigned char * + +raptor_qname_get_value () +
unsigned char * + +raptor_qname_to_counted_name () +
+
+
+

Types and Values

+
++++ + + + + +
typedefraptor_qname
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_qname ()

+
raptor_qname *
+raptor_new_qname (raptor_namespace_stack *nstack,
+                  const char *name,
+                  const unsigned char *value);
+

Constructor - create a new XML qname.

+

Create a new qname from the local element/attribute name, +with optional (attribute) value. The namespace stack is used +to look up the name and find the namespace and generate the +URI of the qname.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

nstack

namespace stack to look up for namespaces

 

name

element or attribute name

 

value

attribute value (else is an element)

 
+
+
+

Returns

+

a new raptor_qname object or NULL on failure

+
+
+
+
+

raptor_new_qname_from_namespace_local_name ()

+
raptor_qname *
+raptor_new_qname_from_namespace_local_name
+                               (raptor_world *world,
+                                raptor_namespace *ns,
+                                const char *local_name,
+                                const unsigned char *value);
+

Constructor - create a new XML qname.

+

Create a new qname from the namespace and local element/attribute name, +with optional (attribute) value.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

ns

namespace of qname (or NULL)

 

local_name

element or attribute name

 

value

attribute value (else is an element)

 
+
+
+

Returns

+

a new raptor_qname object or NULL on failure

+
+
+
+
+

raptor_new_qname_from_namespace_uri ()

+
raptor_qname *
+raptor_new_qname_from_namespace_uri (raptor_namespace_stack *nstack,
+                                     raptor_uri *uri,
+                                     int xml_version);
+

Make an appropriate XML Qname from the namespaces on a namespace stack

+

Makes a qname from the in-scope namespaces in a stack if the URI matches +the prefix and the rest is a legal XML name.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

nstack

namespace stack

 

uri

URI to use to make qname

 

xml_version

XML Version

 
+
+
+

Returns

+

raptor_qname for the URI or NULL on failure

+
+
+
+
+

raptor_qname_copy ()

+
raptor_qname *
+raptor_qname_copy (raptor_qname *qname);
+

Copy constructor - copy an existing XML qname.

+
+

Parameters

+
+++++ + + + + + +

qname

existing qname

 
+
+
+

Returns

+

a new raptor_qname object or NULL on failure

+
+
+
+
+

raptor_free_qname ()

+
void
+raptor_free_qname (raptor_qname *name);
+

Destructor - destroy a raptor_qname object.

+
+

Parameters

+
+++++ + + + + + +

name

raptor_qname object

 
+
+
+
+
+

raptor_qname_equal ()

+
int
+raptor_qname_equal (raptor_qname *name1,
+                    raptor_qname *name2);
+

Compare two XML Qnames for equality.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

name1

first raptor_qname

 

name2

second raptor_name

 
+
+
+

Returns

+

non-0 if the qnames are equal.

+
+
+
+
+

raptor_qname_string_to_uri ()

+
raptor_uri *
+raptor_qname_string_to_uri (raptor_namespace_stack *nstack,
+                            const char *name,
+                            size_t name_len);
+

Get the URI for a qname.

+

Utility function to turn a string representing a QName in the +N3 style, into a new URI representing it. A NULL name or name ":" +returns the default namespace URI. A name "p:" returns +namespace name (URI) for the namespace with prefix "p".

+

Partially equivalent to + qname = raptor_new_qname(nstack, name, NULL); + uri = raptor_uri_copy(qname->uri); + raptor_free_qname(qname) +but without making the qname, and it also handles the NULL and +":" name cases as well as error checking.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

nstack

raptor_namespace_stack to decode the namespace

 

name

QName string or NULL

 

name_len

QName string length

 
+
+
+

Returns

+

new raptor_uri object or NULL on failure

+
+
+
+
+

raptor_qname_write ()

+
int
+raptor_qname_write (raptor_qname *qname,
+                    raptor_iostream *iostr);
+

Write a formatted qname to an iostream

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

qname

QName to write

 

iostr

raptor iosteram

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_qname_format_as_xml ()

+
unsigned char *
+raptor_qname_format_as_xml (const raptor_qname *qname,
+                            size_t *length_p);
+

Format a qname in an XML style into a newly allocated string.

+

Generates a string of the form a:b="value" or a="value" +depending on the qname's prefix. Double quotes are always used.

+

If length_p + is not NULL, the length of the string is +stored in the address it points to.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

qname

qname object

 

length_p

pointer to length (or NULL)

 
+
+
+

Returns

+

qname formatted as newly allocated string or NULL on failure

+
+
+
+
+

raptor_qname_get_counted_value ()

+
const unsigned char *
+raptor_qname_get_counted_value (raptor_qname *name,
+                                size_t *length_p);
+

Get the raptor_value of an XML QName.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

name

raptor_qname object

 

length_p

pointer to variable to store length of name (or NULL)

 
+
+
+

Returns

+

the value

+
+
+
+
+

raptor_qname_get_local_name ()

+
const unsigned char *
+raptor_qname_get_local_name (raptor_qname *name);
+

Get the raptor_local_name of an XML QName.

+
+

Parameters

+
+++++ + + + + + +

name

raptor_qname object

 
+
+
+

Returns

+

the local_name

+
+
+
+
+

raptor_qname_get_namespace ()

+
const raptor_namespace *
+raptor_qname_get_namespace (raptor_qname *name);
+

Get the raptor_namespace of an XML QName.

+
+

Parameters

+
+++++ + + + + + +

name

raptor_qname object

 
+
+
+

Returns

+

the namespace

+
+
+
+
+

raptor_qname_get_value ()

+
const unsigned char *
+raptor_qname_get_value (raptor_qname *name);
+

Get the raptor_value of an XML QName.

+
+

Parameters

+
+++++ + + + + + +

name

raptor_qname object

 
+
+
+

Returns

+

the value

+
+
+
+
+

raptor_qname_to_counted_name ()

+
unsigned char *
+raptor_qname_to_counted_name (raptor_qname *qname,
+                              size_t *length_p);
+

Get the string form of a QName name

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

qname

QName to write

 

length_p

pointer to variable to store length of name (or NULL)

 
+
+
+

Returns

+

new string name or NULL on failure

+
+
+
+
+

Types and Values

+
+

raptor_qname

+
raptor_qname* raptor_qname;
+
+

Raptor XML qname class

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2-section-xml.html b/docs/html/raptor2-section-xml.html new file mode 100644 index 0000000..2fcd01a --- /dev/null +++ b/docs/html/raptor2-section-xml.html @@ -0,0 +1,1565 @@ + + + + +section-xml: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+
+
+ + +
+

section-xml

+

section-xml

+
+
+

Functions

+
++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+raptor_xml_element * + +raptor_new_xml_element () +
+raptor_xml_element * + +raptor_new_xml_element_from_namespace_local_name () +
+void + +raptor_free_xml_element () +
+raptor_qname * + +raptor_xml_element_get_name () +
+raptor_qname ** + +raptor_xml_element_get_attributes () +
+int + +raptor_xml_element_get_attributes_count () +
+void + +raptor_xml_element_set_attributes () +
+int + +raptor_xml_element_declare_namespace () +
+int + +raptor_xml_element_is_empty () +
const unsigned char * + +raptor_xml_element_get_language () +
+int + +raptor_xml_element_write () +
+raptor_xml_writer * + +raptor_new_xml_writer () +
+void + +raptor_free_xml_writer () +
+void + +raptor_xml_writer_empty_element () +
+void + +raptor_xml_writer_start_element () +
+void + +raptor_xml_writer_end_element () +
+void + +raptor_xml_writer_cdata () +
+void + +raptor_xml_writer_cdata_counted () +
+void + +raptor_xml_writer_raw () +
+void + +raptor_xml_writer_raw_counted () +
+void + +raptor_xml_writer_comment () +
+void + +raptor_xml_writer_comment_counted () +
+void + +raptor_xml_writer_flush () +
+void + +raptor_xml_writer_newline () +
+int + +raptor_xml_writer_get_depth () +
+int + +raptor_xml_writer_set_option () +
+int + +raptor_xml_writer_get_option () +
+int + +raptor_xml_escape_string_any () +
+int + +raptor_xml_escape_string_any_write () +
+int + +raptor_xml_escape_string () +
+int + +raptor_xml_escape_string_write () +
+int + +raptor_xml_name_check () +
+
+
+

Types and Values

+
++++ + + + + + + + + + + +
typedefraptor_xml_element
typedefraptor_xml_writer
+
+
+

Description

+
+
+

Functions

+
+

raptor_new_xml_element ()

+
raptor_xml_element *
+raptor_new_xml_element (raptor_qname *name,
+                        const unsigned char *xml_language,
+                        raptor_uri *xml_base);
+

Constructor - create a new XML element from a QName

+

The xml_language + and xml_base + become owned by the new object.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

name

The XML element name

 

xml_language

the in-scope XML language (or NULL)

 

xml_base

the in-scope XML base URI (or NULL)

 
+
+
+

Returns

+

a new raptor_xml_element or NULL on failure

+
+
+
+
+

raptor_new_xml_element_from_namespace_local_name ()

+
raptor_xml_element *
+raptor_new_xml_element_from_namespace_local_name
+                               (raptor_namespace *ns,
+                                const char *name,
+                                const unsigned char *xml_language,
+                                raptor_uri *xml_base);
+

Constructor - create a new XML element from an XML namespace and a local name

+

Added in 1.4.16.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

ns

namespace

 

name

the XML element local name

 

xml_language

the in-scope XML language (or NULL)

 

xml_base

base uri (or NULL)

 
+
+
+

Returns

+

a new raptor_xml_element or NULL on failure

+
+
+
+
+

raptor_free_xml_element ()

+
void
+raptor_free_xml_element (raptor_xml_element *element);
+

Destructor - destroy a raptor_xml_element object.

+
+

Parameters

+
+++++ + + + + + +

element

XML Element

 
+
+
+
+
+

raptor_xml_element_get_name ()

+
raptor_qname *
+raptor_xml_element_get_name (raptor_xml_element *xml_element);
+

Get the XML Name of an XML element

+
+

Parameters

+
+++++ + + + + + +

xml_element

XML Element

 
+
+
+

Returns

+

The Name.

+
+
+
+
+

raptor_xml_element_get_attributes ()

+
raptor_qname **
+raptor_xml_element_get_attributes (raptor_xml_element *xml_element);
+

Get the array of attributes on the XML element.

+

Use raptor_xml_element_get_attributes_count() to get the count +of the array size.

+
+

Parameters

+
+++++ + + + + + +

xml_element

XML Element

 
+
+
+

Returns

+

the array of qnames or NULL if none are present.

+
+
+
+
+

raptor_xml_element_get_attributes_count ()

+
int
+raptor_xml_element_get_attributes_count
+                               (raptor_xml_element *xml_element);
+

Get the number of attributes on the XML element.

+
+

Parameters

+
+++++ + + + + + +

xml_element

XML Element

 
+
+
+

Returns

+

Integer number of attributes - 0 or more.

+
+
+
+
+

raptor_xml_element_set_attributes ()

+
void
+raptor_xml_element_set_attributes (raptor_xml_element *xml_element,
+                                   raptor_qname **attributes,
+                                   int count);
+

Set the attributes on an XML element.

+

The attributes + array becomes owned by the element after this function.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

xml_element

XML Element

 

attributes

Array of XML Qname attributes with values

 

count

Length of array

 
+
+
+
+
+

raptor_xml_element_declare_namespace ()

+
int
+raptor_xml_element_declare_namespace (raptor_xml_element *xml_element,
+                                      raptor_namespace *nspace);
+

Declare a namespace on the XML Element.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xml_element

XML Element

 

nspace

raptor_namespace to declare

 
+
+
+

Returns

+

non-0 if namespace cannot be declared

+
+
+
+
+

raptor_xml_element_is_empty ()

+
int
+raptor_xml_element_is_empty (raptor_xml_element *xml_element);
+

Check if an XML Element is empty.

+
+

Parameters

+
+++++ + + + + + +

xml_element

XML Element

 
+
+
+

Returns

+

non-0 if the element is empty.

+
+
+
+
+

raptor_xml_element_get_language ()

+
const unsigned char *
+raptor_xml_element_get_language (raptor_xml_element *xml_element);
+

Get the XML language of the element.

+
+

Parameters

+
+++++ + + + + + +

xml_element

XML Element

 
+
+
+

Returns

+

XML language or NULL if none in scope

+
+
+
+
+

raptor_xml_element_write ()

+
int
+raptor_xml_element_write (raptor_xml_element *element,
+                          raptor_namespace_stack *nstack,
+                          int is_empty,
+                          int is_end,
+                          int depth,
+                          raptor_iostream *iostr);
+

Write a formatted XML element to a raptor_iostream

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

element

XML element to format

 

nstack

Namespace stack context to use in formatting

 

is_empty

non-0 if element is empty

 

is_end

non-0 if this is an end element (else is a start element)

 

depth

XML element depth

 

iostr

iostream object

 
+
+
+

Returns

+

non-0 on failure

+
+
+
+
+

raptor_new_xml_writer ()

+
raptor_xml_writer *
+raptor_new_xml_writer (raptor_world *world,
+                       raptor_namespace_stack *nstack,
+                       raptor_iostream *iostr);
+

Constructor - Create a new XML Writer writing XML to a raptor_iostream

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

world

raptor_world object

 

nstack

Namespace stack for the writer to start with (or NULL)

 

iostr

I/O stream to write to

 
+
+
+

Returns

+

a new raptor_xml_writer object or NULL on failure

+
+
+
+
+

raptor_free_xml_writer ()

+
void
+raptor_free_xml_writer (raptor_xml_writer *xml_writer);
+

Destructor - Free XML Writer

+
+

Parameters

+
+++++ + + + + + +

xml_writer

XML writer object

 
+
+
+
+
+

raptor_xml_writer_empty_element ()

+
void
+raptor_xml_writer_empty_element (raptor_xml_writer *xml_writer,
+                                 raptor_xml_element *element);
+

Write an empty XML element to the XML writer.

+

Closes any previous empty element if XML writer option AUTO_EMPTY +is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xml_writer

XML writer object

 

element

XML element object

 
+
+
+
+
+

raptor_xml_writer_start_element ()

+
void
+raptor_xml_writer_start_element (raptor_xml_writer *xml_writer,
+                                 raptor_xml_element *element);
+

Write a start XML element to the XML writer.

+

Closes any previous empty element if XML writer option AUTO_EMPTY +is enabled.

+

Indents the start element if XML writer option AUTO_INDENT is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xml_writer

XML writer object

 

element

XML element object

 
+
+
+
+
+

raptor_xml_writer_end_element ()

+
void
+raptor_xml_writer_end_element (raptor_xml_writer *xml_writer,
+                               raptor_xml_element *element);
+

Write an end XML element to the XML writer.

+

Indents the end element if XML writer option AUTO_INDENT is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xml_writer

XML writer object

 

element

XML element object

 
+
+
+
+
+

raptor_xml_writer_cdata ()

+
void
+raptor_xml_writer_cdata (raptor_xml_writer *xml_writer,
+                         const char *s);
+

Write CDATA XML-escaped to the XML writer.

+

Closes any previous empty element if XML writer option AUTO_EMPTY +is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xml_writer

XML writer object

 

s

string to XML escape and write

 
+
+
+
+
+

raptor_xml_writer_cdata_counted ()

+
void
+raptor_xml_writer_cdata_counted (raptor_xml_writer *xml_writer,
+                                 const char *s,
+                                 unsigned int len);
+

Write counted CDATA XML-escaped to the XML writer.

+

Closes any previous empty element if XML writer option AUTO_EMPTY +is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

xml_writer

XML writer object

 

s

string to XML escape and write

 

len

length of string

 
+
+
+
+
+

raptor_xml_writer_raw ()

+
void
+raptor_xml_writer_raw (raptor_xml_writer *xml_writer,
+                       const char *s);
+

Write a string raw to the XML writer.

+

Closes any previous empty element if XML writer option AUTO_EMPTY +is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xml_writer

XML writer object

 

s

string to write

 
+
+
+
+
+

raptor_xml_writer_raw_counted ()

+
void
+raptor_xml_writer_raw_counted (raptor_xml_writer *xml_writer,
+                               const char *s,
+                               unsigned int len);
+

Write a counted string raw to the XML writer.

+

Closes any previous empty element if XML writer option AUTO_EMPTY +is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

xml_writer

XML writer object

 

s

string to write

 

len

length of string

 
+
+
+
+
+

raptor_xml_writer_comment ()

+
void
+raptor_xml_writer_comment (raptor_xml_writer *xml_writer,
+                           const char *s);
+

Write an XML comment to the XML writer.

+

Closes any previous empty element if XML writer option AUTO_EMPTY +is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + +

xml_writer

XML writer object

 

s

comment string to write

 
+
+
+
+
+

raptor_xml_writer_comment_counted ()

+
void
+raptor_xml_writer_comment_counted (raptor_xml_writer *xml_writer,
+                                   const char *s,
+                                   unsigned int len);
+

Write a counted XML comment to the XML writer.

+

Closes any previous empty element if XML writer option AUTO_EMPTY +is enabled.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

xml_writer

XML writer object

 

s

comment string to write

 

len

length of string

 
+
+
+
+
+

raptor_xml_writer_flush ()

+
void
+raptor_xml_writer_flush (raptor_xml_writer *xml_writer);
+

Finish the XML writer.

+
+

Parameters

+
+++++ + + + + + +

xml_writer

XML writer object

 
+
+
+
+
+

raptor_xml_writer_newline ()

+
void
+raptor_xml_writer_newline (raptor_xml_writer *xml_writer);
+

Write a newline to the XML writer.

+

Indents the next line if XML writer option AUTO_INDENT is enabled.

+
+

Parameters

+
+++++ + + + + + +

xml_writer

XML writer object

 
+
+
+
+
+

raptor_xml_writer_get_depth ()

+
int
+raptor_xml_writer_get_depth (raptor_xml_writer *xml_writer);
+

Get the current XML Writer element depth

+
+

Parameters

+
+++++ + + + + + +

xml_writer

raptor_xml_writer xml writer object

 
+
+
+

Returns

+

element stack depth

+
+
+
+
+

raptor_xml_writer_set_option ()

+
int
+raptor_xml_writer_set_option (raptor_xml_writer *xml_writer,
+                              raptor_option option,
+                              char *string,
+                              int integer);
+

Set xml_writer option.

+

If string + is not NULL and the option type is numeric, the string +value is converted to an integer and used in preference to integer +.

+

If string + is NULL and the option type is not numeric, an error is +returned.

+

The string + values used are copied.

+

The allowed options are available via +raptor_world_get_option_description().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

xml_writer

raptor_xml_writer xml_writer object

 

option

option to set from enumerated raptor_option values

 

string

string option value (or NULL)

 

integer

integer option value

 
+
+
+

Returns

+

non 0 on failure or if the option is unknown

+
+
+
+
+

raptor_xml_writer_get_option ()

+
int
+raptor_xml_writer_get_option (raptor_xml_writer *xml_writer,
+                              raptor_option option,
+                              char **string_p,
+                              int *integer_p);
+

Get xml_writer option.

+

Any string value returned in *string_p + is shared and must +be copied by the caller.

+

The allowed options are available via +raptor_world_get_option_description().

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

xml_writer

raptor_xml_writer xml_writer object

 

option

option to get value

 

string_p

pointer to where to store string value

 

integer_p

pointer to where to store integer value

 
+
+
+

Returns

+

option value or < 0 for an illegal option

+
+
+
+
+

raptor_xml_escape_string_any ()

+
int
+raptor_xml_escape_string_any (raptor_world *world,
+                              const char *string,
+                              size_t len,
+                              unsigned char *buffer,
+                              size_t length,
+                              char quote,
+                              int xml_version);
+

Return an XML-escaped version a string.

+

Follows

+Canonical XML rules on Text Nodes and Attribute Nodes

Both: + Replaces & and < + with &amp; and &lt; +respectively, preserving other characters.

+

Text Nodes: + > is turned into &gt; + #xD is turned into &#xD;

+

Attribute Nodes: + > is generated not &gt. + #x9, #xA and #xD are turned into + &#x9;, + &#xA; and + &#xD; + entities.

+

If quote + is given it can be either of '\'' or '\"' +which will be turned into &apos; or +&quot; respectively. +ASCII NUL ('\0') or any other character will not be escaped.

+

If buffer + is NULL, no work is done but the size of buffer +required is returned. The output in buffer remains in UTF-8.

+

If the input string + is empty, a single NUL will be written to the +buffer.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

world

raptor world

 

string

string to XML escape (UTF-8)

 

len

length of string

 

buffer

the buffer to use for new string (UTF-8) or NULL to just calculate expected length

 

length

buffer size

 

quote

optional quote character to escape for attribute content, or 0

 

xml_version

XML 1.0 (10) or XML 1.1 (11)

 
+
+
+

Returns

+

the number of bytes required / used or <0 on failure.

+
+
+
+
+

raptor_xml_escape_string_any_write ()

+
int
+raptor_xml_escape_string_any_write (const char *string,
+                                    size_t len,
+                                    char quote,
+                                    int xml_version,
+                                    raptor_iostream *iostr);
+

Write an XML-escaped version of a string to an iostream.

+

See raptor_xml_escape_string() for the escapes performed and +the conditions on quote + and string +. XML 1.1 allows additional +characters in XML such as U+0001 to U+001F inclusive.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

string

string to XML escape (UTF-8)

 

len

length of string

 

quote

optional quote character to escape for attribute content, or 0

 

xml_version

XML version - 10 (XML 1.0) or 11 (XML 1.1)

 

iostr

the raptor_iostream to write to

 
+
+
+

Returns

+

non 0 on failure

+
+
+
+
+

raptor_xml_escape_string ()

+
int
+raptor_xml_escape_string (raptor_world *world,
+                          const char *string,
+                          size_t len,
+                          unsigned char *buffer,
+                          size_t length,
+                          char quote);
+

Return an XML 1.0-escaped version a string.

+

See raptor_xml_escape_string_any() for the conditions on parameters.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

world

raptor world

 

string

string to XML 1.0 escape (UTF-8)

 

len

length of string

 

buffer

the buffer to use for new string (UTF-8) or NULL to just calculate expected length.

 

length

buffer size

 

quote

optional quote character to escape for attribute content, or 0

 
+
+
+

Returns

+

the number of bytes required / used or <0 on failure.

+
+
+
+
+

raptor_xml_escape_string_write ()

+
int
+raptor_xml_escape_string_write (const char *string,
+                                size_t len,
+                                char quote,
+                                raptor_iostream *iostr);
+

Write an XML 1.0-escaped version of a string to an iostream.

+

See raptor_xml_escape_string_any_write() for the escapes +performed and the conditions on quote + and string +.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + + + + + + +

string

string to XML 1.0 escape (UTF-8)

 

len

length of string

 

quote

optional quote character to escape for attribute content, or 0

 

iostr

the raptor_iostream to write to

 
+
+
+

Returns

+

non 0 on failure

+
+
+
+
+

raptor_xml_name_check ()

+
int
+raptor_xml_name_check (const char *string,
+                       size_t length,
+                       int xml_version);
+

Check a string is a legal XML name (and legal UTF8).

+

xml_version is either 10 (for XML 1.0) or 11 for (XML 1.1). Any +other version fails.

+
+

Parameters

+
+++++ + + + + + + + + + + + + + + + + + +

string

UTF-8 name string

 

length

length of string

 

xml_version

XML version

 
+
+
+

Returns

+

Non 0 if the string is a legal XML name

+
+
+
+
+

Types and Values

+
+

raptor_xml_element

+
raptor_xml_element* raptor_xml_element;
+
+

Raptor XML Element class

+
+
+
+

raptor_xml_writer

+
raptor_xml_writer* raptor_xml_writer;
+
+

Raptor XML Writer class

+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/raptor2.devhelp2 b/docs/html/raptor2.devhelp2 new file mode 100644 index 0000000..69e2967 --- /dev/null +++ b/docs/html/raptor2.devhelp2 @@ -0,0 +1,731 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/html/reference-manual.html b/docs/html/reference-manual.html new file mode 100644 index 0000000..3298f5c --- /dev/null +++ b/docs/html/reference-manual.html @@ -0,0 +1,180 @@ + + + + +Part II. Raptor Reference Manual: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Part II. Raptor Reference Manual

+
+
+

This part contains the Raptor Reference Manual + which comprehensively describes every class and function of the API. +

+

The previous part contains the + Raptor Tutorial + explaining how to use the API parts. +

+

For the latest information, see the + Raptor Home Page + and the main document overview + in this document tree. +

+
+

Table of Contents

+
+
Parsers in Raptor (syntax to triples)
+
+
Introduction
+
GRDDL parser (name grddl)
+
Guess parser (name guess)
+
JSON parser (name json)
+
N-Triples parser (name ntriples)
+
RDFa parser - (name rdfa)
+
RDF/XML parser - default (name rdfxml)
+
RSS Tag Soup parser (name rss-tag-soup)
+
TRiG parser (name trig)
+
Turtle Terse RDF Triple Language parser (name turtle)
+
+
Serializers in Raptor (triples to syntax)
+
+
Introduction
+
Atom 1.0 serializer (name atom)
+
JSON serializers (name json and name json-triples)
+
mKR serializer - default (name mkr)
+
N-Quads serializer - default (name nquads)
+
N-Triples serializer - default (name ntriples)
+
RDF/XML serializer (name rdfxml)
+
RDF/XML (Abbreviated) serializer (name rdfxml-abbrev)
+
RDF/XML (XMP Profile) serializer (name rdfxml-xmp)
+
Turtle serializer (name turtle)
+
RSS 1.0 serializer (name rss-1.0)
+
GraphViz dot serializer (name dot)
+
+
+section-world +
+
+section-general +
+
+section-memory +
+
+section-avltree +
+
+section-constants +
+
+section-option +
+
+section-iostream +
+
+section-locator +
+
+section-parser +
+
+section-sax2 +
+
+section-sequence +
+
+section-serializer +
+
+section-stringbuffer +
+
+section-triples +
+
+section-unicode +
+
+section-uri +
+
+section-www +
+
+section-xml-namespace +
+
+section-xml-qname +
+
+section-xml +
+
Syntax Formats supported in Raptor
+
+
Introduction
+
MIME Types by Parser
+
MIME Types by Serializer
+
MIME Types Index
+
+
API Changes
+
+
Introduction
+
Changes between raptor2 1.4.21 and 2.0.0
+
+
New functions, types, enums and constants
+
Deleted functions, types, enums and constants
+
Renamed functions, enums and constants
+
Changed functions and types
+
+
Changes between raptor2 2.0.3 and 2.0.4
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.4 and 2.0.5
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.5 and 2.0.6
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.6 and 2.0.7
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.7 and 2.0.8
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.9 and 2.0.10
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.10 and 2.0.11
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.11 and 2.0.12
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.13 and 2.0.14
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.14 and 2.0.15
+
New functions, types, enums and constants
+
Changes between raptor2 2.0.15 and 2.0.16
+
+
New functions, types, enums and constants
+
Deleted functions, types, enums and constants
+
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/restrict-parser-network-access.html b/docs/html/restrict-parser-network-access.html new file mode 100644 index 0000000..295d994 --- /dev/null +++ b/docs/html/restrict-parser-network-access.html @@ -0,0 +1,152 @@ + + + + +Restrict parser network access: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Restrict parser network access

+

+Parsing can cause network requests to be performed, especially +if a URI is given as an argument such as with +raptor_parser_parse_uri() +however there may also be indirect requests such as with the +GRDDL parser that retrieves URIs depending on the results of +initial parse requests. The URIs requested may not be wanted +to be fetched or need to be filtered, and this can be done in +three ways. +

+
+

+Filtering parser network requests with option RAPTOR_OPTION_NO_NET +

+

+The parser option +RAPTOR_OPTION_NO_NET +can be set with +raptor_parser_set_option() +and forbids all network requests. There is no customisation with +this approach, for that see the URI filter in the next section. +

+
+  rdf_parser = raptor_new_parser(world, "rdfxml");
+
+  /* Disable internal network requests */
+  raptor_parser_set_option(rdf_parser, RAPTOR_OPTION_NO_NET, NULL, 1);
+
+
+
+

+Filtering parser network requests with raptor_www_set_uri_filter() +

+

+The +raptor_www_set_uri_filter() + +allows setting of a filtering function to operate on all URIs +retrieved by a WWW connection. This connection can be used in +parsing when operated by hand. +

+
+void write_bytes_handler(raptor_www* www, void *user_data, 
+                         const void *ptr, size_t size, size_t nmemb) {
+{
+  raptor_parser* rdf_parser = (raptor_parser*)user_data;
+
+  raptor_parser_parse_chunk(rdf_parser, (unsigned char*)ptr, size*nmemb, 0);
+}
+
+int uri_filter(void* filter_user_data, raptor_uri* uri) {
+  /* return non-0 to forbid the request */
+}
+
+int main(int argc, char *argv[]) { 
+  ...
+
+  rdf_parser = raptor_new_parser(world, "rdfxml");
+  www = raptor_new_www(world);
+
+  /* filter all URI requests */
+  raptor_www_set_uri_filter(www, uri_filter, filter_user_data);
+
+  /* make WWW write bytes to parser */
+  raptor_www_set_write_bytes_handler(www, write_bytes_handler, rdf_parser);
+
+  raptor_parser_parse_start(rdf_parser, uri);
+  raptor_www_fetch(www, uri);
+  /* tell the parser that we are done */
+  raptor_parser_parse_chunk(rdf_parser, NULL, 0, 1);
+
+  raptor_free_www(www);
+  raptor_free_parser(rdf_parser);
+
+  ...
+}
+
+
+
+
+

+Filtering parser network requests with raptor_parser_set_uri_filter() +

+

+The +raptor_parser_set_uri_filter() +allows setting of a filtering function to operate on all URIs that +the parser sees. This operates on the internal raptor_www object +used inside parsing to retrieve URIs, similar to that described in +the previous section. +

+
+  int uri_filter(void* filter_user_data, raptor_uri* uri) {
+    /* return non-0 to forbid the request */
+  }
+
+  rdf_parser = raptor_new_parser(world, "rdfxml");
+
+  raptor_parser_set_uri_filter(rdf_parser, uri_filter, filter_user_data);
+
+  /* parse content as normal */
+  raptor_parser_parse_uri(rdf_parser, uri, base_uri);
+
+
+
+

+Setting timeout for parser network requests with option RAPTOR_OPTION_WWW_TIMEOUT +

+

If the value of option +RAPTOR_OPTION_WWW_TIMEOUT +if set to a number >0, it is used as the timeout in seconds +for retrieving of URIs during parsing (primarily for GRDDL). +This uses +raptor_www_set_connection_timeout() +internally. +

+
+  rdf_parser = raptor_new_parser(world, "grddl");
+
+  /* set internal URI retrieval maximum time to 5 seconds */
+  raptor_parser_set_option(rdf_parser, RAPTOR_OPTION_WWW_TIMEOUT, NULL, 5);
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/right-insensitive.png b/docs/html/right-insensitive.png new file mode 100644 index 0000000..763208d Binary files /dev/null and b/docs/html/right-insensitive.png differ diff --git a/docs/html/right.png b/docs/html/right.png new file mode 100644 index 0000000..eb90dd4 Binary files /dev/null and b/docs/html/right.png differ diff --git a/docs/html/serializer-atom.html b/docs/html/serializer-atom.html new file mode 100644 index 0000000..39bb256 --- /dev/null +++ b/docs/html/serializer-atom.html @@ -0,0 +1,46 @@ + + + + +Atom 1.0 serializer (name atom): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Atom 1.0 serializer (name atom)

+

A serializer to the Atom 1.0 syndication format defined in IETF +RFC 4287. +This serializes an RDF graph written in the RSS 1.0 data model +to Atom 1.0 plus optionally writes extra RDF triples. +

+

+The extra RDF triples are written into an at:md metadata block, along +with at:feedmap and at:entrymap elements to describe the RSS 1.0 +predicate to Atom 1.0 elements mappings for the feed and entry blocks +respecively. The extra triples are enabled when serializer option +'rssTriples' is set to string value 'atom-triples'. +

+

+If no atom triples content type field (at:contentType predicate) is +given, the type is set to 'text/html' when writing out an +atom:content field in Atom 1.0 format. +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-dot.html b/docs/html/serializer-dot.html new file mode 100644 index 0000000..6b8f9e6 --- /dev/null +++ b/docs/html/serializer-dot.html @@ -0,0 +1,45 @@ + + + + +GraphViz dot serializer (name dot): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+GraphViz dot serializer (name dot)

+

A serializer to the +GraphViz DOT format. +

+

This serializer has a set of associated serializer options +that may be set to customise the output colors using +raptor_serializer_set_option() +with the appropriate option name and value as given below. +

+
+RAPTOR_OPTION_RESOURCE_BORDER 	Border color of resource nodes
+RAPTOR_OPTION_LITERAL_BORDER 	Border color of literal nodes
+RAPTOR_OPTION_BNODE_BORDER 	Border color of blank nodes
+RAPTOR_OPTION_RESOURCE_FILL 	Fill color of resource nodes
+RAPTOR_OPTION_LITERAL_FILL 	Fill color of literal nodes
+RAPTOR_OPTION_BNODE_FILL 	Fill color of blank nodes
+
+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-json.html b/docs/html/serializer-json.html new file mode 100644 index 0000000..e4205cd --- /dev/null +++ b/docs/html/serializer-json.html @@ -0,0 +1,37 @@ + + + + +JSON serializers (name json and name json-triples): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+JSON serializers (name json and name json-triples)

+

Two serializers that write JSON in either a resource-centric +format with name json and in a triple-dump format +with name json-triples. The resource-centric +format is based on the Talis +RDF/JSON +design and the triple-dump format based on the SPARQL query results in JSON +design. +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-mkr.html b/docs/html/serializer-mkr.html new file mode 100644 index 0000000..2d81e77 --- /dev/null +++ b/docs/html/serializer-mkr.html @@ -0,0 +1,32 @@ + + + + +mKR serializer - default (name mkr): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+mKR serializer - default (name mkr)

+

A serializer for the +mKR (my Knowledge Representation) Language +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-nquads.html b/docs/html/serializer-nquads.html new file mode 100644 index 0000000..48e14d0 --- /dev/null +++ b/docs/html/serializer-nquads.html @@ -0,0 +1,36 @@ + + + + +N-Quads serializer - default (name nquads): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+N-Quads serializer - default (name nquads)

+

A serializer to the +N-Quads +extension to N-Triples, providing an optional 4th context graph term +at the end of the line when a named graph is associated with a triple +(the triple is contained in a named graph). This is useful for seeing the +output of named graphs or dealing with SPARQL Datasets. +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-ntriples.html b/docs/html/serializer-ntriples.html new file mode 100644 index 0000000..1745970 --- /dev/null +++ b/docs/html/serializer-ntriples.html @@ -0,0 +1,35 @@ + + + + +N-Triples serializer - default (name ntriples): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+N-Triples serializer - default (name ntriples)

+

A serializer to the +N-Triples +syntax as used by the +W3C RDF Core working group +for the RDF Test Cases. +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-rdfxml-abbrev.html b/docs/html/serializer-rdfxml-abbrev.html new file mode 100644 index 0000000..38f1885 --- /dev/null +++ b/docs/html/serializer-rdfxml-abbrev.html @@ -0,0 +1,33 @@ + + + + +RDF/XML (Abbreviated) serializer (name rdfxml-abbrev): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+RDF/XML (Abbreviated) serializer (name rdfxml-abbrev)

+

An RDF/XML serializer using several of the RDF/XML +abbreviations to provide a more compact readable format, at the cost +of some pre-processing. This is suitable for small documents. +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-rdfxml-xmp.html b/docs/html/serializer-rdfxml-xmp.html new file mode 100644 index 0000000..53b8d8e --- /dev/null +++ b/docs/html/serializer-rdfxml-xmp.html @@ -0,0 +1,34 @@ + + + + +RDF/XML (XMP Profile) serializer (name rdfxml-xmp): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+RDF/XML (XMP Profile) serializer (name rdfxml-xmp)

+

A serializer to the Adobe XMP profile of RDF/XML suitable for +embedding inside an external document. Embedding means that the +XML header is omitted, wheras for other XML serializings, it is +always emitted. +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-rdfxml.html b/docs/html/serializer-rdfxml.html new file mode 100644 index 0000000..def1963 --- /dev/null +++ b/docs/html/serializer-rdfxml.html @@ -0,0 +1,36 @@ + + + + +RDF/XML serializer (name rdfxml): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+RDF/XML serializer (name rdfxml)

+

A serializer to the standard +RDF/XML syntax +as revised by the +W3C RDF Core working group. +This writes a plain triple-based RDF/XML serialization with no +optimisation or pretty-printing. +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-rss-1-0.html b/docs/html/serializer-rss-1-0.html new file mode 100644 index 0000000..8ccccba --- /dev/null +++ b/docs/html/serializer-rss-1-0.html @@ -0,0 +1,38 @@ + + + + +RSS 1.0 serializer (name rss-1.0): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+RSS 1.0 serializer (name rss-1.0)

+

A serializer to the +RDF Site Summary (RSS) 1.0 +format for describing a syndication feed of items. +

+

By default this only serializes the RDF triples that describe +the RSS channel and items found. If serialiser option 'rssTriples' +is set to value 'rdf-xml' then any additional triples found will +be included in the channel or item output. +

+
+ + + \ No newline at end of file diff --git a/docs/html/serializer-turtle.html b/docs/html/serializer-turtle.html new file mode 100644 index 0000000..c8fc1f5 --- /dev/null +++ b/docs/html/serializer-turtle.html @@ -0,0 +1,34 @@ + + + + +Turtle serializer (name turtle): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Turtle serializer (name turtle)

+

A serializer for the +Turtle Terse RDF Triple Language +syntax, designed as a useful subset of +Notation 3. +

+
+ + + \ No newline at end of file diff --git a/docs/html/style.css b/docs/html/style.css new file mode 100644 index 0000000..2eeda1f --- /dev/null +++ b/docs/html/style.css @@ -0,0 +1,530 @@ +body +{ + font-family: cantarell, sans-serif; +} +.synopsis, .classsynopsis +{ + /* tango:aluminium 1/2 */ + background: #eeeeec; + background: rgba(238, 238, 236, 0.5); + border: solid 1px rgb(238, 238, 236); + padding: 0.5em; +} +.programlisting +{ + /* tango:sky blue 0/1 */ + /* fallback for no rgba support */ + background: #e6f3ff; + border: solid 1px #729fcf; + background: rgba(114, 159, 207, 0.1); + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0.5em; +} +.variablelist +{ + padding: 4px; + margin-left: 3em; +} +.variablelist td:first-child +{ + vertical-align: top; +} + +span.nowrap { + white-space: nowrap; +} + +div.gallery-float +{ + float: left; + padding: 10px; +} +div.gallery-float img +{ + border-style: none; +} +div.gallery-spacer +{ + clear: both; +} + +a, a:visited +{ + text-decoration: none; + /* tango:sky blue 2 */ + color: #3465a4; +} +a:hover +{ + text-decoration: underline; + /* tango:sky blue 1 */ + color: #729fcf; +} + +.function_type, +.variable_type, +.property_type, +.signal_type, +.parameter_name, +.struct_member_name, +.union_member_name, +.define_keyword, +.datatype_keyword, +.typedef_keyword +{ + text-align: right; +} + +/* dim non-primary columns */ +.c_punctuation, +.function_type, +.variable_type, +.property_type, +.signal_type, +.define_keyword, +.datatype_keyword, +.typedef_keyword, +.property_flags, +.signal_flags, +.parameter_annotations, +.enum_member_annotations, +.struct_member_annotations, +.union_member_annotations +{ + color: #888a85; +} + +.function_type a, +.function_type a:visited, +.function_type a:hover, +.property_type a, +.property_type a:visited, +.property_type a:hover, +.signal_type a, +.signal_type a:visited, +.signal_type a:hover, +.signal_flags a, +.signal_flags a:visited, +.signal_flags a:hover +{ + color: #729fcf; +} + +td p +{ + margin: 0.25em; +} + +div.informaltable table[border="1"], +div.table table +{ + border-collapse: collapse; + border-spacing: 0px; + /* tango:aluminium 3 */ + border: solid 1px #babdb6; +} + +div.informaltable table[border="1"] td, +div.informaltable table th, +div.table table td, div.table table th +{ + /* tango:aluminium 3 */ + border: solid 1px #babdb6; + padding: 3px; + vertical-align: top; +} + +div.informaltable table[border="1"] th, +div.table table th +{ + /* tango:aluminium 2 */ + background-color: #d3d7cf; +} + +h4 +{ + color: #555753; + margin-top: 1em; + margin-bottom: 1em; +} + +hr +{ + /* tango:aluminium 1 */ + color: #d3d7cf; + background: #d3d7cf; + border: none 0px; + height: 1px; + clear: both; + margin: 2.0em 0em 2.0em 0em; +} + +dl.toc dt +{ + padding-bottom: 0.25em; +} + +dl.toc > dt +{ + padding-top: 0.25em; + padding-bottom: 0.25em; + font-weight: bold; +} + +dl.toc > dl +{ + padding-bottom: 0.5em; +} + +.parameter +{ + font-style: normal; +} + +.footer +{ + padding-top: 3.5em; + /* tango:aluminium 3 */ + color: #babdb6; + text-align: center; + font-size: 80%; +} + +.informalfigure, +.figure +{ + margin: 1em; +} + +.informalexample, +.example +{ + margin-top: 1em; + margin-bottom: 1em; +} + +.warning +{ + /* tango:orange 0/1 */ + background: #ffeed9; + background: rgba(252, 175, 62, 0.1); + border-color: #ffb04f; + border-color: rgba(252, 175, 62, 0.2); +} +.note +{ + /* tango:chameleon 0/0.5 */ + background: #d8ffb2; + background: rgba(138, 226, 52, 0.1); + border-color: #abf562; + border-color: rgba(138, 226, 52, 0.2); +} +div.blockquote +{ + border-color: #eeeeec; +} +.note, .warning, div.blockquote +{ + padding: 0.5em; + border-width: 1px; + border-style: solid; + margin: 2em; +} +.note p, .warning p +{ + margin: 0; +} + +div.warning h3.title, +div.note h3.title +{ + display: none; +} + +p + div.section +{ + margin-top: 1em; +} + +div.refnamediv, +div.refsynopsisdiv, +div.refsect1, +div.refsect2, +div.toc, +div.section +{ + margin-bottom: 1em; +} + +/* blob links */ +h2 .extralinks, h3 .extralinks +{ + float: right; + /* tango:aluminium 3 */ + color: #babdb6; + font-size: 80%; + font-weight: normal; +} + +.lineart +{ + color: #d3d7cf; + font-weight: normal; +} + +.annotation +{ + /* tango:aluminium 5 */ + color: #555753; + font-weight: normal; +} + +.structfield +{ + font-style: normal; + font-weight: normal; +} + +acronym,abbr +{ + border-bottom: 1px dotted gray; +} + +.listing_frame { + /* tango:sky blue 1 */ + border: solid 1px #729fcf; + border: solid 1px rgba(114, 159, 207, 0.2); + padding: 0px; +} + +.listing_lines, .listing_code { + margin-top: 0px; + margin-bottom: 0px; + padding: 0.5em; +} +.listing_lines { + /* tango:sky blue 0.5 */ + background: #a6c5e3; + background: rgba(114, 159, 207, 0.2); + /* tango:aluminium 6 */ + color: #2e3436; +} +.listing_code { + /* tango:sky blue 0 */ + background: #e6f3ff; + background: rgba(114, 159, 207, 0.1); +} +.listing_code .programlisting { + /* override from previous */ + border: none 0px; + padding: 0px; + background: none; +} +.listing_lines pre, .listing_code pre { + margin: 0px; +} + +@media screen { + /* these have a as a first child, but since there are no parent selectors + * we can't use that. */ + a.footnote + { + position: relative; + top: 0em ! important; + } + /* this is needed so that the local anchors are displayed below the naviagtion */ + div.footnote a[name], div.refnamediv a[name], div.refsect1 a[name], div.refsect2 a[name], div.index a[name], div.glossary a[name], div.sect1 a[name] + { + display: inline-block; + position: relative; + top:-5em; + } + /* this seems to be a bug in the xsl style sheets when generating indexes */ + div.index div.index + { + top: 0em; + } + /* make space for the fixed navigation bar and add space at the bottom so that + * link targets appear somewhat close to top + */ + body + { + padding-top: 2.5em; + padding-bottom: 500px; + max-width: 60em; + } + p + { + max-width: 60em; + } + /* style and size the navigation bar */ + table.navigation#top + { + position: fixed; + background: #e2e2e2; + border-bottom: solid 1px #babdb6; + border-spacing: 5px; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + z-index: 10; + } + table.navigation#top td + { + padding-left: 6px; + padding-right: 6px; + } + .navigation a, .navigation a:visited + { + /* tango:sky blue 3 */ + color: #204a87; + } + .navigation a:hover + { + /* tango:sky blue 2 */ + color: #3465a4; + } + td.shortcuts + { + /* tango:sky blue 2 */ + color: #3465a4; + font-size: 80%; + white-space: nowrap; + } + td.shortcuts .dim + { + color: #babdb6; + } + .navigation .title + { + font-size: 80%; + max-width: none; + margin: 0px; + font-weight: normal; + } +} +@media screen and (min-width: 60em) { + /* screen larger than 60em */ + body { margin: auto; } +} +@media screen and (max-width: 60em) { + /* screen less than 60em */ + #nav_hierarchy { display: none; } + #nav_interfaces { display: none; } + #nav_prerequisites { display: none; } + #nav_derived_interfaces { display: none; } + #nav_implementations { display: none; } + #nav_child_properties { display: none; } + #nav_style_properties { display: none; } + #nav_index { display: none; } + #nav_glossary { display: none; } + .gallery_image { display: none; } + .property_flags { display: none; } + .signal_flags { display: none; } + .parameter_annotations { display: none; } + .enum_member_annotations { display: none; } + .struct_member_annotations { display: none; } + .union_member_annotations { display: none; } + /* now that a column is hidden, optimize space */ + col.parameters_name { width: auto; } + col.parameters_description { width: auto; } + col.struct_members_name { width: auto; } + col.struct_members_description { width: auto; } + col.enum_members_name { width: auto; } + col.enum_members_description { width: auto; } + col.union_members_name { width: auto; } + col.union_members_description { width: auto; } + .listing_lines { display: none; } +} +@media print { + table.navigation { + visibility: collapse; + display: none; + } + div.titlepage table.navigation { + visibility: visible; + display: table; + background: #e2e2e2; + border: solid 1px #babdb6; + margin-top: 0; + margin-bottom: 0; + top: 0; + left: 0; + height: 3em; + } +} + +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.hll { background-color: #ffffcc } +.c { color: #3D7B7B; font-style: italic } /* Comment */ +.err { border: 1px solid #FF0000 } /* Error */ +.k { color: #008000; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */ +.cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */ +.cp { color: #9C6500 } /* Comment.Preproc */ +.cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */ +.c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */ +.cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #E40000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #008400 } /* Generic.Inserted */ +.go { color: #717171 } /* Generic.Output */ +.gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0044DD } /* Generic.Traceback */ +.kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #008000 } /* Keyword.Pseudo */ +.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #B00040 } /* Keyword.Type */ +.m { color: #666666 } /* Literal.Number */ +.s { color: #BA2121 } /* Literal.String */ +.na { color: #687822 } /* Name.Attribute */ +.nb { color: #008000 } /* Name.Builtin */ +.nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.no { color: #880000 } /* Name.Constant */ +.nd { color: #AA22FF } /* Name.Decorator */ +.ni { color: #717171; font-weight: bold } /* Name.Entity */ +.ne { color: #CB3F38; font-weight: bold } /* Name.Exception */ +.nf { color: #0000FF } /* Name.Function */ +.nl { color: #767600 } /* Name.Label */ +.nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.nt { color: #008000; font-weight: bold } /* Name.Tag */ +.nv { color: #19177C } /* Name.Variable */ +.ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mb { color: #666666 } /* Literal.Number.Bin */ +.mf { color: #666666 } /* Literal.Number.Float */ +.mh { color: #666666 } /* Literal.Number.Hex */ +.mi { color: #666666 } /* Literal.Number.Integer */ +.mo { color: #666666 } /* Literal.Number.Oct */ +.sa { color: #BA2121 } /* Literal.String.Affix */ +.sb { color: #BA2121 } /* Literal.String.Backtick */ +.sc { color: #BA2121 } /* Literal.String.Char */ +.dl { color: #BA2121 } /* Literal.String.Delimiter */ +.sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #BA2121 } /* Literal.String.Double */ +.se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #BA2121 } /* Literal.String.Heredoc */ +.si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */ +.sx { color: #008000 } /* Literal.String.Other */ +.sr { color: #A45A77 } /* Literal.String.Regex */ +.s1 { color: #BA2121 } /* Literal.String.Single */ +.ss { color: #19177C } /* Literal.String.Symbol */ +.bp { color: #008000 } /* Name.Builtin.Pseudo */ +.fm { color: #0000FF } /* Name.Function.Magic */ +.vc { color: #19177C } /* Name.Variable.Class */ +.vg { color: #19177C } /* Name.Variable.Global */ +.vi { color: #19177C } /* Name.Variable.Instance */ +.vm { color: #19177C } /* Name.Variable.Magic */ +.il { color: #666666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/html/tutorial-initialising-finishing.html b/docs/html/tutorial-initialising-finishing.html new file mode 100644 index 0000000..cf94a6e --- /dev/null +++ b/docs/html/tutorial-initialising-finishing.html @@ -0,0 +1,42 @@ + + + + +Initialising and Finishing using the Library: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Initialising and Finishing using the Library

+

Raptor requires initialising a raptor_world object before using +any of the classes which take the world object as an argument in +their constructors. The function to make the world object is +raptor_new_world() and the destructor raptor_free_world(). +

+
+  raptor_world* world;
+  world = raptor_new_world();
+  ...
+  raptor_free_world(world);
+
+

+

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parse-strictness.html b/docs/html/tutorial-parse-strictness.html new file mode 100644 index 0000000..5a90b08 --- /dev/null +++ b/docs/html/tutorial-parse-strictness.html @@ -0,0 +1,37 @@ + + + + +Set the parsing strictness: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Set the parsing strictness

+

+raptor_parser_set_option() +with option +RAPTOR_OPTION_STRICT +allows setting of the parser strictness flag. The default is lax parsing, +accepting older or deprecated syntax forms but may generate a warning. Setting +to non-0 (true) will cause parser errors to be generated in these cases. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-abort.html b/docs/html/tutorial-parser-abort.html new file mode 100644 index 0000000..754cb26 --- /dev/null +++ b/docs/html/tutorial-parser-abort.html @@ -0,0 +1,37 @@ + + + + +Aborting parsing: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Aborting parsing

+

+raptor_parser_parse_abort() +allows the current parsing to be aborted, at which point no further +triples will be passed to callbacks and the parser will attempt to +return control to the application. This is most useful when called +inside a handler function which allows the application to decide to stop +an active parsing. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-content.html b/docs/html/tutorial-parser-content.html new file mode 100644 index 0000000..fc7828b --- /dev/null +++ b/docs/html/tutorial-parser-content.html @@ -0,0 +1,150 @@ + + + + +Provide syntax content to parse: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Provide syntax content to parse

+

The operation of turning syntax into RDF triples has several +alternatives from functions that do most of the work starting from a +URI to functions that allow passing in data buffers.

+
+

Parsing and MIME Types

+The mime type of the retrieved content is not used to choose +a parser unless the parser is of type guess. +The guess parser will send an Accept: header +for all known parser syntax mime types (if a URI request is made) +and based on the response, including the identifiers used, +pick the appropriate parser to execute. See +raptor_world_guess_parser_name() +for a full discussion of the inputs to the guessing. +
+
+

+Parse the content from a URI (raptor_parser_parse_uri())

+

The URI is resolved and the content read from it and passed to +the parser: +

+
+  raptor_parser_parse_uri(rdf_parser, uri, base_uri);
+
+

+The base_uri is optional (can be +NULL) and will default to the +uri. +

+
+
+

+Parse the content of a URI using an existing WWW connection (raptor_parser_parse_uri_with_connection())

+

The URI is resolved using an existing WWW connection (for +example a libcurl CURL handle) to allow for any existing +WWW configuration to be reused. See +raptor_new_www_with_connection +for full details of how this works. The content is then read from the +result of resolving the URI: +

+
+  raptor_parser_parse_uri_with_connection(rdf_parser, uri, base_uri, connection);
+
+

+The base_uri is optional (can be +NULL) and will default to the +uri. +

+
+
+

+Parse the content of a C FILE* (raptor_parser_parse_file_stream())

+

Parsing can read from a C STDIO file handle: +

+
+  stream = fopen(filename, "rb");
+  raptor_parser_parse_file_stream(rdf_parser, stream, filename, base_uri);
+  fclose(stream);
+
+

+This function can use take an optional filename which +is used in locator error messages. +The base_uri may be required by some parsers +and if NULL will cause the parsing to fail. +This requirement can be checked by looking at the flags in +the parser description using +raptor_world_get_parser_description(). +

+
+
+

+Parse the content of a file URI (raptor_parser_parse_file())

+

Parsing can read from a URI known to be a file: URI: +

+
+  raptor_parser_parse_file(rdf_parser, file_uri, base_uri);
+
+

+This function requires that the file_uri is +a file URI, that is +raptor_uri_uri_string_is_file_uri( raptor_uri_as_string( file_uri) ) +must be true. +The base_uri may be required by some parsers +and if NULL will cause the parsing to fail. +

+
+
+

+Parse chunks of syntax content provided by the application (raptor_parser_parse_start() and raptor_parser_parse_chunk())

+

+

+
+  raptor_parser_parse_start(rdf_parser, base_uri);
+  while(/* not finished getting content */) {
+    unsigned char *buffer;
+    size_t buffer_len;
+
+    /* ... obtain some syntax content in buffer of size buffer_len bytes ... */
+
+    raptor_parser_parse_chunk(rdf_parser, buffer, buffer_len, 0);
+  }
+  raptor_parser_parse_chunk(rdf_parser, NULL, 0, 1); /* no data and is_end = 1 */
+
+

+The base_uri argument to +raptor_parser_parse_start() +may be required by some parsers +and if NULL will cause the parsing to fail. +

+

On the last +raptor_parser_parse_chunk() +call, or after the loop is ended, the is_end +parameter must be set to non-0. Content can be passed with the +final call. If no content is present at the end (such as in +some kind of end of file situation), then a 0-length +buffer_len or NULL buffer can be used.

+

The minimal case is an entire parse in one chunk as follows:

+
+  raptor_parser_parse_start(rdf_parser, base_uri);
+  raptor_parser_parse_chunk(rdf_parser, buffer, buffer_len, 1); /* is_end = 1 */
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-create.html b/docs/html/tutorial-parser-create.html new file mode 100644 index 0000000..8023dee --- /dev/null +++ b/docs/html/tutorial-parser-create.html @@ -0,0 +1,90 @@ + + + + +Create the Parser object: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Create the Parser object

+

The parser can be created directly from a known name such as +rdfxml for the W3C Recommendation RDF/XML syntax: +

+
+  raptor_parser* rdf_parser;
+
+  rdf_parser = raptor_new_parser(world, "rdfxml");
+
+

+or the name can be discovered from an description +as discussed in Querying Functionality +

+

The parser can also be created by identifying the syntax by a +URI, specifying the syntax by a MIME Type, providng an identifier for +the content such as filename or URI string or giving some initial +content bytes that can be used to guess. +Using the +raptor_new_parser_for_content() +function, all of these can be given as optional parameters, using NULL +or 0 for undefined parameters. The constructor will then use as much of +this information as possible. +

+
+  raptor_parser* rdf_parser;
+
+

Create a parser that reads the MIME Type for RDF/XML +application/rdf+xml +

+
+  rdf_parser = raptor_new_parser_for_content(world, NULL, "application/rdf+xml", NULL, 0, NULL);
+
+

+

+

Create a parser that can read a syntax identified by the URI +for Turtle http://www.dajobe.org/2004/01/turtle/, +which has no registered MIME Type at this date: +

+
+  syntax_uri = raptor_new_uri(world, "http://www.dajobe.org/2004/01/turtle/");
+
+  rdf_parser = raptor_new_parser_for_content(world, syntax_uri, NULL, NULL, 0, NULL);
+
+

+

+

Create a parser that recognises the identifier foo.rss: +

+
+  rdf_parser = raptor_new_parser_for_content(world, NULL, NULL, NULL, 0, "foo.rss");
+
+

+

+

Create a parser that recognises the content in buffer: +

+
+  rdf_parser = raptor_new_parser_for_content(world, NULL, NULL, buffer, len, NULL);
+
+

+

+

Any of the constructor calls can return NULL if no matching +parser could be found, or the construction failed in another way. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-destroy.html b/docs/html/tutorial-parser-destroy.html new file mode 100644 index 0000000..ab2ae32 --- /dev/null +++ b/docs/html/tutorial-parser-destroy.html @@ -0,0 +1,37 @@ + + + + +Destroy the parser: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Destroy the parser

+

+To tidy up, delete the parser object as follows: +

+
+  raptor_free_parser(rdf_parser);
+
+

+

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-example.html b/docs/html/tutorial-parser-example.html new file mode 100644 index 0000000..9ef3fc4 --- /dev/null +++ b/docs/html/tutorial-parser-example.html @@ -0,0 +1,97 @@ + + + + +Parsing example code: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Parsing example code

+
+

Example 2. rdfprint.c: Parse an RDF/XML file and print the triples

+
+
+#include <stdio.h>
+#include <raptor2.h>
+
+/* rdfprint.c: print triples from parsing RDF/XML */
+
+static void
+print_triple(void* user_data, raptor_statement* triple) 
+{
+  raptor_statement_print_as_ntriples(triple, stdout);
+  fputc('\n', stdout);
+}
+
+int
+main(int argc, char *argv[])
+{
+  raptor_world *world = NULL;
+  raptor_parser* rdf_parser = NULL;
+  unsigned char *uri_string;
+  raptor_uri *uri, *base_uri;
+
+  world = raptor_new_world();
+
+  rdf_parser = raptor_new_parser(world, "rdfxml");
+
+  raptor_parser_set_statement_handler(rdf_parser, NULL, print_triple);
+
+  uri_string = raptor_uri_filename_to_uri_string(argv[1]);
+  uri = raptor_new_uri(world, uri_string);
+  base_uri = raptor_uri_copy(uri);
+
+  raptor_parser_parse_file(rdf_parser, uri, base_uri);
+
+  raptor_free_parser(rdf_parser);
+
+  raptor_free_uri(base_uri);
+  raptor_free_uri(uri);
+  raptor_free_memory(uri_string);
+
+  raptor_free_world(world);
+
+  return 0;
+}
+
+
+

Compile it like this: +

+
+$ gcc -o rdfprint rdfprint.c `pkg-config raptor2 --cflags --libs`
+
+

+and run it on an RDF file as: +

+
+$ ./rdfprint raptor.rdf
+_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://usefulinc.com/ns/doap#Project> .
+_:genid1 <http://usefulinc.com/ns/doap#name> "Raptor" .
+_:genid1 <http://usefulinc.com/ns/doap#homepage> <http://librdf.org/raptor/> .
+...
+
+

+

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-features.html b/docs/html/tutorial-parser-features.html new file mode 100644 index 0000000..7ed2c1a --- /dev/null +++ b/docs/html/tutorial-parser-features.html @@ -0,0 +1,71 @@ + + + + +Parser options: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Parser options

+

There are several + options that can be set on parsers. +The exact list of options can be found at run time via the +Querying Functionality +or in the API reference for +raptor_option. +

+

Options are integer enumerations of the + raptor_option enum and have +typed values that are either booleans, integers or strings. +The function that sets options for parsers is +raptor_parser_set_option() +used as follows: +

+
+  /* Set a boolean or integer valued option to value 1 */
+  raptor_parser_set_option(rdf_parser, option, NULL, 1);
+
+  /* Set a string valued option to value "abc" */
+  raptor_parser_set_option(rdf_parser, option, "abc", -1);
+
+

+

+

+There is a corresponding function for reading the values of parser +option +raptor_parser_get_option() +which takes the option enumeration parameter and returns the boolean / +integer or string value correspondingly into the appropriate pointer +argument. +

+
+  /* Get a boolean or integer option value */
+  int int_var;
+  raptor_parser_get_option(rdf_parser, option, NULL, &int_var);
+
+  /* Get a string option value */
+  char* string_var;
+  raptor_parser_get_option(rdf_parser, option, &string_var, NULL);
+
+

+

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-runtime-info.html b/docs/html/tutorial-parser-runtime-info.html new file mode 100644 index 0000000..5ed16de --- /dev/null +++ b/docs/html/tutorial-parser-runtime-info.html @@ -0,0 +1,36 @@ + + + + +Querying parser run-time information: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Querying parser run-time information

+

+raptor_parser_get_locator() +returns the raptor_locator +for the current position in the input stream. The locator +structure contains full information on the details of where in the +file or URI the current parser has reached. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-set-error-warning-handlers.html b/docs/html/tutorial-parser-set-error-warning-handlers.html new file mode 100644 index 0000000..a100376 --- /dev/null +++ b/docs/html/tutorial-parser-set-error-warning-handlers.html @@ -0,0 +1,54 @@ + + + + +Set parsing log message handlers: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Set parsing log message handlers

+

Any time before parsing is called, a log handler can be set +on the world object via the +raptor_world_set_log_handler() +method to report errors and warnings from parsing. +The method takes a user data argument plus a handler callback of type +raptor_log_handler +with a signature that looks like this: +

+
+void
+message_handler(void *user_data, raptor_log_message* message)
+{
+  /* do something with the message */
+}
+
+

+The handler gets the user data pointer as well as a +raptor_log_handler +pointer that includes associated location information, such as the +log level, +raptor_locator, +and the log message itself. The locator +structure contains full information on the details of where in the +file or URI the message occurred. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-set-id-handler.html b/docs/html/tutorial-parser-set-id-handler.html new file mode 100644 index 0000000..4f17805 --- /dev/null +++ b/docs/html/tutorial-parser-set-id-handler.html @@ -0,0 +1,61 @@ + + + + +Set the identifier creator handler: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Set the identifier creator handler

+

Identifiers are created in some parsers by generating them +automatically or via hints given a syntax. Raptor can customise this +process using a user-supplied identifier handler function. +For example, in RDF/XML generated blank node identifiers and those +those specified rdf:nodeID are passed through this +process. Setting a handler allows the identifier generation mechanism to be +fully replaced. A lighter alternative is to use +raptor_world_set_generate_bnodeid_parameters() +to adjust the default algorithm for generated identifiers. +

+

It is used as follows +

+
+  raptor_generate_bnodeid_handler bnodeid_handler;
+
+  raptor_world_set_generate_bnodeid_handler(rdf_parser, user_data, bnodeid_handler);
+
+

+

+

The bnodeid_handler takes the following signature: +

+
+unsigned char*
+generate_id_handler(void* user_data, unsigned char* user_id)
+{
+   /* return a new generated ID based on user_id (optional) */
+}
+
+

+where user_id an optional user-supplied identifier, +such as the value of a rdf:nodeID in RDF/XML. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-set-namespace-handler.html b/docs/html/tutorial-parser-set-namespace-handler.html new file mode 100644 index 0000000..30a9af7 --- /dev/null +++ b/docs/html/tutorial-parser-set-namespace-handler.html @@ -0,0 +1,57 @@ + + + + +Set namespace declared handler: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Set namespace declared handler

+

Raptor can report when namespace prefix/URIs are declared in +during parsing a syntax such as those in XML, RDF/XML or Turtle. +A handler function can be set to receive these declarations using +the namespace handler method. +

+
+  raptor_namespace_handler namespaces_handler;
+
+  raptor_parser_set_namespace_handler(rdf_parser, user_data, namespaces_handler);
+
+

+

+

The namespaces_handler takes the following signature: +

+
+void
+namespaces_handler(void* user_data, raptor_namespace *nspace)
+{
+  /*  */
+}
+
+

+

+
This may be called multiple times with the same namespace, +if the namespace is declared inside different XML sub-trees. +
+

+

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-set-triple-handler.html b/docs/html/tutorial-parser-set-triple-handler.html new file mode 100644 index 0000000..468202c --- /dev/null +++ b/docs/html/tutorial-parser-set-triple-handler.html @@ -0,0 +1,52 @@ + + + + +Set RDF statement callback handler: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Set RDF statement callback handler

+

The main reason to parse a syntax is to get RDF triples +returned and these are return by a user-defined handler function +which is called with parameters of a user data pointer and a +raptor statement, which includes the triple terms plus the +optional named graph term. The handler is set with +raptor_parser_set_statement_handler() +as follows: +

+
+  void
+  statement_handler(void* user_data, const raptor_statement* statement)
+  {
+    /* do something with the statement */
+  }
+
+  raptor_parser_set_statement_handler(rdf_parser, user_data, statements_handler);
+
+

+

+

Setting a stateemnt handler function is optional since parsing +without returning statements is a valid use, such as when parsing in +order to validate a syntax. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parser-static-info.html b/docs/html/tutorial-parser-static-info.html new file mode 100644 index 0000000..0d01610 --- /dev/null +++ b/docs/html/tutorial-parser-static-info.html @@ -0,0 +1,45 @@ + + + + +Querying parser static information: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Querying parser static information

+

+These methods return information about the constructed parser +implementation corresponding to the information available +via raptor_world_get_parser_description() +for all parsers. +

+

raptor_parser_get_name() returns the parser syntax name, +raptor_parser_get_description() +returns more detailed description fields including the long label and +mime_types for the parser with quality levels. +

+

raptor_parser_get_accept_header() +returns a string that would be sent in an HTTP +request Accept: header for the syntaxes accepted by this +parser only. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-parsing.html b/docs/html/tutorial-parsing.html new file mode 100644 index 0000000..d960089 --- /dev/null +++ b/docs/html/tutorial-parsing.html @@ -0,0 +1,72 @@ + + + + +Parsing syntaxes to RDF Triples: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Parsing syntaxes to RDF Triples

+ +
+

+Introduction

+

+The typical sequence of operations to parse is to create a parser +object, set various handlers and options, start the parsing, send +some syntax content to the parser object, finish the parsing and +destroy the parser object.

+

Several parts of this process are optional, including actually +using the triple results, which is useful as a syntax checking +process. +

+
+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-querying-functionality.html b/docs/html/tutorial-querying-functionality.html new file mode 100644 index 0000000..70932eb --- /dev/null +++ b/docs/html/tutorial-querying-functionality.html @@ -0,0 +1,112 @@ + + + + +Listing built-in functionality: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Listing built-in functionality

+

+Raptor can be configured and compiled with support for different +lists of parsers and serializers. The list built into the +library can be found by means of +description functions. These take as input an +int counter and return descriptions of the object +at that offset in the list. The return value is a pointer to a +shared, read-only description of the object, or NULL if the counter +has gone too far into the list. +

+
+

Listing Functionality with Descriptions

+ ++++ + + + + + + + + + + + + + + +

Get descriptions of the parser syntaxes

+  const raptor_syntax_description*
+  raptor_world_get_parser_description(raptor_world* world,
+                                      unsigned int counter);
+

Get descriptions of the serializer syntaxes

+  const raptor_syntax_description*
+  raptor_world_get_serializer_description(raptor_world* world,
+                                          unsigned int counter);
+

Get descriptions of options

+
+  raptor_option_description*
+  raptor_world_get_option_description(raptor_world* world,
+                                      const raptor_domain domain,
+                                      const raptor_option option);
+
+

+Call with the appropriate domains for the class such as +RAPTOR_DOMAIN_PARSER, +RAPTOR_DOMAIN_SERIALIZER + etc. See the +raptor_domain +description for the full list. +

+
+
+

These functions can be called directly after creating a +raptor world object with +raptor_new_world(). +This is one way to find a parser (name) by it's MIME Type, the other +is to use the mime_type parameter of the +raptor_new_parser_for_content().

+
+

Example 1. List all parser options using option description

+
+
+  unsigned int i;
+  for(i = 0; i < raptor_option_get_count(); i++) {
+    raptor_option_description* od;
+
+    od = raptor_world_get_option_description(world, RAPTOR_DOMAIN_PARSER, i);
+
+    if(od) {
+      /* do something with od fields such as od->name, od->label */
+    }
+  }
+
+

There are more examples of this usage in the source for the +rapper utility in util/rapper.c. +

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-create.html b/docs/html/tutorial-serializer-create.html new file mode 100644 index 0000000..c361d7a --- /dev/null +++ b/docs/html/tutorial-serializer-create.html @@ -0,0 +1,43 @@ + + + + +Create the Serializer object: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Create the Serializer object

+

The serializer can be created directly from a known name using +raptor_new_serializer() +such as rdfxml for the W3C Recommendation RDF/XML syntax: +

+
+  raptor_serializer* rdf_serializer;
+
+  rdf_serializer = raptor_new_serializer(world, "rdfxml");
+
+

+or the name can be discovered from an description +as discussed in +Querying Functionality +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-declare-namespace.html b/docs/html/tutorial-serializer-declare-namespace.html new file mode 100644 index 0000000..05b01da --- /dev/null +++ b/docs/html/tutorial-serializer-declare-namespace.html @@ -0,0 +1,63 @@ + + + + +Declare namespaces: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Declare namespaces

+

Raptor can use namespace prefix/URIs to abbreviate syntax +in some syntaxes such as Turtle or any XML syntax including RDF/XML, +RSS1.0 and Atom 1.0. These are declared +with raptor_serializer_set_namespace() +using a prefix and URI argument pair like this: +

+
+  const unsigned char* prefix = "ex";
+  raptor_uri* uri = raptor_new_uri(world, "http://example.org");
+
+  raptor_serializer_set_namespace(rdf_serializer, prefix, uri);
+
+

+

+

or +raptor_serializer_set_namespace_from_namespace() +from an existing namespace. This can be useful when connected up the +the namespace declarations that are generated from a parser via a +namespace handler set with +raptor_parser_set_namespace_handler() +

+like this: +
+  static void
+  relay_namespaces(void* user_data, raptor_namespace *nspace)
+  {
+    raptor_serializer_set_namespace_from_namespace(rdf_serializer, nspace);
+  }
+
+  ...
+
+  rdf_parser = raptor_new_parser(world, syntax_name);
+  raptor_parser_set_namespace_handler(rdf_parser, rdf_serializer, relay_namespaces);
+
+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-destroy.html b/docs/html/tutorial-serializer-destroy.html new file mode 100644 index 0000000..63053d2 --- /dev/null +++ b/docs/html/tutorial-serializer-destroy.html @@ -0,0 +1,37 @@ + + + + +Destroy the serializer: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Destroy the serializer

+

+To tidy up, delete the serializer object as follows: +

+
+  raptor_free_serializer(rdf_serializer);
+
+

+

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-example.html b/docs/html/tutorial-serializer-example.html new file mode 100644 index 0000000..cadb6e2 --- /dev/null +++ b/docs/html/tutorial-serializer-example.html @@ -0,0 +1,113 @@ + + + + +Serializing example code: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Serializing example code

+
+

Example 4. rdfcat.c: Read any RDF syntax and serialize to RDF/XML (Abbreviated)

+
+
+#include <stdio.h>
+#include <raptor2.h>
+
+/* rdfcat.c: parse any RDF syntax and serialize to RDF/XML-Abbrev */
+
+static raptor_serializer* rdf_serializer;
+
+static void
+serialize_triple(void* user_data, raptor_statement* triple) 
+{
+  raptor_serializer_serialize_statement(rdf_serializer, triple);
+}
+
+static void
+declare_namespace(void* user_data, raptor_namespace *nspace)
+{
+  raptor_serializer_set_namespace_from_namespace(rdf_serializer, nspace);
+}
+
+int
+main(int argc, char *argv[])
+{
+  raptor_world *world = NULL;
+  raptor_parser* rdf_parser = NULL;
+  unsigned char *uri_string;
+  raptor_uri *uri, *base_uri;
+
+  world = raptor_new_world();
+
+  uri_string = raptor_uri_filename_to_uri_string(argv[1]);
+  uri = raptor_new_uri(world, uri_string);
+  base_uri = raptor_uri_copy(uri);
+
+  /* Ask raptor to work out which parser to use */
+  rdf_parser = raptor_new_parser(world, "guess");
+  raptor_parser_set_statement_handler(rdf_parser, NULL, serialize_triple);
+  raptor_parser_set_namespace_handler(rdf_parser, NULL, declare_namespace);
+
+  rdf_serializer = raptor_new_serializer(world, "rdfxml-abbrev");
+
+  raptor_serializer_start_to_file_handle(rdf_serializer, base_uri, stdout);
+  raptor_parser_parse_file(rdf_parser, uri, base_uri);
+  raptor_serializer_serialize_end(rdf_serializer);
+
+  raptor_free_serializer(rdf_serializer);
+  raptor_free_parser(rdf_parser);
+
+  raptor_free_uri(base_uri);
+  raptor_free_uri(uri);
+  raptor_free_memory(uri_string);
+
+  raptor_free_world(world);
+
+  return 0;
+}
+
+
+

Compile it like this: +

+
+$ gcc -o rdfcat rdfcat.c `pkg-config raptor2 --cflags --libs`
+
+

+and run it on an RDF file as: +

+
+$ ./rdfcat raptor.rdf
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://usefulinc.com/ns/doap#">
+  <rdf:Description rdf:about="">
+    <foaf:maker>
+      <foaf:Person>
+        <foaf:name>Dave Beckett</foaf:name>
+...
+
+

+

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-features.html b/docs/html/tutorial-serializer-features.html new file mode 100644 index 0000000..965c7d9 --- /dev/null +++ b/docs/html/tutorial-serializer-features.html @@ -0,0 +1,70 @@ + + + + +Serializer options: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Serializer options

+

There are several options that can be set on serializers. +The exact list of options can be found at run time via the +Querying Functionality +or in the API reference for +raptor_option. +

+

Options are integer enumerations of the +raptor_option enum and have +values that are either booleans, integers or strings. +The function that sets options for serializers is: +raptor_serializer_set_option() +used as follows: +

+
+  /* Set a boolean or integer valued option to value 1 */
+  raptor_serializer_set_option(rdf_serializer, option, NULL, 1);
+
+  /* Set a string valued option to value "abc" */
+  raptor_serializer_set_option(rdf_serializer, option, "abc", -1);
+
+

+

+

+There is a corresponding function for reading the values of serializer +option +raptor_serializer_get_option() +which takes the option enumeration parameter and returns the boolean / +integer or string value correspondingly into the appropriate pointer +argument. +

+
+  /* Get a boolean or integer option value */
+  int int_var;
+  raptor_serializer_get_option(rdf_serializer, option, NULL, &int_var);
+
+  /* Get a string option value */
+  char* string_var;
+  raptor_serializer_get_option(rdf_serializer, option, &string_var, NULL);
+
+

+

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-get-triples.html b/docs/html/tutorial-serializer-get-triples.html new file mode 100644 index 0000000..b81d5ac --- /dev/null +++ b/docs/html/tutorial-serializer-get-triples.html @@ -0,0 +1,125 @@ + + + + +Get or construct RDF Statements (Triples): Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Get or construct RDF Statements (Triples)

+

+An raptor_statement +containing the triple terms and optional graph term +can be made either by receiving them from a +raptor_parser +via parsing or can be constructed by hand.

+

When constructing by hand, +the raptor_statement +structure should be allocated by the application and the fields +filled in. Each statement has three triple terms (subject, +predicate, object) and an optional graph term. The subject can be a +URI or blank node, the predicate can only be a URI and the object can +be a URI, blank node or RDF literal. RDF literals can have either +just a Unicode string, a Unicode string and a language or a Unicode +string and a datatype URI.

+

The statement terms are all instances of +raptor_term +objects constructed with the appropriate constructor for +the URI, blank node or rdf literal types. The graph term +of the statement is typically a URI or blank node. +

+
+

Example 3. rdfserialize.c: Serialize 1 triple to RDF/XML (Abbreviated)

+
+
+#include <stdio.h>
+#include <raptor2.h>
+#include <stdlib.h>
+
+/* rdfserialize.c: serialize 1 triple to RDF/XML-Abbrev */
+
+int
+main(int argc, char *argv[])
+{
+  raptor_world *world = NULL;
+  raptor_serializer* rdf_serializer = NULL;
+  unsigned char *uri_string;
+  raptor_uri *base_uri;
+  raptor_statement* triple;
+
+  world = raptor_new_world();
+  
+  uri_string = raptor_uri_filename_to_uri_string(argv[1]);
+  base_uri = raptor_new_uri(world, uri_string);
+
+  rdf_serializer = raptor_new_serializer(world, "rdfxml-abbrev");
+  raptor_serializer_start_to_file_handle(rdf_serializer, base_uri, stdout);
+  
+  /* Make a triple with URI subject, URI predicate, literal object */
+  triple = raptor_new_statement(world);
+  triple->subject = raptor_new_term_from_uri_string(world, (const unsigned char*)"http://example.org/subject");
+  triple->predicate = raptor_new_term_from_uri_string(world, (const unsigned char*)"http://example.org/predicate");
+  triple->object = raptor_new_term_from_literal(world,
+                                                (const unsigned char*)"An example literal",
+                                                NULL,
+                                                (const unsigned char*)"en");
+
+  /* Write the triple */
+  raptor_serializer_serialize_statement(rdf_serializer, triple);
+
+  /* Delete the triple */
+  raptor_free_statement(triple);
+
+  raptor_serializer_serialize_end(rdf_serializer);
+  raptor_free_serializer(rdf_serializer);
+  
+  raptor_free_uri(base_uri);
+  raptor_free_memory(uri_string);
+
+  raptor_free_world(world);
+  return 0;
+}
+
+
+

Compile it like this: +

+
+$ gcc -o rdfserialize rdfserialize.c `pkg-config raptor2 --cflags --libs`
+
+

+and run it with an optional base URI argument +

+
+$ ./rdfserialize
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+  <rdf:Description rdf:about="http://example.org/subject">
+    <ns0:predicate xmlns:ns0="http://example.org/" xml:lang="en">An example</ns0:predicate>
+  </rdf:Description>
+</rdf:RDF>
+
+

+

+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-runtime-info.html b/docs/html/tutorial-serializer-runtime-info.html new file mode 100644 index 0000000..7f234c4 --- /dev/null +++ b/docs/html/tutorial-serializer-runtime-info.html @@ -0,0 +1,40 @@ + + + + +Querying serializer run-time information: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Querying serializer run-time information

+

+raptor_serializer_get_iostream() +gets the current serializer's raptor_iostream. +

+

+raptor_serializer_get_locator() +returns the raptor_locator +for the current position in the output stream. The locator +structure contains full information on the details of where in the +file or URI the current serializer has reached. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-send-triples.html b/docs/html/tutorial-serializer-send-triples.html new file mode 100644 index 0000000..86c150b --- /dev/null +++ b/docs/html/tutorial-serializer-send-triples.html @@ -0,0 +1,56 @@ + + + + +Send RDF Triples to serializer: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Send RDF Triples to serializer

+

+Once the serializer has been started, RDF triples can be sent to it +via the +raptor_serializer_serialize_statement() +function with a +raptor_statement +value. +

+

Once all triples are sent, the serializing must be finished +with a call to +raptor_serializer_serialize_end(). +In particular, only at this point does the +raptor_iostream +get flushed or any string constructed for +raptor_serializer_start_to_string(). +

+
+  /* start the serializing somehow */
+  while( /* got RDF triples */ ) {
+    raptor_serializer_serialize_statement(rdf_serializer, triple);
+  }
+  raptor_serializer_serialize_end(rdf_serializer);
+  /* now can use the serializing result (FILE, string, raptor_iostream) */
+
+

+ +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-set-error-warning-handlers.html b/docs/html/tutorial-serializer-set-error-warning-handlers.html new file mode 100644 index 0000000..63659bb --- /dev/null +++ b/docs/html/tutorial-serializer-set-error-warning-handlers.html @@ -0,0 +1,54 @@ + + + + +Set error and warning handlers: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Set error and warning handlers

+

Any time before serializing is started, a log handler can be set +on the world object via the +raptor_world_set_log_handler() +method to report errors and warnings from parsing. +The method takes a user data argument plus a handler callback of type +raptor_log_handler +with a signature that looks like this: +

+
+void
+message_handler(void *user_data, raptor_log_message* message)
+{
+  /* do something with the message */
+}
+
+

+The handler gets the user data pointer as well as a +raptor_log_handler +pointer that includes associated location information, such as the +log level, +raptor_locator, +and the log message itself. The locator +structure contains full information on the details of where in the +file or URI the message occurred. +

+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializer-to-destination.html b/docs/html/tutorial-serializer-to-destination.html new file mode 100644 index 0000000..f126e2f --- /dev/null +++ b/docs/html/tutorial-serializer-to-destination.html @@ -0,0 +1,120 @@ + + + + +Provide a destination for the serialized syntax: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Provide a destination for the serialized syntax

+

The operation of turning RDF triples into a syntax has several +alternatives from functions that do most of the work writing to a file +or string to functions that allow passing in a +raptor_iostream +which can be entirely user-constructed.

+
+

+Serialize to a filename (raptor_serializer_start_to_filename())

+

Serialize to a new filename +(using raptor_new_iostream_to_filename() internally) +and uses asf base URI, the file's URI. +

+
+  const char *filename = "raptor.rdf";
+  raptor_serializer_start_to_filename(rdf_serializer, filename);
+
+

+

+
+
+

+Serialize to a string (raptor_serializer_start_to_string())

+

Serialize to a string that is allocated by the serializer +(using raptor_new_iostream_to_string() internally). The +resulting string is only constructed after raptor_serializer_serialize_end() is called and at that +point it is assigned to the string pointer passed in, with the length +written to the optional length pointer. This function +takes an optional base URI but may be required by some serializers. +

+
+  raptor_uri* uri = raptor_new_uri(world, "http://example.org/base");
+  void *string;  /* destination for string */
+  size_t length; /* length of constructed string */
+  raptor_serializer* rdf_serializer = /* serializer created by some means */ ;
+
+  raptor_serializer_start_to_string(rdf_serializer, uri,
+                                    &string, &length);
+
+

+

+
+
+

+Serialize to a FILE* file handle (raptor_serializer_start_to_file_handle())

+

Serialize to an existing open C FILE* file handle +(using raptor_new_iostream_to_file_handle() internally). The handle is not closed after serializing is finished. This function +takes an optional base URI but may be required by some serializers. +

+
+  raptor_uri* uri = raptor_new_uri(world, "http://example.org/base");
+  FILE* fh = fopen("raptor.rdf", "wb");
+  raptor_serializer* rdf_serializer = /* serializer created by some means */ ;
+
+  raptor_serializer_start_to_file_handle(rdf_serializer, uri, fh);
+
+

+

+
+
+ +

This is the most flexible serializing method as it allows +writing to any +raptor_iostream +which can be constructed to build any form of user-generated structure +via callbacks. The iostream remains owned by the caller that can continue +to write to it after the serializing is finished (after +raptor_serializer_serialize_end()) is called). +

+
+  raptor_uri* uri = raptor_new_uri(world, "http://example.org/base");
+  raptor_iostream* iostream = /* iostream initialized by some means */ ;
+  raptor_serializer* rdf_serializer = /* serializer created by some means */ ;
+
+  raptor_serializer_start_to_iostream(rdf_serializer, uri, iostream);
+
+  while( /* got RDF triples */ ) {
+    raptor_statement* triple = /* ... triple made from somewhere ... */ ;
+    raptor_serializer_serialize_statement(rdf_serializer, triple);
+  }
+  raptor_serializer_serialize_end(rdf_serializer);
+
+  raptor_free_serializer(rdf_serializer);
+
+  /* ... write other stuff to iostream ... */
+
+  raptor_free_iostream(iostream);
+
+

+

+
+
+ + + \ No newline at end of file diff --git a/docs/html/tutorial-serializing.html b/docs/html/tutorial-serializing.html new file mode 100644 index 0000000..722f282 --- /dev/null +++ b/docs/html/tutorial-serializing.html @@ -0,0 +1,58 @@ + + + + +Serializing RDF triples to a syntax: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/html/tutorial.html b/docs/html/tutorial.html new file mode 100644 index 0000000..540a43c --- /dev/null +++ b/docs/html/tutorial.html @@ -0,0 +1,102 @@ + + + + +Part I. Raptor Tutorial: Raptor RDF Syntax Library Manual + + + + + + + + + + + + + + + + +
+

+Part I. Raptor Tutorial

+
+
+

This part describes how to use the + Raptor APIs to + turn syntaxes into RDF triples and RDF triples into syntaxes.

+

The next part contains the + Raptor Reference Manual + which comprehensively describes every class and function of the API. +

+

For the latest information, see the + Raptor Home Page + and the main document overview + in this document tree. +

+
+

Table of Contents

+
+
Initialising and Finishing using the Library
+
Listing built-in functionality
+
Parsing syntaxes to RDF Triples
+
+
Introduction
+
Create the Parser object
+
Parser options
+
Set RDF statement callback handler
+
Set parsing log message handlers
+
Set the identifier creator handler
+
Set namespace declared handler
+
Set the parsing strictness
+
Provide syntax content to parse
+
+
Parse the content from a URI (raptor_parser_parse_uri())
+
Parse the content of a URI using an existing WWW connection (raptor_parser_parse_uri_with_connection())
+
Parse the content of a C FILE* (raptor_parser_parse_file_stream())
+
Parse the content of a file URI (raptor_parser_parse_file())
+
Parse chunks of syntax content provided by the application (raptor_parser_parse_start() and raptor_parser_parse_chunk())
+
+
Restrict parser network access
+
+
Filtering parser network requests with option RAPTOR_OPTION_NO_NET
+
Filtering parser network requests with raptor_www_set_uri_filter()
+
Filtering parser network requests with raptor_parser_set_uri_filter()
+
Setting timeout for parser network requests with option RAPTOR_OPTION_WWW_TIMEOUT
+
+
Querying parser static information
+
Querying parser run-time information
+
Aborting parsing
+
Destroy the parser
+
Parsing example code
+
+
Serializing RDF triples to a syntax
+
+
Introduction
+
Create the Serializer object
+
Serializer options
+
Declare namespaces
+
Set error and warning handlers
+
Provide a destination for the serialized syntax
+
+
Serialize to a filename (raptor_serializer_start_to_filename())
+
Serialize to a string (raptor_serializer_start_to_string())
+
Serialize to a FILE* file handle (raptor_serializer_start_to_file_handle())
+
Serialize to an raptor_iostream (raptor_serializer_start_to_iostream())
+
+
Get or construct RDF Statements (Triples)
+
Send RDF Triples to serializer
+
Querying serializer run-time information
+
Destroy the serializer
+
Serializing example code
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/docs/html/up-insensitive.png b/docs/html/up-insensitive.png new file mode 100644 index 0000000..478700c Binary files /dev/null and b/docs/html/up-insensitive.png differ diff --git a/docs/html/up.png b/docs/html/up.png new file mode 100644 index 0000000..636d50d Binary files /dev/null and b/docs/html/up.png differ diff --git a/docs/libraptor2.3 b/docs/libraptor2.3 new file mode 100644 index 0000000..e683b8b --- /dev/null +++ b/docs/libraptor2.3 @@ -0,0 +1,140 @@ +.\" +.\" libraptor2.3 - Raptor2 library manual page +.\" +.\" Copyright (C) 2002-2010 David Beckett - http://www.dajobe.org/ +.\" Copyright (C) 2002-2005 University of Bristol, UK +.\" +.TH libraptor2 3 "2010-08-16" +.\" Please adjust this date whenever revising the manpage. +.SH NAME +libraptor2 \- Raptor RDF syntax library 2.0 +.SH SYNOPSIS +.nf +.B #include +.br + +.br +.BI world = raptor_new_world( ); +.br +.BI "raptor_parser *" p = raptor_new_parser( world , "rdfxml" ); +.br +.BI raptor_set_statement_handler( p , NULL , print_triples ); +.br +.BI "raptor_uri *" file_uri = raptor_new_uri( world , "http://example.org/" ); +.br +.BI raptor_parser_parse_file( p , file_uri , base_uri ); +.br +.BI raptor_parser_parse_uri( p , uri , NULL ); +.br +.BI raptor_free_parser( p ); +.br +.BI raptor_free_uri( file_uri ); +.br +.BI raptor_free_world( world ); +.br + +.B cc prog.c -o prog `pkg-config raptor2 --cflags` `pkg-config raptor2 --libs` +.br +.fi +.SH DESCRIPTION +The \fIRaptor\fP library provides a high-level interface to a set +of parsers and serializers that generate +Resource Description Framework (RDF) triples +by parsing syntaxes or serialize the triples into syntaxes. +.LP +The supported parsing syntaxes include RDF/XML, N-Triples, Turtle, +TRiG, RSS tag soup (including all RSS and Atoms), GRDDL, RDF/JSON, RDFa and the +serializing syntaxes include RDF/XML (3 varieties), N-Quads, N-Triples, +Turtle, RSS 1.0, Atom 1.0, GraphViz DOT and RDF/JSON. +The RDF/XML parser can use either \fIexpat\fP or \fIlibxml\fP +XML parsers for providing the SAX event stream. +The library functions are arranged in an object-oriented style with +constructors, destructors and method calls. The statements +and error messages are delivered via callback functions. +.LP +Raptor also contains classes to support the RDF graph triples: +a statement object containing term objects and support for RDF +URI-References for both parsing them and resolving / retrieval of +URIs. +.LP +It some utility classes such as an I/O Stream abstraction for +supporting reading and writing to and from a variety of locations, +AVL Trees, String buffers and Sequences. +.LP +Raptor uses Unicode strings for RDF literals and URIs +and preserves them throughout the library. It uses the UTF-8 +encoding of Unicode at the API for passing in or returning Unicode +strings. It is intended that the preservation of Unicode for URIs +supports Internationalized Resource Identifiers (IRIs). +.SH "API REFERENCE" +See the HTML API docs that may be installed system wide at +/usr/share/gtk-doc/html/raptor2/ +or on the web at +.UR http://librdf.org/raptor/api/ +http://librdf.org/raptor/api/ +.UE +.SH API CHANGES +See the Raptor API docs changes section at +.UR http://librdf.org/raptor/api/raptor-changes.html +http://librdf.org/raptor/api/raptor-changes.html +.UE +and the upgrading information when converting from libraptor(1) +code at +.UR http://librdf.org/raptor/UPGRADING.html +http://librdf.org/raptor/UPGRADING.html +.UE +.br +.SH "CONFORMING TO" +\fIRDF/XML Syntax (Revised)\fP, Dave Beckett (ed.) +W3C Recommendation, +.UR http://www.w3.org/TR/rdf-syntax-grammar/ +http://www.w3.org/TR/rdf-syntax-grammar/ +.UE + +\fIN-Triples\fP, in \fIRDF Test Cases\fP, Jan Grant and Dave Beckett (eds.) +W3C Recommendation, +.UR http://www.w3.org/TR/rdf-testcases/#ntriples +http://www.w3.org/TR/rdf-testcases/#ntriples +.UE + +\fITurtle - Terse RDF Triple Language\fP, Dave Beckett, +.UR http://www.dajobe.org/2004/01/turtle/ +http://www.dajobe.org/2004/01/turtle/ +.UE + +\fIRSS 0.91 spec revision 3\fP, Dan Libby, Netscape, +.UR http://my.netscape.com/publish/formats/rss-spec-0.91.html +http://my.netscape.com/publish/formats/rss-spec-0.91.html +.UE + +\fIRDF Site Summary (RSS) 1.0\fP, +.UR http://purl.org/rss/1.0/spec +http://purl.org/rss/1.0/spec +.UE + +\fIAtom 1.0 syndication format\fP, +RFC 4287, +.UR http://www.ietf.org/rfc/rfc4287.txt +http://www.ietf.org/rfc/rfc4287.txt +.UE + +\fIGleaning Resource Descriptions from Dialects of Languages +(GRDDL)\fP, Dan Connolly (ed.), W3C Recommendation, 2007-09-11, +.UR http://www.w3.org/TR/2007/REC-grddl-20070911/ +http://www.w3.org/TR/2007/REC-grddl-20070911/ +.UE + +\fIRDFa in XHTML: Syntax and Processing\fP, +Ben Adida, Mark Birbeck, Shane McCarron, Steven Pemberton (eds.) + W3C Recommendation, 2008-10-14, +.UR http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014/ +http://www.w3.org/TR/2008/REC-rdfa-syntax-20081014/ +.UE + +.SH SEE ALSO +.BR rapper(1) +.SH AUTHOR +Dave Beckett - +.UR http://www.dajobe.org/ +http://www.dajobe.org/ +.UE diff --git a/docs/libraptor2.html b/docs/libraptor2.html new file mode 100644 index 0000000..04a674b --- /dev/null +++ b/docs/libraptor2.html @@ -0,0 +1,12 @@ + + + + + + + +

Copyright 2002-2014 Dave Beckett
2002-2005 University of Bristol

+ + + diff --git a/docs/raptor-changes.tsv b/docs/raptor-changes.tsv new file mode 100644 index 0000000..d4c5f68 --- /dev/null +++ b/docs/raptor-changes.tsv @@ -0,0 +1,593 @@ +# OLD VERSIONOLD RETURNOLD NAMEOLD ARGSNEW VERSIONNEW RETURNNEW NAMENEW ARGSNOTES +# OLD VERSIONtypeOLD NAME-NEW VERSIONtypeNEW NAME-NOTES +# OLD VERSIONenumOLD NAME-NEW VERSIONtypeNEW NAME-NOTES +# +# Functions +# +1.4.21 void* raptor_alloc_memory (size_t size) 2.0.0 void* raptor_alloc_memory (size_t size) - +1.4.21 void* raptor_calloc_memory (size_t nmemb, size_t size) 2.0.0 void* raptor_calloc_memory (size_t nmemb, size_t size) - +1.4.21 int raptor_compare_strings (const void *a, const void *b) 2.0.0 - - - Trivial utility function removed. +1.4.21 int raptor_copy_identifier (raptor_identifier *dest, raptor_identifier *src) 2.0.0 - - - Use raptor_term_copy() with #raptor_term objects. +1.4.21 void raptor_error_handlers_init (raptor_error_handlers* error_handlers) 2.0.0 - - - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() +1.4.21 void raptor_error_handlers_init_v2 (raptor_world* world, raptor_error_handlers* error_handlers) 2.0.0 - - - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() +1.4.21 raptor_feature raptor_feature_from_uri (raptor_uri *uri) 2.0.0 raptor_option raptor_world_get_option_from_uri (raptor_world* world, raptor_uri *uri) - +1.4.21 raptor_feature raptor_feature_from_uri_v2 (raptor_world* world, raptor_uri *uri) 2.0.0 raptor_option raptor_world_get_option_from_uri (raptor_world* world, raptor_uri *uri) - +1.4.21 int raptor_feature_value_type (const raptor_feature feature) 2.0.0 - - - Use raptor_world_get_option_description() for the option and access the value_type field. +1.4.21 int raptor_features_enumerate (const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) 2.0.0 raptor_option_description* raptor_world_get_option_description (raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_PARSER +1.4.21 int raptor_features_enumerate_v2 (raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) 2.0.0 raptor_option_description* raptor_world_get_option_description (raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_PARSER +1.4.21 void raptor_finish (void) 2.0.0 - - - Use raptor_free_world() with #raptor_world object. +1.4.21 int raptor_format_locator (char* buffer, size_t length, raptor_locator* locator) 2.0.0 int raptor_locator_format (char* buffer, size_t length, raptor_locator* locator) - +1.4.21 int raptor_format_locator_v2 (raptor_world* world, char* buffer, size_t length, raptor_locator* locator) 2.0.0 int raptor_locator_format (char* buffer, size_t length, raptor_locator* locator) - +1.4.21 void raptor_free_identifier (raptor_identifier *identifier) 2.0.0 - - - Use raptor_free_term() with #raptor_term objects. +1.4.21 void raptor_free_iostream (raptor_iostream *iostr) 2.0.0 void raptor_free_iostream (raptor_iostream *iostr) - +1.4.21 void raptor_free_memory (void *ptr) 2.0.0 void raptor_free_memory (void *ptr) - +1.4.21 void raptor_free_namespace (raptor_namespace *ns) 2.0.0 void raptor_free_namespace (raptor_namespace *ns) - +1.4.21 void raptor_free_namespaces (raptor_namespace_stack *nstack) 2.0.0 void raptor_free_namespaces (raptor_namespace_stack *nstack) - +1.4.21 void raptor_free_parser (raptor_parser* parser) 2.0.0 void raptor_free_parser (raptor_parser* parser) - +1.4.21 void raptor_free_qname (raptor_qname* name) 2.0.0 void raptor_free_qname (raptor_qname* name) - +1.4.21 void raptor_free_sax2 (raptor_sax2 *sax2) 2.0.0 void raptor_free_sax2 (raptor_sax2 *sax2) - +1.4.21 void raptor_free_sequence (raptor_sequence* seq) 2.0.0 void raptor_free_sequence (raptor_sequence* seq) - +1.4.21 void raptor_free_serializer (raptor_serializer* rdf_serializer) 2.0.0 void raptor_free_serializer (raptor_serializer* rdf_serializer) - +1.4.21 void raptor_free_stringbuffer (raptor_stringbuffer *stringbuffer) 2.0.0 void raptor_free_stringbuffer (raptor_stringbuffer *stringbuffer) - +1.4.21 void raptor_free_uri (raptor_uri *uri) 2.0.0 void raptor_free_uri (raptor_uri *uri) - +1.4.21 void raptor_free_uri_v2 (raptor_world* world, raptor_uri *uri) 2.0.0 void raptor_free_uri (raptor_uri *uri) - +1.4.21 void raptor_free_world (raptor_world* world) 2.0.0 void raptor_free_world (raptor_world* world) - +1.4.21 void raptor_free_xml_element (raptor_xml_element *element) 2.0.0 void raptor_free_xml_element (raptor_xml_element *element) - +1.4.21 void raptor_free_xml_writer (raptor_xml_writer* xml_writer) 2.0.0 void raptor_free_xml_writer (raptor_xml_writer* xml_writer) - +1.4.21 int raptor_get_feature (raptor_parser *parser, raptor_feature feature) 2.0.0 int raptor_parser_get_option (raptor_parser *parser, raptor_option option, char** string_p, int* integer_p) - +1.4.21 unsigned int raptor_get_feature_count (void) 2.0.0 unsigned int raptor_option_get_count (void) - +1.4.21 const char* raptor_get_label (raptor_parser *rdf_parser) 2.0.0 raptor_syntax_description* raptor_parser_get_description (raptor_parser* rdf_parser) Use label field of returned description. +1.4.21 raptor_locator* raptor_get_locator (raptor_parser* rdf_parser) 2.0.0 raptor_locator* raptor_parser_get_locator (raptor_parser* rdf_parser) - +1.4.21 const char* raptor_get_mime_type (raptor_parser *rdf_parser) 2.0.0 raptor_syntax_description* raptor_parser_get_description (raptor_parser* rdf_parser) Use the mime_types array field of returned #raptor_syntax_description +1.4.21 const char* raptor_get_name (raptor_parser *rdf_parser) 2.0.0 const char* raptor_parser_get_name (raptor_parser *rdf_parser) - +1.4.21 int raptor_get_need_base_uri (raptor_parser *rdf_parser) 2.0.0 raptor_syntax_description* raptor_parser_get_description (raptor_parser* rdf_parser) Use the #RAPTOR_SYNTAX_NEED_BASE_URI bitflag in the flags field of the returned #raptor_syntax_description +1.4.21 const char* raptor_guess_parser_name (raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) 2.0.0 const char* raptor_world_guess_parser_name (raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) - +1.4.21 const char* raptor_guess_parser_name_v2 (raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) 2.0.0 const char* raptor_world_guess_parser_name (raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) - +1.4.21 void raptor_init (void) 2.0.0 - - - Use raptor_new_world() to create a new #raptor_world object. +1.4.21 int raptor_iostream_format_hexadecimal (raptor_iostream* iostr, unsigned int integer, int width) 2.0.0 int raptor_iostream_hexadecimal_write (unsigned int integer, int width, raptor_iostream* iostr) - +1.4.21 size_t raptor_iostream_get_bytes_written_count (raptor_iostream *iostr) 2.0.0 - - - Deprecated for raptor_iostream_tell(). +1.4.21 int raptor_iostream_read_bytes (raptor_iostream* iostr, void *ptr, size_t size, size_t nmemb) 2.0.0 int raptor_iostream_read_bytes (void *ptr, size_t size, size_t nmemb, raptor_iostream* iostr) - +1.4.21 int raptor_iostream_read_eof (raptor_iostream *iostr) 2.0.0 int raptor_iostream_read_eof (raptor_iostream *iostr) - +1.4.21 unsigned long raptor_iostream_tell (raptor_iostream *iostr) 2.0.0 unsigned long raptor_iostream_tell (raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_byte (raptor_iostream *iostr, const int byte) 2.0.0 int raptor_iostream_write_byte (const int byte, raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_bytes (raptor_iostream *iostr, const void *ptr, size_t size, size_t nmemb) 2.0.0 int raptor_iostream_write_bytes (const void *ptr, size_t size, size_t nmemb, raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_counted_string (raptor_iostream *iostr, const void *string, size_t len) 2.0.0 int raptor_iostream_counted_string_write (const void *string, size_t len, raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_decimal (raptor_iostream* iostr, int integer) 2.0.0 int raptor_iostream_decimal_write (int integer, raptor_iostream* iostr) - +1.4.21 void raptor_iostream_write_end (raptor_iostream *iostr) 2.0.0 int raptor_iostream_write_end (raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_namespace (raptor_iostream* iostr, raptor_namespace *ns) 2.0.0 int raptor_namespace_write (raptor_namespace *ns, raptor_iostream* iostr) - +1.4.21 int raptor_iostream_write_qname (raptor_iostream* iostr, raptor_qname *qname) 2.0.0 int raptor_qname_write (raptor_qname *qname, raptor_iostream* iostr) - +1.4.21 void raptor_iostream_write_statement_ntriples (raptor_iostream* iostr, const raptor_statement *statement) 2.0.0 int raptor_statement_ntriples_write (const raptor_statement *statement, raptor_iostream* iostr, int write_graph_term) Gains extra flag arg to decide whether to write any graph term. +1.4.21 int raptor_iostream_write_string (raptor_iostream *iostr, const void *string) 2.0.0 int raptor_iostream_string_write (const void *string, raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_string_ntriples (raptor_iostream *iostr, const unsigned char* string, size_t len, const char delim) 2.0.0 int raptor_string_ntriples_write (const unsigned char* string, size_t len, const char delim, raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_string_python (raptor_iostream *iostr, const unsigned char* string, size_t len, const char delim, int flags) 2.0.0 int raptor_string_python_write (const unsigned char* string, size_t len, const char delim, int flags, raptor_iostream *iostr) - +1.4.21 void raptor_iostream_write_string_turtle (raptor_iostream *iostr, const unsigned char* string, size_t len) 2.0.0 - - - Deprecated for raptor_string_python_write(). +1.4.21 int raptor_iostream_write_stringbuffer (raptor_iostream* iostr, raptor_stringbuffer *sb) 2.0.0 int raptor_stringbuffer_write (raptor_stringbuffer *sb, raptor_iostream* iostr) - +1.4.21 int raptor_iostream_write_uri (raptor_iostream *iostr, raptor_uri *uri) 2.0.0 int raptor_uri_write (raptor_uri *uri, raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_uri_v2 (raptor_world* world, raptor_iostream *iostr, raptor_uri *uri) 2.0.0 int raptor_uri_write (raptor_uri *uri, raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_xml_any_escaped_string (raptor_iostream* iostr, const unsigned char* string, size_t len, char quote, int xml_version, raptor_simple_message_handler error_handler, void *error_data) 2.0.0 int raptor_xml_escape_string_any_write (const unsigned char* string, size_t len, char quote, int xml_version, raptor_iostream* iostr) - +1.4.21 int raptor_iostream_write_xml_element (raptor_iostream *iostr, raptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, int is_end, raptor_simple_message_handler error_handler, void *error_data, int depth) 2.0.0 int raptor_xml_element_write (raptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, int is_end, int depth, raptor_iostream *iostr) - +1.4.21 int raptor_iostream_write_xml_escaped_string (raptor_iostream* iostr, const unsigned char* string, size_t len, char quote, raptor_simple_message_handler error_handler, void *error_data) 2.0.0 int raptor_xml_escape_string_write (const unsigned char* string, size_t len, char quote, raptor_iostream* iostr) - +1.4.21 int raptor_locator_byte (raptor_locator *locator) 2.0.0 int raptor_locator_byte (raptor_locator *locator) - +1.4.21 int raptor_locator_column (raptor_locator *locator) 2.0.0 int raptor_locator_column (raptor_locator *locator) - +1.4.21 const char* raptor_locator_file (raptor_locator *locator) 2.0.0 const char* raptor_locator_file (raptor_locator *locator) - +1.4.21 int raptor_locator_line (raptor_locator *locator) 2.0.0 int raptor_locator_line (raptor_locator *locator) - +1.4.21 const char* raptor_locator_uri (raptor_locator *locator) 2.0.0 const char* raptor_locator_uri (raptor_locator *locator) - +1.4.21 const char* raptor_locator_uri_v2 (raptor_world* world, raptor_locator *locator) 2.0.0 const char* raptor_locator_uri (raptor_locator *locator) - +1.4.21 int raptor_namespace_copy (raptor_namespace_stack *nstack, raptor_namespace *ns, int new_depth) 2.0.0 int raptor_namespace_stack_start_namespace (raptor_namespace_stack *nstack, raptor_namespace *ns, int new_depth) - +1.4.21 const unsigned char* raptor_namespace_get_counted_prefix (const raptor_namespace *ns, size_t *length_p) 2.0.0 const unsigned char* raptor_namespace_get_counted_prefix (const raptor_namespace *ns, size_t *length_p) - +1.4.21 const unsigned char* raptor_namespace_get_prefix (const raptor_namespace *ns) 2.0.0 const unsigned char* raptor_namespace_get_prefix (const raptor_namespace *ns) - +1.4.21 raptor_uri* raptor_namespace_get_uri (const raptor_namespace *ns) 2.0.0 raptor_uri* raptor_namespace_get_uri (const raptor_namespace *ns) - +1.4.21 void raptor_namespaces_clear (raptor_namespace_stack *nstack) 2.0.0 void raptor_namespaces_clear (raptor_namespace_stack *nstack) - +1.4.21 void raptor_namespaces_end_for_depth (raptor_namespace_stack *nstack, int depth) 2.0.0 void raptor_namespaces_end_for_depth (raptor_namespace_stack *nstack, int depth) - +1.4.21 raptor_namespace* raptor_namespaces_find_namespace (raptor_namespace_stack *nstack, const unsigned char* prefix, int prefix_length) 2.0.0 raptor_namespace* raptor_namespaces_find_namespace (raptor_namespace_stack *nstack, const unsigned char* prefix, int prefix_length) - +1.4.21 raptor_namespace* raptor_namespaces_find_namespace_by_uri (raptor_namespace_stack *nstack, raptor_uri *ns_uri) 2.0.0 raptor_namespace* raptor_namespaces_find_namespace_by_uri (raptor_namespace_stack *nstack, raptor_uri *ns_uri) - +1.4.21 unsigned char* raptor_namespaces_format (const raptor_namespace *ns, size_t *length_p) 2.0.0 unsigned char* raptor_namespace_format_as_xml (const raptor_namespace *ns, size_t *length_p) - +1.4.21 raptor_namespace* raptor_namespaces_get_default_namespace (raptor_namespace_stack *nstack) 2.0.0 raptor_namespace* raptor_namespaces_get_default_namespace (raptor_namespace_stack *nstack) - +1.4.21 int raptor_namespaces_init (raptor_namespace_stack *nstack, const raptor_uri_handler *uri_handler, void *uri_context, raptor_simple_message_handler error_handler, void *error_data, int defaults) 2.0.0 int raptor_namespaces_init (raptor_world* world, raptor_namespace_stack *nstack, int defaults) - +1.4.21 int raptor_namespaces_init_v2 (raptor_world* world, raptor_namespace_stack *nstack, raptor_simple_message_handler error_handler, void *error_data, int defaults) 2.0.0 int raptor_namespaces_init (raptor_world* world, raptor_namespace_stack *nstack, int defaults) - +1.4.21 int raptor_namespaces_namespace_in_scope (raptor_namespace_stack *nstack, const raptor_namespace *nspace) 2.0.0 int raptor_namespaces_namespace_in_scope (raptor_namespace_stack *nstack, const raptor_namespace *nspace) - +1.4.21 raptor_qname* raptor_namespaces_qname_from_uri (raptor_namespace_stack *nstack, raptor_uri *uri, int xml_version) 2.0.0 raptor_qname* raptor_new_qname_from_namespace_uri (raptor_namespace_stack *nstack, raptor_uri *uri, int xml_version) - +1.4.21 void raptor_namespaces_start_namespace (raptor_namespace_stack *nstack, raptor_namespace *nspace) 2.0.0 void raptor_namespaces_start_namespace (raptor_namespace_stack *nstack, raptor_namespace *nspace) - +1.4.21 int raptor_namespaces_start_namespace_full (raptor_namespace_stack *nstack, const unsigned char* prefix, const unsigned char* ns_uri_string, int depth) 2.0.0 int raptor_namespaces_start_namespace_full (raptor_namespace_stack *nstack, const unsigned char* prefix, const unsigned char* ns_uri_string, int depth) - +1.4.21 raptor_identifier* raptor_new_identifier (raptor_identifier_type type, raptor_uri *uri, raptor_uri_source uri_source, const unsigned char* id, const unsigned char* literal, raptor_uri *literal_datatype, const unsigned char* literal_language) 2.0.0 - - - Replaced by raptor_new_term_from_blank(), raptor_new_term_from_literal() or raptor_new_term_from_blank() and #raptor_term class. +1.4.21 raptor_identifier* raptor_new_identifier_v2 (raptor_world* world, raptor_identifier_type type, raptor_uri *uri, raptor_uri_source uri_source, const unsigned char* id, const unsigned char* literal, raptor_uri *literal_datatype, const unsigned char* literal_language) 2.0.0 - - - Replaced by raptor_new_term_from_blank(), raptor_new_term_from_literal() or raptor_new_term_from_blank() and #raptor_term class. +1.4.21 raptor_iostream* raptor_new_iostream_from_file_handle (FILE *handle) 2.0.0 raptor_iostream* raptor_new_iostream_from_file_handle (raptor_world* world, FILE *handle) - +1.4.21 raptor_iostream* raptor_new_iostream_from_filename (const char* filename) 2.0.0 raptor_iostream* raptor_new_iostream_from_filename (raptor_world* world, const char* filename) - +1.4.21 raptor_iostream* raptor_new_iostream_from_handler (void *context, const raptor_iostream_handler *handler) 2.0.0 raptor_iostream* raptor_new_iostream_from_handler (raptor_world* world, void *user_data, const raptor_iostream_handler* const handler) - +1.4.21 raptor_iostream* raptor_new_iostream_from_handler2 (void *user_data, const raptor_iostream_handler2* const handler2) 2.0.0 raptor_iostream* raptor_new_iostream_from_handler (raptor_world* world, void *user_data, const raptor_iostream_handler* const handler) - +1.4.21 raptor_iostream* raptor_new_iostream_from_sink (void) 2.0.0 raptor_iostream* raptor_new_iostream_from_sink (raptor_world* world) - +1.4.21 raptor_iostream* raptor_new_iostream_from_string (void *string, size_t length) 2.0.0 raptor_iostream* raptor_new_iostream_from_string (raptor_world* world, void *string, size_t length) - +1.4.21 raptor_iostream* raptor_new_iostream_to_file_handle (FILE *handle) 2.0.0 raptor_iostream* raptor_new_iostream_to_file_handle (raptor_world* world, FILE *handle) - +1.4.21 raptor_iostream* raptor_new_iostream_to_filename (const char* filename) 2.0.0 raptor_iostream* raptor_new_iostream_to_filename (raptor_world* world, const char* filename) - +1.4.21 raptor_iostream* raptor_new_iostream_to_sink (void) 2.0.0 raptor_iostream* raptor_new_iostream_to_sink (raptor_world* world) - +1.4.21 raptor_iostream* raptor_new_iostream_to_string (void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)) 2.0.0 raptor_iostream* raptor_new_iostream_to_string (raptor_world* world, void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)) - +1.4.21 raptor_namespace* raptor_new_namespace (raptor_namespace_stack *nstack, const unsigned char* prefix, const unsigned char* ns_uri_string, int depth) 2.0.0 raptor_namespace* raptor_new_namespace (raptor_namespace_stack *nstack, const unsigned char* prefix, const unsigned char* ns_uri_string, int depth) - +1.4.21 raptor_namespace* raptor_new_namespace_from_uri (raptor_namespace_stack *nstack, const unsigned char* prefix, raptor_uri* ns_uri, int depth) 2.0.0 raptor_namespace* raptor_new_namespace_from_uri (raptor_namespace_stack *nstack, const unsigned char* prefix, raptor_uri* ns_uri, int depth) - +1.4.21 int raptor_new_namespace_parts_from_string (const unsigned char* string, unsigned char* *prefix, unsigned char* *uri_string) 2.0.0 int raptor_xml_namespace_string_parse (const unsigned char* string, unsigned char* *prefix, unsigned char* *uri_string) - +1.4.21 raptor_namespace_stack* raptor_new_namespaces (const raptor_uri_handler *uri_handler, void *uri_context, raptor_simple_message_handler error_handler, void *error_data, int defaults) 2.0.0 raptor_namespace_stack* raptor_new_namespaces (raptor_world* world, int defaults) - +1.4.21 raptor_namespace_stack* raptor_new_namespaces_v2 (raptor_world* world, raptor_simple_message_handler error_handler, void *error_data, int defaults) 2.0.0 raptor_namespace_stack* raptor_new_namespaces (raptor_world* world, int defaults) - +1.4.21 raptor_parser* raptor_new_parser (const char* name) 2.0.0 raptor_parser* raptor_new_parser (raptor_world* world, const char* name) - +1.4.21 raptor_parser* raptor_new_parser_for_content (raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) 2.0.0 raptor_parser* raptor_new_parser_for_content (raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) - +1.4.21 raptor_parser* raptor_new_parser_for_content_v2 (raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) 2.0.0 raptor_parser* raptor_new_parser_for_content (raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) - +1.4.21 raptor_parser* raptor_new_parser_v2 (raptor_world* world, const char* name) 2.0.0 raptor_parser* raptor_new_parser (raptor_world* world, const char* name) - +1.4.21 raptor_qname* raptor_new_qname (raptor_namespace_stack *nstack, const unsigned char* name, const unsigned char* value, raptor_simple_message_handler error_handler, void *error_data) 2.0.0 raptor_qname* raptor_new_qname (raptor_namespace_stack *nstack, const unsigned char* name, const unsigned char* value) - +1.4.21 raptor_qname* raptor_new_qname_from_namespace_local_name (raptor_namespace *ns, const unsigned char* local_name, const unsigned char* value) 2.0.0 raptor_qname* raptor_new_qname_from_namespace_local_name (raptor_world* world, raptor_namespace *ns, const unsigned char* local_name, const unsigned char* value) - +1.4.21 raptor_qname* raptor_new_qname_from_namespace_local_name_v2 (raptor_world* world, raptor_namespace *ns, const unsigned char* local_name, const unsigned char* value) 2.0.0 raptor_qname* raptor_new_qname_from_namespace_local_name (raptor_world* world, raptor_namespace *ns, const unsigned char* local_name, const unsigned char* value) - +1.4.21 raptor_sax2* raptor_new_sax2 (void *user_data, raptor_error_handlers* error_handlers) 2.0.0 raptor_sax2* raptor_new_sax2 (raptor_world *world, raptor_locator *locator, void* user_data) - +1.4.21 raptor_sequence* raptor_new_sequence (raptor_sequence_free_handler* free_handler, raptor_sequence_print_handler* print_handler) 2.0.0 raptor_sequence* raptor_new_sequence (raptor_data_free_handler free_handler, raptor_data_print_handler print_handler) - +1.4.21 raptor_sequence* raptor_new_sequence_v2 (raptor_sequence_free_handler_v2* free_handler, raptor_sequence_print_handler_v2* print_handler, void* handler_context) 2.0.0 raptor_sequence* raptor_new_sequence (raptor_data_free_handler free_handler, raptor_data_print_handler print_handler) - +1.4.21 raptor_serializer* raptor_new_serializer (const char* name) 2.0.0 raptor_serializer* raptor_new_serializer (raptor_world* world, const char* name) - +1.4.21 raptor_serializer* raptor_new_serializer_v2 (raptor_world* world, const char* name) 2.0.0 raptor_serializer* raptor_new_serializer (raptor_world* world, const char* name) - +1.4.21 raptor_stringbuffer* raptor_new_stringbuffer (void) 2.0.0 raptor_stringbuffer* raptor_new_stringbuffer (void) - +1.4.21 raptor_uri* raptor_new_uri (const unsigned char* uri_string) 2.0.0 raptor_uri* raptor_new_uri (raptor_world* world, const unsigned char* uri_string) - +1.4.21 raptor_uri* raptor_new_uri_for_rdf_concept (const char* name) 2.0.0 raptor_uri* raptor_new_uri_for_rdf_concept (raptor_world* world, const unsigned char* name) - +1.4.21 raptor_uri* raptor_new_uri_for_rdf_concept_v2 (raptor_world* world, const char* name) 2.0.0 raptor_uri* raptor_new_uri_for_rdf_concept (raptor_world* world, const unsigned char* name) - +1.4.21 raptor_uri* raptor_new_uri_for_retrieval (raptor_uri* old_uri) 2.0.0 raptor_uri* raptor_new_uri_for_retrieval (raptor_uri* old_uri) - +1.4.21 raptor_uri* raptor_new_uri_for_retrieval_v2 (raptor_world* world, raptor_uri* old_uri) 2.0.0 raptor_uri* raptor_new_uri_for_retrieval (raptor_uri* old_uri) - +1.4.21 raptor_uri* raptor_new_uri_for_xmlbase (raptor_uri* old_uri) 2.0.0 raptor_uri* raptor_new_uri_for_xmlbase (raptor_uri* old_uri) - +1.4.21 raptor_uri* raptor_new_uri_for_xmlbase_v2 (raptor_world* world, raptor_uri* old_uri) 2.0.0 raptor_uri* raptor_new_uri_for_xmlbase (raptor_uri* old_uri) - +1.4.21 raptor_uri* raptor_new_uri_from_id (raptor_uri *base_uri, const unsigned char* id) 2.0.0 raptor_uri* raptor_new_uri_from_id (raptor_world* world, raptor_uri *base_uri, const unsigned char* id) - +1.4.21 raptor_uri* raptor_new_uri_from_id_v2 (raptor_world* world, raptor_uri *base_uri, const unsigned char* id) 2.0.0 raptor_uri* raptor_new_uri_from_id (raptor_world* world, raptor_uri *base_uri, const unsigned char* id) - +1.4.21 raptor_uri* raptor_new_uri_from_uri_local_name (raptor_uri *uri, const unsigned char* local_name) 2.0.0 raptor_uri* raptor_new_uri_from_uri_local_name (raptor_world* world, raptor_uri *uri, const unsigned char* local_name) - +1.4.21 raptor_uri* raptor_new_uri_from_uri_local_name_v2 (raptor_world* world, raptor_uri *uri, const unsigned char* local_name) 2.0.0 raptor_uri* raptor_new_uri_from_uri_local_name (raptor_world* world, raptor_uri *uri, const unsigned char* local_name) - +1.4.21 raptor_uri* raptor_new_uri_relative_to_base (raptor_uri *base_uri, const unsigned char* uri_string) 2.0.0 raptor_uri* raptor_new_uri_relative_to_base (raptor_world* world, raptor_uri *base_uri, const unsigned char* uri_string) - +1.4.21 raptor_uri* raptor_new_uri_relative_to_base_v2 (raptor_world* world, raptor_uri *base_uri, const unsigned char* uri_string) 2.0.0 raptor_uri* raptor_new_uri_relative_to_base (raptor_world* world, raptor_uri *base_uri, const unsigned char* uri_string) - +1.4.21 raptor_uri* raptor_new_uri_v2 (raptor_world* world, const unsigned char* uri_string) 2.0.0 raptor_uri* raptor_new_uri (raptor_world* world, const unsigned char* uri_string) - +1.4.21 raptor_world* raptor_new_world (void) 2.0.0 raptor_world* raptor_new_world (void) - +1.4.21 raptor_xml_element* raptor_new_xml_element (raptor_qname* name, const unsigned char* xml_language, raptor_uri* xml_base) 2.0.0 raptor_xml_element* raptor_new_xml_element (raptor_qname* name, const unsigned char* xml_language, raptor_uri* xml_base) - +1.4.21 raptor_xml_element* raptor_new_xml_element_from_namespace_local_name (raptor_namespace *ns, const unsigned char* name, const unsigned char* xml_language, raptor_uri *xml_base) 2.0.0 raptor_xml_element* raptor_new_xml_element_from_namespace_local_name (raptor_namespace *ns, const unsigned char* name, const unsigned char* xml_language, raptor_uri *xml_base) - +1.4.21 raptor_xml_writer* raptor_new_xml_writer (raptor_namespace_stack *nstack, const raptor_uri_handler *uri_handler, void *uri_context, raptor_iostream* iostr, raptor_simple_message_handler error_handler, void *error_data, int canonicalize) 2.0.0 raptor_xml_writer* raptor_new_xml_writer (raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr) - +1.4.21 raptor_xml_writer* raptor_new_xml_writer_v2 (raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr, raptor_simple_message_handler error_handler, void *error_data, int canonicalize) 2.0.0 raptor_xml_writer* raptor_new_xml_writer (raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr) - +1.4.21 unsigned char* raptor_ntriples_string_as_utf8_string (raptor_parser* rdf_parser, const unsigned char* src, int len, size_t *dest_lenp) 2.0.0 - - - Deprecated internal debug function. +1.4.21 const char* raptor_ntriples_term_as_string (raptor_ntriples_term_type term) 2.0.0 - - - Deprecated internal debug function. +1.4.21 void raptor_parse_abort (raptor_parser* rdf_parser) 2.0.0 void raptor_parser_parse_abort (raptor_parser* rdf_parser) - +1.4.21 int raptor_parse_chunk (raptor_parser* rdf_parser, const unsigned char* buffer, size_t len, int is_end) 2.0.0 int raptor_parser_parse_chunk (raptor_parser* rdf_parser, const unsigned char* buffer, size_t len, int is_end) - +1.4.21 int raptor_parse_file (raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri) 2.0.0 int raptor_parser_parse_file (raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri) - +1.4.21 int raptor_parse_file_stream (raptor_parser* rdf_parser, FILE *stream, const char* filename, raptor_uri *base_uri) 2.0.0 int raptor_parser_parse_file_stream (raptor_parser* rdf_parser, FILE *stream, const char* filename, raptor_uri *base_uri) - +1.4.21 int raptor_parse_uri (raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri) 2.0.0 int raptor_parser_parse_uri (raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri) - +1.4.21 int raptor_parse_uri_with_connection (raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri, void *connection) 2.0.0 int raptor_parser_parse_uri_with_connection (raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri, void *connection) - +1.4.21 const char* raptor_parser_get_accept_header (raptor_parser* rdf_parser) 2.0.0 const char* raptor_parser_get_accept_header (raptor_parser* rdf_parser) - +1.4.21 const unsigned char* raptor_parser_get_feature_string (raptor_parser *parser, raptor_feature feature) 2.0.0 const unsigned char* raptor_parser_get_option (raptor_parser *parser, raptor_option option, char** string_p, int* integer_p) - +1.4.21 raptor_world* raptor_parser_get_world (raptor_parser* rdf_parser) 2.0.0 raptor_world* raptor_parser_get_world (raptor_parser* rdf_parser) - +1.4.21 int raptor_parser_set_feature_string (raptor_parser *parser, raptor_feature feature, const unsigned char* value) 2.0.0 int raptor_parser_set_option (raptor_parser *parser, raptor_option option, char* string, int integer) - +1.4.21 void raptor_parser_set_uri_filter (raptor_parser* parser, raptor_uri_filter_func filter, void* user_data) 2.0.0 void raptor_parser_set_uri_filter (raptor_parser* parser, raptor_uri_filter_func filter, void* user_data) - +1.4.21 int raptor_parsers_enumerate (const unsigned int counter, const char* *name, const char* *label) 2.0.0 raptor_syntax_description* raptor_world_get_parser_description (raptor_world* world, unsigned int counter) - +1.4.21 int raptor_parsers_enumerate_v2 (raptor_world* world, const unsigned int counter, const char* *name, const char* *label) 2.0.0 raptor_syntax_description* raptor_world_get_parser_description (raptor_world* world, const unsigned int counter) - +1.4.21 void raptor_print_locator (FILE *stream, raptor_locator* locator) 2.0.0 int raptor_locator_print (raptor_locator* locator, FILE *stream) - +1.4.21 void raptor_print_locator_v2 (raptor_world* world, FILE *stream, raptor_locator* locator) 2.0.0 void raptor_locator_print (raptor_locator* locator, FILE *stream) - +1.4.21 int raptor_print_ntriples_string (FILE *stream, const unsigned char* string, const char delim) 2.0.0 - - - Use raptor_string_ntriples_write() with a #raptor_iostream +1.4.21 void raptor_print_statement (const raptor_statement * statement, FILE *stream) 2.0.0 int raptor_statement_print (const raptor_statement * statement, FILE *stream) - +1.4.21 void raptor_print_statement_as_ntriples (const raptor_statement * statement, FILE *stream) 2.0.0 int raptor_statement_print_as_ntriples (const raptor_statement * statement, FILE *stream) - +1.4.21 void raptor_print_statement_as_ntriples_v2 (const raptor_statement_v2 * statement, FILE *stream) 2.0.0 int raptor_statement_print_as_ntriples (const raptor_statement * statement, FILE *stream) - +1.4.21 void raptor_print_statement_detailed (const raptor_statement * statement, int detailed, FILE *stream) 2.0.0 - - - Deprecated internal function. +1.4.21 void raptor_print_statement_v2 (const raptor_statement_v2 * statement, FILE *stream) 2.0.0 int raptor_statement_print (const raptor_statement * statement, FILE *stream) - +1.4.21 raptor_qname* raptor_qname_copy (raptor_qname *qname) 2.0.0 raptor_qname* raptor_qname_copy (raptor_qname *qname) - +1.4.21 int raptor_qname_equal (raptor_qname *name1, raptor_qname *name2) 2.0.0 int raptor_qname_equal (raptor_qname *name1, raptor_qname *name2) - +1.4.21 const unsigned char* raptor_qname_get_counted_value (raptor_qname* name, size_t* length_p) 2.0.0 const unsigned char* raptor_qname_get_counted_value (raptor_qname* name, size_t* length_p) - +1.4.21 const unsigned char* raptor_qname_get_local_name (raptor_qname* name) 2.0.0 const unsigned char* raptor_qname_get_local_name (raptor_qname* name) - +1.4.21 const raptor_namespace* raptor_qname_get_namespace (raptor_qname* name) 2.0.0 const raptor_namespace* raptor_qname_get_namespace (raptor_qname* name) - +1.4.21 const unsigned char* raptor_qname_get_value (raptor_qname* name) 2.0.0 const unsigned char* raptor_qname_get_value (raptor_qname* name) - +1.4.21 raptor_uri* raptor_qname_string_to_uri (raptor_namespace_stack *nstack, const unsigned char* name, size_t name_len, raptor_simple_message_handler error_handler, void *error_data) 2.0.0 raptor_uri* raptor_qname_string_to_uri (raptor_namespace_stack *nstack, const unsigned char* name, size_t name_len) - +1.4.21 unsigned char* raptor_qname_to_counted_name (raptor_qname *qname, size_t* length_p) 2.0.0 unsigned char* raptor_qname_to_counted_name (raptor_qname *qname, size_t* length_p) - +1.4.21 raptor_uri* raptor_sax2_inscope_base_uri (raptor_sax2* sax2) 2.0.0 raptor_uri* raptor_sax2_inscope_base_uri (raptor_sax2* sax2) - +1.4.21 const unsigned char* raptor_sax2_inscope_xml_language (raptor_sax2* sax2) 2.0.0 const unsigned char* raptor_sax2_inscope_xml_language (raptor_sax2* sax2) - +1.4.21 int raptor_sax2_parse_chunk (raptor_sax2* sax2, const unsigned char* buffer, size_t len, int is_end) 2.0.0 int raptor_sax2_parse_chunk (raptor_sax2* sax2, const unsigned char* buffer, size_t len, int is_end) - +1.4.21 void raptor_sax2_parse_start (raptor_sax2 *sax2, raptor_uri *base_uri) 2.0.0 void raptor_sax2_parse_start (raptor_sax2 *sax2, raptor_uri *base_uri) - +1.4.21 void raptor_sax2_set_cdata_handler (raptor_sax2* sax2, raptor_sax2_cdata_handler handler) 2.0.0 void raptor_sax2_set_cdata_handler (raptor_sax2* sax2, raptor_sax2_cdata_handler handler) - +1.4.21 void raptor_sax2_set_characters_handler (raptor_sax2* sax2, raptor_sax2_characters_handler handler) 2.0.0 void raptor_sax2_set_characters_handler (raptor_sax2* sax2, raptor_sax2_characters_handler handler) - +1.4.21 void raptor_sax2_set_comment_handler (raptor_sax2* sax2, raptor_sax2_comment_handler handler) 2.0.0 void raptor_sax2_set_comment_handler (raptor_sax2* sax2, raptor_sax2_comment_handler handler) - +1.4.21 void raptor_sax2_set_end_element_handler (raptor_sax2* sax2, raptor_sax2_end_element_handler handler) 2.0.0 void raptor_sax2_set_end_element_handler (raptor_sax2* sax2, raptor_sax2_end_element_handler handler) - +1.4.21 void raptor_sax2_set_external_entity_ref_handler (raptor_sax2* sax2, raptor_sax2_external_entity_ref_handler handler) 2.0.0 void raptor_sax2_set_external_entity_ref_handler (raptor_sax2* sax2, raptor_sax2_external_entity_ref_handler handler) - +1.4.21 void raptor_sax2_set_namespace_handler (raptor_sax2* sax2, raptor_namespace_handler handler) 2.0.0 void raptor_sax2_set_namespace_handler (raptor_sax2* sax2, raptor_namespace_handler handler) - +1.4.21 void raptor_sax2_set_start_element_handler (raptor_sax2* sax2, raptor_sax2_start_element_handler handler) 2.0.0 void raptor_sax2_set_start_element_handler (raptor_sax2* sax2, raptor_sax2_start_element_handler handler) - +1.4.21 void raptor_sax2_set_unparsed_entity_decl_handler (raptor_sax2* sax2, raptor_sax2_unparsed_entity_decl_handler handler) 2.0.0 void raptor_sax2_set_unparsed_entity_decl_handler (raptor_sax2* sax2, raptor_sax2_unparsed_entity_decl_handler handler) - +1.4.21 void* raptor_sequence_delete_at (raptor_sequence* seq, int idx) 2.0.0 void* raptor_sequence_delete_at (raptor_sequence* seq, int idx) - +1.4.21 void* raptor_sequence_get_at (raptor_sequence* seq, int idx) 2.0.0 void* raptor_sequence_get_at (raptor_sequence* seq, int idx) - +1.4.21 int raptor_sequence_join (raptor_sequence* dest, raptor_sequence *src) 2.0.0 int raptor_sequence_join (raptor_sequence* dest, raptor_sequence *src) - +1.4.21 void* raptor_sequence_pop (raptor_sequence* seq) 2.0.0 void* raptor_sequence_pop (raptor_sequence* seq) - +1.4.21 void raptor_sequence_print (raptor_sequence* seq, FILE* fh) 2.0.0 int raptor_sequence_print (raptor_sequence* seq, FILE* fh) - +1.4.21 void raptor_sequence_print_string (char* data, FILE *fh) 2.0.0 - - - Trivial utility function removed. +1.4.21 void raptor_sequence_print_uri (char* data, FILE *fh) 2.0.0 - - - Deprecated for raptor_uri_print() +1.4.21 int raptor_sequence_push (raptor_sequence* seq, void *data) 2.0.0 int raptor_sequence_push (raptor_sequence* seq, void *data) - +1.4.21 int raptor_sequence_set_at (raptor_sequence* seq, int idx, void *data) 2.0.0 int raptor_sequence_set_at (raptor_sequence* seq, int idx, void *data) - +1.4.21 void raptor_sequence_set_print_handler (raptor_sequence *seq, raptor_sequence_print_handler *print_handler) 2.0.0 - - - Use the argument in the raptor_new_sequence() constructor instead. +1.4.21 void raptor_sequence_set_print_handler_v2 (raptor_sequence *seq, raptor_sequence_print_handler_v2 *print_handler) 2.0.0 - - - Use the argument in the raptor_new_sequence() constructor instead. +1.4.21 int raptor_sequence_shift (raptor_sequence* seq, void *data) 2.0.0 int raptor_sequence_shift (raptor_sequence* seq, void *data) - +1.4.21 int raptor_sequence_size (raptor_sequence* seq) 2.0.0 int raptor_sequence_size (raptor_sequence* seq) - +1.4.21 void raptor_sequence_sort (raptor_sequence* seq, int(*compare)(const void *, const void *)) 2.0.0 void raptor_sequence_sort (raptor_sequence* seq, raptor_data_compare_handler compare) - +1.4.21 void* raptor_sequence_unshift (raptor_sequence* seq) 2.0.0 void* raptor_sequence_unshift (raptor_sequence* seq) - +1.4.21 int raptor_serialize_end (raptor_serializer *rdf_serializer) 2.0.0 int raptor_serializer_serialize_end (raptor_serializer *rdf_serializer) - +1.4.21 int raptor_serialize_set_namespace (raptor_serializer* rdf_serializer, raptor_uri *uri, const unsigned char* prefix) 2.0.0 int raptor_serializer_set_namespace (raptor_serializer* rdf_serializer, raptor_uri *uri, const unsigned char* prefix) - +1.4.21 int raptor_serialize_set_namespace_from_namespace (raptor_serializer* rdf_serializer, raptor_namespace *nspace) 2.0.0 int raptor_serializer_set_namespace_from_namespace (raptor_serializer* rdf_serializer, raptor_namespace *nspace) - +1.4.21 int raptor_serialize_start (raptor_serializer *rdf_serializer, raptor_uri *uri, raptor_iostream *iostream) 2.0.0 int raptor_serializer_start_to_iostream (raptor_serializer *rdf_serializer, raptor_uri *uri, raptor_iostream *iostream) - +1.4.21 int raptor_serialize_start_to_file_handle (raptor_serializer *rdf_serializer, raptor_uri *uri, FILE *fh) 2.0.0 int raptor_serializer_start_to_file_handle (raptor_serializer *rdf_serializer, raptor_uri *uri, FILE *fh) - +1.4.21 int raptor_serialize_start_to_filename (raptor_serializer *rdf_serializer, const char* filename) 2.0.0 int raptor_serializer_start_to_filename (raptor_serializer *rdf_serializer, const char* filename) - +1.4.21 int raptor_serialize_start_to_iostream (raptor_serializer *rdf_serializer, raptor_uri *uri, raptor_iostream *iostream) 2.0.0 int raptor_serializer_start_to_iostream (raptor_serializer *rdf_serializer, raptor_uri *uri, raptor_iostream *iostream) - +1.4.21 int raptor_serialize_start_to_string (raptor_serializer *rdf_serializer, raptor_uri *uri, void **string_p, size_t *length_p) 2.0.0 int raptor_serializer_start_to_string (raptor_serializer *rdf_serializer, raptor_uri *uri, void **string_p, size_t *length_p) - +1.4.21 int raptor_serialize_statement (raptor_serializer* rdf_serializer, const raptor_statement *statement) 2.0.0 int raptor_serializer_serialize_statement (raptor_serializer* rdf_serializer, raptor_statement *statement) - +1.4.21 int raptor_serializer_features_enumerate (const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) 2.0.0 raptor_option_description* raptor_world_get_option_description (raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_SERIALIZER +1.4.21 int raptor_serializer_features_enumerate_v2 (raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) 2.0.0 raptor_option_description* raptor_world_get_option_description (raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_SERIALIZER +1.4.21 int raptor_serializer_get_feature (raptor_serializer *serializer, raptor_feature feature) 2.0.0 int raptor_serializer_get_option (raptor_serializer *serializer, raptor_option option) - +1.4.21 const unsigned char* raptor_serializer_get_feature_string (raptor_serializer *serializer, raptor_feature feature) 2.0.0 int raptor_serializer_get_option (raptor_serializer *serializer, raptor_option option, char** string_p, int* integer_p) - +1.4.21 raptor_iostream* raptor_serializer_get_iostream (raptor_serializer *serializer) 2.0.0 raptor_iostream* raptor_serializer_get_iostream (raptor_serializer *serializer) - +1.4.21 raptor_locator* raptor_serializer_get_locator (raptor_serializer *rdf_serializer) 2.0.0 raptor_locator* raptor_serializer_get_locator (raptor_serializer *rdf_serializer) - +1.4.21 raptor_world* raptor_serializer_get_world (raptor_serializer* rdf_serializer) 2.0.0 raptor_world* raptor_serializer_get_world (raptor_serializer* rdf_serializer) - +1.4.21 void raptor_serializer_set_error_handler (raptor_serializer* serializer, void *user_data, raptor_message_handler handler) 2.0.0 - - - Replaced by raptor_world_set_log_handler() on the #raptor_world object. +1.4.21 int raptor_serializer_set_feature (raptor_serializer *serializer, raptor_feature feature, int value) 2.0.0 int raptor_serializer_set_option (raptor_serializer *serializer, raptor_option option, char* string, int integer) - +1.4.21 int raptor_serializer_set_feature_string (raptor_serializer *serializer, raptor_feature feature, const unsigned char* value) 2.0.0 int raptor_serializer_set_option (raptor_serializer *serializer, raptor_option option, char* string, int integer) - +1.4.21 void raptor_serializer_set_warning_handler (raptor_serializer* serializer, void *user_data, raptor_message_handler handler) 2.0.0 - - - Replaced by raptor_world_set_log_handler() on the #raptor_world object. +1.4.21 int raptor_serializer_syntax_name_check (const char* name) 2.0.0 int raptor_world_is_serializer_name (raptor_world* world, const char* name) - +1.4.21 int raptor_serializer_syntax_name_check_v2 (raptor_world* world, const char* name) 2.0.0 int raptor_world_is_serializer_name (raptor_world* world, const char* name) - +1.4.21 int raptor_serializers_enumerate (const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) 2.0.0 const raptor_syntax_description* raptor_world_get_serializer_description (raptor_world* world, unsigned int counter) - +1.4.21 int raptor_serializers_enumerate_v2 (raptor_world* world, const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) 2.0.0 const raptor_syntax_description* raptor_world_get_serializer_description (raptor_world* world, const unsigned int counter) - +1.4.21 void raptor_set_default_generate_id_parameters (raptor_parser* rdf_parser, char* prefix, int base) 2.0.0 void raptor_world_set_generate_bnodeid_parameters (raptor_world* world, char* prefix, int base) - +1.4.21 void raptor_set_error_handler (raptor_parser* parser, void *user_data, raptor_message_handler handler) 2.0.0 - - - Replaced by raptor_world_set_log_handler() on the #raptor_world object. +1.4.21 void raptor_set_fatal_error_handler (raptor_parser* parser, void *user_data, raptor_message_handler handler) 2.0.0 - - - Replaced by raptor_world_set_log_handler() on the #raptor_world object. +1.4.21 int raptor_set_feature (raptor_parser *parser, raptor_feature feature, int value) 2.0.0 int raptor_parser_set_option (raptor_parser *parser, raptor_option option, char* string, int integer) - +1.4.21 void raptor_set_generate_id_handler (raptor_parser* parser, void *user_data, raptor_generate_id_handler handler) 2.0.0 void raptor_world_set_generate_bnodeid_handler (raptor_world* world, void *user_data, raptor_generate_bnodeid_handler handler) - +1.4.21 void raptor_set_graph_handler (raptor_parser* parser, void *user_data, raptor_graph_handler handler) 2.0.0 void raptor_parser_set_graph_mark_handler (raptor_parser* parser, void *user_data, raptor_graph_mark_handler handler) - +1.4.21 void raptor_set_libxslt_security_preferences (void *security_preferences) 2.0.0 int raptor_world_set_libxslt_security_preferences (raptor_world *world, void *security_preferences) - +1.4.21 void raptor_set_namespace_handler (raptor_parser* parser, void *user_data, raptor_namespace_handler handler) 2.0.0 void raptor_parser_set_namespace_handler (raptor_parser* parser, void *user_data, raptor_namespace_handler handler) - +1.4.21 void raptor_set_parser_strict (raptor_parser* rdf_parser, int is_strict) 2.0.0 - - - Replaced by raptor_parser_set_option() with option RAPTOR_OPTION_STRICT +1.4.21 void raptor_set_statement_handler (raptor_parser* parser, void *user_data, raptor_statement_handler handler) 2.0.0 void raptor_parser_set_statement_handler (raptor_parser* parser, void *user_data, raptor_statement_handler handler) - +1.4.21 void raptor_set_warning_handler (raptor_parser* parser, void *user_data, raptor_message_handler handler) 2.0.0 - - - Replaced by raptor_world_set_log_handler() on the #raptor_world object. +1.4.21 int raptor_start_parse (raptor_parser *rdf_parser, raptor_uri *uri) 2.0.0 int raptor_parser_parse_start (raptor_parser *rdf_parser, raptor_uri *uri) - +1.4.21 int raptor_statement_compare (const raptor_statement *s1, const raptor_statement *s2) 2.0.0 int raptor_statement_compare (const raptor_statement *s1, const raptor_statement *s2) - +1.4.21 int raptor_statement_compare_v2 (const raptor_statement_v2 *s1, const raptor_statement_v2 *s2) 2.0.0 int raptor_statement_compare (const raptor_statement *s1, const raptor_statement *s2) - +1.4.21 unsigned char* raptor_statement_part_as_counted_string (const void *term, raptor_identifier_type type, raptor_uri* literal_datatype, const unsigned char* literal_language, size_t* len_p) 2.0.0 - - - Better done via methods of #raptor_term class such as raptor_term_to_counted_string(). +1.4.21 unsigned char* raptor_statement_part_as_counted_string_v2 (raptor_world* world, const void *term, raptor_identifier_type type, raptor_uri* literal_datatype, const unsigned char* literal_language, size_t* len_p) 2.0.0 - - - Better done via methods of #raptor_term class such as raptor_term_to_counted_string(). +1.4.21 unsigned char* raptor_statement_part_as_string () 2.0.0 - - - Better done via methods of #raptor_term class such as raptor_term_to_string(). +1.4.21 unsigned char* raptor_statement_part_as_string_v2 () 2.0.0 - - - Better done via methods of #raptor_term class such as raptor_term_to_string(). +1.4.21 int raptor_stringbuffer_append_counted_string (raptor_stringbuffer* stringbuffer, const unsigned char* string, size_t length, int do_copy) 2.0.0 int raptor_stringbuffer_append_counted_string (raptor_stringbuffer* stringbuffer, const unsigned char* string, size_t length, int do_copy) - +1.4.21 int raptor_stringbuffer_append_decimal (raptor_stringbuffer* stringbuffer, int integer) 2.0.0 int raptor_stringbuffer_append_decimal (raptor_stringbuffer* stringbuffer, int integer) - +1.4.21 int raptor_stringbuffer_append_string (raptor_stringbuffer* stringbuffer, const unsigned char* string, int do_copy) 2.0.0 int raptor_stringbuffer_append_string (raptor_stringbuffer* stringbuffer, const unsigned char* string, int do_copy) - +1.4.21 int raptor_stringbuffer_append_stringbuffer (raptor_stringbuffer* stringbuffer, raptor_stringbuffer* append) 2.0.0 int raptor_stringbuffer_append_stringbuffer (raptor_stringbuffer* stringbuffer, raptor_stringbuffer* append) - +1.4.21 unsigned char* raptor_stringbuffer_as_string (raptor_stringbuffer* stringbuffer) 2.0.0 unsigned char* raptor_stringbuffer_as_string (raptor_stringbuffer* stringbuffer) - +1.4.21 int raptor_stringbuffer_copy_to_string (raptor_stringbuffer* stringbuffer, unsigned char* string, size_t length) 2.0.0 int raptor_stringbuffer_copy_to_string (raptor_stringbuffer* stringbuffer, unsigned char* string, size_t length) - +1.4.21 size_t raptor_stringbuffer_length (raptor_stringbuffer* stringbuffer) 2.0.0 size_t raptor_stringbuffer_length (raptor_stringbuffer* stringbuffer) - +1.4.21 int raptor_stringbuffer_prepend_counted_string (raptor_stringbuffer* stringbuffer, const unsigned char* string, size_t length, int do_copy) 2.0.0 int raptor_stringbuffer_prepend_counted_string (raptor_stringbuffer* stringbuffer, const unsigned char* string, size_t length, int do_copy) - +1.4.21 int raptor_stringbuffer_prepend_string (raptor_stringbuffer* stringbuffer, const unsigned char* string, int do_copy) 2.0.0 int raptor_stringbuffer_prepend_string (raptor_stringbuffer* stringbuffer, const unsigned char* string, int do_copy) - +1.4.21 int raptor_syntax_name_check (const char* name) 2.0.0 int raptor_world_is_parser_name (raptor_world* world, const char *name) - +1.4.21 int raptor_syntax_name_check_v2 (raptor_world* world, const char* name) 2.0.0 int raptor_world_is_parser_name (raptor_world* world, const char *name) - +1.4.21 int raptor_syntaxes_enumerate (const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) 2.0.0 raptor_syntax_description* raptor_world_get_parser_description (raptor_world* world, const unsigned int counter) - +1.4.21 int raptor_syntaxes_enumerate_v2 (raptor_world* world, const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) 2.0.0 raptor_syntax_description* raptor_world_get_parser_description (raptor_world* world, const unsigned int counter) - +1.4.21 int raptor_unicode_char_to_utf8 (raptor_unichar c, unsigned char* output) 2.0.0 int raptor_unicode_utf8_string_put_char (raptor_unichar c, unsigned char* output, size_t length) - +1.4.21 int raptor_unicode_is_xml10_namechar (raptor_unichar c) 2.0.0 int raptor_unicode_is_xml10_namechar (raptor_unichar c) - +1.4.21 int raptor_unicode_is_xml10_namestartchar (raptor_unichar c) 2.0.0 int raptor_unicode_is_xml10_namestartchar (raptor_unichar c) - +1.4.21 int raptor_unicode_is_xml11_namechar (raptor_unichar c) 2.0.0 int raptor_unicode_is_xml11_namechar (raptor_unichar c) - +1.4.21 int raptor_unicode_is_xml11_namestartchar (raptor_unichar c) 2.0.0 int raptor_unicode_is_xml11_namestartchar (raptor_unichar c) - +1.4.21 unsigned char* raptor_uri_as_counted_string (raptor_uri *uri, size_t* len_p) 2.0.0 unsigned char* raptor_uri_as_counted_string (raptor_uri *uri, size_t* len_p) - +1.4.21 unsigned char* raptor_uri_as_counted_string_v2 (raptor_world* world, raptor_uri *uri, size_t* len_p) 2.0.0 unsigned char* raptor_uri_as_counted_string (raptor_uri *uri, size_t* len_p) - +1.4.21 unsigned char* raptor_uri_as_string (raptor_uri *uri) 2.0.0 unsigned char* raptor_uri_as_string (raptor_uri *uri) - +1.4.21 unsigned char* raptor_uri_as_string_v2 (raptor_world* world, raptor_uri *uri) 2.0.0 unsigned char* raptor_uri_as_string (raptor_uri *uri) - +1.4.21 int raptor_uri_compare (raptor_uri* uri1, raptor_uri* uri2) 2.0.0 int raptor_uri_compare (raptor_uri* uri1, raptor_uri* uri2) - +1.4.21 int raptor_uri_compare_v2 (raptor_world* world, raptor_uri* uri1, raptor_uri* uri2) 2.0.0 int raptor_uri_compare (raptor_uri* uri1, raptor_uri* uri2) - +1.4.21 raptor_uri* raptor_uri_copy (raptor_uri *uri) 2.0.0 raptor_uri* raptor_uri_copy (raptor_uri *uri) - +1.4.21 raptor_uri* raptor_uri_copy_v2 (raptor_world* world, raptor_uri *uri) 2.0.0 raptor_uri* raptor_uri_copy (raptor_uri *uri) - +1.4.21 int raptor_uri_equals (raptor_uri* uri1, raptor_uri* uri2) 2.0.0 int raptor_uri_equals (raptor_uri* uri1, raptor_uri* uri2) - +1.4.21 int raptor_uri_equals_v2 (raptor_world* world, raptor_uri* uri1, raptor_uri* uri2) 2.0.0 int raptor_uri_equals (raptor_uri* uri1, raptor_uri* uri2) - +1.4.21 unsigned char* raptor_uri_filename_to_uri_string (const char* filename) 2.0.0 unsigned char* raptor_uri_filename_to_uri_string (const char* filename) - +1.4.21 void raptor_uri_get_handler (const raptor_uri_handler **handler, void **context) 2.0.0 - - - Entire URI implementation is internal and not replaceable. +1.4.21 void raptor_uri_get_handler_v2 (raptor_world* world, const raptor_uri_handler **handler, void **context) 2.0.0 - - - Entire URI implementation is internal and not replaceable. +1.4.21 int raptor_uri_is_file_uri (const unsigned char* uri_string) 2.0.0 int raptor_uri_uri_string_is_file_uri (const unsigned char* uri_string) - +1.4.21 void raptor_uri_print (const raptor_uri* uri, FILE *stream) 2.0.0 int raptor_uri_print (const raptor_uri* uri, FILE *stream) - +1.4.21 void raptor_uri_print_v2 (raptor_world* world, const raptor_uri* uri, FILE *stream) 2.0.0 int raptor_uri_print (const raptor_uri* uri, FILE *stream) - +1.4.21 void raptor_uri_resolve_uri_reference (const unsigned char* base_uri, const unsigned char* reference_uri, unsigned char* buffer, size_t length) 2.0.0 size_t raptor_uri_resolve_uri_reference (const unsigned char* base_uri, const unsigned char* reference_uri, unsigned char* buffer, size_t length) - +1.4.21 void raptor_uri_set_handler (const raptor_uri_handler *handler, void *context) 2.0.0 - - - Entire URI implementation is internal and not replaceable. +1.4.21 void raptor_uri_set_handler_v2 (raptor_world* world, const raptor_uri_handler *handler, void *context) 2.0.0 - - - Entire URI implementation is internal and not replaceable. +1.4.21 unsigned char* raptor_uri_to_counted_string (raptor_uri *uri, size_t *len_p) 2.0.0 unsigned char* raptor_uri_to_counted_string (raptor_uri *uri, size_t *len_p) - +1.4.21 unsigned char* raptor_uri_to_counted_string_v2 (raptor_world* world, raptor_uri *uri, size_t *len_p) 2.0.0 unsigned char* raptor_uri_to_counted_string (raptor_uri *uri, size_t *len_p) - +1.4.21 unsigned char* raptor_uri_to_relative_counted_uri_string (raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p) 2.0.0 unsigned char* raptor_uri_to_relative_counted_uri_string (raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p) - +1.4.21 unsigned char* raptor_uri_to_relative_counted_uri_string_v2 (raptor_world* world, raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p) 2.0.0 unsigned char* raptor_uri_to_relative_counted_uri_string (raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p) - +1.4.21 unsigned char* raptor_uri_to_relative_uri_string (raptor_uri *base_uri, raptor_uri *reference_uri) 2.0.0 unsigned char* raptor_uri_to_relative_uri_string (raptor_uri *base_uri, raptor_uri *reference_uri) - +1.4.21 unsigned char* raptor_uri_to_relative_uri_string_v2 (raptor_world* world, raptor_uri *base_uri, raptor_uri *reference_uri) 2.0.0 unsigned char* raptor_uri_to_relative_uri_string (raptor_uri *base_uri, raptor_uri *reference_uri) - +1.4.21 unsigned char* raptor_uri_to_string (raptor_uri *uri) 2.0.0 unsigned char* raptor_uri_to_string (raptor_uri *uri) - +1.4.21 unsigned char* raptor_uri_to_string_v2 (raptor_world* world, raptor_uri *uri) 2.0.0 unsigned char* raptor_uri_to_string (raptor_uri *uri) - +1.4.21 int raptor_uri_uri_string_is_file_uri (const unsigned char* uri_string) 2.0.0 int raptor_uri_uri_string_is_file_uri (const unsigned char* uri_string) - +1.4.21 char* raptor_uri_uri_string_to_filename (const unsigned char* uri_string) 2.0.0 char* raptor_uri_uri_string_to_filename (const unsigned char* uri_string) - +1.4.21 char* raptor_uri_uri_string_to_filename_fragment (const unsigned char* uri_string, unsigned char* *fragment_p) 2.0.0 char* raptor_uri_uri_string_to_filename_fragment (const unsigned char* uri_string, unsigned char* *fragment_p) - +1.4.21 int raptor_utf8_check (const unsigned char* string, size_t length) 2.0.0 int raptor_unicode_check_utf8_string (const unsigned char* string, size_t length) - +1.4.21 int raptor_utf8_to_unicode_char (raptor_unichar* output, const unsigned char* input, int length) 2.0.0 int raptor_unicode_utf8_string_get_char (const unsigned char* input, size_t length, raptor_unichar* output) - +1.4.21 char* raptor_vsnprintf (const char* message, va_list arguments) 2.0.0 char* raptor_vsnprintf (const char* message, va_list arguments) - +1.4.21 int raptor_world_open (raptor_world* world) 2.0.0 int raptor_world_open (raptor_world* world) - +1.4.21 void raptor_world_set_libxml_flags (raptor_world *world, int flags) 2.0.0 int raptor_world_set_flag (raptor_world *world, raptor_world_flag flag, int value) - +1.4.21 void raptor_world_set_libxslt_security_preferences (raptor_world *world, void *security_preferences) 2.0.0 int raptor_world_set_libxslt_security_preferences (raptor_world *world, void *security_preferences) - +1.4.21 void raptor_www_abort (raptor_www *www, const char* reason) 2.0.0 void raptor_www_abort (raptor_www *www, const char* reason) - +1.4.21 int raptor_www_fetch (raptor_www *www, raptor_uri *uri) 2.0.0 int raptor_www_fetch (raptor_www *www, raptor_uri *uri) - +1.4.21 int raptor_www_fetch_to_string (raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)) 2.0.0 int raptor_www_fetch_to_string (raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, raptor_data_malloc_handler const malloc_handler) - +1.4.21 void raptor_www_finish (void) 2.0.0 - - - No need for this to be public. +1.4.21 void raptor_www_finish_v2 (raptor_world* world) 2.0.0 - - - No need for this to be public. +1.4.21 void raptor_www_free (raptor_www *www) 2.0.0 void raptor_free_www (raptor_www *www) - +1.4.21 void* raptor_www_get_connection (raptor_www *www) 2.0.0 void* raptor_www_get_connection (raptor_www *www) - +1.4.21 raptor_uri* raptor_www_get_final_uri (raptor_www* www) 2.0.0 raptor_uri* raptor_www_get_final_uri (raptor_www* www) - +1.4.21 void raptor_www_init (void) 2.0.0 - - - No need for this to be public. +1.4.21 int raptor_www_init_v2 (raptor_world* world) 2.0.0 - - - No need for this to be public. +1.4.21 raptor_www* raptor_www_new (void) 2.0.0 raptor_www* raptor_new_www (raptor_world* world) - +1.4.21 raptor_www* raptor_www_new_v2 (raptor_world* world) 2.0.0 raptor_www* raptor_new_www (raptor_world* world) - +1.4.21 raptor_www* raptor_www_new_with_connection (void* connection) 2.0.0 raptor_www* raptor_new_www_with_connection (raptor_world* world, void* connection) - +1.4.21 raptor_www* raptor_www_new_with_connection_v2 (raptor_world* world, void* connection) 2.0.0 raptor_www* raptor_new_www_with_connection (raptor_world* world, void* connection) - +1.4.21 void raptor_www_no_www_library_init_finish (void) 2.0.0 - - - Deprecated for raptor_world_set_flag(). +1.4.21 void raptor_www_no_www_library_init_finish_v2 (raptor_world* world) 2.0.0 - - - Deprecated for raptor_world_set_flag(). +1.4.21 void raptor_www_set_connection_timeout (raptor_www* www, int timeout) 2.0.0 void raptor_www_set_connection_timeout (raptor_www* www, int timeout) - +1.4.21 void raptor_www_set_content_type_handler (raptor_www *www, raptor_www_content_type_handler handler, void *user_data) 2.0.0 void raptor_www_set_content_type_handler (raptor_www *www, raptor_www_content_type_handler handler, void *user_data) - +1.4.21 void raptor_www_set_error_handler (raptor_www *www, raptor_message_handler error_handler, void *error_data) 2.0.0 - - - Replaced by raptor_world_set_log_handler() on the #raptor_world object. +1.4.21 void raptor_www_set_final_uri_handler (raptor_www* www, raptor_www_final_uri_handler handler, void *user_data) 2.0.0 void raptor_www_set_final_uri_handler (raptor_www* www, raptor_www_final_uri_handler handler, void *user_data) - +1.4.21 void raptor_www_set_http_accept (raptor_www *www, const char* value) 2.0.0 void raptor_www_set_http_accept (raptor_www *www, const char* value) - +1.4.21 int raptor_www_set_http_cache_control (raptor_www* www, const char* cache_control) 2.0.0 int raptor_www_set_http_cache_control (raptor_www* www, const char* cache_control) - +1.4.21 void raptor_www_set_proxy (raptor_www *www, const char* proxy) 2.0.0 void raptor_www_set_proxy (raptor_www *www, const char* proxy) - +1.4.21 void raptor_www_set_uri_filter (raptor_www* www, raptor_uri_filter_func filter, void* user_data) 2.0.0 void raptor_www_set_uri_filter (raptor_www* www, raptor_uri_filter_func filter, void* user_data) - +1.4.21 void raptor_www_set_user_agent (raptor_www *www, const char* user_agent) 2.0.0 void raptor_www_set_user_agent (raptor_www *www, const char* user_agent) - +1.4.21 void raptor_www_set_write_bytes_handler (raptor_www *www, raptor_www_write_bytes_handler handler, void *user_data) 2.0.0 void raptor_www_set_write_bytes_handler (raptor_www *www, raptor_www_write_bytes_handler handler, void *user_data) - +1.4.21 int raptor_xml_any_escape_string (const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, int xml_version, raptor_simple_message_handler error_handler, void *error_data) 2.0.0 int raptor_xml_escape_string_any (raptor_world* world, const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, int xml_version) - +1.4.21 int raptor_xml_element_declare_namespace (raptor_xml_element* xml_element, raptor_namespace *nspace) 2.0.0 int raptor_xml_element_declare_namespace (raptor_xml_element* xml_element, raptor_namespace *nspace) - +1.4.21 raptor_qname** raptor_xml_element_get_attributes (raptor_xml_element* xml_element) 2.0.0 raptor_qname** raptor_xml_element_get_attributes (raptor_xml_element* xml_element) - +1.4.21 int raptor_xml_element_get_attributes_count (raptor_xml_element* xml_element) 2.0.0 int raptor_xml_element_get_attributes_count (raptor_xml_element* xml_element) - +1.4.21 const unsigned char* raptor_xml_element_get_language (raptor_xml_element* xml_element) 2.0.0 const unsigned char* raptor_xml_element_get_language (raptor_xml_element* xml_element) - +1.4.21 raptor_qname* raptor_xml_element_get_name (raptor_xml_element *xml_element) 2.0.0 raptor_qname* raptor_xml_element_get_name (raptor_xml_element *xml_element) - +1.4.21 int raptor_xml_element_is_empty (raptor_xml_element* xml_element) 2.0.0 int raptor_xml_element_is_empty (raptor_xml_element* xml_element) - +1.4.21 void raptor_xml_element_set_attributes (raptor_xml_element* xml_element, raptor_qname **attributes, int count) 2.0.0 void raptor_xml_element_set_attributes (raptor_xml_element* xml_element, raptor_qname **attributes, int count) - +1.4.21 int raptor_xml_escape_string (const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, raptor_simple_message_handler error_handler, void *error_data) 2.0.0 int raptor_xml_escape_string (raptor_world *world, const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote) - +1.4.21 int raptor_xml_name_check (const unsigned char* string, size_t length, int xml_version) 2.0.0 int raptor_xml_name_check (const unsigned char* string, size_t length, int xml_version) - +1.4.21 void raptor_xml_writer_cdata (raptor_xml_writer* xml_writer, const unsigned char* s) 2.0.0 void raptor_xml_writer_cdata (raptor_xml_writer* xml_writer, const unsigned char* s) - +1.4.21 void raptor_xml_writer_cdata_counted (raptor_xml_writer* xml_writer, const unsigned char* s, unsigned int len) 2.0.0 void raptor_xml_writer_cdata_counted (raptor_xml_writer* xml_writer, const unsigned char* s, unsigned int len) - +1.4.21 void raptor_xml_writer_comment (raptor_xml_writer* xml_writer, const unsigned char* s) 2.0.0 void raptor_xml_writer_comment (raptor_xml_writer* xml_writer, const unsigned char* s) - +1.4.21 void raptor_xml_writer_comment_counted (raptor_xml_writer* xml_writer, const unsigned char* s, unsigned int len) 2.0.0 void raptor_xml_writer_comment_counted (raptor_xml_writer* xml_writer, const unsigned char* s, unsigned int len) - +1.4.21 void raptor_xml_writer_empty_element (raptor_xml_writer* xml_writer, raptor_xml_element *element) 2.0.0 void raptor_xml_writer_empty_element (raptor_xml_writer* xml_writer, raptor_xml_element *element) - +1.4.21 void raptor_xml_writer_end_element (raptor_xml_writer* xml_writer, raptor_xml_element *element) 2.0.0 void raptor_xml_writer_end_element (raptor_xml_writer* xml_writer, raptor_xml_element *element) - +1.4.21 int raptor_xml_writer_features_enumerate (const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) 2.0.0 raptor_option_description* raptor_world_get_option_description (raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_XML_WRITER +1.4.21 int raptor_xml_writer_features_enumerate_v2 (raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) 2.0.0 raptor_option_description* raptor_world_get_option_description (raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_XML_WRITER +1.4.21 void raptor_xml_writer_flush (raptor_xml_writer* xml_writer) 2.0.0 void raptor_xml_writer_flush (raptor_xml_writer* xml_writer) - +1.4.21 int raptor_xml_writer_get_depth (raptor_xml_writer *xml_writer) 2.0.0 int raptor_xml_writer_get_depth (raptor_xml_writer *xml_writer) - +1.4.21 int raptor_xml_writer_get_feature (raptor_xml_writer *xml_writer, raptor_feature feature) 2.0.0 int raptor_xml_writer_get_option (raptor_xml_writer *xml_writer, raptor_option option, char** string_p, int* integer_p) - +1.4.21 const unsigned char* raptor_xml_writer_get_feature_string (raptor_xml_writer *xml_writer, raptor_feature feature) 2.0.0 const unsigned char* raptor_xml_writer_get_option (raptor_xml_writer *xml_writer, raptor_option option, char** string_p, int* integer_p) - +1.4.21 void raptor_xml_writer_newline (raptor_xml_writer* xml_writer) 2.0.0 void raptor_xml_writer_newline (raptor_xml_writer* xml_writer) - +1.4.21 void raptor_xml_writer_raw (raptor_xml_writer* xml_writer, const unsigned char* s) 2.0.0 void raptor_xml_writer_raw (raptor_xml_writer* xml_writer, const unsigned char* s) - +1.4.21 void raptor_xml_writer_raw_counted (raptor_xml_writer* xml_writer, const unsigned char* s, unsigned int len) 2.0.0 void raptor_xml_writer_raw_counted (raptor_xml_writer* xml_writer, const unsigned char* s, unsigned int len) - +1.4.21 int raptor_xml_writer_set_feature (raptor_xml_writer *xml_writer, raptor_feature feature, int value) 2.0.0 int raptor_xml_writer_set_option (raptor_xml_writer *xml_writer, raptor_option option, char* string, int integer) - +1.4.21 int raptor_xml_writer_set_feature_string (raptor_xml_writer *xml_writer, raptor_feature feature, const unsigned char* value) 2.0.0 int raptor_xml_writer_set_option (raptor_xml_writer *xml_writer, raptor_option option, char* string, int integer) - +1.4.21 void raptor_xml_writer_start_element (raptor_xml_writer* xml_writer, raptor_xml_element *element) 2.0.0 void raptor_xml_writer_start_element (raptor_xml_writer* xml_writer, raptor_xml_element *element) - +1.4.21 - - - 2.0.0 int raptor_avltree_add (raptor_avltree* tree, void* p_data) - +1.4.21 - - - 2.0.0 int raptor_avltree_delete (raptor_avltree* tree, void* p_data) - +1.4.21 - - - 2.0.0 void* raptor_avltree_iterator_get (raptor_avltree_iterator* iterator) - +1.4.21 - - - 2.0.0 int raptor_avltree_iterator_is_end (raptor_avltree_iterator* iterator) - +1.4.21 - - - 2.0.0 int raptor_avltree_iterator_next (raptor_avltree_iterator* iterator) - +1.4.21 - - - 2.0.0 int raptor_avltree_print (raptor_avltree* tree, FILE* stream) - +1.4.21 - - - 2.0.0 void* raptor_avltree_remove (raptor_avltree* tree, void* p_data) - +1.4.21 - - - 2.0.0 void* raptor_avltree_search (raptor_avltree* tree, const void* p_data) - +1.4.21 - - - 2.0.0 void raptor_avltree_set_print_handler (raptor_avltree* tree, raptor_data_print_handler print_handler) - +1.4.21 - - - 2.0.0 int raptor_avltree_size (raptor_avltree* tree) - +1.4.21 - - - 2.0.0 int raptor_avltree_visit (raptor_avltree* tree, raptor_avltree_visit_handler visit_handler, void* user_data) - +1.4.21 - - - 2.0.0 const char* raptor_domain_get_label (raptor_domain domain) - +1.4.21 - - - 2.0.0 void raptor_free_avltree (raptor_avltree* tree) - +1.4.21 - - - 2.0.0 void raptor_free_avltree_iterator (raptor_avltree_iterator* iterator) - +1.4.21 - - - 2.0.0 void raptor_free_option_description (raptor_option_description* option_description) - +1.4.21 - - - 2.0.0 void raptor_free_statement (raptor_statement *statement) - +1.4.21 - - - 2.0.0 void raptor_free_term (raptor_term *term) - +1.4.21 - - - 2.0.0 const char* raptor_log_level_get_label (raptor_log_level level) - +1.4.21 - - - 2.0.0 raptor_avltree* raptor_new_avltree (raptor_data_compare_handler compare_handler, raptor_data_free_handler free_handler, unsigned int flags) - +1.4.21 - - - 2.0.0 raptor_avltree_iterator* raptor_new_avltree_iterator (raptor_avltree* tree, void* range, raptor_data_free_handler range_free_handler, int direction) - +1.4.21 - - - 2.0.0 raptor_sequence* raptor_new_sequence_with_context (raptor_data_context_free_handler* free_handler, raptor_data_context_print_handler* print_handler, void* handler_context) - +1.4.21 - - - 2.0.0 raptor_term* raptor_new_term_from_blank (raptor_world* world, const unsigned char* blank) - +1.4.21 - - - 2.0.0 raptor_term* raptor_new_term_from_counted_blank (raptor_world* world, const unsigned char* blank, size_t length) - +1.4.21 - - - 2.0.0 raptor_term* raptor_new_term_from_literal (raptor_world* world, const unsigned char* literal, raptor_uri* datatype, const unsigned char* language) - +1.4.21 - - - 2.0.0 raptor_term* raptor_new_term_from_counted_literal (raptor_world* world, const unsigned char* literal, size_t literal_len, raptor_uri* datatype, const unsigned char* language, unsigned char language_len) - +1.4.21 - - - 2.0.0 raptor_term* raptor_new_term_from_uri (raptor_world* world, raptor_uri* uri) - +1.4.21 - - - 2.0.0 raptor_uri* raptor_new_uri_from_counted_string (raptor_world* world, const unsigned char* uri_string, size_t length) - +1.4.21 - - - 2.0.0 const char* raptor_option_get_value_type_label (const raptor_option_value_type type) - +1.4.21 - - - 2.0.0 raptor_uri* raptor_parser_get_graph (raptor_parser* rdf_parser) - +1.4.21 - - - 2.0.0 int raptor_parser_parse_iostream (raptor_parser* rdf_parser, raptor_iostream *iostr, raptor_uri *base_uri) - +1.4.21 - - - 2.0.0 unsigned char* raptor_world_generate_bnodeid (raptor_world *world) - +1.4.21 - - - 2.0.0 int raptor_serializer_flush (raptor_serializer *rdf_serializer) - +1.4.21 - - - 2.0.0 raptor_syntax_description* raptor_serializer_get_description (raptor_serializer* rdf_serializer) - +1.4.21 - - - 2.0.0 raptor_statement* raptor_new_statement (raptor_world *world) - +1.4.21 - - - 2.0.0 raptor_statement* raptor_new_statement_from_nodes (raptor_world* world, raptor_term *subject, raptor_term *predicate, raptor_term *object, raptor_term *graph) - +1.4.21 - - - 2.0.0 void raptor_statement_init (raptor_statement *statement, raptor_world *world) - +1.4.21 - - - 2.0.0 void raptor_statement_clear (raptor_statement *statement) - +1.4.21 - - - 2.0.0 raptor_statement* raptor_statement_copy (raptor_statement *statement) - +1.4.21 - - - 2.0.0 int raptor_statement_equals (const raptor_statement* s1, const raptor_statement* s2) - +1.4.21 - - - 2.0.0 unsigned char* raptor_term_to_counted_string (raptor_term *term, size_t* len_p) - +1.4.21 - - - 2.0.0 unsigned char* raptor_term_to_string (raptor_term *term) - +1.4.21 - - - 2.0.0 int raptor_term_compare (const raptor_term *t1, const raptor_term *t2) - +1.4.21 - - - 2.0.0 raptor_term* raptor_term_copy (raptor_term* term) - +1.4.21 - - - 2.0.0 int raptor_term_equals (raptor_term* term1, raptor_term* term2) - +1.4.21 - - - 2.0.0 int raptor_term_ntriples_write (const raptor_term *term, raptor_iostream* iostr) - +1.4.21 - - - 2.0.0 raptor_world* raptor_uri_get_world (raptor_uri *uri) - +1.4.21 - - - 2.0.0 raptor_option_description* raptor_world_get_option_description (raptor_world* world, const raptor_domain domain, const raptor_option option) - +1.4.21 - - - 2.0.0 int raptor_world_is_parser_name (raptor_world* world, const char* name) - +1.4.21 - - - 2.0.0 int raptor_world_set_log_handler (raptor_world *world, void *user_data, raptor_log_handler handler) - +1.4.21 - - - 2.0.0 int raptor_syntax_description_validate (raptor_syntax_description* desc) - +2.0.3 - - - 2.0.4 int raptor_bnodeid_ntriples_write (const unsigned char *bnodeid, size_t len, raptor_iostream *iostr) - +2.0.3 - - - 2.0.4 int raptor_www_set_ssl_cert_options (raptor_www* www, const char* cert_filename, const char* cert_type, const char* cert_passphrase) - +2.0.4 - - - 2.0.5 int raptor_unicode_utf8_strlen (const unsigned char *string, size_t length) - +2.0.4 - - - 2.0.5 size_t raptor_unicode_utf8_substr (unsigned char* dest, size_t* dest_length_p, const unsigned char* src, size_t src_length, int startingLoc, int length) - +2.0.4 - - - 2.0.5 int raptor_vsnprintf2 (char *buffer, size_t size, const char *format, va_list arguments) Deprecates raptor_vsnprintf() +2.0.4 - - - 2.0.5 int raptor_snprintf (char *buffer, size_t size, const char *format, ...) - +2.0.4 - - - 2.0.5 int raptor_vasprintf (char **ret, const char *format, va_list arguments) - +2.0.5 - - - 2.0.6 int raptor_sequence_swap (raptor_sequence* seq, int i, int j) - +2.0.5 - - - 2.0.6 int raptor_sequence_reverse (raptor_sequence* seq, int start_index, int length) - +2.0.5 - - - 2.0.6 int raptor_sequence_next_permutation (raptor_sequence *seq, raptor_data_compare_handler compare) - +2.0.6 - - - 2.0.7 char* raptor_uri_uri_string_to_counted_filename_fragment (const unsigned char *uri_string, size_t* len_p, unsigned char **fragment_p, size_t* fragment_len_p) - +2.0.6 - - - 2.0.7 int raptor_uri_file_exists (raptor_uri* uri) - +2.0.6 - - - 2.0.7 int raptor_uri_filename_exists (const unsigned char* path) - +2.0.6 - - - 2.0.7 raptor_uri* raptor_new_uri_from_uri_or_file_string (raptor_world* world, raptor_uri* base_uri, const unsigned char* uri_or_file_string) - +2.0.6 - - - 2.0.7 void raptor_sax2_set_uri_filter (raptor_sax2* sax2, raptor_uri_filter_func filter, void *user_data) - +2.0.6 - - - 2.0.7 int raptor_www_set_ssl_verify_options (raptor_www* www, int verify_peer, int verify_host) - +2.0.7 - - - 2.0.8 int raptor_uri_turtle_write (raptor_world *world, raptor_iostream* iostr, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri) - +2.0.7 - - - 2.0.8 int raptor_term_turtle_write (raptor_iostream* iostr, raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri) - +2.0.7 - - - 2.0.8 unsigned char* raptor_uri_to_turtle_counted_string (raptor_world *world, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri, size_t *len_p) - +2.0.7 - - - 2.0.8 unsigned char* raptor_uri_to_turtle_string (raptor_world *world, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri) - +2.0.7 - - - 2.0.8 unsigned char* raptor_term_to_turtle_counted_string (raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri, size_t *len_p) - +2.0.7 - - - 2.0.8 unsigned char* raptor_term_to_turtle_string (raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri) - +2.0.7 - - - 2.0.8 raptor_uri* raptor_new_uri_relative_to_base_counted (raptor_world* world, raptor_uri *base_uri, const unsigned char *uri_string, size_t uri_len) - +2.0.9 - - - 2.0.10 int raptor_string_escaped_write (const unsigned char *string, size_t len, const char delim, unsigned int flags, raptor_iostream *iostr) - +2.0.9 - - - 2.0.10 int raptor_term_escaped_write (const raptor_term *term, unsigned int flags, raptor_iostream* iostr) - +2.0.9 - - - 2.0.10 int raptor_uri_escaped_write (raptor_uri* uri, raptor_uri* base_uri, unsigned int flags, raptor_iostream *iostr) - +2.0.10 - - - 2.0.11 int raptor_uri_uri_string_is_absolute (const unsigned char* uri_string) - +2.0.10 - - - 2.0.11 unsigned char* raptor_qname_format_as_xml (const raptor_qname *qname, size_t *length_p) - +2.0.11 - - - 2.0.12 raptor_term* raptor_new_term_from_counted_string (raptor_world* world, unsigned char* string, size_t length) - +2.0.13 - - - 2.0.14 unsigned char* raptor_uri_counted_filename_to_uri_string (const char *filename, size_t filename_len) - +2.0.14 - - - 2.0.15 void raptor_sort_r (void *base, size_t nel, size_t width, raptor_data_compare_arg_handler compar, void *user_data) - +2.0.14 - - - 2.0.15 void raptor_sequence_sort_r (raptor_sequence* seq, raptor_data_compare_arg_handler compare, void* user_data) Uses raptor_sort_r() internally. +2.0.14 - - - 2.0.15 int raptor_world_get_parsers_count (raptor_world* world) - +2.0.14 - - - 2.0.15 int raptor_world_get_serializers_count (raptor_world* world) - +2.0.15 - - - 2.0.16 int raptor_www_set_user_agent2 (raptor_www *www, const char *user_agent, size_t user_agent_len) - +2.0.15 - - - 2.0.16 int raptor_www_set_proxy2 (raptor_www *www, const char *proxy, size_t proxy_len) - +2.0.15 - - - 2.0.16 int raptor_www_set_http_accept2 (raptor_www *www, const char *value, size_t value_len) - +2.0.15 void raptor_www_set_user_agent (raptor_www *www, const char *user_agent) 2.0.16 - - - Deprecated for raptor_www_set_user_agent2 +2.0.15 void raptor_www_set_proxy (raptor_www *www, const char *proxy) 2.0.16 - - - Deprecated for raptor_www_set_proxy2 +2.0.15 void raptor_www_set_http_accept (raptor_www *www, const char *value) 2.0.16 - - - Deprecated for raptor_www_set_http_accept2 +2.0.15 - - - 2.0.16 void raptor_avltree_trim (raptor_avltree* tree) - +# +# Types +# +1.4.21 type raptor_error_handlers - 2.0.0 type - - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() +1.4.21 type raptor_feature - 2.0.0 type raptor_option - And new option RAPTOR_OPTION_STRICT added. +1.4.21 type raptor_free_uri_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_graph_handler - 2.0.0 type raptor_graph_mark_handler - - +1.4.21 type raptor_identifier - 2.0.0 type raptor_term - Fields changed to be simpler #raptor_term_type and #raptor_term_value +1.4.21 type raptor_identifier_type - 2.0.0 type raptor_term_type - Removed several enum values to leave just URI, blank and literal types. +1.4.21 type raptor_iostream_handler2 - 2.0.0 type raptor_iostream_handler - - +1.4.21 type raptor_iostream_write_end_func - 2.0.0 type raptor_iostream_write_end_func - handler returns an int +1.4.21 type raptor_libxml_flags - 2.0.0 type - - replaced by raptor_world_set_flags() with #raptor_world_flag +1.4.21 type raptor_log_level - 2.0.0 type raptor_log_level - Added RAPTOR_LOG_LEVEL_TRACE, RAPTOR_LOG_LEVEL_DEBUG, RAPTOR_LOG_LEVEL_INFO. RAPTOR_LOG_LEVEL_WARNING renamed RAPTOR_LOG_LEVEL_WARN +1.4.21 type raptor_message_handler - 2.0.0 type - - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() +1.4.21 type raptor_message_handler_closure - 2.0.0 type - - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() +1.4.21 type raptor_new_uri_for_rdf_concept_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_new_uri_from_uri_local_name_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_new_uri_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_new_uri_relative_to_base_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_ntriples_parser - 2.0.0 type - - replaced by #raptor_parser +1.4.21 type raptor_ntriples_term_type - 2.0.0 type - - replaced by #raptor_term_type +1.4.21 type raptor_sequence_free_function - 2.0.0 type raptor_data_free_handler - - +1.4.21 type raptor_sequence_free_handler_v2 - 2.0.0 type raptor_data_context_free_handler - - +1.4.21 type raptor_sequence_print_handler - 2.0.0 type raptor_data_print_handler - - +1.4.21 type raptor_sequence_print_handler_v2 - 2.0.0 type raptor_data_context_print_handler - - +1.4.21 type raptor_simple_message_handler - 2.0.0 type raptor_log_handler - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() +1.4.21 type raptor_statement - 2.0.0 type raptor_statement - fields changed to use #raptor_term +1.4.21 type raptor_statement_handler - 2.0.0 type raptor_statement_handler - added const +1.4.21 type raptor_statement_v2 - 2.0.0 type raptor_statement - Fields changed to be a 3 or 4 tuple of #raptor_term +1.4.21 type raptor_uri_as_counted_string_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_uri_as_string_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_uri_compare_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_uri_copy_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_uri_equals_func - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_uri_handler - 2.0.0 type - - Entire URI implementation is internal and not replaceable. +1.4.21 type raptor_uri_source - 2.0.0 type - - URI source was useless. +1.4.21 type - - 2.0.0 type raptor_avltree - - +1.4.21 type - - 2.0.0 type raptor_avltree_bitflags - - +1.4.21 type - - 2.0.0 type raptor_avltree_iterator - - +1.4.21 type - - 2.0.0 type raptor_avltree_visit_handler - - +1.4.21 type - - 2.0.0 type raptor_data_compare_handler - - +1.4.21 type - - 2.0.0 type raptor_data_context_free_handler - - +1.4.21 type - - 2.0.0 type raptor_data_malloc_handler - - +1.4.21 type - - 2.0.0 type raptor_domain - - +1.4.21 type - - 2.0.0 type raptor_graph_mark_flags - - +1.4.21 type - - 2.0.0 type raptor_log_message - - +1.4.21 type - - 2.0.0 type raptor_option_description - - +1.4.21 type - - 2.0.0 type raptor_option_value_type - - +1.4.21 type - - 2.0.0 type raptor_syntax_bitflags - - +1.4.21 type - - 2.0.0 type raptor_syntax_description - - +1.4.21 type - - 2.0.0 type raptor_term_blank_value - - +1.4.21 type - - 2.0.0 type raptor_term_literal_value - - +1.4.21 type - - 2.0.0 type raptor_term_value - - +1.4.21 type - - 2.0.0 type raptor_type_q - - +2.0.9 type - - 2.0.10 type raptor_escaped_write_bitflags - - +2.0.14 type - - 2.0.15 type raptor_data_compare_arg_handler - Used by raptor_sort_r() +# +# Enums and constants +# +1.4.21 enum RAPTOR_IDENTIFIER_TYPE_UNKNOWN - 2.0.0 enum RAPTOR_TERM_TYPE_UNKNOWN - - +1.4.21 enum RAPTOR_IDENTIFIER_TYPE_RESOURCE - 2.0.0 enum RAPTOR_TERM_TYPE_URI - - +1.4.21 enum RAPTOR_IDENTIFIER_TYPE_ANONYMOUS - 2.0.0 enum RAPTOR_TERM_TYPE_BLANK - - +1.4.21 enum RAPTOR_IDENTIFIER_TYPE_PREDICATE - 2.0.0 enum RAPTOR_TERM_TYPE_URI - - +1.4.21 enum RAPTOR_IDENTIFIER_TYPE_ORDINAL - 2.0.0 enum - - Deprecated value deleted. +1.4.21 enum RAPTOR_IDENTIFIER_TYPE_LITERAL - 2.0.0 enum RAPTOR_TERM_TYPE_LITERAL - - +1.4.21 enum RAPTOR_IDENTIFIER_TYPE_XML_LITERAL - 2.0.0 enum RAPTOR_TERM_TYPE_LITERAL - - +1.4.21 enum RAPTOR_URI_SOURCE_UNKNOWN - 2.0.0 enum - - URI source concept removed. +1.4.21 enum RAPTOR_URI_SOURCE_NOT_URI - 2.0.0 enum - - URI source concept removed. +1.4.21 enum RAPTOR_URI_SOURCE_ELEMENT - 2.0.0 enum - - URI source concept removed. +1.4.21 enum RAPTOR_URI_SOURCE_ATTRIBUTE - 2.0.0 enum - - URI source concept removed. +1.4.21 enum RAPTOR_URI_SOURCE_ID - 2.0.0 enum - - URI source concept removed. +1.4.21 enum RAPTOR_URI_SOURCE_URI - 2.0.0 enum - - URI source concept removed. +1.4.21 enum RAPTOR_URI_SOURCE_GENERATED - 2.0.0 enum - - URI source concept removed. +1.4.21 enum RAPTOR_URI_SOURCE_BLANK_ID - 2.0.0 enum - - URI source concept removed. +1.4.21 enum RAPTOR_NTRIPLES_TERM_TYPE_URI_REF - 2.0.0 enum RAPTOR_TERM_TYPE_URI - - +1.4.21 enum RAPTOR_NTRIPLES_TERM_TYPE_BLANK_NODE - 2.0.0 enum RAPTOR_TERM_TYPE_BLANK - - +1.4.21 enum RAPTOR_NTRIPLES_TERM_TYPE_LITERAL - 2.0.0 enum RAPTOR_TERM_TYPE_LITERAL - - +1.4.21 enum RAPTOR_FEATURE_SCANNING - 2.0.0 enum RAPTOR_OPTION_SCANNING - - +1.4.21 enum RAPTOR_FEATURE_ASSUME_IS_RDF - 2.0.0 enum - - Never used. +1.4.21 enum RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES - 2.0.0 enum RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES - - +1.4.21 enum RAPTOR_FEATURE_ALLOW_OTHER_PARSETYPES - 2.0.0 enum RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES - - +1.4.21 enum RAPTOR_FEATURE_ALLOW_BAGID - 2.0.0 enum RAPTOR_OPTION_ALLOW_BAGID - - +1.4.21 enum RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST - 2.0.0 enum RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST - - +1.4.21 enum RAPTOR_FEATURE_NORMALIZE_LANGUAGE - 2.0.0 enum RAPTOR_OPTION_NORMALIZE_LANGUAGE - - +1.4.21 enum RAPTOR_FEATURE_NON_NFC_FATAL - 2.0.0 enum RAPTOR_OPTION_NON_NFC_FATAL - - +1.4.21 enum RAPTOR_FEATURE_WARN_OTHER_PARSETYPES - 2.0.0 enum RAPTOR_OPTION_WARN_OTHER_PARSETYPES - - +1.4.21 enum RAPTOR_FEATURE_CHECK_RDF_ID - 2.0.0 enum RAPTOR_OPTION_CHECK_RDF_ID - - +1.4.21 enum RAPTOR_FEATURE_RELATIVE_URIS - 2.0.0 enum RAPTOR_OPTION_RELATIVE_URIS - - +1.4.21 enum RAPTOR_FEATURE_START_URI - 2.0.0 enum - - Never used. +1.4.21 enum RAPTOR_FEATURE_WRITER_AUTO_INDENT - 2.0.0 enum RAPTOR_OPTION_WRITER_AUTO_INDENT - - +1.4.21 enum RAPTOR_FEATURE_WRITER_AUTO_EMPTY - 2.0.0 enum RAPTOR_OPTION_WRITER_AUTO_EMPTY - - +1.4.21 enum RAPTOR_FEATURE_WRITER_INDENT_WIDTH - 2.0.0 enum RAPTOR_OPTION_WRITER_INDENT_WIDTH - - +1.4.21 enum RAPTOR_FEATURE_WRITER_XML_VERSION - 2.0.0 enum RAPTOR_OPTION_WRITER_XML_VERSION - - +1.4.21 enum RAPTOR_FEATURE_WRITER_XML_DECLARATION - 2.0.0 enum RAPTOR_OPTION_WRITER_XML_DECLARATION - - +1.4.21 enum RAPTOR_FEATURE_NO_NET - 2.0.0 enum RAPTOR_OPTION_NO_NET - - +1.4.21 enum RAPTOR_FEATURE_RESOURCE_BORDER - 2.0.0 enum RAPTOR_OPTION_RESOURCE_BORDER - - +1.4.21 enum RAPTOR_FEATURE_LITERAL_BORDER - 2.0.0 enum RAPTOR_OPTION_LITERAL_BORDER - - +1.4.21 enum RAPTOR_FEATURE_BNODE_BORDER - 2.0.0 enum RAPTOR_OPTION_BNODE_BORDER - - +1.4.21 enum RAPTOR_FEATURE_RESOURCE_FILL - 2.0.0 enum RAPTOR_OPTION_RESOURCE_FILL - - +1.4.21 enum RAPTOR_FEATURE_LITERAL_FILL - 2.0.0 enum RAPTOR_OPTION_LITERAL_FILL - - +1.4.21 enum RAPTOR_FEATURE_BNODE_FILL - 2.0.0 enum RAPTOR_OPTION_BNODE_FILL - - +1.4.21 enum RAPTOR_FEATURE_HTML_TAG_SOUP - 2.0.0 enum RAPTOR_OPTION_HTML_TAG_SOUP - - +1.4.21 enum RAPTOR_FEATURE_MICROFORMATS - 2.0.0 enum RAPTOR_OPTION_MICROFORMATS - - +1.4.21 enum RAPTOR_FEATURE_HTML_LINK - 2.0.0 enum RAPTOR_OPTION_HTML_LINK - - +1.4.21 enum RAPTOR_FEATURE_WWW_TIMEOUT - 2.0.0 enum RAPTOR_OPTION_WWW_TIMEOUT - - +1.4.21 enum RAPTOR_FEATURE_WRITE_BASE_URI - 2.0.0 enum RAPTOR_OPTION_WRITE_BASE_URI - - +1.4.21 enum RAPTOR_FEATURE_WWW_HTTP_CACHE_CONTROL - 2.0.0 enum RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL - - +1.4.21 enum RAPTOR_FEATURE_WWW_HTTP_USER_AGENT - 2.0.0 enum RAPTOR_OPTION_WWW_HTTP_USER_AGENT - - +1.4.21 enum RAPTOR_FEATURE_JSON_CALLBACK - 2.0.0 enum RAPTOR_OPTION_JSON_CALLBACK - - +1.4.21 enum RAPTOR_FEATURE_JSON_EXTRA_DATA - 2.0.0 enum RAPTOR_OPTION_JSON_EXTRA_DATA - - +1.4.21 enum RAPTOR_FEATURE_RSS_TRIPLES - 2.0.0 enum RAPTOR_OPTION_RSS_TRIPLES - - +1.4.21 enum RAPTOR_FEATURE_ATOM_ENTRY_URI - 2.0.0 enum RAPTOR_OPTION_ATOM_ENTRY_URI - - +1.4.21 enum RAPTOR_FEATURE_PREFIX_ELEMENTS - 2.0.0 enum RAPTOR_OPTION_PREFIX_ELEMENTS - - +1.4.21 enum RAPTOR_FEATURE_LAST - 2.0.0 enum RAPTOR_OPTION_LAST - - +1.4.21 enum RAPTOR_GENID_TYPE_BNODEID - 2.0.0 enum - - There is just one type of generated ID now. +1.4.21 enum RAPTOR_GENID_TYPE_BAGID - 2.0.0 enum - - There is just one type of generated ID now. +1.4.21 enum RAPTOR_LOG_LEVEL_NONE - 2.0.0 enum RAPTOR_LOG_LEVEL_NONE - - +1.4.21 enum - - 2.0.0 enum RAPTOR_LOG_LEVEL_TRACE - - +1.4.21 enum - - 2.0.0 enum RAPTOR_LOG_LEVEL_DEBUG - - +1.4.21 enum - - 2.0.0 enum RAPTOR_LOG_LEVEL_INFO - - +1.4.21 enum RAPTOR_LOG_LEVEL_WARNING - 2.0.0 enum RAPTOR_LOG_LEVEL_WARN - - +1.4.21 enum RAPTOR_LOG_LEVEL_ERROR - 2.0.0 enum RAPTOR_LOG_LEVEL_ERROR - - +1.4.21 enum RAPTOR_LOG_LEVEL_FATAL - 2.0.0 enum RAPTOR_LOG_LEVEL_FATAL - - +1.4.21 enum RAPTOR_LOG_LEVEL_LAST - 2.0.0 enum RAPTOR_LOG_LEVEL_LAST - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_NONE - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_IOSTREAM - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_NAMESPACE - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_PARSER - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_QNAME - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_SAX2 - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_SERIALIZER - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_TERM - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_TURTLE_WRITER - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_URI - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_WORLD - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_WWW - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_XML_WRITER - - +1.4.21 enum - - 2.0.0 enum RAPTOR_DOMAIN_LAST - - +1.4.21 enum - - 2.0.0 enum RAPTOR_GRAPH_MARK_START - - +1.4.21 enum - - 2.0.0 enum RAPTOR_GRAPH_MARK_DECLARED - - +1.4.21 enum RAPTOR_LIBXML_FLAGS_GENERIC_ERROR_SAVE - 2.0.0 enum RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE - Flag setting is done by raptor_world_set_flags() +1.4.21 enum RAPTOR_LIBXML_FLAGS_STRUCTURED_ERROR_SAVE - 2.0.0 enum RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE - Flag setting is done by raptor_world_set_flags() +1.4.21 enum - - 2.0.0 enum RAPTOR_WORLD_FLAG_URI_INTERNING - - +1.4.21 enum - - 2.0.0 enum RAPTOR_WORLD_FLAG_WWW_SKIP_INIT_FINISH - - +1.4.21 enum - - 2.0.0 enum RAPTOR_OPTION_VALUE_TYPE_BOOL - - +1.4.21 enum - - 2.0.0 enum RAPTOR_OPTION_VALUE_TYPE_INT - - +1.4.21 enum - - 2.0.0 enum RAPTOR_OPTION_VALUE_TYPE_STRING - - +1.4.21 enum - - 2.0.0 enum RAPTOR_OPTION_VALUE_TYPE_URI - - +1.4.21 enum - - 2.0.0 enum RAPTOR_OPTION_VALUE_TYPE_LAST - - +2.0.6 enum - - 2.0.7 enum RAPTOR_OPTION_NO_FILE - - +2.0.6 enum - - 2.0.7 enum RAPTOR_OPTION_WWW_SSL_VERIFY_PEER - - +2.0.6 enum - - 2.0.7 enum RAPTOR_OPTION_WWW_SSL_VERIFY_HOST - - +2.0.6 enum - - 2.0.7 enum RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES - - +2.0.15 enum - - 2.0.16 enum raptor_rdf_schema_namespace_uri_len - - diff --git a/docs/raptor-changes.xml b/docs/raptor-changes.xml new file mode 100644 index 0000000..68f6245 --- /dev/null +++ b/docs/raptor-changes.xml @@ -0,0 +1,1159 @@ + + +API Changes + +This chapter describes the API changes for raptor2. + +
+Introduction + + +The following sections describe the changes in the API between +versions including additions, deletions, renames (retaining the same +number of parameters, types and return value type) and more complex +changes to functions, types, enums and constants. + + +
+
+Changes between raptor2 1.4.21 and 2.0.0 + +
+New functions, types, enums and constants + + + Functions + int raptor_avltree_add(raptor_avltree* tree, void* p_data) + int raptor_avltree_delete(raptor_avltree* tree, void* p_data) + void* raptor_avltree_iterator_get(raptor_avltree_iterator* iterator) + int raptor_avltree_iterator_is_end(raptor_avltree_iterator* iterator) + int raptor_avltree_iterator_next(raptor_avltree_iterator* iterator) + int raptor_avltree_print(raptor_avltree* tree, FILE* stream) + void* raptor_avltree_remove(raptor_avltree* tree, void* p_data) + void* raptor_avltree_search(raptor_avltree* tree, const void* p_data) + void raptor_avltree_set_print_handler(raptor_avltree* tree, raptor_data_print_handler print_handler) + int raptor_avltree_size(raptor_avltree* tree) + int raptor_avltree_visit(raptor_avltree* tree, raptor_avltree_visit_handler visit_handler, void* user_data) + const char* raptor_domain_get_label(raptor_domain domain) + void raptor_free_avltree(raptor_avltree* tree) + void raptor_free_avltree_iterator(raptor_avltree_iterator* iterator) + void raptor_free_option_description(raptor_option_description* option_description) + void raptor_free_statement(raptor_statement *statement) + void raptor_free_term(raptor_term *term) + const char* raptor_log_level_get_label(raptor_log_level level) + raptor_avltree* raptor_new_avltree(raptor_data_compare_handler compare_handler, raptor_data_free_handler free_handler, unsigned int flags) + raptor_avltree_iterator* raptor_new_avltree_iterator(raptor_avltree* tree, void* range, raptor_data_free_handler range_free_handler, int direction) + raptor_sequence* raptor_new_sequence_with_context(raptor_data_context_free_handler* free_handler, raptor_data_context_print_handler* print_handler, void* handler_context) + raptor_statement* raptor_new_statement(raptor_world *world) + raptor_statement* raptor_new_statement_from_nodes(raptor_world* world, raptor_term *subject, raptor_term *predicate, raptor_term *object, raptor_term *graph) + raptor_term* raptor_new_term_from_blank(raptor_world* world, const unsigned char* blank) + raptor_term* raptor_new_term_from_counted_blank(raptor_world* world, const unsigned char* blank, size_t length) + raptor_term* raptor_new_term_from_counted_literal(raptor_world* world, const unsigned char* literal, size_t literal_len, raptor_uri* datatype, const unsigned char* language, unsigned char language_len) + raptor_term* raptor_new_term_from_literal(raptor_world* world, const unsigned char* literal, raptor_uri* datatype, const unsigned char* language) + raptor_term* raptor_new_term_from_uri(raptor_world* world, raptor_uri* uri) + raptor_uri* raptor_new_uri_from_counted_string(raptor_world* world, const unsigned char* uri_string, size_t length) + const char* raptor_option_get_value_type_label(const raptor_option_value_type type) + raptor_uri* raptor_parser_get_graph(raptor_parser* rdf_parser) + int raptor_parser_parse_iostream(raptor_parser* rdf_parser, raptor_iostream *iostr, raptor_uri *base_uri) + int raptor_serializer_flush(raptor_serializer *rdf_serializer) + raptor_syntax_description* raptor_serializer_get_description(raptor_serializer* rdf_serializer) + void raptor_statement_clear(raptor_statement *statement) + raptor_statement* raptor_statement_copy(raptor_statement *statement) + int raptor_statement_equals(const raptor_statement* s1, const raptor_statement* s2) + void raptor_statement_init(raptor_statement *statement, raptor_world *world) + int raptor_syntax_description_validate (raptor_syntax_description* desc) + int raptor_term_compare(const raptor_term *t1, const raptor_term *t2) + raptor_term* raptor_term_copy(raptor_term* term) + int raptor_term_equals(raptor_term* term1, raptor_term* term2) + int raptor_term_ntriples_write(const raptor_term *term, raptor_iostream* iostr) + unsigned char* raptor_term_to_counted_string(raptor_term *term, size_t* len_p) + unsigned char* raptor_term_to_string(raptor_term *term) + raptor_world* raptor_uri_get_world(raptor_uri *uri) + unsigned char* raptor_world_generate_bnodeid(raptor_world *world) + raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) + int raptor_world_is_parser_name(raptor_world* world, const char* name) + int raptor_world_set_log_handler(raptor_world *world, void *user_data, raptor_log_handler handler) + + + Types + raptor_avltree + raptor_avltree_bitflags + raptor_avltree_iterator + raptor_avltree_visit_handler + raptor_data_compare_handler + raptor_data_context_free_handler + raptor_data_malloc_handler + raptor_domain + raptor_graph_mark_flags + raptor_log_message + raptor_option_description + raptor_option_value_type + raptor_syntax_bitflags + raptor_syntax_description + raptor_term_blank_value + raptor_term_literal_value + raptor_term_value + raptor_type_q + + + Enums and Constants + RAPTOR_DOMAIN_IOSTREAM + RAPTOR_DOMAIN_LAST + RAPTOR_DOMAIN_NAMESPACE + RAPTOR_DOMAIN_NONE + RAPTOR_DOMAIN_PARSER + RAPTOR_DOMAIN_QNAME + RAPTOR_DOMAIN_SAX2 + RAPTOR_DOMAIN_SERIALIZER + RAPTOR_DOMAIN_TERM + RAPTOR_DOMAIN_TURTLE_WRITER + RAPTOR_DOMAIN_URI + RAPTOR_DOMAIN_WORLD + RAPTOR_DOMAIN_WWW + RAPTOR_DOMAIN_XML_WRITER + RAPTOR_GRAPH_MARK_DECLARED + RAPTOR_GRAPH_MARK_START + RAPTOR_LOG_LEVEL_DEBUG + RAPTOR_LOG_LEVEL_INFO + RAPTOR_LOG_LEVEL_TRACE + RAPTOR_OPTION_VALUE_TYPE_BOOL + RAPTOR_OPTION_VALUE_TYPE_INT + RAPTOR_OPTION_VALUE_TYPE_LAST + RAPTOR_OPTION_VALUE_TYPE_STRING + RAPTOR_OPTION_VALUE_TYPE_URI + RAPTOR_WORLD_FLAG_URI_INTERNING + RAPTOR_WORLD_FLAG_WWW_SKIP_INIT_FINISH + + +
+
+Deleted functions, types, enums and constants + + + Functions + raptor_compare_strings - Trivial utility function removed. + raptor_copy_identifier - Use raptor_term_copy() with raptor_term objects. + raptor_error_handlers_init - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() + raptor_error_handlers_init_v2 - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() + raptor_feature_value_type - Use raptor_world_get_option_description() for the option and access the value_type field. + raptor_finish - Use raptor_free_world() with raptor_world object. + raptor_free_identifier - Use raptor_free_term() with raptor_term objects. + raptor_init - Use raptor_new_world() to create a new raptor_world object. + raptor_iostream_get_bytes_written_count - Deprecated for raptor_iostream_tell(). + raptor_iostream_write_string_turtle - Deprecated for raptor_string_python_write(). + raptor_new_identifier - Replaced by raptor_new_term_from_blank(), raptor_new_term_from_literal() or raptor_new_term_from_blank() and raptor_term class. + raptor_new_identifier_v2 - Replaced by raptor_new_term_from_blank(), raptor_new_term_from_literal() or raptor_new_term_from_blank() and raptor_term class. + raptor_ntriples_string_as_utf8_string - Deprecated internal debug function. + raptor_ntriples_term_as_string - Deprecated internal debug function. + raptor_print_ntriples_string - Use raptor_string_ntriples_write() with a raptor_iostream + raptor_print_statement_detailed - Deprecated internal function. + raptor_sequence_print_string - Trivial utility function removed. + raptor_sequence_print_uri - Deprecated for raptor_uri_print() + raptor_sequence_set_print_handler - Use the argument in the raptor_new_sequence() constructor instead. + raptor_sequence_set_print_handler_v2 - Use the argument in the raptor_new_sequence() constructor instead. + raptor_serializer_set_error_handler - Replaced by raptor_world_set_log_handler() on the raptor_world object. + raptor_serializer_set_warning_handler - Replaced by raptor_world_set_log_handler() on the raptor_world object. + raptor_set_error_handler - Replaced by raptor_world_set_log_handler() on the raptor_world object. + raptor_set_fatal_error_handler - Replaced by raptor_world_set_log_handler() on the raptor_world object. + raptor_set_parser_strict - Replaced by raptor_parser_set_option() with option RAPTOR_OPTION_STRICT + raptor_set_warning_handler - Replaced by raptor_world_set_log_handler() on the raptor_world object. + raptor_statement_part_as_counted_string - Better done via methods of raptor_term class such as raptor_term_to_counted_string(). + raptor_statement_part_as_counted_string_v2 - Better done via methods of raptor_term class such as raptor_term_to_counted_string(). + raptor_statement_part_as_string - Better done via methods of raptor_term class such as raptor_term_to_string(). + raptor_statement_part_as_string_v2 - Better done via methods of raptor_term class such as raptor_term_to_string(). + raptor_uri_get_handler - Entire URI implementation is internal and not replaceable. + raptor_uri_get_handler_v2 - Entire URI implementation is internal and not replaceable. + raptor_uri_set_handler - Entire URI implementation is internal and not replaceable. + raptor_uri_set_handler_v2 - Entire URI implementation is internal and not replaceable. + raptor_www_finish - No need for this to be public. + raptor_www_finish_v2 - No need for this to be public. + raptor_www_init - No need for this to be public. + raptor_www_init_v2 - No need for this to be public. + raptor_www_no_www_library_init_finish - Deprecated for raptor_world_set_flag(). + raptor_www_no_www_library_init_finish_v2 - Deprecated for raptor_world_set_flag(). + raptor_www_set_error_handler - Replaced by raptor_world_set_log_handler() on the raptor_world object. + + + Types + raptor_error_handlers - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() + raptor_free_uri_func - Entire URI implementation is internal and not replaceable. + raptor_libxml_flags - replaced by raptor_world_set_flags() with raptor_world_flag + raptor_message_handler - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() + raptor_message_handler_closure - Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() + raptor_new_uri_for_rdf_concept_func - Entire URI implementation is internal and not replaceable. + raptor_new_uri_from_uri_local_name_func - Entire URI implementation is internal and not replaceable. + raptor_new_uri_func - Entire URI implementation is internal and not replaceable. + raptor_new_uri_relative_to_base_func - Entire URI implementation is internal and not replaceable. + raptor_ntriples_parser - replaced by raptor_parser + raptor_ntriples_term_type - replaced by raptor_term_type + raptor_uri_as_counted_string_func - Entire URI implementation is internal and not replaceable. + raptor_uri_as_string_func - Entire URI implementation is internal and not replaceable. + raptor_uri_compare_func - Entire URI implementation is internal and not replaceable. + raptor_uri_copy_func - Entire URI implementation is internal and not replaceable. + raptor_uri_equals_func - Entire URI implementation is internal and not replaceable. + raptor_uri_handler - Entire URI implementation is internal and not replaceable. + raptor_uri_source - URI source was useless. + + + Enums and Constants + RAPTOR_FEATURE_ASSUME_IS_RDF - Never used. + RAPTOR_FEATURE_START_URI - Never used. + RAPTOR_GENID_TYPE_BAGID - There is just one type of generated ID now. + RAPTOR_GENID_TYPE_BNODEID - There is just one type of generated ID now. + RAPTOR_IDENTIFIER_TYPE_ORDINAL - Deprecated value deleted. + RAPTOR_URI_SOURCE_ATTRIBUTE - URI source concept removed. + RAPTOR_URI_SOURCE_BLANK_ID - URI source concept removed. + RAPTOR_URI_SOURCE_ELEMENT - URI source concept removed. + RAPTOR_URI_SOURCE_GENERATED - URI source concept removed. + RAPTOR_URI_SOURCE_ID - URI source concept removed. + RAPTOR_URI_SOURCE_NOT_URI - URI source concept removed. + RAPTOR_URI_SOURCE_UNKNOWN - URI source concept removed. + RAPTOR_URI_SOURCE_URI - URI source concept removed. + + +
+
+Renamed functions, enums and constants + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1.4.21 function2.0.0 functionNotes
raptor_format_locator raptor_locator_format  
raptor_get_feature_count raptor_option_get_count  
raptor_get_locator raptor_parser_get_locator  
raptor_get_name raptor_parser_get_name  
raptor_guess_parser_name_v2 raptor_world_guess_parser_name  
raptor_namespace_copy raptor_namespace_stack_start_namespace  
raptor_namespaces_format raptor_namespace_format_as_xml  
raptor_namespaces_qname_from_uri raptor_new_qname_from_namespace_uri  
raptor_new_namespace_parts_from_string raptor_xml_namespace_string_parse  
raptor_new_parser_for_content_v2 raptor_new_parser_for_content  
raptor_new_parser_v2 raptor_new_parser  
raptor_new_qname_from_namespace_local_name_v2 raptor_new_qname_from_namespace_local_name  
raptor_new_serializer_v2 raptor_new_serializer  
raptor_new_uri_from_id_v2 raptor_new_uri_from_id  
raptor_new_uri_from_uri_local_name_v2 raptor_new_uri_from_uri_local_name  
raptor_new_uri_relative_to_base_v2 raptor_new_uri_relative_to_base  
raptor_new_uri_v2 raptor_new_uri  
raptor_parse_abort raptor_parser_parse_abort  
raptor_parse_chunk raptor_parser_parse_chunk  
raptor_parse_file raptor_parser_parse_file  
raptor_parse_file_stream raptor_parser_parse_file_stream  
raptor_parse_uri raptor_parser_parse_uri  
raptor_parse_uri_with_connection raptor_parser_parse_uri_with_connection  
raptor_serialize_end raptor_serializer_serialize_end  
raptor_serialize_set_namespace raptor_serializer_set_namespace  
raptor_serialize_set_namespace_from_namespace raptor_serializer_set_namespace_from_namespace  
raptor_serialize_start raptor_serializer_start_to_iostream  
raptor_serialize_start_to_file_handle raptor_serializer_start_to_file_handle  
raptor_serialize_start_to_filename raptor_serializer_start_to_filename  
raptor_serialize_start_to_iostream raptor_serializer_start_to_iostream  
raptor_serialize_start_to_string raptor_serializer_start_to_string  
raptor_serializer_syntax_name_check_v2 raptor_world_is_serializer_name  
raptor_set_namespace_handler raptor_parser_set_namespace_handler  
raptor_set_statement_handler raptor_parser_set_statement_handler  
raptor_start_parse raptor_parser_parse_start  
raptor_uri_is_file_uri raptor_uri_uri_string_is_file_uri  
raptor_utf8_check raptor_unicode_check_utf8_string  
raptor_www_free raptor_free_www  
raptor_www_new_v2 raptor_new_www  
raptor_www_new_with_connection_v2 raptor_new_www_with_connection  
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1.4.21 enum / constant2.0.0 enum / constantNotes
RAPTOR_FEATURE_ALLOW_BAGID RAPTOR_OPTION_ALLOW_BAGID  
RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES  
RAPTOR_FEATURE_ALLOW_OTHER_PARSETYPES RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES  
RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST  
RAPTOR_FEATURE_ATOM_ENTRY_URI RAPTOR_OPTION_ATOM_ENTRY_URI  
RAPTOR_FEATURE_BNODE_BORDER RAPTOR_OPTION_BNODE_BORDER  
RAPTOR_FEATURE_BNODE_FILL RAPTOR_OPTION_BNODE_FILL  
RAPTOR_FEATURE_CHECK_RDF_ID RAPTOR_OPTION_CHECK_RDF_ID  
RAPTOR_FEATURE_HTML_LINK RAPTOR_OPTION_HTML_LINK  
RAPTOR_FEATURE_HTML_TAG_SOUP RAPTOR_OPTION_HTML_TAG_SOUP  
RAPTOR_FEATURE_JSON_CALLBACK RAPTOR_OPTION_JSON_CALLBACK  
RAPTOR_FEATURE_JSON_EXTRA_DATA RAPTOR_OPTION_JSON_EXTRA_DATA  
RAPTOR_FEATURE_LAST RAPTOR_OPTION_LAST  
RAPTOR_FEATURE_LITERAL_BORDER RAPTOR_OPTION_LITERAL_BORDER  
RAPTOR_FEATURE_LITERAL_FILL RAPTOR_OPTION_LITERAL_FILL  
RAPTOR_FEATURE_MICROFORMATS RAPTOR_OPTION_MICROFORMATS  
RAPTOR_FEATURE_NON_NFC_FATAL RAPTOR_OPTION_NON_NFC_FATAL  
RAPTOR_FEATURE_NORMALIZE_LANGUAGE RAPTOR_OPTION_NORMALIZE_LANGUAGE  
RAPTOR_FEATURE_NO_NET RAPTOR_OPTION_NO_NET  
RAPTOR_FEATURE_PREFIX_ELEMENTS RAPTOR_OPTION_PREFIX_ELEMENTS  
RAPTOR_FEATURE_RELATIVE_URIS RAPTOR_OPTION_RELATIVE_URIS  
RAPTOR_FEATURE_RESOURCE_BORDER RAPTOR_OPTION_RESOURCE_BORDER  
RAPTOR_FEATURE_RESOURCE_FILL RAPTOR_OPTION_RESOURCE_FILL  
RAPTOR_FEATURE_RSS_TRIPLES RAPTOR_OPTION_RSS_TRIPLES  
RAPTOR_FEATURE_SCANNING RAPTOR_OPTION_SCANNING  
RAPTOR_FEATURE_WARN_OTHER_PARSETYPES RAPTOR_OPTION_WARN_OTHER_PARSETYPES  
RAPTOR_FEATURE_WRITER_AUTO_EMPTY RAPTOR_OPTION_WRITER_AUTO_EMPTY  
RAPTOR_FEATURE_WRITER_AUTO_INDENT RAPTOR_OPTION_WRITER_AUTO_INDENT  
RAPTOR_FEATURE_WRITER_INDENT_WIDTH RAPTOR_OPTION_WRITER_INDENT_WIDTH  
RAPTOR_FEATURE_WRITER_XML_DECLARATION RAPTOR_OPTION_WRITER_XML_DECLARATION  
RAPTOR_FEATURE_WRITER_XML_VERSION RAPTOR_OPTION_WRITER_XML_VERSION  
RAPTOR_FEATURE_WRITE_BASE_URI RAPTOR_OPTION_WRITE_BASE_URI  
RAPTOR_FEATURE_WWW_HTTP_CACHE_CONTROL RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL  
RAPTOR_FEATURE_WWW_HTTP_USER_AGENT RAPTOR_OPTION_WWW_HTTP_USER_AGENT  
RAPTOR_FEATURE_WWW_TIMEOUT RAPTOR_OPTION_WWW_TIMEOUT  
RAPTOR_IDENTIFIER_TYPE_ANONYMOUS RAPTOR_TERM_TYPE_BLANK  
RAPTOR_IDENTIFIER_TYPE_LITERAL RAPTOR_TERM_TYPE_LITERAL  
RAPTOR_IDENTIFIER_TYPE_PREDICATE RAPTOR_TERM_TYPE_URI  
RAPTOR_IDENTIFIER_TYPE_RESOURCE RAPTOR_TERM_TYPE_URI  
RAPTOR_IDENTIFIER_TYPE_UNKNOWN RAPTOR_TERM_TYPE_UNKNOWN  
RAPTOR_IDENTIFIER_TYPE_XML_LITERAL RAPTOR_TERM_TYPE_LITERAL  
RAPTOR_LIBXML_FLAGS_GENERIC_ERROR_SAVE RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE Flag setting is done by raptor_world_set_flags()
RAPTOR_LIBXML_FLAGS_STRUCTURED_ERROR_SAVE RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE Flag setting is done by raptor_world_set_flags()
RAPTOR_LOG_LEVEL_WARNING RAPTOR_LOG_LEVEL_WARN  
RAPTOR_NTRIPLES_TERM_TYPE_BLANK_NODE RAPTOR_TERM_TYPE_BLANK  
RAPTOR_NTRIPLES_TERM_TYPE_LITERAL RAPTOR_TERM_TYPE_LITERAL  
RAPTOR_NTRIPLES_TERM_TYPE_URI_REF RAPTOR_TERM_TYPE_URI  
+ +
+
+Changed functions and types + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1.4.21 function2.0.0 functionNotes
raptor_feature raptor_feature_from_uri(raptor_uri *uri) raptor_option raptor_world_get_option_from_uri(raptor_world* world, raptor_uri *uri)  
raptor_feature raptor_feature_from_uri_v2(raptor_world* world, raptor_uri *uri) raptor_option raptor_world_get_option_from_uri(raptor_world* world, raptor_uri *uri)  
int raptor_features_enumerate(const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_PARSER
int raptor_features_enumerate_v2(raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_PARSER
int raptor_format_locator_v2(raptor_world* world, char* buffer, size_t length, raptor_locator* locator) int raptor_locator_format(char* buffer, size_t length, raptor_locator* locator)  
void raptor_free_uri_v2(raptor_world* world, raptor_uri *uri) void raptor_free_uri(raptor_uri *uri)  
int raptor_get_feature(raptor_parser *parser, raptor_feature feature) int raptor_parser_get_option(raptor_parser *parser, raptor_option option, char** string_p, int* integer_p)  
const char* raptor_get_label(raptor_parser *rdf_parser) raptor_syntax_description* raptor_parser_get_description(raptor_parser* rdf_parser) Use label field of returned description.
const char* raptor_get_mime_type(raptor_parser *rdf_parser) raptor_syntax_description* raptor_parser_get_description(raptor_parser* rdf_parser) Use the mime_types array field of returned raptor_syntax_description
int raptor_get_need_base_uri(raptor_parser *rdf_parser) raptor_syntax_description* raptor_parser_get_description(raptor_parser* rdf_parser) Use the RAPTOR_SYNTAX_NEED_BASE_URI bitflag in the flags field of the returned raptor_syntax_description
const char* raptor_guess_parser_name(raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) const char* raptor_world_guess_parser_name(raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier)  
int raptor_iostream_format_hexadecimal(raptor_iostream* iostr, unsigned int integer, int width) int raptor_iostream_hexadecimal_write(unsigned int integer, int width, raptor_iostream* iostr)  
int raptor_iostream_read_bytes(raptor_iostream* iostr, void *ptr, size_t size, size_t nmemb) int raptor_iostream_read_bytes(void *ptr, size_t size, size_t nmemb, raptor_iostream* iostr)  
int raptor_iostream_write_byte(raptor_iostream *iostr, const int byte) int raptor_iostream_write_byte(const int byte, raptor_iostream *iostr)  
int raptor_iostream_write_bytes(raptor_iostream *iostr, const void *ptr, size_t size, size_t nmemb) int raptor_iostream_write_bytes(const void *ptr, size_t size, size_t nmemb, raptor_iostream *iostr)  
int raptor_iostream_write_counted_string(raptor_iostream *iostr, const void *string, size_t len) int raptor_iostream_counted_string_write(const void *string, size_t len, raptor_iostream *iostr)  
int raptor_iostream_write_decimal(raptor_iostream* iostr, int integer) int raptor_iostream_decimal_write(int integer, raptor_iostream* iostr)  
void raptor_iostream_write_end(raptor_iostream *iostr) int raptor_iostream_write_end(raptor_iostream *iostr)  
int raptor_iostream_write_namespace(raptor_iostream* iostr, raptor_namespace *ns) int raptor_namespace_write(raptor_namespace *ns, raptor_iostream* iostr)  
int raptor_iostream_write_qname(raptor_iostream* iostr, raptor_qname *qname) int raptor_qname_write(raptor_qname *qname, raptor_iostream* iostr)  
void raptor_iostream_write_statement_ntriples(raptor_iostream* iostr, const raptor_statement *statement) int raptor_statement_ntriples_write(const raptor_statement *statement, raptor_iostream* iostr, int write_graph_term) Gains extra flag arg to decide whether to write any graph term.
int raptor_iostream_write_string(raptor_iostream *iostr, const void *string) int raptor_iostream_string_write(const void *string, raptor_iostream *iostr)  
int raptor_iostream_write_string_ntriples(raptor_iostream *iostr, const unsigned char* string, size_t len, const char delim) int raptor_string_ntriples_write(const unsigned char* string, size_t len, const char delim, raptor_iostream *iostr)  
int raptor_iostream_write_string_python(raptor_iostream *iostr, const unsigned char* string, size_t len, const char delim, int flags) int raptor_string_python_write(const unsigned char* string, size_t len, const char delim, int flags, raptor_iostream *iostr)  
int raptor_iostream_write_stringbuffer(raptor_iostream* iostr, raptor_stringbuffer *sb) int raptor_stringbuffer_write(raptor_stringbuffer *sb, raptor_iostream* iostr)  
int raptor_iostream_write_uri(raptor_iostream *iostr, raptor_uri *uri) int raptor_uri_write(raptor_uri *uri, raptor_iostream *iostr)  
int raptor_iostream_write_uri_v2(raptor_world* world, raptor_iostream *iostr, raptor_uri *uri) int raptor_uri_write(raptor_uri *uri, raptor_iostream *iostr)  
int raptor_iostream_write_xml_any_escaped_string(raptor_iostream* iostr, const unsigned char* string, size_t len, char quote, int xml_version, raptor_simple_message_handler error_handler, void *error_data) int raptor_xml_escape_string_any_write(const unsigned char* string, size_t len, char quote, int xml_version, raptor_iostream* iostr)  
int raptor_iostream_write_xml_element(raptor_iostream *iostr, raptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, int is_end, raptor_simple_message_handler error_handler, void *error_data, int depth) int raptor_xml_element_write(raptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, int is_end, int depth, raptor_iostream *iostr)  
int raptor_iostream_write_xml_escaped_string(raptor_iostream* iostr, const unsigned char* string, size_t len, char quote, raptor_simple_message_handler error_handler, void *error_data) int raptor_xml_escape_string_write(const unsigned char* string, size_t len, char quote, raptor_iostream* iostr)  
const char* raptor_locator_uri_v2(raptor_world* world, raptor_locator *locator) const char* raptor_locator_uri(raptor_locator *locator)  
int raptor_namespaces_init(raptor_namespace_stack *nstack, const raptor_uri_handler *uri_handler, void *uri_context, raptor_simple_message_handler error_handler, void *error_data, int defaults) int raptor_namespaces_init(raptor_world* world, raptor_namespace_stack *nstack, int defaults)  
int raptor_namespaces_init_v2(raptor_world* world, raptor_namespace_stack *nstack, raptor_simple_message_handler error_handler, void *error_data, int defaults) int raptor_namespaces_init(raptor_world* world, raptor_namespace_stack *nstack, int defaults)  
raptor_iostream* raptor_new_iostream_from_file_handle(FILE *handle) raptor_iostream* raptor_new_iostream_from_file_handle(raptor_world* world, FILE *handle)  
raptor_iostream* raptor_new_iostream_from_filename(const char* filename) raptor_iostream* raptor_new_iostream_from_filename(raptor_world* world, const char* filename)  
raptor_iostream* raptor_new_iostream_from_handler(void *context, const raptor_iostream_handler *handler) raptor_iostream* raptor_new_iostream_from_handler(raptor_world* world, void *user_data, const raptor_iostream_handler* const handler)  
raptor_iostream* raptor_new_iostream_from_handler2(void *user_data, const raptor_iostream_handler2* const handler2) raptor_iostream* raptor_new_iostream_from_handler(raptor_world* world, void *user_data, const raptor_iostream_handler* const handler)  
raptor_iostream* raptor_new_iostream_from_sink(void) raptor_iostream* raptor_new_iostream_from_sink(raptor_world* world)  
raptor_iostream* raptor_new_iostream_from_string(void *string, size_t length) raptor_iostream* raptor_new_iostream_from_string(raptor_world* world, void *string, size_t length)  
raptor_iostream* raptor_new_iostream_to_file_handle(FILE *handle) raptor_iostream* raptor_new_iostream_to_file_handle(raptor_world* world, FILE *handle)  
raptor_iostream* raptor_new_iostream_to_filename(const char* filename) raptor_iostream* raptor_new_iostream_to_filename(raptor_world* world, const char* filename)  
raptor_iostream* raptor_new_iostream_to_sink(void) raptor_iostream* raptor_new_iostream_to_sink(raptor_world* world)  
raptor_iostream* raptor_new_iostream_to_string(void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)) raptor_iostream* raptor_new_iostream_to_string(raptor_world* world, void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size))  
raptor_namespace_stack* raptor_new_namespaces(const raptor_uri_handler *uri_handler, void *uri_context, raptor_simple_message_handler error_handler, void *error_data, int defaults) raptor_namespace_stack* raptor_new_namespaces(raptor_world* world, int defaults)  
raptor_namespace_stack* raptor_new_namespaces_v2(raptor_world* world, raptor_simple_message_handler error_handler, void *error_data, int defaults) raptor_namespace_stack* raptor_new_namespaces(raptor_world* world, int defaults)  
raptor_parser* raptor_new_parser(const char* name) raptor_parser* raptor_new_parser(raptor_world* world, const char* name)  
raptor_parser* raptor_new_parser_for_content(raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier) raptor_parser* raptor_new_parser_for_content(raptor_world* world, raptor_uri *uri, const char* mime_type, const unsigned char* buffer, size_t len, const unsigned char* identifier)  
raptor_qname* raptor_new_qname(raptor_namespace_stack *nstack, const unsigned char* name, const unsigned char* value, raptor_simple_message_handler error_handler, void *error_data) raptor_qname* raptor_new_qname(raptor_namespace_stack *nstack, const unsigned char* name, const unsigned char* value)  
raptor_qname* raptor_new_qname_from_namespace_local_name(raptor_namespace *ns, const unsigned char* local_name, const unsigned char* value) raptor_qname* raptor_new_qname_from_namespace_local_name(raptor_world* world, raptor_namespace *ns, const unsigned char* local_name, const unsigned char* value)  
raptor_sax2* raptor_new_sax2(void *user_data, raptor_error_handlers* error_handlers) raptor_sax2* raptor_new_sax2(raptor_world *world, raptor_locator *locator, void* user_data)  
raptor_sequence* raptor_new_sequence(raptor_sequence_free_handler* free_handler, raptor_sequence_print_handler* print_handler) raptor_sequence* raptor_new_sequence(raptor_data_free_handler free_handler, raptor_data_print_handler print_handler)  
raptor_sequence* raptor_new_sequence_v2(raptor_sequence_free_handler_v2* free_handler, raptor_sequence_print_handler_v2* print_handler, void* handler_context) raptor_sequence* raptor_new_sequence(raptor_data_free_handler free_handler, raptor_data_print_handler print_handler)  
raptor_serializer* raptor_new_serializer(const char* name) raptor_serializer* raptor_new_serializer(raptor_world* world, const char* name)  
raptor_uri* raptor_new_uri(const unsigned char* uri_string) raptor_uri* raptor_new_uri(raptor_world* world, const unsigned char* uri_string)  
raptor_uri* raptor_new_uri_for_rdf_concept(const char* name) raptor_uri* raptor_new_uri_for_rdf_concept(raptor_world* world, const unsigned char* name)  
raptor_uri* raptor_new_uri_for_rdf_concept_v2(raptor_world* world, const char* name) raptor_uri* raptor_new_uri_for_rdf_concept(raptor_world* world, const unsigned char* name)  
raptor_uri* raptor_new_uri_for_retrieval_v2(raptor_world* world, raptor_uri* old_uri) raptor_uri* raptor_new_uri_for_retrieval(raptor_uri* old_uri)  
raptor_uri* raptor_new_uri_for_xmlbase_v2(raptor_world* world, raptor_uri* old_uri) raptor_uri* raptor_new_uri_for_xmlbase(raptor_uri* old_uri)  
raptor_uri* raptor_new_uri_from_id(raptor_uri *base_uri, const unsigned char* id) raptor_uri* raptor_new_uri_from_id(raptor_world* world, raptor_uri *base_uri, const unsigned char* id)  
raptor_uri* raptor_new_uri_from_uri_local_name(raptor_uri *uri, const unsigned char* local_name) raptor_uri* raptor_new_uri_from_uri_local_name(raptor_world* world, raptor_uri *uri, const unsigned char* local_name)  
raptor_uri* raptor_new_uri_relative_to_base(raptor_uri *base_uri, const unsigned char* uri_string) raptor_uri* raptor_new_uri_relative_to_base(raptor_world* world, raptor_uri *base_uri, const unsigned char* uri_string)  
raptor_xml_writer* raptor_new_xml_writer(raptor_namespace_stack *nstack, const raptor_uri_handler *uri_handler, void *uri_context, raptor_iostream* iostr, raptor_simple_message_handler error_handler, void *error_data, int canonicalize) raptor_xml_writer* raptor_new_xml_writer(raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr)  
raptor_xml_writer* raptor_new_xml_writer_v2(raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr, raptor_simple_message_handler error_handler, void *error_data, int canonicalize) raptor_xml_writer* raptor_new_xml_writer(raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr)  
const unsigned char* raptor_parser_get_feature_string(raptor_parser *parser, raptor_feature feature) const unsigned char* raptor_parser_get_option(raptor_parser *parser, raptor_option option, char** string_p, int* integer_p)  
int raptor_parser_set_feature_string(raptor_parser *parser, raptor_feature feature, const unsigned char* value) int raptor_parser_set_option(raptor_parser *parser, raptor_option option, char* string, int integer)  
int raptor_parsers_enumerate(const unsigned int counter, const char* *name, const char* *label) raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, unsigned int counter)  
int raptor_parsers_enumerate_v2(raptor_world* world, const unsigned int counter, const char* *name, const char* *label) raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, const unsigned int counter)  
void raptor_print_locator(FILE *stream, raptor_locator* locator) int raptor_locator_print(raptor_locator* locator, FILE *stream)  
void raptor_print_locator_v2(raptor_world* world, FILE *stream, raptor_locator* locator) void raptor_locator_print(raptor_locator* locator, FILE *stream)  
void raptor_print_statement(const raptor_statement * statement, FILE *stream) int raptor_statement_print(const raptor_statement * statement, FILE *stream)  
void raptor_print_statement_as_ntriples(const raptor_statement * statement, FILE *stream) int raptor_statement_print_as_ntriples(const raptor_statement * statement, FILE *stream)  
void raptor_print_statement_as_ntriples_v2(const raptor_statement_v2 * statement, FILE *stream) int raptor_statement_print_as_ntriples(const raptor_statement * statement, FILE *stream)  
void raptor_print_statement_v2(const raptor_statement_v2 * statement, FILE *stream) int raptor_statement_print(const raptor_statement * statement, FILE *stream)  
raptor_uri* raptor_qname_string_to_uri(raptor_namespace_stack *nstack, const unsigned char* name, size_t name_len, raptor_simple_message_handler error_handler, void *error_data) raptor_uri* raptor_qname_string_to_uri(raptor_namespace_stack *nstack, const unsigned char* name, size_t name_len)  
void raptor_sequence_print(raptor_sequence* seq, FILE* fh) int raptor_sequence_print(raptor_sequence* seq, FILE* fh)  
void raptor_sequence_sort(raptor_sequence* seq, int(*compare)(const void *, const void *)) void raptor_sequence_sort(raptor_sequence* seq, raptor_data_compare_handler compare)  
int raptor_serialize_statement(raptor_serializer* rdf_serializer, const raptor_statement *statement) int raptor_serializer_serialize_statement(raptor_serializer* rdf_serializer, raptor_statement *statement)  
int raptor_serializer_features_enumerate(const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_SERIALIZER
int raptor_serializer_features_enumerate_v2(raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_SERIALIZER
int raptor_serializer_get_feature(raptor_serializer *serializer, raptor_feature feature) int raptor_serializer_get_option(raptor_serializer *serializer, raptor_option option)  
const unsigned char* raptor_serializer_get_feature_string(raptor_serializer *serializer, raptor_feature feature) int raptor_serializer_get_option(raptor_serializer *serializer, raptor_option option, char** string_p, int* integer_p)  
int raptor_serializer_set_feature(raptor_serializer *serializer, raptor_feature feature, int value) int raptor_serializer_set_option(raptor_serializer *serializer, raptor_option option, char* string, int integer)  
int raptor_serializer_set_feature_string(raptor_serializer *serializer, raptor_feature feature, const unsigned char* value) int raptor_serializer_set_option(raptor_serializer *serializer, raptor_option option, char* string, int integer)  
int raptor_serializer_syntax_name_check(const char* name) int raptor_world_is_serializer_name(raptor_world* world, const char* name)  
int raptor_serializers_enumerate(const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) const raptor_syntax_description* raptor_world_get_serializer_description(raptor_world* world, unsigned int counter)  
int raptor_serializers_enumerate_v2(raptor_world* world, const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) const raptor_syntax_description* raptor_world_get_serializer_description(raptor_world* world, const unsigned int counter)  
void raptor_set_default_generate_id_parameters(raptor_parser* rdf_parser, char* prefix, int base) void raptor_world_set_generate_bnodeid_parameters(raptor_world* world, char* prefix, int base)  
int raptor_set_feature(raptor_parser *parser, raptor_feature feature, int value) int raptor_parser_set_option(raptor_parser *parser, raptor_option option, char* string, int integer)  
void raptor_set_generate_id_handler(raptor_parser* parser, void *user_data, raptor_generate_id_handler handler) void raptor_world_set_generate_bnodeid_handler(raptor_world* world, void *user_data, raptor_generate_bnodeid_handler handler)  
void raptor_set_graph_handler(raptor_parser* parser, void *user_data, raptor_graph_handler handler) void raptor_parser_set_graph_mark_handler(raptor_parser* parser, void *user_data, raptor_graph_mark_handler handler)  
void raptor_set_libxslt_security_preferences(void *security_preferences) int raptor_world_set_libxslt_security_preferences(raptor_world *world, void *security_preferences)  
int raptor_statement_compare_v2(const raptor_statement_v2 *s1, const raptor_statement_v2 *s2) int raptor_statement_compare(const raptor_statement *s1, const raptor_statement *s2)  
int raptor_syntax_name_check(const char* name) int raptor_world_is_parser_name(raptor_world* world, const char *name)  
int raptor_syntax_name_check_v2(raptor_world* world, const char* name) int raptor_world_is_parser_name(raptor_world* world, const char *name)  
int raptor_syntaxes_enumerate(const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, const unsigned int counter)  
int raptor_syntaxes_enumerate_v2(raptor_world* world, const unsigned int counter, const char* *name, const char* *label, const char* *mime_type, const unsigned char* *uri_string) raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, const unsigned int counter)  
int raptor_unicode_char_to_utf8(raptor_unichar c, unsigned char* output) int raptor_unicode_utf8_string_put_char(raptor_unichar c, unsigned char* output, size_t length)  
unsigned char* raptor_uri_as_counted_string_v2(raptor_world* world, raptor_uri *uri, size_t* len_p) unsigned char* raptor_uri_as_counted_string(raptor_uri *uri, size_t* len_p)  
unsigned char* raptor_uri_as_string_v2(raptor_world* world, raptor_uri *uri) unsigned char* raptor_uri_as_string(raptor_uri *uri)  
int raptor_uri_compare_v2(raptor_world* world, raptor_uri* uri1, raptor_uri* uri2) int raptor_uri_compare(raptor_uri* uri1, raptor_uri* uri2)  
raptor_uri* raptor_uri_copy_v2(raptor_world* world, raptor_uri *uri) raptor_uri* raptor_uri_copy(raptor_uri *uri)  
int raptor_uri_equals_v2(raptor_world* world, raptor_uri* uri1, raptor_uri* uri2) int raptor_uri_equals(raptor_uri* uri1, raptor_uri* uri2)  
void raptor_uri_print(const raptor_uri* uri, FILE *stream) int raptor_uri_print(const raptor_uri* uri, FILE *stream)  
void raptor_uri_print_v2(raptor_world* world, const raptor_uri* uri, FILE *stream) int raptor_uri_print(const raptor_uri* uri, FILE *stream)  
void raptor_uri_resolve_uri_reference(const unsigned char* base_uri, const unsigned char* reference_uri, unsigned char* buffer, size_t length) size_t raptor_uri_resolve_uri_reference(const unsigned char* base_uri, const unsigned char* reference_uri, unsigned char* buffer, size_t length)  
unsigned char* raptor_uri_to_counted_string_v2(raptor_world* world, raptor_uri *uri, size_t *len_p) unsigned char* raptor_uri_to_counted_string(raptor_uri *uri, size_t *len_p)  
unsigned char* raptor_uri_to_relative_counted_uri_string_v2(raptor_world* world, raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p) unsigned char* raptor_uri_to_relative_counted_uri_string(raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p)  
unsigned char* raptor_uri_to_relative_uri_string_v2(raptor_world* world, raptor_uri *base_uri, raptor_uri *reference_uri) unsigned char* raptor_uri_to_relative_uri_string(raptor_uri *base_uri, raptor_uri *reference_uri)  
unsigned char* raptor_uri_to_string_v2(raptor_world* world, raptor_uri *uri) unsigned char* raptor_uri_to_string(raptor_uri *uri)  
int raptor_utf8_to_unicode_char(raptor_unichar* output, const unsigned char* input, int length) int raptor_unicode_utf8_string_get_char(const unsigned char* input, size_t length, raptor_unichar* output)  
void raptor_world_set_libxml_flags(raptor_world *world, int flags) int raptor_world_set_flag(raptor_world *world, raptor_world_flag flag, int value)  
void raptor_world_set_libxslt_security_preferences(raptor_world *world, void *security_preferences) int raptor_world_set_libxslt_security_preferences(raptor_world *world, void *security_preferences)  
int raptor_www_fetch_to_string(raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)) int raptor_www_fetch_to_string(raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, raptor_data_malloc_handler const malloc_handler)  
raptor_www* raptor_www_new(void) raptor_www* raptor_new_www(raptor_world* world)  
raptor_www* raptor_www_new_with_connection(void* connection) raptor_www* raptor_new_www_with_connection(raptor_world* world, void* connection)  
int raptor_xml_any_escape_string(const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, int xml_version, raptor_simple_message_handler error_handler, void *error_data) int raptor_xml_escape_string_any(raptor_world* world, const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, int xml_version)  
int raptor_xml_escape_string(const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote, raptor_simple_message_handler error_handler, void *error_data) int raptor_xml_escape_string(raptor_world *world, const unsigned char* string, size_t len, unsigned char* buffer, size_t length, char quote)  
int raptor_xml_writer_features_enumerate(const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_XML_WRITER
int raptor_xml_writer_features_enumerate_v2(raptor_world* world, const raptor_feature feature, const char* *name, raptor_uri **uri, const char* *label) raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option) Call with domain = RAPTOR_DOMAIN_XML_WRITER
int raptor_xml_writer_get_feature(raptor_xml_writer *xml_writer, raptor_feature feature) int raptor_xml_writer_get_option(raptor_xml_writer *xml_writer, raptor_option option, char** string_p, int* integer_p)  
const unsigned char* raptor_xml_writer_get_feature_string(raptor_xml_writer *xml_writer, raptor_feature feature) const unsigned char* raptor_xml_writer_get_option(raptor_xml_writer *xml_writer, raptor_option option, char** string_p, int* integer_p)  
int raptor_xml_writer_set_feature(raptor_xml_writer *xml_writer, raptor_feature feature, int value) int raptor_xml_writer_set_option(raptor_xml_writer *xml_writer, raptor_option option, char* string, int integer)  
int raptor_xml_writer_set_feature_string(raptor_xml_writer *xml_writer, raptor_feature feature, const unsigned char* value) int raptor_xml_writer_set_option(raptor_xml_writer *xml_writer, raptor_option option, char* string, int integer)  
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1.4.21 type2.0.0 typeNotes
raptor_feature raptor_option And new option RAPTOR_OPTION_STRICT added.
raptor_graph_handler raptor_graph_mark_handler  
raptor_identifier raptor_term Fields changed to be simpler raptor_term_type and raptor_term_value
raptor_identifier_type raptor_term_type Removed several enum values to leave just URI, blank and literal types.
raptor_iostream_handler2 raptor_iostream_handler  
raptor_iostream_write_end_func raptor_iostream_write_end_func handler returns an int
raptor_log_level raptor_log_level Added RAPTOR_LOG_LEVEL_TRACE, RAPTOR_LOG_LEVEL_DEBUG, RAPTOR_LOG_LEVEL_INFO. RAPTOR_LOG_LEVEL_WARNING renamed RAPTOR_LOG_LEVEL_WARN
raptor_sequence_free_function raptor_data_free_handler  
raptor_sequence_free_handler_v2 raptor_data_context_free_handler  
raptor_sequence_print_handler raptor_data_print_handler  
raptor_sequence_print_handler_v2 raptor_data_context_print_handler  
raptor_simple_message_handler raptor_log_handler Replaced by generic raptor log mechanism. See raptor_world_set_log_handler()
raptor_statement raptor_statement fields changed to use raptor_term
raptor_statement_handler raptor_statement_handler added const
raptor_statement_v2 raptor_statement Fields changed to be a 3 or 4 tuple of raptor_term
+ +
+ +
+
+Changes between raptor2 2.0.3 and 2.0.4 + +
+New functions, types, enums and constants + + + Functions + int raptor_bnodeid_ntriples_write(const unsigned char *bnodeid, size_t len, raptor_iostream *iostr) + int raptor_www_set_ssl_cert_options(raptor_www* www, const char* cert_filename, const char* cert_type, const char* cert_passphrase) + + +
+ +
+
+Changes between raptor2 2.0.4 and 2.0.5 + +
+New functions, types, enums and constants + + + Functions + int raptor_snprintf(char *buffer, size_t size, const char *format, ...) + int raptor_unicode_utf8_strlen(const unsigned char *string, size_t length) + size_t raptor_unicode_utf8_substr(unsigned char* dest, size_t* dest_length_p, const unsigned char* src, size_t src_length, int startingLoc, int length) + int raptor_vasprintf(char **ret, const char *format, va_list arguments) + int raptor_vsnprintf2(char *buffer, size_t size, const char *format, va_list arguments) - Deprecates raptor_vsnprintf() + + +
+ +
+
+Changes between raptor2 2.0.5 and 2.0.6 + +
+New functions, types, enums and constants + + + Functions + int raptor_sequence_next_permutation(raptor_sequence *seq, raptor_data_compare_handler compare) + int raptor_sequence_reverse(raptor_sequence* seq, int start_index, int length) + int raptor_sequence_swap(raptor_sequence* seq, int i, int j) + + +
+ +
+
+Changes between raptor2 2.0.6 and 2.0.7 + +
+New functions, types, enums and constants + + + Functions + raptor_uri* raptor_new_uri_from_uri_or_file_string(raptor_world* world, raptor_uri* base_uri, const unsigned char* uri_or_file_string) + void raptor_sax2_set_uri_filter(raptor_sax2* sax2, raptor_uri_filter_func filter, void *user_data) + int raptor_uri_file_exists(raptor_uri* uri) + int raptor_uri_filename_exists(const unsigned char* path) + char* raptor_uri_uri_string_to_counted_filename_fragment(const unsigned char *uri_string, size_t* len_p, unsigned char **fragment_p, size_t* fragment_len_p) + int raptor_www_set_ssl_verify_options(raptor_www* www, int verify_peer, int verify_host) + + + Enums and Constants + RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES + RAPTOR_OPTION_NO_FILE + RAPTOR_OPTION_WWW_SSL_VERIFY_HOST + RAPTOR_OPTION_WWW_SSL_VERIFY_PEER + + +
+ +
+
+Changes between raptor2 2.0.7 and 2.0.8 + +
+New functions, types, enums and constants + + + Functions + raptor_uri* raptor_new_uri_relative_to_base_counted(raptor_world* world, raptor_uri *base_uri, const unsigned char *uri_string, size_t uri_len) + unsigned char* raptor_term_to_turtle_counted_string(raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri, size_t *len_p) + unsigned char* raptor_term_to_turtle_string(raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri) + int raptor_term_turtle_write(raptor_iostream* iostr, raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri) + unsigned char* raptor_uri_to_turtle_counted_string(raptor_world *world, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri, size_t *len_p) + unsigned char* raptor_uri_to_turtle_string(raptor_world *world, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri) + int raptor_uri_turtle_write(raptor_world *world, raptor_iostream* iostr, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri) + + +
+ +
+
+Changes between raptor2 2.0.9 and 2.0.10 + +
+New functions, types, enums and constants + + + Functions + int raptor_string_escaped_write(const unsigned char *string, size_t len, const char delim, unsigned int flags, raptor_iostream *iostr) + int raptor_term_escaped_write(const raptor_term *term, unsigned int flags, raptor_iostream* iostr) + int raptor_uri_escaped_write(raptor_uri* uri, raptor_uri* base_uri, unsigned int flags, raptor_iostream *iostr) + + + Types + raptor_escaped_write_bitflags + + +
+ +
+
+Changes between raptor2 2.0.10 and 2.0.11 + +
+New functions, types, enums and constants + + + Functions + unsigned char* raptor_qname_format_as_xml(const raptor_qname *qname, size_t *length_p) + int raptor_uri_uri_string_is_absolute(const unsigned char* uri_string) + + +
+ +
+
+Changes between raptor2 2.0.11 and 2.0.12 + +
+New functions, types, enums and constants + + + Functions + raptor_term* raptor_new_term_from_counted_string(raptor_world* world, unsigned char* string, size_t length) + + +
+ +
+
+Changes between raptor2 2.0.13 and 2.0.14 + +
+New functions, types, enums and constants + + + Functions + unsigned char* raptor_uri_counted_filename_to_uri_string(const char *filename, size_t filename_len) + + +
+ +
+
+Changes between raptor2 2.0.14 and 2.0.15 + +
+New functions, types, enums and constants + + + Functions + void raptor_sequence_sort_r(raptor_sequence* seq, raptor_data_compare_arg_handler compare, void* user_data) - Uses raptor_sort_r() internally. + void raptor_sort_r(void *base, size_t nel, size_t width, raptor_data_compare_arg_handler compar, void *user_data) + int raptor_world_get_parsers_count(raptor_world* world) + int raptor_world_get_serializers_count(raptor_world* world) + + + Types + raptor_data_compare_arg_handler - Used by raptor_sort_r() + + +
+ +
+
+Changes between raptor2 2.0.15 and 2.0.16 + +
+New functions, types, enums and constants + + + Functions + void raptor_avltree_trim(raptor_avltree* tree) + int raptor_www_set_http_accept2(raptor_www *www, const char *value, size_t value_len) + int raptor_www_set_proxy2(raptor_www *www, const char *proxy, size_t proxy_len) + int raptor_www_set_user_agent2(raptor_www *www, const char *user_agent, size_t user_agent_len) + + + Enums and Constants + raptor_rdf_schema_namespace_uri_len + + +
+
+Deleted functions, types, enums and constants + + + Functions + raptor_www_set_http_accept - Deprecated for raptor_www_set_http_accept2 + raptor_www_set_proxy - Deprecated for raptor_www_set_proxy2 + raptor_www_set_user_agent - Deprecated for raptor_www_set_user_agent2 + + +
+ +
+ +
diff --git a/docs/raptor-docs.xml b/docs/raptor-docs.xml new file mode 100644 index 0000000..201ce01 --- /dev/null +++ b/docs/raptor-docs.xml @@ -0,0 +1,169 @@ + + +]> + + + Raptor RDF Syntax Library Manual + Manual for Raptor &version; + + + Dave + Beckett + +
+ http://www.dajobe.org/ +
+
+
+ + + + This documentation is Free Software / Open Source - you can + redistribute it and/or modify it under the same licenses as + Raptor. + It is licensed under the following three licenses as alternatives: + + GNU Lesser General Public License (LGPL) V2.1 or any newer version + GNU General Public License (GPL) V2 or any newer version + Apache License, V2.0 or any newer version + + You may not use this documentation except in compliance with at + least one of the above three licenses. See the + Raptor + site for the full license terms. + + + + + + 2001 + 2002 + 2003 + 2004 + 2005 + 2006 + 2007 + 2008 + 2009 + 2010 + 2011 + 2012 + 2013 + 2014 + 2015 + 2016 + 2017 + 2018 + 2019 + 2020 + Dave Beckett + + + 2001 + 2002 + 2003 + 2004 + 2005 + University of Bristol + +
+ + + Raptor Overview + +Raptor +is a free software / Open Source C library that provides +a set of parsers and serializers that +generate Resource Description Framework (RDF) triples +by parsing syntaxes or serialize the triples into a syntax. +It also includes supporting functionality for managing Unicode, +UTF-8, URIs, retrieving from URIs and reading and writing XML. + + + + + + Raptor Tutorial + + + This part describes how to use the + Raptor APIs to + turn syntaxes into RDF triples and RDF triples into syntaxes. + + The next part contains the + Raptor Reference Manual + which comprehensively describes every class and function of the API. + + + For the latest information, see the + Raptor Home Page + and the main document overview + in this document tree. + + + + + + + + + + + + Raptor Reference Manual + + + This part contains the Raptor Reference Manual + which comprehensively describes every class and function of the API. + + + The previous part contains the + Raptor Tutorial + explaining how to use the API parts. + + + For the latest information, see the + Raptor Home Page + and the main document overview + in this document tree. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index + +
diff --git a/docs/raptor-formats.xml b/docs/raptor-formats.xml new file mode 100644 index 0000000..674a2b8 --- /dev/null +++ b/docs/raptor-formats.xml @@ -0,0 +1,498 @@ + + +Syntax Formats supported in Raptor + +This chapter describes the syntax formats supported +by parsers and serializers in Raptor. + + +
+Introduction + +The parsers and serializers in raptor can handle different MIME Types with different levels of quality (Q). A Q of 1.0 indicates that the parser or serializer will be able to read or write the full format with high quality, and it should be the prefered parser or serializer for that mime type. Lower Q values indicate either additional mime type support (for parsing) or less-preferred mime types (for serializing). A serializer typically has just 1 mime type of Q 1.0; the preferred type. +
+ +
+MIME Types by Parser + + + Gleaning Resource Descriptions from Dialects of Languages (grddl) + + + text/html with q 0.2 + application/xhtml+xml with q 0.4 + + + + + N-Quads (nquads) + + + text/x-nquads with q 1.0 + + + + + N-Triples (ntriples) + + + application/n-triples with q 1.0 + text/plain with q 0.1 + + + + + RDF/A via librdfa (rdfa) + + + text/html with q 0.6 + application/xhtml+xml with q 0.8 + + + + + RDF/JSON (either Triples or Resource-Centric) (json) + + + application/json with q 0.1 + text/json with q 0.1 + + + + + RDF/XML (rdfxml) + + + application/rdf+xml with q 1.0 + text/rdf with q 0.6 + + + + + RSS Tag Soup (rss-tag-soup) + + + application/rss with q 0.8 + application/rss+xml with q 0.8 + text/rss with q 0.8 + application/xml with q 0.3 + text/xml with q 0.3 + application/atom+xml with q 0.3 + + + + + TriG - Turtle with Named Graphs (trig) + + + application/x-trig with q 1.0 + + + + + Turtle Terse RDF Triple Language (turtle) + + + text/turtle with q 1.0 + application/x-turtle with q 1.0 + application/turtle with q 1.0 + text/n3 with q 0.3 + text/rdf+n3 with q 0.3 + application/rdf+n3 with q 0.3 + + + + + +
+ +
+MIME Types by Serializer + + + Atom 1.0 (atom) + + + application/atom+xml with q 1.0 + + + + + GraphViz DOT format (dot) + + + text/x-graphviz with q 0.5 + + + + + HTML Table (html) + + + application/xhtml+xml with q 1.0 + text/html with q 1.0 + + + + + N-Quads (nquads) + + + text/x-nquads with q 1.0 + + + + + N-Triples (ntriples) + + + application/n-triples with q 1.0 + text/plain with q 0.1 + + + + + RDF/JSON Resource-Centric (json) + + + application/json with q 1.0 + text/json with q 0.1 + + + + + RDF/JSON Triples (json-triples) + + + application/json with q 0.0 + text/json with q 0.1 + + + + + RDF/XML (rdfxml) + + + application/rdf+xml with q 1.0 + text/rdf with q 0.6 + + + + + RDF/XML (Abbreviated) (rdfxml-abbrev) + + + application/rdf+xml with q 0.0 + + + + + RDF/XML (XMP Profile) (rdfxml-xmp) + + + application/rdf+xml with q 0.0 + + + + + RSS 1.0 (rss-1.0) + + + application/rss+xml with q 1.0 + application/rss with q 0.3 + text/rss with q 0.3 + application/xml with q 0.3 + text/xml with q 0.3 + + + + + Turtle Terse RDF Triple Language (turtle) + + + text/turtle with q 1.0 + application/turtle with q 1.0 + application/x-turtle with q 0.8 + text/n3 with q 0.3 + text/rdf+n3 with q 0.3 + application/rdf+n3 with q 0.3 + + + + + mKR my Knowledge Representation Language (mkr) + + + text/mkr with q 1.0 + application/mkr with q 1.0 + application/x-mkr with q 0.8 + text/n3 with q 0.3 + text/rdf+n3 with q 0.3 + application/rdf+n3 with q 0.3 + + + + + +
+ +
+MIME Types Index + + + application/atom+xml + + + Atom 1.0 Serializer (atom) with q 1.0 + RSS Tag Soup Parser (rss-tag-soup) with q 0.3 + + + + + application/json + + + RDF/JSON Resource-Centric Serializer (json) with q 1.0 + RDF/JSON (either Triples or Resource-Centric) Parser (json) with q 0.1 + RDF/JSON Triples Serializer (json-triples) with q 0.0 + + + + + application/mkr + + + mKR my Knowledge Representation Language Serializer (mkr) with q 1.0 + No parser. + + + + + application/n-triples + + + N-Triples Parser (ntriples) with q 1.0 + N-Triples Serializer (ntriples) with q 1.0 + + + + + application/rdf+n3 + + + Turtle Terse RDF Triple Language Parser (turtle) with q 0.3 + Turtle Terse RDF Triple Language Serializer (turtle) with q 0.3 + mKR my Knowledge Representation Language Serializer (mkr) with q 0.3 + + + + + application/rdf+xml + + + RDF/XML Parser (rdfxml) with q 1.0 + RDF/XML Serializer (rdfxml) with q 1.0 + RDF/XML (XMP Profile) Serializer (rdfxml-xmp) with q 0.0 + RDF/XML (Abbreviated) Serializer (rdfxml-abbrev) with q 0.0 + + + + + application/rss + + + RSS Tag Soup Parser (rss-tag-soup) with q 0.8 + RSS 1.0 Serializer (rss-1.0) with q 0.3 + + + + + application/rss+xml + + + RSS 1.0 Serializer (rss-1.0) with q 1.0 + RSS Tag Soup Parser (rss-tag-soup) with q 0.8 + + + + + application/turtle + + + Turtle Terse RDF Triple Language Parser (turtle) with q 1.0 + Turtle Terse RDF Triple Language Serializer (turtle) with q 1.0 + + + + + application/x-mkr + + + mKR my Knowledge Representation Language Serializer (mkr) with q 0.8 + No parser. + + + + + application/x-trig + + + TriG - Turtle with Named Graphs Parser (trig) with q 1.0 + No serializer. + + + + + application/x-turtle + + + Turtle Terse RDF Triple Language Parser (turtle) with q 1.0 + Turtle Terse RDF Triple Language Serializer (turtle) with q 0.8 + + + + + application/xhtml+xml + + + HTML Table Serializer (html) with q 1.0 + RDF/A via librdfa Parser (rdfa) with q 0.8 + Gleaning Resource Descriptions from Dialects of Languages Parser (grddl) with q 0.4 + + + + + application/xml + + + RSS Tag Soup Parser (rss-tag-soup) with q 0.3 + RSS 1.0 Serializer (rss-1.0) with q 0.3 + + + + + text/html + + + HTML Table Serializer (html) with q 1.0 + RDF/A via librdfa Parser (rdfa) with q 0.6 + Gleaning Resource Descriptions from Dialects of Languages Parser (grddl) with q 0.2 + + + + + text/json + + + RDF/JSON (either Triples or Resource-Centric) Parser (json) with q 0.1 + RDF/JSON Triples Serializer (json-triples) with q 0.1 + RDF/JSON Resource-Centric Serializer (json) with q 0.1 + + + + + text/mkr + + + mKR my Knowledge Representation Language Serializer (mkr) with q 1.0 + No parser. + + + + + text/n3 + + + Turtle Terse RDF Triple Language Parser (turtle) with q 0.3 + Turtle Terse RDF Triple Language Serializer (turtle) with q 0.3 + mKR my Knowledge Representation Language Serializer (mkr) with q 0.3 + + + + + text/plain + + + N-Triples Parser (ntriples) with q 0.1 + N-Triples Serializer (ntriples) with q 0.1 + + + + + text/rdf + + + RDF/XML Parser (rdfxml) with q 0.6 + RDF/XML Serializer (rdfxml) with q 0.6 + + + + + text/rdf+n3 + + + Turtle Terse RDF Triple Language Parser (turtle) with q 0.3 + Turtle Terse RDF Triple Language Serializer (turtle) with q 0.3 + mKR my Knowledge Representation Language Serializer (mkr) with q 0.3 + + + + + text/rss + + + RSS Tag Soup Parser (rss-tag-soup) with q 0.8 + RSS 1.0 Serializer (rss-1.0) with q 0.3 + + + + + text/turtle + + + Turtle Terse RDF Triple Language Parser (turtle) with q 1.0 + Turtle Terse RDF Triple Language Serializer (turtle) with q 1.0 + + + + + text/x-graphviz + + + GraphViz DOT format Serializer (dot) with q 0.5 + No parser. + + + + + text/x-nquads + + + N-Quads Parser (nquads) with q 1.0 + N-Quads Serializer (nquads) with q 1.0 + + + + + text/xml + + + RSS Tag Soup Parser (rss-tag-soup) with q 0.3 + RSS 1.0 Serializer (rss-1.0) with q 0.3 + + + + + +
+ +
+ + + diff --git a/docs/raptor-parsers.xml b/docs/raptor-parsers.xml new file mode 100644 index 0000000..de4593a --- /dev/null +++ b/docs/raptor-parsers.xml @@ -0,0 +1,262 @@ + + +Parsers in Raptor (syntax to triples) + +
+Introduction + +This section describes the parsers that can be compiled into +Raptor and their options. The exact parsers supported may vary +by different builds of raptor and can be queried at run-time by +use of the +raptor_world_get_parser_description +function + +The options that may be set on parsers can also +be queried at run-time with the +raptor_world_get_option_description +function. + +
+ + +
+GRDDL parser (name <literal>grddl</literal>) +A parser for the +Gleaning Resource Descriptions from Dialects of Languages (GRDDL), +W3C Proposed Recommendation of 2007-07-16 which allows reading XHTML +and XML as RDF triples by using profiles in the document that declare +XSLT transforms from the XHTML or XML content into RDF/XML or other +RDF syntax which can then be parsed. + +The GRDDL parser is rather complex and different from the other +parsers in that it retrieves URIs, reads HTML documents (possibly +with errors), transforms the documents with XSLT and turns the result +into a single graph. The default configuration of the GRDDL parser +also reads microformats (hcard, hcalendar) and follows <link> +tags that point to RDF/XML. Parts of the GRDDL process can be +altered by configuration, which are describe below. + + +The GRDDL parser defines 'base', 'Base' and 'url' XSLT parameters +with the value of the base URI to allow some XSLT sheets to work. These +set of parameters cannot be disabled. + + +If the XSLT transform returns an empty string, no further +processing of the result is done, and a warning is generated. The +xsl:output method is mapped to result document mime types as follows: +'text' to text/plain; 'xml' to application/xml and 'html' to text/html. +Any result that is of type 'application/xml' or unknown mime type +is assumed to be RDF/XML. + + +The URIs that are processed during GRDDL operations can be checked +and skipped if required using a handler set with the +raptor_parser_set_uri_filter() +function. If the handler returns non-0, the URI is rejected. +This uses +raptor_www_set_uri_filter() +internally. + + +If the value of option +RAPTOR_OPTION_WWW_TIMEOUT +if set to a number >0, it is used as the timeout in seconds +for retrieving of URIs during GRDDL processing. +This uses +raptor_www_set_connection_timeout() +internally. + + +The hardcoded support for hcard and hcalendar +microformats can be disabled by setting parser option +RAPTOR_OPTION_MICROFORMATS +to 0 +or using +raptor_parser_set_option() +with option +RAPTOR_OPTION_STRICT +and a boolean value of 1. + + +The GRDDL parser by default will try an XML parser on the +content followed by a lax HTML parser. This can be disabled by +setting parser option +RAPTOR_OPTION_HTML_TAG_SOUP +to 0 +or using +raptor_parser_set_option() +with option +RAPTOR_OPTION_STRICT +and a boolean value of 1. + + +The GRDDL parser by default will try to look for an HTML +<link> tag that points to RDF/XML. This can be disabled by +setting parser option +RAPTOR_OPTION_HTML_LINK +to 0 +or using +raptor_parser_set_option() +with option +RAPTOR_OPTION_STRICT +and a boolean value of 1. + + +
+ + +
+Guess parser (name <literal>guess</literal>) + +This is a special parser that picks the actual parser to use based +on the content type, the content bytes or the content identifier. The +content name can be either from a local file or from a URI. + + +If the protocol that delivered the content (such as HTTP) +provided a Content Type (aka MIME Type) then +this will be the primary means for identifying th ecotnent. + + +The secondary means to identify the content are the bytes of +the content (if available), otherwise the content identifier is used, +which is the least reliable. + + +
+ + +
+JSON parser (name <literal>json</literal>) + +A parser for both the +resource-centric RDF/JSON syntax as defined by Talis at +RDF/JSON Specification +and the triples-centric format based on the SPARQL results in JSON format. + + +
+ + +
+N-Triples parser (name <literal>ntriples</literal>) + +A parser for the +N-Triples +syntax as used by the +W3C RDF Core working group +for the RDF Test Cases. + + +
+ + +
+RDFa parser - (name <literal>rdfa</literal>) + +A parser for the +RDFa +syntax, W3C Candidate Recommendation 20 June 2008 which allows reading XHTML +and XML as RDF triples by interpreting attributes on elements to +describe which ones have RDF semantics. This is implemented via +librdfa +linked inside Raptor, written by Manu Sporny of Digital Bazaar, +and licensed with the same license as Raptor. + + + +This parser is beta quality and passes all but 4 of the RDFa tests as +of Raptor 1.4.18. + + +
+ + +
+RDF/XML parser - default (name <literal>rdfxml</literal>) + +A parser for the standard +RDF/XML syntax +as revised by the +W3C RDF Core working group. + +This is the default parser in Raptor. + +Features of this parser: + +Fully handles the RDF/XML syntax updates for XML Base, xml:lang, RDF datatyping and Collections. + +Handles all RDF vocabularies such as FOAF, RSS 1.0, Dublin Core, OWL, DOAP + +Handles rdf:resource / resource attributes + +Uses expat and/or (GNOME) libxml XML parsers as available or required + + + +
+ + +
+RSS Tag Soup parser (name <literal>rss-tag-soup</literal>) + +A parser for the multiple XML RSS formats that use the elements +such as channel, item, +title, description +in different ways. +This includes support for the Atom 1.0 syndication format defined in IETF +RFC 4287 + + +The parser attempts to turn the input into +RSS 1.0 +RDF triples in the RSS 1.0 model of a syndication feed. +This includes triples for RSS Enclosures. + + + +True RSS 1.0 when +wanted to be used as a full RDF vocabulary, is best parsed by the +RDF/XML parser (name rdfxml). + + +
+ + +
+TRiG parser (name <literal>trig</literal>) + +A parser for the +TriG - Turtle with Named Graphs +syntax. + + +The parser is alpha quality and may not support the entire TRiG +specification. + +
+ + +
+Turtle Terse RDF Triple Language parser (name <literal>turtle</literal>) + +A parser for the +Turtle Terse RDF Triple Language +syntax, designed as a useful subset of +Notation 3. + + +
+ + +
+ + diff --git a/docs/raptor-serializers.xml b/docs/raptor-serializers.xml new file mode 100644 index 0000000..d18b905 --- /dev/null +++ b/docs/raptor-serializers.xml @@ -0,0 +1,195 @@ + + +Serializers in Raptor (triples to syntax) + +
+Introduction + +This section describes the serializers that can be compiled into +Raptor and their options. The exact serializers supported may vary +by different builds of raptor and can be queried at run-time by use of the +raptor_world_get_serializer_description +function + +The optional options that may be set on parsers can also +be queried at run-time with the +raptor_world_get_option_description +function. + +
+ + +
+Atom 1.0 serializer (name <literal>atom</literal>) + +A serializer to the Atom 1.0 syndication format defined in IETF +RFC 4287. +This serializes an RDF graph written in the RSS 1.0 data model +to Atom 1.0 plus optionally writes extra RDF triples. + + +The extra RDF triples are written into an at:md metadata block, along +with at:feedmap and at:entrymap elements to describe the RSS 1.0 +predicate to Atom 1.0 elements mappings for the feed and entry blocks +respecively. The extra triples are enabled when serializer option +'rssTriples' is set to string value 'atom-triples'. + + + +If no atom triples content type field (at:contentType predicate) is +given, the type is set to 'text/html' when writing out an +atom:content field in Atom 1.0 format. + + +
+ + +
+JSON serializers (name <literal>json</literal> and name <literal>json-triples</literal>) + +Two serializers that write JSON in either a resource-centric +format with name json and in a triple-dump format +with name json-triples. The resource-centric +format is based on the Talis +RDF/JSON +design and the triple-dump format based on the SPARQL query results in JSON +design. + + +
+ + +
+mKR serializer - default (name <literal>mkr</literal>) + +A serializer for the +mKR (my Knowledge Representation) Language + + +
+ + +
+N-Quads serializer - default (name <literal>nquads</literal>) + +A serializer to the +N-Quads +extension to N-Triples, providing an optional 4th context graph term +at the end of the line when a named graph is associated with a triple +(the triple is contained in a named graph). This is useful for seeing the +output of named graphs or dealing with SPARQL Datasets. + + +
+ + +
+N-Triples serializer - default (name <literal>ntriples</literal>) + +A serializer to the +N-Triples +syntax as used by the +W3C RDF Core working group +for the RDF Test Cases. + + +
+ + +
+RDF/XML serializer (name <literal>rdfxml</literal>) + +A serializer to the standard +RDF/XML syntax +as revised by the +W3C RDF Core working group. +This writes a plain triple-based RDF/XML serialization with no +optimisation or pretty-printing. + + +
+ + +
+RDF/XML (Abbreviated) serializer (name <literal>rdfxml-abbrev</literal>) + +An RDF/XML serializer using several of the RDF/XML +abbreviations to provide a more compact readable format, at the cost +of some pre-processing. This is suitable for small documents. + + +
+ + +
+RDF/XML (XMP Profile) serializer (name <literal>rdfxml-xmp</literal>) +A serializer to the Adobe XMP profile of RDF/XML suitable for +embedding inside an external document. Embedding means that the +XML header is omitted, wheras for other XML serializings, it is +always emitted. + + +
+ + +
+Turtle serializer (name <literal>turtle</literal>) +A serializer for the +Turtle Terse RDF Triple Language +syntax, designed as a useful subset of +Notation 3. + + +
+ + +
+RSS 1.0 serializer (name <literal>rss-1.0</literal>) +A serializer to the +RDF Site Summary (RSS) 1.0 +format for describing a syndication feed of items. + + +By default this only serializes the RDF triples that describe +the RSS channel and items found. If serialiser option 'rssTriples' +is set to value 'rdf-xml' then any additional triples found will +be included in the channel or item output. + + +
+ + +
+GraphViz dot serializer (name <literal>dot</literal>) +A serializer to the +GraphViz DOT format. + + +This serializer has a set of associated serializer options +that may be set to customise the output colors using +raptor_serializer_set_option() +with the appropriate option name and value as given below. + + + +RAPTOR_OPTION_RESOURCE_BORDER Border color of resource nodes +RAPTOR_OPTION_LITERAL_BORDER Border color of literal nodes +RAPTOR_OPTION_BNODE_BORDER Border color of blank nodes +RAPTOR_OPTION_RESOURCE_FILL Fill color of resource nodes +RAPTOR_OPTION_LITERAL_FILL Fill color of literal nodes +RAPTOR_OPTION_BNODE_FILL Fill color of blank nodes + + + +
+ + +
+ + diff --git a/docs/raptor-tutorial-intro.xml b/docs/raptor-tutorial-intro.xml new file mode 100644 index 0000000..58640bb --- /dev/null +++ b/docs/raptor-tutorial-intro.xml @@ -0,0 +1,25 @@ + + +Initialising and Finishing using the Library + +Raptor requires initialising a raptor_world object before using +any of the classes which take the world object as an argument in +their constructors. The function to make the world object is +raptor_new_world() and the destructor raptor_free_world(). + + raptor_world* world; + world = raptor_new_world(); + ... + raptor_free_world(world); + + + + + + diff --git a/docs/raptor-tutorial-parsing.xml b/docs/raptor-tutorial-parsing.xml new file mode 100644 index 0000000..0112731 --- /dev/null +++ b/docs/raptor-tutorial-parsing.xml @@ -0,0 +1,642 @@ + + +Parsing syntaxes to RDF Triples + +
+Introduction + + +The typical sequence of operations to parse is to create a parser +object, set various handlers and options, start the parsing, send +some syntax content to the parser object, finish the parsing and +destroy the parser object. + +Several parts of this process are optional, including actually +using the triple results, which is useful as a syntax checking +process. + +
+ +
+Create the Parser object + +The parser can be created directly from a known name such as +rdfxml for the W3C Recommendation RDF/XML syntax: + + raptor_parser* rdf_parser; + + rdf_parser = raptor_new_parser(world, "rdfxml"); + +or the name can be discovered from an description +as discussed in Querying Functionality + + +The parser can also be created by identifying the syntax by a +URI, specifying the syntax by a MIME Type, providng an identifier for +the content such as filename or URI string or giving some initial +content bytes that can be used to guess. +Using the +raptor_new_parser_for_content() +function, all of these can be given as optional parameters, using NULL +or 0 for undefined parameters. The constructor will then use as much of +this information as possible. + + + raptor_parser* rdf_parser; + + +Create a parser that reads the MIME Type for RDF/XML +application/rdf+xml + + rdf_parser = raptor_new_parser_for_content(world, NULL, "application/rdf+xml", NULL, 0, NULL); + + + +Create a parser that can read a syntax identified by the URI +for Turtle http://www.dajobe.org/2004/01/turtle/, +which has no registered MIME Type at this date: + + syntax_uri = raptor_new_uri(world, "http://www.dajobe.org/2004/01/turtle/"); + + rdf_parser = raptor_new_parser_for_content(world, syntax_uri, NULL, NULL, 0, NULL); + + + +Create a parser that recognises the identifier foo.rss: + + rdf_parser = raptor_new_parser_for_content(world, NULL, NULL, NULL, 0, "foo.rss"); + + + +Create a parser that recognises the content in buffer: + + rdf_parser = raptor_new_parser_for_content(world, NULL, NULL, buffer, len, NULL); + + + +Any of the constructor calls can return NULL if no matching +parser could be found, or the construction failed in another way. + + +
+ + +
+Parser options + +There are several + options that can be set on parsers. +The exact list of options can be found at run time via the +Querying Functionality +or in the API reference for +raptor_option. + + +Options are integer enumerations of the + raptor_option enum and have +typed values that are either booleans, integers or strings. +The function that sets options for parsers is +raptor_parser_set_option() +used as follows: + + /* Set a boolean or integer valued option to value 1 */ + raptor_parser_set_option(rdf_parser, option, NULL, 1); + + /* Set a string valued option to value "abc" */ + raptor_parser_set_option(rdf_parser, option, "abc", -1); + + + + +There is a corresponding function for reading the values of parser +option +raptor_parser_get_option() +which takes the option enumeration parameter and returns the boolean / +integer or string value correspondingly into the appropriate pointer +argument. + + /* Get a boolean or integer option value */ + int int_var; + raptor_parser_get_option(rdf_parser, option, NULL, &int_var); + + /* Get a string option value */ + char* string_var; + raptor_parser_get_option(rdf_parser, option, &string_var, NULL); + + + +
+ + +
+Set RDF statement callback handler + +The main reason to parse a syntax is to get RDF triples +returned and these are return by a user-defined handler function +which is called with parameters of a user data pointer and a +raptor statement, which includes the triple terms plus the +optional named graph term. The handler is set with +raptor_parser_set_statement_handler() +as follows: + + void + statement_handler(void* user_data, const raptor_statement* statement) + { + /* do something with the statement */ + } + + raptor_parser_set_statement_handler(rdf_parser, user_data, statements_handler); + + + +Setting a stateemnt handler function is optional since parsing +without returning statements is a valid use, such as when parsing in +order to validate a syntax. + +
+ + +
+Set parsing log message handlers + +Any time before parsing is called, a log handler can be set +on the world object via the +raptor_world_set_log_handler() +method to report errors and warnings from parsing. +The method takes a user data argument plus a handler callback of type +raptor_log_handler +with a signature that looks like this: + +void +message_handler(void *user_data, raptor_log_message* message) +{ + /* do something with the message */ +} + +The handler gets the user data pointer as well as a +raptor_log_handler +pointer that includes associated location information, such as the +log level, +raptor_locator, +and the log message itself. The locator +structure contains full information on the details of where in the +file or URI the message occurred. + + +
+ + +
+Set the identifier creator handler + +Identifiers are created in some parsers by generating them +automatically or via hints given a syntax. Raptor can customise this +process using a user-supplied identifier handler function. +For example, in RDF/XML generated blank node identifiers and those +those specified rdf:nodeID are passed through this +process. Setting a handler allows the identifier generation mechanism to be +fully replaced. A lighter alternative is to use +raptor_world_set_generate_bnodeid_parameters() +to adjust the default algorithm for generated identifiers. + + +It is used as follows + + raptor_generate_bnodeid_handler bnodeid_handler; + + raptor_world_set_generate_bnodeid_handler(rdf_parser, user_data, bnodeid_handler); + + + +The bnodeid_handler takes the following signature: + +unsigned char* +generate_id_handler(void* user_data, unsigned char* user_id) +{ + /* return a new generated ID based on user_id (optional) */ +} + +where user_id an optional user-supplied identifier, +such as the value of a rdf:nodeID in RDF/XML. + + +
+ + +
+Set namespace declared handler + +Raptor can report when namespace prefix/URIs are declared in +during parsing a syntax such as those in XML, RDF/XML or Turtle. +A handler function can be set to receive these declarations using +the namespace handler method. + + raptor_namespace_handler namespaces_handler; + + raptor_parser_set_namespace_handler(rdf_parser, user_data, namespaces_handler); + + + +The namespaces_handler takes the following signature: + +void +namespaces_handler(void* user_data, raptor_namespace *nspace) +{ + /* */ +} + +This may be called multiple times with the same namespace, +if the namespace is declared inside different XML sub-trees. + + + +
+ + +
+Set the parsing strictness + +raptor_parser_set_option() +with option +RAPTOR_OPTION_STRICT +allows setting of the parser strictness flag. The default is lax parsing, +accepting older or deprecated syntax forms but may generate a warning. Setting +to non-0 (true) will cause parser errors to be generated in these cases. + +
+ + +
+Provide syntax content to parse + +The operation of turning syntax into RDF triples has several +alternatives from functions that do most of the work starting from a +URI to functions that allow passing in data buffers. + + +Parsing and MIME Types +The mime type of the retrieved content is not used to choose +a parser unless the parser is of type guess. +The guess parser will send an Accept: header +for all known parser syntax mime types (if a URI request is made) +and based on the response, including the identifiers used, +pick the appropriate parser to execute. See +raptor_world_guess_parser_name() +for a full discussion of the inputs to the guessing. + + + +
+Parse the content from a URI (<link linkend="raptor-parser-parse-uri"><function>raptor_parser_parse_uri()</function></link>) + +The URI is resolved and the content read from it and passed to +the parser: + + raptor_parser_parse_uri(rdf_parser, uri, base_uri); + +The base_uri is optional (can be +NULL) and will default to the +uri. + +
+ + +
+Parse the content of a URI using an existing WWW connection (<link linkend="raptor-parser-parse-uri-with-connection"><function>raptor_parser_parse_uri_with_connection()</function></link>) + +The URI is resolved using an existing WWW connection (for +example a libcurl CURL handle) to allow for any existing +WWW configuration to be reused. See +raptor_new_www_with_connection +for full details of how this works. The content is then read from the +result of resolving the URI: + + raptor_parser_parse_uri_with_connection(rdf_parser, uri, base_uri, connection); + +The base_uri is optional (can be +NULL) and will default to the +uri. + +
+ + +
+Parse the content of a C <literal>FILE*</literal> (<link linkend="raptor-parser-parse-file-stream"><function>raptor_parser_parse_file_stream()</function></link>) + +Parsing can read from a C STDIO file handle: + + stream = fopen(filename, "rb"); + raptor_parser_parse_file_stream(rdf_parser, stream, filename, base_uri); + fclose(stream); + +This function can use take an optional filename which +is used in locator error messages. +The base_uri may be required by some parsers +and if NULL will cause the parsing to fail. +This requirement can be checked by looking at the flags in +the parser description using +raptor_world_get_parser_description(). + +
+ + +
+Parse the content of a file URI (<link linkend="raptor-parser-parse-file"><function>raptor_parser_parse_file()</function></link>) + +Parsing can read from a URI known to be a file: URI: + + raptor_parser_parse_file(rdf_parser, file_uri, base_uri); + +This function requires that the file_uri is +a file URI, that is +raptor_uri_uri_string_is_file_uri( raptor_uri_as_string( file_uri) ) +must be true. +The base_uri may be required by some parsers +and if NULL will cause the parsing to fail. + +
+ + +
+Parse chunks of syntax content provided by the application (<link linkend="raptor-parser-parse-start"><function>raptor_parser_parse_start()</function></link> and <link linkend="raptor-parser-parse-chunk"><function>raptor_parser_parse_chunk()</function></link>) + + + + raptor_parser_parse_start(rdf_parser, base_uri); + while(/* not finished getting content */) { + unsigned char *buffer; + size_t buffer_len; + + /* ... obtain some syntax content in buffer of size buffer_len bytes ... */ + + raptor_parser_parse_chunk(rdf_parser, buffer, buffer_len, 0); + } + raptor_parser_parse_chunk(rdf_parser, NULL, 0, 1); /* no data and is_end = 1 */ + +The base_uri argument to +raptor_parser_parse_start() +may be required by some parsers +and if NULL will cause the parsing to fail. + + +On the last +raptor_parser_parse_chunk() +call, or after the loop is ended, the is_end +parameter must be set to non-0. Content can be passed with the +final call. If no content is present at the end (such as in +some kind of end of file situation), then a 0-length +buffer_len or NULL buffer can be used. + +The minimal case is an entire parse in one chunk as follows: + + raptor_parser_parse_start(rdf_parser, base_uri); + raptor_parser_parse_chunk(rdf_parser, buffer, buffer_len, 1); /* is_end = 1 */ + + +
+ +
+ + +
+Restrict parser network access + + +Parsing can cause network requests to be performed, especially +if a URI is given as an argument such as with +raptor_parser_parse_uri() +however there may also be indirect requests such as with the +GRDDL parser that retrieves URIs depending on the results of +initial parse requests. The URIs requested may not be wanted +to be fetched or need to be filtered, and this can be done in +three ways. + + +
+Filtering parser network requests with option <link linkend="RAPTOR-OPTION-NO-NET:CAPS"><literal>RAPTOR_OPTION_NO_NET</literal></link> + +The parser option +RAPTOR_OPTION_NO_NET +can be set with +raptor_parser_set_option() +and forbids all network requests. There is no customisation with +this approach, for that see the URI filter in the next section. + + + + rdf_parser = raptor_new_parser(world, "rdfxml"); + + /* Disable internal network requests */ + raptor_parser_set_option(rdf_parser, RAPTOR_OPTION_NO_NET, NULL, 1); + + +
+ + +
+Filtering parser network requests with <link linkend="raptor-www-set-uri-filter"><function>raptor_www_set_uri_filter()</function></link> + +The +raptor_www_set_uri_filter() + +allows setting of a filtering function to operate on all URIs +retrieved by a WWW connection. This connection can be used in +parsing when operated by hand. + + + +void write_bytes_handler(raptor_www* www, void *user_data, + const void *ptr, size_t size, size_t nmemb) { +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + + raptor_parser_parse_chunk(rdf_parser, (unsigned char*)ptr, size*nmemb, 0); +} + +int uri_filter(void* filter_user_data, raptor_uri* uri) { + /* return non-0 to forbid the request */ +} + +int main(int argc, char *argv[]) { + ... + + rdf_parser = raptor_new_parser(world, "rdfxml"); + www = raptor_new_www(world); + + /* filter all URI requests */ + raptor_www_set_uri_filter(www, uri_filter, filter_user_data); + + /* make WWW write bytes to parser */ + raptor_www_set_write_bytes_handler(www, write_bytes_handler, rdf_parser); + + raptor_parser_parse_start(rdf_parser, uri); + raptor_www_fetch(www, uri); + /* tell the parser that we are done */ + raptor_parser_parse_chunk(rdf_parser, NULL, 0, 1); + + raptor_free_www(www); + raptor_free_parser(rdf_parser); + + ... +} + + + +
+ + +
+Filtering parser network requests with <link linkend="raptor-parser-set-uri-filter"><function>raptor_parser_set_uri_filter()</function></link> + + +The +raptor_parser_set_uri_filter() +allows setting of a filtering function to operate on all URIs that +the parser sees. This operates on the internal raptor_www object +used inside parsing to retrieve URIs, similar to that described in +the previous section. + + + + int uri_filter(void* filter_user_data, raptor_uri* uri) { + /* return non-0 to forbid the request */ + } + + rdf_parser = raptor_new_parser(world, "rdfxml"); + + raptor_parser_set_uri_filter(rdf_parser, uri_filter, filter_user_data); + + /* parse content as normal */ + raptor_parser_parse_uri(rdf_parser, uri, base_uri); + + +
+ + +
+Setting timeout for parser network requests with option <link linkend="RAPTOR-OPTION-WWW-TIMEOUT:CAPS"><literal>RAPTOR_OPTION_WWW_TIMEOUT</literal></link> + +If the value of option +RAPTOR_OPTION_WWW_TIMEOUT +if set to a number >0, it is used as the timeout in seconds +for retrieving of URIs during parsing (primarily for GRDDL). +This uses +raptor_www_set_connection_timeout() +internally. + + + + rdf_parser = raptor_new_parser(world, "grddl"); + + /* set internal URI retrieval maximum time to 5 seconds */ + raptor_parser_set_option(rdf_parser, RAPTOR_OPTION_WWW_TIMEOUT, NULL, 5); + + +
+ + +
+ + +
+Querying parser static information + + +These methods return information about the constructed parser +implementation corresponding to the information available +via raptor_world_get_parser_description() +for all parsers. + + +raptor_parser_get_name() returns the parser syntax name, +raptor_parser_get_description() +returns more detailed description fields including the long label and +mime_types for the parser with quality levels. + + +raptor_parser_get_accept_header() +returns a string that would be sent in an HTTP +request Accept: header for the syntaxes accepted by this +parser only. + + +
+ + +
+Querying parser run-time information + + +raptor_parser_get_locator() +returns the raptor_locator +for the current position in the input stream. The locator +structure contains full information on the details of where in the +file or URI the current parser has reached. + +
+ + +
+Aborting parsing + + +raptor_parser_parse_abort() +allows the current parsing to be aborted, at which point no further +triples will be passed to callbacks and the parser will attempt to +return control to the application. This is most useful when called +inside a handler function which allows the application to decide to stop +an active parsing. + +
+ + +
+Destroy the parser + + +To tidy up, delete the parser object as follows: + + raptor_free_parser(rdf_parser); + + + +
+ + +
+Parsing example code + + +<filename>rdfprint.c</filename>: Parse an RDF/XML file and print the triples + + + + +Compile it like this: + +$ gcc -o rdfprint rdfprint.c `pkg-config raptor2 --cflags --libs` + +and run it on an RDF file as: + +$ ./rdfprint raptor.rdf +_:genid1 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://usefulinc.com/ns/doap#Project> . +_:genid1 <http://usefulinc.com/ns/doap#name> "Raptor" . +_:genid1 <http://usefulinc.com/ns/doap#homepage> <http://librdf.org/raptor/> . +... + + + + + +
+ +
+ + + diff --git a/docs/raptor-tutorial-querying-functionality.xml b/docs/raptor-tutorial-querying-functionality.xml new file mode 100644 index 0000000..bed487d --- /dev/null +++ b/docs/raptor-tutorial-querying-functionality.xml @@ -0,0 +1,85 @@ + + +Listing built-in functionality + + +Raptor can be configured and compiled with support for different +lists of parsers and serializers. The list built into the +library can be found by means of +description functions. These take as input an +int counter and return descriptions of the object +at that offset in the list. The return value is a pointer to a +shared, read-only description of the object, or NULL if the counter +has gone too far into the list. + + + +Listing Functionality with Descriptions +Get descriptions of the parser syntaxes + + const raptor_syntax_description* + raptor_world_get_parser_description(raptor_world* world, + unsigned int counter); + + +Get descriptions of the serializer syntaxes + + const raptor_syntax_description* + raptor_world_get_serializer_description(raptor_world* world, + unsigned int counter); + + +Get descriptions of options + + raptor_option_description* + raptor_world_get_option_description(raptor_world* world, + const raptor_domain domain, + const raptor_option option); + + +Call with the appropriate domains for the class such as +RAPTOR_DOMAIN_PARSER, +RAPTOR_DOMAIN_SERIALIZER + etc. See the +raptor_domain +description for the full list. + + + + + +These functions can be called directly after creating a +raptor world object with +raptor_new_world(). +This is one way to find a parser (name) by it's MIME Type, the other +is to use the mime_type parameter of the +raptor_new_parser_for_content(). + + +List all parser options using option description + + unsigned int i; + for(i = 0; i < raptor_option_get_count(); i++) { + raptor_option_description* od; + + od = raptor_world_get_option_description(world, RAPTOR_DOMAIN_PARSER, i); + + if(od) { + /* do something with od fields such as od->name, od->label */ + } + } + +There are more examples of this usage in the source for the +rapper utility in util/rapper.c. + + + + + + diff --git a/docs/raptor-tutorial-serializing.xml b/docs/raptor-tutorial-serializing.xml new file mode 100644 index 0000000..f27b7f5 --- /dev/null +++ b/docs/raptor-tutorial-serializing.xml @@ -0,0 +1,402 @@ + + +Serializing RDF triples to a syntax + +
+Introduction + + +The typical sequence of operations to serialize is to create a +serializer object, set various callback and features, start the +serializing, send some RDF triples to the serializer object, +finish the serializing and destroy the serializer object. + + +
+ + +
+Create the Serializer object + +The serializer can be created directly from a known name using +raptor_new_serializer() +such as rdfxml for the W3C Recommendation RDF/XML syntax: + + raptor_serializer* rdf_serializer; + + rdf_serializer = raptor_new_serializer(world, "rdfxml"); + +or the name can be discovered from an description +as discussed in +Querying Functionality + +
+ + +
+Serializer options + +There are several options that can be set on serializers. +The exact list of options can be found at run time via the +Querying Functionality +or in the API reference for +raptor_option. + + +Options are integer enumerations of the +raptor_option enum and have +values that are either booleans, integers or strings. +The function that sets options for serializers is: +raptor_serializer_set_option() +used as follows: + + /* Set a boolean or integer valued option to value 1 */ + raptor_serializer_set_option(rdf_serializer, option, NULL, 1); + + /* Set a string valued option to value "abc" */ + raptor_serializer_set_option(rdf_serializer, option, "abc", -1); + + + + +There is a corresponding function for reading the values of serializer +option +raptor_serializer_get_option() +which takes the option enumeration parameter and returns the boolean / +integer or string value correspondingly into the appropriate pointer +argument. + + /* Get a boolean or integer option value */ + int int_var; + raptor_serializer_get_option(rdf_serializer, option, NULL, &int_var); + + /* Get a string option value */ + char* string_var; + raptor_serializer_get_option(rdf_serializer, option, &string_var, NULL); + + + +
+ + +
+Declare namespaces + +Raptor can use namespace prefix/URIs to abbreviate syntax +in some syntaxes such as Turtle or any XML syntax including RDF/XML, +RSS1.0 and Atom 1.0. These are declared +with raptor_serializer_set_namespace() +using a prefix and URI argument pair like this: + + const unsigned char* prefix = "ex"; + raptor_uri* uri = raptor_new_uri(world, "http://example.org"); + + raptor_serializer_set_namespace(rdf_serializer, prefix, uri); + + + +or +raptor_serializer_set_namespace_from_namespace() +from an existing namespace. This can be useful when connected up the +the namespace declarations that are generated from a parser via a +namespace handler set with +raptor_parser_set_namespace_handler() + +like this: + + static void + relay_namespaces(void* user_data, raptor_namespace *nspace) + { + raptor_serializer_set_namespace_from_namespace(rdf_serializer, nspace); + } + + ... + + rdf_parser = raptor_new_parser(world, syntax_name); + raptor_parser_set_namespace_handler(rdf_parser, rdf_serializer, relay_namespaces); + + +
+ + +
+Set error and warning handlers + +Any time before serializing is started, a log handler can be set +on the world object via the +raptor_world_set_log_handler() +method to report errors and warnings from parsing. +The method takes a user data argument plus a handler callback of type +raptor_log_handler +with a signature that looks like this: + +void +message_handler(void *user_data, raptor_log_message* message) +{ + /* do something with the message */ +} + +The handler gets the user data pointer as well as a +raptor_log_handler +pointer that includes associated location information, such as the +log level, +raptor_locator, +and the log message itself. The locator +structure contains full information on the details of where in the +file or URI the message occurred. + + +
+ + +
+Provide a destination for the serialized syntax + +The operation of turning RDF triples into a syntax has several +alternatives from functions that do most of the work writing to a file +or string to functions that allow passing in a +raptor_iostream +which can be entirely user-constructed. + +
+Serialize to a filename (<link linkend="raptor-serializer-start-to-filename"><function>raptor_serializer_start_to_filename()</function></link>) + +Serialize to a new filename +(using raptor_new_iostream_to_filename() internally) +and uses asf base URI, the file's URI. + + const char *filename = "raptor.rdf"; + raptor_serializer_start_to_filename(rdf_serializer, filename); + + +
+ +
+Serialize to a string (<link linkend="raptor-serializer-start-to-string"><function>raptor_serializer_start_to_string()</function></link>) + +Serialize to a string that is allocated by the serializer +(using raptor_new_iostream_to_string() internally). The +resulting string is only constructed after raptor_serializer_serialize_end() is called and at that +point it is assigned to the string pointer passed in, with the length +written to the optional length pointer. This function +takes an optional base URI but may be required by some serializers. + + raptor_uri* uri = raptor_new_uri(world, "http://example.org/base"); + void *string; /* destination for string */ + size_t length; /* length of constructed string */ + raptor_serializer* rdf_serializer = /* serializer created by some means */ ; + + raptor_serializer_start_to_string(rdf_serializer, uri, + &string, &length); + + + +
+ + +
+Serialize to a FILE* file handle (<link linkend="raptor-serializer-start-to-file-handle"><function>raptor_serializer_start_to_file_handle()</function></link>) + +Serialize to an existing open C FILE* file handle +(using raptor_new_iostream_to_file_handle() internally). The handle is not closed after serializing is finished. This function +takes an optional base URI but may be required by some serializers. + + raptor_uri* uri = raptor_new_uri(world, "http://example.org/base"); + FILE* fh = fopen("raptor.rdf", "wb"); + raptor_serializer* rdf_serializer = /* serializer created by some means */ ; + + raptor_serializer_start_to_file_handle(rdf_serializer, uri, fh); + + +
+ +
+Serialize to an <link linkend="raptor-iostream"><type>raptor_iostream</type></link> (<link linkend="raptor-serializer-start-to-iostream"><function>raptor_serializer_start_to_iostream()</function></link>) + +This is the most flexible serializing method as it allows +writing to any +raptor_iostream +which can be constructed to build any form of user-generated structure +via callbacks. The iostream remains owned by the caller that can continue +to write to it after the serializing is finished (after +raptor_serializer_serialize_end()) is called). + + raptor_uri* uri = raptor_new_uri(world, "http://example.org/base"); + raptor_iostream* iostream = /* iostream initialized by some means */ ; + raptor_serializer* rdf_serializer = /* serializer created by some means */ ; + + raptor_serializer_start_to_iostream(rdf_serializer, uri, iostream); + + while( /* got RDF triples */ ) { + raptor_statement* triple = /* ... triple made from somewhere ... */ ; + raptor_serializer_serialize_statement(rdf_serializer, triple); + } + raptor_serializer_serialize_end(rdf_serializer); + + raptor_free_serializer(rdf_serializer); + + /* ... write other stuff to iostream ... */ + + raptor_free_iostream(iostream); + + +
+ + +
+ + +
+Get or construct RDF Statements (Triples) + +An raptor_statement +containing the triple terms and optional graph term +can be made either by receiving them from a +raptor_parser +via parsing or can be constructed by hand. + +When constructing by hand, +the raptor_statement +structure should be allocated by the application and the fields +filled in. Each statement has three triple terms (subject, +predicate, object) and an optional graph term. The subject can be a +URI or blank node, the predicate can only be a URI and the object can +be a URI, blank node or RDF literal. RDF literals can have either +just a Unicode string, a Unicode string and a language or a Unicode +string and a datatype URI. + +The statement terms are all instances of +raptor_term +objects constructed with the appropriate constructor for +the URI, blank node or rdf literal types. The graph term +of the statement is typically a URI or blank node. + + + +<filename>rdfserialize.c</filename>: Serialize 1 triple to RDF/XML (Abbreviated) + + + + +Compile it like this: + +$ gcc -o rdfserialize rdfserialize.c `pkg-config raptor2 --cflags --libs` + +and run it with an optional base URI argument + +$ ./rdfserialize +<?xml version="1.0" encoding="utf-8"?> +<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> + <rdf:Description rdf:about="http://example.org/subject"> + <ns0:predicate xmlns:ns0="http://example.org/" xml:lang="en">An example</ns0:predicate> + </rdf:Description> +</rdf:RDF> + + + + + +
+ +
+Send RDF Triples to serializer + + +Once the serializer has been started, RDF triples can be sent to it +via the +raptor_serializer_serialize_statement() +function with a +raptor_statement +value. + + +Once all triples are sent, the serializing must be finished +with a call to +raptor_serializer_serialize_end(). +In particular, only at this point does the +raptor_iostream +get flushed or any string constructed for +raptor_serializer_start_to_string(). + + /* start the serializing somehow */ + while( /* got RDF triples */ ) { + raptor_serializer_serialize_statement(rdf_serializer, triple); + } + raptor_serializer_serialize_end(rdf_serializer); + /* now can use the serializing result (FILE, string, raptor_iostream) */ + + + +
+ + +
+Querying serializer run-time information + + +raptor_serializer_get_iostream() +gets the current serializer's raptor_iostream. + + + +raptor_serializer_get_locator() +returns the raptor_locator +for the current position in the output stream. The locator +structure contains full information on the details of where in the +file or URI the current serializer has reached. + +
+ + +
+Destroy the serializer + + +To tidy up, delete the serializer object as follows: + + raptor_free_serializer(rdf_serializer); + + + +
+ +
+Serializing example code + + +<filename>rdfcat.c</filename>: Read any RDF syntax and serialize to RDF/XML (Abbreviated) + + + + +Compile it like this: + +$ gcc -o rdfcat rdfcat.c `pkg-config raptor2 --cflags --libs` + +and run it on an RDF file as: + +$ ./rdfcat raptor.rdf +<?xml version="1.0" encoding="utf-8"?> +<rdf:RDF xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://usefulinc.com/ns/doap#"> + <rdf:Description rdf:about=""> + <foaf:maker> + <foaf:Person> + <foaf:name>Dave Beckett</foaf:name> +... + + + + + +
+ +
+ + + diff --git a/docs/raptor1-eol.html b/docs/raptor1-eol.html new file mode 100644 index 0000000..6c760de --- /dev/null +++ b/docs/raptor1-eol.html @@ -0,0 +1,108 @@ + + + + + Raptor RDF Syntax Library - Raptor 1 End of Life (EOL) + + + +

Raptor RDF Syntax Library - Raptor 1 End of Life (EOL)

+ + +

End of life timeline

+ +

Nov 2010 onwards

+ +
    +
  1. Raptor V1 last release remains +1.4.21 of 2010-01-30
  2. +
  3. Raptor V2 release 2.0.0 will happen "soon".
  4. +
  5. The next Rasqal release will support Raptor V2 only.
  6. +
  7. The next librdf release will support Raptor V2 only +(and require a Rasqal built with Raptor V2).
  8. +
+ +

In the style of open source I've been using for the Redland libraries, +which might be described as "release when it's ready, not release by date", +these dates may slip a little but the intention is that Raptor V2 becomes +the mainline.

+ +

I do NOT rule out that there will be another Raptor V1 release but +it will be ONLY for security issues (including data loss or crashes). +It will contain minimal changes and not add any new features or fix +any other type of bug.

+ + +

Developer Actions

+ +

If you use the Raptor V1 ABI/API directly, you will need to +upgrade. If you want to write conditional code, that's possible. +The redland librdf GIT source (or 1.0.12) uses the approach of macros +that rewrite V2 into V1 forms and I recommend this way since dropping +Raptor V1 support then amounts to removing the macros. +

+ +

The +Raptor V2 API documentation +has a detailed +section on the changes +and there is also an +upgrading document +plus it points to a perl script docs/upgrade-script.pl (also in the Raptor +V2 distribution) that automates some of the work (renames mostly) and +leaves markers where a human has to fix.

+ +

The Raptor V1 API documentation will remain in a frozen state available +at +http://librdf.org/raptor/api-1.4/ +

+ +

Packager Actions

+ +

If you are a packager of the redland libraries, you need to prepare for the +Raptor V1 / Raptor V2 transition which can vary depending on your +distribution's standards. The two versions share two files: the rapper +binary and the rapper.1 man page. I do not want to rename them to rapper2 +etc. since rapper is a well known utility name in RDF and I want 'rapper' +to provide the latest version.

+ +

In the Debian packaging which I maintain, these are already planned to be +in separate packages so that both libraries can be installed and you can +choose the raptor-utils2 package over raptor-utils (V1).

+ +

In other distributions where everything is in one package (BSD Ports +for example) you may have to move the rapper/rapper.1 files to the +raptor V2 package and create a new raptor1 package without them. +i.e. something like this

+ +
+
Raptor V1 package 1.4.21-X:
+
+ /usr/lib/libraptor1.so.1* ...
+ (no /usr/bin/rapper or /usr/share/man/man1/rapper.1 ) +
+
Raptor V2 package 2.0.0-1:
+
+ /usr/lib/libraptor2.so.0* ...
+ /usr/bin/rapper
+ /usr/share/man/man1/rapper.1
+ conflicts with older raptor1 packages before 1.4.21-X +
+
+ +

The other thing to deal with is that when Rasqal is built against +Raptor V2, it has internal change that mean librdf has to also be built +against rasqal-with-raptor2. This needs enforcing with packaging +dependencies.

+ +

This packaging work can be done/started as soon as Raptor V2 2.0.0 +is released which will be "soon".

+ +

Dave Beckett, 2010-11-07

+ +
+ +

Copyright (C) 2010 Dave Beckett

+ + + diff --git a/docs/raptor2-overrides.txt b/docs/raptor2-overrides.txt new file mode 100644 index 0000000..e0b0a4f --- /dev/null +++ b/docs/raptor2-overrides.txt @@ -0,0 +1,50 @@ + +raptor_iostream +raptor_iostream* raptor_iostream; + + +raptor_namespace +raptor_namespace* raptor_namespace; + + +raptor_namespace_stack +raptor_namespace_stack* raptor_namespace_stack; + + +raptor_parser +raptor_parser* raptor_parser; + + +raptor_qname +raptor_qname* raptor_qname; + + +raptor_sequence +raptor_sequence* raptor_sequence; + + +raptor_serializer +raptor_serializer* raptor_serializer; + + +raptor_stringbuffer +raptor_stringbuffer* raptor_stringbuffer; + + +raptor_uri +raptor_uri* raptor_uri; + + +raptor_www +raptor_www* raptor_www; + + +raptor_xml_element +raptor_xml_element* raptor_xml_element; + + +raptor_xml_writer +raptor_xml_writer* raptor_xml_writer; + + + diff --git a/docs/raptor2-sections.txt b/docs/raptor2-sections.txt new file mode 100644 index 0000000..b2de695 --- /dev/null +++ b/docs/raptor2-sections.txt @@ -0,0 +1,517 @@ +
+section-world +raptor_world +raptor_new_world +raptor_world_open +raptor_free_world +raptor_world_flag +raptor_world_set_flag +raptor_world_set_libxslt_security_preferences +raptor_world_set_log_handler +raptor_world_get_parser_description +raptor_world_is_parser_name +raptor_world_guess_parser_name +raptor_world_get_serializer_description +raptor_world_is_serializer_name +raptor_world_generate_bnodeid +raptor_world_set_generate_bnodeid_handler +raptor_world_set_generate_bnodeid_parameters +raptor_world_get_parsers_count +raptor_world_get_serializers_count +
+ +
+section-general +RAPTOR_VERSION +RAPTOR_VERSION_MAJOR +RAPTOR_VERSION_MINOR +RAPTOR_VERSION_RELEASE +RAPTOR_VERSION_STRING +raptor_version_major +raptor_version_minor +raptor_version_release +raptor_version_decimal +raptor_copyright_string +raptor_home_url_string +raptor_license_string +raptor_short_copyright_string +raptor_version_string +raptor_owl_namespace_uri +raptor_rdf_namespace_uri +raptor_rdf_schema_namespace_uri +raptor_xml_literal_datatype_uri_string +raptor_xml_namespace_uri +raptor_xmlschema_datatypes_namespace_uri +raptor_statement_handler +raptor_snprintf +raptor_vasprintf +raptor_vsnprintf +raptor_vsnprintf2 +raptor_sort_r +raptor_log_handler +raptor_log_message +raptor_log_level +raptor_log_level_get_label +raptor_domain +raptor_domain_get_label +raptor_data_compare_handler +raptor_data_compare_arg_handler +raptor_data_context_free_handler +raptor_data_context_print_handler +raptor_data_free_handler +raptor_data_malloc_handler +raptor_data_print_handler +raptor_generate_bnodeid_handler +raptor_syntax_bitflags +raptor_syntax_description +raptor_syntax_description_validate +raptor_type_q +
+ +
+section-option +raptor_option +raptor_option_description +raptor_option_get_count +raptor_option_value_type +raptor_option_get_value_type_label +raptor_world_get_option_description +raptor_free_option_description +raptor_world_get_option_from_uri +
+ +
+section-memory +raptor_free_memory +raptor_alloc_memory +raptor_calloc_memory +
+ +
+section-triples +raptor_term_type +raptor_term +raptor_term_value +raptor_term_blank_value +raptor_term_literal_value +raptor_new_term_from_blank +raptor_new_term_from_counted_blank +raptor_new_term_from_literal +raptor_new_term_from_counted_literal +raptor_new_term_from_counted_uri_string +raptor_new_term_from_uri +raptor_new_term_from_uri_string +raptor_new_term_from_counted_string +raptor_term_copy +raptor_term_compare +raptor_term_equals +raptor_free_term +raptor_term_to_counted_string +raptor_term_to_string +raptor_term_ntriples_write +raptor_term_to_turtle_counted_string +raptor_term_to_turtle_string +raptor_term_turtle_write +raptor_statement +raptor_new_statement +raptor_new_statement_from_nodes +raptor_free_statement +raptor_statement_copy +raptor_statement_compare +raptor_statement_equals +raptor_statement_init +raptor_statement_clear +raptor_statement_print +raptor_statement_print_as_ntriples +raptor_statement_ntriples_write +
+ +
+section-constants +raptor_rdf_namespace_uri_len +raptor_rdf_schema_namespace_uri_len +raptor_xml_literal_datatype_uri_string_len +RAPTOR_RDF_MS_URI +RAPTOR_RDF_SCHEMA_URI +RAPTOR_XMLSCHEMA_DATATYPES_URI +RAPTOR_OWL_URI +
+ +
+section-avltree +raptor_avltree +raptor_avltree_bitflags +raptor_new_avltree +raptor_free_avltree +raptor_avltree_add +raptor_avltree_delete +raptor_avltree_print +raptor_avltree_remove +raptor_avltree_search +raptor_avltree_set_print_handler +raptor_avltree_size +raptor_avltree_trim +raptor_avltree_visit +raptor_avltree_iterator +raptor_new_avltree_iterator +raptor_free_avltree_iterator +raptor_avltree_iterator_get +raptor_avltree_iterator_is_end +raptor_avltree_iterator_next +raptor_avltree_visit_handler +
+ +
+section-parser +raptor_parser +raptor_new_parser +raptor_new_parser_for_content +raptor_free_parser +raptor_graph_mark_handler +raptor_namespace_handler +raptor_parser_set_statement_handler +raptor_graph_mark_flags +raptor_parser_set_graph_mark_handler +raptor_parser_set_namespace_handler +raptor_parser_get_description +raptor_parser_get_locator +raptor_parser_parse_abort +raptor_parser_parse_chunk +raptor_parser_parse_file +raptor_parser_parse_file_stream +raptor_parser_parse_iostream +raptor_parser_parse_start +raptor_parser_parse_uri +raptor_parser_parse_uri_with_connection +raptor_parser_get_graph +raptor_parser_get_name +raptor_parser_set_option +raptor_parser_get_option +raptor_parser_get_accept_header +raptor_parser_set_uri_filter +raptor_parser_get_world +
+ +
+section-locator +raptor_locator +raptor_locator_print +raptor_locator_format +raptor_locator_line +raptor_locator_column +raptor_locator_byte +raptor_locator_file +raptor_locator_uri +
+ +
+section-serializer +raptor_serializer +raptor_new_serializer +raptor_free_serializer +raptor_serializer_start_to_iostream +raptor_serializer_start_to_filename +raptor_serializer_start_to_string +raptor_serializer_start_to_file_handle +raptor_serializer_set_namespace +raptor_serializer_set_namespace_from_namespace +raptor_serializer_serialize_statement +raptor_serializer_serialize_end +raptor_serializer_flush +raptor_serializer_get_description +raptor_serializer_get_iostream +raptor_serializer_get_locator +raptor_serializer_set_option +raptor_serializer_get_option +raptor_serializer_get_world +
+ +
+section-uri +raptor_uri +raptor_new_uri +raptor_new_uri_from_counted_string +raptor_new_uri_from_uri_local_name +raptor_new_uri_from_uri_or_file_string +raptor_new_uri_relative_to_base +raptor_new_uri_relative_to_base_counted +raptor_new_uri_from_id +raptor_new_uri_for_rdf_concept +raptor_new_uri_for_xmlbase +raptor_new_uri_for_retrieval +raptor_free_uri +raptor_uri_compare +raptor_uri_equals +raptor_uri_copy +raptor_uri_as_string +raptor_uri_as_counted_string +raptor_uri_to_relative_counted_uri_string +raptor_uri_to_relative_uri_string +raptor_uri_to_counted_string +raptor_uri_to_string +raptor_uri_resolve_uri_reference +raptor_uri_counted_filename_to_uri_string +raptor_uri_filename_to_uri_string +raptor_uri_uri_string_is_absolute +raptor_uri_uri_string_is_file_uri +raptor_uri_uri_string_to_filename +raptor_uri_uri_string_to_filename_fragment +raptor_uri_uri_string_to_counted_filename_fragment +raptor_uri_print +raptor_uri_get_world +raptor_uri_write +raptor_uri_file_exists +raptor_uri_filename_exists +raptor_uri_to_turtle_counted_string +raptor_uri_to_turtle_string +raptor_uri_turtle_write +
+ +
+section-stringbuffer +raptor_stringbuffer +raptor_new_stringbuffer +raptor_free_stringbuffer +raptor_stringbuffer_append_counted_string +raptor_stringbuffer_append_decimal +raptor_stringbuffer_append_hexadecimal +raptor_stringbuffer_append_string +raptor_stringbuffer_append_stringbuffer +raptor_stringbuffer_append_uri_escaped_counted_string +raptor_stringbuffer_prepend_counted_string +raptor_stringbuffer_prepend_string +raptor_stringbuffer_as_string +raptor_stringbuffer_length +raptor_stringbuffer_copy_to_string +raptor_stringbuffer_write +
+ + +
+section-sequence +raptor_sequence +raptor_new_sequence +raptor_new_sequence_with_context +raptor_free_sequence +raptor_sequence_delete_at +raptor_sequence_get_at +raptor_sequence_join +raptor_sequence_next_permutation +raptor_sequence_pop +raptor_sequence_print +raptor_sequence_push +raptor_sequence_reverse +raptor_sequence_set_at +raptor_sequence_shift +raptor_sequence_size +raptor_sequence_sort +raptor_sequence_sort_r +raptor_sequence_swap +raptor_sequence_unshift +
+ +
+section-www +raptor_www +raptor_new_www +raptor_new_www_with_connection +raptor_free_www +raptor_www_write_bytes_handler +raptor_www_content_type_handler +raptor_www_set_user_agent2 +raptor_www_set_user_agent +raptor_www_set_proxy2 +raptor_www_set_proxy +raptor_www_set_http_accept2 +raptor_www_set_http_accept +raptor_www_set_http_cache_control +raptor_www_set_write_bytes_handler +raptor_www_set_connection_timeout +raptor_www_set_content_type_handler +raptor_uri_filter_func +raptor_www_set_uri_filter +raptor_www_final_uri_handler +raptor_www_get_final_uri +raptor_www_set_final_uri_handler +raptor_www_fetch +raptor_www_fetch_to_string +raptor_www_get_connection +raptor_www_set_ssl_cert_options +raptor_www_set_ssl_verify_options +raptor_www_abort +
+ +
+section-iostream +raptor_iostream +raptor_iostream_init_func +raptor_iostream_finish_func +raptor_iostream_write_byte_func +raptor_iostream_write_bytes_func +raptor_iostream_write_end_func +raptor_iostream_read_bytes_func +raptor_iostream_read_eof_func +raptor_iostream_handler +raptor_new_iostream_from_handler +raptor_new_iostream_from_sink +raptor_new_iostream_from_filename +raptor_new_iostream_from_file_handle +raptor_new_iostream_from_string +raptor_new_iostream_to_sink +raptor_new_iostream_to_filename +raptor_new_iostream_to_file_handle +raptor_new_iostream_to_string +raptor_free_iostream +raptor_iostream_hexadecimal_write +raptor_iostream_read_bytes +raptor_iostream_read_eof +raptor_iostream_tell +raptor_iostream_counted_string_write +raptor_iostream_decimal_write +raptor_iostream_string_write +raptor_iostream_write_byte +raptor_iostream_write_bytes +raptor_iostream_write_end +raptor_bnodeid_ntriples_write +raptor_escaped_write_bitflags +raptor_string_escaped_write +raptor_term_escaped_write +raptor_uri_escaped_write +raptor_string_ntriples_write +raptor_string_python_write +
+ + +
+section-sax2 +raptor_sax2 +raptor_new_sax2 +raptor_free_sax2 +raptor_sax2_start_element_handler +raptor_sax2_end_element_handler +raptor_sax2_characters_handler +raptor_sax2_cdata_handler +raptor_sax2_comment_handler +raptor_sax2_unparsed_entity_decl_handler +raptor_sax2_external_entity_ref_handler +raptor_sax2_set_start_element_handler +raptor_sax2_set_end_element_handler +raptor_sax2_set_characters_handler +raptor_sax2_set_cdata_handler +raptor_sax2_set_comment_handler +raptor_sax2_set_unparsed_entity_decl_handler +raptor_sax2_set_external_entity_ref_handler +raptor_sax2_set_namespace_handler +raptor_sax2_set_uri_filter +raptor_sax2_parse_start +raptor_sax2_parse_chunk +raptor_sax2_inscope_xml_language +raptor_sax2_inscope_base_uri +
+ +
+section-xml +raptor_xml_element +raptor_new_xml_element +raptor_new_xml_element_from_namespace_local_name +raptor_free_xml_element +raptor_xml_element_get_name +raptor_xml_element_get_attributes +raptor_xml_element_get_attributes_count +raptor_xml_element_set_attributes +raptor_xml_element_declare_namespace +raptor_xml_element_is_empty +raptor_xml_element_get_language +raptor_xml_element_write +raptor_new_xml_writer +raptor_free_xml_writer +raptor_xml_writer_empty_element +raptor_xml_writer_start_element +raptor_xml_writer_end_element +raptor_xml_writer_cdata +raptor_xml_writer_cdata_counted +raptor_xml_writer_raw +raptor_xml_writer_raw_counted +raptor_xml_writer_comment +raptor_xml_writer_comment_counted +raptor_xml_writer_flush +raptor_xml_writer_newline +raptor_xml_writer_get_depth +raptor_xml_writer_set_option +raptor_xml_writer_get_option +raptor_xml_writer +raptor_xml_escape_string_any +raptor_xml_escape_string_any_write +raptor_xml_escape_string +raptor_xml_escape_string_write +raptor_xml_name_check +
+ +
+section-xml-qname +raptor_qname +raptor_new_qname +raptor_new_qname_from_namespace_local_name +raptor_new_qname_from_namespace_uri +raptor_qname_copy +raptor_free_qname +raptor_qname_equal +raptor_qname_string_to_uri +raptor_qname_write +raptor_qname_format_as_xml +raptor_qname_get_counted_value +raptor_qname_get_local_name +raptor_qname_get_namespace +raptor_qname_get_value +raptor_qname_to_counted_name +
+ +
+section-xml-namespace +raptor_namespace +raptor_new_namespace_from_uri +raptor_new_namespaces +raptor_namespaces_init +raptor_namespaces_clear +raptor_free_namespaces +raptor_namespaces_start_namespace +raptor_namespaces_start_namespace_full +raptor_namespaces_end_for_depth +raptor_namespaces_get_default_namespace +raptor_namespaces_find_namespace +raptor_namespaces_find_namespace_by_uri +raptor_namespaces_namespace_in_scope +raptor_new_namespace +raptor_free_namespace +raptor_namespace_get_uri +raptor_namespace_get_prefix +raptor_namespace_get_counted_prefix +raptor_namespace_write +raptor_namespace_stack +raptor_namespace_stack_start_namespace +raptor_namespace_format_as_xml +raptor_xml_namespace_string_parse +
+ +
+section-unicode +raptor_unichar +raptor_unicode_utf8_string_put_char +raptor_unicode_utf8_string_get_char +raptor_unicode_is_xml11_namestartchar +raptor_unicode_is_xml10_namestartchar +raptor_unicode_is_xml11_namechar +raptor_unicode_is_xml10_namechar +raptor_unicode_check_utf8_string +raptor_unicode_utf8_strlen +raptor_unicode_utf8_substr +
+ +
+section-unused +RAPTOR_API +RAPTOR_DEPRECATED +RAPTOR_PRINTF_FORMAT +RAPTOR_V2_AVAILABLE +raptor_new_world_internal +
diff --git a/docs/raptor2.types b/docs/raptor2.types new file mode 100644 index 0000000..e69de29 diff --git a/docs/rdfcat.c b/docs/rdfcat.c new file mode 100644 index 0000000..978a641 --- /dev/null +++ b/docs/rdfcat.c @@ -0,0 +1,55 @@ +#include +#include + +/* rdfcat.c: parse any RDF syntax and serialize to RDF/XML-Abbrev */ + +static raptor_serializer* rdf_serializer; + +static void +serialize_triple(void* user_data, raptor_statement* triple) +{ + raptor_serializer_serialize_statement(rdf_serializer, triple); +} + +static void +declare_namespace(void* user_data, raptor_namespace *nspace) +{ + raptor_serializer_set_namespace_from_namespace(rdf_serializer, nspace); +} + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + raptor_parser* rdf_parser = NULL; + unsigned char *uri_string; + raptor_uri *uri, *base_uri; + + world = raptor_new_world(); + + uri_string = raptor_uri_filename_to_uri_string(argv[1]); + uri = raptor_new_uri(world, uri_string); + base_uri = raptor_uri_copy(uri); + + /* Ask raptor to work out which parser to use */ + rdf_parser = raptor_new_parser(world, "guess"); + raptor_parser_set_statement_handler(rdf_parser, NULL, serialize_triple); + raptor_parser_set_namespace_handler(rdf_parser, NULL, declare_namespace); + + rdf_serializer = raptor_new_serializer(world, "rdfxml-abbrev"); + + raptor_serializer_start_to_file_handle(rdf_serializer, base_uri, stdout); + raptor_parser_parse_file(rdf_parser, uri, base_uri); + raptor_serializer_serialize_end(rdf_serializer); + + raptor_free_serializer(rdf_serializer); + raptor_free_parser(rdf_parser); + + raptor_free_uri(base_uri); + raptor_free_uri(uri); + raptor_free_memory(uri_string); + + raptor_free_world(world); + + return 0; +} diff --git a/docs/rdfprint.c b/docs/rdfprint.c new file mode 100644 index 0000000..093aa98 --- /dev/null +++ b/docs/rdfprint.c @@ -0,0 +1,42 @@ +#include +#include + +/* rdfprint.c: print triples from parsing RDF/XML */ + +static void +print_triple(void* user_data, raptor_statement* triple) +{ + raptor_statement_print_as_ntriples(triple, stdout); + fputc('\n', stdout); +} + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + raptor_parser* rdf_parser = NULL; + unsigned char *uri_string; + raptor_uri *uri, *base_uri; + + world = raptor_new_world(); + + rdf_parser = raptor_new_parser(world, "rdfxml"); + + raptor_parser_set_statement_handler(rdf_parser, NULL, print_triple); + + uri_string = raptor_uri_filename_to_uri_string(argv[1]); + uri = raptor_new_uri(world, uri_string); + base_uri = raptor_uri_copy(uri); + + raptor_parser_parse_file(rdf_parser, uri, base_uri); + + raptor_free_parser(rdf_parser); + + raptor_free_uri(base_uri); + raptor_free_uri(uri); + raptor_free_memory(uri_string); + + raptor_free_world(world); + + return 0; +} diff --git a/docs/rdfserialize.c b/docs/rdfserialize.c new file mode 100644 index 0000000..ecbc6b3 --- /dev/null +++ b/docs/rdfserialize.c @@ -0,0 +1,47 @@ +#include +#include +#include + +/* rdfserialize.c: serialize 1 triple to RDF/XML-Abbrev */ + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + raptor_serializer* rdf_serializer = NULL; + unsigned char *uri_string; + raptor_uri *base_uri; + raptor_statement* triple; + + world = raptor_new_world(); + + uri_string = raptor_uri_filename_to_uri_string(argv[1]); + base_uri = raptor_new_uri(world, uri_string); + + rdf_serializer = raptor_new_serializer(world, "rdfxml-abbrev"); + raptor_serializer_start_to_file_handle(rdf_serializer, base_uri, stdout); + + /* Make a triple with URI subject, URI predicate, literal object */ + triple = raptor_new_statement(world); + triple->subject = raptor_new_term_from_uri_string(world, (const unsigned char*)"http://example.org/subject"); + triple->predicate = raptor_new_term_from_uri_string(world, (const unsigned char*)"http://example.org/predicate"); + triple->object = raptor_new_term_from_literal(world, + (const unsigned char*)"An example literal", + NULL, + (const unsigned char*)"en"); + + /* Write the triple */ + raptor_serializer_serialize_statement(rdf_serializer, triple); + + /* Delete the triple */ + raptor_free_statement(triple); + + raptor_serializer_serialize_end(rdf_serializer); + raptor_free_serializer(rdf_serializer); + + raptor_free_uri(base_uri); + raptor_free_memory(uri_string); + + raptor_free_world(world); + return 0; +} diff --git a/docs/upgrade-script.pl b/docs/upgrade-script.pl new file mode 100644 index 0000000..18d2524 --- /dev/null +++ b/docs/upgrade-script.pl @@ -0,0 +1,625 @@ +#!/usr/bin/perl -pi~ +# Perl script to upgrade raptor2 1.4.21 to 2.0.0 + + +# Replace statement fields with term fields. +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; +s|->object_type|->object.type|g; +s|->predicate|->predicate.value.uri|g; +s|->predicate_type|->predicate.type|g; +s|->subject_type|->subject.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->object_literal_language|->object.value.literal.language|g; +s|->object_literal_datatype|->object.value.literal.datatype|g; + + +# Deleted functions +s|^(.*raptor_compare_strings.*)$|/\* WARNING: raptor_compare_strings - deleted. Trivial utility function removed. \*/ $1|g; +s|^(.*raptor_copy_identifier.*)$|/\* WARNING: raptor_copy_identifier - deleted. Use raptor_term_copy() with #raptor_term objects. \*/ $1|g; +s|^(.*raptor_error_handlers_init.*)$|/\* WARNING: raptor_error_handlers_init - deleted. Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() \*/ $1|g; +s|^(.*raptor_error_handlers_init_v2.*)$|/\* WARNING: raptor_error_handlers_init_v2 - deleted. Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() \*/ $1|g; +s|^(.*raptor_feature_value_type.*)$|/\* WARNING: raptor_feature_value_type - deleted. Use raptor_world_get_option_description() for the option and access the value_type field. \*/ $1|g; +s|^(.*raptor_finish.*)$|/\* WARNING: raptor_finish - deleted. Use raptor_free_world() with #raptor_world object. \*/ $1|g; +s|^(.*raptor_free_identifier.*)$|/\* WARNING: raptor_free_identifier - deleted. Use raptor_free_term() with #raptor_term objects. \*/ $1|g; +s|^(.*raptor_init.*)$|/\* WARNING: raptor_init - deleted. Use raptor_new_world() to create a new #raptor_world object. \*/ $1|g; +s|^(.*raptor_iostream_get_bytes_written_count.*)$|/\* WARNING: raptor_iostream_get_bytes_written_count - deleted. Deprecated for raptor_iostream_tell(). \*/ $1|g; +s|^(.*raptor_iostream_write_string_turtle.*)$|/\* WARNING: raptor_iostream_write_string_turtle - deleted. Deprecated for raptor_string_python_write(). \*/ $1|g; +s|^(.*raptor_new_identifier.*)$|/\* WARNING: raptor_new_identifier - deleted. Replaced by raptor_new_term_from_blank(), raptor_new_term_from_literal() or raptor_new_term_from_blank() and #raptor_term class. \*/ $1|g; +s|^(.*raptor_new_identifier_v2.*)$|/\* WARNING: raptor_new_identifier_v2 - deleted. Replaced by raptor_new_term_from_blank(), raptor_new_term_from_literal() or raptor_new_term_from_blank() and #raptor_term class. \*/ $1|g; +s|^(.*raptor_ntriples_string_as_utf8_string.*)$|/\* WARNING: raptor_ntriples_string_as_utf8_string - deleted. Deprecated internal debug function. \*/ $1|g; +s|^(.*raptor_ntriples_term_as_string.*)$|/\* WARNING: raptor_ntriples_term_as_string - deleted. Deprecated internal debug function. \*/ $1|g; +s|^(.*raptor_print_ntriples_string.*)$|/\* WARNING: raptor_print_ntriples_string - deleted. Use raptor_string_ntriples_write() with a #raptor_iostream \*/ $1|g; +s|^(.*raptor_print_statement_detailed.*)$|/\* WARNING: raptor_print_statement_detailed - deleted. Deprecated internal function. \*/ $1|g; +s|^(.*raptor_sequence_print_string.*)$|/\* WARNING: raptor_sequence_print_string - deleted. Trivial utility function removed. \*/ $1|g; +s|^(.*raptor_sequence_print_uri.*)$|/\* WARNING: raptor_sequence_print_uri - deleted. Deprecated for raptor_uri_print() \*/ $1|g; +s|^(.*raptor_sequence_set_print_handler.*)$|/\* WARNING: raptor_sequence_set_print_handler - deleted. Use the argument in the raptor_new_sequence() constructor instead. \*/ $1|g; +s|^(.*raptor_sequence_set_print_handler_v2.*)$|/\* WARNING: raptor_sequence_set_print_handler_v2 - deleted. Use the argument in the raptor_new_sequence() constructor instead. \*/ $1|g; +s|^(.*raptor_serializer_set_error_handler.*)$|/\* WARNING: raptor_serializer_set_error_handler - deleted. Replaced by raptor_world_set_log_handler() on the #raptor_world object. \*/ $1|g; +s|^(.*raptor_serializer_set_warning_handler.*)$|/\* WARNING: raptor_serializer_set_warning_handler - deleted. Replaced by raptor_world_set_log_handler() on the #raptor_world object. \*/ $1|g; +s|^(.*raptor_set_error_handler.*)$|/\* WARNING: raptor_set_error_handler - deleted. Replaced by raptor_world_set_log_handler() on the #raptor_world object. \*/ $1|g; +s|^(.*raptor_set_fatal_error_handler.*)$|/\* WARNING: raptor_set_fatal_error_handler - deleted. Replaced by raptor_world_set_log_handler() on the #raptor_world object. \*/ $1|g; +s|^(.*raptor_set_parser_strict.*)$|/\* WARNING: raptor_set_parser_strict - deleted. Replaced by raptor_parser_set_option() with option RAPTOR_OPTION_STRICT \*/ $1|g; +s|^(.*raptor_set_warning_handler.*)$|/\* WARNING: raptor_set_warning_handler - deleted. Replaced by raptor_world_set_log_handler() on the #raptor_world object. \*/ $1|g; +s|^(.*raptor_statement_part_as_counted_string.*)$|/\* WARNING: raptor_statement_part_as_counted_string - deleted. Better done via methods of #raptor_term class such as raptor_term_to_counted_string(). \*/ $1|g; +s|^(.*raptor_statement_part_as_counted_string_v2.*)$|/\* WARNING: raptor_statement_part_as_counted_string_v2 - deleted. Better done via methods of #raptor_term class such as raptor_term_to_counted_string(). \*/ $1|g; +s|^(.*raptor_statement_part_as_string.*)$|/\* WARNING: raptor_statement_part_as_string - deleted. Better done via methods of #raptor_term class such as raptor_term_to_string(). \*/ $1|g; +s|^(.*raptor_statement_part_as_string_v2.*)$|/\* WARNING: raptor_statement_part_as_string_v2 - deleted. Better done via methods of #raptor_term class such as raptor_term_to_string(). \*/ $1|g; +s|^(.*raptor_uri_get_handler.*)$|/\* WARNING: raptor_uri_get_handler - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_get_handler_v2.*)$|/\* WARNING: raptor_uri_get_handler_v2 - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_set_handler.*)$|/\* WARNING: raptor_uri_set_handler - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_set_handler_v2.*)$|/\* WARNING: raptor_uri_set_handler_v2 - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_www_finish.*)$|/\* WARNING: raptor_www_finish - deleted. No need for this to be public. \*/ $1|g; +s|^(.*raptor_www_finish_v2.*)$|/\* WARNING: raptor_www_finish_v2 - deleted. No need for this to be public. \*/ $1|g; +s|^(.*raptor_www_init.*)$|/\* WARNING: raptor_www_init - deleted. No need for this to be public. \*/ $1|g; +s|^(.*raptor_www_init_v2.*)$|/\* WARNING: raptor_www_init_v2 - deleted. No need for this to be public. \*/ $1|g; +s|^(.*raptor_www_no_www_library_init_finish.*)$|/\* WARNING: raptor_www_no_www_library_init_finish - deleted. Deprecated for raptor_world_set_flag(). \*/ $1|g; +s|^(.*raptor_www_no_www_library_init_finish_v2.*)$|/\* WARNING: raptor_www_no_www_library_init_finish_v2 - deleted. Deprecated for raptor_world_set_flag(). \*/ $1|g; +s|^(.*raptor_www_set_error_handler.*)$|/\* WARNING: raptor_www_set_error_handler - deleted. Replaced by raptor_world_set_log_handler() on the #raptor_world object. \*/ $1|g; + +# Deleted types +s|^(.*raptor_error_handlers.*)$|/\* WARNING: raptor_error_handlers - deleted. Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() \*/ $1|g; +s|^(.*raptor_free_uri_func.*)$|/\* WARNING: raptor_free_uri_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_libxml_flags.*)$|/\* WARNING: raptor_libxml_flags - deleted. replaced by raptor_world_set_flags() with #raptor_world_flag \*/ $1|g; +s|^(.*raptor_message_handler.*)$|/\* WARNING: raptor_message_handler - deleted. Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() \*/ $1|g; +s|^(.*raptor_message_handler_closure.*)$|/\* WARNING: raptor_message_handler_closure - deleted. Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() \*/ $1|g; +s|^(.*raptor_new_uri_for_rdf_concept_func.*)$|/\* WARNING: raptor_new_uri_for_rdf_concept_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_new_uri_from_uri_local_name_func.*)$|/\* WARNING: raptor_new_uri_from_uri_local_name_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_new_uri_func.*)$|/\* WARNING: raptor_new_uri_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_new_uri_relative_to_base_func.*)$|/\* WARNING: raptor_new_uri_relative_to_base_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_ntriples_parser.*)$|/\* WARNING: raptor_ntriples_parser - deleted. replaced by #raptor_parser \*/ $1|g; +s|^(.*raptor_ntriples_term_type.*)$|/\* WARNING: raptor_ntriples_term_type - deleted. replaced by #raptor_term_type \*/ $1|g; +s|^(.*raptor_uri_as_counted_string_func.*)$|/\* WARNING: raptor_uri_as_counted_string_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_as_string_func.*)$|/\* WARNING: raptor_uri_as_string_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_compare_func.*)$|/\* WARNING: raptor_uri_compare_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_copy_func.*)$|/\* WARNING: raptor_uri_copy_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_equals_func.*)$|/\* WARNING: raptor_uri_equals_func - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_handler.*)$|/\* WARNING: raptor_uri_handler - deleted. Entire URI implementation is internal and not replaceable. \*/ $1|g; +s|^(.*raptor_uri_source.*)$|/\* WARNING: raptor_uri_source - deleted. URI source was useless. \*/ $1|g; + +# Deleted enums and constants +s|^(.*RAPTOR_IDENTIFIER_TYPE_ORDINAL.*)$|/\* WARNING: RAPTOR_IDENTIFIER_TYPE_ORDINAL - deleted. Deprecated value deleted. \*/ $1|g; +s|^(.*RAPTOR_URI_SOURCE_UNKNOWN.*)$|/\* WARNING: RAPTOR_URI_SOURCE_UNKNOWN - deleted. URI source concept removed. \*/ $1|g; +s|^(.*RAPTOR_URI_SOURCE_NOT_URI.*)$|/\* WARNING: RAPTOR_URI_SOURCE_NOT_URI - deleted. URI source concept removed. \*/ $1|g; +s|^(.*RAPTOR_URI_SOURCE_ELEMENT.*)$|/\* WARNING: RAPTOR_URI_SOURCE_ELEMENT - deleted. URI source concept removed. \*/ $1|g; +s|^(.*RAPTOR_URI_SOURCE_ATTRIBUTE.*)$|/\* WARNING: RAPTOR_URI_SOURCE_ATTRIBUTE - deleted. URI source concept removed. \*/ $1|g; +s|^(.*RAPTOR_URI_SOURCE_ID.*)$|/\* WARNING: RAPTOR_URI_SOURCE_ID - deleted. URI source concept removed. \*/ $1|g; +s|^(.*RAPTOR_URI_SOURCE_URI.*)$|/\* WARNING: RAPTOR_URI_SOURCE_URI - deleted. URI source concept removed. \*/ $1|g; +s|^(.*RAPTOR_URI_SOURCE_GENERATED.*)$|/\* WARNING: RAPTOR_URI_SOURCE_GENERATED - deleted. URI source concept removed. \*/ $1|g; +s|^(.*RAPTOR_URI_SOURCE_BLANK_ID.*)$|/\* WARNING: RAPTOR_URI_SOURCE_BLANK_ID - deleted. URI source concept removed. \*/ $1|g; +s|^(.*RAPTOR_FEATURE_ASSUME_IS_RDF.*)$|/\* WARNING: RAPTOR_FEATURE_ASSUME_IS_RDF - deleted. Never used. \*/ $1|g; +s|^(.*RAPTOR_FEATURE_START_URI.*)$|/\* WARNING: RAPTOR_FEATURE_START_URI - deleted. Never used. \*/ $1|g; +s|^(.*RAPTOR_GENID_TYPE_BNODEID.*)$|/\* WARNING: RAPTOR_GENID_TYPE_BNODEID - deleted. There is just one type of generated ID now. \*/ $1|g; +s|^(.*RAPTOR_GENID_TYPE_BAGID.*)$|/\* WARNING: RAPTOR_GENID_TYPE_BAGID - deleted. There is just one type of generated ID now. \*/ $1|g; + +# Renamed functions +s|raptor_format_locator\(|raptor_locator_format\(|g; +s|raptor_get_feature_count\(|raptor_option_get_count\(|g; +s|raptor_get_locator\(|raptor_parser_get_locator\(|g; +s|raptor_get_name\(|raptor_parser_get_name\(|g; +s|raptor_guess_parser_name_v2\(|raptor_world_guess_parser_name\(|g; +s|raptor_namespace_copy\(|raptor_namespace_stack_start_namespace\(|g; +s|raptor_namespaces_format\(|raptor_namespace_format_as_xml\(|g; +s|raptor_namespaces_qname_from_uri\(|raptor_new_qname_from_namespace_uri\(|g; +s|raptor_new_namespace_parts_from_string\(|raptor_xml_namespace_string_parse\(|g; +s|raptor_new_parser_for_content_v2\(|raptor_new_parser_for_content\(|g; +s|raptor_new_parser_v2\(|raptor_new_parser\(|g; +s|raptor_new_qname_from_namespace_local_name_v2\(|raptor_new_qname_from_namespace_local_name\(|g; +s|raptor_new_serializer_v2\(|raptor_new_serializer\(|g; +s|raptor_new_uri_from_id_v2\(|raptor_new_uri_from_id\(|g; +s|raptor_new_uri_from_uri_local_name_v2\(|raptor_new_uri_from_uri_local_name\(|g; +s|raptor_new_uri_relative_to_base_v2\(|raptor_new_uri_relative_to_base\(|g; +s|raptor_new_uri_v2\(|raptor_new_uri\(|g; +s|raptor_parse_abort\(|raptor_parser_parse_abort\(|g; +s|raptor_parse_chunk\(|raptor_parser_parse_chunk\(|g; +s|raptor_parse_file\(|raptor_parser_parse_file\(|g; +s|raptor_parse_file_stream\(|raptor_parser_parse_file_stream\(|g; +s|raptor_parse_uri\(|raptor_parser_parse_uri\(|g; +s|raptor_parse_uri_with_connection\(|raptor_parser_parse_uri_with_connection\(|g; +s|raptor_serialize_end\(|raptor_serializer_serialize_end\(|g; +s|raptor_serialize_set_namespace\(|raptor_serializer_set_namespace\(|g; +s|raptor_serialize_set_namespace_from_namespace\(|raptor_serializer_set_namespace_from_namespace\(|g; +s|raptor_serialize_start\(|raptor_serializer_start_to_iostream\(|g; +s|raptor_serialize_start_to_file_handle\(|raptor_serializer_start_to_file_handle\(|g; +s|raptor_serialize_start_to_filename\(|raptor_serializer_start_to_filename\(|g; +s|raptor_serialize_start_to_iostream\(|raptor_serializer_start_to_iostream\(|g; +s|raptor_serialize_start_to_string\(|raptor_serializer_start_to_string\(|g; +s|raptor_serializer_syntax_name_check_v2\(|raptor_world_is_serializer_name\(|g; +s|raptor_set_namespace_handler\(|raptor_parser_set_namespace_handler\(|g; +s|raptor_set_statement_handler\(|raptor_parser_set_statement_handler\(|g; +s|raptor_start_parse\(|raptor_parser_parse_start\(|g; +s|raptor_uri_is_file_uri\(|raptor_uri_uri_string_is_file_uri\(|g; +s|raptor_utf8_check\(|raptor_unicode_check_utf8_string\(|g; +s|raptor_www_free\(|raptor_free_www\(|g; +s|raptor_www_new_v2\(|raptor_new_www\(|g; +s|raptor_www_new_with_connection_v2\(|raptor_new_www_with_connection\(|g; + +# Renamed enums and constants +s|RAPTOR_IDENTIFIER_TYPE_UNKNOWN|RAPTOR_TERM_TYPE_UNKNOWN|g; +s|RAPTOR_IDENTIFIER_TYPE_RESOURCE|RAPTOR_TERM_TYPE_URI|g; +s|RAPTOR_IDENTIFIER_TYPE_ANONYMOUS|RAPTOR_TERM_TYPE_BLANK|g; +s|RAPTOR_IDENTIFIER_TYPE_PREDICATE|RAPTOR_TERM_TYPE_URI|g; +s|RAPTOR_IDENTIFIER_TYPE_LITERAL|RAPTOR_TERM_TYPE_LITERAL|g; +s|RAPTOR_IDENTIFIER_TYPE_XML_LITERAL|RAPTOR_TERM_TYPE_LITERAL|g; +s|RAPTOR_NTRIPLES_TERM_TYPE_URI_REF|RAPTOR_TERM_TYPE_URI|g; +s|RAPTOR_NTRIPLES_TERM_TYPE_BLANK_NODE|RAPTOR_TERM_TYPE_BLANK|g; +s|RAPTOR_NTRIPLES_TERM_TYPE_LITERAL|RAPTOR_TERM_TYPE_LITERAL|g; +s|RAPTOR_FEATURE_SCANNING |RAPTOR_OPTION_SCANNING|g; +s|RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES|RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES|g; +s|RAPTOR_FEATURE_ALLOW_OTHER_PARSETYPES|RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES|g; +s|RAPTOR_FEATURE_ALLOW_BAGID|RAPTOR_OPTION_ALLOW_BAGID|g; +s|RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST|RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST|g; +s|RAPTOR_FEATURE_NORMALIZE_LANGUAGE|RAPTOR_OPTION_NORMALIZE_LANGUAGE|g; +s|RAPTOR_FEATURE_NON_NFC_FATAL|RAPTOR_OPTION_NON_NFC_FATAL|g; +s|RAPTOR_FEATURE_WARN_OTHER_PARSETYPES|RAPTOR_OPTION_WARN_OTHER_PARSETYPES|g; +s|RAPTOR_FEATURE_CHECK_RDF_ID|RAPTOR_OPTION_CHECK_RDF_ID|g; +s|RAPTOR_FEATURE_RELATIVE_URIS|RAPTOR_OPTION_RELATIVE_URIS|g; +s|RAPTOR_FEATURE_WRITER_AUTO_INDENT|RAPTOR_OPTION_WRITER_AUTO_INDENT|g; +s|RAPTOR_FEATURE_WRITER_AUTO_EMPTY|RAPTOR_OPTION_WRITER_AUTO_EMPTY|g; +s|RAPTOR_FEATURE_WRITER_INDENT_WIDTH|RAPTOR_OPTION_WRITER_INDENT_WIDTH|g; +s|RAPTOR_FEATURE_WRITER_XML_VERSION|RAPTOR_OPTION_WRITER_XML_VERSION|g; +s|RAPTOR_FEATURE_WRITER_XML_DECLARATION|RAPTOR_OPTION_WRITER_XML_DECLARATION|g; +s|RAPTOR_FEATURE_NO_NET|RAPTOR_OPTION_NO_NET|g; +s|RAPTOR_FEATURE_RESOURCE_BORDER|RAPTOR_OPTION_RESOURCE_BORDER|g; +s|RAPTOR_FEATURE_LITERAL_BORDER|RAPTOR_OPTION_LITERAL_BORDER|g; +s|RAPTOR_FEATURE_BNODE_BORDER|RAPTOR_OPTION_BNODE_BORDER|g; +s|RAPTOR_FEATURE_RESOURCE_FILL|RAPTOR_OPTION_RESOURCE_FILL|g; +s|RAPTOR_FEATURE_LITERAL_FILL|RAPTOR_OPTION_LITERAL_FILL|g; +s|RAPTOR_FEATURE_BNODE_FILL|RAPTOR_OPTION_BNODE_FILL|g; +s|RAPTOR_FEATURE_HTML_TAG_SOUP|RAPTOR_OPTION_HTML_TAG_SOUP|g; +s|RAPTOR_FEATURE_MICROFORMATS|RAPTOR_OPTION_MICROFORMATS|g; +s|RAPTOR_FEATURE_HTML_LINK|RAPTOR_OPTION_HTML_LINK|g; +s|RAPTOR_FEATURE_WWW_TIMEOUT|RAPTOR_OPTION_WWW_TIMEOUT|g; +s|RAPTOR_FEATURE_WRITE_BASE_URI|RAPTOR_OPTION_WRITE_BASE_URI|g; +s|RAPTOR_FEATURE_WWW_HTTP_CACHE_CONTROL|RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL|g; +s|RAPTOR_FEATURE_WWW_HTTP_USER_AGENT|RAPTOR_OPTION_WWW_HTTP_USER_AGENT|g; +s|RAPTOR_FEATURE_JSON_CALLBACK|RAPTOR_OPTION_JSON_CALLBACK|g; +s|RAPTOR_FEATURE_JSON_EXTRA_DATA|RAPTOR_OPTION_JSON_EXTRA_DATA|g; +s|RAPTOR_FEATURE_RSS_TRIPLES|RAPTOR_OPTION_RSS_TRIPLES|g; +s|RAPTOR_FEATURE_ATOM_ENTRY_URI|RAPTOR_OPTION_ATOM_ENTRY_URI|g; +s|RAPTOR_FEATURE_PREFIX_ELEMENTS|RAPTOR_OPTION_PREFIX_ELEMENTS|g; +s|RAPTOR_FEATURE_LAST|RAPTOR_OPTION_LAST|g; +s|RAPTOR_LOG_LEVEL_WARNING|RAPTOR_LOG_LEVEL_WARN|g; +s|RAPTOR_LIBXML_FLAGS_GENERIC_ERROR_SAVE|RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE|g; +s|RAPTOR_LIBXML_FLAGS_STRUCTURED_ERROR_SAVE|RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE|g; + +# Changed functions +s|^(.*)(raptor_feature_from_uri)(.*)$|/\* WARNING: raptor_feature_from_uri. \*/ ${1}raptor_world_get_option_from_uri${3}|g; +s|^(.*)(raptor_feature_from_uri_v2)(.*)$|/\* WARNING: raptor_feature_from_uri_v2. \*/ ${1}raptor_world_get_option_from_uri${3}|g; +s|^(.*)(raptor_features_enumerate)(.*)$|/\* WARNING: raptor_features_enumerate. Call with domain = RAPTOR_DOMAIN_PARSER \*/ ${1}raptor_world_get_option_description${3}|g; +s|^(.*)(raptor_features_enumerate_v2)(.*)$|/\* WARNING: raptor_features_enumerate_v2. Call with domain = RAPTOR_DOMAIN_PARSER \*/ ${1}raptor_world_get_option_description${3}|g; +s|^(.*)(raptor_format_locator_v2)(.*)$|/\* WARNING: raptor_format_locator_v2. \*/ ${1}raptor_locator_format${3}|g; +s|^(.*)(raptor_free_uri_v2)(.*)$|/\* WARNING: raptor_free_uri_v2. \*/ ${1}raptor_free_uri${3}|g; +s|^(.*)(raptor_get_feature)(.*)$|/\* WARNING: raptor_get_feature. \*/ ${1}raptor_parser_get_option${3}|g; +s|^(.*)(raptor_get_label)(.*)$|/\* WARNING: raptor_get_label. Use label field of returned description. \*/ ${1}raptor_parser_get_description${3}|g; +s|^(.*)(raptor_get_mime_type)(.*)$|/\* WARNING: raptor_get_mime_type. Use the mime_types array field of returned #raptor_syntax_description \*/ ${1}raptor_parser_get_description${3}|g; +s|^(.*)(raptor_get_need_base_uri)(.*)$|/\* WARNING: raptor_get_need_base_uri. Use the #RAPTOR_SYNTAX_NEED_BASE_URI bitflag in the flags field of the returned #raptor_syntax_description \*/ ${1}raptor_parser_get_description${3}|g; +s|^(.*)(raptor_guess_parser_name)(.*)$|/\* WARNING: raptor_guess_parser_name. \*/ ${1}raptor_world_guess_parser_name${3}|g; +s|^(.*)(raptor_iostream_format_hexadecimal)(.*)$|/\* WARNING: raptor_iostream_format_hexadecimal. \*/ ${1}raptor_iostream_hexadecimal_write${3}|g; +s|^(.*)(raptor_iostream_read_bytes)(.*)$|/\* WARNING: raptor_iostream_read_bytes. \*/ ${1}raptor_iostream_read_bytes${3}|g; +s|^(.*)(raptor_iostream_write_byte)(.*)$|/\* WARNING: raptor_iostream_write_byte. \*/ ${1}raptor_iostream_write_byte${3}|g; +s|^(.*)(raptor_iostream_write_bytes)(.*)$|/\* WARNING: raptor_iostream_write_bytes. \*/ ${1}raptor_iostream_write_bytes${3}|g; +s|^(.*)(raptor_iostream_write_counted_string)(.*)$|/\* WARNING: raptor_iostream_write_counted_string. \*/ ${1}raptor_iostream_counted_string_write${3}|g; +s|^(.*)(raptor_iostream_write_decimal)(.*)$|/\* WARNING: raptor_iostream_write_decimal. \*/ ${1}raptor_iostream_decimal_write${3}|g; +s|^(.*)(raptor_iostream_write_end)(.*)$|/\* WARNING: raptor_iostream_write_end. \*/ ${1}raptor_iostream_write_end${3}|g; +s|^(.*)(raptor_iostream_write_namespace)(.*)$|/\* WARNING: raptor_iostream_write_namespace. \*/ ${1}raptor_namespace_write${3}|g; +s|^(.*)(raptor_iostream_write_qname)(.*)$|/\* WARNING: raptor_iostream_write_qname. \*/ ${1}raptor_qname_write${3}|g; +s|^(.*)(raptor_iostream_write_statement_ntriples)(.*)$|/\* WARNING: raptor_iostream_write_statement_ntriples. Gains extra flag arg to decide whether to write any graph term. \*/ ${1}raptor_statement_ntriples_write${3}|g; +s|^(.*)(raptor_iostream_write_string)(.*)$|/\* WARNING: raptor_iostream_write_string. \*/ ${1}raptor_iostream_string_write${3}|g; +s|^(.*)(raptor_iostream_write_string_ntriples)(.*)$|/\* WARNING: raptor_iostream_write_string_ntriples. \*/ ${1}raptor_string_ntriples_write${3}|g; +s|^(.*)(raptor_iostream_write_string_python)(.*)$|/\* WARNING: raptor_iostream_write_string_python. \*/ ${1}raptor_string_python_write${3}|g; +s|^(.*)(raptor_iostream_write_stringbuffer)(.*)$|/\* WARNING: raptor_iostream_write_stringbuffer. \*/ ${1}raptor_stringbuffer_write${3}|g; +s|^(.*)(raptor_iostream_write_uri)(.*)$|/\* WARNING: raptor_iostream_write_uri. \*/ ${1}raptor_uri_write${3}|g; +s|^(.*)(raptor_iostream_write_uri_v2)(.*)$|/\* WARNING: raptor_iostream_write_uri_v2. \*/ ${1}raptor_uri_write${3}|g; +s|^(.*)(raptor_iostream_write_xml_any_escaped_string)(.*)$|/\* WARNING: raptor_iostream_write_xml_any_escaped_string. \*/ ${1}raptor_xml_escape_string_any_write${3}|g; +s|^(.*)(raptor_iostream_write_xml_element)(.*)$|/\* WARNING: raptor_iostream_write_xml_element. \*/ ${1}raptor_xml_element_write${3}|g; +s|^(.*)(raptor_iostream_write_xml_escaped_string)(.*)$|/\* WARNING: raptor_iostream_write_xml_escaped_string. \*/ ${1}raptor_xml_escape_string_write${3}|g; +s|^(.*)(raptor_locator_uri_v2)(.*)$|/\* WARNING: raptor_locator_uri_v2. \*/ ${1}raptor_locator_uri${3}|g; +s|^(.*)(raptor_namespaces_init)(.*)$|/\* WARNING: raptor_namespaces_init. \*/ ${1}raptor_namespaces_init${3}|g; +s|^(.*)(raptor_namespaces_init_v2)(.*)$|/\* WARNING: raptor_namespaces_init_v2. \*/ ${1}raptor_namespaces_init${3}|g; +s|^(.*)(raptor_new_iostream_from_file_handle)(.*)$|/\* WARNING: raptor_new_iostream_from_file_handle. \*/ ${1}raptor_new_iostream_from_file_handle${3}|g; +s|^(.*)(raptor_new_iostream_from_filename)(.*)$|/\* WARNING: raptor_new_iostream_from_filename. \*/ ${1}raptor_new_iostream_from_filename${3}|g; +s|^(.*)(raptor_new_iostream_from_handler)(.*)$|/\* WARNING: raptor_new_iostream_from_handler. \*/ ${1}raptor_new_iostream_from_handler${3}|g; +s|^(.*)(raptor_new_iostream_from_handler2)(.*)$|/\* WARNING: raptor_new_iostream_from_handler2. \*/ ${1}raptor_new_iostream_from_handler${3}|g; +s|^(.*)(raptor_new_iostream_from_sink)(.*)$|/\* WARNING: raptor_new_iostream_from_sink. \*/ ${1}raptor_new_iostream_from_sink${3}|g; +s|^(.*)(raptor_new_iostream_from_string)(.*)$|/\* WARNING: raptor_new_iostream_from_string. \*/ ${1}raptor_new_iostream_from_string${3}|g; +s|^(.*)(raptor_new_iostream_to_file_handle)(.*)$|/\* WARNING: raptor_new_iostream_to_file_handle. \*/ ${1}raptor_new_iostream_to_file_handle${3}|g; +s|^(.*)(raptor_new_iostream_to_filename)(.*)$|/\* WARNING: raptor_new_iostream_to_filename. \*/ ${1}raptor_new_iostream_to_filename${3}|g; +s|^(.*)(raptor_new_iostream_to_sink)(.*)$|/\* WARNING: raptor_new_iostream_to_sink. \*/ ${1}raptor_new_iostream_to_sink${3}|g; +s|^(.*)(raptor_new_iostream_to_string)(.*)$|/\* WARNING: raptor_new_iostream_to_string. \*/ ${1}raptor_new_iostream_to_string${3}|g; +s|^(.*)(raptor_new_namespaces)(.*)$|/\* WARNING: raptor_new_namespaces. \*/ ${1}raptor_new_namespaces${3}|g; +s|^(.*)(raptor_new_namespaces_v2)(.*)$|/\* WARNING: raptor_new_namespaces_v2. \*/ ${1}raptor_new_namespaces${3}|g; +s|^(.*)(raptor_new_parser)(.*)$|/\* WARNING: raptor_new_parser. \*/ ${1}raptor_new_parser${3}|g; +s|^(.*)(raptor_new_parser_for_content)(.*)$|/\* WARNING: raptor_new_parser_for_content. \*/ ${1}raptor_new_parser_for_content${3}|g; +s|^(.*)(raptor_new_qname)(.*)$|/\* WARNING: raptor_new_qname. \*/ ${1}raptor_new_qname${3}|g; +s|^(.*)(raptor_new_qname_from_namespace_local_name)(.*)$|/\* WARNING: raptor_new_qname_from_namespace_local_name. \*/ ${1}raptor_new_qname_from_namespace_local_name${3}|g; +s|^(.*)(raptor_new_sax2)(.*)$|/\* WARNING: raptor_new_sax2. \*/ ${1}raptor_new_sax2${3}|g; +s|^(.*)(raptor_new_sequence)(.*)$|/\* WARNING: raptor_new_sequence. \*/ ${1}raptor_new_sequence${3}|g; +s|^(.*)(raptor_new_sequence_v2)(.*)$|/\* WARNING: raptor_new_sequence_v2. \*/ ${1}raptor_new_sequence${3}|g; +s|^(.*)(raptor_new_serializer)(.*)$|/\* WARNING: raptor_new_serializer. \*/ ${1}raptor_new_serializer${3}|g; +s|^(.*)(raptor_new_uri)(.*)$|/\* WARNING: raptor_new_uri. \*/ ${1}raptor_new_uri${3}|g; +s|^(.*)(raptor_new_uri_for_rdf_concept)(.*)$|/\* WARNING: raptor_new_uri_for_rdf_concept. \*/ ${1}raptor_new_uri_for_rdf_concept${3}|g; +s|^(.*)(raptor_new_uri_for_rdf_concept_v2)(.*)$|/\* WARNING: raptor_new_uri_for_rdf_concept_v2. \*/ ${1}raptor_new_uri_for_rdf_concept${3}|g; +s|^(.*)(raptor_new_uri_for_retrieval_v2)(.*)$|/\* WARNING: raptor_new_uri_for_retrieval_v2. \*/ ${1}raptor_new_uri_for_retrieval${3}|g; +s|^(.*)(raptor_new_uri_for_xmlbase_v2)(.*)$|/\* WARNING: raptor_new_uri_for_xmlbase_v2. \*/ ${1}raptor_new_uri_for_xmlbase${3}|g; +s|^(.*)(raptor_new_uri_from_id)(.*)$|/\* WARNING: raptor_new_uri_from_id. \*/ ${1}raptor_new_uri_from_id${3}|g; +s|^(.*)(raptor_new_uri_from_uri_local_name)(.*)$|/\* WARNING: raptor_new_uri_from_uri_local_name. \*/ ${1}raptor_new_uri_from_uri_local_name${3}|g; +s|^(.*)(raptor_new_uri_relative_to_base)(.*)$|/\* WARNING: raptor_new_uri_relative_to_base. \*/ ${1}raptor_new_uri_relative_to_base${3}|g; +s|^(.*)(raptor_new_xml_writer)(.*)$|/\* WARNING: raptor_new_xml_writer. \*/ ${1}raptor_new_xml_writer${3}|g; +s|^(.*)(raptor_new_xml_writer_v2)(.*)$|/\* WARNING: raptor_new_xml_writer_v2. \*/ ${1}raptor_new_xml_writer${3}|g; +s|^(.*)(raptor_parser_get_feature_string)(.*)$|/\* WARNING: raptor_parser_get_feature_string. \*/ ${1}raptor_parser_get_option${3}|g; +s|^(.*)(raptor_parser_set_feature_string)(.*)$|/\* WARNING: raptor_parser_set_feature_string. \*/ ${1}raptor_parser_set_option${3}|g; +s|^(.*)(raptor_parsers_enumerate)(.*)$|/\* WARNING: raptor_parsers_enumerate. \*/ ${1}raptor_world_get_parser_description${3}|g; +s|^(.*)(raptor_parsers_enumerate_v2)(.*)$|/\* WARNING: raptor_parsers_enumerate_v2. \*/ ${1}raptor_world_get_parser_description${3}|g; +s|^(.*)(raptor_print_locator)(.*)$|/\* WARNING: raptor_print_locator. \*/ ${1}raptor_locator_print${3}|g; +s|^(.*)(raptor_print_locator_v2)(.*)$|/\* WARNING: raptor_print_locator_v2. \*/ ${1}raptor_locator_print${3}|g; +s|^(.*)(raptor_print_statement)(.*)$|/\* WARNING: raptor_print_statement. \*/ ${1}raptor_statement_print${3}|g; +s|^(.*)(raptor_print_statement_as_ntriples)(.*)$|/\* WARNING: raptor_print_statement_as_ntriples. \*/ ${1}raptor_statement_print_as_ntriples${3}|g; +s|^(.*)(raptor_print_statement_as_ntriples_v2)(.*)$|/\* WARNING: raptor_print_statement_as_ntriples_v2. \*/ ${1}raptor_statement_print_as_ntriples${3}|g; +s|^(.*)(raptor_print_statement_v2)(.*)$|/\* WARNING: raptor_print_statement_v2. \*/ ${1}raptor_statement_print${3}|g; +s|^(.*)(raptor_qname_string_to_uri)(.*)$|/\* WARNING: raptor_qname_string_to_uri. \*/ ${1}raptor_qname_string_to_uri${3}|g; +s|^(.*)(raptor_sequence_print)(.*)$|/\* WARNING: raptor_sequence_print. \*/ ${1}raptor_sequence_print${3}|g; +s|^(.*)(raptor_sequence_sort)(.*)$|/\* WARNING: raptor_sequence_sort. \*/ ${1}raptor_sequence_sort${3}|g; +s|^(.*)(raptor_serialize_statement)(.*)$|/\* WARNING: raptor_serialize_statement. \*/ ${1}raptor_serializer_serialize_statement${3}|g; +s|^(.*)(raptor_serializer_features_enumerate)(.*)$|/\* WARNING: raptor_serializer_features_enumerate. Call with domain = RAPTOR_DOMAIN_SERIALIZER \*/ ${1}raptor_world_get_option_description${3}|g; +s|^(.*)(raptor_serializer_features_enumerate_v2)(.*)$|/\* WARNING: raptor_serializer_features_enumerate_v2. Call with domain = RAPTOR_DOMAIN_SERIALIZER \*/ ${1}raptor_world_get_option_description${3}|g; +s|^(.*)(raptor_serializer_get_feature)(.*)$|/\* WARNING: raptor_serializer_get_feature. \*/ ${1}raptor_serializer_get_option${3}|g; +s|^(.*)(raptor_serializer_get_feature_string)(.*)$|/\* WARNING: raptor_serializer_get_feature_string. \*/ ${1}raptor_serializer_get_option${3}|g; +s|^(.*)(raptor_serializer_set_feature)(.*)$|/\* WARNING: raptor_serializer_set_feature. \*/ ${1}raptor_serializer_set_option${3}|g; +s|^(.*)(raptor_serializer_set_feature_string)(.*)$|/\* WARNING: raptor_serializer_set_feature_string. \*/ ${1}raptor_serializer_set_option${3}|g; +s|^(.*)(raptor_serializer_syntax_name_check)(.*)$|/\* WARNING: raptor_serializer_syntax_name_check. \*/ ${1}raptor_world_is_serializer_name${3}|g; +s|^(.*)(raptor_serializers_enumerate)(.*)$|/\* WARNING: raptor_serializers_enumerate. \*/ ${1}raptor_world_get_serializer_description${3}|g; +s|^(.*)(raptor_serializers_enumerate_v2)(.*)$|/\* WARNING: raptor_serializers_enumerate_v2. \*/ ${1}raptor_world_get_serializer_description${3}|g; +s|^(.*)(raptor_set_default_generate_id_parameters)(.*)$|/\* WARNING: raptor_set_default_generate_id_parameters. \*/ ${1}raptor_world_set_generate_bnodeid_parameters${3}|g; +s|^(.*)(raptor_set_feature)(.*)$|/\* WARNING: raptor_set_feature. \*/ ${1}raptor_parser_set_option${3}|g; +s|^(.*)(raptor_set_generate_id_handler)(.*)$|/\* WARNING: raptor_set_generate_id_handler. \*/ ${1}raptor_world_set_generate_bnodeid_handler${3}|g; +s|^(.*)(raptor_set_graph_handler)(.*)$|/\* WARNING: raptor_set_graph_handler. \*/ ${1}raptor_parser_set_graph_mark_handler${3}|g; +s|^(.*)(raptor_set_libxslt_security_preferences)(.*)$|/\* WARNING: raptor_set_libxslt_security_preferences. \*/ ${1}raptor_world_set_libxslt_security_preferences${3}|g; +s|^(.*)(raptor_statement_compare_v2)(.*)$|/\* WARNING: raptor_statement_compare_v2. \*/ ${1}raptor_statement_compare${3}|g; +s|^(.*)(raptor_syntax_name_check)(.*)$|/\* WARNING: raptor_syntax_name_check. \*/ ${1}raptor_world_is_parser_name${3}|g; +s|^(.*)(raptor_syntax_name_check_v2)(.*)$|/\* WARNING: raptor_syntax_name_check_v2. \*/ ${1}raptor_world_is_parser_name${3}|g; +s|^(.*)(raptor_syntaxes_enumerate)(.*)$|/\* WARNING: raptor_syntaxes_enumerate. \*/ ${1}raptor_world_get_parser_description${3}|g; +s|^(.*)(raptor_syntaxes_enumerate_v2)(.*)$|/\* WARNING: raptor_syntaxes_enumerate_v2. \*/ ${1}raptor_world_get_parser_description${3}|g; +s|^(.*)(raptor_unicode_char_to_utf8)(.*)$|/\* WARNING: raptor_unicode_char_to_utf8. \*/ ${1}raptor_unicode_utf8_string_put_char${3}|g; +s|^(.*)(raptor_uri_as_counted_string_v2)(.*)$|/\* WARNING: raptor_uri_as_counted_string_v2. \*/ ${1}raptor_uri_as_counted_string${3}|g; +s|^(.*)(raptor_uri_as_string_v2)(.*)$|/\* WARNING: raptor_uri_as_string_v2. \*/ ${1}raptor_uri_as_string${3}|g; +s|^(.*)(raptor_uri_compare_v2)(.*)$|/\* WARNING: raptor_uri_compare_v2. \*/ ${1}raptor_uri_compare${3}|g; +s|^(.*)(raptor_uri_copy_v2)(.*)$|/\* WARNING: raptor_uri_copy_v2. \*/ ${1}raptor_uri_copy${3}|g; +s|^(.*)(raptor_uri_equals_v2)(.*)$|/\* WARNING: raptor_uri_equals_v2. \*/ ${1}raptor_uri_equals${3}|g; +s|^(.*)(raptor_uri_print)(.*)$|/\* WARNING: raptor_uri_print. \*/ ${1}raptor_uri_print${3}|g; +s|^(.*)(raptor_uri_print_v2)(.*)$|/\* WARNING: raptor_uri_print_v2. \*/ ${1}raptor_uri_print${3}|g; +s|^(.*)(raptor_uri_resolve_uri_reference)(.*)$|/\* WARNING: raptor_uri_resolve_uri_reference. \*/ ${1}raptor_uri_resolve_uri_reference${3}|g; +s|^(.*)(raptor_uri_to_counted_string_v2)(.*)$|/\* WARNING: raptor_uri_to_counted_string_v2. \*/ ${1}raptor_uri_to_counted_string${3}|g; +s|^(.*)(raptor_uri_to_relative_counted_uri_string_v2)(.*)$|/\* WARNING: raptor_uri_to_relative_counted_uri_string_v2. \*/ ${1}raptor_uri_to_relative_counted_uri_string${3}|g; +s|^(.*)(raptor_uri_to_relative_uri_string_v2)(.*)$|/\* WARNING: raptor_uri_to_relative_uri_string_v2. \*/ ${1}raptor_uri_to_relative_uri_string${3}|g; +s|^(.*)(raptor_uri_to_string_v2)(.*)$|/\* WARNING: raptor_uri_to_string_v2. \*/ ${1}raptor_uri_to_string${3}|g; +s|^(.*)(raptor_utf8_to_unicode_char)(.*)$|/\* WARNING: raptor_utf8_to_unicode_char. \*/ ${1}raptor_unicode_utf8_string_get_char${3}|g; +s|^(.*)(raptor_world_set_libxml_flags)(.*)$|/\* WARNING: raptor_world_set_libxml_flags. \*/ ${1}raptor_world_set_flag${3}|g; +s|^(.*)(raptor_world_set_libxslt_security_preferences)(.*)$|/\* WARNING: raptor_world_set_libxslt_security_preferences. \*/ ${1}raptor_world_set_libxslt_security_preferences${3}|g; +s|^(.*)(raptor_www_fetch_to_string)(.*)$|/\* WARNING: raptor_www_fetch_to_string. \*/ ${1}raptor_www_fetch_to_string${3}|g; +s|^(.*)(raptor_www_new)(.*)$|/\* WARNING: raptor_www_new. \*/ ${1}raptor_new_www${3}|g; +s|^(.*)(raptor_www_new_with_connection)(.*)$|/\* WARNING: raptor_www_new_with_connection. \*/ ${1}raptor_new_www_with_connection${3}|g; +s|^(.*)(raptor_xml_any_escape_string)(.*)$|/\* WARNING: raptor_xml_any_escape_string. \*/ ${1}raptor_xml_escape_string_any${3}|g; +s|^(.*)(raptor_xml_escape_string)(.*)$|/\* WARNING: raptor_xml_escape_string. \*/ ${1}raptor_xml_escape_string${3}|g; +s|^(.*)(raptor_xml_writer_features_enumerate)(.*)$|/\* WARNING: raptor_xml_writer_features_enumerate. Call with domain = RAPTOR_DOMAIN_XML_WRITER \*/ ${1}raptor_world_get_option_description${3}|g; +s|^(.*)(raptor_xml_writer_features_enumerate_v2)(.*)$|/\* WARNING: raptor_xml_writer_features_enumerate_v2. Call with domain = RAPTOR_DOMAIN_XML_WRITER \*/ ${1}raptor_world_get_option_description${3}|g; +s|^(.*)(raptor_xml_writer_get_feature)(.*)$|/\* WARNING: raptor_xml_writer_get_feature. \*/ ${1}raptor_xml_writer_get_option${3}|g; +s|^(.*)(raptor_xml_writer_get_feature_string)(.*)$|/\* WARNING: raptor_xml_writer_get_feature_string. \*/ ${1}raptor_xml_writer_get_option${3}|g; +s|^(.*)(raptor_xml_writer_set_feature)(.*)$|/\* WARNING: raptor_xml_writer_set_feature. \*/ ${1}raptor_xml_writer_set_option${3}|g; +s|^(.*)(raptor_xml_writer_set_feature_string)(.*)$|/\* WARNING: raptor_xml_writer_set_feature_string. \*/ ${1}raptor_xml_writer_set_option${3}|g; + +# Changed types +s|^(.*)(raptor_feature)(.*)$|/\* WARNING: raptor_feature. And new option RAPTOR_OPTION_STRICT added. \*/ ${1}raptor_option${3}|g; +s|^(.*)(raptor_graph_handler)(.*)$|/\* WARNING: raptor_graph_handler. \*/ ${1}raptor_graph_mark_handler${3}|g; +s|^(.*)(raptor_identifier)(.*)$|/\* WARNING: raptor_identifier. Fields changed to be simpler #raptor_term_type and #raptor_term_value \*/ ${1}raptor_term${3}|g; +s|^(.*)(raptor_identifier_type)(.*)$|/\* WARNING: raptor_identifier_type. Removed several enum values to leave just URI, blank and literal types. \*/ ${1}raptor_term_type${3}|g; +s|^(.*)(raptor_iostream_handler2)(.*)$|/\* WARNING: raptor_iostream_handler2. \*/ ${1}raptor_iostream_handler${3}|g; +s|^(.*)(raptor_iostream_write_end_func)(.*)$|/\* WARNING: raptor_iostream_write_end_func. handler returns an int \*/ ${1}raptor_iostream_write_end_func${3}|g; +s|^(.*)(raptor_log_level)(.*)$|/\* WARNING: raptor_log_level. Added RAPTOR_LOG_LEVEL_TRACE, RAPTOR_LOG_LEVEL_DEBUG, RAPTOR_LOG_LEVEL_INFO. RAPTOR_LOG_LEVEL_WARNING renamed RAPTOR_LOG_LEVEL_WARN \*/ ${1}raptor_log_level${3}|g; +s|^(.*)(raptor_sequence_free_function)(.*)$|/\* WARNING: raptor_sequence_free_function. \*/ ${1}raptor_data_free_handler${3}|g; +s|^(.*)(raptor_sequence_free_handler_v2)(.*)$|/\* WARNING: raptor_sequence_free_handler_v2. \*/ ${1}raptor_data_context_free_handler${3}|g; +s|^(.*)(raptor_sequence_print_handler)(.*)$|/\* WARNING: raptor_sequence_print_handler. \*/ ${1}raptor_data_print_handler${3}|g; +s|^(.*)(raptor_sequence_print_handler_v2)(.*)$|/\* WARNING: raptor_sequence_print_handler_v2. \*/ ${1}raptor_data_context_print_handler${3}|g; +s|^(.*)(raptor_simple_message_handler)(.*)$|/\* WARNING: raptor_simple_message_handler. Replaced by generic raptor log mechanism. See raptor_world_set_log_handler() \*/ ${1}raptor_log_handler${3}|g; +s|^(.*)(raptor_statement)(.*)$|/\* WARNING: raptor_statement. fields changed to use #raptor_term \*/ ${1}raptor_statement${3}|g; +s|^(.*)(raptor_statement_handler)(.*)$|/\* WARNING: raptor_statement_handler. added const \*/ ${1}raptor_statement_handler${3}|g; +s|^(.*)(raptor_statement_v2)(.*)$|/\* WARNING: raptor_statement_v2. Fields changed to be a 3 or 4 tuple of #raptor_term \*/ ${1}raptor_statement${3}|g; +# Perl script to upgrade raptor2 2.0.3 to 2.0.4 + + +# Replace statement fields with term fields. +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object_literal_language|->object.value.literal.language|g; +s|->predicate_type|->predicate.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->subject_type|->subject.type|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; +s|->predicate|->predicate.value.uri|g; +s|->object_type|->object.type|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.4 to 2.0.5 + + +# Replace statement fields with term fields. +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object_literal_language|->object.value.literal.language|g; +s|->subject_type|->subject.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->predicate_type|->predicate.type|g; +s|->object_type|->object.type|g; +s|->predicate|->predicate.value.uri|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.5 to 2.0.6 + + +# Replace statement fields with term fields. +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; +s|->predicate|->predicate.value.uri|g; +s|->object_type|->object.type|g; +s|->predicate_type|->predicate.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->subject_type|->subject.type|g; +s|->object_literal_language|->object.value.literal.language|g; +s|->object_literal_datatype|->object.value.literal.datatype|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.6 to 2.0.7 + + +# Replace statement fields with term fields. +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object_literal_language|->object.value.literal.language|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->subject_type|->subject.type|g; +s|->predicate_type|->predicate.type|g; +s|->predicate|->predicate.value.uri|g; +s|->object_type|->object.type|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.7 to 2.0.8 + + +# Replace statement fields with term fields. +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object_literal_language|->object.value.literal.language|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->subject_type|->subject.type|g; +s|->predicate_type|->predicate.type|g; +s|->predicate|->predicate.value.uri|g; +s|->object_type|->object.type|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.9 to 2.0.10 + + +# Replace statement fields with term fields. +s|->object_literal_language|->object.value.literal.language|g; +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; +s|->predicate|->predicate.value.uri|g; +s|->object_type|->object.type|g; +s|->predicate_type|->predicate.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->subject_type|->subject.type|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.10 to 2.0.11 + + +# Replace statement fields with term fields. +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object_literal_language|->object.value.literal.language|g; +s|->subject_type|->subject.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->predicate_type|->predicate.type|g; +s|->object_type|->object.type|g; +s|->predicate|->predicate.value.uri|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.11 to 2.0.12 + + +# Replace statement fields with term fields. +s|->object_literal_language|->object.value.literal.language|g; +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; +s|->object_type|->object.type|g; +s|->predicate|->predicate.value.uri|g; +s|->predicate_type|->predicate.type|g; +s|->subject_type|->subject.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.13 to 2.0.14 + + +# Replace statement fields with term fields. +s|->predicate_type|->predicate.type|g; +s|->subject_type|->subject.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; +s|->object_type|->object.type|g; +s|->predicate|->predicate.value.uri|g; +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object_literal_language|->object.value.literal.language|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.14 to 2.0.15 + + +# Replace statement fields with term fields. +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object_literal_language|->object.value.literal.language|g; +s|->predicate_type|->predicate.type|g; +s|->subject_type|->subject.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; +s|->object_type|->object.type|g; +s|->predicate|->predicate.value.uri|g; + + +# Deleted functions + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types +# Perl script to upgrade raptor2 2.0.15 to 2.0.16 + + +# Replace statement fields with term fields. +s|->object_literal_language|->object.value.literal.language|g; +s|->object_literal_datatype|->object.value.literal.datatype|g; +s|->object_type|->object.type|g; +s|->predicate|->predicate.value.uri|g; +s|->object|->object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */|g; +s|->subject_type|->subject.type|g; +s|->subject|->subject.value.uri or subject.value.blank.string /* WARNING: must choose one */|g; +s|->predicate_type|->predicate.type|g; + + +# Deleted functions +s|^(.*raptor_www_set_user_agent.*)$|/\* WARNING: raptor_www_set_user_agent - deleted. Deprecated for raptor_www_set_user_agent2 \*/ $1|g; +s|^(.*raptor_www_set_proxy.*)$|/\* WARNING: raptor_www_set_proxy - deleted. Deprecated for raptor_www_set_proxy2 \*/ $1|g; +s|^(.*raptor_www_set_http_accept.*)$|/\* WARNING: raptor_www_set_http_accept - deleted. Deprecated for raptor_www_set_http_accept2 \*/ $1|g; + +# Deleted types + +# Deleted enums and constants + +# Renamed functions + +# Renamed enums and constants + +# Changed functions + +# Changed types diff --git a/docs/version.xml b/docs/version.xml new file mode 100644 index 0000000..a14da29 --- /dev/null +++ b/docs/version.xml @@ -0,0 +1 @@ +2.0.16 diff --git a/docs/version.xml.in b/docs/version.xml.in new file mode 100644 index 0000000..d78bda9 --- /dev/null +++ b/docs/version.xml.in @@ -0,0 +1 @@ +@VERSION@ diff --git a/examples/Makefile.am b/examples/Makefile.am new file mode 100644 index 0000000..8ea2900 --- /dev/null +++ b/examples/Makefile.am @@ -0,0 +1,75 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor examples +# +# Copyright (C) 2003-2010, David Beckett http://www.dajobe.org/ +# Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +EXTRA_PROGRAMS = \ +raptor_abort grapper \ +rdfcat rdfprint rdfserialize rdfguess rdfcount + +examples: $(EXTRA_PROGRAMS) + +CLEANFILES = $(EXTRA_PROGRAMS) + +AM_CFLAGS=$(MEM) +AM_LDFLAGS=$(MEM_LIBS) +AM_CPPFLAGS=-I$(top_srcdir)/src + +raptor_abort_SOURCES = raptor_abort.c +raptor_abort_LDADD=$(top_builddir)/src/libraptor2.la +raptor_abort_DEPENDENCIES = $(top_builddir)/src/libraptor2.la + +grapper_SOURCES = grapper.c +grapper_LDADD=$(top_builddir)/src/libraptor2.la +grapper_CFLAGS=`pkg-config --cflags gtk+-2.0 gconf-2.0` +grapper_LDFLAGS=`pkg-config --libs gtk+-2.0 gconf-2.0` +grapper_DEPENDENCIES = $(top_builddir)/src/libraptor2.la + +rdfcat_SOURCES = rdfcat.c +rdfcat_LDADD=$(top_builddir)/src/libraptor2.la +rdfcat_DEPENDENCIES = $(top_builddir)/src/libraptor2.la + +rdfprint_SOURCES = rdfprint.c +rdfprint_LDADD=$(top_builddir)/src/libraptor2.la +rdfprint_DEPENDENCIES = $(top_builddir)/src/libraptor2.la + +rdfserialize_SOURCES = rdfserialize.c +rdfserialize_LDADD=$(top_builddir)/src/libraptor2.la +rdfserialize_DEPENDENCIES = $(top_builddir)/src/libraptor2.la + +rdfguess_SOURCES = rdfguess.c +rdfguess_LDADD=$(top_builddir)/src/libraptor2.la +rdfguess_DEPENDENCIES = $(top_builddir)/src/libraptor2.la + +rdfcount_SOURCES = rdfcount.c +rdfcount_LDADD=$(top_builddir)/src/libraptor2.la +rdfcount_DEPENDENCIES = $(top_builddir)/src/libraptor2.la + + +$(top_builddir)/src/libraptor2.la: + cd $(top_builddir)/src && $(MAKE) libraptor2.la + +$(top_builddir)/../librdf/librdf.la: + cd $(top_builddir)/../librdf && $(MAKE) librdf.la + +grapper-future: + $(MAKE) clean + $(MAKE) grapper CC="$(CC) -DGTK_DISABLE_DEPRECATED" V=1 diff --git a/examples/Makefile.in b/examples/Makefile.in new file mode 100644 index 0000000..29e4d56 --- /dev/null +++ b/examples/Makefile.in @@ -0,0 +1,772 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor examples +# +# Copyright (C) 2003-2010, David Beckett http://www.dajobe.org/ +# Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +EXTRA_PROGRAMS = raptor_abort$(EXEEXT) grapper$(EXEEXT) \ + rdfcat$(EXEEXT) rdfprint$(EXEEXT) rdfserialize$(EXEEXT) \ + rdfguess$(EXEEXT) rdfcount$(EXEEXT) +subdir = examples +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_grapper_OBJECTS = grapper-grapper.$(OBJEXT) +grapper_OBJECTS = $(am_grapper_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +grapper_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(grapper_CFLAGS) \ + $(CFLAGS) $(grapper_LDFLAGS) $(LDFLAGS) -o $@ +am_raptor_abort_OBJECTS = raptor_abort.$(OBJEXT) +raptor_abort_OBJECTS = $(am_raptor_abort_OBJECTS) +am_rdfcat_OBJECTS = rdfcat.$(OBJEXT) +rdfcat_OBJECTS = $(am_rdfcat_OBJECTS) +am_rdfcount_OBJECTS = rdfcount.$(OBJEXT) +rdfcount_OBJECTS = $(am_rdfcount_OBJECTS) +am_rdfguess_OBJECTS = rdfguess.$(OBJEXT) +rdfguess_OBJECTS = $(am_rdfguess_OBJECTS) +am_rdfprint_OBJECTS = rdfprint.$(OBJEXT) +rdfprint_OBJECTS = $(am_rdfprint_OBJECTS) +am_rdfserialize_OBJECTS = rdfserialize.$(OBJEXT) +rdfserialize_OBJECTS = $(am_rdfserialize_OBJECTS) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/build/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/grapper-grapper.Po \ + ./$(DEPDIR)/raptor_abort.Po ./$(DEPDIR)/rdfcat.Po \ + ./$(DEPDIR)/rdfcount.Po ./$(DEPDIR)/rdfguess.Po \ + ./$(DEPDIR)/rdfprint.Po ./$(DEPDIR)/rdfserialize.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(grapper_SOURCES) $(raptor_abort_SOURCES) $(rdfcat_SOURCES) \ + $(rdfcount_SOURCES) $(rdfguess_SOURCES) $(rdfprint_SOURCES) \ + $(rdfserialize_SOURCES) +DIST_SOURCES = $(grapper_SOURCES) $(raptor_abort_SOURCES) \ + $(rdfcat_SOURCES) $(rdfcount_SOURCES) $(rdfguess_SOURCES) \ + $(rdfprint_SOURCES) $(rdfserialize_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/build/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +CLEANFILES = $(EXTRA_PROGRAMS) +AM_CFLAGS = $(MEM) +AM_LDFLAGS = $(MEM_LIBS) +AM_CPPFLAGS = -I$(top_srcdir)/src +raptor_abort_SOURCES = raptor_abort.c +raptor_abort_LDADD = $(top_builddir)/src/libraptor2.la +raptor_abort_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +grapper_SOURCES = grapper.c +grapper_LDADD = $(top_builddir)/src/libraptor2.la +grapper_CFLAGS = `pkg-config --cflags gtk+-2.0 gconf-2.0` +grapper_LDFLAGS = `pkg-config --libs gtk+-2.0 gconf-2.0` +grapper_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +rdfcat_SOURCES = rdfcat.c +rdfcat_LDADD = $(top_builddir)/src/libraptor2.la +rdfcat_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +rdfprint_SOURCES = rdfprint.c +rdfprint_LDADD = $(top_builddir)/src/libraptor2.la +rdfprint_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +rdfserialize_SOURCES = rdfserialize.c +rdfserialize_LDADD = $(top_builddir)/src/libraptor2.la +rdfserialize_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +rdfguess_SOURCES = rdfguess.c +rdfguess_LDADD = $(top_builddir)/src/libraptor2.la +rdfguess_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +rdfcount_SOURCES = rdfcount.c +rdfcount_LDADD = $(top_builddir)/src/libraptor2.la +rdfcount_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu examples/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +grapper$(EXEEXT): $(grapper_OBJECTS) $(grapper_DEPENDENCIES) $(EXTRA_grapper_DEPENDENCIES) + @rm -f grapper$(EXEEXT) + $(AM_V_CCLD)$(grapper_LINK) $(grapper_OBJECTS) $(grapper_LDADD) $(LIBS) + +raptor_abort$(EXEEXT): $(raptor_abort_OBJECTS) $(raptor_abort_DEPENDENCIES) $(EXTRA_raptor_abort_DEPENDENCIES) + @rm -f raptor_abort$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(raptor_abort_OBJECTS) $(raptor_abort_LDADD) $(LIBS) + +rdfcat$(EXEEXT): $(rdfcat_OBJECTS) $(rdfcat_DEPENDENCIES) $(EXTRA_rdfcat_DEPENDENCIES) + @rm -f rdfcat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rdfcat_OBJECTS) $(rdfcat_LDADD) $(LIBS) + +rdfcount$(EXEEXT): $(rdfcount_OBJECTS) $(rdfcount_DEPENDENCIES) $(EXTRA_rdfcount_DEPENDENCIES) + @rm -f rdfcount$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rdfcount_OBJECTS) $(rdfcount_LDADD) $(LIBS) + +rdfguess$(EXEEXT): $(rdfguess_OBJECTS) $(rdfguess_DEPENDENCIES) $(EXTRA_rdfguess_DEPENDENCIES) + @rm -f rdfguess$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rdfguess_OBJECTS) $(rdfguess_LDADD) $(LIBS) + +rdfprint$(EXEEXT): $(rdfprint_OBJECTS) $(rdfprint_DEPENDENCIES) $(EXTRA_rdfprint_DEPENDENCIES) + @rm -f rdfprint$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rdfprint_OBJECTS) $(rdfprint_LDADD) $(LIBS) + +rdfserialize$(EXEEXT): $(rdfserialize_OBJECTS) $(rdfserialize_DEPENDENCIES) $(EXTRA_rdfserialize_DEPENDENCIES) + @rm -f rdfserialize$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rdfserialize_OBJECTS) $(rdfserialize_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/grapper-grapper.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_abort.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfcat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfcount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfguess.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfprint.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfserialize.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +grapper-grapper.o: grapper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grapper_CFLAGS) $(CFLAGS) -MT grapper-grapper.o -MD -MP -MF $(DEPDIR)/grapper-grapper.Tpo -c -o grapper-grapper.o `test -f 'grapper.c' || echo '$(srcdir)/'`grapper.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/grapper-grapper.Tpo $(DEPDIR)/grapper-grapper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='grapper.c' object='grapper-grapper.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grapper_CFLAGS) $(CFLAGS) -c -o grapper-grapper.o `test -f 'grapper.c' || echo '$(srcdir)/'`grapper.c + +grapper-grapper.obj: grapper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grapper_CFLAGS) $(CFLAGS) -MT grapper-grapper.obj -MD -MP -MF $(DEPDIR)/grapper-grapper.Tpo -c -o grapper-grapper.obj `if test -f 'grapper.c'; then $(CYGPATH_W) 'grapper.c'; else $(CYGPATH_W) '$(srcdir)/grapper.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/grapper-grapper.Tpo $(DEPDIR)/grapper-grapper.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='grapper.c' object='grapper-grapper.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(grapper_CFLAGS) $(CFLAGS) -c -o grapper-grapper.obj `if test -f 'grapper.c'; then $(CYGPATH_W) 'grapper.c'; else $(CYGPATH_W) '$(srcdir)/grapper.c'; fi` + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/grapper-grapper.Po + -rm -f ./$(DEPDIR)/raptor_abort.Po + -rm -f ./$(DEPDIR)/rdfcat.Po + -rm -f ./$(DEPDIR)/rdfcount.Po + -rm -f ./$(DEPDIR)/rdfguess.Po + -rm -f ./$(DEPDIR)/rdfprint.Po + -rm -f ./$(DEPDIR)/rdfserialize.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/grapper-grapper.Po + -rm -f ./$(DEPDIR)/raptor_abort.Po + -rm -f ./$(DEPDIR)/rdfcat.Po + -rm -f ./$(DEPDIR)/rdfcount.Po + -rm -f ./$(DEPDIR)/rdfguess.Po + -rm -f ./$(DEPDIR)/rdfprint.Po + -rm -f ./$(DEPDIR)/rdfserialize.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +examples: $(EXTRA_PROGRAMS) + +$(top_builddir)/src/libraptor2.la: + cd $(top_builddir)/src && $(MAKE) libraptor2.la + +$(top_builddir)/../librdf/librdf.la: + cd $(top_builddir)/../librdf && $(MAKE) librdf.la + +grapper-future: + $(MAKE) clean + $(MAKE) grapper CC="$(CC) -DGTK_DISABLE_DEPRECATED" V=1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/examples/grapper.c b/examples/grapper.c new file mode 100644 index 0000000..a15c662 --- /dev/null +++ b/examples/grapper.c @@ -0,0 +1,1322 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * grapper.c - Raptor GTK GUI example code + * + * Copyright (C) 2003-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + * Requires GTK 2.5.0+ + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#include + +/* for the memory allocation functions */ +#if defined(HAVE_DMALLOC_H) && defined(RAPTOR_MEMORY_DEBUG_DMALLOC) +#include +#endif + +/* Raptor includes */ +#include + +/* Gtk 2.0 */ +#include + +/* Gconf */ +#include +#include + +#if GTK_CHECK_VERSION(2,5,0) +#else +#error "Requires GTK 2.5.0+" +#endif + +/* Qnames button does nothing */ +#undef GRAPPER_QNAMES + +/* GtkUIManager and external XML file is too damn complex to make work */ +#ifdef GTK_DISABLE_DEPRECATED +/* GtkItemFactory was deprecated in GTK+ 2.4 */ +#undef ITEM_FACTORY +/* GtkToolTips was deprecated in GTK+ 2.12 */ +#undef TOOL_TIPS +#else +#define ITEM_FACTORY 1 +#define TOOL_TIPS 1 +#endif + +static const char *application_name = "Grapper"; +static const char *application_title = "Grapper GUI RDF Parser Utility"; +static const char *application_description = "GUI RDF parser utility based on the Raptor RDF parsing library"; + + +/* Top level window */ +static GtkWidget *grapper_window; + + +/* GConf */ +static GConfClient *gconf_client = NULL; + +#define GCONF_GRAPPER_NAMESPACE "/apps/grapper" + +/* configuration dir listened to */ +static const gchar* gconf_namespace= GCONF_GRAPPER_NAMESPACE; + +/* window width key */ +static const gchar* width_gconf_key = (const gchar*) GCONF_GRAPPER_NAMESPACE "/width"; +/* window height key */ +static const gchar* height_gconf_key = (const gchar*) GCONF_GRAPPER_NAMESPACE "/height"; + +#define MIN_WINDOW_WIDTH 400 +#define MIN_WINDOW_HEIGHT 300 + + +typedef struct +{ + raptor_world* world; + /* model data */ +#ifdef GRAPPER_QNAMES + int qnames; +#endif + int guess; + unsigned int syntax; + + int options[RAPTOR_OPTION_LAST]; + int options_set[RAPTOR_OPTION_LAST]; + int ignore_warnings; + + unsigned char *url; + + /* last picked filename or NULL */ + gchar *filename; + + /* GList *triples_list; */ + int triples_count; + int warnings_count; + int errors_count; + gchar *error; + + /* view/controller data */ + GtkWidget *window; + GtkWidget *v_box; + GtkWidget *url_entry; + GtkListStore *triples_store; + GtkWidget *file_selection; + GtkWidget *status; + GtkWidget *triples_frame; + GtkWidget *errors_frame; + GtkListStore *errors_store; + +} grapper_state; + + +typedef struct +{ + grapper_state* state; + int option; +} grapper_widget_data; + + +enum { + SUBJECT_COLUMN, + PREDICATE_COLUMN, + OBJECT_COLUMN, + N_COLUMNS +}; + + +/* Local prototypes */ +static void grapper_model_parse(grapper_state *state); + + +static void +grapper_view_url_changed(grapper_state *state) +{ + GtkWidget *url_entry=state->url_entry; + + gtk_entry_set_text(GTK_ENTRY(url_entry), (const gchar*)state->url); +} + +#ifdef GRAPPER_QNAMES +static void +grapper_view_qnames_changed(grapper_state *state) +{ + +} +#endif + +static void +grapper_view_guess_changed(grapper_state *state) +{ + +} + +static void +grapper_view_option_changed(grapper_state *state, int option) +{ + +} + +static void +grapper_view_syntax_changed(grapper_state *state) +{ + +} + +static void +grapper_view_set_triples_count(grapper_state *state, int count) +{ +#define TC_BUF_LEN 18 + char buf[TC_BUF_LEN+1]; + if(count>0) + snprintf(buf, TC_BUF_LEN, "Triples: %d", count); + else + memcpy(buf, "Triples", 8); + + gtk_frame_set_label(GTK_FRAME(state->triples_frame), buf); +} + +static void +grapper_view_add_triple(grapper_state *state, unsigned char* nodes[3], int i) +{ + GtkListStore *store=state->triples_store; + GtkTreeIter iter; + + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, + SUBJECT_COLUMN, nodes[0], + PREDICATE_COLUMN, nodes[1], + OBJECT_COLUMN, nodes[2], + -1); +} + +static void +grapper_view_empty_triples(grapper_state *state) +{ + gtk_list_store_clear(state->triples_store); + gtk_list_store_clear(state->errors_store); +} + + +static void +grapper_view_reset_status(grapper_state *state) +{ + gtk_list_store_clear(state->errors_store); +} + + +static void +grapper_view_update_error_count(grapper_state *state) +{ +#define EC_BUF_LEN 18 + char buf[EC_BUF_LEN+1]; + int count=state->errors_count; + + if(count>0) + snprintf(buf, EC_BUF_LEN, "Errors: %d", count); + else + memcpy(buf, "Errors", 7); + + gtk_frame_set_label(GTK_FRAME(state->errors_frame), buf); +} + + +static void +grapper_view_add_error_message(grapper_state *state, gchar *error, + raptor_locator *locator, int is_error) +{ + if(error) { + GtkListStore *store = state->errors_store; + GtkTreeIter iter; + int line = (locator && locator->line >= 0) ? locator->line : 0; + + gtk_list_store_append(store, &iter); + gtk_list_store_set(store, &iter, + 0, line, + 1, (is_error ? "Error" : "Warning"), + 2, error, + -1); + grapper_view_update_error_count(state); + } +} + + +static void +grapper_model_add_triple(grapper_state *state, unsigned char *nodes[3]) +{ + /* g_list_append(state->triples_list, nodes); */ + state->triples_count++; + + grapper_view_add_triple(state, nodes, state->triples_count-1); + grapper_view_set_triples_count(state, state->triples_count); +} + + +static void +grapper_model_empty_triples(grapper_state *state) +{ + /* g_list_free(state->triples_list); */ + + grapper_view_empty_triples(state); +} + + +static void +grapper_model_set_url(grapper_state *state, const unsigned char *url) +{ + if(state->url) { + if(!strcmp((const char*)state->url, (const char*)url)) + return; + + g_free(state->url); + } + + state->url = (unsigned char*)g_strdup((const char*)url); + + grapper_view_url_changed(state); +} + + +#ifdef GRAPPER_QNAMES +static void +grapper_model_set_qnames (grapper_state *state, int qnames) +{ + if(state->qnames == qnames) + return; + + state->qnames=qnames; + grapper_view_qnames_changed(state); +} +#endif + + +static void +grapper_model_set_guess (grapper_state *state, int guess) +{ + if(state->guess == guess) + return; + + state->guess=guess; + grapper_view_guess_changed(state); +} + +static void +grapper_model_set_option(grapper_state *state, int option, int value) +{ + if(state->options[option] == value) + return; + + state->options[option] = value; + state->options_set[option] = 1; + grapper_view_option_changed(state, option); +} + + +static void +grapper_model_set_syntax (grapper_state *state, unsigned int syntax) +{ + if(state->syntax == syntax) + return; + + state->syntax=syntax; + grapper_view_syntax_changed(state); +} + + +static void +grapper_model_reset_counts(grapper_state *state) +{ + state->triples_count = 0; + state->warnings_count = 0; + state->errors_count = 0; + grapper_view_update_error_count(state); +} + + +static void +grapper_model_reset_error(grapper_state *state) +{ + if(state->error) { + g_free(state->error); + state->error = NULL; + } + grapper_view_reset_status(state); +} + + +static void +grapper_model_log_handler(void *data, raptor_log_message *message) +{ + grapper_state* state = (grapper_state*)data; + + if(message->level >= RAPTOR_LOG_LEVEL_ERROR) { + state->errors_count++; + + if(state->error) + g_free(state->error); + + state->error = g_strdup(message->text); + + grapper_view_add_error_message(state, state->error, message->locator, 1); + } else { + state->warnings_count++; + + if(state->ignore_warnings) + return; + + if(state->error) + g_free(state->error); + + state->error = g_strdup(message->text); + + grapper_view_add_error_message(state, state->error, message->locator, 0); + } +} + + +static void +grapper_model_statements_handler(void *data, raptor_statement *statement) +{ + grapper_state* state = (grapper_state*)data; + unsigned char* nodes[3]; + + nodes[0] = raptor_term_to_string(statement->subject); + nodes[1] = raptor_term_to_string(statement->predicate); + nodes[2] = raptor_term_to_string(statement->object); + + grapper_model_add_triple(state, nodes); + free(nodes[0]); + free(nodes[1]); + free(nodes[2]); +} + + +static void +grapper_model_parse(grapper_state *state) +{ + raptor_uri* uri; + raptor_parser* rdf_parser; + const char *syntax_name; + int i; + const raptor_syntax_description* sd; + + if(!state->url) + return; + + grapper_model_empty_triples(state); + + grapper_model_reset_counts(state); + grapper_model_reset_error(state); + + uri = raptor_new_uri(state->world, state->url); + sd = raptor_world_get_parser_description(state->world, state->syntax); + syntax_name = sd->names[0]; + + + if(state->guess) { + rdf_parser = raptor_new_parser_for_content(state->world, NULL, NULL, NULL, + 0, state->url); + if(!rdf_parser) { + fprintf(stderr, "Failed to create guessed raptor parser from uri %s\n", + state->url); + exit(1); + } + + fprintf(stdout, "Guessed parser name '%s' from uri %s\n", + raptor_parser_get_name(rdf_parser), state->url); + } else { + rdf_parser = raptor_new_parser(state->world, syntax_name); + } + + + for(i = 0; i <= RAPTOR_OPTION_LAST; i++) { + if(state->options_set[i]) + raptor_parser_set_option(rdf_parser, (raptor_option)i, NULL, state->options[i]); + } + + raptor_world_set_log_handler(state->world, state, grapper_model_log_handler); + raptor_parser_set_statement_handler(rdf_parser, state, + grapper_model_statements_handler); + + raptor_parser_parse_uri(rdf_parser, uri, NULL); + + raptor_free_parser(rdf_parser); + raptor_free_uri(uri); +} + + + +/* go button clicked / url entry activated callback */ +static void +url_entry_callback(GtkWidget *widget, gpointer data) +{ + grapper_state* state = (grapper_state*)data; + GtkWidget *url_entry = state->url_entry; + const unsigned char* url; + + url = (const unsigned char*)gtk_entry_get_text(GTK_ENTRY(url_entry)); + grapper_model_set_url(state, url); + grapper_model_parse(state); +} + + +/* open action wanted */ +static void +do_open_action(grapper_state* state) +{ + unsigned char *uri_string; + GtkWidget *files = gtk_file_chooser_dialog_new("Open", + GTK_WINDOW(state->window), + GTK_FILE_CHOOSER_ACTION_OPEN, + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, + NULL); + + if(state->filename) + gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(files), state->filename); + + if (gtk_dialog_run(GTK_DIALOG (files)) == GTK_RESPONSE_ACCEPT) { + state->filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(files)); + uri_string = (unsigned char*)gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(files)); + grapper_model_set_url(state, uri_string); + g_free(uri_string); + + grapper_model_parse(state); + } + gtk_widget_destroy(files); +} + + +/* quit callback */ +static void +do_quit_action(grapper_state* state) +{ + gtk_main_quit(); +} + + +/* preferences option menu item toggled callback */ +static void +option_menu_toggled(GtkCheckMenuItem *checkmenuitem, gpointer data) +{ + grapper_widget_data* sbdata = (grapper_widget_data*)data; + int active = gtk_check_menu_item_get_active(checkmenuitem); + + grapper_model_set_option(sbdata->state, sbdata->option, active); +} + + +#ifdef GRAPPER_QNAMES +/* qnames button clicked callback */ +static void +qnames_button_callback(GtkWidget *widget, gpointer data) +{ + grapper_state* state = (grapper_state*)data; + int active = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget)) != 0); + + grapper_model_set_qnames(state, active); +} +#endif + + +/* guess button clicked callback */ +static void +guess_button_callback(GtkWidget *widget, gpointer data) +{ + grapper_state* state = (grapper_state*)data; + int active = (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON (widget)) != 0); + + grapper_model_set_guess(state, active); +} + + +/* syntax menu changed callback */ +static void +syntax_menu_callback(GtkWidget *widget, gpointer data) +{ + grapper_state* state = (grapper_state*)data; + unsigned int syntax; + + syntax = (unsigned int)gtk_combo_box_get_active(GTK_COMBO_BOX(widget)); + + grapper_model_set_syntax(state, syntax); +} + + +/* delete (window) event callback */ +static gboolean +delete_event_callback(GtkWidget *widget, GdkEvent *event, gpointer data) +{ + return FALSE; /* continue normal event handing */ +} + + +/* destroy callback */ +static void +destroy_callback(GtkWidget *widget, gpointer data) +{ + gtk_main_quit (); +} + + +#ifdef ITEM_FACTORY +static void +open_menu_callback(gpointer user_data, guint action, GtkWidget *widget) +{ + do_open_action((grapper_state*)user_data); +} +#else +static void +on_open_menu_callback(GtkAction *action, gpointer user_data) +{ + do_open_action((grapper_state*)user_data); +} +#endif + + +#ifdef ITEM_FACTORY +static void +quit_menu_callback(gpointer user_data, guint action, GtkWidget *widget) +{ + do_quit_action((grapper_state*)user_data); +} +#else +static void +on_quit_menu_callback(GtkAction *action, gpointer user_data) +{ + do_quit_action((grapper_state*)user_data); +} +#endif + + +static void +do_about_action(grapper_state* state) { + const gchar* authors[2]= { "Dave Beckett http://www.dajobe.org/", NULL }; + +#if 1 + /* using 2.5.x+ stock about dialog */ + gtk_show_about_dialog(GTK_WINDOW(state->window), + "authors", authors, + "comments", application_description, + "copyright", raptor_short_copyright_string, + "license", raptor_license_string, + "name", application_name, + "version", raptor_version_string, + "website", raptor_home_url_string, + "website-label", "Raptor", + NULL); +#else + /* using 2.5.x+ by hand about */ + GtkWidget *about; + + about = gtk_about_dialog_new(); + gtk_about_dialog_set_name(GTK_ABOUT_DIALOG(about), application_name); + gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(about), raptor_version_string); + gtk_about_dialog_set_copyright(GTK_ABOUT_DIALOG(about), + raptor_short_copyright_string); + gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about), + application_description); + gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about), raptor_license_string); + gtk_about_dialog_set_website(GTK_ABOUT_DIALOG(about), raptor_home_url_string); + gtk_about_dialog_set_website_label(GTK_ABOUT_DIALOG(about), "Raptor"); + gtk_about_dialog_set_authors(GTK_ABOUT_DIALOG(about), authors); + + gtk_widget_show_all(about); +#endif +} + + +#ifdef ITEM_FACTORY +static void +about_menu_callback(gpointer user_data, guint action, GtkWidget *widget) +{ + do_about_action((grapper_state*)user_data); +} +#else +static void +on_about_menu_callback(GtkAction* action, gpointer user_data) +{ + do_about_action((grapper_state*)user_data); +} +#endif + + +#ifdef ITEM_FACTORY +static GtkItemFactoryEntry menu_item_factory_entries[] = { + /* path, accelerator, callback, callback_action, item_type, extra_data */ + { (gchar*)"/_File", NULL, NULL, 0, (gchar*)"" }, + { (gchar*)"/File/_Open...", (gchar*)"O", (GtkItemFactoryCallback)open_menu_callback, 1, (gchar*)"", GTK_STOCK_OPEN }, + { (gchar*)"/File/sep1", NULL, NULL, 0, (gchar*)"" }, + { (gchar*)"/File/_Quit", (gchar*)"Q", (GtkItemFactoryCallback)quit_menu_callback, 1, (gchar*)"", GTK_STOCK_QUIT }, + { (gchar*)"/_Preferences", NULL, NULL, 0, (gchar*)"" }, + { (gchar*)"/_Help", NULL, NULL, 0, (gchar*)"" }, + { (gchar*)"/Help/About", NULL, (GtkItemFactoryCallback)about_menu_callback, 1, (gchar*)"" } +}; + +static gint menu_item_factory_nentries = sizeof(menu_item_factory_entries) / sizeof(menu_item_factory_entries[0]); +#else +static GtkActionEntry menu_actions[] = { + /* name, stock id, label */ + { "FileMenuAction", NULL, "_File" }, + { "PreferencesMenuAction", NULL, "_Preferences" }, + { "HelpMenuAction", NULL, "_Help" }, + + /* name, stock id, label, accelerator, tooltip, callback */ + { "OpenAction", GTK_STOCK_OPEN, "_Open", (gchar*)"O", "Open a file", G_CALLBACK ( on_open_menu_callback ) }, + { "QuitAction", GTK_STOCK_QUIT, "_Quit", (gchar*)"Q", "Quit", G_CALLBACK ( on_quit_menu_callback ) }, + + { "AboutAction", GTK_STOCK_ABOUT, NULL, NULL, "About", G_CALLBACK ( on_about_menu_callback ) } +}; + +static gint menu_actions_nentries = G_N_ELEMENTS (menu_actions); +#endif + + +static void +init_grapper_window(GtkWidget *window, grapper_state *state) +{ + + GtkAccelGroup *accel_group; + GtkWidget *menu_bar; + GtkMenu *prefs_menu; + GtkWidget *v_paned; + GtkWidget *v_box; + GtkWidget *box; + GtkWidget *go_button; + GtkWidget* option_items[RAPTOR_OPTION_LAST]; +#ifdef GRAPPER_QNAMES + GtkWidget *qnames_button; +#endif + GtkWidget *guess_button; + GtkWidget *syntax_combo_box; + GtkWidget *url_entry; + GtkWidget *triples_frame, *prefs_frame; + GtkWidget *triples_scrolled_window; + GtkWidget *triples_treeview; + GtkCellRenderer *renderer; + GtkTreeViewColumn *column; +#ifdef GRAPPER_QNAMES + GtkTooltips *qnames_tooltips; +#endif +#ifdef TOOL_TIPS + GtkTooltips *guess_tooltips; + GtkTooltips *syntax_tooltips; +#else +#endif + GtkWidget *prefs_box; + GtkListStore *store; + int i; + GtkWidget *errors_frame, *errors_scrolled_window; + GtkWidget *errors_treeview; + GtkListStore *errors_store; +#ifdef SYNTAX_LIST_STORE + GtkListStore *syntax_list_store; + GtkTreeIter iter; + GtkCellRenderer* cell; +#endif +#ifdef ITEM_FACTORY + GtkItemFactory* menu_item_factory; +#else + GtkActionGroup *action_group; + GtkUIManager *menu_manager; + GError *error; +#endif + + + state->window=window; + + /* connect window delete event to callback */ + g_signal_connect (G_OBJECT (window), "delete_event", + G_CALLBACK (delete_event_callback), NULL); + + /* connect window destroy event to callback */ + g_signal_connect (G_OBJECT (window), "destroy", + G_CALLBACK (destroy_callback), NULL); + + + + /* vertical box */ + v_box = gtk_vbox_new (FALSE, 0); + + /* gtk_container_set_border_width (GTK_CONTAINER (v_box), 10); */ + + state->v_box = v_box; + + + /* acceleration group for menu bar*/ + accel_group = gtk_accel_group_new(); + + + /* Menu bar */ +#ifdef ITEM_FACTORY + menu_item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, + "
", accel_group); + gtk_item_factory_create_items(menu_item_factory, + menu_item_factory_nentries, + menu_item_factory_entries, + state); + gtk_window_add_accel_group(GTK_WINDOW(window), accel_group); + + menu_bar = gtk_item_factory_get_widget (menu_item_factory, "
"); + gtk_widget_show(menu_bar); +#else + action_group = gtk_action_group_new("Actions"); + gtk_action_group_add_actions (action_group, + menu_actions, menu_actions_nentries, + state); + menu_manager = gtk_ui_manager_new (); + gtk_ui_manager_insert_action_group (menu_manager, action_group, 0); + error = NULL; + gtk_ui_manager_add_ui_from_file(menu_manager, "grapper-ui.xml", &error); + if (error) { + g_message ("Building menus failed: %s", error->message); + g_error_free (error); + } + + /* get the menu bar widget */ + menu_bar = gtk_ui_manager_get_widget(menu_manager, "/MainMenu"); +#endif + + + gtk_box_pack_start (GTK_BOX (v_box), menu_bar, FALSE, FALSE, 0); + + +#ifdef ITEM_FACTORY +#else + /* enable keyboard shortcuts */ + gtk_window_add_accel_group (GTK_WINDOW(window), + gtk_ui_manager_get_accel_group (menu_manager)); +#endif + + /* horizontal box for url entry, OK, Open buttons in vertical box (v_box) */ + box = gtk_hbox_new (FALSE, 0); + + + /* url text entry in horizontal box */ + url_entry = gtk_entry_new(); + gtk_entry_set_max_length(GTK_ENTRY(url_entry), 200); + /* connect text entry activate (enter key) callback */ + g_signal_connect (G_OBJECT(url_entry), "activate", + G_CALLBACK(url_entry_callback), state); + gtk_editable_set_editable(GTK_EDITABLE(url_entry), TRUE); + + /* pack into the invisible box */ + gtk_box_pack_start(GTK_BOX(box), url_entry, TRUE, TRUE, 0); + + gtk_widget_show(url_entry); + state->url_entry = url_entry; + + /* go button in horizontal box */ + go_button = gtk_button_new_from_stock(GTK_STOCK_OK); + + /* connect button clicked event to callback */ + g_signal_connect (G_OBJECT (go_button), "clicked", + G_CALLBACK (url_entry_callback), state); + + /* pack into the invisible box */ + gtk_box_pack_start (GTK_BOX(box), go_button, FALSE, TRUE, 0); + + gtk_widget_show (go_button); + + + gtk_widget_show (box); + + + /* add hbox to vbox */ + gtk_box_pack_start (GTK_BOX (v_box), box, FALSE, FALSE, 0); + + + /* horizontal box for syntax prefs in vertical box (v_box) */ + prefs_frame = gtk_frame_new ("RDF Syntax"); + + prefs_box = gtk_hbutton_box_new(); + + gtk_button_box_set_layout (GTK_BUTTON_BOX(prefs_box), GTK_BUTTONBOX_START); + +#ifdef GRAPPER_QNAMES + /* qnames button in horizontal box */ + qnames_button = gtk_check_button_new_with_label ("QNames"); + + qnames_tooltips = gtk_tooltips_new (); + gtk_tooltips_set_tip (qnames_tooltips, qnames_button, + "Display URIs as XML QNames", NULL); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(qnames_button), + (state->qnames)); + + /* connect button clicked event to callback */ + g_signal_connect (G_OBJECT (qnames_button), "clicked", + G_CALLBACK (qnames_button_callback), state); + + /* pack into the invisible box */ + gtk_box_pack_start (GTK_BOX(prefs_box), qnames_button, TRUE, TRUE, 0); + + gtk_widget_show (qnames_button); +#endif + + /* guess button in horizontal box */ + guess_button = gtk_check_button_new_with_label ("Guess Syntax"); + +#ifdef TOOL_TIPS + guess_tooltips = gtk_tooltips_new (); + gtk_tooltips_set_tip (guess_tooltips, guess_button, + "Try to guess the syntax from the URI", NULL); +#else + gtk_widget_set_tooltip_text (GTK_WIDGET(guess_button), + "Try to guess the syntax from the URI"); +#endif + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(guess_button), + (state->guess)); + + /* connect button clicked event to callback */ + g_signal_connect (G_OBJECT (guess_button), "clicked", + G_CALLBACK (guess_button_callback), state); + + /* pack into the invisible box */ + gtk_box_pack_start (GTK_BOX(prefs_box), guess_button, TRUE, TRUE, 0); + + gtk_widget_show (guess_button); + + /* add prefs frame to vbox */ + gtk_container_add (GTK_CONTAINER(prefs_frame), prefs_box); + + gtk_widget_show (prefs_box); + + /* add prefs frame to start of vbox */ + gtk_box_pack_start (GTK_BOX (v_box), prefs_frame, FALSE, TRUE, 0); + + gtk_widget_show (prefs_frame); + + + + /* paned in vertical box */ + v_paned = gtk_vpaned_new (); + + + /* triples frame in vertical paned */ + triples_frame = gtk_frame_new("Triples"); + state->triples_frame = triples_frame; + + gtk_paned_pack1 (GTK_PANED (v_paned), triples_frame, TRUE, FALSE); + gtk_widget_show (triples_frame); + + + /* scroll window in triples frame */ + triples_scrolled_window = gtk_scrolled_window_new(NULL, NULL); + + gtk_container_set_border_width (GTK_CONTAINER(triples_scrolled_window), 10); + + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(triples_scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + + gtk_container_add (GTK_CONTAINER(triples_frame), triples_scrolled_window); + gtk_widget_show (triples_scrolled_window); + + store = gtk_list_store_new (N_COLUMNS, + G_TYPE_STRING, + G_TYPE_STRING, + G_TYPE_STRING); + state->triples_store = store; + + triples_treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(store)); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(triples_treeview), TRUE); + + /* set columns renderer for treeview */ + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("Subject", + renderer, + "text", SUBJECT_COLUMN, + NULL); + gtk_tree_view_column_set_sort_column_id (column, SUBJECT_COLUMN); + gtk_tree_view_column_set_resizable (column, 1); + gtk_tree_view_append_column (GTK_TREE_VIEW (triples_treeview), column); + + renderer= gtk_cell_renderer_text_new (); + column= gtk_tree_view_column_new_with_attributes ("Predicate", + renderer, + "text", PREDICATE_COLUMN, + NULL); + gtk_tree_view_column_set_sort_column_id (column, PREDICATE_COLUMN); + gtk_tree_view_column_set_resizable (column, 1); + gtk_tree_view_append_column (GTK_TREE_VIEW (triples_treeview), column); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("Object", + renderer, + "text", OBJECT_COLUMN, + NULL); + gtk_tree_view_column_set_sort_column_id (column, OBJECT_COLUMN); + gtk_tree_view_column_set_resizable (column, 1); + gtk_tree_view_append_column (GTK_TREE_VIEW (triples_treeview), column); + + + /* pack the store into the scrolled window */ + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(triples_scrolled_window), + triples_treeview); + gtk_widget_show(triples_treeview); + + + /* errors frame in vertical paned */ + errors_frame = gtk_frame_new ("Errors"); + state->errors_frame = errors_frame; + + gtk_paned_pack2 (GTK_PANED (v_paned), errors_frame, TRUE, FALSE); + gtk_widget_show (errors_frame); + + + gtk_box_pack_start (GTK_BOX (v_box), v_paned, TRUE, TRUE, 0); + gtk_widget_show (v_paned); + + + /* scroll window in errors frame */ + errors_scrolled_window = gtk_scrolled_window_new(NULL, NULL); + + gtk_container_set_border_width (GTK_CONTAINER(errors_scrolled_window), 10); + + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(errors_scrolled_window), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + + gtk_container_add (GTK_CONTAINER(errors_frame), errors_scrolled_window); + gtk_widget_show (errors_scrolled_window); + + errors_store = gtk_list_store_new (3, + G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING); + state->errors_store = errors_store; + + errors_treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL(errors_store)); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(errors_treeview), TRUE); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("Line", + renderer, + "text", 0, + NULL); + gtk_tree_view_column_set_resizable (column, 1); + gtk_tree_view_append_column (GTK_TREE_VIEW (errors_treeview), column); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("Type", + renderer, + "text", 1, + NULL); + gtk_tree_view_column_set_resizable (column, 1); + gtk_tree_view_append_column (GTK_TREE_VIEW (errors_treeview), column); + + renderer = gtk_cell_renderer_text_new (); + column = gtk_tree_view_column_new_with_attributes ("Message", + renderer, + "text", 2, + NULL); + gtk_tree_view_column_set_resizable (column, 1); + gtk_tree_view_append_column (GTK_TREE_VIEW (errors_treeview), column); + +#ifdef TOOL_TIPS + gtk_tooltips_set_tip (gtk_tooltips_new (), errors_treeview, + "Errors and warnings from parsing the content.", NULL); +#else + gtk_widget_set_tooltip_text (GTK_WIDGET(errors_treeview), + "Errors and warnings from parsing the content."); +#endif + + /* pack the errors store into the errors scrolled window */ + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(errors_scrolled_window), + errors_treeview); + gtk_widget_show (errors_treeview); + + + + +#ifdef ITEM_FACTORY + prefs_menu = GTK_MENU(gtk_item_factory_get_widget (menu_item_factory, + "/Preferences")); +#else + prefs_menu = GTK_MENU(gtk_ui_manager_get_widget (menu_manager, + "/MainMenu/PreferencesMenu")); +#endif + + /* options in the preferences menu */ + for(i = 0; i <= RAPTOR_OPTION_LAST; i++) { + grapper_widget_data* sbdata; + raptor_option_description* od; + + od = raptor_world_get_option_description(state->world, + RAPTOR_DOMAIN_PARSER, + (raptor_option)i); + if(!od) + break; + + sbdata = (grapper_widget_data*)malloc(sizeof(grapper_widget_data)); + sbdata->state = state; + sbdata->option = i; + + /* add to the preferences menu */ + option_items[i] = gtk_check_menu_item_new_with_label (od->label); + gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(option_items[i]), + state->options[i]); + gtk_menu_shell_append (GTK_MENU_SHELL(prefs_menu), option_items[i]); + + g_signal_connect (G_OBJECT(option_items[i]), "toggled", + G_CALLBACK(option_menu_toggled), (gpointer)sbdata); + gtk_widget_show (option_items[i]); + } + + + /* syntax button in horizontal box */ +#ifdef SYNTAX_LIST_STORE + /* Create combo box with data model behind */ + + syntax_list_store = gtk_list_store_new (/* N columns */ 1, G_TYPE_STRING); + for(i = 0; 1; i++) { + const raptor_syntax_description* sd; + + sd = raptor_world_get_parser_description(state->world, i); + if(!sd) + break; + + gtk_list_store_append (syntax_list_store, &iter); + gtk_list_store_set (syntax_list_store, &iter, + /* column */ 0, (const gchar*)sd->label, + -1); + } + + syntax_combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(syntax_list_store)); + + /* Remove our reference to the store to avoid memory leak */ + g_object_unref ( G_OBJECT (syntax_list_store ) ); + + /* Create text cell renderer */ + cell = gtk_cell_renderer_text_new (); + + /* Pack it to the combo box */ + gtk_cell_layout_pack_start (GTK_CELL_LAYOUT ( syntax_combo_box ), cell, TRUE); + + /* Connect renderer to data source: attr "text" is column 0 in data model */ + gtk_cell_layout_set_attributes ( GTK_CELL_LAYOUT ( syntax_combo_box ), + cell, + /* attribute */ "text", /* column */ 0, + NULL); + +#else + /* Create combo box using text API */ + syntax_combo_box = gtk_combo_box_new_text (); + + for(i = 0; 1; i++) { + const raptor_syntax_description* sd; + + sd = raptor_world_get_parser_description(state->world, i); + if(!sd) + break; + + gtk_combo_box_append_text (GTK_COMBO_BOX (syntax_combo_box), + (const gchar*)sd->label); + } +#endif + + g_signal_connect (GTK_OBJECT(syntax_combo_box), "changed", + G_CALLBACK(syntax_menu_callback), state); + + /* Default is item 0 (should be RDF/XML) */ + gtk_combo_box_set_active (GTK_COMBO_BOX(syntax_combo_box), 0); + +#ifdef TOOL_TIPS + syntax_tooltips = gtk_tooltips_new (); + gtk_tooltips_set_tip (syntax_tooltips, syntax_combo_box, + "Choose the Syntax to parse", NULL); +#else + gtk_widget_set_tooltip_text (GTK_WIDGET(syntax_combo_box), + "Choose the Syntax to parse"); +#endif + + /* pack into the invisible box */ + gtk_box_pack_start (GTK_BOX(prefs_box), syntax_combo_box, TRUE, TRUE, 0); + + gtk_widget_show (syntax_combo_box); + + + /* add vbox to window */ + gtk_container_add (GTK_CONTAINER (window), v_box); + gtk_widget_show (v_box); + + +} + + + +static void +grapper_gconfclient_notify(GConfClient* client, guint cnxn_id, + GConfEntry *entry, gpointer user_data) +{ + /* grapper_state* state = (grapper_state*)user_data; */ + GError* err = NULL; + int width, height; + + gtk_window_get_size (GTK_WINDOW(grapper_window), &width, &height); + + + width = gconf_client_get_int (gconf_client, width_gconf_key, &err); + if(err) { + g_error_free (err); + err = NULL; + width = -1; + } else + fprintf(stderr, "gconf width changed to %d\n", width); + + height = gconf_client_get_int (gconf_client, height_gconf_key, &err); + if(err) { + g_error_free (err); + err = NULL; + height = -1; + } else + fprintf(stderr, "gconf height changed to %d\n", width); + + /* let's not make it too small */ + if(width < MIN_WINDOW_WIDTH) + width = MIN_WINDOW_WIDTH; + if(height < MIN_WINDOW_HEIGHT) + height = MIN_WINDOW_HEIGHT; + + gtk_window_resize (GTK_WINDOW(grapper_window), width, height); +} + + +static void +grapper_gconflient_free(gpointer user_data) +{ + +} + + +static gint +configure_callback(GtkWidget *widget, GdkEvent *event, gpointer data) +{ + gint width, height; + GError* err = NULL; + + gtk_window_get_size (GTK_WINDOW(grapper_window), &width, &height); + + if(!gconf_client_set_int (gconf_client, width_gconf_key, width, &err)) { + fprintf(stderr, "gconf error writing width: %s\n", err->message); + g_error_free (err); + err = NULL; + } + + if(!gconf_client_set_int (gconf_client, height_gconf_key, height, &err)) { + fprintf(stderr, "gconf error writing width: %s\n", err->message); + g_error_free (err); + err = NULL; + } + + return FALSE; +} + + + +int +main(int argc, char *argv[]) +{ + grapper_state state; + GError* err = NULL; + guint cnxn; + int width, height; + + gtk_init (&argc, &argv); + + g_set_application_name (application_name); + + memset(&state, 0, sizeof(grapper_state)); + + state.world = raptor_new_world(); + + gconf_client = gconf_client_get_default(); + + cnxn = gconf_client_notify_add (gconf_client, gconf_namespace, + grapper_gconfclient_notify, + (gpointer)&state, /* user data */ + grapper_gconflient_free, + &err); + + /* create the main window */ + grapper_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + + gtk_window_set_title (GTK_WINDOW(grapper_window), application_title); + + init_grapper_window(grapper_window, &state); + + width = gconf_client_get_int (gconf_client, width_gconf_key, &err); + if(err) { + fprintf(stderr, "gconf error reading width: %s\n", err->message); + g_error_free (err); + err = NULL; + width= -1; + } + + height = gconf_client_get_int (gconf_client, height_gconf_key, &err); + if(err) { + fprintf(stderr, "gconf error reading height: %s\n", err->message); + g_error_free (err); + err = NULL; + height= -1; + } + + /* let's not make it too small */ + if(width < MIN_WINDOW_WIDTH) + width = MIN_WINDOW_WIDTH; + if(height < MIN_WINDOW_HEIGHT) + height = MIN_WINDOW_HEIGHT; + + gtk_window_set_default_size (GTK_WINDOW(grapper_window), width, height); + + /* Connect the window resize event to configure_callback */ + g_signal_connect (G_OBJECT (grapper_window), "configure_event", + G_CALLBACK (configure_callback), &state); + + /* finally make it all visible */ + gtk_widget_show (grapper_window); + + if(argc>1) { + if(!access(argv[1], R_OK)) { + /* it's a file - make a URL out of it */ + unsigned char *uri_string = raptor_uri_filename_to_uri_string(argv[1]); + grapper_model_set_url(&state, uri_string); + free(uri_string); + } else + grapper_model_set_url(&state, (unsigned char*)argv[1]); + + grapper_model_parse(&state); + } + + /* main loop, exited when gtk_main_quit() is called */ + gtk_main (); + + raptor_free_world(state.world); + + gconf_client_notify_remove (gconf_client, cnxn); + + return 0; +} + diff --git a/examples/raptor_abort.c b/examples/raptor_abort.c new file mode 100644 index 0000000..d71fe9e --- /dev/null +++ b/examples/raptor_abort.c @@ -0,0 +1,128 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_abort.c - Raptor abort example code + * + * Copyright (C) 2003-2006, David Beckett http://purl.org/net/dajobe/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif + +/* for the memory allocation functions */ +#if defined(HAVE_DMALLOC_H) && defined(RAPTOR_MEMORY_DEBUG_DMALLOC) +#include +#endif + +/* Raptor includes */ +#include + + +static void handle_statements(void *user_data, raptor_statement *statement); +int main(int argc, char *argv[]); + + +typedef struct +{ + raptor_parser *parser; + FILE *stream; + int count; + int max; + int stopped; +} my_data; + + +static void +handle_statements(void *user_data, raptor_statement *statement) +{ + my_data* me=(my_data*)user_data; + + me->count++; + if(me->count > me->max) { + fprintf(me->stream, "Reached %d statements, stopping\n", me->max); + raptor_parser_parse_abort(me->parser); + me->stopped=1; + return; + } + + fprintf(me->stream, "Saw statement %d\n", me->count); +} + + +int +main (int argc, char *argv[]) +{ + raptor_world* world; + raptor_parser* rdf_parser; + raptor_uri* uri; + my_data* me; + const char *program; + int rc; + + program=argv[0]; + + if(argc != 2) { + fprintf(stderr, "%s: USAGE [RDF-XML content URI]\n", program); + exit(1); + } + + world = raptor_new_world(); + + me=(my_data*)malloc(sizeof(my_data)); + if(!me) { + fprintf(stderr, "%s: Out of memory\n", program); + exit(1); + } + + me->stream=stderr; + me->count = 0; + me->max=5; + + uri = raptor_new_uri(world, (const unsigned char*)argv[1]); + rdf_parser = raptor_new_parser(world, "rdfxml"); + + me->parser = rdf_parser; + + raptor_parser_set_statement_handler(rdf_parser, me, handle_statements); + + me->stopped = 0; + rc = raptor_parser_parse_uri(rdf_parser, uri, NULL); + + fprintf(stderr, "%s: Parser returned status %d, stopped? %s\n", program, rc, + (me->stopped ? "yes" : "no")); + + free(me); + + raptor_free_parser(rdf_parser); + + raptor_free_uri(uri); + + raptor_free_world(world); + + return 0; +} diff --git a/examples/rdfcat.c b/examples/rdfcat.c new file mode 100644 index 0000000..978a641 --- /dev/null +++ b/examples/rdfcat.c @@ -0,0 +1,55 @@ +#include +#include + +/* rdfcat.c: parse any RDF syntax and serialize to RDF/XML-Abbrev */ + +static raptor_serializer* rdf_serializer; + +static void +serialize_triple(void* user_data, raptor_statement* triple) +{ + raptor_serializer_serialize_statement(rdf_serializer, triple); +} + +static void +declare_namespace(void* user_data, raptor_namespace *nspace) +{ + raptor_serializer_set_namespace_from_namespace(rdf_serializer, nspace); +} + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + raptor_parser* rdf_parser = NULL; + unsigned char *uri_string; + raptor_uri *uri, *base_uri; + + world = raptor_new_world(); + + uri_string = raptor_uri_filename_to_uri_string(argv[1]); + uri = raptor_new_uri(world, uri_string); + base_uri = raptor_uri_copy(uri); + + /* Ask raptor to work out which parser to use */ + rdf_parser = raptor_new_parser(world, "guess"); + raptor_parser_set_statement_handler(rdf_parser, NULL, serialize_triple); + raptor_parser_set_namespace_handler(rdf_parser, NULL, declare_namespace); + + rdf_serializer = raptor_new_serializer(world, "rdfxml-abbrev"); + + raptor_serializer_start_to_file_handle(rdf_serializer, base_uri, stdout); + raptor_parser_parse_file(rdf_parser, uri, base_uri); + raptor_serializer_serialize_end(rdf_serializer); + + raptor_free_serializer(rdf_serializer); + raptor_free_parser(rdf_parser); + + raptor_free_uri(base_uri); + raptor_free_uri(uri); + raptor_free_memory(uri_string); + + raptor_free_world(world); + + return 0; +} diff --git a/examples/rdfcount.c b/examples/rdfcount.c new file mode 100644 index 0000000..9c899b1 --- /dev/null +++ b/examples/rdfcount.c @@ -0,0 +1,62 @@ +#include +#include + +/* rdfcount.c: parse any number of RDF/XML files and count the triples */ + +static void +count_triples(void* user_data, raptor_statement* triple) +{ + unsigned int* count_p = (unsigned int*)user_data; + (*count_p)++; +} + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + const char* program = "rdfcount"; + raptor_parser* rdf_parser = NULL; + unsigned int i; + unsigned int count; + unsigned int files_count = 0; + unsigned int total_count = 0; + + world = raptor_new_world(); + + /* just one parser is used and reused here */ + rdf_parser = raptor_new_parser(world, "rdfxml"); + + raptor_parser_set_statement_handler(rdf_parser, &count, count_triples); + + for(i = 1; argv[i]; i++) { + const char* filename = argv[i]; + unsigned char *uri_string; + raptor_uri *uri, *base_uri; + + uri_string = raptor_uri_filename_to_uri_string(filename); + uri = raptor_new_uri(world, uri_string); + base_uri = raptor_uri_copy(uri); + + count = 0; + if(!raptor_parser_parse_file(rdf_parser, uri, base_uri)) { + fprintf(stderr, "%s: %s : %d triples\n", program, filename, count); + total_count += count; + files_count++; + } else { + fprintf(stderr, "%s: %s : failed to parse\n", program, filename); + } + + raptor_free_uri(base_uri); + raptor_free_uri(uri); + raptor_free_memory(uri_string); + } + + raptor_free_parser(rdf_parser); + + raptor_free_world(world); + + fprintf(stderr, "%s: Total count: %d files %d triples\n", + program, files_count, total_count); + + return 0; +} diff --git a/examples/rdfguess.c b/examples/rdfguess.c new file mode 100644 index 0000000..b636c0b --- /dev/null +++ b/examples/rdfguess.c @@ -0,0 +1,102 @@ +#include +#include +#include +#include + +#include + + +/* rdfguess.c: guess parser name from filename and its content */ + +#define READ_BUFFER_SIZE 256 + +static int +rdfguess_guess_name(raptor_world* world, const char* filename) +{ + char *buffer[READ_BUFFER_SIZE]; + raptor_iostream* iostr = NULL; + const char* name; + const unsigned char* identifier; + const char* label; + size_t read_len; + size_t count; + + if(!strcmp(filename, "-")) { + iostr = raptor_new_iostream_from_file_handle(world, stdin); + identifier = NULL; + label = ""; + } else { + if(access(filename, R_OK)) { + fprintf(stderr, "rdfguess: file %s not found\n", filename); + return 1; + } + + iostr = raptor_new_iostream_from_filename(world, filename); + identifier = (const unsigned char *)filename; + label = filename; + } + + if(!iostr) { + fprintf(stderr, "rdfguess: Could not create iostream for %s\n", label); + goto tidy; + } + + read_len = READ_BUFFER_SIZE; + count = raptor_iostream_read_bytes(buffer, 1, read_len, iostr); + if(count < 1) { + fprintf(stderr, "rdfguess: Failed to read any data from %s\n", + label); + goto tidy; + } + + name = raptor_world_guess_parser_name(world, + /* uri*/ NULL, + /* mime_type */ NULL, + (const unsigned char*)buffer, + read_len, + identifier); + + if(name) + fprintf(stdout, "rdfguess: %s guessed to be %s\n", label, name); + else + fprintf(stdout, "rdfguess: failed to guess parser for %s\n", label); + + tidy: + raptor_free_iostream(iostr); + + return 0; +} + + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + const char *filename; + int rc = 0; + + world = raptor_new_world(); + + if(argc == 2 && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help"))) { + fprintf(stderr, "USAGE rdfguess [FILENAMES...]\n"); + rc = 1; + goto tidy; + } + + if(argc == 1) { + rc = rdfguess_guess_name(world, "-"); + } else { + int i; + + for(i = 1; (filename = (const char*)argv[i]); i++) { + rc = rdfguess_guess_name(world, filename); + if(rc) + break; + } + } + + tidy: + raptor_free_world(world); + + return rc; +} diff --git a/examples/rdfprint.c b/examples/rdfprint.c new file mode 100644 index 0000000..093aa98 --- /dev/null +++ b/examples/rdfprint.c @@ -0,0 +1,42 @@ +#include +#include + +/* rdfprint.c: print triples from parsing RDF/XML */ + +static void +print_triple(void* user_data, raptor_statement* triple) +{ + raptor_statement_print_as_ntriples(triple, stdout); + fputc('\n', stdout); +} + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + raptor_parser* rdf_parser = NULL; + unsigned char *uri_string; + raptor_uri *uri, *base_uri; + + world = raptor_new_world(); + + rdf_parser = raptor_new_parser(world, "rdfxml"); + + raptor_parser_set_statement_handler(rdf_parser, NULL, print_triple); + + uri_string = raptor_uri_filename_to_uri_string(argv[1]); + uri = raptor_new_uri(world, uri_string); + base_uri = raptor_uri_copy(uri); + + raptor_parser_parse_file(rdf_parser, uri, base_uri); + + raptor_free_parser(rdf_parser); + + raptor_free_uri(base_uri); + raptor_free_uri(uri); + raptor_free_memory(uri_string); + + raptor_free_world(world); + + return 0; +} diff --git a/examples/rdfserialize.c b/examples/rdfserialize.c new file mode 100644 index 0000000..ecbc6b3 --- /dev/null +++ b/examples/rdfserialize.c @@ -0,0 +1,47 @@ +#include +#include +#include + +/* rdfserialize.c: serialize 1 triple to RDF/XML-Abbrev */ + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + raptor_serializer* rdf_serializer = NULL; + unsigned char *uri_string; + raptor_uri *base_uri; + raptor_statement* triple; + + world = raptor_new_world(); + + uri_string = raptor_uri_filename_to_uri_string(argv[1]); + base_uri = raptor_new_uri(world, uri_string); + + rdf_serializer = raptor_new_serializer(world, "rdfxml-abbrev"); + raptor_serializer_start_to_file_handle(rdf_serializer, base_uri, stdout); + + /* Make a triple with URI subject, URI predicate, literal object */ + triple = raptor_new_statement(world); + triple->subject = raptor_new_term_from_uri_string(world, (const unsigned char*)"http://example.org/subject"); + triple->predicate = raptor_new_term_from_uri_string(world, (const unsigned char*)"http://example.org/predicate"); + triple->object = raptor_new_term_from_literal(world, + (const unsigned char*)"An example literal", + NULL, + (const unsigned char*)"en"); + + /* Write the triple */ + raptor_serializer_serialize_statement(rdf_serializer, triple); + + /* Delete the triple */ + raptor_free_statement(triple); + + raptor_serializer_serialize_end(rdf_serializer); + raptor_free_serializer(rdf_serializer); + + raptor_free_uri(base_uri); + raptor_free_memory(uri_string); + + raptor_free_world(world); + return 0; +} diff --git a/gtk-doc.make b/gtk-doc.make new file mode 100644 index 0000000..c673175 --- /dev/null +++ b/gtk-doc.make @@ -0,0 +1,322 @@ +# -*- mode: makefile -*- +# +# gtk-doc.make - make rules for gtk-doc +# Copyright (C) 2003 James Henstridge +# 2004-2007 Damon Chaplin +# 2007-2017 Stefan Sauer +# +# 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 3 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, see . + +#################################### +# Everything below here is generic # +#################################### + +if GTK_DOC_USE_LIBTOOL +GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = $(LIBTOOL) --mode=execute +else +GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) +GTKDOC_RUN = +endif + +# We set GPATH here; this gives us semantics for GNU make +# which are more like other make's VPATH, when it comes to +# whether a source that is a target of one rule is then +# searched for in VPATH/GPATH. +# +GPATH = $(srcdir) + +TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) + +SETUP_FILES = \ + $(content_files) \ + $(expand_content_files) \ + $(DOC_MAIN_SGML_FILE) \ + $(DOC_MODULE)-sections.txt \ + $(DOC_MODULE)-overrides.txt + +EXTRA_DIST = \ + $(HTML_IMAGES) \ + $(SETUP_FILES) + +DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + sgml.stamp html.stamp pdf.stamp + +SCANOBJ_FILES = \ + $(DOC_MODULE).actions \ + $(DOC_MODULE).args \ + $(DOC_MODULE).hierarchy \ + $(DOC_MODULE).interfaces \ + $(DOC_MODULE).prerequisites \ + $(DOC_MODULE).signals + +REPORT_FILES = \ + $(DOC_MODULE)-undocumented.txt \ + $(DOC_MODULE)-undeclared.txt \ + $(DOC_MODULE)-unused.txt + +gtkdoc-check.test: Makefile + $(AM_V_GEN)echo "#!/bin/sh -e" > $@; \ + echo "$(GTKDOC_CHECK_PATH) || exit 1" >> $@; \ + chmod +x $@ + +CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS) gtkdoc-check.test + +if GTK_DOC_BUILD_HTML +HTML_BUILD_STAMP=html-build.stamp +else +HTML_BUILD_STAMP= +endif +if GTK_DOC_BUILD_PDF +PDF_BUILD_STAMP=pdf-build.stamp +else +PDF_BUILD_STAMP= +endif + +all-gtk-doc: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) +.PHONY: all-gtk-doc + +if ENABLE_GTK_DOC +all-local: all-gtk-doc +endif + +docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) + +$(REPORT_FILES): sgml-build.stamp + +#### setup #### + +GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_@AM_V@) +GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_@AM_DEFAULT_V@) +GTK_DOC_V_SETUP_0=@echo " DOC Preparing build"; + +setup-build.stamp: + -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \ + if test "x$$files" != "x" ; then \ + for file in $$files ; do \ + destdir=`dirname $(abs_builddir)/$$file`; \ + test -d "$$destdir" || mkdir -p "$$destdir"; \ + test -f $(abs_srcdir)/$$file && \ + cp -pf $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \ + done; \ + fi; \ + fi + $(AM_V_at)touch setup-build.stamp + +#### scan #### + +GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_@AM_V@) +GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_@AM_DEFAULT_V@) +GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files"; + +GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_@AM_V@) +GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_@AM_DEFAULT_V@) +GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects"; + +scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB) + $(GTK_DOC_V_SCAN)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) + $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \ + scanobj_options=""; \ + gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + scanobj_options="--verbose"; \ + fi; \ + fi; \ + CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \ + gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \ + else \ + for i in $(SCANOBJ_FILES) ; do \ + test -f $$i || touch $$i ; \ + done \ + fi + $(AM_V_at)touch scan-build.stamp + +$(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp + @true + +#### xml #### + +GTK_DOC_V_XML=$(GTK_DOC_V_XML_@AM_V@) +GTK_DOC_V_XML_=$(GTK_DOC_V_XML_@AM_DEFAULT_V@) +GTK_DOC_V_XML_0=@echo " DOC Building XML"; + +sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(HFILE_GLOB) $(CFILE_GLOB) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files) xml/gtkdocentities.ent + $(GTK_DOC_V_XML)_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ + _source_dir="$${_source_dir} --source-dir=$$i" ; \ + done ; \ + gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS) + $(AM_V_at)touch sgml-build.stamp + +sgml.stamp: sgml-build.stamp + @true + +$(DOC_MAIN_SGML_FILE): sgml-build.stamp + @true + +xml/gtkdocentities.ent: Makefile + $(GTK_DOC_V_XML)$(MKDIR_P) $(@D) && ( \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + echo ""; \ + ) > $@ + +#### html #### + +GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_@AM_V@) +GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_@AM_DEFAULT_V@) +GTK_DOC_V_HTML_0=@echo " DOC Building HTML"; + +GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_@AM_V@) +GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_@AM_DEFAULT_V@) +GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references"; + +html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \ + mkhtml_options=""; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkhtml_options="$$mkhtml_options --verbose"; \ + fi; \ + fi; \ + gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ + if test "$$?" = "0"; then \ + mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \ + fi; \ + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + -@test "x$(HTML_IMAGES)" = "x" || \ + for file in $(HTML_IMAGES) ; do \ + test -f $(abs_srcdir)/$$file && cp $(abs_srcdir)/$$file $(abs_builddir)/html; \ + test -f $(abs_builddir)/$$file && cp $(abs_builddir)/$$file $(abs_builddir)/html; \ + test -f $$file && cp $$file $(abs_builddir)/html; \ + done; + $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + $(AM_V_at)touch html-build.stamp + +#### pdf #### + +GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_@AM_V@) +GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_@AM_DEFAULT_V@) +GTK_DOC_V_PDF_0=@echo " DOC Building PDF"; + +pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files) + $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \ + mkpdf_options=""; \ + gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \ + if test "$$?" = "0"; then \ + if test "x$(V)" = "x1"; then \ + mkpdf_options="$$mkpdf_options --verbose"; \ + fi; \ + fi; \ + if test "x$(HTML_IMAGES)" != "x"; then \ + for img in $(HTML_IMAGES); do \ + part=`dirname $$img`; \ + echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \ + if test $$? != 0; then \ + mkpdf_options="$$mkpdf_options --imgdir=$$part"; \ + fi; \ + done; \ + fi; \ + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + $(AM_V_at)touch pdf-build.stamp + +############## + +clean-local: + @rm -f *~ *.bak + @rm -rf .libs + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \ + rm -f $(DOC_MODULE).types; \ + fi + @if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \ + rm -f $(DOC_MODULE)-sections.txt; \ + fi + +distclean-local: + @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(SETUP_FILES) $(DOC_MODULE).types; \ + fi + +maintainer-clean-local: + @rm -rf xml html + +install-data-local: + @installfiles=`echo $(builddir)/html/*`; \ + if test "$$installfiles" = '$(builddir)/html/*'; \ + then echo 1>&2 'Nothing to install' ; \ + else \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + $(mkinstalldirs) $${installdir} ; \ + for i in $$installfiles; do \ + echo ' $(INSTALL_DATA) '$$i ; \ + $(INSTALL_DATA) $$i $${installdir}; \ + done; \ + if test -n "$(DOC_MODULE_VERSION)"; then \ + mv -f $${installdir}/$(DOC_MODULE).devhelp2 \ + $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \ + fi; \ + $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \ + fi + +uninstall-local: + @if test -n "$(DOC_MODULE_VERSION)"; then \ + installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \ + else \ + installdir="$(DESTDIR)$(TARGET_DIR)"; \ + fi; \ + rm -rf $${installdir} + +# +# Require gtk-doc when making dist +# +if HAVE_GTK_DOC +dist-check-gtkdoc: docs +else +dist-check-gtkdoc: + @echo "*** gtk-doc is needed to run 'make dist'. ***" + @echo "*** gtk-doc was not found when 'configure' ran. ***" + @echo "*** please install gtk-doc and rerun 'configure'. ***" + @false +endif + +dist-hook: dist-check-gtkdoc all-gtk-doc dist-hook-local + @mkdir $(distdir)/html + @cp ./html/* $(distdir)/html + @-cp ./$(DOC_MODULE).pdf $(distdir)/ + @-cp ./$(DOC_MODULE).types $(distdir)/ + @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/ + @cd $(distdir) && rm -f $(DISTCLEANFILES) + @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html + +.PHONY : dist-hook-local docs diff --git a/librdfa/Makefile.am b/librdfa/Makefile.am new file mode 100644 index 0000000..7d53e16 --- /dev/null +++ b/librdfa/Makefile.am @@ -0,0 +1,83 @@ +# -*- Mode: Makefile -*- +# +# Makefile for librdfa convienience library +# + +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) + +if LIBRDFA +noinst_LTLIBRARIES = librdfa.la +AM_CPPFLAGS = -DLIBRDFA_IN_RAPTOR -I$(srcdir) -I$(top_srcdir)/src + +librdfa_la_SOURCES = \ +context.c \ +curie.c \ +iri.c \ +language.c \ +lists.c \ +namespace.c \ +rdfa.c \ +rdfa_utils.c \ +subject.c \ +triple.c \ +rdfa.h \ +rdfa_utils.h \ +config.h + +if NEED_STRTOK_R +librdfa_la_SOURCES += \ +strtok_r.c \ +strtok_r.h +endif + + +# Do not need: +# mingw32_utils.c +# mingw32_utils.h + +else + +EXTRA_DIST = \ +context.c \ +curie.c \ +iri.c \ +language.c \ +lists.c \ +namespace.c \ +rdfa.c \ +rdfa_utils.c \ +strtok_r.c \ +subject.c \ +triple.c \ +rdfa.h \ +rdfa_utils.h \ +strtok_r.h \ +config.h + +endif + +CLEANFILES=*.plist + +if MAINTAINER_MODE +# Run Clang static analyzer over sources. +analyze: $(SOURCES) + @list='$(SOURCES)'; \ + result=0; \ + for file in $$list; do \ + if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ + $(RECHO) "Analyzing $$file"; \ + $(ANALYZE_COMMAND) $(srcdir)/$$file; \ + status=$$?; \ + if test $$status != 0; then \ + result=1; \ + fi; \ + fi; \ + done; \ + set -e; exit $$result +endif diff --git a/librdfa/Makefile.in b/librdfa/Makefile.in new file mode 100644 index 0000000..d7d6876 --- /dev/null +++ b/librdfa/Makefile.in @@ -0,0 +1,747 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile for librdfa convienience library +# + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@LIBRDFA_TRUE@@NEED_STRTOK_R_TRUE@am__append_1 = \ +@LIBRDFA_TRUE@@NEED_STRTOK_R_TRUE@strtok_r.c \ +@LIBRDFA_TRUE@@NEED_STRTOK_R_TRUE@strtok_r.h + +subdir = librdfa +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +librdfa_la_LIBADD = +am__librdfa_la_SOURCES_DIST = context.c curie.c iri.c language.c \ + lists.c namespace.c rdfa.c rdfa_utils.c subject.c triple.c \ + rdfa.h rdfa_utils.h config.h strtok_r.c strtok_r.h +@LIBRDFA_TRUE@@NEED_STRTOK_R_TRUE@am__objects_1 = strtok_r.lo +@LIBRDFA_TRUE@am_librdfa_la_OBJECTS = context.lo curie.lo iri.lo \ +@LIBRDFA_TRUE@ language.lo lists.lo namespace.lo rdfa.lo \ +@LIBRDFA_TRUE@ rdfa_utils.lo subject.lo triple.lo \ +@LIBRDFA_TRUE@ $(am__objects_1) +librdfa_la_OBJECTS = $(am_librdfa_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +@LIBRDFA_TRUE@am_librdfa_la_rpath = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/build/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/context.Plo ./$(DEPDIR)/curie.Plo \ + ./$(DEPDIR)/iri.Plo ./$(DEPDIR)/language.Plo \ + ./$(DEPDIR)/lists.Plo ./$(DEPDIR)/namespace.Plo \ + ./$(DEPDIR)/rdfa.Plo ./$(DEPDIR)/rdfa_utils.Plo \ + ./$(DEPDIR)/strtok_r.Plo ./$(DEPDIR)/subject.Plo \ + ./$(DEPDIR)/triple.Plo +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(librdfa_la_SOURCES) +DIST_SOURCES = $(am__librdfa_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/build/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) + +@LIBRDFA_TRUE@noinst_LTLIBRARIES = librdfa.la +@LIBRDFA_TRUE@AM_CPPFLAGS = -DLIBRDFA_IN_RAPTOR -I$(srcdir) -I$(top_srcdir)/src +@LIBRDFA_TRUE@librdfa_la_SOURCES = context.c curie.c iri.c language.c \ +@LIBRDFA_TRUE@ lists.c namespace.c rdfa.c rdfa_utils.c \ +@LIBRDFA_TRUE@ subject.c triple.c rdfa.h rdfa_utils.h config.h \ +@LIBRDFA_TRUE@ $(am__append_1) + +# Do not need: +# mingw32_utils.c +# mingw32_utils.h +@LIBRDFA_FALSE@EXTRA_DIST = \ +@LIBRDFA_FALSE@context.c \ +@LIBRDFA_FALSE@curie.c \ +@LIBRDFA_FALSE@iri.c \ +@LIBRDFA_FALSE@language.c \ +@LIBRDFA_FALSE@lists.c \ +@LIBRDFA_FALSE@namespace.c \ +@LIBRDFA_FALSE@rdfa.c \ +@LIBRDFA_FALSE@rdfa_utils.c \ +@LIBRDFA_FALSE@strtok_r.c \ +@LIBRDFA_FALSE@subject.c \ +@LIBRDFA_FALSE@triple.c \ +@LIBRDFA_FALSE@rdfa.h \ +@LIBRDFA_FALSE@rdfa_utils.h \ +@LIBRDFA_FALSE@strtok_r.h \ +@LIBRDFA_FALSE@config.h + +CLEANFILES = *.plist +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu librdfa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu librdfa/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +librdfa.la: $(librdfa_la_OBJECTS) $(librdfa_la_DEPENDENCIES) $(EXTRA_librdfa_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_librdfa_la_rpath) $(librdfa_la_OBJECTS) $(librdfa_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/context.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curie.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iri.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/language.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lists.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/namespace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfa_utils.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtok_r.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/subject.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/triple.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/context.Plo + -rm -f ./$(DEPDIR)/curie.Plo + -rm -f ./$(DEPDIR)/iri.Plo + -rm -f ./$(DEPDIR)/language.Plo + -rm -f ./$(DEPDIR)/lists.Plo + -rm -f ./$(DEPDIR)/namespace.Plo + -rm -f ./$(DEPDIR)/rdfa.Plo + -rm -f ./$(DEPDIR)/rdfa_utils.Plo + -rm -f ./$(DEPDIR)/strtok_r.Plo + -rm -f ./$(DEPDIR)/subject.Plo + -rm -f ./$(DEPDIR)/triple.Plo + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/context.Plo + -rm -f ./$(DEPDIR)/curie.Plo + -rm -f ./$(DEPDIR)/iri.Plo + -rm -f ./$(DEPDIR)/language.Plo + -rm -f ./$(DEPDIR)/lists.Plo + -rm -f ./$(DEPDIR)/namespace.Plo + -rm -f ./$(DEPDIR)/rdfa.Plo + -rm -f ./$(DEPDIR)/rdfa_utils.Plo + -rm -f ./$(DEPDIR)/strtok_r.Plo + -rm -f ./$(DEPDIR)/subject.Plo + -rm -f ./$(DEPDIR)/triple.Plo + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +# Run Clang static analyzer over sources. +@MAINTAINER_MODE_TRUE@analyze: $(SOURCES) +@MAINTAINER_MODE_TRUE@ @list='$(SOURCES)'; \ +@MAINTAINER_MODE_TRUE@ result=0; \ +@MAINTAINER_MODE_TRUE@ for file in $$list; do \ +@MAINTAINER_MODE_TRUE@ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "Analyzing $$file"; \ +@MAINTAINER_MODE_TRUE@ $(ANALYZE_COMMAND) $(srcdir)/$$file; \ +@MAINTAINER_MODE_TRUE@ status=$$?; \ +@MAINTAINER_MODE_TRUE@ if test $$status != 0; then \ +@MAINTAINER_MODE_TRUE@ result=1; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ done; \ +@MAINTAINER_MODE_TRUE@ set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/librdfa/config.h b/librdfa/config.h new file mode 100644 index 0000000..6eac131 --- /dev/null +++ b/librdfa/config.h @@ -0,0 +1,2 @@ +/* Fake librdfa config.h - reads configuration from Raptor's config header */ +#include diff --git a/librdfa/context.c b/librdfa/context.c new file mode 100644 index 0000000..fca5b07 --- /dev/null +++ b/librdfa/context.c @@ -0,0 +1,591 @@ +/** + * Copyright 2008-2012 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * The librdfa library is the Fastest RDFa Parser in the Universe. It is + * a stream parser, meaning that it takes an XML data as input and spits + * out RDF triples as it comes across them in the stream. Due to this + * processing approach, librdfa has a very, very small memory footprint. + * It is also very fast and can operate on hundreds of gigabytes of XML + * data without breaking a sweat. + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include "rdfa_utils.h" +#include "rdfa.h" + +rdfacontext* rdfa_create_context(const char* base) +{ + rdfacontext* rval = NULL; + size_t base_length = strlen(base); + + /* if the base isn't specified, don't create a context */ + if(base_length > 0) + { + char* cleaned_base; + + /* malloc and init whole context to NULL */ + rval = (rdfacontext*)malloc(sizeof(rdfacontext)); + if(!rval) + return NULL; + + memset(rval, 0, sizeof(rdfacontext)); + + /* clean and initialize base */ + cleaned_base = rdfa_iri_get_base(base); + rval->base = rdfa_replace_string(rval->base, cleaned_base); + free(cleaned_base); + } + else + { +#ifdef LIBRDFA_IN_RAPTOR +#else + printf("librdfa error: Failed to create a parsing context, " + "base IRI was not specified!\n"); +#endif + } + + return rval; +} + +void rdfa_init_context(rdfacontext* context) +{ + /* assume the RDFa processing rules are RDFa 1.1 unless otherwise specified */ + context->rdfa_version = RDFA_VERSION_1_1; + + /* assume the default host language is XML1 */ + context->host_language = HOST_LANGUAGE_XML1; + + /* the [parent subject] is set to the [base] value; */ + context->parent_subject = NULL; + if(context->base != NULL) + { + char* cleaned_base = rdfa_iri_get_base(context->base); + context->parent_subject = + rdfa_replace_string(context->parent_subject, cleaned_base); + free(cleaned_base); + } + + /* the [parent object] is set to null; */ + context->parent_object = NULL; + +#ifdef LIBRDFA_IN_RAPTOR +#else + /* the [list of URI mappings] is cleared; */ + context->uri_mappings = rdfa_create_mapping(MAX_URI_MAPPINGS); +#endif + + /* the [list of incomplete triples] is cleared; */ + context->incomplete_triples = rdfa_create_list(3); + + /* the [language] is set to null. */ + context->language = NULL; + + /* set the [current object resource] to null; */ + context->current_object_resource = NULL; + + /* the list of term mappings is set to null + * (or a list defined in the initial context of the Host Language). */ + context->term_mappings = rdfa_create_mapping(MAX_TERM_MAPPINGS); + + /* the maximum number of list mappings */ + context->list_mappings = rdfa_create_mapping(MAX_LIST_MAPPINGS); + + /* the maximum number of local list mappings */ + context->local_list_mappings = + rdfa_create_mapping(MAX_LOCAL_LIST_MAPPINGS); + + /* the default vocabulary is set to null + * (or a IRI defined in the initial context of the Host Language). */ + context->default_vocabulary = NULL; + + /* whether or not the @inlist attribute is present on the current element */ + context->inlist_present = 0; + + /* whether or not the @rel attribute is present on the current element */ + context->rel_present = 0; + + /* whether or not the @rev attribute is present on the current element */ + context->rev_present = 0; + + /* 1. First, the local values are initialized, as follows: + * + * * the [recurse] flag is set to 'true'; */ + context->recurse = 1; + + /* * the [skip element] flag is set to 'false'; */ + context->skip_element = 0; + + /* * [new subject] is set to null; */ + context->new_subject = NULL; + + /* * [current object resource] is set to null; */ + context->current_object_resource = NULL; + + /* * the [local list of URI mappings] is set to the list of URI + * mappings from the [evaluation context]; + * NOTE: This step is done in rdfa_create_new_element_context() */ + + /* FIXME: Initialize the term mappings and URI mappings based on Host Language */ + + /* * the [local list of incomplete triples] is set to null; */ + context->local_incomplete_triples = rdfa_create_list(3); + + /* * the [current language] value is set to the [language] value + * from the [evaluation context]. + * NOTE: This step is done in rdfa_create_new_element_context() */ +} + +#ifdef LIBRDFA_IN_RAPTOR +#define DECLARE_URI_MAPPING(context, prefix, value) \ +do { \ + raptor_namespace_stack* nstack = &context->sax2->namespaces; \ + raptor_namespace* ns = raptor_new_namespace(nstack, \ + (const unsigned char *)prefix, (const unsigned char*)value, 0); \ + raptor_namespaces_start_namespace(nstack, ns); \ + } while(0) +#else +#define DECLARE_URI_MAPPING(context, prefix, value) \ + rdfa_update_mapping(context->uri_mappings, prefix, value, \ + (update_mapping_value_fp)rdfa_replace_string) +#endif + +void rdfa_setup_initial_context(rdfacontext* context) +{ +#ifdef LIBRDFA_IN_RAPTOR +#else + char* key = NULL; + void* value = NULL; + void** mptr = context->uri_mappings; +#endif + + /* Setup the base RDFa 1.1 prefix and term mappings */ + if(context->rdfa_version == RDFA_VERSION_1_1) + { + /* Setup the base RDFa 1.1 prefix mappings */ + DECLARE_URI_MAPPING(context, + "grddl", "http://www.w3.org/2003/g/data-view#"); + DECLARE_URI_MAPPING(context, + "ma", "http://www.w3.org/ns/ma-ont#"); + DECLARE_URI_MAPPING(context, + "owl", "http://www.w3.org/2002/07/owl#"); + DECLARE_URI_MAPPING(context, + "rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"); + DECLARE_URI_MAPPING(context, + "rdfa", "http://www.w3.org/ns/rdfa#"); + DECLARE_URI_MAPPING(context, + "rdfs", "http://www.w3.org/2000/01/rdf-schema#"); + DECLARE_URI_MAPPING(context, + "rif", "http://www.w3.org/2007/rif#"); + DECLARE_URI_MAPPING(context, + "skos", "http://www.w3.org/2004/02/skos/core#"); + DECLARE_URI_MAPPING(context, + "skosxl", "http://www.w3.org/2008/05/skos-xl#"); + DECLARE_URI_MAPPING(context, + "wdr", "http://www.w3.org/2007/05/powder#"); + DECLARE_URI_MAPPING(context, + "void", "http://rdfs.org/ns/void#"); + DECLARE_URI_MAPPING(context, + "wdrs", "http://www.w3.org/2007/05/powder-s#"); + DECLARE_URI_MAPPING(context, + "xhv", "http://www.w3.org/1999/xhtml/vocab#"); + DECLARE_URI_MAPPING(context, + "xml", "http://www.w3.org/XML/1998/namespace"); + DECLARE_URI_MAPPING(context, + "xsd", "http://www.w3.org/2001/XMLSchema#"); + DECLARE_URI_MAPPING(context, + "cc", "http://creativecommons.org/ns#"); + DECLARE_URI_MAPPING(context, + "ctag", "http://commontag.org/ns#"); + DECLARE_URI_MAPPING(context, + "dc", "http://purl.org/dc/terms/"); + DECLARE_URI_MAPPING(context, + "dcterms", "http://purl.org/dc/terms/"); + DECLARE_URI_MAPPING(context, + "foaf", "http://xmlns.com/foaf/0.1/"); + DECLARE_URI_MAPPING(context, + "gr", "http://purl.org/goodrelations/v1#"); + DECLARE_URI_MAPPING(context, + "ical", "http://www.w3.org/2002/12/cal/icaltzd#"); + DECLARE_URI_MAPPING(context, + "og", "http://ogp.me/ns#"); + DECLARE_URI_MAPPING(context, + "rev", "http://purl.org/stuff/rev#"); + DECLARE_URI_MAPPING(context, + "sioc", "http://rdfs.org/sioc/ns#"); + DECLARE_URI_MAPPING(context, + "v", "http://rdf.data-vocabulary.org/#"); + DECLARE_URI_MAPPING(context, + "vcard", "http://www.w3.org/2006/vcard/ns#"); + DECLARE_URI_MAPPING(context, + "schema", "http://schema.org/"); + + /* Setup the base RDFa 1.1 term mappings */ + rdfa_update_mapping(context->term_mappings, + "describedby", "http://www.w3.org/2007/05/powder-s#describedby", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "license", "http://www.w3.org/1999/xhtml/vocab#license", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "role", "http://www.w3.org/1999/xhtml/vocab#role", + (update_mapping_value_fp)rdfa_replace_string); + } + + /* Setup the term mappings for XHTML1 */ + if(context->host_language == HOST_LANGUAGE_XHTML1) + { + rdfa_update_mapping(context->term_mappings, + "alternate", "http://www.w3.org/1999/xhtml/vocab#alternate", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "appendix", "http://www.w3.org/1999/xhtml/vocab#appendix", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "cite", "http://www.w3.org/1999/xhtml/vocab#cite", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "bookmark", "http://www.w3.org/1999/xhtml/vocab#bookmark", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "contents", "http://www.w3.org/1999/xhtml/vocab#contents", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "chapter", "http://www.w3.org/1999/xhtml/vocab#chapter", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "copyright", "http://www.w3.org/1999/xhtml/vocab#copyright", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "first", "http://www.w3.org/1999/xhtml/vocab#first", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "glossary", "http://www.w3.org/1999/xhtml/vocab#glossary", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "help", "http://www.w3.org/1999/xhtml/vocab#help", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "icon", "http://www.w3.org/1999/xhtml/vocab#icon", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "index", "http://www.w3.org/1999/xhtml/vocab#index", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "last", "http://www.w3.org/1999/xhtml/vocab#last", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "license", "http://www.w3.org/1999/xhtml/vocab#license", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "meta", "http://www.w3.org/1999/xhtml/vocab#meta", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "next", "http://www.w3.org/1999/xhtml/vocab#next", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "prev", "http://www.w3.org/1999/xhtml/vocab#prev", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "previous", "http://www.w3.org/1999/xhtml/vocab#previous", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "section", "http://www.w3.org/1999/xhtml/vocab#section", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "start", "http://www.w3.org/1999/xhtml/vocab#start", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "stylesheet", "http://www.w3.org/1999/xhtml/vocab#stylesheet", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "subsection", "http://www.w3.org/1999/xhtml/vocab#subsection", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "top", "http://www.w3.org/1999/xhtml/vocab#top", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "up", "http://www.w3.org/1999/xhtml/vocab#up", + (update_mapping_value_fp)rdfa_replace_string); + rdfa_update_mapping(context->term_mappings, + "p3pv1", "http://www.w3.org/1999/xhtml/vocab#p3pv1", + (update_mapping_value_fp)rdfa_replace_string); + + /* From the role attribute module */ + rdfa_update_mapping(context->term_mappings, + "role", "http://www.w3.org/1999/xhtml/vocab#role", + (update_mapping_value_fp)rdfa_replace_string); + } + + /* Setup the prefix and term mappings for HTML4 and HTML5 */ + if(context->host_language == HOST_LANGUAGE_HTML) + { + /* No term or prefix mappings as of 2012-04-04 */ + } + +#ifdef LIBRDFA_IN_RAPTOR + /* Raptor does this elsewhere */ +#else + /* Generate namespace triples for all values in the uri_mapping */ + while(*mptr != NULL) + { + rdfa_next_mapping(mptr++, &key, &value); + mptr++; + rdfa_generate_namespace_triple(context, key, value); + } +#endif +} + +/** + * Creates a new context for the current element by cloning certain + * parts of the old context on the top of the given stack. + * + * @param context_stack the context stack that is associated with this + * processing run. + */ +rdfacontext* rdfa_create_new_element_context(rdfalist* context_stack) +{ + rdfacontext* parent_context = (rdfacontext*) + context_stack->items[context_stack->num_items - 1]->data; + rdfacontext* rval = rdfa_create_context(parent_context->base); + + if(!rval) + return NULL; + + /* * Otherwise, the values are: */ + + /* * the [ base ] is set to the [ base ] value of the current + * [ evaluation context ]; */ + rval->base = rdfa_replace_string(rval->base, parent_context->base); + rdfa_init_context(rval); + + /* Set the processing depth as parent + 1 */ + rval->depth = parent_context->depth + 1; + + /* copy the URI mappings */ +#ifdef LIBRDFA_IN_RAPTOR + /* Raptor does this automatically for URIs */ +#else + rdfa_free_mapping(rval->uri_mappings, (free_mapping_value_fp)free); +#endif + rdfa_free_mapping(rval->term_mappings, (free_mapping_value_fp)free); + rdfa_free_mapping(rval->list_mappings, (free_mapping_value_fp)rdfa_free_list); + rdfa_free_mapping(rval->local_list_mappings, (free_mapping_value_fp)rdfa_free_list); +#ifdef LIBRDFA_IN_RAPTOR + /* Raptor does this automatically for URIs */ +#else + rval->uri_mappings = + rdfa_copy_mapping((void**)parent_context->uri_mappings, + (copy_mapping_value_fp)rdfa_replace_string); +#endif + rval->term_mappings = + rdfa_copy_mapping((void**)parent_context->term_mappings, + (copy_mapping_value_fp)rdfa_replace_string); + rval->list_mappings = + rdfa_copy_mapping((void**)parent_context->local_list_mappings, + (copy_mapping_value_fp)rdfa_replace_list); + rval->local_list_mappings = + rdfa_copy_mapping((void**)parent_context->local_list_mappings, + (copy_mapping_value_fp)rdfa_replace_list); + + /* inherit the parent context's host language and RDFa processor mode */ + rval->host_language = parent_context->host_language; + rval->rdfa_version = parent_context->rdfa_version; + + /* inherit the parent context's language */ + if(parent_context->language != NULL) + { + rval->language = + rdfa_replace_string(rval->language, parent_context->language); + } + + /* inherit the parent context's default vocabulary */ + if(parent_context->default_vocabulary != NULL) + { + rval->default_vocabulary = rdfa_replace_string( + rval->default_vocabulary, parent_context->default_vocabulary); + } + + /* set the callbacks callback */ + rval->default_graph_triple_callback = + parent_context->default_graph_triple_callback; + rval->processor_graph_triple_callback = + parent_context->processor_graph_triple_callback; + rval->buffer_filler_callback = parent_context->buffer_filler_callback; + + /* inherit the bnode count, _: bnode name, recurse flag, and state + * of the xml_literal_namespace_insertion */ + rval->bnode_count = parent_context->bnode_count; + rval->underscore_colon_bnode_name = + rdfa_replace_string(rval->underscore_colon_bnode_name, + parent_context->underscore_colon_bnode_name); + rval->recurse = parent_context->recurse; + rval->skip_element = 0; + rval->callback_data = parent_context->callback_data; + rval->xml_literal_namespaces_defined = + parent_context->xml_literal_namespaces_defined; + rval->xml_literal_xml_lang_defined = + parent_context->xml_literal_xml_lang_defined; + +#if 0 + /* inherit the parent context's new_subject + * TODO: This is not anywhere in the syntax processing document */ + if(parent_context->new_subject != NULL) + { + rval->new_subject = rdfa_replace_string( + rval->new_subject, parent_context->new_subject); + } +#endif + + if(parent_context->skip_element == 0) + { + /* o the [ parent subject ] is set to the value of [ new subject ], + * if non-null, or the value of the [ parent subject ] of the + * current [ evaluation context ]; */ + if(parent_context->new_subject != NULL) + { + rval->parent_subject = rdfa_replace_string( + rval->parent_subject, parent_context->new_subject); + } + else + { + rval->parent_subject = rdfa_replace_string( + rval->parent_subject, parent_context->parent_subject); + } + + /* o the [ parent object ] is set to value of [ current object + * resource ], if non-null, or the value of [ new subject ], if + * non-null, or the value of the [ parent subject ] of the + * current [ evaluation context ]; */ + if(parent_context->current_object_resource != NULL) + { + rval->parent_object = + rdfa_replace_string( + rval->parent_object, parent_context->current_object_resource); + } + else if(parent_context->new_subject != NULL) + { + rval->parent_object = + rdfa_replace_string( + rval->parent_object, parent_context->new_subject); + } + else + { + rval->parent_object = + rdfa_replace_string( + rval->parent_object, parent_context->parent_subject); + } + + /* o the [ list of incomplete triples ] is set to the [ local list + * of incomplete triples ]; */ + rval->incomplete_triples = rdfa_replace_list( + rval->incomplete_triples, parent_context->local_incomplete_triples); + } + else + { + rval->parent_subject = rdfa_replace_string( + rval->parent_subject, parent_context->parent_subject); + rval->parent_object = rdfa_replace_string( + rval->parent_object, parent_context->parent_object); + + /* copy the incomplete triples */ + rval->incomplete_triples = rdfa_replace_list( + rval->incomplete_triples, parent_context->incomplete_triples); + + /* copy the local list of incomplete triples */ + rval->local_incomplete_triples = rdfa_replace_list( + rval->local_incomplete_triples, + parent_context->local_incomplete_triples); + } + +#ifdef LIBRDFA_IN_RAPTOR + rval->base_uri = parent_context->base_uri; + rval->sax2 = parent_context->sax2; + rval->namespace_handler = parent_context->namespace_handler; + rval->namespace_handler_user_data = parent_context->namespace_handler_user_data; +#endif + + return rval; +} + +void rdfa_free_context_stack(rdfacontext* context) +{ + /* this field is not NULL only on the rdfacontext* at the top of the stack */ + if(context->context_stack != NULL) + { + void* rval; + /* free the stack ensuring that we do not delete this context if + * it is in the list (which it may be, if parsing ended on error) */ + do + { + rval = rdfa_pop_item(context->context_stack); + if(rval && rval != context) + { + rdfa_free_context((rdfacontext*)rval); + } + } + while(rval); + free(context->context_stack->items); + free(context->context_stack); + context->context_stack = NULL; + } +} + +void rdfa_free_context(rdfacontext* context) +{ + free(context->base); + free(context->default_vocabulary); + free(context->parent_subject); + free(context->parent_object); + +#ifdef LIBRDFA_IN_RAPTOR +#else + rdfa_free_mapping(context->uri_mappings, (free_mapping_value_fp)free); +#endif + + rdfa_free_mapping(context->term_mappings, (free_mapping_value_fp)free); + rdfa_free_list(context->incomplete_triples); + rdfa_free_mapping(context->list_mappings, + (free_mapping_value_fp)rdfa_free_list); + rdfa_free_mapping(context->local_list_mappings, + (free_mapping_value_fp)rdfa_free_list); + free(context->language); + free(context->underscore_colon_bnode_name); + free(context->new_subject); + free(context->current_object_resource); + free(context->about); + free(context->typed_resource); + free(context->resource); + free(context->href); + free(context->src); + free(context->content); + free(context->datatype); + rdfa_free_list(context->property); + free(context->plain_literal); + free(context->xml_literal); + + /* TODO: These should be moved into their own data structure */ + rdfa_free_list(context->local_incomplete_triples); + + rdfa_free_context_stack(context); + free(context->working_buffer); + free(context); +} diff --git a/librdfa/curie.c b/librdfa/curie.c new file mode 100644 index 0000000..98ee7e0 --- /dev/null +++ b/librdfa/curie.c @@ -0,0 +1,691 @@ +/** + * Copyright 2008 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * The CURIE module is used to resolve all forms of CURIEs that + * XHTML+RDFa accepts. + * + * @author Manu Sporny + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#ifdef HAVE_STRINGS_H +# include +#endif +#include +#include +#include "rdfa_utils.h" +#include "rdfa.h" +#include "strtok_r.h" + +/* The base XHTML vocab URL is used to resolve URIs that are reserved + * words. Any reserved listed above is appended to the URL below to + * form a complete IRI. */ +#define XHTML_VOCAB_URI "http://www.w3.org/1999/xhtml/vocab#" +#define XHTML_VOCAB_URI_SIZE 35 + +/** + * Gets the type of CURIE that is passed to it. + * + * @param uri the uri to check. + * + * @return either CURIE_TYPE_SAFE, CURIE_TYPE_URI or CURIE_TYPE_INVALID. + */ +static curie_t rdfa_get_curie_type(const char* uri) +{ + curie_t rval = CURIE_TYPE_INVALID; + + if(uri != NULL) + { + size_t uri_length = strlen(uri); + + if((uri[0] == '[') && (uri[uri_length - 1] == ']')) + { + /* a safe curie starts with [ and ends with ] */ + rval = CURIE_TYPE_SAFE; + } + else if(strstr(uri, ":") != NULL) + { + /* at this point, it is unknown whether or not the CURIE is + * an IRI or an unsafe CURIE */ + rval = CURIE_TYPE_IRI_OR_UNSAFE; + } + else + { + /* if none of the above match, then the CURIE is probably a + * relative IRI */ + rval = CURIE_TYPE_IRI_OR_UNSAFE; + } + } + + return rval; +} + +char* rdfa_resolve_uri(rdfacontext* context, const char* uri) +{ + char* rval = NULL; + char* path_start = NULL; + size_t base_length = strlen(context->base); + + if(strlen(uri) < 1) + { + /* if a blank URI is given, use the base context */ + rval = rdfa_replace_string(rval, context->base); + } + else if(strstr(uri, ":") != NULL) + { + /* if a IRI is given, don't concatenate */ + rval = rdfa_replace_string(rval, uri); + } + else if(uri[0] == '#' || uri[0] == '?') + { + /* if a fragment ID or start of a query parameter is given, + * concatenate it with the base URI */ + rval = rdfa_join_string(context->base, uri); + } + else if(uri[0] == '/') + { + /* if a relative URI is given, but it starts with a '/', use the + * host part concatenated to the given URI */ + char* tmp = NULL; + char* end_index = NULL; + + /* initialize the working-set data */ + tmp = rdfa_replace_string(tmp, context->base); + end_index = strchr(tmp, '/'); + + + /* find the final '/' character after the host part of the context base. */ + if(end_index != NULL) + { + end_index = strchr(end_index + 1, '/'); + + if(end_index != NULL) + { + end_index = strchr(end_index + 1, '/'); + } + } + + /* if the '/' character after the host part was found, copy the host + * part and append the given URI to the URI, otherwise, append the + * host part and the URI part as-is, ensuring that a '/' exists at the + * end of the host part. */ + if(end_index != NULL) + { + char* rval_copy; + + *end_index = '\0'; + + /* if the '/' character after the host part was found, copy the host + * part and append the given URI to the URI. */ + rval_copy = rdfa_replace_string(rval, tmp); + rval = rdfa_join_string(rval_copy, uri); + free(rval_copy); + } + else + { + /* append the host part and the URI part as-is, ensuring that a + * '/' exists at the end of the host part. */ + size_t tlen = strlen(tmp) - 1; + char* rval_copy; + + rval_copy = rdfa_replace_string(rval, tmp); + + if(rval_copy[tlen] == '/') + { + rval_copy[tlen] = '\0'; + } + rval = rdfa_join_string(rval_copy, uri); + free(rval_copy); + } + + free(tmp); + } + else + { + if((char)context->base[base_length - 1] == '/') + { + /* if the base URI already ends in /, concatenate */ + rval = rdfa_join_string(context->base, uri); + } + else + { + /* if we have a relative URI, chop off the name of the file + * and replace it with the relative pathname */ + char* end_index = strrchr(context->base, '/'); + + if(end_index != NULL) + { + char* tmpstr = NULL; + char* end_index2; + + tmpstr = rdfa_replace_string(tmpstr, context->base); + end_index2 = strrchr(tmpstr, '/'); + if(end_index2 != NULL) { + end_index2++; + *end_index2 = '\0'; + } + + rval = rdfa_join_string(tmpstr, uri); + free(tmpstr); + } + } + } + + /* It is possible that rval may be NULL here in OOM scenarios */ + if(!rval) + return NULL; + + /* Find the start of a scheme-based URL path */ + path_start = (char*)strstr(rval, "://"); + if(path_start != NULL) + { + if(strstr(path_start, "/.") != NULL) + { + path_start += 3; + path_start = strstr(path_start, "/"); + } + else + { + path_start = NULL; + } + } + + /* remove any dot-segments that remain in the URL for URLs w/ schemes */ + if(path_start != NULL) + { + size_t rlen = strlen(rval) + 1; + size_t hlen = path_start - rval; + char* src = (char*)malloc(rlen + 4); + char* sptr = src + hlen; + char* dest = (char*)malloc(rlen + 1); + char* dptr = dest + hlen; + char* dfence = dptr; + + memset(src, 0, rlen + 4); + memcpy(src, rval, rlen); + strncpy(dest, rval, hlen); + + /* Process the path portion of the IRI */ + while(sptr[0] != '?' && sptr[0] != '\0') + { + if(sptr[0] == '.' && sptr[1] == '.' && sptr[2] == '/') + { + /* A. If the input buffer begins with a prefix of "../", + * then remove that prefix from the input buffer; otherwise, + */ + sptr += 3; + } + else if(sptr[0] == '.' && sptr[1] == '/') + { + /* A. If the input buffer begins with a prefix of "./", + * then remove that prefix from the input buffer; otherwise, + */ + sptr += 2; + } + else if(sptr[0] == '/' && sptr[1] == '.' && sptr[2] == '/') + { + /* B. if the input buffer begins with a prefix of "/./", + * then replace that prefix with "/" in the input buffer; + * otherwise, + */ + sptr += 2; + } + else if(sptr[0] == '/' && sptr[1] == '.' && sptr[2] == '\0') + { + /* B. if the input buffer begins with a prefix of "/.", + * where "." is a complete path segment, then replace that + * prefix with "/" in the input buffer; otherwise, + */ + sptr += 1; + *sptr = '/'; + } + else if(sptr[0] == '/' && sptr[1] == '.' && sptr[2] == '.' && + ((sptr[3] == '/') || (sptr[3] == '\0'))) + { + /* C. if the input buffer begins with a prefix of "/../", + * then replace that prefix with "/" in the input buffer and + * remove the last segment and its preceding "/" (if any) from + * the output buffer; otherwise, + */ + if(sptr[3] == '/') + { + sptr += 3; + } + else if(sptr[3] == '\0') + { + sptr += 2; + *sptr = '/'; + } + + /* remove the last segment and the preceding '/' */ + if(dptr > dfence) + { + dptr--; + if(dptr[0] == '/') + { + dptr--; + } + } + while(dptr >= dfence && dptr[0] != '/') + { + dptr--; + } + if(dptr >= dfence) + { + dptr[0] = '\0'; + } + else + { + dptr = dfence; + dptr[0] = '\0'; + } + } + else if(sptr[0] == '.' && sptr[1] == '\0') + { + /* D. if the input buffer consists only of ".", then remove + * that from the input buffer; otherwise, + */ + sptr++; + + } + else if(sptr[0] == '.' && sptr[1] == '.' && sptr[2] == '\0') + { + /* D. if the input buffer consists only of "..", then remove + * that from the input buffer; otherwise, + */ + sptr += 2; + } + else + { + /* Copy the path segment */ + do + { + *dptr++ = *sptr++; + *dptr = '\0'; + } while(sptr[0] != '/' && sptr[0] != '?' && sptr[0] != '\0'); + } + } + + /* Copy the remaining query parameters */ + if(sptr[0] == '?') + { + size_t rest_len = strlen(sptr); + memcpy(dptr, sptr, rest_len + 1); + } + else + { + dptr[0] = '\0'; + } + + free(rval); + free(src); + rval = dest; + } + + return rval; +} + +char* rdfa_resolve_curie( + rdfacontext* context, const char* uri, curieparse_t mode) +{ + char* rval = NULL; + curie_t ctype = rdfa_get_curie_type(uri); + + if(!uri) + return NULL; + + if(ctype == CURIE_TYPE_INVALID) + { + rval = NULL; + } + else if((ctype == CURIE_TYPE_IRI_OR_UNSAFE) && + ((mode == CURIE_PARSE_HREF_SRC) || + (context->rdfa_version == RDFA_VERSION_1_0 && + mode == CURIE_PARSE_ABOUT_RESOURCE))) + { + /* If we are parsing something that can take either a CURIE or a + * URI, and the type is either IRI or UNSAFE, assume that it is + * an IRI */ + rval = rdfa_resolve_uri(context, uri); + } + + /* + * Check to see if the value is a term. + */ + if(ctype == CURIE_TYPE_IRI_OR_UNSAFE && mode == CURIE_PARSE_PROPERTY) + { + const char* term_iri; + term_iri = (const char*)rdfa_get_mapping(context->term_mappings, uri); + if(term_iri != NULL) + { + rval = rdfa_strdup(term_iri); + } + else if(context->default_vocabulary == NULL && strstr(uri, ":") == NULL) + { + /* Generate the processor warning if this is a missing term */ +#define FORMAT_1 "The use of the '%s' term was unrecognized by the RDFa processor because it is not a valid term for the current Host Language." + +#ifdef LIBRDFA_IN_RAPTOR + raptor_parser_warning((raptor_parser*)context->callback_data, + FORMAT_1, uri); +#else + char msg[1024]; + snprintf(msg, 1024, FORMAT_1, uri); + + rdfa_processor_triples(context, RDFA_PROCESSOR_WARNING, msg); +#endif + } + } + + /* if we are processing a safe CURIE OR + * if we are parsing an unsafe CURIE that is an @type_of, + * @datatype, @property, @rel, or @rev attribute, treat the curie + * as not an IRI, but an unsafe CURIE */ + if(rval == NULL && ((ctype == CURIE_TYPE_SAFE) || + ((ctype == CURIE_TYPE_IRI_OR_UNSAFE) && + ((mode == CURIE_PARSE_INSTANCEOF_DATATYPE) || + (mode == CURIE_PARSE_PROPERTY) || + (mode == CURIE_PARSE_RELREV) || + (context->rdfa_version == RDFA_VERSION_1_1 && + mode == CURIE_PARSE_ABOUT_RESOURCE))))) + { + char* working_copy = NULL; + char* wcptr = NULL; + char* prefix = NULL; + char* curie_reference = NULL; + const char* expanded_prefix = NULL; + size_t uri_len = strlen(uri); + working_copy = (char*)malloc(uri_len + 1); + memcpy(working_copy, uri, uri_len + 1);/*rdfa_replace_string(working_copy, uri);*/ + + /* if this is a safe CURIE, chop off the beginning and the end */ + if(ctype == CURIE_TYPE_SAFE) + { + prefix = strtok_r(working_copy, "[:]", &wcptr); + if(wcptr) + curie_reference = strtok_r(NULL, "[]", &wcptr); + } + else if(ctype == CURIE_TYPE_IRI_OR_UNSAFE) + { + prefix = strtok_r(working_copy, ":", &wcptr); + if(wcptr) + curie_reference = strtok_r(NULL, "", &wcptr); + } + + /* fully resolve the prefix and get its length */ + + /* if a colon was found, but no prefix, use the XHTML vocabulary URI + * as the expanded prefix */ + if((uri[0] == ':') || (strcmp(uri, "[:]") == 0)) + { + expanded_prefix = XHTML_VOCAB_URI; + curie_reference = prefix; + prefix = NULL; + } + else if(uri[0] == ':') + { + /* FIXME: This looks like a bug - don't know why this code is + * in here. I think it's for the case where ":next" is + * specified, but the code's not checking that -- manu */ + expanded_prefix = context->base; + curie_reference = prefix; + prefix = NULL; + } + else if(prefix != NULL) + { + if((mode != CURIE_PARSE_PROPERTY) && + (mode != CURIE_PARSE_RELREV) && + strcmp(prefix, "_") == 0) + { + /* if the prefix specifies this as a blank node, then we + * use the blank node prefix */ + expanded_prefix = "_"; + } + else + { + /* if the prefix was defined, get it from the set of URI mappings. */ +#ifdef LIBRDFA_IN_RAPTOR + if(!strcmp(prefix, "xml")) + { + expanded_prefix = RAPTOR_GOOD_CAST(const char*, raptor_xml_namespace_uri); + } + else + { + raptor_namespace *nspace; + raptor_uri* ns_uri; + nspace = raptor_namespaces_find_namespace(&context->sax2->namespaces, + (const unsigned char*)prefix, + (int)strlen(prefix)); + if(nspace) { + ns_uri = raptor_namespace_get_uri(nspace); + if(ns_uri) + expanded_prefix = (const char*)raptor_uri_as_string(ns_uri); + } + } +#else + expanded_prefix = + rdfa_get_mapping(context->uri_mappings, prefix); + + /* Generate the processor warning if the prefix was not found */ + if(expanded_prefix == NULL && strstr(uri, ":") != NULL && + strstr(uri, "://") == NULL) + { +#define FORMAT_2 "The '%s' prefix was not found. You may want to check that it is declared before it is used, or that it is a valid prefix string." +#ifdef LIBRDFA_IN_RAPTOR + raptor_parser_warning((raptor_parser*)context->callback_data, + FORMAT_2, prefix); +#else + char msg[1024]; + snprintf(msg, 1024, FORMAT_2, prefix); + + rdfa_processor_triples(context, RDFA_PROCESSOR_WARNING, msg); +#endif + } +#endif + } + } + + if((expanded_prefix != NULL) && (curie_reference != NULL)) + { + /* if the expanded prefix and the reference exist, generate the + * full IRI. */ + if(strcmp(expanded_prefix, "_") == 0) + { + rval = rdfa_join_string("_:", curie_reference); + } + else + { + rval = rdfa_join_string(expanded_prefix, curie_reference); + } + } + else if((expanded_prefix != NULL) && (expanded_prefix[0] != '_') && + (curie_reference == NULL)) + { + /* if the expanded prefix exists, but the reference is null, + * generate the CURIE because a reference-less CURIE is still + * valid */ + rval = rdfa_join_string(expanded_prefix, ""); + } + + free(working_copy); + } + + if(rval == NULL) + { + /* if we're NULL at this point, the CURIE might be the special + * unnamed bnode specified by _: */ + if((strcmp(uri, "[_:]") == 0) || (strcmp(uri, "_:") == 0)) + { + if(context->underscore_colon_bnode_name == NULL) + { + context->underscore_colon_bnode_name = rdfa_create_bnode(context); + } + rval = rdfa_replace_string(rval, context->underscore_colon_bnode_name); + } + /* if we're NULL at this point and the IRI isn't [], then this might be + * an IRI */ + else if(context->rdfa_version == RDFA_VERSION_1_1 && + (strcmp(uri, "[]") != 0)) + { + if((context->default_vocabulary != NULL) && + ((mode == CURIE_PARSE_PROPERTY) || (mode == CURIE_PARSE_RELREV) || + (mode == CURIE_PARSE_INSTANCEOF_DATATYPE)) && + (strstr(uri, ":") == NULL)) + { + rval = rdfa_join_string(context->default_vocabulary, uri); + } + else if(((mode == CURIE_PARSE_PROPERTY) || + (mode == CURIE_PARSE_ABOUT_RESOURCE) || + (mode == CURIE_PARSE_INSTANCEOF_DATATYPE)) && + (strstr(uri, "_:") == NULL) && (strstr(uri, "[_:") == NULL)) + { + rval = rdfa_resolve_uri(context, uri); + } + } + } + + /* even though a reference-only CURIE is valid, it does not + * generate a triple in XHTML+RDFa. If we're NULL at this point, + * the given value wasn't valid in XHTML+RDFa. */ + + return rval; +} + +/** + * Resolves a given uri depending on whether or not it is a fully + * qualified IRI, a CURIE, or a short-form XHTML reserved word for + * @rel or @rev as defined in the XHTML+RDFa Syntax Document. + * + * @param context the current processing context. + * @param uri the URI part to process. + * + * @return the fully qualified IRI, or NULL if the conversion failed + * due to the given URI not being a short-form XHTML reserved + * word. The memory returned from this function MUST be freed. + */ +char* rdfa_resolve_relrev_curie(rdfacontext* context, const char* uri) +{ + char* rval = NULL; + const char* resource = uri; + + /* check to make sure the URI doesn't have an empty prefix */ + if(uri[0] == ':') + { + resource++; + } + + /* override reserved words if there is a default vocab defined + * NOTE: Don't have to check for RDFa 1.1 mode because vocab is only defined + * in RDFa 1.1 */ + if(context->default_vocabulary != NULL) + { + rval = rdfa_resolve_curie(context, uri, CURIE_PARSE_RELREV); + } + else if(context->host_language == HOST_LANGUAGE_XHTML1) + { + /* search all of the XHTML @rel/@rev reserved words for a + * case-insensitive match against the given URI */ + char* term = rdfa_strdup(resource); + char* ptr = NULL; + + for(ptr = term; *ptr; ptr++) + { + *ptr = RAPTOR_GOOD_CAST(char, tolower(*ptr)); + } + + rval = (char*)rdfa_get_mapping(context->term_mappings, term); + if(rval != NULL) + { + rval = rdfa_strdup(rval); + } + free(term); + } + else + { + /* Search the term mappings for a match */ + rval = (char*)rdfa_get_mapping(context->term_mappings, resource); + if(rval != NULL) + { + rval = rdfa_strdup(rval); + } + } + + /* if a search against the registered terms failed, + * attempt to resolve the value as a standard CURIE */ + if(rval == NULL) + { + rval = rdfa_resolve_curie(context, uri, CURIE_PARSE_RELREV); + } + + /* if a CURIE wasn't found, attempt to resolve the value as an IRI */ + if(rval == NULL && (context->rdfa_version == RDFA_VERSION_1_1)) + { + rval = rdfa_resolve_uri(context, uri); + } + + return rval; +} + +rdfalist* rdfa_resolve_curie_list( + rdfacontext* rdfa_context, const char* uris, curieparse_t mode) +{ + rdfalist* rval = rdfa_create_list(3); + char* working_uris = NULL; + char* uptr = NULL; + char* ctoken = NULL; + working_uris = rdfa_replace_string(working_uris, uris); + + /* go through each item in the list of CURIEs and resolve each */ + ctoken = strtok_r(working_uris, RDFA_WHITESPACE, &uptr); + + while(ctoken != NULL) + { + char* resolved_curie = NULL; + + if((mode == CURIE_PARSE_INSTANCEOF_DATATYPE) || + (mode == CURIE_PARSE_ABOUT_RESOURCE) || + (mode == CURIE_PARSE_PROPERTY)) + { + resolved_curie = + rdfa_resolve_curie(rdfa_context, ctoken, mode); + } + else if(mode == CURIE_PARSE_RELREV) + { + resolved_curie = + rdfa_resolve_relrev_curie(rdfa_context, ctoken); + } + + /* add the CURIE if it was a valid one */ + if(resolved_curie != NULL) + { + rdfa_add_item(rval, resolved_curie, RDFALIST_FLAG_TEXT); + free(resolved_curie); + } + + ctoken = strtok_r(NULL, RDFA_WHITESPACE, &uptr); + } + + free(working_uris); + + return rval; +} diff --git a/librdfa/iri.c b/librdfa/iri.c new file mode 100644 index 0000000..8f72d78 --- /dev/null +++ b/librdfa/iri.c @@ -0,0 +1,73 @@ +/** + * Copyright 2008 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * The iri module is used to process IRIs. + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +#include "rdfa.h" +#include "rdfa_utils.h" + +/** + * Strips the iquery and ifragment part from an IRI. This leaves just the + * scheme and the ihier-part, as defined in RFC 3987. This function will + * copy the input string and return a new string that must be free()'d. + * + * @param iri the IRI that should be stripped of anything after the iquery + * and fragment, if they exist. + */ +char* rdfa_iri_get_base(const char* iri) +{ + char* rval = NULL; + const char* eindex = 0; + + /* search to see if there is iquery separator */ + eindex = strchr(iri, '?'); + if(eindex == NULL) + { + /* if there is no iquery separator, check to see if there is an + * ifragment separator */ + eindex = strchr(iri, '#'); + } + + /* check to see if the output string needs to be different from the + * input string */ + if(eindex == NULL) + { + /* there was no iquery or ifragment in the input string, so there is + * no need to reformat the string */ + rval = rdfa_strdup(iri); + } + else + { + /* the output string should be concatenated */ + unsigned int length = (unsigned int)(eindex - iri); + rval = (char*)malloc(length + 1); + rval = strncpy(rval, iri, length); + rval[length] = '\0'; + } + + return rval; +} diff --git a/librdfa/language.c b/librdfa/language.c new file mode 100644 index 0000000..daa2daf --- /dev/null +++ b/librdfa/language.c @@ -0,0 +1,55 @@ +/** + * Copyright 2008 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * The language module is used to determine and set the current language. + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include "rdfa_utils.h" +#include "rdfa.h" + +/** + * Updates the language given the value of the xml:lang attribute. + * + * @param lang the new value of the lang attribute. + */ +void rdfa_update_language(rdfacontext* context, const char* lang) +{ + /* the [current element] is parsed for any language information, + * and [language] is set in the [current evaluation context]; */ + if(lang != NULL) + { + if(strlen(lang) > 0) + { + /* if a language was specified, set it */ + context->language = rdfa_replace_string(context->language, lang); + } + else + { + /* if a blank language was specified, clear the language context */ + free(context->language); + context->language = NULL; + } + } +} diff --git a/librdfa/lists.c b/librdfa/lists.c new file mode 100644 index 0000000..d399979 --- /dev/null +++ b/librdfa/lists.c @@ -0,0 +1,243 @@ +/** + * Copyright 2012 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * Handles all triple functionality including all incomplete triple + * functionality. + * + * @author Manu Sporny + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include "rdfa_utils.h" +#include "rdfa.h" + +void rdfa_establish_new_inlist_triples(rdfacontext* context, + rdfalist* predicates, const char* object, rdfresource_t object_type) +{ + int i = 0; + for(i = 0; i < (int)predicates->num_items; i++) + { + const char* predicate = (const char*)predicates->items[i]->data; + char* resolved_predicate = rdfa_resolve_relrev_curie(context, predicate); + rdftriple* triple; + /* ensure the list mapping exists */ + rdfa_create_list_mapping( + context, context->local_list_mappings, + context->new_subject, resolved_predicate); + + /* add an incomplete triple for each list mapping */ + triple = rdfa_create_triple(context->new_subject, resolved_predicate, + object, object_type, context->datatype, context->language); + rdfa_append_to_list_mapping(context->local_list_mappings, + context->new_subject, resolved_predicate, triple); + + free(resolved_predicate); + } + +#if defined(DEBUG) && DEBUG > 0 + printf("LOCAL LIST MAPPINGS: "); + rdfa_print_mapping(context->local_list_mappings, + (print_mapping_value_fp)rdfa_print_triple_list); +#endif +} + +void rdfa_save_incomplete_list_triples( + rdfacontext* context, const rdfalist* rel) +{ + unsigned int i; + for(i = 0; i < rel->num_items; i++) + { + const char* curie = (const char*)rel->items[i]->data; + char* resolved_curie = rdfa_resolve_relrev_curie(context, curie); + + /* ensure the list mapping exists */ + rdfa_create_list_mapping( + context, context->local_list_mappings, + context->new_subject, resolved_curie); + + /* get the list name */ + rdfa_add_item( + context->local_incomplete_triples, resolved_curie, + (liflag_t)(RDFALIST_FLAG_DIR_NONE | RDFALIST_FLAG_TEXT)); + + free(resolved_curie); + } + +#if defined(DEBUG) && DEBUG > 0 + printf("LOCAL INCOMPLETE TRIPLES: "); + rdfa_print_list(context->local_incomplete_triples); +#endif +} + +void rdfa_complete_list_triples(rdfacontext* context) +{ + /* For each IRI in the local list mapping, if the equivalent list does + * not exist in the evaluation context, indicating that the list was + * originally instantiated on the current element, use the list as follows: */ + int i; + rdfalist* list; + rdftriple* triple; + void** mptr = context->local_list_mappings; + char* key = NULL; + void** kptr = NULL; + void* value = NULL; + unsigned int list_depth = 0; + +#if defined(DEBUG) && DEBUG > 0 + printf("local_list_mappings: "); + rdfa_print_mapping(context->local_list_mappings, + (print_mapping_value_fp)rdfa_print_triple_list); +#endif + + while(*mptr != NULL) + { + kptr = mptr; + rdfa_next_mapping(mptr++, &key, &value); + list = (rdfalist*)value; + list_depth = list->user_data; + mptr++; +#if defined(DEBUG) && DEBUG > 0 + printf("LIST TRIPLES for key (%u/%u): KEY(%s)\n", + context->depth, list_depth, key); +#endif + + if((context->depth < (int)list_depth) && + (rdfa_get_list_mapping( + context->list_mappings, context->new_subject, key) == NULL) && + (strcmp(key, RDFA_MAPPING_DELETED_KEY) != 0)) + { + char* predicate = strstr(key, " ") + 1; + triple = (rdftriple*)list->items[0]->data; + if(list->num_items == 1) + { + /* Free unused list triple */ + rdfa_free_triple(triple); + + /* the list is empty, generate an empty list triple */ + triple = rdfa_create_triple(context->new_subject, predicate, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil", + RDF_TYPE_IRI, NULL, NULL); + context->default_graph_triple_callback( + triple, context->callback_data); + } + else + { + char* bnode = NULL; + char* subject; + char* tmp = NULL; + bnode = rdfa_replace_string(bnode, triple->subject); + for(i = 1; i < (int)list->num_items; i++) + { + char* next = NULL; + triple = (rdftriple*)list->items[i]->data; + /* Create a new 'bnode' array containing newly created bnodes, + * one for each item in the list + * For each bnode-(IRI or literal) pair from the list the + * following triple is generated: + * + * subject + * bnode + * predicate + * http://www.w3.org/1999/02/22-rdf-syntax-ns#first + * object + * full IRI or literal */ + triple->subject = + rdfa_replace_string(triple->subject, bnode); + triple->predicate = + rdfa_replace_string(triple->predicate, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#first"); + context->default_graph_triple_callback( + triple, context->callback_data); + + /* Free the list item */ + free(list->items[i]); + list->items[i] = NULL; + + /* For each item in the 'bnode' array the following triple is + * generated: + * + * subject + * bnode + * predicate + * http://www.w3.org/1999/02/22-rdf-syntax-ns#rest + * object + * next item in the 'bnode' array or, if that does not exist, + * http://www.w3.org/1999/02/22-rdf-syntax-ns#nil */ + if(i < (int)list->num_items - 1) + { + next = rdfa_create_bnode(context); + } + else + { + next = rdfa_strdup((char*)"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"); + } + + triple = rdfa_create_triple(bnode, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#rest", + next, RDF_TYPE_IRI, NULL, NULL); + context->default_graph_triple_callback( + triple, context->callback_data); + + /* Free the bnode, setting 'next' appropriately */ + free(bnode); + bnode = next; + } + + /* A single additional triple is generated: + * subject + * current subject + * predicate + * full IRI of the local list mapping associated with this list + * object + * first item of the 'bnode' array */ + subject = rdfa_strdup(key); + if(subject) + tmp = strstr(subject, " "); + + if(tmp) { + tmp[0] = '\0'; + triple = (rdftriple*)list->items[0]->data; + triple->subject = + rdfa_replace_string(triple->subject, subject); + triple->predicate = + rdfa_replace_string(triple->predicate, predicate); + context->default_graph_triple_callback( + triple, context->callback_data); + } + if(subject) + free(subject); + if(bnode) + free(bnode); + } + + /* Free the first list item and empty the list */ + free(list->items[0]); + list->items[0] = NULL; + list->num_items = 0; + + /* clear the entry from the mapping */ + *kptr = rdfa_replace_string((char*)*kptr, RDFA_MAPPING_DELETED_KEY); + } + } +} diff --git a/librdfa/namespace.c b/librdfa/namespace.c new file mode 100644 index 0000000..06c7f00 --- /dev/null +++ b/librdfa/namespace.c @@ -0,0 +1,140 @@ +/** + * Copyright 2008-2011 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * This file implements mapping data structure memory management as + * well as updating URI mappings. + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include "rdfa_utils.h" +#include "rdfa.h" + +/** + * Attempts to update the uri mappings in the given context using the + * given attribute/value pair. + * + * @param attribute the attribute, which must start with xmlns. + * @param value the value of the attribute + */ +void rdfa_update_uri_mappings( + rdfacontext* context, const char* attr, const char* value) +{ +#ifdef LIBRDFA_IN_RAPTOR + raptor_namespace_stack* nstack; + nstack = &context->sax2->namespaces; +#endif + + /* * the [current element] is parsed for [URI mappings] and these + * are added to the [list of URI mappings]. Note that a [URI + * mapping] will simply overwrite any current mapping in the list + * that has the same name; */ + + /* Mappings are provided by @xmlns. The value to be mapped is set + * by the XML namespace prefix, and the value to map is the value + * of the attribute -- a URI. Note that the URI is not processed + * in any way; in particular if it is a relative path it is not + * resolved against the [current base]. Authors are advised to + * follow best practice for using namespaces, which includes not + * using relative paths. */ + + if(attr == NULL) + { +#ifdef LIBRDFA_IN_RAPTOR + raptor_namespaces_start_namespace_full(nstack, + NULL, + (const unsigned char*)value, + 0); +#else + rdfa_update_mapping( + context->uri_mappings, XMLNS_DEFAULT_MAPPING, value, + (update_mapping_value_fp)rdfa_replace_string); +#endif + } + else if(strcmp(attr, "_") == 0) + { +#define FORMAT_1 "The underscore character must not be declared as a prefix " \ + "because it conflicts with the prefix for blank node identifiers. " \ + "The occurrence of this prefix declaration is being ignored." +#ifdef LIBRDFA_IN_RAPTOR + raptor_parser_warning((raptor_parser*)context->callback_data, + FORMAT_1); +#else + rdfa_processor_triples(context, + RDFA_PROCESSOR_WARNING, + FORMAT_1); +#endif + } + else if(attr[0] == ':' || attr[0] == '_' || + (attr[0] >= 'A' && attr[0] <= 'Z') || + (attr[0] >= 'a' && attr[0] <= 'z') || + ((unsigned char)attr[0] >= 0xc0 && (unsigned char)attr[0] <= 0xd6) || + ((unsigned char)attr[0] >= 0xd8 && (unsigned char)attr[0] <= 0xf6) || (unsigned char)attr[0] >= 0xf8) + { +#ifdef LIBRDFA_IN_RAPTOR + raptor_namespaces_start_namespace_full(nstack, + (const unsigned char*)attr, + (const unsigned char*)value, + 0); +#else + rdfa_generate_namespace_triple(context, attr, value); + rdfa_update_mapping(context->uri_mappings, attr, value, + (update_mapping_value_fp)rdfa_replace_string); +#endif + } + else + { + /* allowable characters for CURIEs: + * ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | + * [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | + * [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] + * | [#x10000-#xEFFFF] + */ + + /* Generate the processor warning if this is an invalid prefix */ +#define FORMAT_2 "The declaration of the '%s' prefix is invalid " \ + "because it starts with an invalid character. Please see " \ + "http://www.w3.org/TR/REC-xml/#NT-NameStartChar for a " \ + "full explanation of valid first characters for declaring " \ + "prefixes." +#ifdef LIBRDFA_IN_RAPTOR + raptor_parser_warning((raptor_parser*)context->callback_data, + FORMAT_2, attr); +#else + char msg[1024]; + snprintf(msg, 1024, FORMAT_1); + rdfa_processor_triples(context, RDFA_PROCESSOR_WARNING, msg); +#endif + } + +#ifdef LIBRDFA_IN_RAPTOR +#else + /* print the current mapping */ + if(DEBUG) + { + printf("DEBUG: PREFIX MAPPINGS:"); + rdfa_print_mapping(context->uri_mappings, + (print_mapping_value_fp)rdfa_print_string); + } +#endif +} diff --git a/librdfa/rdfa.c b/librdfa/rdfa.c new file mode 100644 index 0000000..6dadbe0 --- /dev/null +++ b/librdfa/rdfa.c @@ -0,0 +1,1552 @@ +/** + * Copyright 2008-2011 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * The librdfa library is the Fastest RDFa Parser in the Universe. It is + * a stream parser, meaning that it takes an XML data as input and spits + * out RDF triples as it comes across them in the stream. Due to this + * processing approach, librdfa has a very, very small memory footprint. + * It is also very fast and can operate on hundreds of gigabytes of XML + * data without breaking a sweat. + * + * Usage: + * + * rdfacontext* context = rdfa_create_context(BASE_URI); + * context->callback_data = your_user_data; + * rdfa_set_default_graph_triple_handler(context, &default_graph_triple); + * rdfa_set_processor_graph_triple_handler(context, &processor_graph_triple); + * rdfa_set_buffer_filler(context, &fill_buffer); + * rdfa_parse(context); + * rdfa_free_context(context); + * + * @author Manu Sporny + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#ifdef HAVE_STRINGS_H +# include +#endif +#include +#include +#include "rdfa_utils.h" +#include "rdfa.h" +#include "strtok_r.h" + +#define READ_BUFFER_SIZE 4096 +#define RDFA_DOCTYPE_STRING_LENGTH 103 + +/** + * Read the head of the XHTML document and determines the base IRI for + * the document. + * + * @param context the current working context. + * @param working_buffer the current working buffer. + * @param wb_allocated the number of bytes that have been allocated to + * the working buffer. + * + * @return the size of the data available in the working buffer. + */ +static size_t rdfa_init_base( + rdfacontext* context, char** working_buffer, size_t* working_buffer_size, + char* temp_buffer, size_t bytes_read) +{ + char* head_end = NULL; + size_t offset = context->wb_position; + size_t needed_size = 0; + + if((offset + bytes_read) > *working_buffer_size) + { + needed_size = (offset + bytes_read) - *working_buffer_size; + } + + /* search for the end of , stop if was found */ + + /* extend the working buffer size */ + if(needed_size > 0) + { + size_t temp_buffer_size = sizeof(char) * READ_BUFFER_SIZE; + if((size_t)needed_size > temp_buffer_size) + temp_buffer_size += needed_size; + + *working_buffer_size += temp_buffer_size; + /* +1 for NUL at end, to allow strstr() etc. to work */ + *working_buffer = (char*)realloc(*working_buffer, *working_buffer_size + 1); + } + + /* append to the working buffer */ + memmove(*working_buffer + offset, temp_buffer, bytes_read); + /* ensure the buffer is a NUL-terminated string */ + *(*working_buffer + offset + bytes_read) = '\0'; + + /* Sniff the beginning of the document for any document information */ + if(strstr(*working_buffer, "-//W3C//DTD XHTML+RDFa 1.0//EN") != NULL) + { + context->host_language = HOST_LANGUAGE_XHTML1; + context->rdfa_version = RDFA_VERSION_1_0; + } + else if(strstr(*working_buffer, "-//W3C//DTD XHTML+RDFa 1.1//EN") != NULL) + { + context->host_language = HOST_LANGUAGE_XHTML1; + context->rdfa_version = RDFA_VERSION_1_1; + } + else if(strstr(*working_buffer, "host_language = HOST_LANGUAGE_HTML; + context->rdfa_version = RDFA_VERSION_1_1; + } + else + { + context->host_language = HOST_LANGUAGE_XML1; + context->rdfa_version = RDFA_VERSION_1_1; + } + +#ifdef LIBRDFA_IN_RAPTOR + if(context->raptor_rdfa_version == 10) { + context->host_language = HOST_LANGUAGE_XHTML1; + context->rdfa_version = RDFA_VERSION_1_0; + } else if(context->raptor_rdfa_version == 11) + context->rdfa_version = RDFA_VERSION_1_1; +#endif + + /* search for the end of in */ + head_end = strstr(*working_buffer, ""); + if(head_end == NULL) + head_end = strstr(*working_buffer, ""); + + context->wb_position += bytes_read; + + if(head_end == NULL) + return bytes_read; + + /* if was found, search for xml_literal == NULL) + { + context->xml_literal = rdfa_replace_string(context->xml_literal, "<"); + context->xml_literal_size = 1; + } + else + { + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, "<", 1); + } + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, + name, strlen(name)); + + if(!context->xml_literal_namespaces_defined) + { + /* append namespaces to XML Literal */ +#ifdef LIBRDFA_IN_RAPTOR + raptor_namespace_stack* nstack = &context->sax2->namespaces; + raptor_namespace* ns; + raptor_namespace** ns_list = NULL; + size_t ns_size; +#else + void** umap = context->uri_mappings; +#endif + const char* umap_key = NULL; + void* umap_value = NULL; + + /* if the namespaces are not defined, then neither is the xml:lang */ + context->xml_literal_xml_lang_defined = 0; + +#ifdef LIBRDFA_IN_RAPTOR + ns_size = 0; + ns_list = raptor_namespace_stack_to_array(nstack, &ns_size); + qsort((void*)ns_list, ns_size, sizeof(raptor_namespace*), + raptor_nspace_compare); + + while(ns_size > 0) +#else + while(*umap != NULL) +#endif + { + unsigned char insert_xmlns_definition = 1; + const char* attr = NULL; + + /* get the next mapping to process */ +#ifdef LIBRDFA_IN_RAPTOR + ns=ns_list[--ns_size]; + + umap_key = (const char*)raptor_namespace_get_prefix(ns); + if(!umap_key) + umap_key=(const char*)XMLNS_DEFAULT_MAPPING; + umap_value = (char*)raptor_uri_as_string(raptor_namespace_get_uri(ns)); +#else + rdfa_next_mapping(umap++, &umap_key, &umap_value); + umap++; +#endif + + /* check to make sure that the namespace isn't already + * defined in the current element. */ + if(attributes != NULL) + { + const char** attrs = attributes; + while((*attrs != NULL) && insert_xmlns_definition) + { + attr = *attrs++; + + /* if the attribute is a umap_key, skip the definition + * of the attribute. */ + if(strcmp(attr, umap_key) == 0) + { + insert_xmlns_definition = 0; + } + } + } + + /* if the namespace isn't already defined on the element, + * copy it to the XML Literal string. */ + if(insert_xmlns_definition) + { + /* append the namespace attribute to the XML Literal */ + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, + " xmlns", strlen(" xmlns")); + + /* check to see if we're dumping the standard XHTML namespace or + * a user-defined XML namespace */ + if(strcmp(umap_key, XMLNS_DEFAULT_MAPPING) != 0) + { + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, ":", 1); + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, + umap_key, strlen(umap_key)); + } + + /* append the namespace value */ + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, "=\"", 2); + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, + (const char*)umap_value, strlen((char*)umap_value)); + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, "\"", 1); + } + + } /* end while umap not NULL */ + context->xml_literal_namespaces_defined = 1; + +#ifdef LIBRDFA_IN_RAPTOR + if(ns_list) + raptor_free_memory(ns_list); +#endif + } /* end if namespaces inserted */ + +#ifdef LIBRDFA_IN_RAPTOR + /* Raptor namespace code does this already */ +#else + /* 3. For backward compatibility, RDFa Processors should also permit the + * definition of mappings via @xmlns. In this case, the value to be mapped + * is set by the XML namespace prefix, and the value to map is the value of + * the attribute - an IRI. (Note that prefix mapping via @xmlns is + * deprecated, and may be removed in a future version of this + * specification.) When xmlns is supported, such mappings must be processed + * before processing any mappings from @prefix on the same element. */ + if(namespaces != NULL) + { + int ni; + + for(ni = 0; ni < nb_namespaces * 2; ni += 2) + { + const char* ns = namespaces[ni]; + const char* value = namespaces[ni + 1]; + /* Regardless of how the mapping is declared, the value to be mapped + * must be converted to lower case, and the IRI is not processed in + * any way; in particular if it is a relative path it must not be + * resolved against the current base. */ + char* lcns = NULL; + if(ns != NULL) + { + /* convert the namespace string to lowercase */ + unsigned int i; + size_t ns_length = strlen(ns); + lcns = (char*)malloc(ns_length + 1); + for(i = 0; i <= ns_length; i++) + { + lcns[i] = tolower(ns[i]); + } + } + + /* update the URI mappings */ + rdfa_update_uri_mappings(context, lcns, value); + + if(lcns != NULL) + { + free(lcns); + } + } + } +#endif + + /* detect the RDFa version of the document, if specified */ + if(attributes != NULL) + { + int ci; + + /* search for a version attribute */ + for(ci = 0; ci < nb_attributes * 5; ci += 5) + { + const char* attr; + char* value; + size_t value_length = 0; + + attr = attributes[ci]; + value_length = attributes[ci + 4] - attributes[ci + 3] + 1; + + if(strcmp(attr, "version") == 0) + { + /* append the attribute-value pair to the XML literal */ + value = (char*)malloc(value_length + 1); + snprintf(value, value_length, "%s", attributes[ci + 3]); + if(strstr(value, "RDFa 1.0") != NULL) + { + context->rdfa_version = RDFA_VERSION_1_0; + } + else if(strstr(value, "RDFa 1.1") != NULL) + { + context->rdfa_version = RDFA_VERSION_1_1; + } + + free(value); + } + } + } + +#ifdef LIBRDFA_IN_RAPTOR + if(context->sax2) + { + /* Raptor handles xml:lang itself but not 'lang' */ + xml_lang = (char*)raptor_sax2_inscope_xml_language(context->sax2); + xml_lang = rdfa_replace_string(NULL, xml_lang); + } +#endif + + /* prepare all of the RDFa-specific attributes we are looking for. + * scan all of the attributes for the RDFa-specific attributes */ + if(attributes != NULL) + { + int ci; + + if(context->rdfa_version == RDFA_VERSION_1_1) + { + /* process all vocab and prefix attributes */ + for(ci = 0; ci < nb_attributes * 5; ci += 5) + { + const char* attr; + char* value; + size_t value_length = 0; + + attr = attributes[ci]; + value_length = attributes[ci + 4] - attributes[ci + 3] + 1; + + /* append the attribute-value pair to the XML literal */ + value = (char*)malloc(value_length + 1); + snprintf(value, value_length, "%s", attributes[ci + 3]); + + /* 2. Next the current element is examined for any change to the + * default vocabulary via @vocab. */ + if(strcmp(attr, "vocab") == 0) + { + if(strlen(value) < 1) + { + /* If the value is empty, then the local default vocabulary + * must be reset to the Host Language defined default + * (if any). */ + free(context->default_vocabulary); + context->default_vocabulary = NULL; + } + else + { + char* resolved_uri; + rdftriple* triple; + + /* If @vocab is present and contains a value, the local + * default vocabulary is updated according to the + * section on CURIE and IRI Processing. */ + resolved_uri = rdfa_resolve_uri(context, value); + context->default_vocabulary = rdfa_replace_string( + context->default_vocabulary, resolved_uri); + + /* The value of @vocab is used to generate a triple */ + triple = rdfa_create_triple( + context->base, "http://www.w3.org/ns/rdfa#usesVocabulary", + resolved_uri, RDF_TYPE_IRI, NULL, NULL); + context->default_graph_triple_callback( + triple, context->callback_data); + + free(resolved_uri); + } + } + else if(strcmp(attr, "prefix") == 0) + { + /* Mappings are defined via @prefix. */ + char* working_string = NULL; + char* atprefix = NULL; + char* iri = NULL; + char* saveptr = NULL; + + working_string = rdfa_replace_string(working_string, value); + + /* Values in this attribute are evaluated from beginning to + * end (e.g., left to right in typical documents). */ + atprefix = strtok_r(working_string, ":", &saveptr); + while(atprefix != NULL) + { + /* find the prefix and IRI mappings while skipping whitespace */ + while((*saveptr == ' ' || *saveptr == '\n' || + *saveptr == '\r' || *saveptr == '\t' || *saveptr == '\f' || + *saveptr == '\v') && *saveptr != '\0') + { + saveptr++; + } + iri = strtok_r(NULL, RDFA_WHITESPACE, &saveptr); + + /* update the prefix mappings */ + rdfa_update_uri_mappings(context, atprefix, iri); + + if(!saveptr) + break; + + while((*saveptr == ' ' || *saveptr == '\n' || + *saveptr == '\r' || *saveptr == '\t' || *saveptr == '\f' || + *saveptr == '\v') && *saveptr != '\0') + { + saveptr++; + } + + /* get the next prefix to process */ + atprefix = strtok_r(NULL, ":", &saveptr); + } + + free(working_string); + } + else if(strcmp(attr, "inlist") == 0) + { + context->inlist_present = 1; + } + free(value); + } + } + + /* resolve all of the other RDFa values */ + for(ci = 0; ci < nb_attributes * 5; ci += 5) + { + const char* attr; + char* value; + char* attrns; + char* literal_text; + size_t value_length = 0; + size_t literal_text_length; + + attr = attributes[ci]; + attrns = (char*)attributes[ci + 1]; + value_length = attributes[ci + 4] - attributes[ci + 3] + 1; + + /* append the attribute-value pair to the XML literal */ + value = (char*)malloc(value_length + 1); + snprintf(value, value_length, "%s", attributes[ci + 3]); + + literal_text_length = strlen(attr) + value_length + 4; + literal_text = (char*)malloc(literal_text_length + 1); + snprintf(literal_text, literal_text_length, " %s=\"%s\"", attr, value); + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, + literal_text, strlen(literal_text)); + free(literal_text); + + /* if xml:lang is defined, ensure that it is not overwritten */ + if(attrns != NULL && strcmp(attrns, "xml") == 0 && + strcmp(attr, "lang") == 0) + { + context->xml_literal_xml_lang_defined = 1; + } + + /* process all of the RDFa attributes */ + if(strcmp(attr, "about") == 0) + { + about_curie = value; + about = rdfa_resolve_curie( + context, about_curie, CURIE_PARSE_ABOUT_RESOURCE); + } + else if(strcmp(attr, "src") == 0) + { + src_curie = value; + src = rdfa_resolve_curie(context, src_curie, CURIE_PARSE_HREF_SRC); + } + else if(strcmp(attr, "typeof") == 0) + { + type_of_curie = value; + type_of = rdfa_resolve_curie_list( + context, type_of_curie, + CURIE_PARSE_INSTANCEOF_DATATYPE); + } + else if(strcmp(attr, "rel") == 0) + { + context->rel_present = 1; + rel_curie = value; + rel = rdfa_resolve_curie_list( + context, rel_curie, CURIE_PARSE_RELREV); + } + else if(strcmp(attr, "rev") == 0) + { + context->rev_present = 1; + rev_curie = value; + rev = rdfa_resolve_curie_list( + context, rev_curie, CURIE_PARSE_RELREV); + } + else if(strcmp(attr, "property") == 0) + { + property_curie = value; + property = + rdfa_resolve_curie_list( + context, property_curie, CURIE_PARSE_PROPERTY); + } + else if(strcmp(attr, "resource") == 0) + { + resource_curie = value; + resource = rdfa_resolve_curie( + context, resource_curie, CURIE_PARSE_ABOUT_RESOURCE); + } + else if(strcmp(attr, "href") == 0) + { + href_curie = value; + href = + rdfa_resolve_curie(context, href_curie, CURIE_PARSE_HREF_SRC); + } + else if(strcmp(attr, "content") == 0) + { + content = rdfa_replace_string(content, value); + } + else if(strcmp(attr, "datatype") == 0) + { + datatype_curie = value; + + if(strlen(datatype_curie) == 0) + { + datatype = rdfa_replace_string(datatype, ""); + } + else + { + datatype = rdfa_resolve_curie(context, datatype_curie, + CURIE_PARSE_INSTANCEOF_DATATYPE); + } + } + else if((attrns == NULL && strcmp(attr, "lang") == 0) || + (attrns != NULL && strcmp(attrns, "xml") == 0 && + strcmp(attr, "lang") == 0)) + { + xml_lang = rdfa_replace_string(xml_lang, value); + } + + free(value); + } + } + + /* The root element has an implicit @about declaration */ + if(context->depth == 1 && about == NULL && resource == NULL && + href == NULL && src == NULL) + { + about_curie = ""; + about = rdfa_resolve_curie( + context, about_curie, CURIE_PARSE_ABOUT_RESOURCE); + } + + /* The HEAD and BODY element in XHTML and HTML has an implicit + * about="" on it. + */ + if(about == NULL && resource == NULL && href == NULL && src == NULL && + (context->parent_subject == NULL || type_of != NULL) && + ((context->host_language == HOST_LANGUAGE_XHTML1 || + context->host_language == HOST_LANGUAGE_HTML) && + (strcasecmp(name, "head") == 0 || strcasecmp(name, "body") == 0))) + { + about_curie = ""; + about = rdfa_resolve_curie( + context, about_curie, CURIE_PARSE_ABOUT_RESOURCE); + } + + /* check to see if we should append an xml:lang to the XML Literal + * if one is defined in the context and does not exist on the + * element. */ + if((xml_lang == NULL) && (context->language != NULL) && + !context->xml_literal_xml_lang_defined) + { + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, + " xml:lang=\"", strlen(" xml:lang=\"")); + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, + context->language, strlen(context->language)); + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, "\"", 1); + + /* ensure that the lang isn't set in a subtree (unless it's overwritten) */ + context->xml_literal_xml_lang_defined = 1; + } + + /* close the XML Literal value */ + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, ">", 1); + + /* 3. The [current element] is also parsed for any language + * information, and [language] is set in the [current + * evaluation context]; */ + rdfa_update_language(context, xml_lang); + + /***************** FOR DEBUGGING PURPOSES ONLY ******************/ +#if defined(DEBUG) && DEBUG > 0 + printf("DEBUG: depth = %u\n", context->depth); + if(about != NULL) + { + printf("DEBUG: @about = %s\n", about); + } + if(src != NULL) + { + printf("DEBUG: @src = %s\n", src); + } + if(type_of != NULL) + { + printf("DEBUG: @type_of = "); + rdfa_print_list(type_of); + } + if(context->inlist_present) + { + printf("DEBUG: @inlist = true\n"); + } + if(rel != NULL) + { + printf("DEBUG: @rel = "); + rdfa_print_list(rel); + } + if(rev != NULL) + { + printf("DEBUG: @rev = "); + rdfa_print_list(rev); + } + if(property != NULL) + { + printf("DEBUG: @property = "); + rdfa_print_list(property); + } + if(resource != NULL) + { + printf("DEBUG: @resource = %s\n", resource); + } + if(href != NULL) + { + printf("DEBUG: @href = %s\n", href); + } + if(content != NULL) + { + printf("DEBUG: @content = %s\n", content); + } + if(datatype != NULL) + { + printf("DEBUG: @datatype = %s\n", datatype); + } + if(xml_lang != NULL) + { + printf("DEBUG: @xml:lang = %s\n", xml_lang); + } +#endif + + /* TODO: This isn't part of the processing model, it needs to be + * included and is a correction for the last item in step #4. */ + if((about == NULL) && (src == NULL) && (type_of == NULL) && + (rel == NULL) && (rev == NULL) && (property == NULL) && + (resource == NULL) && (href == NULL) && + (context->default_vocabulary == NULL) && (prefix == NULL)) + { + context->skip_element = 1; + } + + if((rel == NULL) && (rev == NULL)) + { + if(context->rdfa_version == RDFA_VERSION_1_0) + { + /* 4. If the [current element] contains no valid @rel or @rev + * URI, obtained according to the section on CURIE and URI + * Processing, then the next step is to establish a value for + * [new subject]. Any of the attributes that can carry a + * resource can set [new subject]; */ + rdfa_establish_new_1_0_subject( + context, name, about, src, resource, href, type_of); + } + else + { + rdfa_establish_new_1_1_subject( + context, name, about, src, resource, href, type_of, property, + content, datatype); + } + } + else + { + if(context->rdfa_version == RDFA_VERSION_1_0) + { + /* 5. If the [current element] does contain a valid @rel or @rev + * URI, obtained according to the section on CURIE and URI + * Processing, then the next step is to establish both a value + * for [new subject] and a value for [current object resource]: */ + rdfa_establish_new_1_0_subject_with_relrev( + context, name, about, src, resource, href, type_of); + } + else + { + rdfa_establish_new_1_1_subject_with_relrev( + context, name, about, src, resource, href, type_of); + } + } + + if(context->new_subject != NULL) + { +#if defined(DEBUG) && DEBUG > 0 + printf("DEBUG: new_subject = %s\n", context->new_subject); +#endif + + /* RDFa 1.0: 6. If in any of the previous steps a [new subject] was set + * to a non-null value, it is now used to provide a subject for + * type values; */ + /* RDFa 1.1: 7. If in any of the previous steps a typed resource was set + * to a non-null value, it is now used to provide a subject for type + * values; + */ + if(type_of != NULL) + { + rdfa_complete_type_triples(context, type_of); + } + + /* Note that none of this block is executed if there is no + * [new subject] value, i.e., [new subject] remains null. */ + } + + if(context->current_object_resource != NULL) + { + /* If the element contains both the @inlist and the @rel attributes: + * the @rel may contain one or more resources, obtained according to + * the section on CURIE and IRI Processing each of which is used to + * add an entry to the list mapping as follows: + * if the local list mapping does not contain a list associated with + * the IRI, instantiate a new list and add to local list mappings + * add the current object resource to the list associated with the + * resource in the local list mapping */ + if(context->rdfa_version == RDFA_VERSION_1_1 && (rel != NULL) && + context->inlist_present) + { + rdfresource_t object_type = RDF_TYPE_IRI; + if((property != NULL) || (content != NULL)) + { + object_type = RDF_TYPE_PLAIN_LITERAL; + if(datatype != NULL) + { + object_type = RDF_TYPE_TYPED_LITERAL; + } + } + rdfa_establish_new_inlist_triples( + context, rel, context->current_object_resource, object_type); + } + + /* 7. If in any of the previous steps a [current object resource] + * was set to a non-null value, it is now used to generate triples */ + rdfa_complete_relrev_triples(context, rel, rev); + } + + if((context->current_object_resource == NULL) && + context->rdfa_version == RDFA_VERSION_1_1 && (rel != NULL) && + context->inlist_present) + { + rdfa_save_incomplete_list_triples(context, rel); + } + else if((context->current_object_resource == NULL) && + ((rel != NULL) || (rev != NULL))) + { + /* 8. If however [current object resource] was set to null, but + * there are predicates present, then they must be stored as + * [incomplete triple]s, pending the discovery of a subject that + * can be used as the object. Also, [current object resource] + * should be set to a newly created [bnode] */ + rdfa_save_incomplete_triples(context, rel, rev); + } + + /* Ensure to re-insert XML Literal namespace information from this + * point on... */ + if(property != NULL) + { + context->xml_literal_namespaces_defined = 0; + } + + /* save these for processing steps #9 and #10 */ + context->about = rdfa_replace_string(context->about, about); + context->resource = rdfa_replace_string(context->resource, resource); + context->href = rdfa_replace_string(context->href, href); + context->src = rdfa_replace_string(context->src, src); + context->content = rdfa_replace_string(context->content, content); + context->datatype = rdfa_replace_string(context->datatype, datatype); + context->property = property; + + /* free the resolved CURIEs */ + free(about); + free(src); + rdfa_free_list(type_of); + rdfa_free_list(rel); + rdfa_free_list(rev); + free(xml_lang); + free(content); + free(resource); + free(href); + free(datatype); +} + +static void character_data( + void *parser_context, const xmlChar *s, int len) +{ + /*xmlParserCtxtPtr parser = (xmlParserCtxtPtr)parser_context;*/ + rdfalist* context_stack = + (rdfalist*)((rdfacontext*)parser_context)->context_stack; + rdfacontext* context = (rdfacontext*) + context_stack->items[context_stack->num_items - 1]->data; + + char *buffer = (char*)malloc(len + 1); + memset(buffer, 0, len + 1); + memcpy(buffer, s, len); + + /* append the text to the current context's plain literal */ + if(context->plain_literal == NULL) + { + context->plain_literal = + rdfa_replace_string(context->plain_literal, buffer); + context->plain_literal_size = len; + } + else + { + context->plain_literal = rdfa_n_append_string( + context->plain_literal, + &context->plain_literal_size, buffer, len); + } + + /* append the text to the current context's XML literal */ + if(context->xml_literal == NULL) + { + context->xml_literal = + rdfa_replace_string(context->xml_literal, buffer); + context->xml_literal_size = len; + } + else + { + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, buffer, len); + } + + /*printf("plain_literal: %s\n", context->plain_literal);*/ + /*printf("xml_literal: %s\n", context->xml_literal);*/ + + free(buffer); +} + +static void end_element(void* parser_context, const char* name, + const char* prefix,const xmlChar* URI) +{ + /*xmlParserCtxtPtr parser = (xmlParserCtxtPtr)parser_context;*/ + rdfalist* context_stack = + (rdfalist*)((rdfacontext*)parser_context)->context_stack; + rdfacontext* context = (rdfacontext*)rdfa_pop_item(context_stack); + rdfacontext* parent_context = (rdfacontext*) + context_stack->items[context_stack->num_items - 1]->data; + + /* append the text to the current context's XML literal */ + size_t name_len = strlen(name); + char* buffer = (char*)malloc(name_len + 3 + 1); + +#if defined(DEBUG) && DEBUG > 0 + printf("DEBUG: \n", name); + printf("context->local_list_mappings (start of end_element): "); + rdfa_print_mapping(context->local_list_mappings, + (print_mapping_value_fp)rdfa_print_triple_list); +#endif + + buffer[0] = '<'; + buffer[1] = '/'; + memcpy(buffer + 2, name, name_len); + buffer[name_len + 2] = '>'; + buffer[name_len + 3] = '\0'; + if(context->xml_literal == NULL) + { + context->xml_literal = + rdfa_replace_string(context->xml_literal, buffer); + context->xml_literal_size = strlen(buffer); + } + else + { + context->xml_literal = rdfa_n_append_string( + context->xml_literal, &context->xml_literal_size, + buffer, strlen(buffer)); + } + free(buffer); + + /* 9. The next step of the iteration is to establish any + * [current object literal]; */ + + /* generate the complete object literal triples */ + if(context->property != NULL) + { + /* save the current xml literal */ + char* saved_xml_literal = context->xml_literal; + char* content_start = NULL; + char* content_end = NULL; + + /* ensure to mark only the inner-content of the XML node for + * processing the object literal. */ + buffer = NULL; + + if(context->xml_literal != NULL) + { + /* get the data between the first tag and the last tag */ + content_start = strchr(context->xml_literal, '>'); + content_end = strrchr(context->xml_literal, '<'); + + if((content_start != NULL) && (content_end != NULL)) + { + /* set content end to null terminator */ + context->xml_literal = ++content_start; + *content_end = '\0'; + } + } + + /* update the plain literal if the XML Literal is an empty string */ + if(context->xml_literal != NULL && strlen(context->xml_literal) == 0) + { + context->plain_literal = + rdfa_replace_string(context->plain_literal, ""); + } + + /* process data between first tag and last tag + * this needs the xml literal to be null terminated */ + if(context->rdfa_version == RDFA_VERSION_1_0) + { + rdfa_complete_object_literal_triples(context); + } + else + { + rdfa_complete_current_property_value_triples(context); + } + + if(content_end != NULL) + { + /* set content end back */ + *content_end = '<'; + } + + if(saved_xml_literal != NULL) + { + /* restore xml literal */ + context->xml_literal = saved_xml_literal; + } + } + + /*printf(context->plain_literal);*/ + + if(parent_context != NULL) { + /* append the XML literal and plain text literals to the parent + * literals */ + if(context->xml_literal != NULL) + { + if(parent_context->xml_literal == NULL) + { + parent_context->xml_literal = + rdfa_replace_string( + parent_context->xml_literal, context->xml_literal); + parent_context->xml_literal_size = context->xml_literal_size; + } + else + { + parent_context->xml_literal = + rdfa_n_append_string( + parent_context->xml_literal, + &parent_context->xml_literal_size, + context->xml_literal, context->xml_literal_size); + } + + /* if there is an XML literal, there is probably a plain literal */ + if(context->plain_literal != NULL) + { + if(parent_context->plain_literal == NULL) + { + parent_context->plain_literal = + rdfa_replace_string( + parent_context->plain_literal, context->plain_literal); + parent_context->plain_literal_size = + context->plain_literal_size; + } + else + { + parent_context->plain_literal = + rdfa_n_append_string( + parent_context->plain_literal, + &parent_context->plain_literal_size, + context->plain_literal, + context->plain_literal_size); + } + } + } + + /* preserve the bnode count by copying it to the parent_context */ + parent_context->bnode_count = context->bnode_count; + parent_context->underscore_colon_bnode_name = \ + rdfa_replace_string(parent_context->underscore_colon_bnode_name, + context->underscore_colon_bnode_name); + } + + /* 10. If the [ skip element ] flag is 'false', and [ new subject ] + * was set to a non-null value, then any [ incomplete triple ]s + * within the current context should be completed: */ + if((context->skip_element == 0) && (context->new_subject != NULL)) + { + rdfa_complete_incomplete_triples(context); + } + + /* 14. Once all the child elements have been traversed, list triples are + * generated, if necessary. */ + if(context->rdfa_version == RDFA_VERSION_1_1 && (context->new_subject != NULL)) + { + rdfa_complete_list_triples(context); + + if(parent_context != NULL) + { + /* copy the current mapping to the parent mapping */ + rdfa_free_mapping(parent_context->local_list_mappings, + (free_mapping_value_fp)rdfa_free_list); + parent_context->local_list_mappings = rdfa_copy_mapping( + (void**)context->local_list_mappings, + (copy_mapping_value_fp)rdfa_replace_list); + +#if defined(DEBUG) && DEBUG > 0 + printf("parent_context->local_list_mappings (after copy): "); + rdfa_print_mapping(context->local_list_mappings, + (print_mapping_value_fp)rdfa_print_triple_list); +#endif + rdfa_free_mapping(context->local_list_mappings, + (free_mapping_value_fp)rdfa_free_list); + context->local_list_mappings = NULL; + } + } + + /* free the context */ + rdfa_free_context(context); + +#if defined(DEBUG) && DEBUG > 0 + printf("-------------------------------------------------------------\n"); +#endif +} + +void rdfa_set_default_graph_triple_handler( + rdfacontext* context, triple_handler_fp th) +{ + context->default_graph_triple_callback = th; +} + +void rdfa_set_processor_graph_triple_handler( + rdfacontext* context, triple_handler_fp th) +{ + context->processor_graph_triple_callback = th; +} + +void rdfa_set_buffer_filler(rdfacontext* context, buffer_filler_fp bf) +{ + context->buffer_filler_callback = bf; +} + +#ifdef LIBRDFA_IN_RAPTOR +/* Raptor reports its errors a different way */ +#else +static void rdfa_report_error(void* parser_context, char* msg, ...) +{ + char error[1024]; + char* eptr; + va_list args; + rdfacontext* context = (rdfacontext*)parser_context; + + /* format the error message */ + va_start(args, msg); + vsprintf(error, msg, args); + va_end(args); + + /* Remove any newlines from the libxml2 error */ + eptr = error; + while(*eptr != '\0') + { + if(*eptr == '\n') + { + *eptr = '.'; + } + eptr++; + } + + /* Generate the processor error */ + rdfa_processor_triples(context, RDFA_PROCESSOR_ERROR, error); +} +#endif + +#ifdef LIBRDFA_IN_RAPTOR + +static void raptor_rdfa_start_element(void *user_data, + raptor_xml_element *xml_element) +{ + raptor_qname* qname = raptor_xml_element_get_name(xml_element); + int nb_attributes = raptor_xml_element_get_attributes_count(xml_element); + raptor_qname** attrs = raptor_xml_element_get_attributes(xml_element); + unsigned char* localname = raptor_qname_to_counted_name(qname, NULL); + const raptor_namespace* qname_ns = raptor_qname_get_namespace(qname); + int nb_namespaces = 0; + const char** namespaces = NULL; + int nb_defaulted = 0; + char** attr = NULL; + int i; + const char* ns_name = NULL; + const char* ns_uri = NULL; + + if(nb_attributes > 0) { + /* Everything written into 'attr' is a shared pointer into + * xml_element or contained objects - qnames, namespaces, uris + * and values + */ + attr = (char**)malloc(sizeof(char*) * (1 + (nb_attributes * 5))); + for(i = 0; i < nb_attributes; i++) { + const raptor_namespace* attr_ns = attrs[i]->nspace; + char** attri = &attr[5 * i]; + /* 5 tuple: (localname, prefix, URI, value, end) */ + attri[0] = (char*)attrs[i]->local_name; + attri[1] = attr_ns ? (char*)attr_ns->prefix : NULL; + attri[2] = attr_ns ? (char*)raptor_uri_as_string(attr_ns->uri) : NULL; + attri[3] = (char*)attrs[i]->value; + attri[4] = attri[3] + attrs[i]->value_length; + } + attr[5 * i] = NULL; + } + +/* + * @ctx: the user data (XML parser context) + * @localname: the local name of the element + * @prefix: the element namespace prefix if available + * @URI: the element namespace name if available + * @nb_namespaces: number of namespace definitions on that node + * @namespaces: pointer to the array of prefix/URI pairs namespace definitions + * @nb_attributes: the number of attributes on that node + * @nb_defaulted: the number of defaulted attributes. The defaulted + * ones are at the end of the array + * @attributes: pointer to the array of (localname/prefix/URI/value/end) + * attribute values. + */ + if(qname_ns) { + ns_name = (const char*)raptor_namespace_get_prefix(qname_ns); + ns_uri = (const char*)raptor_uri_as_string(qname_ns->uri); + } + + start_element(user_data, (const char*)localname, + ns_name, + ns_uri, + nb_namespaces, + (const char**)namespaces, + nb_attributes, + nb_defaulted, + (const char**)attr); + if(attr) + free(attr); + raptor_free_memory(localname); +} + +static void raptor_rdfa_end_element(void *user_data, + raptor_xml_element* xml_element) +{ + raptor_qname* qname = raptor_xml_element_get_name(xml_element); + unsigned char* localname = raptor_qname_to_counted_name(qname, NULL); + const raptor_namespace* qname_ns = raptor_qname_get_namespace(qname); + + if(qname_ns) + end_element(user_data, (const char*)localname, + (const char*)qname_ns->prefix, + (const xmlChar*)raptor_uri_as_string(qname_ns->uri)); + else + end_element(user_data, (const char*)localname, NULL, NULL); + + raptor_free_memory(localname); +} + +static void raptor_rdfa_character_data(void *user_data, + raptor_xml_element* xml_element, + const unsigned char *s, int len) +{ + character_data(user_data, (const xmlChar *)s, len); +} + +static void raptor_rdfa_namespace_handler(void *user_data, + raptor_namespace* nspace) +{ + rdfacontext* context = (rdfacontext*)user_data; + + if(context->namespace_handler) + (*context->namespace_handler)(context->namespace_handler_user_data, + nspace); +} + +#endif + +int rdfa_parse_start(rdfacontext* context) +{ + /* create the buffers and expat parser */ + int rval = RDFA_PARSE_SUCCESS; + + context->wb_allocated = sizeof(char) * READ_BUFFER_SIZE; + /* +1 for NUL at end, to allow strstr() etc. to work + * malloc - only the first char needs to be NUL */ + context->working_buffer = (char*)malloc(context->wb_allocated + 1); + *context->working_buffer = '\0'; + context->done = 0; + context->context_stack = rdfa_create_list(32); + + /* initialize the context stack */ + rdfa_push_item(context->context_stack, context, RDFALIST_FLAG_CONTEXT); + +#ifdef LIBRDFA_IN_RAPTOR + context->sax2 = raptor_new_sax2(context->world, context->locator, + context); +#else + /* init libxml2 */ + xmlInitParser(); +#endif + + /* set up the context stack */ +#ifdef LIBRDFA_IN_RAPTOR + raptor_sax2_set_start_element_handler(context->sax2, + raptor_rdfa_start_element); + raptor_sax2_set_end_element_handler(context->sax2, + raptor_rdfa_end_element); + raptor_sax2_set_characters_handler(context->sax2, + raptor_rdfa_character_data); + raptor_sax2_set_namespace_handler(context->sax2, + raptor_rdfa_namespace_handler); +#endif + + rdfa_init_context(context); + +#ifdef LIBRDFA_IN_RAPTOR + context->base_uri = raptor_new_uri(context->sax2->world, + (const unsigned char*)context->base); + raptor_sax2_parse_start(context->sax2, context->base_uri); +#endif + + return rval; +} + +int rdfa_parse_chunk(rdfacontext* context, char* data, size_t wblen, int done) +{ +#ifdef LIBRDFA_IN_RAPTOR +#else + xmlSAXHandler handler; + xmlParserCtxtPtr parser; +#endif + + /* it is an error to call this before rdfa_parse_start() */ + if(context->done) + { + return RDFA_PARSE_FAILED; + } + + if(!context->preread) + { + /* search for the tag and use the href contained therein to + * set the parsing context. */ + context->wb_preread = rdfa_init_base(context, + &context->working_buffer, &context->wb_allocated, data, wblen); + + /* continue looking if in first 131072 bytes of data */ + if(!context->base && context->wb_preread < (1<<17)) + return RDFA_PARSE_SUCCESS; + +#ifdef LIBRDFA_IN_RAPTOR + /* term mappings are needed before SAX2 parsing */ + rdfa_setup_initial_context(context); + + if(raptor_sax2_parse_chunk(context->sax2, + (const unsigned char*)context->working_buffer, + context->wb_position, done)) + { + return RDFA_PARSE_FAILED; + } +#else + /* create the SAX2 handler structure */ + memset(&handler, 0, sizeof(xmlSAXHandler)); + handler.initialized = XML_SAX2_MAGIC; + handler.startElementNs = (startElementNsSAX2Func)start_element; + handler.endElementNs = (endElementNsSAX2Func)end_element; + handler.characters = (charactersSAXFunc)character_data; + handler.error = (errorSAXFunc)rdfa_report_error; + + /* create a push-based parser */ + parser = xmlCreatePushParserCtxt( + &handler, context, (const char*)context->working_buffer, + context->wb_position, NULL); + + /* ensure that entity substitution is turned on by default */ + xmlSubstituteEntitiesDefault(1); + + context->parser = parser; + + rdfa_setup_initial_context(context); +#endif + + context->preread = 1; + + return RDFA_PARSE_SUCCESS; + } + + /* otherwise just parse the block passed in */ +#ifdef LIBRDFA_IN_RAPTOR + if(raptor_sax2_parse_chunk(context->sax2, + (const unsigned char*)data, wblen, done)) + { + return RDFA_PARSE_FAILED; + } +#else + if(xmlParseChunk(context->parser, data, wblen, done)) + { + return RDFA_PARSE_FAILED; + } +#endif + + return RDFA_PARSE_SUCCESS; +} + +void rdfa_parse_end(rdfacontext* context) +{ + /* free context stack */ + rdfa_free_context_stack(context); + + /* Free the expat parser and the like */ +#ifdef LIBRDFA_IN_RAPTOR + if(context->base_uri) + raptor_free_uri(context->base_uri); + raptor_free_sax2(context->sax2); + context->sax2=NULL; +#else + /* free parser */ + xmlFreeParserCtxt(context->parser); + xmlCleanupParser(); +#endif +} + +char* rdfa_get_buffer(rdfacontext* context, size_t* blen) +{ + *blen = context->wb_allocated; + return context->working_buffer; +} + +int rdfa_parse_buffer(rdfacontext* context, size_t bytes) +{ + int rval; + int done; + done = (bytes == 0); + rval = rdfa_parse_chunk(context, context->working_buffer, bytes, done); + context->done = done; + return rval; +} + +int rdfa_parse(rdfacontext* context) +{ + int rval; + + rval = rdfa_parse_start(context); + if(rval != RDFA_PARSE_SUCCESS) + { + context->done = 1; + return rval; + } + + do + { + size_t wblen; + int done; + + wblen = context->buffer_filler_callback( + context->working_buffer, context->wb_allocated, + context->callback_data); + done = (wblen == 0); + + rval = rdfa_parse_chunk(context, context->working_buffer, wblen, done); + context->done=done; + } + while(!context->done && rval == RDFA_PARSE_SUCCESS); + + rdfa_parse_end(context); + + return rval; +} diff --git a/librdfa/rdfa.h b/librdfa/rdfa.h new file mode 100644 index 0000000..7c9cfb2 --- /dev/null +++ b/librdfa/rdfa.h @@ -0,0 +1,377 @@ +/** + * Copyright 2008-2010 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * You should have received a copy of the GNU Lesser General Public + * License along with librdfa. If not, see . + * + * The librdfa library is the Fastest RDFa Parser in the Universe. It is + * a stream parser, meaning that it takes an XML data as input and spits + * out RDF triples as it comes across them in the stream. Due to this + * processing approach, librdfa has a very, very small memory footprint. + * It is also very fast and can operate on hundreds of gigabytes of XML + * data without breaking a sweat. + * + * Usage: + * + * rdfacontext* context = rdfa_create_context(base_uri); + * context->callback_data = your_user_data; + * rdfa_set_triple_handler(context, triple_function); + * rdfa_set_buffer_filler(context, buffer_filler_function); + * rdfa_parse(context); + * rdfa_free_context(context); + * + * If you would like to get warnings/error triples from the processor graph: + * + * rdfa_set_issue_handler(context, triple_function); + * + * Usage if you need more control over when to fill rdfa's buffer: + * + * rdfacontext* context = rdfa_create_context(base_uri); + * context->callback_data = your_user_data; + * rdfa_set_triple_handler(context, triple_function); + * int rval = rdfa_parse_start(context); + * if(rval == RDFA_PARSE_SUCCESS) + * { + * FILE* myfile = fopen("myfilename"); + * size_t buf_len = 0; + * size_t read = 0; + * do + * { + * char* buf = rdfa_get_buffer(context, &buf_len); + * if(buf_len > 0) + * { + * // fill buffer here up to buf_len bytes from your input stream + * read = fread(buf, sizeof(char), buf_len, myfile); + * } + * + * // parse the read data + * rdfa_parse_buffer(context, read); + * } + * while(read > 0); + * fclose(myfile); + * + * rdfa_parse_end(context); + * } + * rdfa_free_context(context); + * + */ +#ifndef _LIBRDFA_RDFA_H_ +#define _LIBRDFA_RDFA_H_ +#include +#include + +/* Activate the stupid Windows DLL exporting mechanism if we're building for Windows */ +#ifdef WIN32 +#define DLLEXPORT __declspec(dllexport) +#else +#define DLLEXPORT +#endif + +#ifdef LIBRDFA_IN_RAPTOR +#include "raptor2.h" +#include "raptor_internal.h" +#endif /* LIBRDFA_IN_RAPTOR */ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define DEBUG 0 + +/* RDFa version numbers */ +#define RDFA_VERSION_1_0 1 +#define RDFA_VERSION_1_1 2 + +/* parse process return types */ +#define RDFA_PARSE_WARNING -2 +#define RDFA_PARSE_FAILED -1 +#define RDFA_PARSE_UNKNOWN 0 +#define RDFA_PARSE_SUCCESS 1 + +/* maximum list lengths */ +#define MAX_LOCAL_LIST_MAPPINGS 32 +#define MAX_LIST_MAPPINGS 48 +#define MAX_LIST_ITEMS 16 +#define MAX_TERM_MAPPINGS 64 +#define MAX_URI_MAPPINGS 128 +#define MAX_INCOMPLETE_TRIPLES 128 + +/* host language definitions */ +#define HOST_LANGUAGE_NONE 0 +#define HOST_LANGUAGE_XML1 1 +#define HOST_LANGUAGE_XHTML1 2 +#define HOST_LANGUAGE_HTML 3 + +/* default mapping key for xmlns */ +#define XMLNS_DEFAULT_MAPPING "XMLNS_DEFAULT" + +/* whitespace characters for RDFa Core 1.1 */ +#define RDFA_WHITESPACE " \t\n\v\f\r" + +/** + * An RDF resource type is used to denote the content of a triple's + * object value. + */ +typedef enum +{ + RDF_TYPE_NAMESPACE_PREFIX, + RDF_TYPE_IRI, + RDF_TYPE_PLAIN_LITERAL, + RDF_TYPE_XML_LITERAL, + RDF_TYPE_TYPED_LITERAL, + RDF_TYPE_UNKNOWN +} rdfresource_t; + +/** + * An RDF triple is the result of an RDFa statement that contains, at + * the very least, a subject, a predicate and an object. It is the + * smallest, complete statement one can make in RDF. + */ +typedef struct rdftriple +{ + char* subject; + char* predicate; + char* object; + rdfresource_t object_type; + char* datatype; + char* language; +} rdftriple; + +/** + * The specification for a callback that is capable of handling + * triples. Produces a triple that must be freed once the application + * is done with the object. + */ +typedef void (*triple_handler_fp)(rdftriple*, void*); + +/** + * The specification for a callback that is used to fill the input buffer + * with data to parse. + */ +typedef size_t (*buffer_filler_fp)(char*, size_t, void*); + +/** + * An RDFA list item is used to hold each datum in an rdfa list. It + * contains a list of flags as well as the data for the list member. + */ +typedef struct rdfalistitem +{ + unsigned char flags; + void* data; +} rdfalistitem; + +/** + * An RDFa list is used to store multiple text strings that have a set + * of attributes associated with them. These can be lists of CURIEs, + * or lists of incomplete triples. The structure grows with use, but + * cannot be shrunk. + */ +typedef struct rdfalist +{ + rdfalistitem** items; + size_t num_items; + size_t max_items; + unsigned int user_data; +} rdfalist; + +/** + * The RDFa Parser structure is responsible for keeping track of the state of + * the current RDFa parser. Things such as the default namespace, + * CURIE mappings, and other context-specific + */ +typedef struct rdfacontext +{ + unsigned char rdfa_version; + char* base; + char* parent_subject; + char* parent_object; + char* default_vocabulary; +#ifndef LIBRDFA_IN_RAPTOR + void** uri_mappings; +#endif + void** term_mappings; + void** list_mappings; + void** local_list_mappings; + rdfalist* incomplete_triples; + rdfalist* local_incomplete_triples; + char* language; + unsigned char host_language; + + triple_handler_fp default_graph_triple_callback; + buffer_filler_fp buffer_filler_callback; + triple_handler_fp processor_graph_triple_callback; + + unsigned char recurse; + unsigned char skip_element; + char* new_subject; + char* current_object_resource; + + char* about; + char* typed_resource; + char* resource; + char* href; + char* src; + char* content; + char* datatype; + rdfalist* property; + unsigned char inlist_present; + unsigned char rel_present; + unsigned char rev_present; + char* plain_literal; + size_t plain_literal_size; + char* xml_literal; + size_t xml_literal_size; + + void* callback_data; + + /* parse state */ + size_t bnode_count; + char* underscore_colon_bnode_name; + unsigned char xml_literal_namespaces_defined; + unsigned char xml_literal_xml_lang_defined; + size_t wb_allocated; + char* working_buffer; + size_t wb_position; +#ifdef LIBRDFA_IN_RAPTOR + raptor_world *world; + raptor_locator *locator; + /* a pointer (in every context) to the error_handlers structure + * held in the raptor_parser object */ + raptor_uri* base_uri; + raptor_sax2* sax2; + raptor_namespace_handler namespace_handler; + void* namespace_handler_user_data; + int raptor_rdfa_version; /* 10 or 11 or otherwise default */ +#else + xmlParserCtxtPtr parser; +#endif + int done; + rdfalist* context_stack; + size_t wb_preread; + int preread; + int depth; +} rdfacontext; + +/** + * Creates an initial context for RDFa. + * + * @param base The base URI that should be used for the parser. + * + * @return a pointer to the base RDFa context, or NULL if memory + * allocation failed. + */ +DLLEXPORT rdfacontext* rdfa_create_context(const char* base); + +/** + * Sets the default graph triple handler for the application. + * + * @param context the base rdfa context for the application. + * @param th the triple handler function. + */ +DLLEXPORT void rdfa_set_default_graph_triple_handler( + rdfacontext* context, triple_handler_fp th); + +/** + * Sets the processor graph triple handler for the application. + * + * @param context the base rdfa context for the application. + * @param th the triple handler function. + */ +DLLEXPORT void rdfa_set_processor_graph_triple_handler( + rdfacontext* context, triple_handler_fp th); + +/** + * Sets the buffer filler for the application. + * + * @param context the base rdfa context for the application. + * @param bf the buffer filler function. + */ +DLLEXPORT void rdfa_set_buffer_filler( + rdfacontext* context, buffer_filler_fp bf); + +/** + * Starts processing given the base rdfa context. + * + * @param context the base rdfa context. + * + * @return RDFA_PARSE_SUCCESS if everything went well. RDFA_PARSE_FAILED + * if there was a fatal error and RDFA_PARSE_WARNING if there + * was a non-fatal error. + */ +DLLEXPORT int rdfa_parse(rdfacontext* context); + +DLLEXPORT int rdfa_parse_start(rdfacontext* context); + +DLLEXPORT int rdfa_parse_chunk( + rdfacontext* context, char* data, size_t wblen, int done); + +/** + * Gets the input buffer for the given context so it can be filled with data. + * A pointer to the buffer will be returned and the maximum number of bytes + * that can be written to that buffer will be set to the blen parameter. Once + * data has been written to the buffer, rdfa_parse_buffer() should be called. + * + * @param context the base rdfa context. + * @param blen the variable to set to the buffer length. + * + * @return a pointer to the context's input buffer. + */ +DLLEXPORT char* rdfa_get_buffer(rdfacontext* context, size_t* blen); + +/** + * Informs the parser to attempt to parse more of the given context's input + * buffer. To fill the input buffer with data, call rdfa_get_buffer(). + * + * If any of the input buffer can be parsed, it will be. It is possible + * that none of the data will be parsed, in which case this function will + * still return RDFA_PARSE_SUCCESS. More data should be written to the input + * buffer using rdfa_get_buffer() as it is made available to the application. + * Once there is no more data to write, rdfa_parse_end() should be called. + * + * @param context the base rdfa context. + * @param bytes the number of bytes written to the input buffer via the last + * call to rdfa_get_buffer(), a value of 0 will indicate that there + * is no more data to parse. + * + * @return RDFA_PARSE_SUCCESS if everything went well. RDFA_PARSE_FAILED + * if there was a fatal error and RDFA_PARSE_WARNING if there + * was a non-fatal error. + */ +DLLEXPORT int rdfa_parse_buffer(rdfacontext* context, size_t bytes); + +DLLEXPORT void rdfa_parse_end(rdfacontext* context); + +DLLEXPORT void rdfa_init_context(rdfacontext* context); + +DLLEXPORT char* rdfa_iri_get_base(const char* iri); + +/** + * Destroys the given rdfa context by freeing all memory associated + * with the context. + * + * @param context the rdfa context. + */ +DLLEXPORT void rdfa_free_context(rdfacontext* context); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/librdfa/rdfa_utils.c b/librdfa/rdfa_utils.c new file mode 100644 index 0000000..a2e65f2 --- /dev/null +++ b/librdfa/rdfa_utils.c @@ -0,0 +1,543 @@ +/* + * Copyright 2008-2011 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * You should have received a copy of the GNU Lesser General Public + * License along with librdfa. If not, see . + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include "rdfa_utils.h" +#include "rdfa.h" +#include "strtok_r.h" + +#define RDFA_WHITESPACE_CHARACTERS " \a\b\t\n\v\f\r" + +char* rdfa_join_string(const char* prefix, const char* suffix) +{ + char* rval = NULL; + size_t prefix_size = strlen(prefix); + size_t suffix_size = strlen(suffix); + rval = (char*)malloc(prefix_size + suffix_size + 1); + + memcpy(rval, prefix, prefix_size); + memcpy(rval+prefix_size, suffix, suffix_size + 1); + + return rval; +} + +char* rdfa_n_append_string( + char* old_string, size_t* string_size, + const char* suffix, size_t suffix_size) +{ + char* rval = NULL; + rval = (char*)realloc(old_string, *string_size + suffix_size + 1); + memcpy(rval + *string_size, suffix, suffix_size + 1); + *string_size = *string_size + suffix_size; + return rval; +} + +char* rdfa_replace_string(char* old_string, const char* new_string) +{ + char* rval = NULL; + + if(new_string != NULL) + { + /* free the memory associated with the old string */ + free(old_string); + + /* copy the new string */ + rval = rdfa_strdup(new_string); + } + + return rval; +} + +char* rdfa_canonicalize_string(const char* str) +{ + char* rval = (char*)malloc(sizeof(char) * (strlen(str) + 2)); + char* working_string = NULL; + char* token = NULL; + char* wptr = NULL; + char* offset = rval; + + working_string = rdfa_replace_string(working_string, str); + + /* split on any whitespace character that we may find */ + token = strtok_r(working_string, RDFA_WHITESPACE_CHARACTERS, &wptr); + while(token != NULL) + { + size_t token_length = strlen(token); + memcpy(offset, token, token_length); + offset += token_length; + *offset++ = ' '; + *offset = '\0'; + + token = strtok_r(NULL, RDFA_WHITESPACE_CHARACTERS, &wptr); + } + + if(offset != rval) + { + offset--; + *offset = '\0'; + } + + free(working_string); + + return rval; +} + +rdfalist* rdfa_create_list(size_t size) +{ + rdfalist* rval = (rdfalist*)malloc(sizeof(rdfalist)); + + rval->max_items = size; + rval->num_items = 0; + rval->items = (rdfalistitem**)malloc( + sizeof(rdfalistitem*) * rval->max_items); + + return rval; +} + +rdfalist* rdfa_replace_list(rdfalist* old_list, rdfalist* new_list) +{ + rdfalist* rval = NULL; + + if(new_list != NULL) + { + /* free the memory associated with the old list */ + rdfa_free_list(old_list); + + /* copy the new list */ + rval = rdfa_copy_list(new_list); + } + + return rval; +} + +rdfalist* rdfa_copy_list(rdfalist* list) +{ + rdfalist* rval = NULL; + + if(list != NULL) + { + unsigned int i; + rval = rdfa_create_list(list->max_items); + + /* copy the base list variables over */ + rval->num_items = list->num_items; + rval->user_data = list->user_data; + + /* copy the data of every list member along with all of the flags + * for each list member. */ + for(i = 0; i < list->max_items; i++) + { + if(i < list->num_items) + { + rval->items[i] = (rdfalistitem*)malloc(sizeof(rdfalistitem)); + rval->items[i]->data = NULL; + rval->items[i]->flags = list->items[i]->flags; + + /* copy specific data type */ + if(list->items[i]->flags & RDFALIST_FLAG_TEXT) + { + rval->items[i]->data = rdfa_strdup((char*)list->items[i]->data); + } + else if(list->items[i]->flags & RDFALIST_FLAG_TRIPLE) + { + rdftriple* t = (rdftriple*)list->items[i]->data; + rval->items[i]->data = + rdfa_create_triple(t->subject, t->predicate, t->object, + t->object_type, t->datatype, t->language); + } + else if(list->items[i]->flags & RDFALIST_FLAG_CONTEXT) + { + /* TODO: Implement the copy for context, if it is needed. */ + } + } + else + { + rval->items[i] = NULL; + } + } + } + + return rval; +} + +void rdfa_print_list(rdfalist* list) +{ + unsigned int i; + + printf("[ "); + + for(i = 0; i < list->num_items; i++) + { + if(i != 0) + { + printf(", "); + } + + puts((const char*)list->items[i]->data); + } + + printf(" ]\n"); +} + +void rdfa_print_triple_list(rdfalist* list) +{ + unsigned int i; + + if(list != NULL) + { + printf("[ "); + + for(i = 0; i < list->num_items; i++) + { + if(i != 0) + { + printf(", "); + } + + rdfa_print_triple((rdftriple*)list->items[i]->data); + } + + printf(" ]\n"); + } + else + { + printf("NULL\n"); + } +} + +void rdfa_free_list(rdfalist* list) +{ + if(list != NULL) + { + unsigned int i; + for(i = 0; i < list->num_items; i++) + { + if(list->items[i]->flags & RDFALIST_FLAG_TEXT) + { + free(list->items[i]->data); + } + else if(list->items[i]->flags & RDFALIST_FLAG_TRIPLE) + { + rdftriple* t = (rdftriple*)list->items[i]->data; + rdfa_free_triple(t); + } + + free(list->items[i]); + } + + free(list->items); + free(list); + } +} + +void rdfa_push_item(rdfalist* stack, void* data, liflag_t flags) +{ + rdfa_add_item(stack, data, flags); +} + +void* rdfa_pop_item(rdfalist* stack) +{ + void* rval = NULL; + + if(stack->num_items > 0) + { + --stack->num_items; + rval = stack->items[stack->num_items]->data; + free(stack->items[stack->num_items]); + stack->items[stack->num_items] = NULL; + } + + return rval; +} + +void rdfa_add_item(rdfalist* list, void* data, liflag_t flags) +{ + rdfalistitem* item; + + if(!list) + return; + + item = (rdfalistitem*)malloc(sizeof(rdfalistitem)); + + item->data = NULL; + + if((flags & RDFALIST_FLAG_CONTEXT) || (flags & RDFALIST_FLAG_TRIPLE)) + { + item->data = data; + } + else + { + item->data = (char*)rdfa_replace_string( + (char*)item->data, (const char*)data); + } + + item->flags = flags; + + if(list->num_items == list->max_items) + { + list->max_items = 1 + (list->max_items * 2); + list->items = (rdfalistitem**)realloc( + list->items, sizeof(rdfalistitem*) * list->max_items); + } + + list->items[list->num_items] = item; + ++list->num_items; +} + +void** rdfa_create_mapping(size_t elements) +{ + size_t mapping_size = sizeof(void*) * MAX_URI_MAPPINGS * 2; + void** mapping = (void**)malloc(mapping_size); + + /* only initialize the mapping if it is not null. */ + if(mapping != NULL) + { + memset(mapping, 0, mapping_size); + } + + return mapping; +} + +void rdfa_create_list_mapping( + rdfacontext* context, void** mapping, + const char* subject, const char* key) +{ + char* realkey = NULL; + size_t str_size; + rdfalist* value = NULL; + char* list_bnode; + rdftriple* triple; + + /* Attempt to find the list mapping */ + value = (rdfalist*)rdfa_get_list_mapping(mapping, subject, key); + + if(value == NULL) + { + /* create the mapping */ + value = rdfa_create_list(MAX_LIST_ITEMS); + value->user_data = context->depth; + + /* build the real key to use when updating the mapping */ + str_size = strlen(subject); + realkey = rdfa_strdup(subject); + realkey = rdfa_n_append_string(realkey, &str_size, " ", 1); + realkey = rdfa_n_append_string(realkey, &str_size, key, strlen(key)); + rdfa_update_mapping(mapping, realkey, value, + (update_mapping_value_fp)rdfa_replace_list); + free(realkey); + rdfa_free_list(value); + + /* add the first item in the list as the bnode for the list */ + list_bnode = rdfa_create_bnode(context); + triple = rdfa_create_triple( + list_bnode, list_bnode, list_bnode, RDF_TYPE_IRI, NULL, NULL); + rdfa_append_to_list_mapping(mapping, subject, key, (void*)triple); + free(list_bnode); + } +} + +void rdfa_append_to_list_mapping( + void** mapping, const char* subject, const char* key, void* value) +{ + rdfalist* list = (rdfalist*)rdfa_get_list_mapping(mapping, subject, key); + rdfa_add_item(list, value, RDFALIST_FLAG_TRIPLE); +} + +void** rdfa_copy_mapping( + void** mapping, copy_mapping_value_fp copy_mapping_value) +{ + void** rval = (void**)calloc(MAX_URI_MAPPINGS * 2, sizeof(void*)); + void** mptr = mapping; + void** rptr = rval; + + /* copy each element of the old mapping to the new mapping. */ + while(*mptr != NULL) + { + /* copy the key */ + *rptr = rdfa_replace_string((char*)*rptr, (const char*)*mptr); + rptr++; + mptr++; + + /* copy the value */ + *rptr = copy_mapping_value(*rptr, *mptr); + rptr++; + mptr++; + } + + return rval; +} + +void rdfa_update_mapping(void** mapping, const char* key, const void* value, + update_mapping_value_fp update_mapping_value) +{ + int found = 0; + void** mptr = mapping; + + /* search the current mapping to see if the key exists in the mapping */ + while(!found && (*mptr != NULL)) + { + if(strcmp((char*)*mptr, key) == 0) + { + mptr++; + *mptr = update_mapping_value(*mptr, value); + found = 1; + } + else + { + mptr++; + } + mptr++; + } + + /* if we made it through the entire URI mapping and the key was not + * found, create a new key-value pair. */ + if(!found) + { + *mptr = rdfa_replace_string((char*)*mptr, key); + mptr++; + *mptr = update_mapping_value(*mptr, value); + } +} + +const void* rdfa_get_mapping(void** mapping, const char* key) +{ + const void* rval = NULL; + char** mptr = (char**)mapping; + + /* search the current mapping to see if the key exists in the mapping. */ + while(*mptr != NULL) + { + if(strcmp(*mptr, key) == 0) + { + mptr++; + rval = *mptr; + } + else + { + mptr++; + } + mptr++; + } + + return rval; +} + +const void* rdfa_get_list_mapping( + void** mapping, const char* subject, const char* key) +{ + void* rval; + char* realkey = NULL; + size_t str_size = strlen(subject); + + /* generate the real list mapping key and retrieve it from the mapping */ + realkey = rdfa_strdup(subject); + realkey = rdfa_n_append_string(realkey, &str_size, " ", 1); + realkey = rdfa_n_append_string(realkey, &str_size, key, strlen(key)); + rval = (void*)rdfa_get_mapping(mapping, realkey); + free(realkey); + + return (const void*)rval; +} + +void rdfa_next_mapping(void** mapping, char** key, void** value) +{ + *key = NULL; + *value = NULL; + + if(*mapping != NULL) + { + *key = *(char**)mapping++; + *value = *mapping++; + } +} + +void rdfa_print_mapping(void** mapping, print_mapping_value_fp print_value) +{ + void** mptr = mapping; + printf("{\n"); + while(*mptr != NULL) + { + char* key; + void* value; + key = (char*)*mptr++; + value = *mptr++; + + printf(" %s : ", key); + print_value(value); + + if(*mptr != NULL) + { + printf(",\n"); + } + else + { + printf("\n"); + } + } + printf("}\n"); +} + +void rdfa_print_string(const char* str) +{ + printf("%s", str); +} + +void rdfa_free_mapping(void** mapping, free_mapping_value_fp free_value) +{ + void** mptr = mapping; + + if(mapping != NULL) + { + /* free all of the memory in the mapping */ + while(*mptr != NULL) + { + free(*mptr); + mptr++; + free_value(*mptr); + mptr++; + } + + free(mapping); + } +} + +char* +rdfa_strdup(const char* s) +{ + size_t len; + char *buf; + + if(!s) + return NULL; + + len = strlen(s) + 1; + buf = (char*)malloc(len); + if(buf) + memcpy(buf, s, len); + return buf; +} diff --git a/librdfa/rdfa_utils.h b/librdfa/rdfa_utils.h new file mode 100644 index 0000000..a21ddfe --- /dev/null +++ b/librdfa/rdfa_utils.h @@ -0,0 +1,486 @@ +/** + * Copyright 2008 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * You should have received a copy of the GNU Lesser General Public + * License along with librdfa. If not, see . + * + * This file contains functions used for common rdfa utility functions. + */ +#ifndef _RDFA_UTILS_H_ +#define _RDFA_UTILS_H_ +#include "rdfa.h" + +#ifdef __cplusplus +extern "C" +{ +#endif + +/** + * A CURIE type can be safe, unsafe, and Internationalized Resource + * Identifier, reference-only or invalid. + */ +typedef enum +{ + CURIE_TYPE_SAFE, + CURIE_TYPE_IRI_OR_UNSAFE, + CURIE_TYPE_LINK_TYPE, + CURIE_TYPE_INVALID +} curie_t; + +/** + * A CURIE parse type lets the CURIE processor know what type of CURIE + * is being parsed so that the proper namespace resolution may occur. + */ +typedef enum +{ + CURIE_PARSE_ABOUT_RESOURCE, + CURIE_PARSE_PROPERTY, + CURIE_PARSE_INSTANCEOF_DATATYPE, + CURIE_PARSE_HREF_SRC, + CURIE_PARSE_RELREV +} curieparse_t; + +/** + * The list member flag type is used to attach attribute information + * to list member data. + */ +typedef enum +{ + RDFALIST_FLAG_NONE = 0, + RDFALIST_FLAG_DIR_NONE = (1 << 1), + RDFALIST_FLAG_DIR_FORWARD = (1 << 2), + RDFALIST_FLAG_DIR_REVERSE = (1 << 3), + RDFALIST_FLAG_TEXT = (1 << 4), + RDFALIST_FLAG_CONTEXT = (1 << 5), + RDFALIST_FLAG_TRIPLE = (1 << 6), + RDFALIST_FLAG_LAST = (1 << 7) +} liflag_t; + +/* + * RDFa processor graph reporting types + */ +#define RDFA_PROCESSOR_INFO "http://www.w3.org/ns/rdfa#Info" +#define RDFA_PROCESSOR_WARNING "http://www.w3.org/ns/rdfa#Warning" +#define RDFA_PROCESSOR_ERROR "http://www.w3.org/ns/rdfa#Error" + +/* key establishing a deleted mapping entry */ +#define RDFA_MAPPING_DELETED_KEY "" + +/** + * A function pointer that will be used to copy mapping values. + */ +typedef void* (*copy_mapping_value_fp)(void*, void*); + +/** + * A function pointer that will be used to update mapping values. + */ +typedef void* (*update_mapping_value_fp)(const void*, const void*); + +/** + * A function pointer that will be used to print mapping values. + */ +typedef void (*print_mapping_value_fp)(void*); + +/** + * A function pointer that will be used to free memory associated with values. + */ +typedef void (*free_mapping_value_fp)(void*); + +/** + * Initializes a mapping given the number of elements the mapping is + * expected to hold. + * + * @param elements the maximum number of elements the mapping is + * supposed to hold. + * + * @return an initialized void**, with all of the elements set to NULL. + */ +void** rdfa_create_mapping(size_t elements); + +/** + * Adds a list to a mapping given a key to create. The result will be a + * zero-item list associated with the given key in the mapping. + * + * @param context the current active context. + * @param mapping the mapping to modify. + * @param subject the current active subject. + * @param key the key to add to the mapping. + * @param user_data the user-defined data to store with the list information. + */ +void rdfa_create_list_mapping( + rdfacontext* context, void** mapping, const char* subject, const char* key); + +/** + * Adds an item to the end of the list that is associated with the given + * key in the mapping. + * + * @param mapping the mapping to modify. + * @param subject the current active subject. + * @param key the key to use when looking up the list value. + * @param value the value to append to the end of the list. + */ +void rdfa_append_to_list_mapping( + void** mapping, const char* subject, const char* key, void* value); + +/** + * Gets the value for a given list mapping when presented with a subject + * and a key. If the subject-key combo doesn't exist in the mapping, + * NULL is returned. + * + * @param mapping the mapping to search. + * @param subject the current active subject. + * @param key the key. + * + * @return value the value in the mapping for the given key. + */ +const void* rdfa_get_list_mapping( + void** mapping, const char* subject, const char* key); + +/** + * Copies the entire contents of a mapping verbatim and returns a + * pointer to the copied mapping. + * + * @param mapping the mapping to copy + * + * @return the copied mapping, with all of the memory newly + * allocated. You MUST free the returned mapping when you are + * done with it. + */ +void** rdfa_copy_mapping( + void** mapping, copy_mapping_value_fp copy_mapping_value); + +/** + * Updates the given mapping when presented with a key and a value. If + * the key doesn't exist in the mapping, it is created. + * + * @param mapping the mapping to update. + * @param key the key. + * @param value the value. + * @param replace_mapping_value a pointer to a function that will replace the + * old + */ +void rdfa_update_mapping(void** mapping, const char* key, const void* value, + update_mapping_value_fp update_mapping_value); + +/** + * Gets the value for a given mapping when presented with a key. If + * the key doesn't exist in the mapping, NULL is returned. + * + * @param mapping the mapping to search. + * @param key the key. + * + * @return value the value in the mapping for the given key. + */ +const void* rdfa_get_mapping(void** mapping, const char* key); + +/** + * Gets the current mapping for the given mapping and increments the + * mapping to the next value in the chain. + * + * @param mapping the mapping to use and increment. + * @param key the key that will be retrieved, NULL if the mapping is + * blank or you are at the end of the mapping. + * @param value the value that is associated with the key. NULL if the + * mapping is blank or you are at the end of the mapping. + */ +void rdfa_next_mapping(void** mapping, char** key, void** value); + +/** + * Prints the mapping to the screen in a human-readable way. + * + * @param mapping the mapping to print to the screen. + * @param print_value the function pointer to use to print the mapping values. + */ +void rdfa_print_mapping(void** mapping, print_mapping_value_fp print_value); + +/** + * Frees all memory associated with a mapping. + * + * @param mapping the mapping to free. + * @param free_value the function to free mapping values. + */ +void rdfa_free_mapping(void** mapping, free_mapping_value_fp free_value); + +/** + * Creates a list and initializes it to the given size. + * + * @param size the starting size of the list. + */ +rdfalist* rdfa_create_list(size_t size); + +/** + * Copies the given list. + * + * @param list the list to copy. + * + * @return the copied list. You MUST free the memory associated with + * the returned list once you are done with it. + */ +rdfalist* rdfa_copy_list(rdfalist* list); + +/** + * Replaced the old_list by free'ing the memory associated with it. A + * copy is made of the new list and then returned. + * + * @param old_list the list to replace. The memory associated with this list + * is freed. + * @param new_list the new list to copy in replacement of the old list. A + * deep copy is performed on the new list. + * + * @return the copied list. You MUST free the memory associated with + * the returned list once you are done with it. + */ +rdfalist* rdfa_replace_list(rdfalist* old_list, rdfalist* new_list); + +/** + * Adds an item to the end of the list. + * + * @param list the list to add the item to. + * @param data the data to add to the list. + * @param flags the flags to attach to the item. + */ +void rdfa_add_item(rdfalist* list, void* data, liflag_t flags); + +/** + * Pushes an item onto the top of a stack. This function uses a list + * for the underlying implementation. + * + * @param stack the stack to add the item to. + * @param data the data to add to the stack. + * @param flags the flags to attach to the item. + */ +void rdfa_push_item(rdfalist* stack, void* data, liflag_t flags); + +/** + * Pops an item off of the top of a stack. This function uses a list + * for the underlying implementation + * + * @param stack the stack to pop the item off of. + * + * @return the item that was just popped off of the top of the + * stack. You MUST free the memory associated with the return + * value. + */ +void* rdfa_pop_item(rdfalist* stack); + +/** + * Prints the list to the screen in a human-readable way. + * + * @param list the list to print to the screen. + */ +void rdfa_print_list(rdfalist* list); + +/** + * Frees all memory associated with the given list. + * + * @param list the list to free. + */ +void rdfa_free_list(rdfalist* list); + +/** + * Replaces an old string with a new string, freeing the old memory + * and allocating new memory for the new string. + * + * @param old_string the old string to free and replace. + * @param new_string the new string to copy to the old_string's + * location. + * + * @return a pointer to the newly allocated string. + */ +char* rdfa_replace_string(char* old_string, const char* new_string); + +/** + * Appends a new string to the old string, expanding the old string's + * memory area if needed. The old string's size must be provided and + * will be updated to the new length. + * + * @param old_string the old string to reallocate if needed. + * @param string_size the old string's length, to be updated. + * @param suffix the string to append to the old_string. + * @param suffix_size the size of the suffix string. + * + * @return a pointer to the newly re-allocated string. + */ +char* rdfa_n_append_string( + char* old_string, size_t* string_size, + const char* suffix, size_t suffix_size); + +/** + * Joins two strings together and returns a newly allocated string + * with both strings joined. + * + * @param prefix the beginning part of the string. + * @param suffix the ending part of the string. + * + * @return a pointer to the newly allocated string that has both + * prefix and suffix in it. + */ +char* rdfa_join_string(const char* prefix, const char* suffix); + +/** + * Prints a string to stdout. This function is used by the rdfa_print_mapping + * function. + * + * @param str the string to print to stdout. + */ +void rdfa_print_string(const char* str); + +/** + * Canonicalizes a given string by condensing all whitespace to single + * spaces and stripping leading and trailing whitespace. + * + * @param str the string to canonicalize. + * + * @return a pointer to a newly allocated string that contains the + * canonicalized text. + */ +char* rdfa_canonicalize_string(const char* str); + +/** + * Creates a triple given the subject, predicate, object, datatype and + * language for the triple. + * + * @param subject the subject for the triple. + * @param predicate the predicate for the triple. + * @param object the object for the triple. + * @param object_type the type of the object, which must be an rdfresource_t. + * @param datatype the datatype of the triple. + * @param language the language for the triple. + * + * @return a newly allocated triple with all of the given + * information. This triple MUST be free()'d when you are done + * with it. + */ +rdftriple* rdfa_create_triple(const char* subject, const char* predicate, + const char* object, rdfresource_t object_type, const char* datatype, + const char* language); + +/** + * Prints a triple in a human-readable fashion. + * + * @triple the triple to display. + */ +void rdfa_print_triple(rdftriple* triple); + +/** + * Prints a list of triples in a human readable form. + * + * @triple the triple to display. + */ +void rdfa_print_triple_list(rdfalist* list); + +/** + * Frees the memory associated with a triple. + */ +void rdfa_free_triple(rdftriple* triple); + +/** + * Resolves a given uri by appending it to the context's base parameter. + * + * @param context the current processing context. + * @param uri the URI part to process. + * + * @return the fully qualified IRI. The memory returned from this + * function MUST be freed. + */ +char* rdfa_resolve_uri(rdfacontext* context, const char* uri); + +/** + * Resolves a given uri depending on whether or not it is a fully + * qualified IRI or a CURIE. + * + * @param context the current processing context. + * @param uri the URI part to process. + * @param mode the CURIE processing mode to use when parsing the CURIE. + * + * @return the fully qualified IRI. The memory returned from this + * function MUST be freed. + */ +char* rdfa_resolve_curie( + rdfacontext* context, const char* uri, curieparse_t mode); + +/** + * Resolves one or more CURIEs into fully qualified IRIs. + * + * @param rdfa_context the current processing context. + * @param uris a list of URIs. + * @param mode the CURIE parsing mode to use, one of + * CURIE_PARSE_INSTANCEOF, CURIE_PARSE_RELREV, or + * CURIE_PARSE_PROPERTY. + * + * @return an RDFa list if one or more IRIs were generated, NULL if not. + */ +rdfalist* rdfa_resolve_curie_list( + rdfacontext* rdfa_context, const char* uris, curieparse_t mode); + +char* rdfa_resolve_relrev_curie(rdfacontext* context, const char* uri); + +char* rdfa_resolve_property_curie(rdfacontext* context, const char* uri); + +void rdfa_update_language(rdfacontext* context, const char* lang); + +char* rdfa_create_bnode(rdfacontext* context); + +/* All functions that rdfa.c needs. */ +void rdfa_update_uri_mappings(rdfacontext* context, const char* attr, const char* value); +void rdfa_establish_new_1_0_subject( + rdfacontext* context, const char* name, const char* about, const char* src, + const char* resource, const char* href, const rdfalist* type_of); +void rdfa_establish_new_1_1_subject( + rdfacontext* context, const char* name, const char* about, const char* src, + const char* resource, const char* href, const rdfalist* type_of, + const rdfalist* property, const char* content, const char* datatype); +void rdfa_establish_new_1_0_subject_with_relrev( + rdfacontext* context, const char* name, const char* about, const char* src, + const char* resource, const char* href, const rdfalist* type_of); +void rdfa_establish_new_1_1_subject_with_relrev( + rdfacontext* context, const char* name, const char* about, const char* src, + const char* resource, const char* href, const rdfalist* type_of); +void rdfa_complete_incomplete_triples(rdfacontext* context); +void rdfa_save_incomplete_list_triples( + rdfacontext* context, const rdfalist* rel); +void rdfa_complete_type_triples(rdfacontext* context, const rdfalist* type_of); +void rdfa_complete_relrev_triples( + rdfacontext* context, const rdfalist* rel, const rdfalist* rev); +void rdfa_save_incomplete_triples( + rdfacontext* context, const rdfalist* rel, const rdfalist* rev); +void rdfa_complete_object_literal_triples(rdfacontext* context); +void rdfa_complete_current_property_value_triples(rdfacontext* context); + +/* Declarations needed by namespace.c */ +void rdfa_generate_namespace_triple( + rdfacontext* context, const char* prefix, const char* iri); +void rdfa_processor_triples( + rdfacontext* context, const char* type, const char* msg); + +/* Declarations needed by rdfa.c */ +void rdfa_setup_initial_context(rdfacontext* context); +void rdfa_establish_new_inlist_triples( + rdfacontext* context, rdfalist* predicates, const char* object, + rdfresource_t object_type); +void rdfa_complete_list_triples(rdfacontext* context); +rdfacontext* rdfa_create_new_element_context(rdfalist* context_stack); +void rdfa_free_context_stack(rdfacontext* context); +char* rdfa_strdup(const char* s); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/librdfa/strtok_r.c b/librdfa/strtok_r.c new file mode 100644 index 0000000..f07f9fb --- /dev/null +++ b/librdfa/strtok_r.c @@ -0,0 +1,52 @@ +/* This file is in the public domain */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include "strtok_r.h" + +#ifdef NEED_RDFA_STRTOK_R + +char * +rdfa_strtok_r(char *str, const char *delim, char **saveptr) +{ + char *p; + + if (str == NULL) + str = *saveptr; + + if (str == NULL) + return NULL; + + while (*str && strchr(delim, *str)) + str++; + + if (*str == '\0') + { + *saveptr = NULL; + return NULL; + } + + p = str; + while (*p && !strchr(delim, *p)) + p++; + + if (*p == '\0') + *saveptr = NULL; + else + { + *p = '\0'; + p++; + *saveptr = p; + } + + return str; +} + +#else /* ! NEED_RDFA_STRTOK_R */ + +typedef int blah; /* "ISO C forbids an empty translation unit" */ + +#endif /* NEED_RDFA_STRTOK_R */ diff --git a/librdfa/strtok_r.h b/librdfa/strtok_r.h new file mode 100644 index 0000000..6fd31ee --- /dev/null +++ b/librdfa/strtok_r.h @@ -0,0 +1,15 @@ +/* This file is in the public domain */ + +#ifndef HAVE_STRTOK_R +# define NEED_RDFA_STRTOK_R +#endif + +#if defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400 +# define strtok_r(s,d,p) strtok_s(s,d,p) +# undef NEED_RDFA_STRTOK_R +#endif + +#ifdef NEED_RDFA_STRTOK_R +char *rdfa_strtok_r(char *str, const char *delim, char **saveptr); +# define strtok_r(s,d,p) rdfa_strtok_r(s,d,p) +#endif diff --git a/librdfa/subject.c b/librdfa/subject.c new file mode 100644 index 0000000..f082052 --- /dev/null +++ b/librdfa/subject.c @@ -0,0 +1,535 @@ +/** + * Copyright 2008 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * This file is used to process RDFa subjects. + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include "rdfa_utils.h" +#include "rdfa.h" + +/** + * Creates a new bnode given an RDFa context. + * + * @param context the RDFa context. + * + * @return a newly allocated string containing the bnode name. This + * string MUST be memory collected. + */ +char* rdfa_create_bnode(rdfacontext* context) +{ + char* rval = NULL; +#define BNODE_BUFFER_LEN 64 + char buffer[BNODE_BUFFER_LEN]; + + /* print and increment the bnode count */ + snprintf(buffer, BNODE_BUFFER_LEN, "_:bnode%i", (int)context->bnode_count++); + rval = rdfa_replace_string(rval, buffer); + + return rval; +} + +/** + * Establishes a new subject for the given context given the + * attributes on the current element. The given context's new_subject + * value is updated if a new subject is found. + * + * @param context the RDFa context. + * @param name the name of the current element that is being processed. + * @param about the full IRI for about, or NULL if there isn't one. + * @param src the full IRI for src, or NULL if there isn't one. + * @param resource the full IRI for resource, or NULL if there isn't one. + * @param href the full IRI for href, or NULL if there isn't one. + * @param type_of The list of IRIs for type_of, or NULL if there was + * no type_of specified. + */ +void rdfa_establish_new_1_0_subject( + rdfacontext* context, const char* name, const char* about, const char* src, + const char* resource, const char* href, const rdfalist* type_of) +{ + /* 4. If the [current element] contains no valid @rel or @rev + * URI, obtained according to the section on CURIE and URI + * Processing, then the next step is to establish a value for + * [new subject]. Any of the attributes that can carry a + * resource can set [new subject]; */ + + if(about != NULL) + { + /* * by using the URI from @about, if present, obtained according + * to the section on CURIE and URI Processing; */ + context->new_subject = + rdfa_replace_string(context->new_subject, about); + } + else if(src != NULL) + { + /* * otherwise, by using the URI from @src, if present, obtained + * according to the section on CURIE and URI Processing. */ + context->new_subject = + rdfa_replace_string(context->new_subject, src); + } + else if(resource != NULL) + { + /* * otherwise, by using the URI from @resource, if present, + * obtained according to the section on CURIE and URI + * Processing; */ + context->new_subject = + rdfa_replace_string(context->new_subject, resource); + } + else if(href != NULL) + { + /* * otherwise, by using the URI from @href, if present, obtained + * according to the section on CURIE and URI Processing. */ + context->new_subject = + rdfa_replace_string(context->new_subject, href); + } + else if((type_of != NULL) && (type_of->num_items > 0)) + { + /* * if @type_of is present, obtained according to the + * section on CURIE and URI Processing, then [new subject] is + * set to be a newly created [bnode]; */ + char* bnode = rdfa_create_bnode(context); + context->new_subject = rdfa_replace_string(context->new_subject, bnode); + free(bnode); + } + else if(context->parent_object != NULL) + { + /* * otherwise, if [parent object] is present, [new subject] is + * set to that and the [skip element] flag is set to 'true'; */ + context->new_subject = + rdfa_replace_string(context->new_subject, context->parent_object); + + /* TODO: The skip element flag will be set even if there is a + * @property value, which is a bug, isn't it? */ + /*context->skip_element = 1;*/ + } +} + +/** + * Establishes a new subject for the given context given the + * attributes on the current element. The given context's new_subject + * value is updated if a new subject is found. + * + * @param context the RDFa context. + * @param name the name of the current element that is being processed. + * @param about the full IRI for about, or NULL if there isn't one. + * @param src the full IRI for src, or NULL if there isn't one. + * @param resource the full IRI for resource, or NULL if there isn't one. + * @param href the full IRI for href, or NULL if there isn't one. + * @param type_of The list of IRIs for type_of, or NULL if there was + * no type_of specified. + * @param property a list of properties that were detected during processing. + */ +void rdfa_establish_new_1_1_subject( + rdfacontext* context, const char* name, const char* about, const char* src, + const char* resource, const char* href, const rdfalist* type_of, + const rdfalist* property, const char* content, const char* datatype) +{ + /* + * If the current element contains the @property attribute, but does not + * contain either the @content or @datatype attributes, then new subject + * is set to the resource obtained from the first match from the + * following rule: + */ + if(property != NULL && content == NULL && datatype == NULL) + { + /* by using the resource from @about, if present, obtained according to + * the section on CURIE and IRI Processing; + */ + if(about != NULL) + { + /* NOTE: this statement achieves this part of the processing rule + * as well because @about is set if depth == 1 in RDFa 1.1 in + * the calling function: otherwise, if the element is the root + * element of the document, then act as if there is an empty + * @about present, and process it according to the rule for + * @about, above; + */ + context->new_subject = + rdfa_replace_string(context->new_subject, about); + } + else if(context->parent_object != NULL) + { + /* otherwise, if parent object is present, new subject is set + * to the value of parent object. + */ + context->new_subject = + rdfa_replace_string(context->new_subject, context->parent_object); + } + + /* If @typeof is present then typed resource is set to the resource + * obtained from the first match from the following rules: + */ + if(type_of != NULL) + { + if(about != NULL) + { + /* by using the resource from @about, if present, obtained + * according to the section on CURIE and IRI Processing; + * + * NOTE: about is set to the document if this is the root + * element of the document, so the following rule is also applied + * in this case: + * + * otherwise, if the element is the root element of the + * document, then act as if there is an empty @about present + * and process it according to the previous rule; + */ + context->typed_resource = + rdfa_replace_string(context->typed_resource, about); + } + else + { + if(resource != NULL) + { + /* by using the resource from @resource, if present, obtained + * according to the section on CURIE and IRI Processing; + */ + context->typed_resource = + rdfa_replace_string(context->typed_resource, resource); + } + else if(href != NULL) + { + /* otherwise, by using the IRI from @href, if present, obtained + * according to the section on CURIE and IRI Processing; + */ + context->typed_resource = + rdfa_replace_string(context->typed_resource, href); + } + else if(src != NULL) + { + /* otherwise, by using the IRI from @src, if present, obtained + * according to the section on CURIE and IRI Processing; + */ + context->typed_resource = + rdfa_replace_string(context->typed_resource, src); + } + else + { + /* otherwise, the value of typed resource is set to a newly + * created bnode. + */ + char* bnode = rdfa_create_bnode(context); + context->typed_resource = rdfa_replace_string( + context->typed_resource, bnode); + free(bnode); + } + + /* The value of the current object resource is then set to the value + * of typed resource. + */ + context->current_object_resource = rdfa_replace_string( + context->current_object_resource, context->typed_resource); + } + } + } + else + { + /* otherwise: + * If the element contains an @about, @href, @src, or @resource attribute, + * new subject is set to the resource obtained as follows: + */ + if(about != NULL || href != NULL || src != NULL || resource != NULL) + { + if(about != NULL) + { + /* by using the resource from @about, if present, obtained + * according to the section on CURIE and IRI Processing; + */ + context->new_subject = + rdfa_replace_string(context->new_subject, about); + } + else if(resource != NULL) + { + /* otherwise, by using the resource from @resource, if present, + * obtained according to the section on CURIE and IRI Processing; + */ + context->new_subject = + rdfa_replace_string(context->new_subject, resource); + } + else if(href != NULL) + { + /* otherwise, by using the IRI from @href, if present, obtained + * according to the section on CURIE and IRI Processing; + */ + context->new_subject = + rdfa_replace_string(context->new_subject, href); + } + else if(src != NULL) + { + /* otherwise, by using the IRI from @src, if present, obtained + * according to the section on CURIE and IRI Processing. + */ + context->new_subject = + rdfa_replace_string(context->new_subject, src); + } + } + else + { + /* otherwise, if no resource is provided by a resource attribute, + * then the first match from the following rules will apply: + */ + + /* NOTE: this step is achieved via the parent function call as @about + * is set if the current element is the root element. + * + * if the element is the root element of the document, then act + * as if there is an empty @about present, and process it according + * to the rule for @about, above; + */ + if(type_of != NULL) + { + /* otherwise, if @typeof is present, then new subject is set + * to be a newly created bnode; + */ + char* bnode = rdfa_create_bnode(context); + context->new_subject = rdfa_replace_string(context->new_subject, + bnode); + free(bnode); + } + else if(context->parent_object != NULL) + { + /* otherwise, if parent object is present, new subject is set to + * the value of parent object. + */ + context->new_subject = rdfa_replace_string(context->new_subject, + context->parent_object); + + /* Additionally, if @property is not present then the skip + * element flag is set to 'true'. + */ + if(property == NULL) + { + context->skip_element = 1; + } + } + } + + if(type_of != NULL) + { + /* Finally, if @typeof is present, set the typed resource to the value + * of new subject. + */ + context->typed_resource = rdfa_replace_string(context->typed_resource, + context->new_subject); + } + } +} + +/** + * Establishes a new subject for the given context when @rel or @rev + * is present. The given context's new_subject and + * current_object_resource values are updated if a new subject is found. + * + * @param context the RDFa context. + * @param about the full IRI for about, or NULL if there isn't one. + * @param src the full IRI for src, or NULL if there isn't one. + * @param resource the full IRI for resource, or NULL if there isn't one. + * @param href the full IRI for href, or NULL if there isn't one. + * @param type_of the list of IRIs for type_of, or NULL if type_of + * wasn't specified on the current element. + */ +void rdfa_establish_new_1_0_subject_with_relrev( + rdfacontext* context, const char* name, const char* about, const char* src, + const char* resource, const char* href, const rdfalist* type_of) +{ + /* 5. If the [current element] does contain a valid @rel or @rev + * URI, obtained according to the section on CURIE and URI + * Processing, then the next step is to establish both a value + * for [new subject] and a value for [current object resource]: + * + * [new subject] is set to the URI obtained from the first match + * from the following rules: */ + + if(about != NULL) + { + /* * by using the URI from @about, if present, obtained + * according to the section on CURIE and URI Processing; */ + context->new_subject = + rdfa_replace_string(context->new_subject, about); + } + else if(context->rdfa_version == RDFA_VERSION_1_0 && src != NULL) + { + /* * otherwise, by using the URI from @src, if present, obtained + * according to the section on CURIE and URI Processing. */ + context->new_subject = + rdfa_replace_string(context->new_subject, src); + } + else if((type_of != NULL) && (type_of->num_items > 0)) + { + /* * if @type_of is present, obtained according to the + * section on CURIE and URI Processing, then [new subject] is + * set to be a newly created [bnode]; */ + char* bnode = rdfa_create_bnode(context); + context->new_subject = rdfa_replace_string(context->new_subject, bnode); + free(bnode); + } + else if(context->parent_object != NULL) + { + /* * otherwise, if [parent object] is present, [new subject] is + * set to that; */ + context->new_subject = + rdfa_replace_string(context->new_subject, context->parent_object); + } + + /* Then the [current object resource] is set to the URI obtained + * from the first match from the following rules: */ + if(resource != NULL) + { + /* * by using the URI from @resource, if present, obtained + * according to the section on CURIE and URI Processing; */ + context->current_object_resource = + rdfa_replace_string(context->current_object_resource, resource); + } + else if(href != NULL) + { + /* * otherwise, by using the URI from @href, if present, + * obtained according to the section on CURIE and URI Processing. */ + context->current_object_resource = + rdfa_replace_string(context->current_object_resource, href); + } + else + { + /* * otherwise, null. */ + context->current_object_resource = NULL; + } + + /* Note that final value of the [current object resource] will + * either be null, or a full URI. */ +} + +/** + * Establishes a new subject for the given context when @rel or @rev + * is present. The given context's new_subject and + * current_object_resource values are updated if a new subject is found. + * + * @param context the RDFa context. + * @param about the full IRI for about, or NULL if there isn't one. + * @param src the full IRI for src, or NULL if there isn't one. + * @param resource the full IRI for resource, or NULL if there isn't one. + * @param href the full IRI for href, or NULL if there isn't one. + * @param type_of the list of IRIs for type_of, or NULL if type_of + * wasn't specified on the current element. + */ +void rdfa_establish_new_1_1_subject_with_relrev( + rdfacontext* context, const char* name, const char* about, const char* src, + const char* resource, const char* href, const rdfalist* type_of) +{ + /* If the current element does contain a @rel or @rev attribute, then + * the next step is to establish both a value for new subject and a + * value for current object resource: + */ + + /* new subject is set to the resource obtained from the first match from + * the following rules: + */ + + if(about != NULL) + { + /* by using the resource from @about, if present, obtained according + * to the section on CURIE and IRI Processing; + * + * NOTE: This will also catch the following rule due to @about being + * set in the calling function: + * + * if the element is the root element of the document then act as if + * there is an empty @about present, and process it according to the + * rule for @about, above; + */ + context->new_subject = + rdfa_replace_string(context->new_subject, about); + } + + if(type_of != NULL) + { + /* if the @typeof attribute is present, set typed resource to + * new subject. + */ + context->typed_resource = + rdfa_replace_string(context->typed_resource, context->new_subject); + } + + /* If no resource is provided then the first match from the following rules + * will apply: + * + */ + if(context->new_subject == NULL && context->parent_object != NULL) + { + /* otherwise, if parent object is present, new subject is set to that. + */ + context->new_subject = rdfa_replace_string( + context->new_subject, context->parent_object); + } + + /* Then the current object resource is set to the resource obtained from + * the first match from the following rules: + */ + + if(resource != NULL) + { + /* by using the resource from @resource, if present, obtained according + * to the section on CURIE and IRI Processing; + */ + context->current_object_resource = rdfa_replace_string( + context->current_object_resource, resource); + } + else if(href != NULL) + { + /* otherwise, by using the IRI from @href, if present, obtained + * according to the section on CURIE and IRI Processing; + */ + context->current_object_resource = rdfa_replace_string( + context->current_object_resource, href); + } + else if(src != NULL) + { + /* otherwise, by using the IRI from @src, if present, obtained + * according to the section on CURIE and IRI Processing; + */ + context->current_object_resource = rdfa_replace_string( + context->current_object_resource, src); + } + else if(type_of != NULL && about == NULL) + { + /* otherwise, if @typeof is present and @about is not, use a + * newly created bnode. + */ + char* bnode = rdfa_create_bnode(context); + context->current_object_resource = rdfa_replace_string( + context->current_object_resource, bnode); + free(bnode); + } + + if(type_of != NULL && about == NULL) + { + /* If @typeof is present and @about is not, set typed resource to current + * object resource. + */ + context->typed_resource = rdfa_replace_string( + context->typed_resource, context->current_object_resource); + } + + /* Note that final value of the current object resource will either be + * null (from initialization) or a full IRI or bnode. + */ +} diff --git a/librdfa/triple.c b/librdfa/triple.c new file mode 100644 index 0000000..be1caf2 --- /dev/null +++ b/librdfa/triple.c @@ -0,0 +1,847 @@ +/** + * Copyright 2008 Digital Bazaar, Inc. + * + * This file is part of librdfa. + * + * librdfa is Free Software, and can be licensed under any of the + * following three licenses: + * + * 1. GNU Lesser General Public License (LGPL) V2.1 or any + * newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE-* at the top of this software distribution for more + * information regarding the details of each license. + * + * Handles all triple functionality including all incomplete triple + * functionality. + * + * @author Manu Sporny + */ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include "rdfa_utils.h" +#include "rdfa.h" + +rdftriple* rdfa_create_triple(const char* subject, const char* predicate, + const char* object, rdfresource_t object_type, const char* datatype, + const char* language) +{ + rdftriple* rval = (rdftriple*)malloc(sizeof(rdftriple)); + + /* clear the memory */ + rval->subject = NULL; + rval->predicate = NULL; + rval->object = NULL; + rval->object_type = object_type; + rval->datatype = NULL; + rval->language = NULL; + +#if 0 + printf("SUBJECT : %s\n", subject); + printf("PREDICATE: %s\n", predicate); + printf("OBJECT : %s\n", object); + printf("DATATYPE : %s\n", datatype); + printf("LANG : %s\n", language); +#endif + + /* a triple needs a subject, predicate and object at minimum to be + * considered a triple. */ + if((subject != NULL) && (predicate != NULL) && (object != NULL)) + { + rval->subject = rdfa_replace_string(rval->subject, subject); + rval->predicate = rdfa_replace_string(rval->predicate, predicate); + rval->object = rdfa_replace_string(rval->object, object); + + /* if the datatype is present, set it */ + if(datatype != NULL) + { + rval->datatype = rdfa_replace_string(rval->datatype, datatype); + } + + /* if the language was specified, set it */ + if(language != NULL) + { + rval->language = rdfa_replace_string(rval->language, language); + } + } + + return rval; +} + +void rdfa_print_triple(rdftriple* triple) +{ + if(triple->object_type == RDF_TYPE_NAMESPACE_PREFIX) + { + printf("%s %s: <%s> .\n", + triple->subject, triple->predicate, triple->object); + } + else + { + if(triple->subject != NULL) + { + if((triple->subject[0] == '_') && (triple->subject[1] == ':')) + { + printf("%s\n", triple->subject); + } + else + { + printf("<%s>\n", triple->subject); + } + } + else + { + printf("INCOMPLETE\n"); + } + + if(triple->predicate != NULL) + { + printf(" <%s>\n", triple->predicate); + } + else + { + printf(" INCOMPLETE\n"); + } + + if(triple->object != NULL) + { + if(triple->object_type == RDF_TYPE_IRI) + { + if((triple->object[0] == '_') && (triple->object[1] == ':')) + { + printf(" %s", triple->object); + } + else + { + printf(" <%s>", triple->object); + } + } + else if(triple->object_type == RDF_TYPE_PLAIN_LITERAL) + { + printf(" \"%s\"", triple->object); + if(triple->language != NULL) + { + printf("@%s", triple->language); + } + } + else if(triple->object_type == RDF_TYPE_XML_LITERAL) + { + printf(" \"%s\"^^rdf:XMLLiteral", triple->object); + } + else if(triple->object_type == RDF_TYPE_TYPED_LITERAL) + { + if((triple->datatype != NULL) && (triple->language != NULL)) + { + printf(" \"%s\"@%s^^<%s>", + triple->object, triple->language, triple->datatype); + } + else if(triple->datatype != NULL) + { + printf(" \"%s\"^^<%s>", triple->object, triple->datatype); + } + } + else + { + printf(" <%s> <---- UNKNOWN OBJECT TYPE", triple->object); + } + + printf(" .\n"); + } + else + { + printf(" INCOMPLETE ."); + } + } +} + +void rdfa_free_triple(rdftriple* triple) +{ + free(triple->subject); + free(triple->predicate); + free(triple->object); + free(triple->datatype); + free(triple->language); + free(triple); +} + +#ifndef LIBRDFA_IN_RAPTOR +/** + * Generates a namespace prefix triple for any application that is + * interested in processing namespace changes. + * + * @param context the RDFa context. + * @param prefix the name of the prefix + * @param IRI the fully qualified IRI that the prefix maps to. + */ +void rdfa_generate_namespace_triple( + rdfacontext* context, const char* prefix, const char* iri) +{ + if(context->processor_graph_triple_callback != NULL) + { + rdftriple* triple = rdfa_create_triple( + "@prefix", prefix, iri, RDF_TYPE_NAMESPACE_PREFIX, NULL, NULL); + context->processor_graph_triple_callback(triple, context->callback_data); + } +} + +/** + * Generates a set of triples that describe the location of a warning or + * error in a document. + * + * @param context the currently active context. + * @param subject the name of the subject that is associated with the triples. + */ +#if 1 /* remove when the prototype is in the header */ +void rdfa_processor_location_triples(rdfacontext* context, const char* subject); +#endif +void rdfa_processor_location_triples(rdfacontext* context, const char* subject) +{ +} + +/** + * Generates a set of triples in the processor graph including the processor's + * position in the byte stream. + * + * @param context the current active context. + * @param type the type of the message, which may be any of the RDF Classes + * defined in the RDFa Core specification: + * http://www.w3.org/TR/rdfa-core/#processor-graph-reporting + * @param msg the message associated with the processor warning. + */ +void rdfa_processor_triples( + rdfacontext* context, const char* type, const char* msg) +{ + if(context->processor_graph_triple_callback != NULL) + { + char buffer[32]; + char* subject = rdfa_create_bnode(context); + char* context_subject = rdfa_create_bnode(context); + + /* generate the RDFa Processing Graph warning type triple */ + rdftriple* triple = rdfa_create_triple( + subject, "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", + type, RDF_TYPE_IRI, NULL, NULL); + context->processor_graph_triple_callback(triple, context->callback_data); + + /* generate the description */ + triple = rdfa_create_triple( + subject, "http://purl.org/dc/terms/description", msg, + RDF_TYPE_PLAIN_LITERAL, NULL, "en"); + context->processor_graph_triple_callback(triple, context->callback_data); + + /* generate the context triple for the error */ + triple = rdfa_create_triple( + subject, "http://www.w3.org/ns/rdfa#context", + context_subject, RDF_TYPE_IRI, NULL, NULL); + context->processor_graph_triple_callback(triple, context->callback_data); + + /* generate the type for the context triple */ + triple = rdfa_create_triple( + context_subject, "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", + "http://www.w3.org/2009/pointers#LineCharPointer", + RDF_TYPE_IRI, NULL, NULL); + context->processor_graph_triple_callback(triple, context->callback_data); + + /* generate the line number */ + snprintf(buffer, sizeof(buffer) - 1, "%d", + (int)xmlSAX2GetLineNumber(context->parser)); + triple = rdfa_create_triple( + context_subject, "http://www.w3.org/2009/pointers#lineNumber", + buffer, RDF_TYPE_TYPED_LITERAL, + "http://www.w3.org/2001/XMLSchema#positiveInteger", NULL); + context->processor_graph_triple_callback(triple, context->callback_data); + + free(context_subject); + free(subject); + } +} +#endif + +/** + * Completes all incomplete triples that are part of the current + * context by matching the new_subject with the list of incomplete + * triple predicates. + * + * @param context the RDFa context. + */ +void rdfa_complete_incomplete_triples(rdfacontext* context) +{ + /* 10. If the [ skip element ] flag is 'false', and [ new subject ] + * was set to a non-null value, then any [ incomplete triple ]s + * within the current context should be completed: + * + * The [ list of incomplete triples ] from the current [ evaluation + * context ] ( not the [ local list of incomplete triples ]) will + * contain zero or more predicate URIs. This list is iterated, and + * each of the predicates is used with [ parent subject ] and + * [ new subject ] to generate a triple. Note that at each level + * there are two , lists of [ incomplete triple ]s; one for the + * current processing level (which is passed to each child element + * in the previous step), and one that was received as part of the + * [ evaluation context ]. It is the latter that is used in + * processing during this step. */ + unsigned int i; + for(i = 0; i < context->incomplete_triples->num_items; i++) + { + rdfalist* incomplete_triples = context->incomplete_triples; + rdfalistitem* incomplete_triple = incomplete_triples->items[i]; + + if(incomplete_triple->flags & RDFALIST_FLAG_DIR_NONE) + { + /* If direction is 'none', the new subject is added to the list + * from the iterated incomplete triple. */ + const char* predicate = (const char*)incomplete_triple->data; + rdftriple* triple = rdfa_create_triple(context->parent_subject, + predicate, context->new_subject, RDF_TYPE_IRI, NULL, NULL); + + /* ensure the list mapping exists */ + rdfa_create_list_mapping( + context, context->local_list_mappings, + context->parent_subject, predicate); + + /* add the predicate to the list mapping */ + rdfa_append_to_list_mapping(context->local_list_mappings, + context->parent_subject, predicate, (void*)triple); + } + else if(incomplete_triple->flags & RDFALIST_FLAG_DIR_FORWARD) + { + /* If [direction] is 'forward' then the following triple is generated: + * + * subject + * [parent subject] + * predicate + * the predicate from the iterated incomplete triple + * object + * [new subject] */ + rdftriple* triple = + rdfa_create_triple(context->parent_subject, + (const char*)incomplete_triple->data, context->new_subject, + RDF_TYPE_IRI, NULL, NULL); + context->default_graph_triple_callback(triple, context->callback_data); + } + else + { + /* If [direction] is not 'forward' then this is the triple generated: + * + * subject + * [new subject] + * predicate + * the predicate from the iterated incomplete triple + * object + * [parent subject] */ + rdftriple* triple = + rdfa_create_triple(context->new_subject, + (const char*)incomplete_triple->data, context->parent_subject, + RDF_TYPE_IRI, NULL, NULL); + context->default_graph_triple_callback(triple, context->callback_data); + } + free(incomplete_triple->data); + free(incomplete_triple); + } + context->incomplete_triples->num_items = 0; +} + +void rdfa_complete_type_triples( + rdfacontext* context, const rdfalist* type_of) +{ + unsigned int i; + rdfalistitem** iptr = type_of->items; + const char* subject; + const char* type; + + if(context->rdfa_version == RDFA_VERSION_1_0) + { + /* RDFa 1.0: 6.1 One or more 'types' for the [new subject] can be set by + * using @type_of. If present, the attribute must contain one or + * more URIs, obtained according to the section on URI and CURIE + * Processing, each of which is used to generate a triple as follows: + * + * subject + * [new subject] + * predicate + * http://www.w3.org/1999/02/22-rdf-syntax-ns#type + * object + * full URI of 'type' + */ + subject = context->new_subject; + } + else + { + /* RDFa 1.1: 7. One or more 'types' for the typed resource can be set by + * using @typeof. If present, the attribute may contain one or more IRIs, + * obtained according to the section on CURIE and IRI Processing, each of + * which is used to generate a triple as follows: + * + * subject + * typed resource + * predicate + * http://www.w3.org/1999/02/22-rdf-syntax-ns#type + * object + * current full IRI of 'type' from typed resource + */ + subject = context->typed_resource; + } + + for(i = 0; i < type_of->num_items; i++) + { + rdfalistitem* iri = *iptr; + rdftriple* triple; + type = (const char*)iri->data; + + triple = rdfa_create_triple(subject, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", type, RDF_TYPE_IRI, + NULL, NULL); + + context->default_graph_triple_callback(triple, context->callback_data); + iptr++; + } +} + +void rdfa_complete_relrev_triples( + rdfacontext* context, const rdfalist* rel, const rdfalist* rev) +{ + /* 7. If in any of the previous steps a [current object resource] + * was set to a non-null value, it is now used to generate triples */ + unsigned int i; + + /* Predicates for the [current object resource] can be set by using + * one or both of the @rel and @rev attributes. */ + + /* If present, @rel will contain one or more URIs, obtained + * according to the section on CURIE and URI Processing each of + * which is used to generate a triple as follows: + * + * subject + * [new subject] + * predicate + * full URI + * object + * [current object resource] */ + if(rel != NULL) + { + rdfalistitem** relptr = rel->items; + for(i = 0; i < rel->num_items; i++) + { + rdfalistitem* curie = *relptr; + + rdftriple* triple = rdfa_create_triple(context->new_subject, + (const char*)curie->data, context->current_object_resource, + RDF_TYPE_IRI, NULL, NULL); + + context->default_graph_triple_callback(triple, context->callback_data); + relptr++; + } + } + + /* If present, @rev will contain one or more URIs, obtained + * according to the section on CURIE and URI Processing each of which + * is used to generate a triple as follows: + * + * subject + * [current object resource] + * predicate + * full URI + * object + * [new subject] */ + if(rev != NULL) + { + rdfalistitem** revptr = rev->items; + for(i = 0; i < rev->num_items; i++) + { + rdfalistitem* curie = *revptr; + + rdftriple* triple = rdfa_create_triple( + context->current_object_resource, (const char*)curie->data, + context->new_subject, RDF_TYPE_IRI, NULL, NULL); + + context->default_graph_triple_callback(triple, context->callback_data); + revptr++; + } + } +} + +void rdfa_save_incomplete_triples( + rdfacontext* context, const rdfalist* rel, const rdfalist* rev) +{ + unsigned int i; + /* 8. If however [current object resource] was set to null, but + * there are predicates present, then they must be stored as + * [incomplete triple]s, pending the discovery of a subject that + * can be used as the object. Also, [current object resource] + * should be set to a newly created [bnode] */ + if(context->current_object_resource == NULL) + { + context->current_object_resource = rdfa_create_bnode(context); + } + + /* If present, @rel must contain one or more URIs, obtained + * according to the section on CURIE and URI Processing each of + * which is added to the [local local list of incomplete triples] + * as follows: + * + * predicate + * full URI + * direction + * forward */ + if(rel != NULL) + { + rdfalistitem** relptr = rel->items; + for(i = 0; i < rel->num_items; i++) + { + rdfalistitem* curie = *relptr; + + rdfa_add_item( + context->local_incomplete_triples, curie->data, + (liflag_t)(RDFALIST_FLAG_DIR_FORWARD | RDFALIST_FLAG_TEXT)); + + relptr++; + } + } + + /* If present, @rev must contain one or more URIs, obtained + * according to the section on CURIE and URI Processing, each of + * which is added to the [local list of incomplete triples] as follows: + * + * predicate + * full URI + * direction + * reverse */ + if(rev != NULL) + { + rdfalistitem** revptr = rev->items; + for(i = 0; i < rev->num_items; i++) + { + rdfalistitem* curie = *revptr; + + rdfa_add_item( + context->local_incomplete_triples, curie->data, + (liflag_t)(RDFALIST_FLAG_DIR_REVERSE | RDFALIST_FLAG_TEXT)); + + revptr++; + } + } +} + +void rdfa_complete_object_literal_triples(rdfacontext* context) +{ + /* 9. The next step of the iteration is to establish any + * [current object literal]; + * + * Predicates for the [current object literal] can be set by using + * @property. If present, a URI is obtained according to the + * section on CURIE and URI Processing, and then the actual literal + * value is obtained as follows: */ + const char* current_object_literal = NULL; + rdfresource_t type = RDF_TYPE_UNKNOWN; + + unsigned int i; + rdfalistitem** pptr; + + /* * as a [plain literal] if: + * o @content is present; + * o or all children of the [current element] are text nodes; + * o or there are no child nodes; TODO: Is this needed? + * o or the body of the [current element] does have non-text + * child nodes but @datatype is present, with an empty value. + * + * Additionally, if there is a value for [current language] then + * the value of the [plain literal] should include this language + * information, as described in [RDF-CONCEPTS]. The actual literal + * is either the value of @content (if present) or a string created + * by concatenating the text content of each of the descendant + * elements of the [current element] in document order. */ + if((context->content != NULL)) + { + current_object_literal = context->content; + type = RDF_TYPE_PLAIN_LITERAL; + } + else if(context->xml_literal && strchr(context->xml_literal, '<') == NULL) + { + current_object_literal = context->plain_literal; + type = RDF_TYPE_PLAIN_LITERAL; + } + else if(strlen(context->plain_literal) == 0) + { + current_object_literal = (const char*)""; + type = RDF_TYPE_PLAIN_LITERAL; + } + else if((context->xml_literal != NULL) && + (context->datatype != NULL) && + (strlen(context->xml_literal) > 0) && + (strcmp(context->datatype, "") == 0)) + { + current_object_literal = context->plain_literal; + type = RDF_TYPE_PLAIN_LITERAL; + } + + + /* * as an [XML literal] if: + * o the [current element] has any child nodes that are not + * simply text nodes, and @datatype is not present, or is + * present, but is set to rdf:XMLLiteral. + * + * The value of the [XML literal] is a string created by + * serializing to text, all nodes that are descendants of the + * [current element], i.e., not including the element itself, and + * giving it a datatype of rdf:XMLLiteral. */ + if((context->xml_literal != NULL) && + (current_object_literal == NULL) && + (strchr(context->xml_literal, '<') != NULL) && + ((context->datatype == NULL) || + (strcmp(context->datatype, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral") == 0))) + { + current_object_literal = context->xml_literal; + type = RDF_TYPE_XML_LITERAL; + } + + /* * as a [typed literal] if: + * o @datatype is present, and does not have an empty + * value. + * + * The actual literal is either the value of @content (if present) + * or a string created by concatenating the value of all descendant + * text nodes, of the [current element] in turn. The final string + * includes the datatype URI, as described in [RDF-CONCEPTS], which + * will have been obtained according to the section on CURIE and + * URI Processing. */ + if((context->datatype != NULL) && (strlen(context->datatype) > 0)) + { + if(context->content != NULL) + { + /* Static code analyzer clang says next line is not needed; + * "Assigned value is always the same as the existing value" + */ + /* current_object_literal = context->content; */ + type = RDF_TYPE_TYPED_LITERAL; + } + else if(strcmp(context->datatype, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral") != 0) + { + current_object_literal = context->plain_literal; + type = RDF_TYPE_TYPED_LITERAL; + } + } + + /* TODO: Setting the current object literal to the plain literal in + * the case of xsd:string isn't mentioned in the syntax + * processing document. */ + if((current_object_literal == NULL) && (context->datatype != NULL) && + (strcmp( + context->datatype, "http://www.w3.org/2001/XMLSchema#string") == 0)) + { + current_object_literal = context->plain_literal; + type = RDF_TYPE_TYPED_LITERAL; + } + + /* The [current object literal] is then used with each predicate to + * generate a triple as follows: + * + * subject + * [new subject] + * predicate + * full URI + * object + * [current object literal] */ + pptr = context->property->items; + for(i = 0; i < context->property->num_items; i++) + { + + rdfalistitem* curie = *pptr; + rdftriple* triple = NULL; + + triple = rdfa_create_triple(context->new_subject, + (const char*)curie->data, current_object_literal, type, + context->datatype, context->language); + + context->default_graph_triple_callback(triple, context->callback_data); + pptr++; + } + + /* TODO: Implement recurse flag being set to false + * + * Once the triple has been created, if the [datatype] of the + * [current object literal] is rdf:XMLLiteral, then the [recurse] + * flag is set to false */ + context->recurse = 0; +} + +void rdfa_complete_current_property_value_triples(rdfacontext* context) +{ + /* 11. The next step of the iteration is to establish any current property + * value; + * Predicates for the current property value can be set by using @property. + * If present, one or more resources are obtained according to the section + * on CURIE and IRI Processing, and then the actual literal value is + * obtained as follows: */ + char* current_property_value = NULL; + rdfresource_t type = RDF_TYPE_UNKNOWN; + + unsigned int i; + rdfalistitem** pptr; + + /* as a typed literal if @datatype is present, does not have an empty + * value according to the section on CURIE and IRI Processing, and is not + * set to XMLLiteral in the vocabulary + * http://www.w3.org/1999/02/22-rdf-syntax-ns#. */ + if((context->datatype != NULL) && (strcmp(context->datatype, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral") != 0)) + { + /* The actual literal is either the value of @content (if present) or a + * string created by concatenating the value of all descendant text nodes, + * of the current element in turn. */ + if(context->content != NULL) + { + current_property_value = context->content; + } + else + { + current_property_value = context->plain_literal; + } + + /* The final string includes the datatype + * IRI, as described in [RDF-CONCEPTS], which will have been obtained + * according to the section on CURIE and IRI Processing. + * otherwise, as a plain literal if @datatype is present but has an + * empty value according to the section on CURIE and IRI Processing. */ + if(strlen(context->datatype) > 0) + { + type = RDF_TYPE_TYPED_LITERAL; + } + else + { + type = RDF_TYPE_PLAIN_LITERAL; + } + } + else if((context->datatype != NULL) && (strcmp(context->datatype, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral") == 0)) + { + /* otherwise, as an XML literal if @datatype is present and is set to + * XMLLiteral in the vocabulary + * http://www.w3.org/1999/02/22-rdf-syntax-ns#. + * The value of the XML literal is a string created by serializing to + * text, all nodes that are descendants of the current element, i.e., not + * including the element itself, and giving it a datatype of XMLLiteral + * in the vocabulary http://www.w3.org/1999/02/22-rdf-syntax-ns#. The + * format of the resulting serialized content is as defined in Exclusive + * XML Canonicalization Version [XML-EXC-C14N]. + * In order to maintain maximum portability of this literal, any children + * of the current node that are elements must have the current XML + * namespace declarations (if any) declared on the serialized element. + * Since the child element node could also declare new XML namespaces, + * the RDFa Processor must be careful to merge these together when + * generating the serialized element definition. For avoidance of doubt, + * any re-declarations on the child node must take precedence over + * declarations that were active on the current node. */ + current_property_value = context->xml_literal; + type = RDF_TYPE_XML_LITERAL; + } + else if(context->content != NULL) + { + /* otherwise, as an plain literal using the value of @content if + * @content is present. */ + current_property_value = context->content; + type = RDF_TYPE_PLAIN_LITERAL; + } + else if((context->rel_present == 0) && (context->rev_present == 0) && + (context->content == NULL)) + { + /* otherwise, if the @rel, @rev, and @content attributes are not present, + * as a resource obtained from one of the following: */ + if(context->resource != NULL) + { + /* by using the resource from @resource, if present, obtained + * according to the section on CURIE and IRI Processing; */ + current_property_value = context->resource; + type = RDF_TYPE_IRI; + } + else if(context->href != NULL) + { + /* otherwise, by using the IRI from @href, if present, obtained + * according to the section on CURIE and IRI Processing; */ + current_property_value = context->href; + type = RDF_TYPE_IRI; + } + else if(context->src != NULL) + { + /* otherwise, by using the IRI from @src, if present, obtained + * according to the section on CURIE and IRI Processing. */ + current_property_value = context->src; + type = RDF_TYPE_IRI; + } + else if((context->about == NULL) && (context->typed_resource != NULL)) + { + /* otherwise, if @typeof is present and @about is not, the value of + * typed resource. */ + current_property_value = context->typed_resource; + type = RDF_TYPE_IRI; + } + else + { + /* otherwise as a plain literal. */ + current_property_value = context->plain_literal; + type = RDF_TYPE_PLAIN_LITERAL; + } + } + else + { + /* otherwise as a plain literal. */ + current_property_value = context->plain_literal; + type = RDF_TYPE_PLAIN_LITERAL; + } + + /* Additionally, if there is a value for current language then the value + * of the plain literal should include this language information, as + * described in [RDF-CONCEPTS]. The actual literal is either the value + * of @content (if present) or a string created by concatenating the text + * content of each of the descendant elements of the current element in + * document order. + * + * NOTE: This happens automatically due to the way the code is setup. */ + + if(context->inlist_present) + { + /* The current property value is then used with each predicate as + * follows: + * If the element also includes the @inlist attribute, the current + * property value is added to the local list mapping as follows: + * if the local list mapping does not contain a list associated with + * the predicate IRI, instantiate a new list and add to local list + * mappings add the current property value to the list associated + * with the predicate IRI in the local list mapping */ + rdfa_establish_new_inlist_triples( + context, context->property, current_property_value, type); + } + else + { + pptr = context->property->items; + for(i = 0; i < context->property->num_items; i++) + { + /* Otherwise the current property value is used to generate a triple + * as follows: + * subject + * new subject + * predicate + * full IRI + * object + * current property value */ + rdfalistitem* curie = *pptr; + rdftriple* triple = rdfa_create_triple(context->new_subject, + (const char*)curie->data, current_property_value, type, + context->datatype, context->language); + + context->default_graph_triple_callback(triple, context->callback_data); + + pptr++; + } + } +} diff --git a/raptor2.pc.in b/raptor2.pc.in new file mode 100644 index 0000000..40c6af7 --- /dev/null +++ b/raptor2.pc.in @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@/@PACKAGE@ + +Name: Raptor RDF Syntax Library +Description: RDF Syntax Library +Version: @VERSION@ +Libs: -L${libdir} -lraptor2 +Libs.private: @RAPTOR_LDFLAGS@ +Cflags: -I${includedir} +Requires:@PKG_CONFIG_REQUIRES@ + diff --git a/raptor2.rdf.in b/raptor2.rdf.in new file mode 100644 index 0000000..e1aa22d --- /dev/null +++ b/raptor2.rdf.in @@ -0,0 +1,94 @@ + + + + + Raptor + + + Raptor RDF Parser Toolkit Library. + + is a free software / Open Source C + library that provides a set of parsers and serializers that + generate Resource Description Framework (RDF) triples by parsing + syntaxes or serialize the triples into a syntax. The supported + parsing syntaxes are RDF/XML, N-Triples, TRiG, Turtle, RSS tag + soup including all versions of RSS, Atom 1.0 and 0.3, GRDDL and + microformats for HTML, XHTML and XML. The + serializing syntaxes are RDF/XML (regular, and abbreviated), + N-Triples, RSS 1.0, Atom 1.0, XMP, Turtle, GraphViz DOT and + JSON. + + + + Dave Beckett + + 970987f991961f2553a1bf2574166fa29befbccb + + + + + + stable + 2005-02-01 + @VERSION@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dave Beckett + + 970987f991961f2553a1bf2574166fa29befbccb + + + + + + diff --git a/raptor2.spec.in b/raptor2.spec.in new file mode 100644 index 0000000..0e1a25d --- /dev/null +++ b/raptor2.spec.in @@ -0,0 +1,139 @@ +# -*- RPM-SPEC -*- +%define name @PACKAGE@ +%define version @VERSION@ +%define release @RPM_RELEASE@ + +Summary: Raptor RDF Parser Toolkit for Redland +Name: %{name} +Version: %{version} +Release: %{release} +Prefix: %{_prefix} +License: LGPLv2+ or ASL 2.0 +Group: Development/Libraries +Source: http://download.librdf.org/source/%{name}-%{version}.tar.gz +URL: http://librdf.org/raptor/ +BuildRoot: /tmp/%{name}-%{version} +BuildRequires: libxml2 libxml2-devel >= 2.6.8 +BuildRequires: curl curl-devel +BuildRequires: libxslt libxslt-devel +Packager: Dave Beckett +Docdir: %{_docdir} + +%description + +Raptor is the RDF Parser Toolkit for Redland that provides a set of +Resource Description Framework (RDF) parsers and serializers, +generating RDF triples from the following syntaxes: RDF/XML, +N-Triples, TRiG, Turtle, RSS tag soup including all versions of RSS, +Atom 1.0 and 0.3, GRDDL and microformats for HTML, XHTML and XML. The +serializing RDF triples to syntaxes are: RDF/XML, RSS 1.0, Atom 1.0, +N-Triples, XMP, Turtle, GraphViz DOT and JSON. + +%package devel +Summary: Libraries, includes etc to develop with Raptor RDF parser library +Group: Development/Libraries +Requires: raptor = %{version} +Requires: libxml2-devel + +%description devel +Libraries, includes etc to develop with Raptor RDF parser and +serializer library. + +%prep +%setup -q + +%build + +%configure --enable-release + +%{__make} OPTIMIZE="$RPM_OPT_FLAGS" + +%install +[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT + +install -d $RPM_BUILD_ROOT%{_mandir}/man1 +install -d $RPM_BUILD_ROOT%{_mandir}/man3 + +%makeinstall + +%clean +[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-, root, root) + +%doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README +%doc LICENSE-2.0.txt NOTICE +%doc *.html + +%doc %{_mandir}/man1/rapper.1* +%doc %{_mandir}/man3/libraptor2.3* + +%doc %{_datadir}/gtk-doc/html/raptor2/* + +%{_libdir}/libraptor*.so.* +%{prefix}/bin/rapper + + +%files devel +%defattr(-, root, root) + +%doc AUTHORS COPYING COPYING.LIB ChangeLog LICENSE.txt NEWS README +%doc LICENSE-2.0.txt NOTICE + +%{_libdir}/libraptor2*.* +%{_libdir}/pkgconfig/raptor2.pc + +%{prefix}/include/raptor2/* + + +%changelog +* Wed Jan 14 2015 Phil John +- Fix for wrong libdir causing errors when running rpmbuild + +* Fri Jan 5 2007 Dave Beckett +- rename files for raptor 2.0.0 +- no more raptor-config +- do not package libraptor*.la or libraptor*.a files +- includes are in a subdir + +* Fri Jan 5 2007 Dave Beckett +- Document Turtle and DOT serializers + +* Wed Feb 15 2006 Dave Beckett +- Add libxslt and libxslt-devel for GRDDL + +* Wed Dec 20 2005 Dave Beckett +- Update description of parsers and serializers. + +* Wed Nov 9 2005 Dave Beckett +- Add gtk-doc documentation + +* Wed Aug 11 2005 Dave Beckett +- Update Source: +- Use %makeinstall + +* Wed Aug 10 2005 Dave Beckett +- Use %configure and %{_make} + +* Thu Sep 9 2004 Dave Beckett +- License now LGPL/Apache 2 +- Added LICENSE-2.0.txt and NOTICE + +* Tue May 11 2004 Dave Beckett +- Added RELEASE.html + +* Thu Apr 17 2003 Dave Beckett +- Added pkgconfig raptor.pc, raptor-config +- Requires curl + +* Mon Jan 13 2003 Dave Beckett +- rdfdump now rapper + +* Fri Dec 20 2002 Dave Beckett +- Updated to have two RPMs for raptor and raptor-devel. Depend on + libxml2 as XML parser. diff --git a/scripts/Makefile.am b/scripts/Makefile.am new file mode 100644 index 0000000..5591adb --- /dev/null +++ b/scripts/Makefile.am @@ -0,0 +1,45 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor libraptor +# +# Copyright (C) 2010, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# + +EXTRA_DIST= \ +fix-bison.pl \ +fix-flex.pl \ +fix-groff-xhtml.pl \ +fix-gtkdoc-header.pl \ +process-changes.pl \ +rdfcompare + +CLEANFILES = + +AM_CPPFLAGS= -I$(top_srcdir)/src + +if MAINTAINER_MODE +EXTRA_PROGRAMS = build-formats + +CLEANFILES += build-formats + +build_formats_SOURCES = build-formats.c +build_formats_LDADD= $(top_builddir)/src/libraptor2.la + +endif + +$(top_builddir)/src/libraptor2.la: + cd $(top_builddir)/src && $(MAKE) libraptor2.la diff --git a/scripts/Makefile.in b/scripts/Makefile.in new file mode 100644 index 0000000..d285b34 --- /dev/null +++ b/scripts/Makefile.in @@ -0,0 +1,671 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor libraptor +# +# Copyright (C) 2010, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@MAINTAINER_MODE_TRUE@EXTRA_PROGRAMS = build-formats$(EXEEXT) +@MAINTAINER_MODE_TRUE@am__append_1 = build-formats +subdir = scripts +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__build_formats_SOURCES_DIST = build-formats.c +@MAINTAINER_MODE_TRUE@am_build_formats_OBJECTS = \ +@MAINTAINER_MODE_TRUE@ build-formats.$(OBJEXT) +build_formats_OBJECTS = $(am_build_formats_OBJECTS) +@MAINTAINER_MODE_TRUE@build_formats_DEPENDENCIES = \ +@MAINTAINER_MODE_TRUE@ $(top_builddir)/src/libraptor2.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/build/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/build-formats.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(build_formats_SOURCES) +DIST_SOURCES = $(am__build_formats_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/build/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = \ +fix-bison.pl \ +fix-flex.pl \ +fix-groff-xhtml.pl \ +fix-gtkdoc-header.pl \ +process-changes.pl \ +rdfcompare + +CLEANFILES = $(am__append_1) +AM_CPPFLAGS = -I$(top_srcdir)/src +@MAINTAINER_MODE_TRUE@build_formats_SOURCES = build-formats.c +@MAINTAINER_MODE_TRUE@build_formats_LDADD = $(top_builddir)/src/libraptor2.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu scripts/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +build-formats$(EXEEXT): $(build_formats_OBJECTS) $(build_formats_DEPENDENCIES) $(EXTRA_build_formats_DEPENDENCIES) + @rm -f build-formats$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(build_formats_OBJECTS) $(build_formats_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/build-formats.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/build-formats.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/build-formats.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-generic clean-libtool cscopelist-am ctags ctags-am \ + distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + +.PRECIOUS: Makefile + + +$(top_builddir)/src/libraptor2.la: + cd $(top_builddir)/src && $(MAKE) libraptor2.la + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/scripts/build-formats.c b/scripts/build-formats.c new file mode 100644 index 0000000..827f8ae --- /dev/null +++ b/scripts/build-formats.c @@ -0,0 +1,588 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * build-formats.c - Helper to print raptor syntaxes into docbook xml + * + * Copyright (C) 2010, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#include +#include +#include + +#include + +static const char * const program = "build-formats"; + +static raptor_world* world = NULL; + + + +static void +emit_literal(const char* literal, raptor_iostream* iostr) +{ + raptor_iostream_string_write("", iostr); + raptor_iostream_string_write(literal, iostr); + raptor_iostream_string_write("", iostr); +} + + +#if 0 +static void +emit_function(const char* name, raptor_iostream* iostr) +{ + int i; + char c; + + raptor_iostream_string_write("", iostr); + for(i = 0; (c = name[i]); i++) { + if(c == '_') + c = '-'; + raptor_iostream_write_byte(c, iostr); + } + raptor_iostream_string_write("\">", iostr); + raptor_iostream_string_write(name, iostr); + raptor_iostream_string_write("()", iostr); +} +#endif + + +static void +emit_header(const char* id, raptor_iostream* iostr) +{ + raptor_iostream_string_write( +"\n" +"\n" +"Syntax Formats supported in Raptor\n" +"\n" +"This chapter describes the syntax formats supported\n" +"by parsers and serializers in Raptor.\n" +"\n" +"\n", + iostr); +} + + +static void +emit_footer(raptor_iostream *iostr) +{ + raptor_iostream_string_write( +"\n" +"\n" +"\n" +"\n", + iostr); +} + + +static void +emit_start_section(const char* id, const char* title, raptor_iostream* iostr) +{ + raptor_iostream_string_write("
\n" +"", + iostr); + raptor_xml_escape_string_write((const unsigned char*)title, strlen(title), + '\0', iostr); + raptor_iostream_string_write("\n", iostr); +} + + +static void +emit_end_section(raptor_iostream *iostr) +{ + raptor_iostream_string_write( +"
\n" +"\n", + iostr); +} + + +static void +emit_start_list(raptor_iostream *iostr) +{ + raptor_iostream_string_write(" \n", iostr); +} + + +static void +emit_start_list_item(raptor_iostream *iostr) +{ + raptor_iostream_string_write(" ", iostr); +} + + +static void +emit_end_list_item(raptor_iostream *iostr) +{ + raptor_iostream_string_write("\n", iostr); +} + + +static void +emit_end_list(raptor_iostream *iostr) +{ + raptor_iostream_string_write(" \n", iostr); +} + + +static void +emit_start_desc_list(const char* title, raptor_iostream *iostr) +{ + raptor_iostream_string_write( + " \n", + iostr); + if(title) { + raptor_iostream_string_write( +" ", + iostr); + raptor_iostream_string_write(title, iostr); + raptor_iostream_string_write("\n", iostr); + } + raptor_iostream_write_byte('\n', iostr); +} + + +static void +emit_start_desc_list_term(raptor_iostream *iostr) +{ + raptor_iostream_string_write( +" ", + iostr); +} + + +static void +emit_start_desc_list_defn(raptor_iostream *iostr) +{ + raptor_iostream_string_write( +"\n" +" ", + iostr); +} + + +static void +emit_end_desc_list_item(raptor_iostream *iostr) +{ + raptor_iostream_string_write( +" \n" +" \n" +"\n", + iostr); +} + + +static void +emit_end_desc_list(raptor_iostream *iostr) +{ + raptor_iostream_string_write(" \n", iostr); +} + + +static void +emit_mime_type_name(const char *name, raptor_iostream* iostr) +{ + emit_literal(name, iostr); +} + +static void +emit_mime_type_q(unsigned char q, raptor_iostream* iostr) +{ + if(q < 10) { + raptor_iostream_string_write("q 0.", iostr); + raptor_iostream_decimal_write((int)q, iostr); + } else + raptor_iostream_string_write("q 1.0", iostr); +} + +static void +emit_mime_type(const raptor_type_q* mt, raptor_iostream* iostr) +{ + emit_mime_type_name(mt->mime_type, iostr); + raptor_iostream_string_write(" with ", iostr); + emit_mime_type_q(mt->q, iostr); +} + + +static void +emit_format_description_name(const char* type_name, + const raptor_syntax_description* sd, + raptor_iostream* iostr) +{ + raptor_xml_escape_string_write((const unsigned char*)sd->label, + strlen(sd->label), + '\0', iostr); + if(type_name) { + raptor_iostream_write_byte(' ', iostr); + raptor_iostream_string_write(type_name, iostr); + } + raptor_iostream_string_write(" (", iostr); + emit_literal(sd->names[0], iostr); + raptor_iostream_write_byte(')', iostr); +} + + +static void +emit_format_description(const char* type_name, + const raptor_syntax_description* sd, + raptor_iostream* iostr) +{ + unsigned int i; + + if(!sd->mime_types_count) + return; + + /* term */ + emit_start_desc_list_term(iostr); + emit_format_description_name(type_name, sd, iostr); + + /* definition */ + emit_start_desc_list_defn(iostr); + raptor_iostream_string_write("\n ", iostr); + + emit_start_list(iostr); + for(i = 0; i < sd->mime_types_count; i++) { + const raptor_type_q* mime_type = &sd->mime_types[i]; + if(!sd) + break; + raptor_iostream_string_write(" ", iostr); + emit_start_list_item(iostr); + emit_mime_type(mime_type, iostr); + emit_end_list_item(iostr); + } + raptor_iostream_string_write(" ", iostr); + emit_end_list(iostr); + + emit_end_desc_list_item(iostr); +} + + +static int +sort_sd_by_name(const void *a, const void *b) +{ + raptor_syntax_description* sd_a = *(raptor_syntax_description**)a; + raptor_syntax_description* sd_b = *(raptor_syntax_description**)b; + + return strcmp(sd_a->label, sd_b->label); +} + + +typedef struct +{ + const char *mime_type; + unsigned char q; + raptor_syntax_description* parser_sd; + raptor_syntax_description* serializer_sd; +} type_syntax; + + +static int +sort_type_syntax_by_mime_type(const void *a, const void *b) +{ + int rc; + + const char* mime_type_a = ((type_syntax*)a)->mime_type; + const char* mime_type_b = ((type_syntax*)b)->mime_type; + + if(!mime_type_a || !mime_type_b) { + if(!mime_type_a && !mime_type_b) + return (int)(mime_type_b - mime_type_a); + return (mime_type_a) ? 1 : -1; + } + + rc = strcmp(mime_type_a, mime_type_b); + if(rc) + return rc; + return ((type_syntax*)b)->q - ((type_syntax*)a)->q; +} + + + +static void +emit_format_to_syntax_list(raptor_iostream* iostr, + type_syntax* type_syntaxes, + const char* mime_type, + int start, int end) +{ + int i; + int parser_seen = 0; + int serializer_seen = 0; + + /* term */ + emit_start_desc_list_term(iostr); + emit_mime_type_name(mime_type, iostr); + + /* definition */ + emit_start_desc_list_defn(iostr); + raptor_iostream_string_write("\n ", iostr); + + emit_start_list(iostr); + for(i = start; i <= end; i++) { + raptor_iostream_string_write(" ", iostr); + emit_start_list_item(iostr); + if(type_syntaxes[i].parser_sd) { + emit_format_description_name("Parser", + type_syntaxes[i].parser_sd, + iostr); + parser_seen++; + } else { + emit_format_description_name("Serializer", + type_syntaxes[i].serializer_sd, + iostr); + serializer_seen++; + } + raptor_iostream_string_write(" with ", iostr); + emit_mime_type_q(type_syntaxes[i].q, iostr); + emit_end_list_item(iostr); + } + if(!parser_seen || !serializer_seen) { + emit_start_list_item(iostr); + if(!parser_seen) + raptor_iostream_string_write("No parser.", iostr); + else + raptor_iostream_string_write("No serializer.", iostr); + emit_end_list_item(iostr); + } + raptor_iostream_string_write(" ", iostr); + emit_end_list(iostr); + + emit_end_desc_list_item(iostr); +} + + +int +main(int argc, char *argv[]) +{ + int rc = 1; + int i; + int parsers_count = 0; + int serializers_count = 0; + int mime_types_count = 0; + raptor_syntax_description** parsers = NULL; + raptor_syntax_description** serializers = NULL; + raptor_iostream* iostr = NULL; + type_syntax* type_syntaxes = NULL; + int type_syntaxes_count = 0; + + if(argc != 1) { + fprintf(stderr, "%s: USAGE: %s\n", program, program); + return 1; + } + + world = raptor_new_world(); + if(!world) + goto tidy; + + + for(i = 0; 1; i++) { + raptor_syntax_description* sd; + sd = (raptor_syntax_description*)raptor_world_get_parser_description(world, i); + if(!sd) + break; + parsers_count++; + mime_types_count += sd->mime_types_count; + } + for(i = 0; 1; i++) { + raptor_syntax_description* sd; + sd = (raptor_syntax_description*)raptor_world_get_serializer_description(world, i); + if(!sd) + break; + serializers_count++; + mime_types_count += sd->mime_types_count; + } + + parsers = (raptor_syntax_description**)calloc(parsers_count, + sizeof(raptor_syntax_description*)); + if(!parsers) + goto tidy; + + serializers = (raptor_syntax_description**)calloc(serializers_count, + sizeof(raptor_syntax_description*)); + if(!serializers) + goto tidy; + + type_syntaxes = (type_syntax*)calloc(mime_types_count, + sizeof(type_syntax)); + if(!type_syntaxes) + goto tidy; + + type_syntaxes_count = 0; + + for(i = 0; 1; i++) { + raptor_syntax_description* sd; + unsigned int m; + + sd = (raptor_syntax_description*)raptor_world_get_parser_description(world, i); + if(!sd) + break; + parsers[i] = sd; + + for(m = 0; m < sd->mime_types_count; m++) { + type_syntaxes[type_syntaxes_count].mime_type = sd->mime_types[m].mime_type; + type_syntaxes[type_syntaxes_count].q = sd->mime_types[m].q; + type_syntaxes[type_syntaxes_count].parser_sd = sd; + type_syntaxes_count++; + } + } + + qsort(parsers, parsers_count, sizeof(raptor_syntax_description*), + sort_sd_by_name); + + for(i = 0; 1; i++) { + raptor_syntax_description* sd; + unsigned int m; + + sd = (raptor_syntax_description*)raptor_world_get_serializer_description(world, i); + if(!sd) + break; + serializers[i] = sd; + + for(m = 0; m < sd->mime_types_count; m++) { + type_syntaxes[type_syntaxes_count].mime_type = sd->mime_types[m].mime_type; + type_syntaxes[type_syntaxes_count].q = sd->mime_types[m].q; + type_syntaxes[type_syntaxes_count].serializer_sd = sd; + type_syntaxes_count++; + } + } + + qsort(serializers, serializers_count, sizeof(raptor_syntax_description*), + sort_sd_by_name); + + + iostr = raptor_new_iostream_to_file_handle(world, stdout); + if(!iostr) + goto tidy; + + + /* MIME Types by parser */ + emit_header("raptor-formats", iostr); + + emit_start_section("raptor-formats-intro", + "Introduction", + iostr); + raptor_iostream_string_write( +"\n" +"The parsers and serializers in raptor can handle different MIME Types with different levels of quality (Q). A Q of 1.0 indicates that the parser or serializer will be able to read or write the full format with high quality, and it should be the prefered parser or serializer for that mime type. Lower Q values indicate either additional mime type support (for parsing) or less-preferred mime types (for serializing). A serializer typically has just 1 mime type of Q 1.0; the preferred type." +"\n" +, + iostr); + emit_end_section(iostr); + + emit_start_section("raptor-formats-types-by-parser", + "MIME Types by Parser", + iostr); + emit_start_desc_list(NULL, iostr); + for(i = 0; i < parsers_count; i++) { + emit_format_description(NULL, parsers[i], + iostr); + } + emit_end_desc_list(iostr); + emit_end_section(iostr); + + + /* MIME Types by serializer */ + emit_start_section("raptor-formats-types-by-serializer", + "MIME Types by Serializer", + iostr); + emit_start_desc_list(NULL, iostr); + for(i = 0; i < serializers_count; i++) { + emit_format_description(NULL, serializers[i], + iostr); + } + emit_end_desc_list(iostr); + emit_end_section(iostr); + + + /* MIME Types index */ + qsort(type_syntaxes, type_syntaxes_count, sizeof(type_syntax), + sort_type_syntax_by_mime_type); + + emit_start_section("raptor-formats-types-index", + "MIME Types Index", + iostr); + emit_start_desc_list(NULL, iostr); + if(1) { + const char* last_mime_type = NULL; + int last_start_index = -1; + for(i = 0; i < type_syntaxes_count; i++) { + const char *this_mime_type = type_syntaxes[i].mime_type; + + if(last_start_index < 0) { + last_mime_type = this_mime_type; + last_start_index = i; + continue; + } + /* continue if same mime type */ + if(!strcmp(last_mime_type, this_mime_type)) + continue; + + emit_format_to_syntax_list(iostr, type_syntaxes, + last_mime_type, last_start_index, i-1); + + last_mime_type = type_syntaxes[i].mime_type; + last_start_index = i; + } + + emit_format_to_syntax_list(iostr, type_syntaxes, + last_mime_type, last_start_index, i-1); + } + emit_end_desc_list(iostr); + emit_end_section(iostr); + + + + emit_footer(iostr); + + raptor_free_iostream(iostr); + iostr = NULL; + + /* success */ + rc = 0; + + tidy: + if(iostr) + raptor_free_iostream(iostr); + + if(parsers) + free(parsers); + + if(serializers) + free(serializers); + + if(type_syntaxes) + free(type_syntaxes); + + if(world) + raptor_free_world(world); + + return rc; +} diff --git a/scripts/fix-bison.pl b/scripts/fix-bison.pl new file mode 100755 index 0000000..2327a7a --- /dev/null +++ b/scripts/fix-bison.pl @@ -0,0 +1,107 @@ +#!/usr/bin/perl +# +# Format output code generated by bison +# +# Usage: +# bison -b foo_parser -p foo_parser_ -d -v foo_parser.y +# perl fix-bison.pl foo_parser.tab.c +# +# Copyright (C) 2004-2014, David Beckett http://www.dajobe.org/ +# Copyright (C) 2004, University of Bristol, UK http://www.bristol.ac.uk/ +# + +my $seen_yyerrlab1=0; +my $syntax_error_has_default=0; +my $line_offset=1; # #line directives always refer to the NEXT line + +my $extension = '.bak'; + +sub fix($) +{ + my ($file) = @_; + my $backup = $file . $extension; + rename($file, $backup); + open(IN, "$backup"); + open(OUT, ">$file"); + + while() { + # Remove code that causes a warning + if(/Suppress GCC warning that yyerrlab1/) { + do { + $_ = ; + $line_offset--; # skipped a line + } while (!/^\#endif/); + $line_offset--; # skipped a line + next; + } + + $seen_yyerrlab1=1 if /goto yyerrlab1/; + + s/^yyerrlab1:// unless $seen_yyerrlab1; + + # Do not use macro name for a temporary variable + s/unsigned int yylineno = /unsigned int yylineno_tmp = /; + s/yyrule - 1, yylineno\)/yyrule - 1, yylineno_tmp\)/; + + # Do not (re)define prototypes that the system did better + if(m%^void \*malloc\s*\(%) { + $line_offset--; # skipped a line + next; + } + if(m%^void free\s*\(%) { + $line_offset--; # skipped a line + next; + } + + # syntax error handler will have a default case already in Bison 3.0.5+ + $syntax_error_has_default=1 if /default: \/\* Avoid compiler warnings. \*\//; + + if(m%^\# undef YYCASE_$% and $syntax_error_has_default==0) { + # Add a default value for yyformat on Bison <3.0.5, for coverity CID 10838 + my $line=$_; + print OUT qq{ default: yyformat = YY_("syntax error");\n}; + $line_offset++; # extra line + print OUT $line; + next; + } + + if(m%yysyntax_error_status = YYSYNTAX_ERROR%) { + # Set yytoken to non-negative value for coverity CID 29259 + my $line=$_; + print OUT qq{if(yytoken < 0) yytoken = YYUNDEFTOK;\n}; + $line_offset++; # extra line + print OUT $line; + next; + } + + # Suppress warnings about empty declarations + s/(^static int .*_init_globals.*);$/$1/; + + # Remove always false condition + if(m%if \(/\*CONSTCOND\*/ 0\)%) { + $line_offset--; # skipped a line + $_ = ; + $line_offset--; # skipped a line + next; + } + + # Remove always false condition; this macro is #defined to 0 + if(m%if \(yytable_value_is_error \(yyn\)\)%) { + $line_offset--; # skipped a line + $_ = ; + $line_offset--; # skipped a line + next; + } + + # Fixup pending filename renaming, see above. + # Fix line numbers. + my $line=$. +$line_offset; + s/^(\#line) \d+ (.*\.c)/$1 $line $2/; + + print OUT; + } +} + +for my $file (@ARGV) { + fix $file; +} diff --git a/scripts/fix-flex.pl b/scripts/fix-flex.pl new file mode 100755 index 0000000..785864e --- /dev/null +++ b/scripts/fix-flex.pl @@ -0,0 +1,154 @@ +#!/usr/bin/perl +# +# Format output generated by flex 2.5.31 +# +# Usage: +# flex -o$output $input +# perl fix-flex $output > $tmp +# mv $tmp $output +# +# (C) Copyright 2004-2014 Dave Beckett http://www.dajobe.org/ +# (C) Copyright 2004 University of Bristol +# + +my $line_offset = 1; # #line directives always refer to the NEXT line + +print <<'EOT'; +#ifdef HAVE_CONFIG_H +#include +#endif + +EOT +$line_offset += 4; # added 4 lines above to output + +my $debug = 0; + +# Lexer symbol prefix such as 'turtle_lexer_' +my $prefix = undef; +# Current function or undef if out of function +my $cur_function = undef; +# State for current function for rules to use. +my(%fn_state); + +while(<>) { + # find lexer prefix + if(!defined($prefix) && /^void\s*(.+?)restart\s*\(.*;$/) { + $prefix = $1; + warn "$.: Lexer prefix $prefix\n" + if $debug > 0; + } + + # Remove generated yy_fatal_error declaration and definition to avoid warnings about unused/non-defined static function + # declaration + if(/^static void( yynoreturn)? yy_fatal_error\s*\(.*\)\s*\;\s*$/) { + $line_offset--; # skipped 1 line + next; + } + # definition + if(/^static void( yynoreturn)? yy_fatal_error\s*\(.*\)\s*[^\;]\s*$/) { + do { + $_=<>; + $line_offset--; # skipped 1 line + } while(!/^}/); + $line_offset--; # skipped 1 line + next; + } + + # Replace calls to yy_fatal_error("msg", yyscanner) to YY_FATAL_ERROR("msg") macro + s/(^\s*)yy_fatal_error\s*\(\s*(\".*\")\s*,\s*yyscanner\s*\)/$1YY_FATAL_ERROR($2)/; + + # flex has %option nounistd however it does not work in 2.5.31 + # It is safe to add yet another wrapper. + if(m%^(\#include \)$%) { + $_=<<"EOT"; +#ifndef YY_NO_UNISTD_H +$1 +#endif +EOT + $line_offset += 2; # added 2 lines to output + } + + # Fix .[ch] line references because we have added lines to it + my $line = $. + $line_offset; + s/^#line \d+ (\".*\.[ch]\")/#line $line $1/; + + # Fix signed / unsigned comparison gcc 4.x warning: + # int n : in the macro YY_INPUT definition + # (size_t)num_to_read : which is silly since num_to_read is an int! + s/yyg->yy_n_chars, \(size_t\) num_to_read \)/yyg->yy_n_chars, num_to_read \)/; + + + # Match prefixed functions and a couple of static ones starting yy_ + if(!defined($cur_function) && /^.*?((?:${prefix}|yy_)\w+)\s+\((.*)$/) { + my($f,$rest)=($1,$2); + if($rest !~ /;$/) { + $cur_function=$1; + warn "$.: Now in $cur_function: $_\n" + if $debug > 1; + %fn_state=(); + } + } elsif(defined($cur_function) && /^\}/) { + warn "$.: End of $cur_function\n" + if $debug > 1; + $cur_function = undef; + %fn_state=(); + } + + # Fix declaration of signed 'i' operating over range of yy_size_t + if($cur_function eq $prefix."_scan_bytes") { + s/int i;/yy_size_t i;/; + } + + # Add $prefix_cleanup() call at the end of $prefix_lex_destroy() + # find the start of lex_destroy function definition and capture prefix + # look for lexer_free(yyscanner, yyscanner) statement within the function and place the cleanup call before it + if($cur_function eq $prefix."lex_destroy") { + if(/(^\s*)(${prefix}free\s*\(\s*yyscanner\s*,\s*yyscanner\s*\)\s*\;)\s*$/) { + $_=<<"EOT"; +$1/* clean up leaks if any before freeing yyscanner */ +$1${prefix}cleanup(yyscanner); +$1$2 +EOT + $line_offset += 2; # added 2 lines to output + } + } + + # Fix ${prefix}_scan_bytes to take a yy_size_t len arg, not int. + # declaration + s/(${prefix}_scan_bytes|yy_scan_bytes)\s+\( const char \*bytes, int len , yyscan_t yyscanner \);/\1 \( const char \*bytes, yy_size_t len , yyscan_t yyscanner \);/; + # definition + s/^YY_BUFFER_STATE (${prefix}_scan_bytes|yy_scan_bytes)\s+\(const char \* yybytes, int _yybytes_len , yyscan_t yyscanner\)/YY_BUFFER_STATE \1 \(const char \* yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner\)/; + + if($cur_function eq $prefix."_switch_to_buffer" || + $cur_function eq $prefix."restart" || + $cur_function eq $prefix."push_buffer_state") { + if(!exists($fn_state{'seen_ensure'})) { + s%(^\s*if\s*\(\s*!\s*)YY_CURRENT_BUFFER(\s*\)\s*\{.*$)%${1}yyg->yy_buffer_stack${2}%; + if(m%^\s*${prefix}ensure_buffer_stack\s*\(%) { + $fn_state{'seen_ensure'} = 1; + } + } else { + # In condition with whitespace + s%(\s+)YY_CURRENT_BUFFER(\s+)%${1}YY_CURRENT_BUFFER_LVALUE${2}%; + # In parameter or condition + s%([,\(])YY_CURRENT_BUFFER([,\)])%${1}YY_CURRENT_BUFFER_LVALUE${2}%; + } + } + + if($cur_function eq 'yy_get_next_buffer') { + if(!exists($fn_state{'seen_yyinput'}) && + m%^\s*YY_INPUT\(%) { + $fn_state{'seen_yyinput'} = 1; + } elsif(exists($fn_state{'seen_yyinput'})) { + # Remove dead code after YY_INPUT - which is a return NULL + s%^\s*YY_CURRENT_BUFFER_LVALUE->yy_n_chars\s*=\s*yyg->yy_n_chars;%%; + } + } + + if($cur_function eq $prefix.'pop_buffer_state') { + # Change last if use of YY_CURRENT_BUFFER macro to unconditional value + s%^(\s*if \(\s*)YY_CURRENT_BUFFER(\s*\)\s*\{.*)$%${1}YY_CURRENT_BUFFER_LVALUE${2}%; + } + + print; +} diff --git a/scripts/fix-groff-xhtml.pl b/scripts/fix-groff-xhtml.pl new file mode 100755 index 0000000..00d587a --- /dev/null +++ b/scripts/fix-groff-xhtml.pl @@ -0,0 +1,64 @@ +#!/usr/bin/perl +# +# Format XHTML generated by groff -Thtml (via tidy) for websites +# +# Usage: groff -Thtml -P-l something.man | tidy -asxml ... | perl fix-groff-xhtml.pl OUTPUT-FILE +# +# (C) Copyright 2003-2014 Dave Beckett +# + +use strict; +use File::Basename; + +my $progname=basename $0; + +my $raptor_title="Raptor RDF Parser Toolkit"; +my $redland_title="Redland RDF Application Framework"; +my $rasqal_title="Rasqal RDF Query Library"; + +die "USAGE: $progname OUTPUT-FILE\n" if @ARGV < 1; + +my $doc_title; + +my($file)=@ARGV; + +open(OUT, ">$file") or die "$progname: Cannot create $file - $!\n"; +open(IN, "-"); +while() { + + s%libraptor%$raptor_title - Raptor API%; + s%

libraptor

%

$raptor_title - Raptor API

%; + + s%rapper%$raptor_title - Raptor RDF parser utility%; + s%

rapper

%

$raptor_title - Raptor RDF parser utility

%; + + s%rdfproc%$redland_title - Redland RDF processor utility%; + s%

rdfproc

%

$redland_title - Redland RDF processor utility

%; + + s%librasqal%$rasqal_title - Rasqal API%; + s%

librasqal

%

$rasqal_title - Rasqal API

%; + + s%roqet%$rasqal_title - Rasqal RDF parser utility%; + s%

roqet

%

$rasqal_title - Rasqal RDF parser utility

%; + + next if /^]*>%%; + + # This is not xhtml + s% cols="\d+" % %; + + s%(name|id)="([^"]+)"%my($at,$val)=($1,$2); $val =~ s/ /_/g; qq{$at="$val"};%eg; + + s%(Dave Beckett|Institute for Learning and Research Technology .ILRT.|University of Bristol) (?:- |)(http://[^<]+)%$1%; + + my $year=1900+(localtime)[5]; + print OUT <<"EOT" if m%^%; + +

Copyright 2002-$year Dave Beckett
2002-2005 University of Bristol

+ +EOT + print OUT; +} +close(IN); +close(OUT); diff --git a/scripts/fix-gtkdoc-header.pl b/scripts/fix-gtkdoc-header.pl new file mode 100755 index 0000000..df73ccc --- /dev/null +++ b/scripts/fix-gtkdoc-header.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl -w +# +# Edit main header so that gtk-doc is happy about it +# +# USAGE: +# perl fix-gtkc-header.pl < header.h > header.i +# +# Copyright (C) 2010-2014, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + +while(<>) { + # Remove trailing macros + s{RAPTOR_PRINTF_FORMAT\(\d+, \d+\);}{;}; + + # gtk-doc hates const in some places + s/const char\* const\* (\w+)/const char\* $1/; + + # and unsigned char + s/const unsigned char \*(\w+)/const char \* $1/; + + # and unsigned char in a handler typedef + s/typedef unsigned char\s*\*/typedef char \*/; + + print; +} diff --git a/scripts/process-changes.pl b/scripts/process-changes.pl new file mode 100755 index 0000000..3c4dbbc --- /dev/null +++ b/scripts/process-changes.pl @@ -0,0 +1,844 @@ +#!/usr/bin/perl -w +# +# Format changes TSV file +# +# USAGE: +# process-changes.pl [OPTIONS] CHANGES-TSV-FILE +# +# Copyright (C) 2010-2011, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +# Example of Format (9 fields): +# OLD VERSIONtype | enum | OLD RETURNOLD NAMEOLD ARGSNEW VERSIONtype | enum | NEW RETURNNEW NAMENEW ARGSNOTES +# +# Functions +# 0.9.21voidoldfunctionor-(args)0.9.22voidnewfunctionor-(args)NOTES +# Types +# 0.9.21typeoldtypenameor--0.9.22typenewtypeor--NOTES +# Enums +# 0.9.21enumoldenumvalueor--0.9.22enumnewenumvalueor--NOTES +# + +use strict; +use File::Basename; +use IO::File; +use Getopt::Long; +use Pod::Usage; + +our $program = basename $0; + +our $nbsp = ' '; + +our $id_prefix = undef; + +our $raptor_v1_version = '1.4.21'; + +sub print_start_chapter_as_docbook_xml($$$$) { + my($fh, $id, $title, $intro_para)=@_; + + print $fh <<"EOT"; + + +$title + +$intro_para +EOT + +} + +sub print_end_chapter_as_docbook_xml($) +{ + my($fh)=@_; + print $fh <<"EOT"; + + +EOT +} + + + +sub print_docbook_xml($$$@) { + my($fh, $id, $title, @list)=@_; + + print $fh <<"EOT"; +
+$title +EOT + + print $fh <<"EOT"; +
+EOT +} + +sub print_start_section_as_docbook_xml($$$) { + my($fh, $id, $title)=@_; + + print $fh <<"EOT"; +
+$title + +EOT +} + + +sub format_function_name_as_docbook_xml($) { + my($name)=@_; + + my $escaped_name = $name; $escaped_name =~ s/_/-/g; + return qq{$name}; +} + +sub format_type_name_as_docbook_xml($) { + my($name)=@_; + + my $escaped_name = $name; $escaped_name =~ s/_/-/g; + if($escaped_name =~ /^[-A-Z0-9]+$/) { + $escaped_name .= ":CAPS"; + } + return qq{$name}; +} + +sub format_enum_name_as_docbook_xml($) { + my($name)=@_; + + my $escaped_name = $name; $escaped_name =~ s/_/-/g; + if($escaped_name =~ /^[-A-Z0-9]+$/) { + $escaped_name .= ":CAPS"; + } + return qq{$name}; +} + + +sub format_fn_sig($$$$$) { + my($format_name, $show_sig, $fn_return, $fn_name, $fn_args)=@_; + my $formatted_name = $format_name ? format_function_name_as_docbook_xml($fn_name) : $fn_name; + + return $show_sig ? $fn_return . " " . $formatted_name . $fn_args + : $formatted_name; +} + +sub format_notes($$) { + my($is_inline,$notes)=@_; + + if ($notes eq '') { + return $is_inline ? '' : $nbsp; + } + + $notes =~ s{#((?:raptor|librdf|rasqal)\w+)}{format_type_name_as_docbook_xml($1)}ge; + $notes =~ s{#?((?:RAPTOR|LIBRDF|RASQAL)_\w+)}{format_enum_name_as_docbook_xml($1)}ge; + $notes =~ s{((?:raptor|librdf|rasqal)_\w+?)\(}{format_function_name_as_docbook_xml($1)."("}ge; + + return $is_inline ? "- " . $notes : $notes; +} + +sub print_functions_list_as_docbook_xml($$$$@) { + my($fh, $title, $format_name, $show_sig, @list)=@_; + + return if !@list; + + print $fh <<"EOT"; + + Functions +EOT + + print $fh " $title\n" + if defined $title; + + # Sort by fn_name name + @list = sort { $a->[1] cmp $b->[1] } @list; + + for my $item (@list) { + my($fn_return, $fn_name, $fn_args, $notes) = @$item; + my $formatted_fn = format_fn_sig($format_name, $show_sig, + $fn_return, $fn_name, $fn_args); + $notes = format_notes(1, $notes); + print $fh " $formatted_fn $notes\n"; + } + print $fh <<"EOT"; + +EOT +} + + +sub format_type_sig($$) { + my($format_name, $type_name)=@_; + return $format_name ? format_type_name_as_docbook_xml($type_name) : $type_name; +} + +sub format_enum_sig($$) { + my($format_name, $enum_name)=@_; + return $format_name ? format_enum_name_as_docbook_xml($enum_name) : $enum_name; +} + + +sub print_types_list_as_docbook_xml($$$$@) { + my($fh, $title, $format_name, $show_sig, @list)=@_; + + return if !@list; + + print $fh <<"EOT"; + + Types +EOT + + print $fh " $title\n" + if defined $title; + + # Sort by type name + @list = sort { $a->[0] cmp $b->[0] } @list; + + for my $item (@list) { + my($type_name, $notes) = @$item; + my $formatted_fn = format_type_sig($format_name, $type_name); + $notes = format_notes(1, $notes); + print $fh " $formatted_fn $notes\n"; + } + print $fh <<"EOT"; + +EOT +} + + +sub print_enums_list_as_docbook_xml($$$$@) { + my($fh, $title, $format_name, $show_sig, @list)=@_; + + return if !@list; + + print $fh <<"EOT"; + + Enums and Constants +EOT + + print $fh " $title\n" + if defined $title; + + # Sort by format name + @list = sort { $a->[0] cmp $b->[0] } @list; + + for my $item (@list) { + my($enum_name, $notes) = @$item; + my $formatted_fn = format_enum_sig($format_name, $enum_name); + $notes = format_notes(1, $notes); + print $fh " $formatted_fn $notes\n"; + } + print $fh <<"EOT"; + +EOT +} + + +sub print_renamed_functions_as_docbook_xml($$$$@) { + my($fh, $title, $old_function_header, $new_function_header, @list)=@_; + + return if !@list; + + print $fh <<"EOT"; + +EOT + + print $fh " \n" + if defined $title; + + # Sort by from name + @list = sort { $a->[0] cmp $b->[0] } @list; + + print $fh <<"EOT"; + + + + + + + + +EOT + for my $item (@list) { + my($from, $to, $notes) = @$item; + my $formatted_name = format_function_name_as_docbook_xml($to); + + $notes = format_notes(0, $notes); + print $fh " \n \n \n"; + } + print $fh <<"EOT"; + +
$title
$old_function_header$new_function_headerNotes
$from $formatted_name $notes
+EOT + +} + +sub print_changed_functions_as_docbook_xml($$$$@) { + my($fh, $title, $old_function_header, $new_function_header, @list)=@_; + + return if !@list; + + print $fh <<"EOT"; + +EOT + + print $fh " \n" + if defined $title; + + print $fh <<"EOT"; + + + + + + + + +EOT + for my $item (@list) { + my($old_fn_return, $old_fn_name, $old_fn_args, + $new_fn_return, $new_fn_name, $new_fn_args, $notes) = @$item; + + my $old_formatted_fn = format_fn_sig(0, 1, + $old_fn_return, $old_fn_name, $old_fn_args); + + my $new_formatted_fn = format_fn_sig(1, 1, + $new_fn_return, $new_fn_name, $new_fn_args); + + $notes = format_notes(0, $notes); + print $fh " \n \n \n"; + } + print $fh <<"EOT"; + +
$title
$old_function_header$new_function_headerNotes
$old_formatted_fn $new_formatted_fn $notes
+EOT + +} + +sub print_end_section_as_docbook_xml($) +{ + my($fh)=@_; + print $fh <<"EOT"; + +
+EOT +} + + +sub print_changed_types_as_docbook_xml($$$$@) { + my($fh, $title, $old_type_header, $new_type_header, @list)=@_; + + return if !@list; + + print $fh <<"EOT"; + +EOT + + print $fh " \n" + if defined $title; + + # Sort by old type name + @list = sort { $a->[0] cmp $b->[0] } @list; + + print $fh <<"EOT"; + + + + + + + + +EOT + for my $item (@list) { + my($old_type_name, $new_type_name, $notes) = @$item; + + my $old_formatted_type = format_type_sig(0, $old_type_name); + my $new_formatted_type = format_type_sig(1, $new_type_name); + + $notes = format_notes(0, $notes); + print $fh " \n \n \n"; + } + print $fh <<"EOT"; + +
$title
$old_type_header$new_type_headerNotes
$old_formatted_type $new_formatted_type $notes
+EOT + +} + + +sub print_renamed_enums_as_docbook_xml($$$$@) { + my($fh, $title, $old_enum_header, $new_enum_header, @list)=@_; + + return if !@list; + + print $fh <<"EOT"; + +EOT + + print $fh " \n" + if defined $title; + + # Sort by from name + @list = sort { $a->[0] cmp $b->[0] } @list; + + print $fh <<"EOT"; + + + + + + + + +EOT + for my $item (@list) { + my($from, $to, $notes) = @$item; + my $formatted_name = format_enum_name_as_docbook_xml($to); + + $notes = format_notes(0, $notes); + print $fh " \n \n \n"; + } + print $fh <<"EOT"; + +
$title
$old_enum_header$new_enum_headerNotes
$from $formatted_name $notes
+EOT + +} + + +sub print_deletes_as_perl_script($$@) { + my($out_fh, $title, @names) = @_; + + print $out_fh "\n# $title\n"; + + for my $entry (@names) { + my($name,$note)=@$entry; + $note ||= ''; + print $out_fh qq{s|^(.*$name.*)\$|/\\* WARNING: $name - deleted. $note \\*/ \$1|g;\n}; + } +} + + +sub print_renames_as_perl_script($$$@) { + my($out_fh, $title, $is_function, @names) = @_; + + print $out_fh "\n# $title\n"; + + for my $entry (@names) { + my($from, $to, $note)=@$entry; + $note ||= ''; + my $suffix = ($is_function ? '\\(' : ''); + print $out_fh qq{s|$from$suffix|$to$suffix|g;\n}; + } +} + + +sub print_changes_as_perl_script($$@) { + my($out_fh, $title, @names) = @_; + + print $out_fh "\n# $title\n"; + + for my $entry (@names) { + my($from, $to, $note)=@$entry; + $note ||= ''; + print $out_fh qq{s|^(.*)($from)(.*)\$|/\\* WARNING: $from. $note \\*/ \$\{1\}$to\$\{3\}|g;\n}; + } +} + + +sub print_statement_field_renames_as_perl_script($) { + my($out_fh)=@_; + # These are tricky / tedious to deal with entirely by hand but + # the replacement for subject and object can only be determined by a person + my(%statement_field_maps) = ( + 'subject' => 'subject.value.uri or subject.value.blank.string /* WARNING: must choose one */', + 'subject_type' => 'subject.type', + 'predicate' => 'predicate.value.uri', + 'predicate_type' => 'predicate.type', + 'object' => 'object.value.uri or object.value.literal.string or object.value.blank.string /* WARNING: must choose one */', + 'object_type' => 'object.type', + 'object_literal_datatype' => 'object.value.literal.datatype', + 'object_literal_language' => 'object.value.literal.language' + ); + print $out_fh "\n# Replace statement fields with term fields.\n"; + while(my($old,$new) = each %statement_field_maps) { + print $out_fh qq{s|->$old|->$new|g;\n}; + } + print $out_fh "\n"; +} + + +sub to_id($) { + my $id=shift; + + $id =~ s/\W/-/g; + $id =~ s/\-+/-/g; + $id =~ s/^\-//; + $id =~ s/\-$//; + + return $id; +} + + +# main + +my $docbook_xml_file = undef; +my $upgrade_script_file = undef; +my $usage = undef; + +GetOptions( + 'docbook-xml=s' => \$docbook_xml_file, + 'upgrade-script=s' => \$upgrade_script_file, + 'package=s' => \$id_prefix, + 'help|h|?' => \$usage +) || pod2usage(2); + +pod2usage(-verbose => 2) + if $usage; + +# Arguments +our($package, $file) = @ARGV; + +$id_prefix ||= $package; + +# Read in data + +our $expected_n_fields = 9; + +# "$old-$new" versions in order +our(@version_pairs); +# and seen +our(%version_pairs_seen); + +# Hashes keyed by $version_pair. Value is array of descriptive +# arrays specific to each type +my(%new_functions); +my(%deleted_functions); +my(%renamed_functions); +my(%changed_functions); + +my(%new_types); +my(%deleted_types); +my(%changed_types); + +my(%new_enums); +my(%deleted_enums); +my(%renamed_enums); + +open(IN, "<$file") or die "$program: Cannot read $file - $!\n"; +while() { + chomp; + + next if /^#/; + + my(@fields)=split(/\t/); + my $actual_n_fields=scalar(@fields); + die "$program: Bad line has $actual_n_fields fields expected $expected_n_fields $.: $_\n" + unless $actual_n_fields == $expected_n_fields; + + if($fields[1] eq 'type') { + my($old_ver, $dummy1, $old_name, $old_args, $new_ver, $dummy2, $new_name, $new_args,$notes)=@fields; + + my $version_pair = $old_ver."-".$new_ver; + if(!$version_pairs_seen{$version_pair}) { + push(@version_pairs, [$old_ver, $new_ver]); + $version_pairs_seen{$version_pair} = 1; + } + + $notes = '' if $notes eq '-'; + + if($old_name eq '-') { + push(@{$new_types{$version_pair}}, [$new_name, $notes]); + } elsif($new_name eq '-') { + push(@{$deleted_types{$version_pair}}, [$old_name, $notes]); + } elsif(($old_name eq $new_name) && $notes eq '') { + # same + } else { + # renamed and maybe something else changed - in the notes + push(@{$changed_types{$version_pair}}, [$old_name, $new_name, $notes]); + } + + } elsif($fields[1] eq 'enum') { + my($old_ver, $dummy1, $old_name, $old_args, $new_ver, $dummy2, $new_name, $new_args,$notes)=@fields; + + my $version_pair = $old_ver."-".$new_ver; + if(!$version_pairs_seen{$version_pair}) { + push(@version_pairs, [$old_ver, $new_ver]); + $version_pairs_seen{$version_pair} = 1; + } + + $notes = '' if $notes eq '-'; + + if($old_name eq '-') { + push(@{$new_enums{$version_pair}}, [$new_name, $notes]); + } elsif($new_name eq '-') { + push(@{$deleted_enums{$version_pair}}, [$old_name, $notes]); + } elsif(($old_name eq $new_name) && $notes eq '') { + # same + } else { + push(@{$renamed_enums{$version_pair}}, [$old_name, $new_name, $notes]); + } + + } else { + my($old_ver, $old_return, $old_name, $old_args, $new_ver, $new_return, $new_name, $new_args,$notes)=@fields; + + my $version_pair = $old_ver."-".$new_ver; + if(!$version_pairs_seen{$version_pair}) { + push(@version_pairs, [$old_ver, $new_ver]); + $version_pairs_seen{$version_pair} = 1; + } + + $notes = '' if $notes eq '-'; + + if($old_name eq '-') { + push(@{$new_functions{$version_pair}}, [$new_return, $new_name, $new_args, $notes]); + } elsif($new_name eq '-') { + push(@{$deleted_functions{$version_pair}}, [$old_return, $old_name, $old_args, $notes]); + } elsif($old_return eq $new_return && $old_name eq $new_name && + $old_args eq $new_args) { + # same + warn "$program: Line records no function change old: $old_return $old_name $old_args to new: $new_return $new_name $new_args\n$.: $_\n" + if $old_ver ne $raptor_v1_version; + } elsif($old_return eq $new_return && $old_name ne $new_name && + $old_args eq $new_args) { + # renamed but nothing else changed + push(@{$renamed_functions{$version_pair}}, [$old_name, $new_name, $notes]); + } else { + # something changed - args and/or return + push(@{$changed_functions{$version_pair}}, [$old_return, $old_name, $old_args, $new_return, $new_name, $new_args, $notes]); + } + } +} +close(IN); + + + +sub version_for_sort($) { + map { sprintf("%02d", $_) } split(/\./, $_[0]); +} + +# Write Docbook XML output + +if(defined $docbook_xml_file) { + my $out_fh = new IO::File; + $out_fh->open(">$docbook_xml_file"); + + our $intro_title = "API Changes"; + our $intro_para = <<"EOT"; +This chapter describes the API changes for $package. +EOT + + print_start_chapter_as_docbook_xml($out_fh, + $id_prefix.'-changes', + $intro_title, + $intro_para); + + + print_start_section_as_docbook_xml($out_fh, + $id_prefix.'-changes-intro', + "Introduction"); + print $out_fh <<"EOT"; + +The following sections describe the changes in the API between +versions including additions, deletions, renames (retaining the same +number of parameters, types and return value type) and more complex +changes to functions, types, enums and constants. + +EOT + + print_end_section_as_docbook_xml($out_fh); + + # Sort by new version, newest first + for my $vp (sort { version_for_sort($b->[1]) cmp version_for_sort($a->[1]) } @version_pairs) { + my($old_version, $new_version)= @$vp; + my $id = to_id($old_version) . "-to-" . to_id($new_version); + + my $version_pair = $old_version."-".$new_version; + + print_start_section_as_docbook_xml($out_fh, + $id_prefix.'-changes-'.$id, + "Changes between $package $old_version and $new_version"); + + my(@f, @t, @e); + @f = @{$new_functions{$version_pair} || []}; + @t = @{$new_types{$version_pair} || []}; + @e = @{$new_enums{$version_pair} || []}; + + if(@f || @t || @e) { + print_start_section_as_docbook_xml($out_fh, + $id_prefix.'-changes-new-'.$id, + "New functions, types, enums and constants"); + print_functions_list_as_docbook_xml($out_fh, + undef, 1, 1, @f); + print_types_list_as_docbook_xml($out_fh, + undef, 1, 1, @t); + print_enums_list_as_docbook_xml($out_fh, + undef, 1, 1, @e); + print_end_section_as_docbook_xml($out_fh); + } + + @f = @{$deleted_functions{$version_pair} || []}; + @t = @{$deleted_types{$version_pair} || []}; + @e = @{$deleted_enums{$version_pair} || []}; + if(@f || @t || @e) { + print_start_section_as_docbook_xml($out_fh, + $id_prefix.'-changes-deleted-'.$id, + "Deleted functions, types, enums and constants"); + print_functions_list_as_docbook_xml($out_fh, + undef, 0, 0, @f); + print_types_list_as_docbook_xml($out_fh, + undef, 0, 1, @t); + print_enums_list_as_docbook_xml($out_fh, + undef, 0, 1, @e); + print_end_section_as_docbook_xml($out_fh); + } + + + @f = @{$renamed_functions{$version_pair} || []}; + @e = @{$renamed_enums{$version_pair} || []}; + if(@f || @e) { + print_start_section_as_docbook_xml($out_fh, + $id_prefix.'-changes-renamed-'.$id, + "Renamed functions, enums and constants"); + print_renamed_functions_as_docbook_xml($out_fh, + undef, + "$old_version function", + "$new_version function", + @f); + print_renamed_enums_as_docbook_xml($out_fh, + undef, + "$old_version enum / constant", + "$new_version enum / constant", + @e); + print_end_section_as_docbook_xml($out_fh); + } + + @f = @{$changed_functions{$version_pair} || []}; + @t = @{$changed_types{$version_pair} || []}; + if(@f || @t) { + print_start_section_as_docbook_xml($out_fh, + $id_prefix.'-changes-changed-'.$id, + "Changed functions and types"); + print_changed_functions_as_docbook_xml($out_fh, + undef, + "$old_version function", + "$new_version function", + @f); + print_changed_types_as_docbook_xml($out_fh, + undef, + "$old_version type", + "$new_version type", + @t); + print_end_section_as_docbook_xml($out_fh); + } + + print_end_section_as_docbook_xml($out_fh); + + } # end pair of old/new versions + + print_end_chapter_as_docbook_xml($out_fh); + + $out_fh->close; +} + + +# Write Upgrade script output + +if(defined $upgrade_script_file) { + my $out_fh = new IO::File; + $out_fh->open(">$upgrade_script_file"); + + print $out_fh "#!/usr/bin/perl -pi~\n"; + + for my $vp (@version_pairs) { + my($old_version, $new_version)= @$vp; + + my $version_pair = $old_version."-".$new_version; + + print $out_fh "# Perl script to upgrade $package $old_version to $new_version\n\n"; + + print_statement_field_renames_as_perl_script($out_fh); + + my(@f, @t, @e); + + @f = @{$deleted_functions{$version_pair} || []}; + @t = @{$deleted_types{$version_pair} || []}; + @e = @{$deleted_enums{$version_pair} || []}; + + print_deletes_as_perl_script($out_fh, 'Deleted functions', + (map { [ $_->[1], $_->[3] ] } @f)); + + print_deletes_as_perl_script($out_fh, 'Deleted types', + @t); + + print_deletes_as_perl_script($out_fh, 'Deleted enums and constants', + @e); + + @f = @{$renamed_functions{$version_pair} || []}; + @e = @{$renamed_enums{$version_pair} || []}; + print_renames_as_perl_script($out_fh, 'Renamed functions', 1, + @f); + + print_renames_as_perl_script($out_fh, 'Renamed enums and constants', 0, + @e); + + @f = @{$changed_functions{$version_pair} || []}; + @t = @{$changed_types{$version_pair} || []}; + print_changes_as_perl_script($out_fh, 'Changed functions', + (map { [ $_->[1], $_->[4], $_->[6] ] } @f)); + + print_changes_as_perl_script($out_fh, 'Changed types', + @t); + + } # end of version pair loop + + $out_fh->close; +} + + +exit 0; + + +__END__ + +=head1 NAME + +process-changes - turn changes TSV into files + +=head1 SYNOPSIS + +process-changes [options] PACKAGE-NAME TSV-FILE + +=head1 OPTIONS + +=over 8 + +=item B<--help> + +Give command help summary. + +=item B<--docbook-xml> DOCBOOK-XML + +Set the output docbook XML file + +=item B<--upgrade-script> UPGRADE-SCRIPT-PL + +Set the output perl script to upgrade the function and type names +where possible. + +=back + +=head1 DESCRIPTION + +Turn a package's changes TSV file into docbook XML. + +=cut diff --git a/scripts/rdfcompare b/scripts/rdfcompare new file mode 100755 index 0000000..6430bf4 --- /dev/null +++ b/scripts/rdfcompare @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Compare two RDF graphs +# +# Needs an external utility to do a true graph compare. +# + + +PROGRAM=`basename $0` + +CMP=cmp +DIFF=diff + +tmpdiff=/tmp/rdfcompare$$ + +if [ $# -lt 1 ] ; then + echo "$PROGRAM: compare two RDF graphs for isomorphism" 1>&2 + echo "USAGE: $PROGRAM RDF-FILE-1 RDF-FILE-2" 1>&2 + echo "where both files are RDF graphs serialized as N-Triples" 1>&2 + exit 0 +fi + +# Try a simple compare first +$CMP $1 $2 2>&1 +status=$? +if test $status -eq 0; then + exit 0 +fi + +echo "$program: Doing an RDF graph compare" 1>&2 + +if test "X$NTC" != X; then + $NTC $1 $2 > $tmpdiff 2>&1 + status=$? + if test $status != 0; then + $DIFF -u $1 $2 + fi +elif test "X$JENAROOT" != X; then + RDFCOMPARE="$JENAROOT/bin/rdfcompare" + + $RDFCOMPARE $1 $2 N-TRIPLE N-TRIPLE + status=$? + if test $status != 0; then + $DIFF -u $1 $2 + fi +else + $DIFF -u $1 $2 > $tmpdiff + status=$? + if test $status != 0; then + cat $tmpdiff + rm $tmpdiff + fi +fi + +exit $status diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..41829e0 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,413 @@ +# raptor/src/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# +# Changes 01/20/15 J Kyle Medley +# + +IF(RAPTOR_PARSER_RDFA) + INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa) +ENDIF(RAPTOR_PARSER_RDFA) + +# ** Parser sources ** + +# XML parser enabled +IF(RAPTOR_PARSER_RDFXML) + SET(raptor_parser_rdfxml_sources raptor_rdfxml.c) + SET(raptor_libxml_libs ${LIBXML2_LIBRARIES}) +ENDIF(RAPTOR_PARSER_RDFXML) + +# N triples parser enabled +IF(RAPTOR_PARSER_NTRIPLES OR RAPTOR_PARSER_NQUADS) + SET(raptor_parser_ntriples_nquads_sources ntriples_parse.c raptor_ntriples.c) +ENDIF(RAPTOR_PARSER_NTRIPLES OR RAPTOR_PARSER_NQUADS) + +# Turtle parser enabled +IF(RAPTOR_PARSER_TURTLE OR RAPTOR_PARSER_TRIG) + SET(raptor_parser_turtle_trig_sources +# turtle_common.h + ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.c +# turtle_lexer.h + ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c +# turtle_parser.h + ) + + # Generate the turtle parser + ADD_CUSTOM_TARGET(turtle_tables_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.tab.c) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.tab.c + COMMAND ${BISON_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c ${CMAKE_CURRENT_SOURCE_DIR}/turtle_parser.y + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/turtle_parser.y) + + ADD_CUSTOM_TARGET(turtle_parser_tgt DEPENDS turtle_tables_tgt ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.h) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c + COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/fix-bison.pl ${CMAKE_CURRENT_BINARY_DIR}/turtle_parser.c + DEPENDS turtle_tables_tgt) + + # Generate the turtle lexer + ADD_CUSTOM_TARGET(turtle_flex_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.t) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.t + COMMAND ${FLEX_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.t ${CMAKE_CURRENT_SOURCE_DIR}/turtle_lexer.l + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/turtle_lexer.l) + + ADD_CUSTOM_TARGET(turtle_lexer_tgt DEPENDS turtle_flex_tgt) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.c + COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/fix-flex.pl ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.t > ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.c + COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/fix-flex.pl ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.h > ${CMAKE_CURRENT_BINARY_DIR}/t + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/t ${CMAKE_CURRENT_BINARY_DIR}/turtle_lexer.h + DEPENDS turtle_flex_tgt) +ENDIF(RAPTOR_PARSER_TURTLE OR RAPTOR_PARSER_TRIG) + +# RSS feed parser enabled +IF(RAPTOR_PARSER_RSS OR RAPTOR_SERIALIZER_RSS_1_0) + SET(raptor_rss_common_sources raptor_rss_common.c raptor_rss.h) +ENDIF(RAPTOR_PARSER_RSS OR RAPTOR_SERIALIZER_RSS_1_0) +IF(RAPTOR_PARSER_RSS) + SET(raptor_parser_rss_sources raptor_rss.c) + SET(raptor_libxml_libs ${LIBXML2_LIBRARIES}) +ENDIF(RAPTOR_PARSER_RSS) + +# GRDDL parser enabled +IF(RAPTOR_PARSER_GRDDL) + SET(raptor_parser_grddl_sources raptor_grddl.c) + SET(raptor_libxml_libs ${LIBXML2_LIBRARIES}) + SET(raptor_libxslt_libs ${LIBXSLT_LIBRARIES}) +ENDIF(RAPTOR_PARSER_GRDDL) + +# Guess which parser to use based on context +IF(RAPTOR_PARSER_GUESS) + SET(raptor_parser_guess_sources raptor_guess.c) +ENDIF(RAPTOR_PARSER_GUESS) + +# RDFA parser enabled +IF(RAPTOR_PARSER_RDFA) + SET(raptor_parser_rdfa_sources raptor_librdfa.c) +ENDIF(RAPTOR_PARSER_RDFA) + +# JSON parser enabled +IF(RAPTOR_PARSER_JSON) + SET(raptor_parser_json_sources raptor_json.c) +ENDIF(RAPTOR_PARSER_JSON) + +# ** Serializers ** + +IF(RAPTOR_SERIALIZER_RDFXML) + SET(raptor_serializer_rdfxml_sources raptor_serialize_rdfxml.c) +ENDIF(RAPTOR_SERIALIZER_RDFXML) +IF(RAPTOR_SERIALIZER_NTRIPLES OR RAPTOR_SERIALIZER_NQUADS) + SET(raptor_serializer_ntriples_nquads_sources raptor_serialize_ntriples.c) +ENDIF(RAPTOR_SERIALIZER_NTRIPLES OR RAPTOR_SERIALIZER_NQUADS) +IF(RAPTOR_SERIALIZER_RDFXML_ABBREV OR RAPTOR_SERIALIZER_TURTLE OR RAPTOR_SERIALIZER_MKR) + SET(raptor_serializer_abbrev_sources raptor_abbrev.c) +ENDIF(RAPTOR_SERIALIZER_RDFXML_ABBREV OR RAPTOR_SERIALIZER_TURTLE OR RAPTOR_SERIALIZER_MKR) +IF(RAPTOR_SERIALIZER_RDFXML_ABBREV) + SET(raptor_serializer_rdfxml_abbrev_sources raptor_serialize_rdfxmla.c) +ENDIF(RAPTOR_SERIALIZER_RDFXML_ABBREV) +IF(RAPTOR_SERIALIZER_TURTLE OR RAPTOR_SERIALIZER_MKR) + SET(raptor_serializer_turtle_sources raptor_serialize_turtle.c) +ENDIF(RAPTOR_SERIALIZER_TURTLE OR RAPTOR_SERIALIZER_MKR) +IF(RAPTOR_SERIALIZER_RSS_1_0) + SET(raptor_serializer_rss_1_0_sources raptor_serialize_rss.c) +ENDIF(RAPTOR_SERIALIZER_RSS_1_0) +IF(RAPTOR_SERIALIZER_DOT) + SET(raptor_serializer_dot_sources raptor_serialize_dot.c) +ENDIF(RAPTOR_SERIALIZER_DOT) +IF(RAPTOR_SERIALIZER_HTML) + SET(raptor_serializer_html_sources raptor_serialize_html.c) +ENDIF(RAPTOR_SERIALIZER_HTML) +IF(RAPTOR_SERIALIZER_JSON) + SET(raptor_serializer_json_sources raptor_serialize_json.c) + SET(raptor_yajl_libs ${YAJL_LIBRARIES}) +ENDIF(RAPTOR_SERIALIZER_JSON) + +IF(RAPTOR_WWW STREQUAL "curl") + SET(raptor_www_sources raptor_www_curl.c) + SET(raptor_www_libs ${CURL_LIBRARIES}) +ELSEIF(RAPTOR_WWW STREQUAL "fetch") + SET(raptor_www_sources raptor_www_libfetch.c) + #SET(raptor_www_libs ${FETCH_LIBRARIES}) +ELSEIF(RAPTOR_WWW STREQUAL "xml") + SET(raptor_www_sources raptor_www_libxml.c) + SET(raptor_www_libs ${LIBXML2_LIBRARIES}) +ENDIF(RAPTOR_WWW STREQUAL "curl") + +IF(RAPTOR_XML STREQUAL "libxml") + SET(raptor_libxml_sources raptor_libxml.c) + SET(raptor_libxml_libs ${LIBXML2_LIBRARIES}) +ENDIF(RAPTOR_XML STREQUAL "libxml") +IF(RAPTOR_PARSER_RDFA) + SET(raptor_librdfa_sources + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/context.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/curie.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/iri.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/language.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/lists.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/namespace.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/rdfa.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/rdfa_utils.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/strtok_r.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/subject.c + ${CMAKE_CURRENT_SOURCE_DIR}/../librdfa/triple.c +# ${CMAKE_SOURCE_DIR}/librdfa/rdfa.h +# ${CMAKE_SOURCE_DIR}/librdfa/rdfa_utils.h +# ${CMAKE_SOURCE_DIR}/librdfa/strtok_r.h + ) +ENDIF(RAPTOR_PARSER_RDFA) + +IF(NOT HAVE_STRCASECMP AND NOT HAVE_STRICMP) + SET(raptor_strcasecmp_sources strcasecmp.c) +ENDIF(NOT HAVE_STRCASECMP AND NOT HAVE_STRICMP) + +IF(RAPTOR_PARSEDATE) + SET(raptor_parsedate_sources ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c) + + # Generate the date/time parser + ADD_CUSTOM_TARGET(parsedate_tables_tgt DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/parsedate.tab.c) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/parsedate.tab.c + COMMAND ${BISON_EXECUTABLE} -o ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c ${CMAKE_CURRENT_SOURCE_DIR}/parsedate.y + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/parsedate.y) + + ADD_CUSTOM_TARGET(parsedate_tgt DEPENDS parsedate_tables_tgt ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c ${CMAKE_CURRENT_BINARY_DIR}/parsedate.h) + ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c + COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/fix-bison.pl ${CMAKE_CURRENT_BINARY_DIR}/parsedate.c + DEPENDS parsedate_tables_tgt) +ENDIF(RAPTOR_PARSEDATE) + +IF(BUILD_SHARED_LIBS) + SET(LIB_TYPE SHARED) +ELSE(BUILD_SHARED_LIBS) + SET(LIB_TYPE STATIC) +ENDIF(BUILD_SHARED_LIBS) + +ADD_LIBRARY(raptor2 ${LIB_TYPE} + raptor_avltree.c + raptor_concepts.c + raptor_escaped.c + raptor_general.c + raptor_iostream.c + raptor_json_writer.c + raptor_locator.c + raptor_log.c + raptor_memstr.c + raptor_namespace.c + raptor_option.c + raptor_parse.c + raptor_qname.c + raptor_rfc2396.c + raptor_sax2.c + raptor_sequence.c + raptor_serialize.c + raptor_set.c + raptor_statement.c + raptor_stringbuffer.c + raptor_syntax_description.c + raptor_term.c + raptor_turtle_writer.c + raptor_unicode.c + raptor_uri.c + raptor_www.c + raptor_xml.c + raptor_xml_writer.c + snprintf.c + sort_r.c + turtle_common.c + ${raptor_parser_rdfxml_sources} + ${raptor_parser_ntriples_nquads_sources} + ${raptor_parser_turtle_trig_sources} + ${raptor_rss_common_sources} + ${raptor_parser_rss_sources} + ${raptor_parser_grddl_sources} + ${raptor_parser_guess_sources} + ${raptor_parser_rdfa_sources} + ${raptor_parser_json_sources} + ${raptor_serializer_rdfxml_sources} + ${raptor_serializer_ntriples_nquads_sources} + ${raptor_serializer_abbrev_sources} + ${raptor_serializer_rdfxml_abbrev_sources} + ${raptor_serializer_turtle_sources} + ${raptor_serializer_rss_1_0_sources} + ${raptor_serializer_dot_sources} + ${raptor_serializer_html_sources} + ${raptor_serializer_json_sources} + ${raptor_www_sources} + ${raptor_libxml_sources} + ${raptor_librdfa_sources} + ${raptor_strcasecmp_sources} + ${raptor_parsedate_sources} +) +IF(RAPTOR_PARSER_TURTLE OR RAPTOR_PARSER_TRIG) + add_dependencies(raptor2 turtle_parser_tgt turtle_lexer_tgt) +ENDIF() +IF(RAPTOR_PARSEDATE) + add_dependencies(raptor2 parsedate_tgt) +ENDIF() + +TARGET_LINK_LIBRARIES(raptor2 + ${raptor_libxslt_libs} + ${raptor_libxml_libs} + ${raptor_yajl_libs} + ${raptor_www_libs} +) + +SET_TARGET_PROPERTIES( + raptor2 + PROPERTIES + COMPILE_DEFINITIONS "LIBRDFA_IN_RAPTOR;RAPTOR_INTERNAL;${LIBXML2_DEFINITIONS};${LIBXSLT_DEFINITIONS}" +) + +ADD_EXECUTABLE(turtle_lexer_test turtle_lexer.c) +TARGET_LINK_LIBRARIES(turtle_lexer_test raptor2) + +IF(NOT WIN32 OR NOT BUILD_SHARED_LIBS) + # This currently cannot be built on Windows with DLL linkage + ADD_EXECUTABLE(turtle_parser_test turtle_parser.c) + TARGET_LINK_LIBRARIES(turtle_parser_test raptor2) + SET_TARGET_PROPERTIES( + turtle_parser_test + PROPERTIES + COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE" + ) +ENDIF(NOT WIN32 OR NOT BUILD_SHARED_LIBS) + +ADD_EXECUTABLE(raptor_parse_test raptor_parse.c) +TARGET_LINK_LIBRARIES(raptor_parse_test raptor2) +ADD_TEST(raptor_parse_test raptor_parse_test) + +ADD_EXECUTABLE(raptor_rfc2396_test raptor_rfc2396.c) +TARGET_LINK_LIBRARIES(raptor_rfc2396_test raptor2) +ADD_TEST(raptor_rfc2396_test raptor_rfc2396_test) + +ADD_EXECUTABLE(raptor_uri_test raptor_uri.c) +TARGET_LINK_LIBRARIES(raptor_uri_test raptor2) +ADD_TEST(raptor_uri_test raptor_uri_test) + +ADD_EXECUTABLE(raptor_namespace_test raptor_namespace.c) +TARGET_LINK_LIBRARIES(raptor_namespace_test raptor2) +ADD_TEST(raptor_namespace_test raptor_namespace_test) + +ADD_EXECUTABLE(strcasecmp_test strcasecmp.c) +TARGET_LINK_LIBRARIES(strcasecmp_test raptor2) +ADD_TEST(strcasecmp_test strcasecmp_test) + +ADD_EXECUTABLE(raptor_www_test raptor_www_test.c) +TARGET_LINK_LIBRARIES(raptor_www_test raptor2) +ADD_TEST(raptor_www_test raptor_www_test) + +ADD_EXECUTABLE(raptor_sequence_test raptor_sequence.c) +TARGET_LINK_LIBRARIES(raptor_sequence_test raptor2) +ADD_TEST(raptor_sequence_test raptor_sequence_test) + +ADD_EXECUTABLE(raptor_stringbuffer_test raptor_stringbuffer.c) +TARGET_LINK_LIBRARIES(raptor_stringbuffer_test raptor2) +ADD_TEST(raptor_stringbuffer_test raptor_stringbuffer_test) + +ADD_EXECUTABLE(raptor_iostream_test raptor_iostream.c) +TARGET_LINK_LIBRARIES(raptor_iostream_test raptor2) +ADD_TEST(raptor_iostream_test raptor_iostream_test) + +ADD_EXECUTABLE(raptor_xml_writer_test raptor_xml_writer.c) +TARGET_LINK_LIBRARIES(raptor_xml_writer_test raptor2) +ADD_TEST(raptor_xml_writer_test raptor_xml_writer_test) + +ADD_EXECUTABLE(raptor_turtle_writer_test raptor_turtle_writer.c) +TARGET_LINK_LIBRARIES(raptor_turtle_writer_test raptor2) +ADD_TEST(raptor_turtle_writer_test raptor_turtle_writer_test) + +ADD_EXECUTABLE(raptor_avltree_test raptor_avltree.c) +TARGET_LINK_LIBRARIES(raptor_avltree_test raptor2) +ADD_TEST(raptor_avltree_test raptor_avltree_test) + +ADD_EXECUTABLE(raptor_term_test raptor_term.c) +TARGET_LINK_LIBRARIES(raptor_term_test raptor2) +ADD_TEST(raptor_term_test raptor_term_test) + +ADD_EXECUTABLE(raptor_permute_test raptor_permute_test.c) +TARGET_LINK_LIBRARIES(raptor_permute_test raptor2) +ADD_TEST(raptor_permute_test raptor_permute_test) + +ADD_EXECUTABLE(raptor_snprintf_test snprintf.c) +TARGET_LINK_LIBRARIES(raptor_snprintf_test raptor2) +ADD_TEST(raptor_snprintf_test raptor_snprintf_test) + +ADD_EXECUTABLE(raptor_sort_r_test sort_r.c) +TARGET_LINK_LIBRARIES(raptor_sort_r_test raptor2) +ADD_TEST(raptor_sort_r_test raptor_sort_r_test) + +SET_TARGET_PROPERTIES( + turtle_lexer_test + #turtle_parser_test + raptor_parse_test + raptor_rfc2396_test + raptor_uri_test + raptor_namespace_test + strcasecmp_test + raptor_www_test + raptor_sequence_test + raptor_stringbuffer_test + raptor_iostream_test + raptor_xml_writer_test + raptor_turtle_writer_test + raptor_avltree_test + raptor_term_test + raptor_permute_test + raptor_snprintf_test + raptor_sort_r_test + PROPERTIES + COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE" +) + +IF(RAPTOR_PARSER_RDFXML) + ADD_EXECUTABLE(raptor_set_test raptor_set.c) + TARGET_LINK_LIBRARIES(raptor_set_test raptor2) + ADD_TEST(raptor_set_test raptor_set_test) + + ADD_EXECUTABLE(raptor_xml_test raptor_xml.c) + TARGET_LINK_LIBRARIES(raptor_xml_test raptor2) + ADD_TEST(raptor_xml_test raptor_xml_test) + + SET_TARGET_PROPERTIES( + raptor_set_test + raptor_xml_test + PROPERTIES + COMPILE_DEFINITIONS "RAPTOR_INTERNAL;STANDALONE" + ) +ENDIF(RAPTOR_PARSER_RDFXML) + +# Generate pkg-config metadata file +# +FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/raptor2.pc +"prefix=${CMAKE_INSTALL_PREFIX} +exec_prefix=\${prefix} +libdir=${CMAKE_INSTALL_FULL_LIBDIR} +includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}/raptor2 + +Name: Raptor RDF Parsing Library +Description: RDF Parser Toolkit Library +Version: ${VERSION} +Libs: -L\${libdir} -lraptor2 +Libs.private: ${raptor_libxslt_libs} ${raptor_libxml_libs} +Cflags: -I\${includedir} +") + +INSTALL(FILES + raptor.h + ${CMAKE_CURRENT_BINARY_DIR}/raptor2.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/raptor2 +) + +INSTALL(FILES + ${CMAKE_CURRENT_BINARY_DIR}/raptor2.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig +) + +INSTALL( + TARGETS raptor2 + EXPORT Raptor2Config + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) + +INSTALL(EXPORT Raptor2Config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake) + +# end raptor/src/CMakeLists.txt diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..15ea200 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,350 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor libraptor +# +# Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + + +lib_LTLIBRARIES = libraptor2.la + +pkginclude_HEADERS = raptor.h +nodist_pkginclude_HEADERS = raptor2.h + +noinst_HEADERS = raptor_internal.h + +TESTS=raptor_parse_test raptor_rfc2396_test raptor_uri_test \ +raptor_namespace_test strcasecmp_test raptor_www_test \ +raptor_sequence_test raptor_stringbuffer_test \ +raptor_uri_win32_test raptor_iostream_test raptor_xml_writer_test \ +raptor_turtle_writer_test raptor_avltree_test raptor_term_test \ +raptor_permute_test raptor_snprintf_test raptor_sort_r_test +if RAPTOR_PARSER_RDFXML +TESTS += raptor_set_test raptor_xml_test +endif + +CLEANFILES=$(TESTS) \ +turtle_lexer_test turtle_parser_test \ +*.plist \ +git-version.h + +MAINTAINERCLEANFILES=turtle_lexer.c turtle_lexer.h \ +turtle_parser.c turtle_parser.h turtle_parser.output + +# Memory debugging +MEM=@MEM@ +MEM_LIBS=@MEM_LIBS@ + +AM_CPPFLAGS = $(MEM) + +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) + +BUILT_SOURCES = turtle_lexer.c turtle_lexer.h turtle_parser.c turtle_parser.h + +libraptor2_la_SOURCES = raptor_parse.c raptor_serialize.c \ +raptor_rfc2396.c raptor_uri.c raptor_log.c raptor_locator.c \ +raptor_namespace.c raptor_qname.c \ +raptor_option.c raptor_general.c raptor_unicode.c \ +raptor_www.c \ +raptor_statement.c \ +raptor_term.c \ +raptor_sequence.c raptor_stringbuffer.c raptor_iostream.c \ +raptor_xml.c raptor_xml_writer.c raptor_set.c turtle_common.c \ +raptor_turtle_writer.c raptor_avltree.c snprintf.c \ +raptor_json_writer.c raptor_memstr.c raptor_concepts.c \ +raptor_syntax_description.c \ +raptor_sax2.c raptor_escaped.c \ +raptor_ntriples.c \ +sort_r.c sort_r.h ssort.h +if RAPTOR_XML_LIBXML +libraptor2_la_SOURCES += raptor_libxml.c +endif +if RAPTOR_PARSER_RDFXML +libraptor2_la_SOURCES += raptor_rdfxml.c +endif +if RAPTOR_PARSER_TURTLE +libraptor2_la_SOURCES += turtle_lexer.c turtle_lexer.h turtle_parser.c turtle_parser.h turtle_common.h +else +if RAPTOR_PARSER_TRIG +libraptor2_la_SOURCES += turtle_lexer.c turtle_lexer.h turtle_parser.c turtle_parser.h turtle_common.h +endif +endif +if RAPTOR_PARSER_NTRIPLES +libraptor2_la_SOURCES += ntriples_parse.c +else +if RAPTOR_PARSER_NQUADS +libraptor2_la_SOURCES += ntriples_parse.c +endif +endif +if RAPTOR_RSS_COMMON +libraptor2_la_SOURCES += raptor_rss_common.c raptor_rss.h +endif +if RAPTOR_PARSER_RSS +libraptor2_la_SOURCES += raptor_rss.c +endif +if RAPTOR_PARSER_GRDDL +libraptor2_la_SOURCES += raptor_grddl.c +endif +if RAPTOR_PARSER_GUESS +libraptor2_la_SOURCES += raptor_guess.c +endif +if RAPTOR_PARSER_RDFA +libraptor2_la_SOURCES += raptor_librdfa.c +endif +if RAPTOR_PARSER_JSON +libraptor2_la_SOURCES += raptor_json.c +endif +if RAPTOR_SERIALIZER_RDFXML +libraptor2_la_SOURCES += raptor_serialize_rdfxml.c +endif + +if RAPTOR_SERIALIZER_NTRIPLES +libraptor2_la_SOURCES += raptor_serialize_ntriples.c +else +if RAPTOR_SERIALIZER_NQUADS +libraptor2_la_SOURCES += raptor_serialize_ntriples.c +endif +endif + +#raptor_abbrev.c required by both turtle and xml-abbrev +if RAPTOR_SERIALIZER_RDFXML_ABBREV +libraptor2_la_SOURCES += raptor_abbrev.c +else +if RAPTOR_SERIALIZER_TURTLE +libraptor2_la_SOURCES += raptor_abbrev.c +else +if RAPTOR_SERIALIZER_MKR +libraptor2_la_SOURCES += raptor_abbrev.c +endif +endif +endif + +if RAPTOR_SERIALIZER_RDFXML_ABBREV +libraptor2_la_SOURCES += raptor_serialize_rdfxmla.c +endif +if RAPTOR_SERIALIZER_TURTLE +libraptor2_la_SOURCES += raptor_serialize_turtle.c +else +if RAPTOR_SERIALIZER_MKR +libraptor2_la_SOURCES += raptor_serialize_turtle.c +endif +endif +if RAPTOR_SERIALIZER_RSS_1_0 +libraptor2_la_SOURCES += raptor_serialize_rss.c +endif +if RAPTOR_SERIALIZER_DOT +libraptor2_la_SOURCES += raptor_serialize_dot.c +endif +if RAPTOR_SERIALIZER_HTML +libraptor2_la_SOURCES += raptor_serialize_html.c +endif +if RAPTOR_SERIALIZER_JSON +libraptor2_la_SOURCES += raptor_serialize_json.c +endif +if STRCASECMP +libraptor2_la_SOURCES += strcasecmp.c +endif +if PARSEDATE +libraptor2_la_SOURCES += parsedate.c parsedate.h +BUILT_SOURCES += parsedate.c parsedate.h +endif + + +libraptor2_la_LIBADD = + +if LIBRDFA +AM_CPPFLAGS += -DLIBRDFA_IN_RAPTOR -I$(top_srcdir)/librdfa +libraptor2_la_LIBADD += $(top_builddir)/librdfa/librdfa.la +endif + +libraptor2_la_LDFLAGS = -version-info @RAPTOR_LIBTOOL_VERSION@ \ +@RAPTOR_LDFLAGS@ $(MEM_LIBS) +libraptor2_la_LIBADD += @LTLIBOBJS@ + + +EXTRA_DIST=\ +CMakeLists.txt \ +raptor_config_cmake.h.in \ +raptor_permute_test.c \ +raptor_www_test.c \ +raptor_nfc_test.c \ +raptor_win32.c \ +$(man_MANS) \ +turtle_lexer.l turtle_parser.y \ +parsedate.y + + +nodist_libraptor2_la_SOURCES = + +if MAINTAINER_MODE +nodist_libraptor2_la_SOURCES += git-version.h + +# raptor_parse.c is the first source file so this ensures +# git-version.h is created before it and before the actual file +# dependencies are calculated as a side-effect of compilation +raptor_parse.c: git-version.h + +# Actually it needs turtle_parser.h but nevermind +turtle_lexer.c: $(srcdir)/turtle_lexer.l turtle_parser.c $(top_srcdir)/scripts/fix-flex.pl + $(AM_V_GEN) \ + $(LEX) -o$@ $(srcdir)/turtle_lexer.l; \ + for file in turtle_lexer.c turtle_lexer.h; do \ + $(PERL) $(top_srcdir)/scripts/fix-flex.pl $$file > turtle_lexer.t || rm -f $$file; \ + mv -f turtle_lexer.t $$file; \ + done + +turtle_lexer.h: turtle_lexer.c ; @exit 0 + +turtle_parser.c: $(srcdir)/turtle_parser.y $(top_srcdir)/scripts/fix-bison.pl + $(AM_V_GEN) \ + $(BISON) -o $@ $(srcdir)/turtle_parser.y; \ + $(PERL) $(top_srcdir)/scripts/fix-bison.pl $@ + +turtle_parser.h: turtle_parser.c ; @exit 0 + +parsedate.c: $(srcdir)/parsedate.y $(top_srcdir)/scripts/fix-bison.pl + $(AM_V_GEN) \ + $(BISON) -o $@ $(srcdir)/parsedate.y; \ + $(PERL) $(top_srcdir)/scripts/fix-bison.pl $@ + +parsedate.h: parsedate.c ; @exit 0 + +endif + +# Actually it needs turtle_parser.h but nevermind +turtle_lexer_test: $(srcdir)/turtle_lexer.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/turtle_lexer.c libraptor2.la $(LIBS) + +turtle_parser_test: $(srcdir)/turtle_parser.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/turtle_parser.c libraptor2.la $(LIBS) + +raptor_parse_test: $(srcdir)/raptor_parse.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_parse.c libraptor2.la $(LIBS) + +raptor_rfc2396_test: $(srcdir)/raptor_rfc2396.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_rfc2396.c libraptor2.la $(LIBS) + +raptor_uri_test: $(srcdir)/raptor_uri.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_uri.c libraptor2.la $(LIBS) + +raptor_uri_win32_test: $(srcdir)/raptor_uri.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE -DWIN32_URI_TEST $(srcdir)/raptor_uri.c libraptor2.la $(LIBS) + +raptor_namespace_test: $(srcdir)/raptor_namespace.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_namespace.c libraptor2.la $(LIBS) + +strcasecmp_test: $(srcdir)/strcasecmp.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/strcasecmp.c libraptor2.la $(LIBS) + +raptor_www_test: $(srcdir)/raptor_www_test.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_www_test.c libraptor2.la $(LIBS) + +raptor_set_test: $(srcdir)/raptor_set.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_set.c libraptor2.la $(LIBS) + +raptor_xml_test: $(srcdir)/raptor_xml.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_xml.c libraptor2.la $(LIBS) + +raptor_sequence_test: $(srcdir)/raptor_sequence.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_sequence.c libraptor2.la $(LIBS) + +raptor_stringbuffer_test: $(srcdir)/raptor_stringbuffer.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_stringbuffer.c libraptor2.la $(LIBS) + +raptor_nfc_test: $(srcdir)/raptor_nfc_test.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_nfc_test.c libraptor2.la $(LIBS) + +raptor_iostream_test: $(srcdir)/raptor_iostream.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_iostream.c libraptor2.la $(LIBS) + +raptor_xml_writer_test: $(srcdir)/raptor_xml_writer.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_xml_writer.c libraptor2.la $(LIBS) + +raptor_turtle_writer_test: $(srcdir)/raptor_turtle_writer.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_turtle_writer.c libraptor2.la $(LIBS) + +raptor_avltree_test: $(srcdir)/raptor_avltree.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_avltree.c libraptor2.la $(LIBS) + +raptor_term_test: $(srcdir)/raptor_term.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_term.c libraptor2.la $(LIBS) + +raptor_permute_test: $(srcdir)/raptor_permute_test.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_permute_test.c libraptor2.la $(LIBS) + +raptor_snprintf_test: $(srcdir)/snprintf.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/snprintf.c libraptor2.la $(LIBS) + +raptor_sort_r_test: $(srcdir)/sort_r.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/sort_r.c libraptor2.la $(LIBS) + +$(top_builddir)/librdfa/librdfa.la: + cd $(top_builddir)/librdfa && $(MAKE) librdfa.la + +# Some people need a little help ;-) +test: check + + +if MAINTAINER_MODE +git-version.h: check-version + +# Always run this in maintainer mode but do not always change git-version.h +.PHONY: check-version +check-version: + @file="git-version.h" ; \ + if test -d ../.git; then \ + git_version=`cd .. && git rev-parse HEAD`; \ + else \ + git_version="unknown"; \ + fi; \ + $(RECHO) "GIT version $$git_version"; \ + tmp="$$file.tmp"; \ + $(RECHO) "#define GIT_VERSION \"$$git_version\"" > $$tmp; \ + if test -f $$file; then \ + if cmp $$file $$tmp >/dev/null 2>&1; then \ + rm $$tmp; \ + else \ + mv $$tmp $$file; \ + fi; \ + else \ + mv $$tmp $$file; \ + fi + +# Run Clang static analyzer over sources. +analyze: $(SOURCES) + @list='$(SOURCES)'; \ + result=0; \ + for file in $$list; do \ + if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ + $(RECHO) "Analyzing $$file"; \ + $(ANALYZE_COMMAND) $(srcdir)/$$file; \ + status=$$?; \ + if test $$status != 0; then \ + result=1; \ + fi; \ + fi; \ + done; \ + set -e; exit $$result +endif diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..5c6cac9 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,1807 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor libraptor +# +# Copyright (C) 2000-2011, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@RAPTOR_PARSER_RDFXML_TRUE@am__append_1 = raptor_set_test raptor_xml_test +@RAPTOR_XML_LIBXML_TRUE@am__append_2 = raptor_libxml.c +@RAPTOR_PARSER_RDFXML_TRUE@am__append_3 = raptor_rdfxml.c +@RAPTOR_PARSER_TURTLE_TRUE@am__append_4 = turtle_lexer.c turtle_lexer.h turtle_parser.c turtle_parser.h turtle_common.h +@RAPTOR_PARSER_TRIG_TRUE@@RAPTOR_PARSER_TURTLE_FALSE@am__append_5 = turtle_lexer.c turtle_lexer.h turtle_parser.c turtle_parser.h turtle_common.h +@RAPTOR_PARSER_NTRIPLES_TRUE@am__append_6 = ntriples_parse.c +@RAPTOR_PARSER_NQUADS_TRUE@@RAPTOR_PARSER_NTRIPLES_FALSE@am__append_7 = ntriples_parse.c +@RAPTOR_RSS_COMMON_TRUE@am__append_8 = raptor_rss_common.c raptor_rss.h +@RAPTOR_PARSER_RSS_TRUE@am__append_9 = raptor_rss.c +@RAPTOR_PARSER_GRDDL_TRUE@am__append_10 = raptor_grddl.c +@RAPTOR_PARSER_GUESS_TRUE@am__append_11 = raptor_guess.c +@RAPTOR_PARSER_RDFA_TRUE@am__append_12 = raptor_librdfa.c +@RAPTOR_PARSER_JSON_TRUE@am__append_13 = raptor_json.c +@RAPTOR_SERIALIZER_RDFXML_TRUE@am__append_14 = raptor_serialize_rdfxml.c +@RAPTOR_SERIALIZER_NTRIPLES_TRUE@am__append_15 = raptor_serialize_ntriples.c +@RAPTOR_SERIALIZER_NQUADS_TRUE@@RAPTOR_SERIALIZER_NTRIPLES_FALSE@am__append_16 = raptor_serialize_ntriples.c + +#raptor_abbrev.c required by both turtle and xml-abbrev +@RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE@am__append_17 = raptor_abbrev.c +@RAPTOR_SERIALIZER_RDFXML_ABBREV_FALSE@@RAPTOR_SERIALIZER_TURTLE_TRUE@am__append_18 = raptor_abbrev.c +@RAPTOR_SERIALIZER_MKR_TRUE@@RAPTOR_SERIALIZER_RDFXML_ABBREV_FALSE@@RAPTOR_SERIALIZER_TURTLE_FALSE@am__append_19 = raptor_abbrev.c +@RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE@am__append_20 = raptor_serialize_rdfxmla.c +@RAPTOR_SERIALIZER_TURTLE_TRUE@am__append_21 = raptor_serialize_turtle.c +@RAPTOR_SERIALIZER_MKR_TRUE@@RAPTOR_SERIALIZER_TURTLE_FALSE@am__append_22 = raptor_serialize_turtle.c +@RAPTOR_SERIALIZER_RSS_1_0_TRUE@am__append_23 = raptor_serialize_rss.c +@RAPTOR_SERIALIZER_DOT_TRUE@am__append_24 = raptor_serialize_dot.c +@RAPTOR_SERIALIZER_HTML_TRUE@am__append_25 = raptor_serialize_html.c +@RAPTOR_SERIALIZER_JSON_TRUE@am__append_26 = raptor_serialize_json.c +@STRCASECMP_TRUE@am__append_27 = strcasecmp.c +@PARSEDATE_TRUE@am__append_28 = parsedate.c parsedate.h +@PARSEDATE_TRUE@am__append_29 = parsedate.c parsedate.h +@LIBRDFA_TRUE@am__append_30 = -DLIBRDFA_IN_RAPTOR -I$(top_srcdir)/librdfa +@LIBRDFA_TRUE@am__append_31 = $(top_builddir)/librdfa/librdfa.la +@MAINTAINER_MODE_TRUE@am__append_32 = git-version.h +subdir = src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ + $(pkginclude_HEADERS) $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = raptor_config.h +CONFIG_CLEAN_FILES = raptor2.h +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" \ + "$(DESTDIR)$(pkgincludedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libraptor2_la_DEPENDENCIES = $(am__append_31) @LTLIBOBJS@ +am__libraptor2_la_SOURCES_DIST = raptor_parse.c raptor_serialize.c \ + raptor_rfc2396.c raptor_uri.c raptor_log.c raptor_locator.c \ + raptor_namespace.c raptor_qname.c raptor_option.c \ + raptor_general.c raptor_unicode.c raptor_www.c \ + raptor_statement.c raptor_term.c raptor_sequence.c \ + raptor_stringbuffer.c raptor_iostream.c raptor_xml.c \ + raptor_xml_writer.c raptor_set.c turtle_common.c \ + raptor_turtle_writer.c raptor_avltree.c snprintf.c \ + raptor_json_writer.c raptor_memstr.c raptor_concepts.c \ + raptor_syntax_description.c raptor_sax2.c raptor_escaped.c \ + raptor_ntriples.c sort_r.c sort_r.h ssort.h raptor_libxml.c \ + raptor_rdfxml.c turtle_lexer.c turtle_lexer.h turtle_parser.c \ + turtle_parser.h turtle_common.h ntriples_parse.c \ + raptor_rss_common.c raptor_rss.h raptor_rss.c raptor_grddl.c \ + raptor_guess.c raptor_librdfa.c raptor_json.c \ + raptor_serialize_rdfxml.c raptor_serialize_ntriples.c \ + raptor_abbrev.c raptor_serialize_rdfxmla.c \ + raptor_serialize_turtle.c raptor_serialize_rss.c \ + raptor_serialize_dot.c raptor_serialize_html.c \ + raptor_serialize_json.c strcasecmp.c parsedate.c parsedate.h +@RAPTOR_XML_LIBXML_TRUE@am__objects_1 = raptor_libxml.lo +@RAPTOR_PARSER_RDFXML_TRUE@am__objects_2 = raptor_rdfxml.lo +@RAPTOR_PARSER_TURTLE_TRUE@am__objects_3 = turtle_lexer.lo \ +@RAPTOR_PARSER_TURTLE_TRUE@ turtle_parser.lo +@RAPTOR_PARSER_TRIG_TRUE@@RAPTOR_PARSER_TURTLE_FALSE@am__objects_4 = turtle_lexer.lo \ +@RAPTOR_PARSER_TRIG_TRUE@@RAPTOR_PARSER_TURTLE_FALSE@ turtle_parser.lo +@RAPTOR_PARSER_NTRIPLES_TRUE@am__objects_5 = ntriples_parse.lo +@RAPTOR_PARSER_NQUADS_TRUE@@RAPTOR_PARSER_NTRIPLES_FALSE@am__objects_6 = ntriples_parse.lo +@RAPTOR_RSS_COMMON_TRUE@am__objects_7 = raptor_rss_common.lo +@RAPTOR_PARSER_RSS_TRUE@am__objects_8 = raptor_rss.lo +@RAPTOR_PARSER_GRDDL_TRUE@am__objects_9 = raptor_grddl.lo +@RAPTOR_PARSER_GUESS_TRUE@am__objects_10 = raptor_guess.lo +@RAPTOR_PARSER_RDFA_TRUE@am__objects_11 = raptor_librdfa.lo +@RAPTOR_PARSER_JSON_TRUE@am__objects_12 = raptor_json.lo +@RAPTOR_SERIALIZER_RDFXML_TRUE@am__objects_13 = \ +@RAPTOR_SERIALIZER_RDFXML_TRUE@ raptor_serialize_rdfxml.lo +@RAPTOR_SERIALIZER_NTRIPLES_TRUE@am__objects_14 = \ +@RAPTOR_SERIALIZER_NTRIPLES_TRUE@ raptor_serialize_ntriples.lo +@RAPTOR_SERIALIZER_NQUADS_TRUE@@RAPTOR_SERIALIZER_NTRIPLES_FALSE@am__objects_15 = raptor_serialize_ntriples.lo +@RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE@am__objects_16 = \ +@RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE@ raptor_abbrev.lo +@RAPTOR_SERIALIZER_RDFXML_ABBREV_FALSE@@RAPTOR_SERIALIZER_TURTLE_TRUE@am__objects_17 = raptor_abbrev.lo +@RAPTOR_SERIALIZER_MKR_TRUE@@RAPTOR_SERIALIZER_RDFXML_ABBREV_FALSE@@RAPTOR_SERIALIZER_TURTLE_FALSE@am__objects_18 = raptor_abbrev.lo +@RAPTOR_SERIALIZER_RDFXML_ABBREV_TRUE@am__objects_19 = raptor_serialize_rdfxmla.lo +@RAPTOR_SERIALIZER_TURTLE_TRUE@am__objects_20 = \ +@RAPTOR_SERIALIZER_TURTLE_TRUE@ raptor_serialize_turtle.lo +@RAPTOR_SERIALIZER_MKR_TRUE@@RAPTOR_SERIALIZER_TURTLE_FALSE@am__objects_21 = raptor_serialize_turtle.lo +@RAPTOR_SERIALIZER_RSS_1_0_TRUE@am__objects_22 = \ +@RAPTOR_SERIALIZER_RSS_1_0_TRUE@ raptor_serialize_rss.lo +@RAPTOR_SERIALIZER_DOT_TRUE@am__objects_23 = raptor_serialize_dot.lo +@RAPTOR_SERIALIZER_HTML_TRUE@am__objects_24 = \ +@RAPTOR_SERIALIZER_HTML_TRUE@ raptor_serialize_html.lo +@RAPTOR_SERIALIZER_JSON_TRUE@am__objects_25 = \ +@RAPTOR_SERIALIZER_JSON_TRUE@ raptor_serialize_json.lo +@STRCASECMP_TRUE@am__objects_26 = strcasecmp.lo +@PARSEDATE_TRUE@am__objects_27 = parsedate.lo +am_libraptor2_la_OBJECTS = raptor_parse.lo raptor_serialize.lo \ + raptor_rfc2396.lo raptor_uri.lo raptor_log.lo \ + raptor_locator.lo raptor_namespace.lo raptor_qname.lo \ + raptor_option.lo raptor_general.lo raptor_unicode.lo \ + raptor_www.lo raptor_statement.lo raptor_term.lo \ + raptor_sequence.lo raptor_stringbuffer.lo raptor_iostream.lo \ + raptor_xml.lo raptor_xml_writer.lo raptor_set.lo \ + turtle_common.lo raptor_turtle_writer.lo raptor_avltree.lo \ + snprintf.lo raptor_json_writer.lo raptor_memstr.lo \ + raptor_concepts.lo raptor_syntax_description.lo raptor_sax2.lo \ + raptor_escaped.lo raptor_ntriples.lo sort_r.lo \ + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) $(am__objects_6) \ + $(am__objects_7) $(am__objects_8) $(am__objects_9) \ + $(am__objects_10) $(am__objects_11) $(am__objects_12) \ + $(am__objects_13) $(am__objects_14) $(am__objects_15) \ + $(am__objects_16) $(am__objects_17) $(am__objects_18) \ + $(am__objects_19) $(am__objects_20) $(am__objects_21) \ + $(am__objects_22) $(am__objects_23) $(am__objects_24) \ + $(am__objects_25) $(am__objects_26) $(am__objects_27) +am__objects_28 = +nodist_libraptor2_la_OBJECTS = $(am__objects_28) +libraptor2_la_OBJECTS = $(am_libraptor2_la_OBJECTS) \ + $(nodist_libraptor2_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +libraptor2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libraptor2_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/build/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = $(DEPDIR)/raptor_nfc_icu.Plo \ + $(DEPDIR)/raptor_www_curl.Plo \ + $(DEPDIR)/raptor_www_libfetch.Plo \ + $(DEPDIR)/raptor_www_libxml.Plo ./$(DEPDIR)/ntriples_parse.Plo \ + ./$(DEPDIR)/parsedate.Plo ./$(DEPDIR)/raptor_abbrev.Plo \ + ./$(DEPDIR)/raptor_avltree.Plo ./$(DEPDIR)/raptor_concepts.Plo \ + ./$(DEPDIR)/raptor_escaped.Plo ./$(DEPDIR)/raptor_general.Plo \ + ./$(DEPDIR)/raptor_grddl.Plo ./$(DEPDIR)/raptor_guess.Plo \ + ./$(DEPDIR)/raptor_iostream.Plo ./$(DEPDIR)/raptor_json.Plo \ + ./$(DEPDIR)/raptor_json_writer.Plo \ + ./$(DEPDIR)/raptor_librdfa.Plo ./$(DEPDIR)/raptor_libxml.Plo \ + ./$(DEPDIR)/raptor_locator.Plo ./$(DEPDIR)/raptor_log.Plo \ + ./$(DEPDIR)/raptor_memstr.Plo ./$(DEPDIR)/raptor_namespace.Plo \ + ./$(DEPDIR)/raptor_ntriples.Plo ./$(DEPDIR)/raptor_option.Plo \ + ./$(DEPDIR)/raptor_parse.Plo ./$(DEPDIR)/raptor_qname.Plo \ + ./$(DEPDIR)/raptor_rdfxml.Plo ./$(DEPDIR)/raptor_rfc2396.Plo \ + ./$(DEPDIR)/raptor_rss.Plo ./$(DEPDIR)/raptor_rss_common.Plo \ + ./$(DEPDIR)/raptor_sax2.Plo ./$(DEPDIR)/raptor_sequence.Plo \ + ./$(DEPDIR)/raptor_serialize.Plo \ + ./$(DEPDIR)/raptor_serialize_dot.Plo \ + ./$(DEPDIR)/raptor_serialize_html.Plo \ + ./$(DEPDIR)/raptor_serialize_json.Plo \ + ./$(DEPDIR)/raptor_serialize_ntriples.Plo \ + ./$(DEPDIR)/raptor_serialize_rdfxml.Plo \ + ./$(DEPDIR)/raptor_serialize_rdfxmla.Plo \ + ./$(DEPDIR)/raptor_serialize_rss.Plo \ + ./$(DEPDIR)/raptor_serialize_turtle.Plo \ + ./$(DEPDIR)/raptor_set.Plo ./$(DEPDIR)/raptor_statement.Plo \ + ./$(DEPDIR)/raptor_stringbuffer.Plo \ + ./$(DEPDIR)/raptor_syntax_description.Plo \ + ./$(DEPDIR)/raptor_term.Plo \ + ./$(DEPDIR)/raptor_turtle_writer.Plo \ + ./$(DEPDIR)/raptor_unicode.Plo ./$(DEPDIR)/raptor_uri.Plo \ + ./$(DEPDIR)/raptor_www.Plo ./$(DEPDIR)/raptor_xml.Plo \ + ./$(DEPDIR)/raptor_xml_writer.Plo ./$(DEPDIR)/snprintf.Plo \ + ./$(DEPDIR)/sort_r.Plo ./$(DEPDIR)/strcasecmp.Plo \ + ./$(DEPDIR)/turtle_common.Plo ./$(DEPDIR)/turtle_lexer.Plo \ + ./$(DEPDIR)/turtle_parser.Plo +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libraptor2_la_SOURCES) $(nodist_libraptor2_la_SOURCES) +DIST_SOURCES = $(am__libraptor2_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +HEADERS = $(nodist_pkginclude_HEADERS) $(noinst_HEADERS) \ + $(pkginclude_HEADERS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ + raptor_config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +AM_RECURSIVE_TARGETS = check recheck +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/build/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/raptor2.h.in \ + $(srcdir)/raptor_config.h.in $(top_srcdir)/build/depcomp \ + $(top_srcdir)/build/test-driver raptor_nfc_icu.c \ + raptor_www_curl.c raptor_www_libfetch.c raptor_www_libxml.c +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ + +# Memory debugging +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +lib_LTLIBRARIES = libraptor2.la +pkginclude_HEADERS = raptor.h +nodist_pkginclude_HEADERS = raptor2.h +noinst_HEADERS = raptor_internal.h +TESTS = raptor_parse_test raptor_rfc2396_test raptor_uri_test \ + raptor_namespace_test strcasecmp_test raptor_www_test \ + raptor_sequence_test raptor_stringbuffer_test \ + raptor_uri_win32_test raptor_iostream_test \ + raptor_xml_writer_test raptor_turtle_writer_test \ + raptor_avltree_test raptor_term_test raptor_permute_test \ + raptor_snprintf_test raptor_sort_r_test $(am__append_1) +CLEANFILES = $(TESTS) \ +turtle_lexer_test turtle_parser_test \ +*.plist \ +git-version.h + +MAINTAINERCLEANFILES = turtle_lexer.c turtle_lexer.h \ +turtle_parser.c turtle_parser.h turtle_parser.output + +AM_CPPFLAGS = $(MEM) $(am__append_30) +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) + +BUILT_SOURCES = turtle_lexer.c turtle_lexer.h turtle_parser.c \ + turtle_parser.h $(am__append_29) +libraptor2_la_SOURCES = raptor_parse.c raptor_serialize.c \ + raptor_rfc2396.c raptor_uri.c raptor_log.c raptor_locator.c \ + raptor_namespace.c raptor_qname.c raptor_option.c \ + raptor_general.c raptor_unicode.c raptor_www.c \ + raptor_statement.c raptor_term.c raptor_sequence.c \ + raptor_stringbuffer.c raptor_iostream.c raptor_xml.c \ + raptor_xml_writer.c raptor_set.c turtle_common.c \ + raptor_turtle_writer.c raptor_avltree.c snprintf.c \ + raptor_json_writer.c raptor_memstr.c raptor_concepts.c \ + raptor_syntax_description.c raptor_sax2.c raptor_escaped.c \ + raptor_ntriples.c sort_r.c sort_r.h ssort.h $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) \ + $(am__append_6) $(am__append_7) $(am__append_8) \ + $(am__append_9) $(am__append_10) $(am__append_11) \ + $(am__append_12) $(am__append_13) $(am__append_14) \ + $(am__append_15) $(am__append_16) $(am__append_17) \ + $(am__append_18) $(am__append_19) $(am__append_20) \ + $(am__append_21) $(am__append_22) $(am__append_23) \ + $(am__append_24) $(am__append_25) $(am__append_26) \ + $(am__append_27) $(am__append_28) +libraptor2_la_LIBADD = $(am__append_31) @LTLIBOBJS@ +libraptor2_la_LDFLAGS = -version-info @RAPTOR_LIBTOOL_VERSION@ \ +@RAPTOR_LDFLAGS@ $(MEM_LIBS) + +EXTRA_DIST = \ +CMakeLists.txt \ +raptor_config_cmake.h.in \ +raptor_permute_test.c \ +raptor_www_test.c \ +raptor_nfc_test.c \ +raptor_win32.c \ +$(man_MANS) \ +turtle_lexer.l turtle_parser.y \ +parsedate.y + +nodist_libraptor2_la_SOURCES = $(am__append_32) +all: $(BUILT_SOURCES) raptor_config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +raptor_config.h: stamp-h1 + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 + +stamp-h1: $(srcdir)/raptor_config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status src/raptor_config.h +$(srcdir)/raptor_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f raptor_config.h stamp-h1 +raptor2.h: $(top_builddir)/config.status $(srcdir)/raptor2.h.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ + +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + done + +clean-libLTLIBRARIES: + -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libraptor2.la: $(libraptor2_la_OBJECTS) $(libraptor2_la_DEPENDENCIES) $(EXTRA_libraptor2_la_DEPENDENCIES) + $(AM_V_CCLD)$(libraptor2_la_LINK) -rpath $(libdir) $(libraptor2_la_OBJECTS) $(libraptor2_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/raptor_nfc_icu.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/raptor_www_curl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/raptor_www_libfetch.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/raptor_www_libxml.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ntriples_parse.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parsedate.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_abbrev.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_avltree.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_concepts.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_escaped.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_general.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_grddl.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_guess.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_iostream.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_json.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_json_writer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_librdfa.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_libxml.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_locator.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_log.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_memstr.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_namespace.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_ntriples.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_option.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_parse.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_qname.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_rdfxml.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_rfc2396.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_rss.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_rss_common.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_sax2.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_sequence.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize_dot.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize_html.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize_json.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize_ntriples.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize_rdfxml.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize_rdfxmla.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize_rss.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_serialize_turtle.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_set.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_statement.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_stringbuffer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_syntax_description.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_term.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_turtle_writer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_unicode.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_uri.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_www.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_xml.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raptor_xml_writer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sort_r.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strcasecmp.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/turtle_common.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/turtle_lexer.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/turtle_parser.Plo@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-nodist_pkgincludeHEADERS: $(nodist_pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-nodist_pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(nodist_pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) +install-pkgincludeHEADERS: $(pkginclude_HEADERS) + @$(NORMAL_INSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkgincludedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkgincludedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(pkgincludedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(pkgincludedir)" || exit $$?; \ + done + +uninstall-pkgincludeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(pkginclude_HEADERS)'; test -n "$(pkgincludedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(pkgincludedir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +raptor_parse_test.log: raptor_parse_test + @p='raptor_parse_test'; \ + b='raptor_parse_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_rfc2396_test.log: raptor_rfc2396_test + @p='raptor_rfc2396_test'; \ + b='raptor_rfc2396_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_uri_test.log: raptor_uri_test + @p='raptor_uri_test'; \ + b='raptor_uri_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_namespace_test.log: raptor_namespace_test + @p='raptor_namespace_test'; \ + b='raptor_namespace_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +strcasecmp_test.log: strcasecmp_test + @p='strcasecmp_test'; \ + b='strcasecmp_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_www_test.log: raptor_www_test + @p='raptor_www_test'; \ + b='raptor_www_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_sequence_test.log: raptor_sequence_test + @p='raptor_sequence_test'; \ + b='raptor_sequence_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_stringbuffer_test.log: raptor_stringbuffer_test + @p='raptor_stringbuffer_test'; \ + b='raptor_stringbuffer_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_uri_win32_test.log: raptor_uri_win32_test + @p='raptor_uri_win32_test'; \ + b='raptor_uri_win32_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_iostream_test.log: raptor_iostream_test + @p='raptor_iostream_test'; \ + b='raptor_iostream_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_xml_writer_test.log: raptor_xml_writer_test + @p='raptor_xml_writer_test'; \ + b='raptor_xml_writer_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_turtle_writer_test.log: raptor_turtle_writer_test + @p='raptor_turtle_writer_test'; \ + b='raptor_turtle_writer_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_avltree_test.log: raptor_avltree_test + @p='raptor_avltree_test'; \ + b='raptor_avltree_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_term_test.log: raptor_term_test + @p='raptor_term_test'; \ + b='raptor_term_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_permute_test.log: raptor_permute_test + @p='raptor_permute_test'; \ + b='raptor_permute_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_snprintf_test.log: raptor_snprintf_test + @p='raptor_snprintf_test'; \ + b='raptor_snprintf_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_sort_r_test.log: raptor_sort_r_test + @p='raptor_sort_r_test'; \ + b='raptor_sort_r_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_set_test.log: raptor_set_test + @p='raptor_set_test'; \ + b='raptor_set_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +raptor_xml_test.log: raptor_xml_test + @p='raptor_xml_test'; \ + b='raptor_xml_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LTLIBRARIES) $(HEADERS) raptor_config.h +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ + mostlyclean-am + +distclean: distclean-am + -rm -f $(DEPDIR)/raptor_nfc_icu.Plo + -rm -f $(DEPDIR)/raptor_www_curl.Plo + -rm -f $(DEPDIR)/raptor_www_libfetch.Plo + -rm -f $(DEPDIR)/raptor_www_libxml.Plo + -rm -f ./$(DEPDIR)/ntriples_parse.Plo + -rm -f ./$(DEPDIR)/parsedate.Plo + -rm -f ./$(DEPDIR)/raptor_abbrev.Plo + -rm -f ./$(DEPDIR)/raptor_avltree.Plo + -rm -f ./$(DEPDIR)/raptor_concepts.Plo + -rm -f ./$(DEPDIR)/raptor_escaped.Plo + -rm -f ./$(DEPDIR)/raptor_general.Plo + -rm -f ./$(DEPDIR)/raptor_grddl.Plo + -rm -f ./$(DEPDIR)/raptor_guess.Plo + -rm -f ./$(DEPDIR)/raptor_iostream.Plo + -rm -f ./$(DEPDIR)/raptor_json.Plo + -rm -f ./$(DEPDIR)/raptor_json_writer.Plo + -rm -f ./$(DEPDIR)/raptor_librdfa.Plo + -rm -f ./$(DEPDIR)/raptor_libxml.Plo + -rm -f ./$(DEPDIR)/raptor_locator.Plo + -rm -f ./$(DEPDIR)/raptor_log.Plo + -rm -f ./$(DEPDIR)/raptor_memstr.Plo + -rm -f ./$(DEPDIR)/raptor_namespace.Plo + -rm -f ./$(DEPDIR)/raptor_ntriples.Plo + -rm -f ./$(DEPDIR)/raptor_option.Plo + -rm -f ./$(DEPDIR)/raptor_parse.Plo + -rm -f ./$(DEPDIR)/raptor_qname.Plo + -rm -f ./$(DEPDIR)/raptor_rdfxml.Plo + -rm -f ./$(DEPDIR)/raptor_rfc2396.Plo + -rm -f ./$(DEPDIR)/raptor_rss.Plo + -rm -f ./$(DEPDIR)/raptor_rss_common.Plo + -rm -f ./$(DEPDIR)/raptor_sax2.Plo + -rm -f ./$(DEPDIR)/raptor_sequence.Plo + -rm -f ./$(DEPDIR)/raptor_serialize.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_dot.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_html.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_json.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_ntriples.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_rdfxml.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_rdfxmla.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_rss.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_turtle.Plo + -rm -f ./$(DEPDIR)/raptor_set.Plo + -rm -f ./$(DEPDIR)/raptor_statement.Plo + -rm -f ./$(DEPDIR)/raptor_stringbuffer.Plo + -rm -f ./$(DEPDIR)/raptor_syntax_description.Plo + -rm -f ./$(DEPDIR)/raptor_term.Plo + -rm -f ./$(DEPDIR)/raptor_turtle_writer.Plo + -rm -f ./$(DEPDIR)/raptor_unicode.Plo + -rm -f ./$(DEPDIR)/raptor_uri.Plo + -rm -f ./$(DEPDIR)/raptor_www.Plo + -rm -f ./$(DEPDIR)/raptor_xml.Plo + -rm -f ./$(DEPDIR)/raptor_xml_writer.Plo + -rm -f ./$(DEPDIR)/snprintf.Plo + -rm -f ./$(DEPDIR)/sort_r.Plo + -rm -f ./$(DEPDIR)/strcasecmp.Plo + -rm -f ./$(DEPDIR)/turtle_common.Plo + -rm -f ./$(DEPDIR)/turtle_lexer.Plo + -rm -f ./$(DEPDIR)/turtle_parser.Plo + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-nodist_pkgincludeHEADERS \ + install-pkgincludeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(DEPDIR)/raptor_nfc_icu.Plo + -rm -f $(DEPDIR)/raptor_www_curl.Plo + -rm -f $(DEPDIR)/raptor_www_libfetch.Plo + -rm -f $(DEPDIR)/raptor_www_libxml.Plo + -rm -f ./$(DEPDIR)/ntriples_parse.Plo + -rm -f ./$(DEPDIR)/parsedate.Plo + -rm -f ./$(DEPDIR)/raptor_abbrev.Plo + -rm -f ./$(DEPDIR)/raptor_avltree.Plo + -rm -f ./$(DEPDIR)/raptor_concepts.Plo + -rm -f ./$(DEPDIR)/raptor_escaped.Plo + -rm -f ./$(DEPDIR)/raptor_general.Plo + -rm -f ./$(DEPDIR)/raptor_grddl.Plo + -rm -f ./$(DEPDIR)/raptor_guess.Plo + -rm -f ./$(DEPDIR)/raptor_iostream.Plo + -rm -f ./$(DEPDIR)/raptor_json.Plo + -rm -f ./$(DEPDIR)/raptor_json_writer.Plo + -rm -f ./$(DEPDIR)/raptor_librdfa.Plo + -rm -f ./$(DEPDIR)/raptor_libxml.Plo + -rm -f ./$(DEPDIR)/raptor_locator.Plo + -rm -f ./$(DEPDIR)/raptor_log.Plo + -rm -f ./$(DEPDIR)/raptor_memstr.Plo + -rm -f ./$(DEPDIR)/raptor_namespace.Plo + -rm -f ./$(DEPDIR)/raptor_ntriples.Plo + -rm -f ./$(DEPDIR)/raptor_option.Plo + -rm -f ./$(DEPDIR)/raptor_parse.Plo + -rm -f ./$(DEPDIR)/raptor_qname.Plo + -rm -f ./$(DEPDIR)/raptor_rdfxml.Plo + -rm -f ./$(DEPDIR)/raptor_rfc2396.Plo + -rm -f ./$(DEPDIR)/raptor_rss.Plo + -rm -f ./$(DEPDIR)/raptor_rss_common.Plo + -rm -f ./$(DEPDIR)/raptor_sax2.Plo + -rm -f ./$(DEPDIR)/raptor_sequence.Plo + -rm -f ./$(DEPDIR)/raptor_serialize.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_dot.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_html.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_json.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_ntriples.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_rdfxml.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_rdfxmla.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_rss.Plo + -rm -f ./$(DEPDIR)/raptor_serialize_turtle.Plo + -rm -f ./$(DEPDIR)/raptor_set.Plo + -rm -f ./$(DEPDIR)/raptor_statement.Plo + -rm -f ./$(DEPDIR)/raptor_stringbuffer.Plo + -rm -f ./$(DEPDIR)/raptor_syntax_description.Plo + -rm -f ./$(DEPDIR)/raptor_term.Plo + -rm -f ./$(DEPDIR)/raptor_turtle_writer.Plo + -rm -f ./$(DEPDIR)/raptor_unicode.Plo + -rm -f ./$(DEPDIR)/raptor_uri.Plo + -rm -f ./$(DEPDIR)/raptor_www.Plo + -rm -f ./$(DEPDIR)/raptor_xml.Plo + -rm -f ./$(DEPDIR)/raptor_xml_writer.Plo + -rm -f ./$(DEPDIR)/snprintf.Plo + -rm -f ./$(DEPDIR)/sort_r.Plo + -rm -f ./$(DEPDIR)/strcasecmp.Plo + -rm -f ./$(DEPDIR)/turtle_common.Plo + -rm -f ./$(DEPDIR)/turtle_lexer.Plo + -rm -f ./$(DEPDIR)/turtle_parser.Plo + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgincludeHEADERS + +.MAKE: all check check-am install install-am install-exec \ + install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am clean clean-generic clean-libLTLIBRARIES \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man \ + install-nodist_pkgincludeHEADERS install-pdf install-pdf-am \ + install-pkgincludeHEADERS install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am recheck tags tags-am uninstall \ + uninstall-am uninstall-libLTLIBRARIES \ + uninstall-nodist_pkgincludeHEADERS uninstall-pkgincludeHEADERS + +.PRECIOUS: Makefile + + +# raptor_parse.c is the first source file so this ensures +# git-version.h is created before it and before the actual file +# dependencies are calculated as a side-effect of compilation +@MAINTAINER_MODE_TRUE@raptor_parse.c: git-version.h + +# Actually it needs turtle_parser.h but nevermind +@MAINTAINER_MODE_TRUE@turtle_lexer.c: $(srcdir)/turtle_lexer.l turtle_parser.c $(top_srcdir)/scripts/fix-flex.pl +@MAINTAINER_MODE_TRUE@ $(AM_V_GEN) \ +@MAINTAINER_MODE_TRUE@ $(LEX) -o$@ $(srcdir)/turtle_lexer.l; \ +@MAINTAINER_MODE_TRUE@ for file in turtle_lexer.c turtle_lexer.h; do \ +@MAINTAINER_MODE_TRUE@ $(PERL) $(top_srcdir)/scripts/fix-flex.pl $$file > turtle_lexer.t || rm -f $$file; \ +@MAINTAINER_MODE_TRUE@ mv -f turtle_lexer.t $$file; \ +@MAINTAINER_MODE_TRUE@ done + +@MAINTAINER_MODE_TRUE@turtle_lexer.h: turtle_lexer.c ; @exit 0 + +@MAINTAINER_MODE_TRUE@turtle_parser.c: $(srcdir)/turtle_parser.y $(top_srcdir)/scripts/fix-bison.pl +@MAINTAINER_MODE_TRUE@ $(AM_V_GEN) \ +@MAINTAINER_MODE_TRUE@ $(BISON) -o $@ $(srcdir)/turtle_parser.y; \ +@MAINTAINER_MODE_TRUE@ $(PERL) $(top_srcdir)/scripts/fix-bison.pl $@ + +@MAINTAINER_MODE_TRUE@turtle_parser.h: turtle_parser.c ; @exit 0 + +@MAINTAINER_MODE_TRUE@parsedate.c: $(srcdir)/parsedate.y $(top_srcdir)/scripts/fix-bison.pl +@MAINTAINER_MODE_TRUE@ $(AM_V_GEN) \ +@MAINTAINER_MODE_TRUE@ $(BISON) -o $@ $(srcdir)/parsedate.y; \ +@MAINTAINER_MODE_TRUE@ $(PERL) $(top_srcdir)/scripts/fix-bison.pl $@ + +@MAINTAINER_MODE_TRUE@parsedate.h: parsedate.c ; @exit 0 + +# Actually it needs turtle_parser.h but nevermind +turtle_lexer_test: $(srcdir)/turtle_lexer.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/turtle_lexer.c libraptor2.la $(LIBS) + +turtle_parser_test: $(srcdir)/turtle_parser.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/turtle_parser.c libraptor2.la $(LIBS) + +raptor_parse_test: $(srcdir)/raptor_parse.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_parse.c libraptor2.la $(LIBS) + +raptor_rfc2396_test: $(srcdir)/raptor_rfc2396.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_rfc2396.c libraptor2.la $(LIBS) + +raptor_uri_test: $(srcdir)/raptor_uri.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_uri.c libraptor2.la $(LIBS) + +raptor_uri_win32_test: $(srcdir)/raptor_uri.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE -DWIN32_URI_TEST $(srcdir)/raptor_uri.c libraptor2.la $(LIBS) + +raptor_namespace_test: $(srcdir)/raptor_namespace.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_namespace.c libraptor2.la $(LIBS) + +strcasecmp_test: $(srcdir)/strcasecmp.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/strcasecmp.c libraptor2.la $(LIBS) + +raptor_www_test: $(srcdir)/raptor_www_test.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_www_test.c libraptor2.la $(LIBS) + +raptor_set_test: $(srcdir)/raptor_set.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_set.c libraptor2.la $(LIBS) + +raptor_xml_test: $(srcdir)/raptor_xml.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_xml.c libraptor2.la $(LIBS) + +raptor_sequence_test: $(srcdir)/raptor_sequence.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_sequence.c libraptor2.la $(LIBS) + +raptor_stringbuffer_test: $(srcdir)/raptor_stringbuffer.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_stringbuffer.c libraptor2.la $(LIBS) + +raptor_nfc_test: $(srcdir)/raptor_nfc_test.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_nfc_test.c libraptor2.la $(LIBS) + +raptor_iostream_test: $(srcdir)/raptor_iostream.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_iostream.c libraptor2.la $(LIBS) + +raptor_xml_writer_test: $(srcdir)/raptor_xml_writer.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_xml_writer.c libraptor2.la $(LIBS) + +raptor_turtle_writer_test: $(srcdir)/raptor_turtle_writer.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_turtle_writer.c libraptor2.la $(LIBS) + +raptor_avltree_test: $(srcdir)/raptor_avltree.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_avltree.c libraptor2.la $(LIBS) + +raptor_term_test: $(srcdir)/raptor_term.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_term.c libraptor2.la $(LIBS) + +raptor_permute_test: $(srcdir)/raptor_permute_test.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/raptor_permute_test.c libraptor2.la $(LIBS) + +raptor_snprintf_test: $(srcdir)/snprintf.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/snprintf.c libraptor2.la $(LIBS) + +raptor_sort_r_test: $(srcdir)/sort_r.c libraptor2.la + $(LINK) $(DEFS) $(CPPFLAGS) -I$(srcdir) -I. -DSTANDALONE $(srcdir)/sort_r.c libraptor2.la $(LIBS) + +$(top_builddir)/librdfa/librdfa.la: + cd $(top_builddir)/librdfa && $(MAKE) librdfa.la + +# Some people need a little help ;-) +test: check + +@MAINTAINER_MODE_TRUE@git-version.h: check-version + +# Always run this in maintainer mode but do not always change git-version.h +@MAINTAINER_MODE_TRUE@.PHONY: check-version +@MAINTAINER_MODE_TRUE@check-version: +@MAINTAINER_MODE_TRUE@ @file="git-version.h" ; \ +@MAINTAINER_MODE_TRUE@ if test -d ../.git; then \ +@MAINTAINER_MODE_TRUE@ git_version=`cd .. && git rev-parse HEAD`; \ +@MAINTAINER_MODE_TRUE@ else \ +@MAINTAINER_MODE_TRUE@ git_version="unknown"; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "GIT version $$git_version"; \ +@MAINTAINER_MODE_TRUE@ tmp="$$file.tmp"; \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "#define GIT_VERSION \"$$git_version\"" > $$tmp; \ +@MAINTAINER_MODE_TRUE@ if test -f $$file; then \ +@MAINTAINER_MODE_TRUE@ if cmp $$file $$tmp >/dev/null 2>&1; then \ +@MAINTAINER_MODE_TRUE@ rm $$tmp; \ +@MAINTAINER_MODE_TRUE@ else \ +@MAINTAINER_MODE_TRUE@ mv $$tmp $$file; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ else \ +@MAINTAINER_MODE_TRUE@ mv $$tmp $$file; \ +@MAINTAINER_MODE_TRUE@ fi + +# Run Clang static analyzer over sources. +@MAINTAINER_MODE_TRUE@analyze: $(SOURCES) +@MAINTAINER_MODE_TRUE@ @list='$(SOURCES)'; \ +@MAINTAINER_MODE_TRUE@ result=0; \ +@MAINTAINER_MODE_TRUE@ for file in $$list; do \ +@MAINTAINER_MODE_TRUE@ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "Analyzing $$file"; \ +@MAINTAINER_MODE_TRUE@ $(ANALYZE_COMMAND) $(srcdir)/$$file; \ +@MAINTAINER_MODE_TRUE@ status=$$?; \ +@MAINTAINER_MODE_TRUE@ if test $$status != 0; then \ +@MAINTAINER_MODE_TRUE@ result=1; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ done; \ +@MAINTAINER_MODE_TRUE@ set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/ntriples_parse.c b/src/ntriples_parse.c new file mode 100644 index 0000000..1d74431 --- /dev/null +++ b/src/ntriples_parse.c @@ -0,0 +1,799 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * ntriples_parse.c - Raptor N-Triples Parser implementation + * + * N-Triples + * http://www.w3.org/TR/rdf-testcases/#ntriples + * + * Copyright (C) 2001-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2001-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +/* Set RAPTOR_DEBUG to > 1 to get lots of buffer related debugging */ +/* +#undef RAPTOR_DEBUG +#define RAPTOR_DEBUG 2 +*/ + + +/* Prototypes for local functions */ +static void raptor_ntriples_generate_statement(raptor_parser* parser, raptor_term* subject_term, raptor_term* predicate_term, raptor_term* object_term, raptor_term* graph_term); + +/* + * NTriples parser object + */ +struct raptor_ntriples_parser_context_s { + /* current line */ + unsigned char *line; + /* current line length */ + size_t line_length; + /* current char in line buffer */ + size_t offset; + + char last_char; + + /* static statement for use in passing to user code */ + raptor_statement statement; + + /* Non-0 if N-Quads */ + int is_nquads; + + int literal_graph_warning; +}; + + +typedef struct raptor_ntriples_parser_context_s raptor_ntriples_parser_context; + + + +/** + * raptor_ntriples_parse_init: + * + * Initialise the Raptor NTriples parser. + * + * Return value: non 0 on failure + **/ + +static int +raptor_ntriples_parse_init(raptor_parser* rdf_parser, const char *name) +{ + raptor_ntriples_parser_context *ntriples_parser; + ntriples_parser = (raptor_ntriples_parser_context*)rdf_parser->context; + + raptor_statement_init(&ntriples_parser->statement, rdf_parser->world); + + if(!strcmp(name, "nquads")) + ntriples_parser->is_nquads = 1; + + return 0; +} + + +/* PUBLIC FUNCTIONS */ + + +/* + * raptor_ntriples_parse_terminate - Free the Raptor NTriples parser + * @rdf_parser: parser object + * + **/ +static void +raptor_ntriples_parse_terminate(raptor_parser* rdf_parser) +{ + raptor_ntriples_parser_context *ntriples_parser; + ntriples_parser = (raptor_ntriples_parser_context*)rdf_parser->context; + if(ntriples_parser->line_length) + RAPTOR_FREE(cdata, ntriples_parser->line); +} + + +static void +raptor_ntriples_generate_statement(raptor_parser* parser, + raptor_term *subject, + raptor_term *predicate, + raptor_term *object, + raptor_term *graph) +{ + /* raptor_ntriples_parser_context *ntriples_parser = (raptor_ntriples_parser_context*)parser->context; */ + raptor_statement *statement = &parser->statement; + + if(!parser->emitted_default_graph) { + raptor_parser_start_graph(parser, NULL, 0); + parser->emitted_default_graph++; + } + + statement->subject = subject; + statement->predicate = predicate; + statement->object = object; + statement->graph = graph; + + /* Do not generate a partial triple - but do clean up */ + if(!subject || !predicate || !object) + goto cleanup; + + /* If there is no statement handler - there is nothing else to do */ + if(!parser->statement_handler) + goto cleanup; + + /* Generate the statement */ + (*parser->statement_handler)(parser->user_data, statement); + + cleanup: + raptor_free_statement(statement); +} + + + +#define MAX_NTRIPLES_TERMS 4 + +static int +raptor_ntriples_parse_line(raptor_parser* rdf_parser, + unsigned char *buffer, size_t len, + int max_terms) +{ + raptor_ntriples_parser_context *ntriples_parser = (raptor_ntriples_parser_context*)rdf_parser->context; + int i; + unsigned char *p; + raptor_term* terms[MAX_NTRIPLES_TERMS+1] = {NULL, NULL, NULL, NULL, NULL}; + int rc = 0; + + /* ASSERTION: + * p always points to first char we are considering + * p[len-1] always points to last char + */ + + /* Handle empty lines */ + if(!len) + return 0; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("handling line '%s' (%d bytes)\n", buffer, (unsigned int)len); +#endif + + p = buffer; + + while(len > 0 && isspace((int)*p)) { + p++; + rdf_parser->locator.column++; + rdf_parser->locator.byte++; + len--; + } + + /* Handle empty - all whitespace lines */ + if(!len) + return 0; + + /* Handle comment lines */ + if(*p == '#') + return 0; + + /* Remove trailing spaces */ + while(len > 0 && isspace((int)p[len-1])) { + p[len-1] = '\0'; + len--; + } + + /* can't be empty now - that would have been caught above */ + + /* Must be triple/quad */ + + for(i = 0; i < MAX_NTRIPLES_TERMS + 1; i++) { + size_t term_len; + + if(!len) { + if(ntriples_parser->is_nquads) { + /* context is optional in nquads */ + if(i == 3 || i ==4) + break; + } else { + if(i == 3) + break; + } + raptor_parser_error(rdf_parser, "Unexpected end of line"); + goto cleanup; + } + + + if(i == 3) { + /* graph term (3): blank node or */ + if(*p != '<' && *p != '_') { + raptor_parser_error(rdf_parser, "Saw '%c', expected Graph term , _:bnodeID", *p); + goto cleanup; + } + } else if(i == 2) { + /* object term (2): expect either or _:name or literal */ + if(*p != '<' && *p != '_' && *p != '"') { + raptor_parser_error(rdf_parser, "Saw '%c', expected object term , _:bnodeID or \"literal\"", *p); + goto cleanup; + } + } else if(i == 1) { + /* predicate term (1): expect URI only */ + if(*p != '<') { + raptor_parser_error(rdf_parser, "Saw '%c', expected predict term ", *p); + goto cleanup; + } + } else { + /* subject (0) or graph (3) terms: expect or _:name */ + if(*p != '<' && *p != '_') { + raptor_parser_error(rdf_parser, "Saw '%c', expected subject term or _:bnodeID", *p); + goto cleanup; + } + } + + + term_len = raptor_ntriples_parse_term(rdf_parser->world, &rdf_parser->locator, + p, &len, &terms[i], 0); + if(!term_len) { + rc = 1; + goto cleanup; + } + + p += term_len; + rc = 0; + + if(terms[i] && terms[i]->type == RAPTOR_TERM_TYPE_URI) { + unsigned const char* uri_string; + + /* Check for absolute URI */ + uri_string = raptor_uri_as_string(terms[i]->value.uri); + if(!raptor_uri_uri_string_is_absolute(uri_string)) { + raptor_parser_error(rdf_parser, "URI %s is not absolute", uri_string); + goto cleanup; + } + } + + /* Skip whitespace after terms */ + while(len > 0 && isspace((int)*p)) { + p++; + len--; + rdf_parser->locator.column++; + rdf_parser->locator.byte++; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + if(terms[i]) { + unsigned char* c = raptor_term_to_string(terms[i]); + fprintf(stderr, "item %d: term '%s' type %d\n", + i, c, terms[i]->type); + raptor_free_memory(c); + } else + fprintf(stderr, "item %d: NULL term\n", i); +#endif + + /* Look for terminating '.' after 3rd (ntriples) or 3rd/4th (nquads) term */ + if(i == (ntriples_parser->is_nquads ? 4 : 3) && *p != '.') { + raptor_parser_error(rdf_parser, "Missing terminating \".\""); + return 0; + } + + /* Still may be optional so check again */ + if(*p == '.') { + p++; + len--; + rdf_parser->locator.column++; + rdf_parser->locator.byte++; + + /* Skip whitespace after '.' */ + while(len > 0 && isspace((int)*p)) { + p++; + len--; + rdf_parser->locator.column++; + rdf_parser->locator.byte++; + } + + /* Only a comment is allowed here */ + if(*p && *p != '#') { + raptor_parser_error(rdf_parser, "Junk after terminating \".\""); + return 0; + } + + p += len; len = 0; + } + } + + + if(ntriples_parser->is_nquads) { + /* Check N-Quads has 3 or 4 terms */ + if(terms[4]) { + raptor_free_term(terms[4]); + terms[4] = NULL; + raptor_parser_error(rdf_parser, "N-Quads only allows 3 or 4 terms"); + goto cleanup; + } + } else { + /* Check N-Triples has only 3 terms */ + if(terms[3] || terms[4]) { + if(terms[4]) { + raptor_free_term(terms[4]); + terms[4] = NULL; + } + if(terms[3]) { + raptor_free_term(terms[3]); + terms[3] = NULL; + } + raptor_parser_error(rdf_parser, "N-Triples only allows 3 terms"); + goto cleanup; + } + } + + if(terms[3] && terms[3]->type == RAPTOR_TERM_TYPE_LITERAL) { + if(!ntriples_parser->literal_graph_warning++) + raptor_parser_warning(rdf_parser, "Ignoring N-Quad literal contexts"); + + raptor_free_term(terms[3]); + terms[3] = NULL; + } + + raptor_ntriples_generate_statement(rdf_parser, + terms[0], terms[1], terms[2], terms[3]); + + rdf_parser->locator.byte += RAPTOR_BAD_CAST(int, len); + + cleanup: + + return rc; +} + + +static int +raptor_ntriples_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *s, size_t len, + int is_end) +{ + unsigned char *buffer; + unsigned char *ptr; + unsigned char *start; + raptor_ntriples_parser_context *ntriples_parser = (raptor_ntriples_parser_context*)rdf_parser->context; + int max_terms = ntriples_parser->is_nquads ? 4 : 3; + unsigned char* end_ptr; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("adding %d bytes to buffer\n", (unsigned int)len); +#endif + + if(len) { + buffer = RAPTOR_MALLOC(unsigned char*, ntriples_parser->line_length + len + 1); + if(!buffer) { + raptor_parser_fatal_error(rdf_parser, "Out of memory"); + return 1; + } + + if(ntriples_parser->line_length) { + memcpy(buffer, ntriples_parser->line, ntriples_parser->line_length); + RAPTOR_FREE(char*, ntriples_parser->line); + } + + ntriples_parser->line = buffer; + + /* move pointer to end of cdata buffer */ + ptr = buffer + ntriples_parser->line_length; + + /* adjust stored length */ + ntriples_parser->line_length += len; + + /* now write new stuff at end of cdata buffer */ + memcpy(ptr, s, len); + ptr += len; + *ptr = '\0'; + } else + buffer = ntriples_parser->line; + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("buffer now %ld bytes\n", ntriples_parser->line_length); +#endif + + if(!ntriples_parser->line_length) + return 0; + + ptr = buffer + ntriples_parser->offset; + end_ptr = buffer + ntriples_parser->line_length; + while((start = ptr) < end_ptr) { + unsigned char *line_start = ptr; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("line buffer now '%s' (offset %ld)\n", ptr, ptr-(buffer+ntriples_parser->offset)); +#endif + + /* skip \n when just seen \r - i.e. \r\n or CR LF */ + if(ntriples_parser->last_char == '\r' && *ptr == '\n') { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG1("skipping a \\n\n"); +#endif + ptr++; + rdf_parser->locator.byte++; + rdf_parser->locator.column = 0; + start = line_start = ptr; + } + + if(1) { + int quote = '\0'; + int in_uri = '\0'; + int bq = 0; + while(ptr < end_ptr) { + if(!bq) { + if(*ptr == '\\') { + bq = 1; + ptr++; + continue; + } + + if(*ptr == '<') + in_uri = 1; + else if (in_uri && *ptr == '>') + in_uri = 0; + + if(!quote) { + if((!in_uri && *ptr == '\'') || *ptr == '"') + quote = *ptr; + if(*ptr == '\n' || *ptr == '\r') + break; + } else { + if(*ptr == quote) + quote = 0; + } + } + ptr++; + bq = 0; + } + } + + if(ptr == end_ptr) { + if(!is_end) + /* middle of line */ + break; + } else { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("found newline \\x%02x at offset %ld\n", *ptr, + ptr-line_start); +#endif + ntriples_parser->last_char = *ptr; + } + + len = ptr - line_start; + rdf_parser->locator.column = 0; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("line (%ld) : >>>", len); + fwrite(line_start, sizeof(char), len, stderr); + fputs("<<<\n", stderr); +#endif + *ptr = '\0'; + if(raptor_ntriples_parse_line(rdf_parser, line_start, len, max_terms)) + return 1; + + rdf_parser->locator.line++; + + /* go past newline */ + if(ptr < end_ptr) { + ptr++; + rdf_parser->locator.byte++; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + /* Do not peek if too far */ + if(RAPTOR_BAD_CAST(size_t, ptr - buffer) < ntriples_parser->line_length) + RAPTOR_DEBUG2("next char is \\x%02x\n", *ptr); + else + RAPTOR_DEBUG1("next char unknown - end of buffer\n"); +#endif + } + + ntriples_parser->offset = start - buffer; + + len = ntriples_parser->line_length - ntriples_parser->offset; + + if(len && ntriples_parser->line_length != len) { + /* collapse buffer */ + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("collapsing buffer from %ld to %ld bytes\n", ntriples_parser->line_length, len); +#endif + buffer = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!buffer) { + raptor_parser_fatal_error(rdf_parser, "Out of memory"); + return 1; + } + + memcpy(buffer, + ntriples_parser->line + ntriples_parser->line_length - len, + len); + buffer[len] = '\0'; + + RAPTOR_FREE(char*, ntriples_parser->line); + + ntriples_parser->line = buffer; + ntriples_parser->line_length -= ntriples_parser->offset; + ntriples_parser->offset = 0; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("buffer now '%s' (%ld bytes)\n", ntriples_parser->line, ntriples_parser->line_length); +#endif + } + + /* exit now, no more input */ + if(is_end) { + if(ntriples_parser->offset != ntriples_parser->line_length) { + raptor_parser_error(rdf_parser, "Junk at end of input."); + return 1; + } + + if(rdf_parser->emitted_default_graph) { + raptor_parser_end_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph--; + } + + return 0; + } + + return 0; +} + + +static int +raptor_ntriples_parse_start(raptor_parser* rdf_parser) +{ + raptor_locator *locator = &rdf_parser->locator; + raptor_ntriples_parser_context *ntriples_parser = (raptor_ntriples_parser_context*)rdf_parser->context; + + locator->line = 1; + locator->column = 0; + locator->byte = 0; + + ntriples_parser->last_char = '\0'; + + return 0; +} + + +#if defined RAPTOR_PARSER_NTRIPLES || defined RAPTOR_PARSER_NQUADS +static int +raptor_ntriples_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score = 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "nt")) + score = 8; + + /* Explicitly refuse to do anything with Turtle or N3 named content */ + if(!strcmp((const char*)suffix, "ttl") || + !strcmp((const char*)suffix, "n3")) { + return 0; + } + } + + if(mime_type) { + if(strstr((const char*)mime_type, "ntriples")) + score += 6; + } + + if(buffer && len) { + int has_ntriples_3; + + /* recognizing N-Triples is tricky but rely that it is line based + * and that all URLs are absolute, and there are a lot of http: + * URLs + */ +#define HAS_AT_PREFIX (raptor_memstr((const char*)buffer, len, "@prefix ") != NULL) + +#define HAS_NTRIPLES_START_1_LEN 8 +#define HAS_NTRIPLES_START_1 (!memcmp((const char*)buffer, " <") != NULL) +#define HAS_NTRIPLES_5 (raptor_memstr((const char*)buffer, len, "> \"") != NULL) + if(HAS_AT_PREFIX) + /* Turtle */ + return 0; + + has_ntriples_3 = HAS_NTRIPLES_3; + + /* Bonus if the first bytes look N-Triples-like */ + if(len >= HAS_NTRIPLES_START_1_LEN && HAS_NTRIPLES_START_1) + score++; + if(len >= HAS_NTRIPLES_START_2_LEN && HAS_NTRIPLES_START_2) + score++; + + if(HAS_NTRIPLES_1 || HAS_NTRIPLES_2) { + /* N-Triples file with newlines and HTTP subjects */ + score += 6; + if(has_ntriples_3) + score++; + } else if(has_ntriples_3) { + /* an HTTP URL predicate or object but no HTTP subject */ + score += 3; + } else if(HAS_NTRIPLES_4) { + /* non HTTP urls - weak check */ + score += 2; + if(HAS_NTRIPLES_5) + /* bonus for a literal object */ + score++; + } + } + + return score; +} + + +static const char* const ntriples_names[2] = { "ntriples", NULL }; + +static const char* const ntriples_uri_strings[3] = { + "http://www.w3.org/ns/formats/N-Triples", + "http://www.w3.org/TR/rdf-testcases/#ntriples", + NULL +}; + +#define NTRIPLES_TYPES_COUNT 2 +static const raptor_type_q ntriples_types[NTRIPLES_TYPES_COUNT + 1] = { + { "application/n-triples", 21, 10}, + { "text/plain", 10, 1}, + { NULL, 0, 0} +}; + +static int +raptor_ntriples_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = ntriples_names; + + factory->desc.mime_types = ntriples_types; + + factory->desc.label = "N-Triples"; + factory->desc.uri_strings = ntriples_uri_strings; + + factory->desc.flags = 0; + + factory->context_length = sizeof(raptor_ntriples_parser_context); + + factory->init = raptor_ntriples_parse_init; + factory->terminate = raptor_ntriples_parse_terminate; + factory->start = raptor_ntriples_parse_start; + factory->chunk = raptor_ntriples_parse_chunk; + factory->recognise_syntax = raptor_ntriples_parse_recognise_syntax; + + return rc; +} + + +int +raptor_init_parser_ntriples(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_ntriples_parser_register_factory); +} + +#endif + + +#ifdef RAPTOR_PARSER_NQUADS +static int +raptor_nquads_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score = 0; + int ntriples_score; + + if(suffix) { + if(!strcmp((const char*)suffix, "nq")) + score = 2; + + /* Explicitly refuse to do anything with N-Triples, Turtle or N3 + * named content + */ + if(!strcmp((const char*)suffix, "nt") || + !strcmp((const char*)suffix, "ttl") || + !strcmp((const char*)suffix, "n3")) { + return 0; + } + } + + if(mime_type) { + if(strstr((const char*)mime_type, "nquads")) + score += 2; + } + + /* ntriples is a subset of nquads, score higher than ntriples */ + ntriples_score = raptor_ntriples_parse_recognise_syntax(factory, buffer, len, identifier, suffix, mime_type); + if(ntriples_score > 0) { + score += ntriples_score + 1; + } + + return score; +} + + +static const char* const nquads_names[2] = { "nquads", NULL }; + +static const char* const nquads_uri_strings[2] = { + "http://sw.deri.org/2008/07/n-quads/", + NULL +}; + +#define NQUADS_TYPES_COUNT 1 +static const raptor_type_q nquads_types[NQUADS_TYPES_COUNT + 1] = { + { "text/x-nquads", 13, 10}, + { NULL, 0, 0} +}; + +static int +raptor_nquads_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = nquads_names; + + factory->desc.mime_types = nquads_types; + + factory->desc.label = "N-Quads"; + factory->desc.uri_strings = nquads_uri_strings; + + factory->desc.flags = 0; + + factory->context_length = sizeof(raptor_ntriples_parser_context); + + factory->init = raptor_ntriples_parse_init; + factory->terminate = raptor_ntriples_parse_terminate; + factory->start = raptor_ntriples_parse_start; + factory->chunk = raptor_ntriples_parse_chunk; + factory->recognise_syntax = raptor_nquads_parse_recognise_syntax; + + return rc; +} + + +int +raptor_init_parser_nquads(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_nquads_parser_register_factory); +} +#endif diff --git a/src/parsedate.c b/src/parsedate.c new file mode 100644 index 0000000..87dc1bb --- /dev/null +++ b/src/parsedate.c @@ -0,0 +1,2760 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 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, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 + +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 1 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Substitute the type names. */ +#define YYSTYPE RAPTOR_PARSEDATE_STYPE +/* Substitute the variable and function names. */ +#define yyparse raptor_parsedate_parse +#define yylex raptor_parsedate_lex +#define yyerror raptor_parsedate_error +#define yydebug raptor_parsedate_debug +#define yynerrs raptor_parsedate_nerrs + +/* First part of user prologue. */ +#line 1 "./parsedate.y" + +/* + * Imported from the public domain source in PHP 4.4 + * Fri May 20 07:14:01 2005 + * https://github.com/php/php-src/blob/379c4af44aa6456fbdbc69dba3ead166ba7ff67d/ext/standard/parsedate.y + * + * and patched from there + * + * Later versions removed this from PHP and replaced it with entirely + * new code written under the PHP license. That code is not used here + * and cannot be used. + * + */ + + +/* +** Originally written by Steven M. Bellovin while +** at the University of North Carolina at Chapel Hill. Later tweaked by +** a couple of people on Usenet. Completely overhauled by Rich $alz +** and Jim Berets in August, 1990. +** +** This code is in the public domain and has no copyright. +*/ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_TIME_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#if defined(_HPUX_SOURCE) +#include +#endif + +#include "raptor2.h" +#include "raptor_internal.h" + + +#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) + +#ifdef HAVE_STRING_H +# include +#endif + +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __attribute__(x) +#endif + +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + +/* Some old versions of bison generate parsers that use bcopy. + That loses on systems that don't provide the function, so we have + to redefine it here. */ +#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy) +# define bcopy(from, to, len) memcpy ((to), (from), (len)) +#endif + +/* Prototypes */ +static int raptor_parsedate_error(void* parm, const char *msg); + + +#define EPOCH 1970 +#define HOUR(x) ((x) * 60) + +#define MAX_BUFF_LEN 128 /* size of buffer to read the date into */ + +/* +** An entry in the lexical lookup table. +*/ +typedef struct _TABLE { + const char *name; + int type; + int value; +} TABLE; + + +/* +** Meridian: am, pm, or 24-hour style. +*/ +typedef enum _MERIDIAN { + MERam, MERpm, MER24 +} MERIDIAN; + +struct date_yy { + const char *yyInput; + int yyDayOrdinal; + int yyDayNumber; + int yyHaveDate; + int yyHaveDay; + int yyHaveRel; + int yyHaveTime; + int yyHaveZone; + int yyTimezone; + int yyDay; + int yyHour; + int yyMinutes; + int yyMonth; + int yySeconds; + int yyYear; + MERIDIAN yyMeridian; + int yyRelDay; + int yyRelHour; + int yyRelMinutes; + int yyRelMonth; + int yyRelSeconds; + int yyRelYear; +}; + +typedef union _date_ll { + int Number; + enum _MERIDIAN Meridian; +} date_ll; + +#define YYPARSE_PARAM parm +#define YYLEX_PARAM parm +#define YYSTYPE date_ll +#define YYLTYPE void + +static int yylex (YYSTYPE *lvalp, void *parm); + +static int ToHour (int Hours, MERIDIAN Meridian); +static int ToYear (int Year); +static int LookupWord (YYSTYPE *lvalp, char *buff); + + +#line 219 "parsedate.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +#include "parsedate.h" +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_tAGO = 3, /* tAGO */ + YYSYMBOL_tDAY = 4, /* tDAY */ + YYSYMBOL_tDAY_UNIT = 5, /* tDAY_UNIT */ + YYSYMBOL_tDAYZONE = 6, /* tDAYZONE */ + YYSYMBOL_tDST = 7, /* tDST */ + YYSYMBOL_tHOUR_UNIT = 8, /* tHOUR_UNIT */ + YYSYMBOL_tID = 9, /* tID */ + YYSYMBOL_tTZONE = 10, /* tTZONE */ + YYSYMBOL_tWZONE = 11, /* tWZONE */ + YYSYMBOL_tZZONE = 12, /* tZZONE */ + YYSYMBOL_tMERIDIAN = 13, /* tMERIDIAN */ + YYSYMBOL_tMINUTE_UNIT = 14, /* tMINUTE_UNIT */ + YYSYMBOL_tMONTH = 15, /* tMONTH */ + YYSYMBOL_tMONTH_UNIT = 16, /* tMONTH_UNIT */ + YYSYMBOL_tSEC_UNIT = 17, /* tSEC_UNIT */ + YYSYMBOL_tSNUMBER = 18, /* tSNUMBER */ + YYSYMBOL_tUNUMBER = 19, /* tUNUMBER */ + YYSYMBOL_tYEAR_UNIT = 20, /* tYEAR_UNIT */ + YYSYMBOL_tZONE = 21, /* tZONE */ + YYSYMBOL_22_ = 22, /* '.' */ + YYSYMBOL_23_ = 23, /* ':' */ + YYSYMBOL_24_ = 24, /* ',' */ + YYSYMBOL_25_ = 25, /* '/' */ + YYSYMBOL_YYACCEPT = 26, /* $accept */ + YYSYMBOL_spec = 27, /* spec */ + YYSYMBOL_item = 28, /* item */ + YYSYMBOL_time = 29, /* time */ + YYSYMBOL_iso8601time_colon = 30, /* iso8601time_colon */ + YYSYMBOL_iso8601zonepart = 31, /* iso8601zonepart */ + YYSYMBOL_sec_fraction_part = 32, /* sec_fraction_part */ + YYSYMBOL_zonepart_numeric_without_colon = 33, /* zonepart_numeric_without_colon */ + YYSYMBOL_zonepart_numeric_with_colon = 34, /* zonepart_numeric_with_colon */ + YYSYMBOL_HMStime_with_colon = 35, /* HMStime_with_colon */ + YYSYMBOL_HMtime_with_colon = 36, /* HMtime_with_colon */ + YYSYMBOL_zone = 37, /* zone */ + YYSYMBOL_day = 38, /* day */ + YYSYMBOL_date = 39, /* date */ + YYSYMBOL_iso8601datetime = 40, /* iso8601datetime */ + YYSYMBOL_iso8601date = 41, /* iso8601date */ + YYSYMBOL_iso8601weekspec = 42, /* iso8601weekspec */ + YYSYMBOL_iso8601time = 43, /* iso8601time */ + YYSYMBOL_rel = 44, /* rel */ + YYSYMBOL_relunit = 45, /* relunit */ + YYSYMBOL_number = 46, /* number */ + YYSYMBOL_o_merid = 47 /* o_merid */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; + + + + +#ifdef short +# undef short +#endif + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + and (if available) are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + . */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if !defined yyoverflow + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +# endif +# endif +# endif +#endif /* !defined yyoverflow */ + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined RAPTOR_PARSEDATE_STYPE_IS_TRIVIAL && RAPTOR_PARSEDATE_STYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 2 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 110 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 26 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 22 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 77 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 100 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 276 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 24, 2, 22, 25, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 23, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21 +}; + +#if RAPTOR_PARSEDATE_DEBUG +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = +{ + 0, 177, 177, 178, 181, 184, 187, 190, 193, 196, + 197, 200, 206, 210, 213, 217, 220, 226, 229, 232, + 235, 238, 240, 243, 253, 259, 265, 281, 284, 287, + 290, 293, 296, 301, 305, 309, 315, 319, 330, 348, + 349, 352, 358, 363, 371, 376, 384, 391, 392, 411, + 417, 423, 435, 438, 444, 445, 470, 484, 487, 490, + 493, 496, 499, 502, 505, 508, 511, 514, 517, 520, + 523, 526, 529, 532, 535, 538, 543, 578 +}; +#endif + +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if RAPTOR_PARSEDATE_DEBUG || 0 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "tAGO", "tDAY", + "tDAY_UNIT", "tDAYZONE", "tDST", "tHOUR_UNIT", "tID", "tTZONE", "tWZONE", + "tZZONE", "tMERIDIAN", "tMINUTE_UNIT", "tMONTH", "tMONTH_UNIT", + "tSEC_UNIT", "tSNUMBER", "tUNUMBER", "tYEAR_UNIT", "tZONE", "'.'", "':'", + "','", "'/'", "$accept", "spec", "item", "time", "iso8601time_colon", + "iso8601zonepart", "sec_fraction_part", "zonepart_numeric_without_colon", + "zonepart_numeric_with_colon", "HMStime_with_colon", "HMtime_with_colon", + "zone", "day", "date", "iso8601datetime", "iso8601date", + "iso8601weekspec", "iso8601time", "rel", "relunit", "number", "o_merid", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} +#endif + +#define YYPACT_NINF (-60) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-1) + +#define yytable_value_is_error(Yyn) \ + 0 + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int8 yypact[] = +{ + -60, 2, -60, -13, -60, -60, -60, -60, -60, -60, + -60, -60, 13, -60, -60, 69, 20, -60, 32, -60, + -60, -60, 29, 4, -60, -60, -60, -60, 44, -60, + 58, -60, -60, -60, -15, -60, -60, -60, -60, -60, + -60, -60, -60, -60, 46, 48, -60, -60, 28, -60, + -60, 37, -60, 56, 57, -60, -60, 59, 52, 61, + 52, 46, -60, 64, 62, 26, -60, -60, 66, -60, + -60, -60, -60, 68, -60, 36, 74, -60, -60, -60, + -60, -60, -60, -60, -60, -60, 76, -60, 86, -60, + 80, 81, 78, 79, -60, -60, -60, 84, 87, -60 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = +{ + 2, 0, 1, 33, 66, 31, 69, 27, 28, 29, + 77, 72, 0, 63, 75, 0, 76, 60, 30, 3, + 4, 12, 22, 22, 5, 7, 6, 40, 39, 8, + 57, 9, 10, 34, 43, 65, 68, 71, 62, 74, + 59, 35, 64, 67, 0, 0, 11, 70, 45, 61, + 73, 50, 58, 0, 0, 51, 32, 0, 20, 0, + 20, 0, 56, 42, 0, 22, 54, 48, 52, 41, + 46, 49, 26, 36, 21, 23, 0, 15, 17, 18, + 19, 13, 25, 16, 14, 47, 0, 44, 20, 53, + 0, 0, 0, 23, 55, 38, 24, 0, 0, 37 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -60, -60, -60, -60, 104, -59, -23, -60, -60, -60, + -60, 107, -60, -60, -60, -60, -60, 49, -55, -60, + -60, -60 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + 0, 1, 19, 20, 66, 77, 58, 78, 79, 22, + 23, 80, 25, 26, 27, 28, 55, 67, 29, 30, + 31, 32 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int8 yytable[] = +{ + 60, 83, 2, 81, 63, 84, 3, 4, 5, 64, + 6, 33, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 41, 42, 57, 59, 43, 94, + 44, 45, 34, 46, 47, 48, 49, 50, 51, 56, + 52, 35, 88, 53, 36, 54, 69, 70, 57, 53, + 37, 57, 38, 39, 61, 71, 40, 4, 5, 91, + 6, 62, 7, 8, 9, 65, 11, 68, 13, 14, + 75, 76, 17, 18, 35, 72, 73, 36, 74, 42, + 82, 87, 43, 37, 89, 38, 39, 86, 47, 40, + 49, 50, 5, 90, 52, 92, 7, 8, 9, 95, + 96, 97, 91, 98, 93, 21, 99, 18, 24, 0, + 85 +}; + +static const yytype_int8 yycheck[] = +{ + 23, 60, 0, 58, 19, 60, 4, 5, 6, 24, + 8, 24, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 4, 5, 22, 23, 8, 88, + 10, 11, 19, 13, 14, 15, 16, 17, 18, 7, + 20, 5, 65, 23, 8, 25, 18, 19, 22, 23, + 14, 22, 16, 17, 10, 18, 20, 5, 6, 23, + 8, 3, 10, 11, 12, 19, 14, 19, 16, 17, + 18, 19, 20, 21, 5, 19, 19, 8, 19, 5, + 19, 19, 8, 14, 18, 16, 17, 23, 14, 20, + 16, 17, 6, 25, 20, 19, 10, 11, 12, 19, + 19, 23, 23, 19, 18, 1, 19, 21, 1, -1, + 61 +}; + +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int8 yystos[] = +{ + 0, 27, 0, 4, 5, 6, 8, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 28, + 29, 30, 35, 36, 37, 38, 39, 40, 41, 44, + 45, 46, 47, 24, 19, 5, 8, 14, 16, 17, + 20, 4, 5, 8, 10, 11, 13, 14, 15, 16, + 17, 18, 20, 23, 25, 42, 7, 22, 32, 23, + 32, 10, 3, 19, 24, 19, 30, 43, 19, 18, + 19, 18, 19, 19, 19, 18, 19, 31, 33, 34, + 37, 44, 19, 31, 44, 43, 23, 19, 32, 18, + 25, 23, 19, 18, 31, 19, 19, 23, 19, 19 +}; + +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr1[] = +{ + 0, 26, 27, 27, 28, 28, 28, 28, 28, 28, + 28, 29, 29, 30, 30, 30, 30, 31, 31, 31, + 31, 32, 32, 33, 34, 35, 36, 37, 37, 37, + 37, 37, 37, 38, 38, 38, 39, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 40, 40, 41, + 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 46, 47 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 0, 2, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 3, 3, 3, 3, 1, 1, 1, + 0, 2, 0, 1, 3, 3, 3, 1, 1, 1, + 1, 1, 2, 1, 2, 2, 3, 8, 5, 1, + 1, 3, 3, 2, 4, 2, 3, 3, 3, 3, + 2, 2, 2, 3, 1, 3, 2, 1, 2, 2, + 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, + 2, 2, 1, 2, 2, 1, 1, 1 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = RAPTOR_PARSEDATE_EMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == RAPTOR_PARSEDATE_EMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (parm, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use RAPTOR_PARSEDATE_error or RAPTOR_PARSEDATE_UNDEF. */ +#define YYERRCODE RAPTOR_PARSEDATE_UNDEF + + +/* Enable debugging if requested. */ +#if RAPTOR_PARSEDATE_DEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, parm); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, struct date_yy *parm) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (parm); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, struct date_yy *parm) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + yy_symbol_value_print (yyo, yykind, yyvaluep, parm); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule, struct date_yy *parm) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], parm); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, parm); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !RAPTOR_PARSEDATE_DEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !RAPTOR_PARSEDATE_DEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + + + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, struct date_yy *parm) +{ + YY_USE (yyvaluep); + YY_USE (parm); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (struct date_yy *parm) +{ +/* Lookahead token kind. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + + /* Number of syntax errors so far. */ + int yynerrs = 0; + + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; + + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; + + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; + + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = RAPTOR_PARSEDATE_EMPTY; /* Cause a token to be read. */ + + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == RAPTOR_PARSEDATE_EMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, parm); + } + + if (yychar <= RAPTOR_PARSEDATE_EOF) + { + yychar = RAPTOR_PARSEDATE_EOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == RAPTOR_PARSEDATE_error) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = RAPTOR_PARSEDATE_UNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + /* Discard the shifted token. */ + yychar = RAPTOR_PARSEDATE_EMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 4: /* item: time */ +#line 181 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveTime++; + } +#line 1328 "parsedate.c" + break; + + case 5: /* item: zone */ +#line 184 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveZone++; + } +#line 1336 "parsedate.c" + break; + + case 6: /* item: date */ +#line 187 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveDate++; + } +#line 1344 "parsedate.c" + break; + + case 7: /* item: day */ +#line 190 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveDay++; + } +#line 1352 "parsedate.c" + break; + + case 8: /* item: rel */ +#line 193 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveRel++; + } +#line 1360 "parsedate.c" + break; + + case 11: /* time: tUNUMBER tMERIDIAN */ +#line 200 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHour = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyMinutes = 0; + ((struct date_yy *)parm)->yySeconds = 0; + ((struct date_yy *)parm)->yyMeridian = (yyvsp[0].Meridian); + } +#line 1371 "parsedate.c" + break; + + case 13: /* iso8601time_colon: HMStime_with_colon sec_fraction_part rel */ +#line 210 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMeridian = MER24; + } +#line 1379 "parsedate.c" + break; + + case 14: /* iso8601time_colon: HMtime_with_colon sec_fraction_part rel */ +#line 213 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMeridian = MER24; + ((struct date_yy *)parm)->yySeconds = 0; + } +#line 1388 "parsedate.c" + break; + + case 15: /* iso8601time_colon: HMStime_with_colon sec_fraction_part iso8601zonepart */ +#line 217 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMeridian = MER24; + } +#line 1396 "parsedate.c" + break; + + case 16: /* iso8601time_colon: HMtime_with_colon sec_fraction_part iso8601zonepart */ +#line 220 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMeridian = MER24; + ((struct date_yy *)parm)->yySeconds = 0; + } +#line 1405 "parsedate.c" + break; + + case 17: /* iso8601zonepart: zonepart_numeric_without_colon */ +#line 226 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveZone++; + } +#line 1413 "parsedate.c" + break; + + case 18: /* iso8601zonepart: zonepart_numeric_with_colon */ +#line 229 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveZone++; + } +#line 1421 "parsedate.c" + break; + + case 19: /* iso8601zonepart: zone */ +#line 232 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveZone++; + } +#line 1429 "parsedate.c" + break; + + case 21: /* sec_fraction_part: '.' tUNUMBER */ +#line 238 "./parsedate.y" + { + } +#line 1436 "parsedate.c" + break; + + case 23: /* zonepart_numeric_without_colon: tSNUMBER */ +#line 243 "./parsedate.y" + { + /* format: [+-]hhmm */ + if((yyvsp[0].Number) <= -100 || (yyvsp[0].Number) >= 100) { + ((struct date_yy *)parm)->yyTimezone = (-(yyvsp[0].Number) / 100) * 60 + (-(yyvsp[0].Number) % 100); + } else if((yyvsp[0].Number) >= -99 && (yyvsp[0].Number) <= 99) { + ((struct date_yy *)parm)->yyTimezone = -(yyvsp[0].Number) * 60; + } + } +#line 1449 "parsedate.c" + break; + + case 24: /* zonepart_numeric_with_colon: tSNUMBER ':' tUNUMBER */ +#line 253 "./parsedate.y" + { + /* format: [+-]hh:mm */ + ((struct date_yy *)parm)->yyTimezone = -(yyvsp[-2].Number) * 60 + ((yyvsp[-2].Number) > 0 ? -(yyvsp[0].Number): (yyvsp[0].Number)); + } +#line 1458 "parsedate.c" + break; + + case 25: /* HMStime_with_colon: HMtime_with_colon ':' tUNUMBER */ +#line 259 "./parsedate.y" + { + /* format: hh:mm:ss */ + ((struct date_yy *)parm)->yySeconds = (yyvsp[0].Number); + } +#line 1467 "parsedate.c" + break; + + case 26: /* HMtime_with_colon: tUNUMBER ':' tUNUMBER */ +#line 265 "./parsedate.y" + { + /* format: hh:mm */ + ((struct date_yy *)parm)->yyHour = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyMinutes = (yyvsp[0].Number); + } +#line 1477 "parsedate.c" + break; + + case 27: /* zone: tTZONE */ +#line 281 "./parsedate.y" + { + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number); + } +#line 1485 "parsedate.c" + break; + + case 28: /* zone: tWZONE */ +#line 284 "./parsedate.y" + { + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number); + } +#line 1493 "parsedate.c" + break; + + case 29: /* zone: tZZONE */ +#line 287 "./parsedate.y" + { + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number); + } +#line 1501 "parsedate.c" + break; + + case 30: /* zone: tZONE */ +#line 290 "./parsedate.y" + { + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number); + } +#line 1509 "parsedate.c" + break; + + case 31: /* zone: tDAYZONE */ +#line 293 "./parsedate.y" + { + ((struct date_yy *)parm)->yyTimezone = (yyvsp[0].Number) - 60; + } +#line 1517 "parsedate.c" + break; + + case 32: /* zone: tZONE tDST */ +#line 296 "./parsedate.y" + { + ((struct date_yy *)parm)->yyTimezone = (yyvsp[-1].Number) - 60; + } +#line 1525 "parsedate.c" + break; + + case 33: /* day: tDAY */ +#line 301 "./parsedate.y" + { + ((struct date_yy *)parm)->yyDayOrdinal = 1; + ((struct date_yy *)parm)->yyDayNumber = (yyvsp[0].Number); + } +#line 1534 "parsedate.c" + break; + + case 34: /* day: tDAY ',' */ +#line 305 "./parsedate.y" + { + ((struct date_yy *)parm)->yyDayOrdinal = 1; + ((struct date_yy *)parm)->yyDayNumber = (yyvsp[-1].Number); + } +#line 1543 "parsedate.c" + break; + + case 35: /* day: tUNUMBER tDAY */ +#line 309 "./parsedate.y" + { + ((struct date_yy *)parm)->yyDayOrdinal = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyDayNumber = (yyvsp[0].Number); + } +#line 1552 "parsedate.c" + break; + + case 36: /* date: tUNUMBER '/' tUNUMBER */ +#line 315 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMonth = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[0].Number); + } +#line 1561 "parsedate.c" + break; + + case 37: /* date: tMONTH tUNUMBER tUNUMBER ':' tUNUMBER ':' tUNUMBER tUNUMBER */ +#line 319 "./parsedate.y" + { + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-7].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-6].Number); + + ((struct date_yy *)parm)->yyHour = (yyvsp[-5].Number); + ((struct date_yy *)parm)->yyMinutes = (yyvsp[-3].Number); + ((struct date_yy *)parm)->yySeconds = (yyvsp[-1].Number); + + ((struct date_yy *)parm)->yyHaveTime = 1; + } +#line 1577 "parsedate.c" + break; + + case 38: /* date: tUNUMBER '/' tUNUMBER '/' tUNUMBER */ +#line 330 "./parsedate.y" + { + /* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY. + The goal in recognizing YYYY/MM/DD is solely to support legacy + machine-generated dates like those in an RCS log listing. If + you want portability, use the ISO 8601 format. */ + if((yyvsp[-4].Number) >= 1000) + { + ((struct date_yy *)parm)->yyYear = (yyvsp[-4].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[0].Number); + } + else + { + ((struct date_yy *)parm)->yyMonth = (yyvsp[-4].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); + } + } +#line 1600 "parsedate.c" + break; + + case 40: /* date: iso8601datetime */ +#line 349 "./parsedate.y" + { + ((struct date_yy *)parm)->yyHaveTime++; + } +#line 1608 "parsedate.c" + break; + + case 41: /* date: tUNUMBER tMONTH tSNUMBER */ +#line 352 "./parsedate.y" + { + /* e.g. 17-JUN-1992. */ + ((struct date_yy *)parm)->yyDay = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyMonth = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyYear = -(yyvsp[0].Number); + } +#line 1619 "parsedate.c" + break; + + case 42: /* date: tMONTH tUNUMBER tUNUMBER */ +#line 358 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMonth = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); + } +#line 1629 "parsedate.c" + break; + + case 43: /* date: tMONTH tUNUMBER */ +#line 363 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMonth = (yyvsp[-1].Number); + if((yyvsp[0].Number) > 1000) { + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); + } else { + ((struct date_yy *)parm)->yyDay = (yyvsp[0].Number); + } + } +#line 1642 "parsedate.c" + break; + + case 44: /* date: tMONTH tUNUMBER ',' tUNUMBER */ +#line 371 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMonth = (yyvsp[-3].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); + } +#line 1652 "parsedate.c" + break; + + case 45: /* date: tUNUMBER tMONTH */ +#line 376 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMonth = (yyvsp[0].Number); + if((yyvsp[-1].Number) > 1000) { + ((struct date_yy *)parm)->yyYear = (yyvsp[-1].Number); + } else { + ((struct date_yy *)parm)->yyDay = (yyvsp[-1].Number); + } + } +#line 1665 "parsedate.c" + break; + + case 46: /* date: tUNUMBER tMONTH tUNUMBER */ +#line 384 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMonth = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyDay = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); + } +#line 1675 "parsedate.c" + break; + + case 48: /* iso8601datetime: tUNUMBER tTZONE iso8601time */ +#line 392 "./parsedate.y" + { + int i = (yyvsp[-2].Number); + + if(i >= 10000) { + /* format: yyyymmdd */ + ((struct date_yy *)parm)->yyYear = i / 10000; + i %= 10000; + ((struct date_yy *)parm)->yyMonth = i / 100; + i %= 100; + ((struct date_yy *)parm)->yyDay = i; + } else if(i >= 1000 && i <= 9999) { + /* format: yyyy */ + ((struct date_yy *)parm)->yyYear = i; + ((struct date_yy *)parm)->yyDay= 1; + ((struct date_yy *)parm)->yyMonth = 1; + } + } +#line 1697 "parsedate.c" + break; + + case 49: /* iso8601date: tUNUMBER tSNUMBER tSNUMBER */ +#line 411 "./parsedate.y" + { + /* ISO 8601 format. yyyy-mm-dd. */ + ((struct date_yy *)parm)->yyYear = (yyvsp[-2].Number); + ((struct date_yy *)parm)->yyMonth = -(yyvsp[-1].Number); + ((struct date_yy *)parm)->yyDay = -(yyvsp[0].Number); + } +#line 1708 "parsedate.c" + break; + + case 50: /* iso8601date: tUNUMBER tSNUMBER */ +#line 417 "./parsedate.y" + { + /* ISO 8601 format yyyy-mm */ + ((struct date_yy *)parm)->yyYear = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyMonth = -(yyvsp[0].Number); + ((struct date_yy *)parm)->yyDay = 1; + } +#line 1719 "parsedate.c" + break; + + case 51: /* iso8601date: tUNUMBER iso8601weekspec */ +#line 423 "./parsedate.y" + { + const int om = (1 + 9) % 12; /* offset month */ + const int oy = (yyvsp[-1].Number) - 1; /* offset year */ + + ((struct date_yy *)parm)->yyYear = (yyvsp[-1].Number); + ((struct date_yy *)parm)->yyMonth = 1; + /* Zeller's formula */ + ((struct date_yy *)parm)->yyDay -= ((13 * om + 12) / 5 + + oy + oy / 4 + oy / 400 - oy / 100) % 7 - 1; + } +#line 1734 "parsedate.c" + break; + + case 52: /* iso8601weekspec: tWZONE tUNUMBER */ +#line 435 "./parsedate.y" + { + ((struct date_yy *)parm)->yyDay = ((yyvsp[0].Number) / 10) * 7 + ((yyvsp[0].Number) % 10) - 8; + } +#line 1742 "parsedate.c" + break; + + case 53: /* iso8601weekspec: tWZONE tUNUMBER tSNUMBER */ +#line 438 "./parsedate.y" + { + ((struct date_yy *)parm)->yyDay = (yyvsp[-1].Number) * 7 - (yyvsp[0].Number) - 8; + } +#line 1750 "parsedate.c" + break; + + case 55: /* iso8601time: tUNUMBER sec_fraction_part iso8601zonepart */ +#line 445 "./parsedate.y" + { + int i = (yyvsp[-2].Number); + + if(i <= -100000 || i >= 100000) { + ((struct date_yy *)parm)->yyHour = i / 10000; + i %= 10000; + ((struct date_yy *)parm)->yyMinutes = i / 100; + i %= 100; + ((struct date_yy *)parm)->yySeconds = i; + } else if(i <= -1000 || i >= 1000) { + ((struct date_yy *)parm)->yyHour = i / 100; + i %= 100; + ((struct date_yy *)parm)->yyMinutes = i; + ((struct date_yy *)parm)->yySeconds = 0; + } else if(i >= -99 && i <= 99) { + ((struct date_yy *)parm)->yyHour = i; + ((struct date_yy *)parm)->yyMinutes = 0; + ((struct date_yy *)parm)->yySeconds = 0; + } else { + ((struct date_yy *)parm)->yyHaveTime = 0; + } + ((struct date_yy *)parm)->yyMeridian = MER24; + } +#line 1778 "parsedate.c" + break; + + case 56: /* rel: relunit tAGO */ +#line 470 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelSeconds = + -((struct date_yy *)parm)->yyRelSeconds; + ((struct date_yy *)parm)->yyRelMinutes = + -((struct date_yy *)parm)->yyRelMinutes; + ((struct date_yy *)parm)->yyRelHour = + -((struct date_yy *)parm)->yyRelHour; + ((struct date_yy *)parm)->yyRelDay = + -((struct date_yy *)parm)->yyRelDay; + ((struct date_yy *)parm)->yyRelMonth = + -((struct date_yy *)parm)->yyRelMonth; + ((struct date_yy *)parm)->yyRelYear = + -((struct date_yy *)parm)->yyRelYear; + } +#line 1797 "parsedate.c" + break; + + case 58: /* relunit: tUNUMBER tYEAR_UNIT */ +#line 487 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelYear += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1805 "parsedate.c" + break; + + case 59: /* relunit: tSNUMBER tYEAR_UNIT */ +#line 490 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelYear += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1813 "parsedate.c" + break; + + case 60: /* relunit: tYEAR_UNIT */ +#line 493 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelYear += (yyvsp[0].Number); + } +#line 1821 "parsedate.c" + break; + + case 61: /* relunit: tUNUMBER tMONTH_UNIT */ +#line 496 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1829 "parsedate.c" + break; + + case 62: /* relunit: tSNUMBER tMONTH_UNIT */ +#line 499 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelMonth += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1837 "parsedate.c" + break; + + case 63: /* relunit: tMONTH_UNIT */ +#line 502 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelMonth += (yyvsp[0].Number); + } +#line 1845 "parsedate.c" + break; + + case 64: /* relunit: tUNUMBER tDAY_UNIT */ +#line 505 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelDay += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1853 "parsedate.c" + break; + + case 65: /* relunit: tSNUMBER tDAY_UNIT */ +#line 508 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelDay += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1861 "parsedate.c" + break; + + case 66: /* relunit: tDAY_UNIT */ +#line 511 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelDay += (yyvsp[0].Number); + } +#line 1869 "parsedate.c" + break; + + case 67: /* relunit: tUNUMBER tHOUR_UNIT */ +#line 514 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelHour += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1877 "parsedate.c" + break; + + case 68: /* relunit: tSNUMBER tHOUR_UNIT */ +#line 517 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelHour += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1885 "parsedate.c" + break; + + case 69: /* relunit: tHOUR_UNIT */ +#line 520 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelHour += (yyvsp[0].Number); + } +#line 1893 "parsedate.c" + break; + + case 70: /* relunit: tUNUMBER tMINUTE_UNIT */ +#line 523 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1901 "parsedate.c" + break; + + case 71: /* relunit: tSNUMBER tMINUTE_UNIT */ +#line 526 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1909 "parsedate.c" + break; + + case 72: /* relunit: tMINUTE_UNIT */ +#line 529 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelMinutes += (yyvsp[0].Number); + } +#line 1917 "parsedate.c" + break; + + case 73: /* relunit: tUNUMBER tSEC_UNIT */ +#line 532 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1925 "parsedate.c" + break; + + case 74: /* relunit: tSNUMBER tSEC_UNIT */ +#line 535 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[-1].Number) * (yyvsp[0].Number); + } +#line 1933 "parsedate.c" + break; + + case 75: /* relunit: tSEC_UNIT */ +#line 538 "./parsedate.y" + { + ((struct date_yy *)parm)->yyRelSeconds += (yyvsp[0].Number); + } +#line 1941 "parsedate.c" + break; + + case 76: /* number: tUNUMBER */ +#line 544 "./parsedate.y" + { + if(((struct date_yy *)parm)->yyHaveTime && + ((struct date_yy *)parm)->yyHaveDate && + !((struct date_yy *)parm)->yyHaveRel) + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number); + else + { + if((yyvsp[0].Number) > 10000) + { + ((struct date_yy *)parm)->yyHaveDate++; + ((struct date_yy *)parm)->yyDay= ((yyvsp[0].Number))%100; + ((struct date_yy *)parm)->yyMonth= ((yyvsp[0].Number)/100)%100; + ((struct date_yy *)parm)->yyYear = (yyvsp[0].Number)/10000; + } + else + { + ((struct date_yy *)parm)->yyHaveTime++; + if((yyvsp[0].Number) < 100) + { + ((struct date_yy *)parm)->yyHour = (yyvsp[0].Number); + ((struct date_yy *)parm)->yyMinutes = 0; + } + else + { + ((struct date_yy *)parm)->yyHour = (yyvsp[0].Number) / 100; + ((struct date_yy *)parm)->yyMinutes = (yyvsp[0].Number) % 100; + } + ((struct date_yy *)parm)->yySeconds = 0; + ((struct date_yy *)parm)->yyMeridian = MER24; + } + } + } +#line 1978 "parsedate.c" + break; + + case 77: /* o_merid: tMERIDIAN */ +#line 579 "./parsedate.y" + { + ((struct date_yy *)parm)->yyMeridian = (yyvsp[0].Meridian); + } +#line 1986 "parsedate.c" + break; + + +#line 1990 "parsedate.c" + + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == RAPTOR_PARSEDATE_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + yyerror (parm, YY_("syntax error")); + } + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= RAPTOR_PARSEDATE_EOF) + { + /* Return failure if at end of input. */ + if (yychar == RAPTOR_PARSEDATE_EOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, parm); + yychar = RAPTOR_PARSEDATE_EMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp, parm); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturnlab; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturnlab; + + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ +yyexhaustedlab: + yyerror (parm, YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != RAPTOR_PARSEDATE_EMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, parm); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, parm); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + + return yyresult; +} + +#line 584 "./parsedate.y" + + +time_t get_date (char *p, time_t *now); + +/* Month and day table. */ +static TABLE const MonthDayTable[] = { + { "january", tMONTH, 1 }, + { "february", tMONTH, 2 }, + { "march", tMONTH, 3 }, + { "april", tMONTH, 4 }, + { "may", tMONTH, 5 }, + { "june", tMONTH, 6 }, + { "july", tMONTH, 7 }, + { "august", tMONTH, 8 }, + { "september", tMONTH, 9 }, + { "sept", tMONTH, 9 }, + { "october", tMONTH, 10 }, + { "november", tMONTH, 11 }, + { "december", tMONTH, 12 }, + { "sunday", tDAY, 0 }, + { "monday", tDAY, 1 }, + { "tuesday", tDAY, 2 }, + { "tues", tDAY, 2 }, + { "wednesday", tDAY, 3 }, + { "wednes", tDAY, 3 }, + { "thursday", tDAY, 4 }, + { "thur", tDAY, 4 }, + { "thurs", tDAY, 4 }, + { "friday", tDAY, 5 }, + { "saturday", tDAY, 6 }, + { NULL, 0, 0 } +}; + +/* Time units table. */ +static TABLE const UnitsTable[] = { + { "year", tYEAR_UNIT, 1 }, + { "month", tMONTH_UNIT, 1 }, + { "fortnight", tDAY_UNIT, 14 }, + { "week", tDAY_UNIT, 7 }, + { "day", tDAY_UNIT, 1 }, + { "hour", tHOUR_UNIT, 1 }, + { "minute", tMINUTE_UNIT, 1 }, + { "min", tMINUTE_UNIT, 1 }, + { "second", tSEC_UNIT, 1 }, + { "sec", tSEC_UNIT, 1 }, + { NULL, 0, 0 } +}; + +/* Assorted relative-time words. */ +static TABLE const OtherTable[] = { + { "tomorrow", tDAY_UNIT, 1 }, + { "yesterday", tDAY_UNIT, -1 }, + { "today", tDAY_UNIT, 0 }, + { "now", tDAY_UNIT, 0 }, + { "last", tUNUMBER, -1 }, + { "this", tUNUMBER, 0 }, + { "next", tUNUMBER, 1 }, + { "first", tUNUMBER, 1 }, +/* { "second", tUNUMBER, 2 }, */ + { "third", tUNUMBER, 3 }, + { "fourth", tUNUMBER, 4 }, + { "fifth", tUNUMBER, 5 }, + { "sixth", tUNUMBER, 6 }, + { "seventh", tUNUMBER, 7 }, + { "eighth", tUNUMBER, 8 }, + { "ninth", tUNUMBER, 9 }, + { "tenth", tUNUMBER, 10 }, + { "eleventh", tUNUMBER, 11 }, + { "twelfth", tUNUMBER, 12 }, + { "ago", tAGO, 1 }, + { NULL, 0, 0 } +}; + +/* The timezone table. */ +static TABLE const TimezoneTable[] = { + { "gmt", tZONE, HOUR ( 0) }, /* Greenwich Mean */ + { "ut", tZONE, HOUR ( 0) }, /* Universal (Coordinated) */ + { "utc", tZONE, HOUR ( 0) }, + { "wet", tZONE, HOUR ( 0) }, /* Western European */ + { "bst", tDAYZONE, HOUR ( 0) }, /* British Summer */ + { "wat", tZONE, HOUR ( 1) }, /* West Africa */ + { "at", tZONE, HOUR ( 2) }, /* Azores */ +#if 0 + /* For completeness. BST is also British Summer, and GST is + * also Guam Standard. */ + { "bst", tZONE, HOUR ( 3) }, /* Brazil Standard */ + { "gst", tZONE, HOUR ( 3) }, /* Greenland Standard */ +#endif +#if 0 + { "nft", tZONE, HOUR (3.5) }, /* Newfoundland */ + { "nst", tZONE, HOUR (3.5) }, /* Newfoundland Standard */ + { "ndt", tDAYZONE, HOUR (3.5) }, /* Newfoundland Daylight */ +#endif + { "ast", tZONE, HOUR ( 4) }, /* Atlantic Standard */ + { "adt", tDAYZONE, HOUR ( 4) }, /* Atlantic Daylight */ + { "est", tZONE, HOUR ( 5) }, /* Eastern Standard */ + { "edt", tDAYZONE, HOUR ( 5) }, /* Eastern Daylight */ + { "cst", tZONE, HOUR ( 6) }, /* Central Standard */ + { "cdt", tDAYZONE, HOUR ( 6) }, /* Central Daylight */ + { "mst", tZONE, HOUR ( 7) }, /* Mountain Standard */ + { "mdt", tDAYZONE, HOUR ( 7) }, /* Mountain Daylight */ + { "pst", tZONE, HOUR ( 8) }, /* Pacific Standard */ + { "pdt", tDAYZONE, HOUR ( 8) }, /* Pacific Daylight */ + { "yst", tZONE, HOUR ( 9) }, /* Yukon Standard */ + { "ydt", tDAYZONE, HOUR ( 9) }, /* Yukon Daylight */ + { "hst", tZONE, HOUR (10) }, /* Hawaii Standard */ + { "hdt", tDAYZONE, HOUR (10) }, /* Hawaii Daylight */ + { "cat", tZONE, HOUR (10) }, /* Central Alaska */ + { "akst", tZONE, HOUR (10) }, /* Alaska Standard */ + { "akdt", tZONE, HOUR (10) }, /* Alaska Daylight */ + { "ahst", tZONE, HOUR (10) }, /* Alaska-Hawaii Standard */ + { "nt", tZONE, HOUR (11) }, /* Nome */ + { "idlw", tZONE, HOUR (12) }, /* International Date Line West */ + { "cet", tZONE, -HOUR (1) }, /* Central European */ + { "cest", tDAYZONE, -HOUR (1) }, /* Central European Summer */ + { "met", tZONE, -HOUR (1) }, /* Middle European */ + { "mewt", tZONE, -HOUR (1) }, /* Middle European Winter */ + { "mest", tDAYZONE, -HOUR (1) }, /* Middle European Summer */ + { "mesz", tDAYZONE, -HOUR (1) }, /* Middle European Summer */ + { "swt", tZONE, -HOUR (1) }, /* Swedish Winter */ + { "sst", tDAYZONE, -HOUR (1) }, /* Swedish Summer */ + { "fwt", tZONE, -HOUR (1) }, /* French Winter */ + { "fst", tDAYZONE, -HOUR (1) }, /* French Summer */ + { "eet", tZONE, -HOUR (2) }, /* Eastern Europe, USSR Zone 1 */ + { "bt", tZONE, -HOUR (3) }, /* Baghdad, USSR Zone 2 */ +#if 0 + { "it", tZONE, -HOUR (3.5) },/* Iran */ +#endif + { "zp4", tZONE, -HOUR (4) }, /* USSR Zone 3 */ + { "zp5", tZONE, -HOUR (5) }, /* USSR Zone 4 */ +#if 0 + { "ist", tZONE, -HOUR (5.5) },/* Indian Standard */ +#endif + { "zp6", tZONE, -HOUR (6) }, /* USSR Zone 5 */ +#if 0 + /* For completeness. NST is also Newfoundland Standard, and SST is + * also Swedish Summer. */ + { "nst", tZONE, -HOUR (6.5) },/* North Sumatra */ + { "sst", tZONE, -HOUR (7) }, /* South Sumatra, USSR Zone 6 */ +#endif /* 0 */ + { "wast", tZONE, -HOUR (7) }, /* West Australian Standard */ + { "wadt", tDAYZONE, -HOUR (7) }, /* West Australian Daylight */ +#if 0 + { "jt", tZONE, -HOUR (7.5) },/* Java (3pm in Cronusland!) */ +#endif + { "cct", tZONE, -HOUR (8) }, /* China Coast, USSR Zone 7 */ + { "jst", tZONE, -HOUR (9) }, /* Japan Standard, USSR Zone 8 */ +#if 0 + { "cast", tZONE, -HOUR (9.5) },/* Central Australian Standard */ + { "cadt", tDAYZONE, -HOUR (9.5) },/* Central Australian Daylight */ +#endif + { "east", tZONE, -HOUR (10) }, /* Eastern Australian Standard */ + { "eadt", tDAYZONE, -HOUR (10) }, /* Eastern Australian Daylight */ + { "gst", tZONE, -HOUR (10) }, /* Guam Standard, USSR Zone 9 */ + { "nzt", tZONE, -HOUR (12) }, /* New Zealand */ + { "nzst", tZONE, -HOUR (12) }, /* New Zealand Standard */ + { "nzdt", tDAYZONE, -HOUR (12) }, /* New Zealand Daylight */ + { "idle", tZONE, -HOUR (12) }, /* International Date Line East */ + { NULL, 0, 0 } +}; + +/* Military timezone table. */ +static TABLE const MilitaryTable[] = { + { "a", tZONE, HOUR (- 1) }, + { "b", tZONE, HOUR (- 2) }, + { "c", tZONE, HOUR (- 3) }, + { "d", tZONE, HOUR (- 4) }, + { "e", tZONE, HOUR (- 5) }, + { "f", tZONE, HOUR (- 6) }, + { "g", tZONE, HOUR (- 7) }, + { "h", tZONE, HOUR (- 8) }, + { "i", tZONE, HOUR (- 9) }, + { "k", tZONE, HOUR (-10) }, + { "l", tZONE, HOUR (-11) }, + { "m", tZONE, HOUR (-12) }, + { "n", tZONE, HOUR ( 1) }, + { "o", tZONE, HOUR ( 2) }, + { "p", tZONE, HOUR ( 3) }, + { "q", tZONE, HOUR ( 4) }, + { "r", tZONE, HOUR ( 5) }, + { "s", tZONE, HOUR ( 6) }, + { "t", tTZONE, HOUR ( 7) }, + { "u", tZONE, HOUR ( 8) }, + { "v", tZONE, HOUR ( 9) }, + { "w", tWZONE, HOUR ( 10) }, + { "x", tZONE, HOUR ( 11) }, + { "y", tZONE, HOUR ( 12) }, + { "z", tZZONE, HOUR ( 0) }, + { NULL, 0, 0 } +}; + + + + +/* ARGSUSED */ +static int +yyerror(void* parm, const char *s) +{ + return 0; +} + +static int +ToHour(int Hours, MERIDIAN Meridian) +{ + switch (Meridian) + { + case MER24: + if(Hours < 0 || Hours > 23) + return -1; + return Hours; + case MERam: + if(Hours < 1 || Hours > 12) + return -1; + if(Hours == 12) + Hours = 0; + return Hours; + case MERpm: + if(Hours < 1 || Hours > 12) + return -1; + if(Hours == 12) + Hours = 0; + return Hours + 12; + default: +#ifdef RAPTOR_DEBUG + fprintf(stderr, "%s:%d:%s: UNKNOWN Meridian %d - add a new case", + __FILE__, __LINE__, __FUNCTION__, (int)Meridian); +#endif + return -1; + } + /* NOTREACHED */ +} + +static int +ToYear(int Year) +{ + if(Year < 0) + Year = -Year; + + /* XPG4 suggests that years 00-68 map to 2000-2068, and + years 69-99 map to 1969-1999. */ + if(Year < 69) + Year += 2000; + else if(Year < 100) + Year += 1900; + + return Year; +} + +static int +LookupWord (YYSTYPE *lvalp, char *buff) +{ + char *p; + char *q; + const TABLE *tp; + int i; + int abbrev; + + /* Make it lowercase. */ + for(p = buff; *p; p++) + if(isupper ((unsigned char) *p)) + *p = tolower (*p); + + if(strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) + { + lvalp->Meridian = MERam; + return tMERIDIAN; + } + if(strcmp (buff, "pm") == 0 || strcmp (buff, "p.m.") == 0) + { + lvalp->Meridian = MERpm; + return tMERIDIAN; + } + + /* See if we have an abbreviation for a month. */ + if(strlen (buff) == 3) + abbrev = 1; + else if(strlen (buff) == 4 && buff[3] == '.') + { + abbrev = 1; + buff[3] = '\0'; + } + else + abbrev = 0; + + for(tp = MonthDayTable; tp->name; tp++) + { + if(abbrev) + { + if(strncmp (buff, tp->name, 3) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + } + else if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + } + + for(tp = TimezoneTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + + if(strcmp (buff, "dst") == 0) + return tDST; + + for(tp = UnitsTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + + /* Strip off any plural and try the units table again. */ + i = RAPTOR_BAD_CAST(int, strlen(buff)) - 1; + if(buff[i] == 's') + { + buff[i] = '\0'; + for(tp = UnitsTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + buff[i] = 's'; /* Put back for "this" in OtherTable. */ + } + + for(tp = OtherTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + + /* Military timezones. */ + if(buff[1] == '\0' && isalpha ((unsigned char) *buff)) + { + for(tp = MilitaryTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + } + + /* Drop out any periods and try the timezone table again. */ + for(i = 0, p = q = buff; *q; q++) + if(*q != '.') + *p++ = *q; + else + i++; + *p = '\0'; + if(i) + for(tp = TimezoneTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + + return tID; +} + +int yylex(YYSTYPE *lvalp, void *parm) +{ + unsigned char c; + char *p; + char buff[20]; + int Count; + int sign; + struct date_yy * date = (struct date_yy *)parm; + + for(;;) + { + while(isspace ((unsigned char) *date->yyInput)) + date->yyInput++; + + if(isdigit (c = *date->yyInput) || c == '-' || c == '+') + { + if(c == '-' || c == '+') + { + sign = c == '-' ? -1 : 1; + if(!ISDIGIT (*++date->yyInput)) + /* skip the '-' sign */ + continue; + } + else + sign = 0; + for(lvalp->Number = 0; ISDIGIT (c = *date->yyInput++);) + lvalp->Number = 10 * lvalp->Number + c - '0'; + date->yyInput--; + if(sign < 0) + lvalp->Number = -lvalp->Number; + /* Ignore ordinal suffixes on numbers */ + c = *date->yyInput; + if(c == 's' || c == 'n' || c == 'r' || c == 't') { + c = *++date->yyInput; + if(c == 't' || c == 'd' || c == 'h') { + date->yyInput++; + } else { + date->yyInput--; + } + } + return sign ? tSNUMBER : tUNUMBER; + } + if(isalpha (c)) + { + for(p = buff; (c = *date->yyInput++, isalpha (c)) || c == '.';) + if(p < &buff[sizeof buff - 1]) + *p++ = c; + *p = '\0'; + date->yyInput--; + return LookupWord (lvalp, buff); + } + if(c != '(') + return *date->yyInput++; + Count = 0; + do + { + c = *date->yyInput++; + if(c == '\0') + return c; + if(c == '(') + Count++; + else if(c == ')') + Count--; + } + while(Count > 0); + } +} + +#define TM_YEAR_ORIGIN 1900 + +/* Yield A - B, measured in seconds. */ +static long +difftm (struct tm *a, struct tm *b) +{ + int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); + int by = b->tm_year + (TM_YEAR_ORIGIN - 1); + long days = ( + /* difference in day of year */ + a->tm_yday - b->tm_yday + /* + intervening leap days */ + + ((ay >> 2) - (by >> 2)) + - (ay / 100 - by / 100) + + ((ay / 100 >> 2) - (by / 100 >> 2)) + /* + difference in years * 365 */ + + (long) (ay - by) * 365 + ); + return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); +} + +time_t raptor_parse_date(const char *p, time_t *now) +{ + struct tm tm, tm0, *tmp; + time_t Start; + struct date_yy date; + + date.yyInput = p; + Start = now ? *now : time ((time_t *) NULL); + tmp = localtime (&Start); + if(!tmp) + return -1; + date.yyYear = tmp->tm_year + TM_YEAR_ORIGIN; + date.yyMonth = tmp->tm_mon + 1; + date.yyDay = tmp->tm_mday; + date.yyHour = tmp->tm_hour; + date.yyMinutes = tmp->tm_min; + date.yySeconds = tmp->tm_sec; + tm.tm_isdst = tmp->tm_isdst; + date.yyMeridian = MER24; + date.yyRelSeconds = 0; + date.yyRelMinutes = 0; + date.yyRelHour = 0; + date.yyRelDay = 0; + date.yyRelMonth = 0; + date.yyRelYear = 0; + date.yyHaveDate = 0; + date.yyHaveDay = 0; + date.yyHaveRel = 0; + date.yyHaveTime = 0; + date.yyHaveZone = 0; + + if(yyparse (&date) + || date.yyHaveTime > 1 || date.yyHaveZone > 1 + || date.yyHaveDate > 1 || date.yyHaveDay > 1) { + return -1; + } + tm.tm_year = ToYear (date.yyYear) - TM_YEAR_ORIGIN + date.yyRelYear; + tm.tm_mon = date.yyMonth - 1 + date.yyRelMonth; + tm.tm_mday = date.yyDay + date.yyRelDay; + if(date.yyHaveTime || (date.yyHaveRel && !date.yyHaveDate && !date.yyHaveDay)) + { + tm.tm_hour = ToHour (date.yyHour, date.yyMeridian); + if(tm.tm_hour < 0) + return -1; + tm.tm_min = date.yyMinutes; + tm.tm_sec = date.yySeconds; + } + else + { + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + } + tm.tm_hour += date.yyRelHour; + tm.tm_min += date.yyRelMinutes; + tm.tm_sec += date.yyRelSeconds; + + /* Let mktime deduce tm_isdst if we have an absolute timestamp, + or if the relative timestamp mentions days, months, or years. */ + if(date.yyHaveDate | date.yyHaveDay | date.yyHaveTime | date.yyRelDay | date.yyRelMonth | date.yyRelYear) + tm.tm_isdst = -1; + + tm0 = tm; + + Start = mktime (&tm); + + if(Start == (time_t) -1) + { + + /* Guard against falsely reporting errors near the time_t boundaries + when parsing times in other time zones. For example, if the min + time_t value is 1970-01-01 00:00:00 UTC and we are 8 hours ahead + of UTC, then the min localtime value is 1970-01-01 08:00:00; if + we apply mktime to 1970-01-01 00:00:00 we will get an error, so + we apply mktime to 1970-01-02 08:00:00 instead and adjust the time + zone by 24 hours to compensate. This algorithm assumes that + there is no DST transition within a day of the time_t boundaries. */ + if(date.yyHaveZone) + { + tm = tm0; + if(tm.tm_year <= EPOCH - TM_YEAR_ORIGIN) + { + tm.tm_mday++; + date.yyTimezone -= 24 * 60; + } + else + { + tm.tm_mday--; + date.yyTimezone += 24 * 60; + } + Start = mktime (&tm); + } + + if(Start == (time_t) -1) + return Start; + } + + if(date.yyHaveDay && !date.yyHaveDate) + { + tm.tm_mday += ((date.yyDayNumber - tm.tm_wday + 7) % 7 + + 7 * (date.yyDayOrdinal - (0 < date.yyDayOrdinal))); + Start = mktime (&tm); + if(Start == (time_t) -1) + return Start; + } + + if(date.yyHaveZone) + { + long delta; + struct tm *gmt = gmtime (&Start); + if(!gmt) + return -1; + delta = date.yyTimezone * 60L + difftm (&tm, gmt); + + if((Start + delta < Start) != (delta < 0)) + return -1; /* time_t overflow */ + Start += delta; + } + + return Start; +} diff --git a/src/parsedate.h b/src/parsedate.h new file mode 100644 index 0000000..ad62b5a --- /dev/null +++ b/src/parsedate.h @@ -0,0 +1,96 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 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, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_RAPTOR_PARSEDATE_PARSEDATE_H_INCLUDED +# define YY_RAPTOR_PARSEDATE_PARSEDATE_H_INCLUDED +/* Debug traces. */ +#ifndef RAPTOR_PARSEDATE_DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define RAPTOR_PARSEDATE_DEBUG 1 +# else +# define RAPTOR_PARSEDATE_DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define RAPTOR_PARSEDATE_DEBUG 0 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined RAPTOR_PARSEDATE_DEBUG */ +#if RAPTOR_PARSEDATE_DEBUG +extern int raptor_parsedate_debug; +#endif + +/* Token kinds. */ +#ifndef RAPTOR_PARSEDATE_TOKENTYPE +# define RAPTOR_PARSEDATE_TOKENTYPE + enum raptor_parsedate_tokentype + { + RAPTOR_PARSEDATE_EMPTY = -2, + RAPTOR_PARSEDATE_EOF = 0, /* "end of file" */ + RAPTOR_PARSEDATE_error = 256, /* error */ + RAPTOR_PARSEDATE_UNDEF = 257, /* "invalid token" */ + tAGO = 258, /* tAGO */ + tDAY = 259, /* tDAY */ + tDAY_UNIT = 260, /* tDAY_UNIT */ + tDAYZONE = 261, /* tDAYZONE */ + tDST = 262, /* tDST */ + tHOUR_UNIT = 263, /* tHOUR_UNIT */ + tID = 264, /* tID */ + tTZONE = 265, /* tTZONE */ + tWZONE = 266, /* tWZONE */ + tZZONE = 267, /* tZZONE */ + tMERIDIAN = 268, /* tMERIDIAN */ + tMINUTE_UNIT = 269, /* tMINUTE_UNIT */ + tMONTH = 270, /* tMONTH */ + tMONTH_UNIT = 271, /* tMONTH_UNIT */ + tSEC_UNIT = 272, /* tSEC_UNIT */ + tSNUMBER = 273, /* tSNUMBER */ + tUNUMBER = 274, /* tUNUMBER */ + tYEAR_UNIT = 275, /* tYEAR_UNIT */ + tZONE = 276 /* tZONE */ + }; + typedef enum raptor_parsedate_tokentype raptor_parsedate_token_kind_t; +#endif + +/* Value type. */ + + + + +int raptor_parsedate_parse (struct date_yy *parm); + + +#endif /* !YY_RAPTOR_PARSEDATE_PARSEDATE_H_INCLUDED */ diff --git a/src/parsedate.y b/src/parsedate.y new file mode 100644 index 0000000..77f5d4f --- /dev/null +++ b/src/parsedate.y @@ -0,0 +1,1161 @@ +%{ +/* + * Imported from the public domain source in PHP 4.4 + * Fri May 20 07:14:01 2005 + * https://github.com/php/php-src/blob/379c4af44aa6456fbdbc69dba3ead166ba7ff67d/ext/standard/parsedate.y + * + * and patched from there + * + * Later versions removed this from PHP and replaced it with entirely + * new code written under the PHP license. That code is not used here + * and cannot be used. + * + */ + + +/* +** Originally written by Steven M. Bellovin while +** at the University of North Carolina at Chapel Hill. Later tweaked by +** a couple of people on Usenet. Completely overhauled by Rich $alz +** and Jim Berets in August, 1990. +** +** This code is in the public domain and has no copyright. +*/ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_TIME_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#if defined(_HPUX_SOURCE) +#include +#endif + +#include "raptor2.h" +#include "raptor_internal.h" + + +#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) + +#ifdef HAVE_STRING_H +# include +#endif + +#if !defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) +# define __attribute__(x) +#endif + +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + +/* Some old versions of bison generate parsers that use bcopy. + That loses on systems that don't provide the function, so we have + to redefine it here. */ +#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy) +# define bcopy(from, to, len) memcpy ((to), (from), (len)) +#endif + +/* Prototypes */ +static int raptor_parsedate_error(void* parm, const char *msg); + + +#define EPOCH 1970 +#define HOUR(x) ((x) * 60) + +#define MAX_BUFF_LEN 128 /* size of buffer to read the date into */ + +/* +** An entry in the lexical lookup table. +*/ +typedef struct _TABLE { + const char *name; + int type; + int value; +} TABLE; + + +/* +** Meridian: am, pm, or 24-hour style. +*/ +typedef enum _MERIDIAN { + MERam, MERpm, MER24 +} MERIDIAN; + +struct date_yy { + const char *yyInput; + int yyDayOrdinal; + int yyDayNumber; + int yyHaveDate; + int yyHaveDay; + int yyHaveRel; + int yyHaveTime; + int yyHaveZone; + int yyTimezone; + int yyDay; + int yyHour; + int yyMinutes; + int yyMonth; + int yySeconds; + int yyYear; + MERIDIAN yyMeridian; + int yyRelDay; + int yyRelHour; + int yyRelMinutes; + int yyRelMonth; + int yyRelSeconds; + int yyRelYear; +}; + +typedef union _date_ll { + int Number; + enum _MERIDIAN Meridian; +} date_ll; + +#define YYPARSE_PARAM parm +#define YYLEX_PARAM parm +#define YYSTYPE date_ll +#define YYLTYPE void + +static int yylex (YYSTYPE *lvalp, void *parm); + +static int ToHour (int Hours, MERIDIAN Meridian); +static int ToYear (int Year); +static int LookupWord (YYSTYPE *lvalp, char *buff); + +%} + +/* directives */ + +%require "3.0" + +/* File prefix (bison -b) */ +%file-prefix "parsedate" + +/* Symbol prefix (bison -d : deprecated) */ +%define api.prefix {raptor_parsedate_} + +/* Write parser header file with macros (bison -d) */ +%defines + +/* Write output file with verbose descriptions of parser states */ +%verbose + +%define api.pure true + +/* This grammar has 56 shift/reduce conflicts. */ +%expect 56 + +%param { struct date_yy *parm } + +%token tAGO tDAY tDAY_UNIT tDAYZONE tDST tHOUR_UNIT tID tTZONE tWZONE tZZONE +%token tMERIDIAN tMINUTE_UNIT tMONTH tMONTH_UNIT +%token tSEC_UNIT tSNUMBER tUNUMBER tYEAR_UNIT tZONE + +%type tDAY tDAY_UNIT tDAYZONE tHOUR_UNIT tMINUTE_UNIT +%type tMONTH tMONTH_UNIT +%type tSEC_UNIT tSNUMBER tUNUMBER tYEAR_UNIT tZONE tTZONE tWZONE tZZONE +%type tMERIDIAN + +%% + +spec : /* NULL */ + | spec item + ; + +item : time { + ((struct date_yy *)parm)->yyHaveTime++; + } + | zone { + ((struct date_yy *)parm)->yyHaveZone++; + } + | date { + ((struct date_yy *)parm)->yyHaveDate++; + } + | day { + ((struct date_yy *)parm)->yyHaveDay++; + } + | rel { + ((struct date_yy *)parm)->yyHaveRel++; + } + | number + | o_merid + ; + +time : tUNUMBER tMERIDIAN { + ((struct date_yy *)parm)->yyHour = $1; + ((struct date_yy *)parm)->yyMinutes = 0; + ((struct date_yy *)parm)->yySeconds = 0; + ((struct date_yy *)parm)->yyMeridian = $2; + } + | iso8601time_colon + /* | pgsqltime ... shares a common spec with ISO8601 */ + ; + +iso8601time_colon: HMStime_with_colon sec_fraction_part rel { + ((struct date_yy *)parm)->yyMeridian = MER24; + } + | HMtime_with_colon sec_fraction_part rel { + ((struct date_yy *)parm)->yyMeridian = MER24; + ((struct date_yy *)parm)->yySeconds = 0; + } + | HMStime_with_colon sec_fraction_part iso8601zonepart { + ((struct date_yy *)parm)->yyMeridian = MER24; + } + | HMtime_with_colon sec_fraction_part iso8601zonepart { + ((struct date_yy *)parm)->yyMeridian = MER24; + ((struct date_yy *)parm)->yySeconds = 0; + } + ; + +iso8601zonepart: zonepart_numeric_without_colon { + ((struct date_yy *)parm)->yyHaveZone++; + } + | zonepart_numeric_with_colon { + ((struct date_yy *)parm)->yyHaveZone++; + } + | zone { + ((struct date_yy *)parm)->yyHaveZone++; + } + | /* empty */ + ; + +sec_fraction_part: '.' tUNUMBER { + } + | /* empty */ + ; + +zonepart_numeric_without_colon: tSNUMBER { + /* format: [+-]hhmm */ + if($1 <= -100 || $1 >= 100) { + ((struct date_yy *)parm)->yyTimezone = (-$1 / 100) * 60 + (-$1 % 100); + } else if($1 >= -99 && $1 <= 99) { + ((struct date_yy *)parm)->yyTimezone = -$1 * 60; + } + } + ; + +zonepart_numeric_with_colon: tSNUMBER ':' tUNUMBER { + /* format: [+-]hh:mm */ + ((struct date_yy *)parm)->yyTimezone = -$1 * 60 + ($1 > 0 ? -$3: $3); + } + ; + +HMStime_with_colon: HMtime_with_colon ':' tUNUMBER { + /* format: hh:mm:ss */ + ((struct date_yy *)parm)->yySeconds = $3; + } + ; + +HMtime_with_colon: tUNUMBER ':' tUNUMBER { + /* format: hh:mm */ + ((struct date_yy *)parm)->yyHour = $1; + ((struct date_yy *)parm)->yyMinutes = $3; + } + ; + + + /* we have to deal with a special case for the datetime format + of XML Schema here: '2003-11-18T22:40:00Z' + the combination of a 'T' timezone specifier later followed + by a 'Z' is now recognized and allowed + TODO: change the grammer so that the exact positions are checked + right now '2003-11-18 22:40:00 TZ' is also accepted (hartmut) + */ + +zone : tTZONE { + ((struct date_yy *)parm)->yyTimezone = $1; + } + | tWZONE { + ((struct date_yy *)parm)->yyTimezone = $1; + } + | tZZONE { + ((struct date_yy *)parm)->yyTimezone = $1; + } + | tZONE { + ((struct date_yy *)parm)->yyTimezone = $1; + } + | tDAYZONE { + ((struct date_yy *)parm)->yyTimezone = $1 - 60; + } + | tZONE tDST { + ((struct date_yy *)parm)->yyTimezone = $1 - 60; + } + ; + +day : tDAY { + ((struct date_yy *)parm)->yyDayOrdinal = 1; + ((struct date_yy *)parm)->yyDayNumber = $1; + } + | tDAY ',' { + ((struct date_yy *)parm)->yyDayOrdinal = 1; + ((struct date_yy *)parm)->yyDayNumber = $1; + } + | tUNUMBER tDAY { + ((struct date_yy *)parm)->yyDayOrdinal = $1; + ((struct date_yy *)parm)->yyDayNumber = $2; + } + ; + +date : tUNUMBER '/' tUNUMBER { + ((struct date_yy *)parm)->yyMonth = $1; + ((struct date_yy *)parm)->yyDay = $3; + } + | tMONTH tUNUMBER tUNUMBER ':' tUNUMBER ':' tUNUMBER tUNUMBER { + ((struct date_yy *)parm)->yyYear = $8; + ((struct date_yy *)parm)->yyMonth = $1; + ((struct date_yy *)parm)->yyDay = $2; + + ((struct date_yy *)parm)->yyHour = $3; + ((struct date_yy *)parm)->yyMinutes = $5; + ((struct date_yy *)parm)->yySeconds = $7; + + ((struct date_yy *)parm)->yyHaveTime = 1; + } + | tUNUMBER '/' tUNUMBER '/' tUNUMBER { + /* Interpret as YYYY/MM/DD if $1 >= 1000, otherwise as MM/DD/YY. + The goal in recognizing YYYY/MM/DD is solely to support legacy + machine-generated dates like those in an RCS log listing. If + you want portability, use the ISO 8601 format. */ + if($1 >= 1000) + { + ((struct date_yy *)parm)->yyYear = $1; + ((struct date_yy *)parm)->yyMonth = $3; + ((struct date_yy *)parm)->yyDay = $5; + } + else + { + ((struct date_yy *)parm)->yyMonth = $1; + ((struct date_yy *)parm)->yyDay = $3; + ((struct date_yy *)parm)->yyYear = $5; + } + } + | iso8601date + | iso8601datetime { + ((struct date_yy *)parm)->yyHaveTime++; + } + | tUNUMBER tMONTH tSNUMBER { + /* e.g. 17-JUN-1992. */ + ((struct date_yy *)parm)->yyDay = $1; + ((struct date_yy *)parm)->yyMonth = $2; + ((struct date_yy *)parm)->yyYear = -$3; + } + | tMONTH tUNUMBER tUNUMBER { + ((struct date_yy *)parm)->yyMonth = $1; + ((struct date_yy *)parm)->yyDay = $2; + ((struct date_yy *)parm)->yyYear = $3; + } + | tMONTH tUNUMBER { + ((struct date_yy *)parm)->yyMonth = $1; + if($2 > 1000) { + ((struct date_yy *)parm)->yyYear = $2; + } else { + ((struct date_yy *)parm)->yyDay = $2; + } + } + | tMONTH tUNUMBER ',' tUNUMBER { + ((struct date_yy *)parm)->yyMonth = $1; + ((struct date_yy *)parm)->yyDay = $2; + ((struct date_yy *)parm)->yyYear = $4; + } + | tUNUMBER tMONTH { + ((struct date_yy *)parm)->yyMonth = $2; + if($1 > 1000) { + ((struct date_yy *)parm)->yyYear = $1; + } else { + ((struct date_yy *)parm)->yyDay = $1; + } + } + | tUNUMBER tMONTH tUNUMBER { + ((struct date_yy *)parm)->yyMonth = $2; + ((struct date_yy *)parm)->yyDay = $1; + ((struct date_yy *)parm)->yyYear = $3; + } + ; + +iso8601datetime: iso8601date tTZONE iso8601time + | tUNUMBER tTZONE iso8601time { + int i = $1; + + if(i >= 10000) { + /* format: yyyymmdd */ + ((struct date_yy *)parm)->yyYear = i / 10000; + i %= 10000; + ((struct date_yy *)parm)->yyMonth = i / 100; + i %= 100; + ((struct date_yy *)parm)->yyDay = i; + } else if(i >= 1000 && i <= 9999) { + /* format: yyyy */ + ((struct date_yy *)parm)->yyYear = i; + ((struct date_yy *)parm)->yyDay= 1; + ((struct date_yy *)parm)->yyMonth = 1; + } + } + ; + +iso8601date: tUNUMBER tSNUMBER tSNUMBER { + /* ISO 8601 format. yyyy-mm-dd. */ + ((struct date_yy *)parm)->yyYear = $1; + ((struct date_yy *)parm)->yyMonth = -$2; + ((struct date_yy *)parm)->yyDay = -$3; + } + | tUNUMBER tSNUMBER { + /* ISO 8601 format yyyy-mm */ + ((struct date_yy *)parm)->yyYear = $1; + ((struct date_yy *)parm)->yyMonth = -$2; + ((struct date_yy *)parm)->yyDay = 1; + } + | tUNUMBER iso8601weekspec { + const int om = (1 + 9) % 12; /* offset month */ + const int oy = $1 - 1; /* offset year */ + + ((struct date_yy *)parm)->yyYear = $1; + ((struct date_yy *)parm)->yyMonth = 1; + /* Zeller's formula */ + ((struct date_yy *)parm)->yyDay -= ((13 * om + 12) / 5 + + oy + oy / 4 + oy / 400 - oy / 100) % 7 - 1; + } + ; + +iso8601weekspec: tWZONE tUNUMBER { + ((struct date_yy *)parm)->yyDay = ($2 / 10) * 7 + ($2 % 10) - 8; + } + | tWZONE tUNUMBER tSNUMBER { + ((struct date_yy *)parm)->yyDay = $2 * 7 - $3 - 8; + } + ; + +iso8601time: + iso8601time_colon + | tUNUMBER sec_fraction_part iso8601zonepart { + int i = $1; + + if(i <= -100000 || i >= 100000) { + ((struct date_yy *)parm)->yyHour = i / 10000; + i %= 10000; + ((struct date_yy *)parm)->yyMinutes = i / 100; + i %= 100; + ((struct date_yy *)parm)->yySeconds = i; + } else if(i <= -1000 || i >= 1000) { + ((struct date_yy *)parm)->yyHour = i / 100; + i %= 100; + ((struct date_yy *)parm)->yyMinutes = i; + ((struct date_yy *)parm)->yySeconds = 0; + } else if(i >= -99 && i <= 99) { + ((struct date_yy *)parm)->yyHour = i; + ((struct date_yy *)parm)->yyMinutes = 0; + ((struct date_yy *)parm)->yySeconds = 0; + } else { + ((struct date_yy *)parm)->yyHaveTime = 0; + } + ((struct date_yy *)parm)->yyMeridian = MER24; + } + ; + +rel : relunit tAGO { + ((struct date_yy *)parm)->yyRelSeconds = + -((struct date_yy *)parm)->yyRelSeconds; + ((struct date_yy *)parm)->yyRelMinutes = + -((struct date_yy *)parm)->yyRelMinutes; + ((struct date_yy *)parm)->yyRelHour = + -((struct date_yy *)parm)->yyRelHour; + ((struct date_yy *)parm)->yyRelDay = + -((struct date_yy *)parm)->yyRelDay; + ((struct date_yy *)parm)->yyRelMonth = + -((struct date_yy *)parm)->yyRelMonth; + ((struct date_yy *)parm)->yyRelYear = + -((struct date_yy *)parm)->yyRelYear; + } + | relunit + ; + +relunit : tUNUMBER tYEAR_UNIT { + ((struct date_yy *)parm)->yyRelYear += $1 * $2; + } + | tSNUMBER tYEAR_UNIT { + ((struct date_yy *)parm)->yyRelYear += $1 * $2; + } + | tYEAR_UNIT { + ((struct date_yy *)parm)->yyRelYear += $1; + } + | tUNUMBER tMONTH_UNIT { + ((struct date_yy *)parm)->yyRelMonth += $1 * $2; + } + | tSNUMBER tMONTH_UNIT { + ((struct date_yy *)parm)->yyRelMonth += $1 * $2; + } + | tMONTH_UNIT { + ((struct date_yy *)parm)->yyRelMonth += $1; + } + | tUNUMBER tDAY_UNIT { + ((struct date_yy *)parm)->yyRelDay += $1 * $2; + } + | tSNUMBER tDAY_UNIT { + ((struct date_yy *)parm)->yyRelDay += $1 * $2; + } + | tDAY_UNIT { + ((struct date_yy *)parm)->yyRelDay += $1; + } + | tUNUMBER tHOUR_UNIT { + ((struct date_yy *)parm)->yyRelHour += $1 * $2; + } + | tSNUMBER tHOUR_UNIT { + ((struct date_yy *)parm)->yyRelHour += $1 * $2; + } + | tHOUR_UNIT { + ((struct date_yy *)parm)->yyRelHour += $1; + } + | tUNUMBER tMINUTE_UNIT { + ((struct date_yy *)parm)->yyRelMinutes += $1 * $2; + } + | tSNUMBER tMINUTE_UNIT { + ((struct date_yy *)parm)->yyRelMinutes += $1 * $2; + } + | tMINUTE_UNIT { + ((struct date_yy *)parm)->yyRelMinutes += $1; + } + | tUNUMBER tSEC_UNIT { + ((struct date_yy *)parm)->yyRelSeconds += $1 * $2; + } + | tSNUMBER tSEC_UNIT { + ((struct date_yy *)parm)->yyRelSeconds += $1 * $2; + } + | tSEC_UNIT { + ((struct date_yy *)parm)->yyRelSeconds += $1; + } + ; + +number : tUNUMBER + { + if(((struct date_yy *)parm)->yyHaveTime && + ((struct date_yy *)parm)->yyHaveDate && + !((struct date_yy *)parm)->yyHaveRel) + ((struct date_yy *)parm)->yyYear = $1; + else + { + if($1 > 10000) + { + ((struct date_yy *)parm)->yyHaveDate++; + ((struct date_yy *)parm)->yyDay= ($1)%100; + ((struct date_yy *)parm)->yyMonth= ($1/100)%100; + ((struct date_yy *)parm)->yyYear = $1/10000; + } + else + { + ((struct date_yy *)parm)->yyHaveTime++; + if($1 < 100) + { + ((struct date_yy *)parm)->yyHour = $1; + ((struct date_yy *)parm)->yyMinutes = 0; + } + else + { + ((struct date_yy *)parm)->yyHour = $1 / 100; + ((struct date_yy *)parm)->yyMinutes = $1 % 100; + } + ((struct date_yy *)parm)->yySeconds = 0; + ((struct date_yy *)parm)->yyMeridian = MER24; + } + } + } + ; + +o_merid : tMERIDIAN + { + ((struct date_yy *)parm)->yyMeridian = $1; + } + ; + +%% + +time_t get_date (char *p, time_t *now); + +/* Month and day table. */ +static TABLE const MonthDayTable[] = { + { "january", tMONTH, 1 }, + { "february", tMONTH, 2 }, + { "march", tMONTH, 3 }, + { "april", tMONTH, 4 }, + { "may", tMONTH, 5 }, + { "june", tMONTH, 6 }, + { "july", tMONTH, 7 }, + { "august", tMONTH, 8 }, + { "september", tMONTH, 9 }, + { "sept", tMONTH, 9 }, + { "october", tMONTH, 10 }, + { "november", tMONTH, 11 }, + { "december", tMONTH, 12 }, + { "sunday", tDAY, 0 }, + { "monday", tDAY, 1 }, + { "tuesday", tDAY, 2 }, + { "tues", tDAY, 2 }, + { "wednesday", tDAY, 3 }, + { "wednes", tDAY, 3 }, + { "thursday", tDAY, 4 }, + { "thur", tDAY, 4 }, + { "thurs", tDAY, 4 }, + { "friday", tDAY, 5 }, + { "saturday", tDAY, 6 }, + { NULL, 0, 0 } +}; + +/* Time units table. */ +static TABLE const UnitsTable[] = { + { "year", tYEAR_UNIT, 1 }, + { "month", tMONTH_UNIT, 1 }, + { "fortnight", tDAY_UNIT, 14 }, + { "week", tDAY_UNIT, 7 }, + { "day", tDAY_UNIT, 1 }, + { "hour", tHOUR_UNIT, 1 }, + { "minute", tMINUTE_UNIT, 1 }, + { "min", tMINUTE_UNIT, 1 }, + { "second", tSEC_UNIT, 1 }, + { "sec", tSEC_UNIT, 1 }, + { NULL, 0, 0 } +}; + +/* Assorted relative-time words. */ +static TABLE const OtherTable[] = { + { "tomorrow", tDAY_UNIT, 1 }, + { "yesterday", tDAY_UNIT, -1 }, + { "today", tDAY_UNIT, 0 }, + { "now", tDAY_UNIT, 0 }, + { "last", tUNUMBER, -1 }, + { "this", tUNUMBER, 0 }, + { "next", tUNUMBER, 1 }, + { "first", tUNUMBER, 1 }, +/* { "second", tUNUMBER, 2 }, */ + { "third", tUNUMBER, 3 }, + { "fourth", tUNUMBER, 4 }, + { "fifth", tUNUMBER, 5 }, + { "sixth", tUNUMBER, 6 }, + { "seventh", tUNUMBER, 7 }, + { "eighth", tUNUMBER, 8 }, + { "ninth", tUNUMBER, 9 }, + { "tenth", tUNUMBER, 10 }, + { "eleventh", tUNUMBER, 11 }, + { "twelfth", tUNUMBER, 12 }, + { "ago", tAGO, 1 }, + { NULL, 0, 0 } +}; + +/* The timezone table. */ +static TABLE const TimezoneTable[] = { + { "gmt", tZONE, HOUR ( 0) }, /* Greenwich Mean */ + { "ut", tZONE, HOUR ( 0) }, /* Universal (Coordinated) */ + { "utc", tZONE, HOUR ( 0) }, + { "wet", tZONE, HOUR ( 0) }, /* Western European */ + { "bst", tDAYZONE, HOUR ( 0) }, /* British Summer */ + { "wat", tZONE, HOUR ( 1) }, /* West Africa */ + { "at", tZONE, HOUR ( 2) }, /* Azores */ +#if 0 + /* For completeness. BST is also British Summer, and GST is + * also Guam Standard. */ + { "bst", tZONE, HOUR ( 3) }, /* Brazil Standard */ + { "gst", tZONE, HOUR ( 3) }, /* Greenland Standard */ +#endif +#if 0 + { "nft", tZONE, HOUR (3.5) }, /* Newfoundland */ + { "nst", tZONE, HOUR (3.5) }, /* Newfoundland Standard */ + { "ndt", tDAYZONE, HOUR (3.5) }, /* Newfoundland Daylight */ +#endif + { "ast", tZONE, HOUR ( 4) }, /* Atlantic Standard */ + { "adt", tDAYZONE, HOUR ( 4) }, /* Atlantic Daylight */ + { "est", tZONE, HOUR ( 5) }, /* Eastern Standard */ + { "edt", tDAYZONE, HOUR ( 5) }, /* Eastern Daylight */ + { "cst", tZONE, HOUR ( 6) }, /* Central Standard */ + { "cdt", tDAYZONE, HOUR ( 6) }, /* Central Daylight */ + { "mst", tZONE, HOUR ( 7) }, /* Mountain Standard */ + { "mdt", tDAYZONE, HOUR ( 7) }, /* Mountain Daylight */ + { "pst", tZONE, HOUR ( 8) }, /* Pacific Standard */ + { "pdt", tDAYZONE, HOUR ( 8) }, /* Pacific Daylight */ + { "yst", tZONE, HOUR ( 9) }, /* Yukon Standard */ + { "ydt", tDAYZONE, HOUR ( 9) }, /* Yukon Daylight */ + { "hst", tZONE, HOUR (10) }, /* Hawaii Standard */ + { "hdt", tDAYZONE, HOUR (10) }, /* Hawaii Daylight */ + { "cat", tZONE, HOUR (10) }, /* Central Alaska */ + { "akst", tZONE, HOUR (10) }, /* Alaska Standard */ + { "akdt", tZONE, HOUR (10) }, /* Alaska Daylight */ + { "ahst", tZONE, HOUR (10) }, /* Alaska-Hawaii Standard */ + { "nt", tZONE, HOUR (11) }, /* Nome */ + { "idlw", tZONE, HOUR (12) }, /* International Date Line West */ + { "cet", tZONE, -HOUR (1) }, /* Central European */ + { "cest", tDAYZONE, -HOUR (1) }, /* Central European Summer */ + { "met", tZONE, -HOUR (1) }, /* Middle European */ + { "mewt", tZONE, -HOUR (1) }, /* Middle European Winter */ + { "mest", tDAYZONE, -HOUR (1) }, /* Middle European Summer */ + { "mesz", tDAYZONE, -HOUR (1) }, /* Middle European Summer */ + { "swt", tZONE, -HOUR (1) }, /* Swedish Winter */ + { "sst", tDAYZONE, -HOUR (1) }, /* Swedish Summer */ + { "fwt", tZONE, -HOUR (1) }, /* French Winter */ + { "fst", tDAYZONE, -HOUR (1) }, /* French Summer */ + { "eet", tZONE, -HOUR (2) }, /* Eastern Europe, USSR Zone 1 */ + { "bt", tZONE, -HOUR (3) }, /* Baghdad, USSR Zone 2 */ +#if 0 + { "it", tZONE, -HOUR (3.5) },/* Iran */ +#endif + { "zp4", tZONE, -HOUR (4) }, /* USSR Zone 3 */ + { "zp5", tZONE, -HOUR (5) }, /* USSR Zone 4 */ +#if 0 + { "ist", tZONE, -HOUR (5.5) },/* Indian Standard */ +#endif + { "zp6", tZONE, -HOUR (6) }, /* USSR Zone 5 */ +#if 0 + /* For completeness. NST is also Newfoundland Standard, and SST is + * also Swedish Summer. */ + { "nst", tZONE, -HOUR (6.5) },/* North Sumatra */ + { "sst", tZONE, -HOUR (7) }, /* South Sumatra, USSR Zone 6 */ +#endif /* 0 */ + { "wast", tZONE, -HOUR (7) }, /* West Australian Standard */ + { "wadt", tDAYZONE, -HOUR (7) }, /* West Australian Daylight */ +#if 0 + { "jt", tZONE, -HOUR (7.5) },/* Java (3pm in Cronusland!) */ +#endif + { "cct", tZONE, -HOUR (8) }, /* China Coast, USSR Zone 7 */ + { "jst", tZONE, -HOUR (9) }, /* Japan Standard, USSR Zone 8 */ +#if 0 + { "cast", tZONE, -HOUR (9.5) },/* Central Australian Standard */ + { "cadt", tDAYZONE, -HOUR (9.5) },/* Central Australian Daylight */ +#endif + { "east", tZONE, -HOUR (10) }, /* Eastern Australian Standard */ + { "eadt", tDAYZONE, -HOUR (10) }, /* Eastern Australian Daylight */ + { "gst", tZONE, -HOUR (10) }, /* Guam Standard, USSR Zone 9 */ + { "nzt", tZONE, -HOUR (12) }, /* New Zealand */ + { "nzst", tZONE, -HOUR (12) }, /* New Zealand Standard */ + { "nzdt", tDAYZONE, -HOUR (12) }, /* New Zealand Daylight */ + { "idle", tZONE, -HOUR (12) }, /* International Date Line East */ + { NULL, 0, 0 } +}; + +/* Military timezone table. */ +static TABLE const MilitaryTable[] = { + { "a", tZONE, HOUR (- 1) }, + { "b", tZONE, HOUR (- 2) }, + { "c", tZONE, HOUR (- 3) }, + { "d", tZONE, HOUR (- 4) }, + { "e", tZONE, HOUR (- 5) }, + { "f", tZONE, HOUR (- 6) }, + { "g", tZONE, HOUR (- 7) }, + { "h", tZONE, HOUR (- 8) }, + { "i", tZONE, HOUR (- 9) }, + { "k", tZONE, HOUR (-10) }, + { "l", tZONE, HOUR (-11) }, + { "m", tZONE, HOUR (-12) }, + { "n", tZONE, HOUR ( 1) }, + { "o", tZONE, HOUR ( 2) }, + { "p", tZONE, HOUR ( 3) }, + { "q", tZONE, HOUR ( 4) }, + { "r", tZONE, HOUR ( 5) }, + { "s", tZONE, HOUR ( 6) }, + { "t", tTZONE, HOUR ( 7) }, + { "u", tZONE, HOUR ( 8) }, + { "v", tZONE, HOUR ( 9) }, + { "w", tWZONE, HOUR ( 10) }, + { "x", tZONE, HOUR ( 11) }, + { "y", tZONE, HOUR ( 12) }, + { "z", tZZONE, HOUR ( 0) }, + { NULL, 0, 0 } +}; + + + + +/* ARGSUSED */ +static int +yyerror(void* parm, const char *s) +{ + return 0; +} + +static int +ToHour(int Hours, MERIDIAN Meridian) +{ + switch (Meridian) + { + case MER24: + if(Hours < 0 || Hours > 23) + return -1; + return Hours; + case MERam: + if(Hours < 1 || Hours > 12) + return -1; + if(Hours == 12) + Hours = 0; + return Hours; + case MERpm: + if(Hours < 1 || Hours > 12) + return -1; + if(Hours == 12) + Hours = 0; + return Hours + 12; + default: +#ifdef RAPTOR_DEBUG + fprintf(stderr, "%s:%d:%s: UNKNOWN Meridian %d - add a new case", + __FILE__, __LINE__, __FUNCTION__, (int)Meridian); +#endif + return -1; + } + /* NOTREACHED */ +} + +static int +ToYear(int Year) +{ + if(Year < 0) + Year = -Year; + + /* XPG4 suggests that years 00-68 map to 2000-2068, and + years 69-99 map to 1969-1999. */ + if(Year < 69) + Year += 2000; + else if(Year < 100) + Year += 1900; + + return Year; +} + +static int +LookupWord (YYSTYPE *lvalp, char *buff) +{ + char *p; + char *q; + const TABLE *tp; + int i; + int abbrev; + + /* Make it lowercase. */ + for(p = buff; *p; p++) + if(isupper ((unsigned char) *p)) + *p = tolower (*p); + + if(strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) + { + lvalp->Meridian = MERam; + return tMERIDIAN; + } + if(strcmp (buff, "pm") == 0 || strcmp (buff, "p.m.") == 0) + { + lvalp->Meridian = MERpm; + return tMERIDIAN; + } + + /* See if we have an abbreviation for a month. */ + if(strlen (buff) == 3) + abbrev = 1; + else if(strlen (buff) == 4 && buff[3] == '.') + { + abbrev = 1; + buff[3] = '\0'; + } + else + abbrev = 0; + + for(tp = MonthDayTable; tp->name; tp++) + { + if(abbrev) + { + if(strncmp (buff, tp->name, 3) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + } + else if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + } + + for(tp = TimezoneTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + + if(strcmp (buff, "dst") == 0) + return tDST; + + for(tp = UnitsTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + + /* Strip off any plural and try the units table again. */ + i = RAPTOR_BAD_CAST(int, strlen(buff)) - 1; + if(buff[i] == 's') + { + buff[i] = '\0'; + for(tp = UnitsTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + buff[i] = 's'; /* Put back for "this" in OtherTable. */ + } + + for(tp = OtherTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + + /* Military timezones. */ + if(buff[1] == '\0' && isalpha ((unsigned char) *buff)) + { + for(tp = MilitaryTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + } + + /* Drop out any periods and try the timezone table again. */ + for(i = 0, p = q = buff; *q; q++) + if(*q != '.') + *p++ = *q; + else + i++; + *p = '\0'; + if(i) + for(tp = TimezoneTable; tp->name; tp++) + if(strcmp (buff, tp->name) == 0) + { + lvalp->Number = tp->value; + return tp->type; + } + + return tID; +} + +int yylex(YYSTYPE *lvalp, void *parm) +{ + unsigned char c; + char *p; + char buff[20]; + int Count; + int sign; + struct date_yy * date = (struct date_yy *)parm; + + for(;;) + { + while(isspace ((unsigned char) *date->yyInput)) + date->yyInput++; + + if(isdigit (c = *date->yyInput) || c == '-' || c == '+') + { + if(c == '-' || c == '+') + { + sign = c == '-' ? -1 : 1; + if(!ISDIGIT (*++date->yyInput)) + /* skip the '-' sign */ + continue; + } + else + sign = 0; + for(lvalp->Number = 0; ISDIGIT (c = *date->yyInput++);) + lvalp->Number = 10 * lvalp->Number + c - '0'; + date->yyInput--; + if(sign < 0) + lvalp->Number = -lvalp->Number; + /* Ignore ordinal suffixes on numbers */ + c = *date->yyInput; + if(c == 's' || c == 'n' || c == 'r' || c == 't') { + c = *++date->yyInput; + if(c == 't' || c == 'd' || c == 'h') { + date->yyInput++; + } else { + date->yyInput--; + } + } + return sign ? tSNUMBER : tUNUMBER; + } + if(isalpha (c)) + { + for(p = buff; (c = *date->yyInput++, isalpha (c)) || c == '.';) + if(p < &buff[sizeof buff - 1]) + *p++ = c; + *p = '\0'; + date->yyInput--; + return LookupWord (lvalp, buff); + } + if(c != '(') + return *date->yyInput++; + Count = 0; + do + { + c = *date->yyInput++; + if(c == '\0') + return c; + if(c == '(') + Count++; + else if(c == ')') + Count--; + } + while(Count > 0); + } +} + +#define TM_YEAR_ORIGIN 1900 + +/* Yield A - B, measured in seconds. */ +static long +difftm (struct tm *a, struct tm *b) +{ + int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); + int by = b->tm_year + (TM_YEAR_ORIGIN - 1); + long days = ( + /* difference in day of year */ + a->tm_yday - b->tm_yday + /* + intervening leap days */ + + ((ay >> 2) - (by >> 2)) + - (ay / 100 - by / 100) + + ((ay / 100 >> 2) - (by / 100 >> 2)) + /* + difference in years * 365 */ + + (long) (ay - by) * 365 + ); + return (60 * (60 * (24 * days + (a->tm_hour - b->tm_hour)) + + (a->tm_min - b->tm_min)) + + (a->tm_sec - b->tm_sec)); +} + +time_t raptor_parse_date(const char *p, time_t *now) +{ + struct tm tm, tm0, *tmp; + time_t Start; + struct date_yy date; + + date.yyInput = p; + Start = now ? *now : time ((time_t *) NULL); + tmp = localtime (&Start); + if(!tmp) + return -1; + date.yyYear = tmp->tm_year + TM_YEAR_ORIGIN; + date.yyMonth = tmp->tm_mon + 1; + date.yyDay = tmp->tm_mday; + date.yyHour = tmp->tm_hour; + date.yyMinutes = tmp->tm_min; + date.yySeconds = tmp->tm_sec; + tm.tm_isdst = tmp->tm_isdst; + date.yyMeridian = MER24; + date.yyRelSeconds = 0; + date.yyRelMinutes = 0; + date.yyRelHour = 0; + date.yyRelDay = 0; + date.yyRelMonth = 0; + date.yyRelYear = 0; + date.yyHaveDate = 0; + date.yyHaveDay = 0; + date.yyHaveRel = 0; + date.yyHaveTime = 0; + date.yyHaveZone = 0; + + if(yyparse (&date) + || date.yyHaveTime > 1 || date.yyHaveZone > 1 + || date.yyHaveDate > 1 || date.yyHaveDay > 1) { + return -1; + } + tm.tm_year = ToYear (date.yyYear) - TM_YEAR_ORIGIN + date.yyRelYear; + tm.tm_mon = date.yyMonth - 1 + date.yyRelMonth; + tm.tm_mday = date.yyDay + date.yyRelDay; + if(date.yyHaveTime || (date.yyHaveRel && !date.yyHaveDate && !date.yyHaveDay)) + { + tm.tm_hour = ToHour (date.yyHour, date.yyMeridian); + if(tm.tm_hour < 0) + return -1; + tm.tm_min = date.yyMinutes; + tm.tm_sec = date.yySeconds; + } + else + { + tm.tm_hour = tm.tm_min = tm.tm_sec = 0; + } + tm.tm_hour += date.yyRelHour; + tm.tm_min += date.yyRelMinutes; + tm.tm_sec += date.yyRelSeconds; + + /* Let mktime deduce tm_isdst if we have an absolute timestamp, + or if the relative timestamp mentions days, months, or years. */ + if(date.yyHaveDate | date.yyHaveDay | date.yyHaveTime | date.yyRelDay | date.yyRelMonth | date.yyRelYear) + tm.tm_isdst = -1; + + tm0 = tm; + + Start = mktime (&tm); + + if(Start == (time_t) -1) + { + + /* Guard against falsely reporting errors near the time_t boundaries + when parsing times in other time zones. For example, if the min + time_t value is 1970-01-01 00:00:00 UTC and we are 8 hours ahead + of UTC, then the min localtime value is 1970-01-01 08:00:00; if + we apply mktime to 1970-01-01 00:00:00 we will get an error, so + we apply mktime to 1970-01-02 08:00:00 instead and adjust the time + zone by 24 hours to compensate. This algorithm assumes that + there is no DST transition within a day of the time_t boundaries. */ + if(date.yyHaveZone) + { + tm = tm0; + if(tm.tm_year <= EPOCH - TM_YEAR_ORIGIN) + { + tm.tm_mday++; + date.yyTimezone -= 24 * 60; + } + else + { + tm.tm_mday--; + date.yyTimezone += 24 * 60; + } + Start = mktime (&tm); + } + + if(Start == (time_t) -1) + return Start; + } + + if(date.yyHaveDay && !date.yyHaveDate) + { + tm.tm_mday += ((date.yyDayNumber - tm.tm_wday + 7) % 7 + + 7 * (date.yyDayOrdinal - (0 < date.yyDayOrdinal))); + Start = mktime (&tm); + if(Start == (time_t) -1) + return Start; + } + + if(date.yyHaveZone) + { + long delta; + struct tm *gmt = gmtime (&Start); + if(!gmt) + return -1; + delta = date.yyTimezone * 60L + difftm (&tm, gmt); + + if((Start + delta < Start) != (delta < 0)) + return -1; /* time_t overflow */ + Start += delta; + } + + return Start; +} diff --git a/src/raptor.h b/src/raptor.h new file mode 100644 index 0000000..91d361e --- /dev/null +++ b/src/raptor.h @@ -0,0 +1 @@ +#include diff --git a/src/raptor2.h.in b/src/raptor2.h.in new file mode 100644 index 0000000..f97326a --- /dev/null +++ b/src/raptor2.h.in @@ -0,0 +1,2203 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor.h - Redland Parser Toolkit for RDF (Raptor) - public API + * + * Copyright (C) 2000-2013, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + + +#ifndef RAPTOR_H +#define RAPTOR_H + + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/* Required for va_list in raptor_vsnprintf */ +#include + + +/** + * RAPTOR_V2_AVAILABLE + * + * Flag for marking raptor2 API availability. + */ +#define RAPTOR_V2_AVAILABLE 1 + + +/** + * RAPTOR_VERSION: + * + * Raptor library version number + * + * Format: major * 10000 + minor * 100 + release + */ +#define RAPTOR_VERSION @RAPTOR_VERSION_DECIMAL@ + +/** + * RAPTOR_VERSION_STRING: + * + * Raptor library version string + */ +#define RAPTOR_VERSION_STRING "@VERSION@" + +/** + * RAPTOR_VERSION_MAJOR: + * + * Raptor library major version + */ +#define RAPTOR_VERSION_MAJOR @RAPTOR_VERSION_MAJOR@ + +/** + * RAPTOR_VERSION_MINOR: + * + * Raptor library minor version + */ +#define RAPTOR_VERSION_MINOR @RAPTOR_VERSION_MINOR@ + +/** + * RAPTOR_VERSION_RELEASE: + * + * Raptor library release + */ +#define RAPTOR_VERSION_RELEASE @RAPTOR_VERSION_RELEASE@ + +/** + * RAPTOR_API: + * + * Macro for wrapping API function call declarations. + * + */ +#ifndef RAPTOR_API +# ifdef WIN32 +# ifdef __GNUC__ +# undef _declspec +# define _declspec(x) __declspec(x) +# endif +# ifdef RAPTOR_STATIC +# define RAPTOR_API +# else +# ifdef RAPTOR_INTERNAL +# define RAPTOR_API _declspec(dllexport) +# else +# define RAPTOR_API _declspec(dllimport) +# endif +# endif +# else +# define RAPTOR_API +# endif +#endif + +/* Use gcc 3.1+ feature to allow marking of deprecated API calls. + * This gives a warning during compiling. + */ +#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +#define RAPTOR_DEPRECATED __attribute__((deprecated)) +#define RAPTOR_NORETURN __attribute__((__noreturn__)) +#else +#define RAPTOR_DEPRECATED +#define RAPTOR_NORETURN +#endif + +/** + * RAPTOR_PRINTF_FORMAT: + * @string_index: ignore me + * @first_to_check_index: ignore me + * + * Internal macro + */ +#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5)) +#define RAPTOR_PRINTF_FORMAT(string_index, first_to_check_index) \ + __attribute__((__format__(__printf__, string_index, first_to_check_index))) +#else +#define RAPTOR_PRINTF_FORMAT(string_index, first_to_check_index) +#endif + +/** + * raptor_uri: + * + * Raptor URI Class. + */ +typedef struct raptor_uri_s raptor_uri; + + +/* Public statics */ + +/** + * raptor_short_copyright_string: + * + * Short copyright string (one line). + */ +RAPTOR_API +extern const char * const raptor_short_copyright_string; + +/** + * raptor_copyright_string: + * + * Copyright string (multiple lines). + */ +RAPTOR_API +extern const char * const raptor_copyright_string; + +/** + * raptor_version_string: + * + * Raptor version as a string. + */ +RAPTOR_API +extern const char * const raptor_version_string; + +/** + * raptor_version_major: + * + * Raptor major version number. + */ +RAPTOR_API +extern const unsigned int raptor_version_major; + +/** + * raptor_version_minor: + * + * Raptor minor version number. + */ +RAPTOR_API +extern const unsigned int raptor_version_minor; + +/** + * raptor_version_release: + * + * Raptor release version number. + */ +RAPTOR_API +extern const unsigned int raptor_version_release; + +/** + * raptor_version_decimal: + * + * Raptor version as a decimal number. + * + * Format: major * 10000 + minor * 100 + release + */ +RAPTOR_API +extern const unsigned int raptor_version_decimal; + +/** + * raptor_license_string: + * + * Raptor license string. + */ +RAPTOR_API +extern const char * const raptor_license_string; + +/** + * raptor_home_url_string: + * + * Raptor home page URL. + */ +RAPTOR_API +extern const char * const raptor_home_url_string; + +/** + * raptor_xml_namespace_uri: + * + * XML Namespace (xml:) URI string. + */ +RAPTOR_API +extern const unsigned char * const raptor_xml_namespace_uri; + + +/** + * raptor_rdf_namespace_uri: + * + * RDF Namespace (rdf:) URI string. + */ +RAPTOR_API +extern const unsigned char * const raptor_rdf_namespace_uri; + +/** + * raptor_rdf_namespace_uri_len: + * + * Length of #raptor_rdf_namespace_uri string + */ +RAPTOR_API +extern const unsigned int raptor_rdf_namespace_uri_len; + +/** + * raptor_rdf_schema_namespace_uri: + * + * RDF Schema (rdfs:) Namespace URI string. + */ +RAPTOR_API +extern const unsigned char * const raptor_rdf_schema_namespace_uri; + +/** + * raptor_rdf_schenma_namespace_uri_len: + * + * Length of #raptor_rdf_schenma_namespace_uri string + */ +RAPTOR_API +extern const unsigned int raptor_rdf_schema_namespace_uri_len; + +/** + * raptor_xmlschema_datatypes_namespace_uri: + * + * XML Schema datatypes (xsd:) namespace URI string. + */ +RAPTOR_API +extern const unsigned char * const raptor_xmlschema_datatypes_namespace_uri; + +/** + * raptor_owl_namespace_uri: + * + * OWL (owl:) Namespace URI string. + */ +RAPTOR_API +extern const unsigned char * const raptor_owl_namespace_uri; + +/** + * raptor_xml_literal_datatype_uri_string: + * + * XML Literal datatype (rdf:XMLLiteral) URI string. + */ +RAPTOR_API +extern const unsigned char * const raptor_xml_literal_datatype_uri_string; + +/** + * raptor_xml_literal_datatype_uri_string_len: + * + * Length of #raptor_xml_literal_datatype_uri_string + */ +RAPTOR_API +extern const unsigned int raptor_xml_literal_datatype_uri_string_len; + + +/* Public structure */ +/** + * raptor_world: + * + * Raptor world class. + */ +typedef struct raptor_world_s raptor_world; +/** + * raptor_parser: + * + * Raptor Parser class + */ +typedef struct raptor_parser_s raptor_parser; +/** + * raptor_serializer: + * + * Raptor Serializer class + */ +typedef struct raptor_serializer_s raptor_serializer; + +/** + * raptor_www: + * + * Raptor WWW class + */ +typedef struct raptor_www_s raptor_www; +/** + * raptor_iostream: + * + * Raptor I/O Stream class + */ +typedef struct raptor_iostream_s raptor_iostream; +/** + * raptor_xml_element: + * + * Raptor XML Element class + */ +typedef struct raptor_xml_element_s raptor_xml_element; +/** + * raptor_xml_writer: + * + * Raptor XML Writer class + */ +typedef struct raptor_xml_writer_s raptor_xml_writer; +/** + * raptor_qname: + * + * Raptor XML qname class + */ +typedef struct raptor_qname_s raptor_qname; +/** + * raptor_namespace: + * + * Raptor XML Namespace class + */ +typedef struct raptor_namespace_s raptor_namespace; +/** + * raptor_namespace_stack: + * + * Raptor XML Namespace Stack class + */ +typedef struct raptor_namespace_stack_s raptor_namespace_stack; + +/** + * raptor_sax2: + * + * Raptor SAX2 class + */ +typedef struct raptor_sax2_s raptor_sax2; + + +/** + * raptor_type_q: + * @mime_type: MIME type string + * @mime_type_len: length of @mime_type + * @q: Q value 0-10 standing for decimal 0.0-1.0 + * + * (MIME Type, Q) pair + */ +typedef struct { + const char* mime_type; + size_t mime_type_len; + unsigned char q; +} raptor_type_q; + + +/** + * raptor_syntax_bitflags: + * @RAPTOR_SYNTAX_NEED_BASE_URI: the syntax requires a base URI + * + * Bit flags for #raptor_syntax_description flags field + */ +typedef enum { + RAPTOR_SYNTAX_NEED_BASE_URI = 1 +} raptor_syntax_bitflags; + + +/** + * raptor_syntax_description: + * @names: array of syntax names - the first one (required) is the public name, the rest are aliases. The array is NULL terminated. + * @names_count: size of @names array + * @label: long descriptive label for syntax + * @mime_types: Array of (MIME type, Q) values associated with the syntax (or NULL). If present the array is NULL terminated. + * @mime_types_count: size of @mime_types array + * @uri_strings: array of URIs identifying the syntax (or NULL). The first one if present is the main URI, the rest are aliases. The array is NULL terminated. + * @uri_strings_count: size of @uri_strings array + * @flags: See #raptor_syntax_bitflags for the bits + * + * Description of a syntax or file format. + * + */ +typedef struct { + const char* const* names; + unsigned int names_count; + + const char* label; + + const raptor_type_q* mime_types; + unsigned int mime_types_count; + + const char* const* uri_strings; + unsigned int uri_strings_count; + + unsigned int flags; +} raptor_syntax_description; + + +/** + * raptor_term_type: + * @RAPTOR_TERM_TYPE_URI: RDF URI + * @RAPTOR_TERM_TYPE_LITERAL: RDF literal + * @RAPTOR_TERM_TYPE_BLANK: RDF blank node + * @RAPTOR_TERM_TYPE_UNKNOWN: Internal + * + * Type of term in a #raptor_statement + * + * Node type 3 is unused but exists to preserve numeric compatibility + * with librdf_node_type values. + */ +typedef enum { + RAPTOR_TERM_TYPE_UNKNOWN = 0, + RAPTOR_TERM_TYPE_URI = 1, + RAPTOR_TERM_TYPE_LITERAL = 2, + /* unused type 3 */ + RAPTOR_TERM_TYPE_BLANK = 4 +} raptor_term_type; + + +/** + * raptor_locator: + * @uri: URI of location (or NULL) + * @file: Filename of location (or NULL) + * @line: Line number of location (or <0 for no line) + * @column: Column number of location (or <0 for no column) + * @byte: Byte number of location (or <0 for no byte) + * + * Location information for an error, warning or information message. + */ +typedef struct { + raptor_uri *uri; + const char *file; + int line; + int column; + int byte; +} raptor_locator; + +/** + * raptor_option: + * @RAPTOR_OPTION_SCANNING: If true (default false), the RDF/XML + * parser will look for embedded rdf:RDF elements inside the XML + * content, and not require that the XML start with an rdf:RDF root + * element. + * @RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES: If true (default true) + * then the RDF/XML parser will allow non-XML namespaced attributes + * to be accepted as well as rdf: namespaced ones. For example, + * 'about' and 'ID' will be interpreted as if they were rdf:about + * and rdf:ID respectively. + * @RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES: If true (default true) + * then the RDF/XML parser will allow unknown parsetypes to be + * present and will pass them on to the user. Unimplemented at + * present. + * @RAPTOR_OPTION_ALLOW_BAGID: If true (default true) then the + * RDF/XML parser will support the rdf:bagID attribute that was + * removed from the RDF/XML language when it was revised. This + * support may be removed in future. + * @RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST: If true (default false) + * then the RDF/XML parser will generate the idList rdf:type + * rdf:List triple in the handling of rdf:parseType="Collection". + * This triple was removed during the revising of RDF/XML after + * collections were initially added. + * @RAPTOR_OPTION_NORMALIZE_LANGUAGE: If true (default true) then + * XML language values such as from xml:lang will be normalized to + * lowercase. + * @RAPTOR_OPTION_NON_NFC_FATAL: If true (default false) then + * illegal Unicode Normal Form C in literals will give a fatal + * error, otherwise just a warning. + * @RAPTOR_OPTION_WARN_OTHER_PARSETYPES: If true (default true) then + * the RDF/XML parser will warn about unknown rdf:parseType values. + * @RAPTOR_OPTION_CHECK_RDF_ID: If true (default true) then the + * RDF/XML will check rdf:ID attribute values for duplicates and + * cause an error if any are found. + * @RAPTOR_OPTION_RELATIVE_URIS: If true (default true) then + * relative URIs will be used wherever possible when serializing. + * @RAPTOR_OPTION_WRITER_AUTO_INDENT: Automatically indent elements when + * seriailizing. + * @RAPTOR_OPTION_WRITER_AUTO_EMPTY: Automatically detect and + * abbreviate empty elements when serializing. + * @RAPTOR_OPTION_WRITER_INDENT_WIDTH: Integer number of spaces to use + * for each indent level when serializing with auto indent. + * @RAPTOR_OPTION_WRITER_XML_VERSION: Integer XML version XML 1.0 (10) or XML 1.1 (11) + * @RAPTOR_OPTION_WRITER_XML_DECLARATION: Write XML 1.0 or 1.1 declaration. + * @RAPTOR_OPTION_NO_NET: Deny network requests inside other requests. + * @RAPTOR_OPTION_RESOURCE_BORDER: Border color of resource + * nodes for GraphViz DOT serializer. + * @RAPTOR_OPTION_LITERAL_BORDER: Border color of literal nodes + * for GraphViz DOT serializer. + * @RAPTOR_OPTION_BNODE_BORDER: Border color of blank nodes for + * GraphViz DOT serializer. + * @RAPTOR_OPTION_RESOURCE_FILL: Fill color of resource nodes + * for GraphViz DOT serializer. + * @RAPTOR_OPTION_LITERAL_FILL: Fill color of literal nodes for + * GraphViz DOT serializer. + * @RAPTOR_OPTION_BNODE_FILL: Fill color of blank nodes for + * GraphViz DOT serializer. + * @RAPTOR_OPTION_HTML_TAG_SOUP: Use a lax HTML parser if an XML parser + * fails when read HTML for GRDDL parser. + * @RAPTOR_OPTION_MICROFORMATS: Look for microformats for GRDDL parser. + * @RAPTOR_OPTION_HTML_LINK: Look for head <link> to type rdf/xml + * for GRDDL parser. + * @RAPTOR_OPTION_WWW_TIMEOUT: Set timeout for internal WWW URI requests + * for GRDDL parser. + * @RAPTOR_OPTION_WRITE_BASE_URI: Write @base directive for Turtle/N3. + * @RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL: HTTP Cache-Control: header + * @RAPTOR_OPTION_WWW_HTTP_USER_AGENT: HTTP User-Agent: header + * @RAPTOR_OPTION_JSON_CALLBACK: JSON serializer callback function. + * @RAPTOR_OPTION_JSON_EXTRA_DATA: JSON serializer extra top-level data + * @RAPTOR_OPTION_RSS_TRIPLES: Atom/RSS serializer writes extra RDF triples it finds (none, rdf-xml, atom-triples) + * @RAPTOR_OPTION_ATOM_ENTRY_URI: Atom entry URI. If given, generate an Atom Entry Document with the item having the given URI, otherwise generate an Atom Feed Document with any items found. + * @RAPTOR_OPTION_PREFIX_ELEMENTS: Integer. If set, generate Atom/RSS1.0 documents with prefixed elements, otherwise unprefixed. + * @RAPTOR_OPTION_STRICT: Boolean. If set, operate in strict conformance mode. + * @RAPTOR_OPTION_WWW_CERT_FILENAME: String. SSL client certificate filename + * @RAPTOR_OPTION_WWW_CERT_TYPE: String. SSL client certificate type + * @RAPTOR_OPTION_WWW_CERT_PASSPHRASE: String. SSL client certificate passphrase + * @RAPTOR_OPTION_WWW_SSL_VERIFY_PEER: Integer. SSL verify peer - non-0 to verify peer SSL certificate (default) + * @RAPTOR_OPTION_WWW_SSL_VERIFY_HOST: Integer. SSL verify host - 0 none, 1 CN match, 2 host match (default). Other values are ignored. + * @RAPTOR_OPTION_NO_FILE: Deny file reading requests inside other requests. + * @RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES: When reading XML, load external entities. + * @RAPTOR_OPTION_LAST: Internal + * + * Raptor parser, serializer or XML writer options. + */ +typedef enum { + RAPTOR_OPTION_SCANNING, + RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES, + RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES, + RAPTOR_OPTION_ALLOW_BAGID, + RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST, + RAPTOR_OPTION_NORMALIZE_LANGUAGE, + RAPTOR_OPTION_NON_NFC_FATAL, + RAPTOR_OPTION_WARN_OTHER_PARSETYPES, + RAPTOR_OPTION_CHECK_RDF_ID, + RAPTOR_OPTION_RELATIVE_URIS, + RAPTOR_OPTION_WRITER_AUTO_INDENT, + RAPTOR_OPTION_WRITER_AUTO_EMPTY, + RAPTOR_OPTION_WRITER_INDENT_WIDTH, + RAPTOR_OPTION_WRITER_XML_VERSION, + RAPTOR_OPTION_WRITER_XML_DECLARATION, + RAPTOR_OPTION_NO_NET, + RAPTOR_OPTION_RESOURCE_BORDER, + RAPTOR_OPTION_LITERAL_BORDER, + RAPTOR_OPTION_BNODE_BORDER, + RAPTOR_OPTION_RESOURCE_FILL, + RAPTOR_OPTION_LITERAL_FILL, + RAPTOR_OPTION_BNODE_FILL, + RAPTOR_OPTION_HTML_TAG_SOUP, + RAPTOR_OPTION_MICROFORMATS, + RAPTOR_OPTION_HTML_LINK, + RAPTOR_OPTION_WWW_TIMEOUT, + RAPTOR_OPTION_WRITE_BASE_URI, + RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL, + RAPTOR_OPTION_WWW_HTTP_USER_AGENT, + RAPTOR_OPTION_JSON_CALLBACK, + RAPTOR_OPTION_JSON_EXTRA_DATA, + RAPTOR_OPTION_RSS_TRIPLES, + RAPTOR_OPTION_ATOM_ENTRY_URI, + RAPTOR_OPTION_PREFIX_ELEMENTS, + RAPTOR_OPTION_STRICT, + RAPTOR_OPTION_WWW_CERT_FILENAME, + RAPTOR_OPTION_WWW_CERT_TYPE, + RAPTOR_OPTION_WWW_CERT_PASSPHRASE, + RAPTOR_OPTION_NO_FILE, + RAPTOR_OPTION_WWW_SSL_VERIFY_PEER, + RAPTOR_OPTION_WWW_SSL_VERIFY_HOST, + RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES, + RAPTOR_OPTION_LAST = RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES +} raptor_option; + + +/** + * raptor_term_literal_value: + * @string: literal string + * @string_len: length of string + * @datatype: datatype URI (or NULL) + * @language: literal language (or NULL) + * @language_len: length of language + * + * Literal term value - this typedef exists solely for use in #raptor_term + * + * Either @datatype or @language may be non-NULL but not both. + */ +typedef struct { + unsigned char *string; + unsigned int string_len; + + raptor_uri *datatype; + + unsigned char *language; + unsigned char language_len; +} raptor_term_literal_value; + + +/** + * raptor_term_blank_value: + * @string: literal string + * @string_len: length of string + * + * Blank term value - this typedef exists solely for use in #raptor_term + * + */ +typedef struct { + unsigned char *string; + unsigned int string_len; +} raptor_term_blank_value; + + +/** + * raptor_term_value: + * @uri: uri value when term type is #RAPTOR_TERM_TYPE_URI + * @literal: literal value when term type is #RAPTOR_TERM_TYPE_LITERAL + * @blank: blank value when term type is #RAPTOR_TERM_TYPE_BLANK + * + * Term value - this typedef exists solely for use in #raptor_term + * + **/ +typedef union { + raptor_uri *uri; + + raptor_term_literal_value literal; + + raptor_term_blank_value blank; +} raptor_term_value; + + +/** + * raptor_term: + * @world: world + * @usage: usage reference count (if >0) + * @type: term type + * @value: term values per type + * + * An RDF statement term + * + */ +typedef struct { + raptor_world* world; + + int usage; + + raptor_term_type type; + + raptor_term_value value; + +} raptor_term; + + +/** + * raptor_statement: + * @world: world pointer + * @usage: usage count + * @subject: statement subject + * @predicate: statement predicate + * @object: statement object + * @graph: statement graph name (or NULL if not present) + * + * An RDF triple with optional graph name (quad) + * + * See #raptor_term for a description of how the fields may be used. + * As returned by a parser statement_handler. + */ +typedef struct { + raptor_world* world; + int usage; + raptor_term* subject; + raptor_term* predicate; + raptor_term* object; + raptor_term* graph; +} raptor_statement; + + +/** + * raptor_log_level: + * @RAPTOR_LOG_LEVEL_NONE: Internal + * @RAPTOR_LOG_LEVEL_TRACE: very fine-grained tracing messages information + * @RAPTOR_LOG_LEVEL_DEBUG: fine-grained tracing messages suitable for debugging + * @RAPTOR_LOG_LEVEL_INFO: coarse-grained information messages + * @RAPTOR_LOG_LEVEL_WARN: warning messages of potentially harmful problems + * @RAPTOR_LOG_LEVEL_ERROR: error messages where the application can continue + * @RAPTOR_LOG_LEVEL_FATAL: fatal error message where the application will likely abort + * @RAPTOR_LOG_LEVEL_LAST: Internal + * + * Log levels + */ +typedef enum { + RAPTOR_LOG_LEVEL_NONE, + RAPTOR_LOG_LEVEL_TRACE, + RAPTOR_LOG_LEVEL_DEBUG, + RAPTOR_LOG_LEVEL_INFO, + RAPTOR_LOG_LEVEL_WARN, + RAPTOR_LOG_LEVEL_ERROR, + RAPTOR_LOG_LEVEL_FATAL, + RAPTOR_LOG_LEVEL_LAST = RAPTOR_LOG_LEVEL_FATAL +} raptor_log_level; + + +/** + * raptor_domain: + * @RAPTOR_DOMAIN_IOSTREAM: I/O stream + * @RAPTOR_DOMAIN_NAMESPACE: XML Namespace / namespace stack + * @RAPTOR_DOMAIN_PARSER: RDF Parser + * @RAPTOR_DOMAIN_QNAME: XML QName + * @RAPTOR_DOMAIN_SAX2: XML SAX2 + * @RAPTOR_DOMAIN_SERIALIZER: RDF Serializer + * @RAPTOR_DOMAIN_TERM: RDF Term + * @RAPTOR_DOMAIN_TURTLE_WRITER: Turtle Writer + * @RAPTOR_DOMAIN_URI: RDF Uri + * @RAPTOR_DOMAIN_WORLD: RDF world + * @RAPTOR_DOMAIN_WWW: WWW + * @RAPTOR_DOMAIN_XML_WRITER: XML Writer + * @RAPTOR_DOMAIN_NONE: Internal + * @RAPTOR_DOMAIN_LAST: Internal + * + * Log domain + */ +typedef enum { + RAPTOR_DOMAIN_NONE, + RAPTOR_DOMAIN_IOSTREAM, + RAPTOR_DOMAIN_NAMESPACE, + RAPTOR_DOMAIN_PARSER, + RAPTOR_DOMAIN_QNAME, + RAPTOR_DOMAIN_SAX2, + RAPTOR_DOMAIN_SERIALIZER, + RAPTOR_DOMAIN_TERM, + RAPTOR_DOMAIN_TURTLE_WRITER, + RAPTOR_DOMAIN_URI, + RAPTOR_DOMAIN_WORLD, + RAPTOR_DOMAIN_WWW, + RAPTOR_DOMAIN_XML_WRITER, + RAPTOR_DOMAIN_LAST = RAPTOR_DOMAIN_XML_WRITER +} raptor_domain; + + +/** + * raptor_log_message: + * @code: error code or < 0 if not used or known + * @domain: message domain or #RAPTOR_DOMAIN_NONE if not used or known + * @level: log message level + * @locator: location associated with message or NULL if not known + * @text: message string + * + * Log message. + */ +typedef struct { + int code; + raptor_domain domain; + raptor_log_level level; + raptor_locator *locator; + const char *text; +} raptor_log_message; + + +/** + * raptor_log_handler: + * @user_data: user data + * @message: log message + * + * Handler function for log messages with location + * + * Used during parsing and serializing for errors and warnings that + * may include location information. Handlers may be set + * by raptor_world_set_log_handler(). + * + */ +typedef void (*raptor_log_handler)(void *user_data, raptor_log_message *message); + + +/** + * raptor_statement_handler: + * @user_data: user data + * @statement: statement to report + * + * Statement (triple) reporting handler function. + * + * This handler function set with + * raptor_parser_set_statement_handler() on a parser receives + * statements as the parsing proceeds. The @statement argument to the + * handler is shared and must be copied by the caller with + * raptor_statement_copy(). + */ +typedef void (*raptor_statement_handler)(void *user_data, raptor_statement *statement); + +/** + * raptor_graph_mark_flags: + * @RAPTOR_GRAPH_MARK_START: mark is start of graph (otherwise is end) + * @RAPTOR_GRAPH_MARK_DECLARED: mark was declared in syntax rather than implict + * + * Graph mark handler bitmask flags + */ +typedef enum { + RAPTOR_GRAPH_MARK_START = 1, + RAPTOR_GRAPH_MARK_DECLARED = 2 +} raptor_graph_mark_flags; + + +/** + * raptor_graph_mark_handler: + * @user_data: user data + * @graph: graph to report, NULL for the default graph + * @flags: bitmask of #raptor_graph_mark_flags flags + * + * Graph start/end mark handler function. + * + * Records start and end of graphs happening in a stream of generated + * #raptor_statement via the statement handler. The callback starts a + * graph when @flags has #RAPTOR_GRAPH_MARK_START bit set. + * + * The start and ends may be either declared in the syntax via some + * keyword or mechanism such as TRiG {} syntax when @flags has bit + * #RAPTOR_GRAPH_MARK_DECLARED set, or be implied by the start/end of + * the data in other syntaxes, and the bit will be unset. + */ +typedef void (*raptor_graph_mark_handler)(void *user_data, raptor_uri *graph, int flags); + +/** + * raptor_generate_bnodeid_handler: + * @user_data: user data + * @user_bnodeid: a user-specified ID or NULL if none available. + * + * Generate a blank node identifier handler function. + * + * Return value: new blank node ID to use + */ +typedef unsigned char* (*raptor_generate_bnodeid_handler)(void *user_data, unsigned char* user_bnodeid); + +/** + * raptor_namespace_handler: + * @user_data: user data + * @nspace: #raptor_namespace declared + * + * XML Namespace declaration reporting handler set by + * raptor_parser_set_namespace_handler(). + */ +typedef void (*raptor_namespace_handler)(void* user_data, raptor_namespace *nspace); + + +/** + * raptor_www_write_bytes_handler: + * @www: WWW object + * @userdata: user data + * @ptr: data pointer + * @size: size of individual item + * @nmemb: number of items + * + * Receiving bytes of data from WWW retrieval handler. + * + * Set by raptor_www_set_write_bytes_handler(). + */ +typedef void (*raptor_www_write_bytes_handler)(raptor_www* www, void *userdata, const void *ptr, size_t size, size_t nmemb); + +/** + * raptor_www_content_type_handler: + * @www: WWW object + * @userdata: user data + * @content_type: content type seen + * + * Receiving Content-Type: header from WWW retrieval handler. + * + * Set by raptor_www_set_content_type_handler(). + */ +typedef void (*raptor_www_content_type_handler)(raptor_www* www, void *userdata, const char *content_type); + +/** + * raptor_www_final_uri_handler: + * @www: WWW object + * @userdata: user data + * @final_uri: final URI seen + * + * Receiving the final resolved URI from a WWW retrieval + * + * Set by raptor_www_set_final_uri_handler(). + */ +typedef void (*raptor_www_final_uri_handler)(raptor_www* www, void *userdata, raptor_uri *final_uri); + +/** + * raptor_uri_filter_func: + * @user_data: user data + * @uri: #raptor_uri URI to check + * + * Callback function for #raptor_www_set_uri_filter + * + * Return value: non-0 to filter the URI + */ +typedef int (*raptor_uri_filter_func)(void *user_data, raptor_uri* uri); + + +/** + * raptor_world_flag: + * @RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE: if set (non-0 value) - save/restore the libxml generic error handler when raptor library initializes (default set) + * @RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE: if set (non-0 value) - save/restore the libxml structured error handler when raptor library terminates (default set) + * @RAPTOR_WORLD_FLAG_URI_INTERNING: if set (non-0 value) - each URI is saved interned in-memory and reused (default set) + * @RAPTOR_WORLD_FLAG_WWW_SKIP_INIT_FINISH: if set (non-0 value) the raptor will neither initialise or terminate the lower level WWW library. Usually in raptor initialising either curl_global_init (for libcurl) are called and in raptor cleanup, curl_global_cleanup is called. This flag allows the application finer control over these libraries such as setting other global options or potentially calling and terminating raptor several times. It does mean that applications which use this call must do their own extra work in order to allocate and free all resources to the system. + * + * Raptor world flags + * + * These are used by raptor_world_set_flags() to control raptor-wide + * options across classes. These must be set before + * raptor_world_open() is called explicitly or implicitly (by + * creating a raptor object). There is no enumeration function for + * these flags because they are not user options and must be set + * before the library is initialised. For similar reasons, there is + * no get function. + * + * If any libxml handler saving/restoring is enabled, any existing + * handler and context is saved before parsing and restored + * afterwards. Otherwise, no saving/restoring is performed. + * + */ +typedef enum { + RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE = 1, + RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE = 2, + RAPTOR_WORLD_FLAG_URI_INTERNING = 3, + RAPTOR_WORLD_FLAG_WWW_SKIP_INIT_FINISH = 4 +} raptor_world_flag; + + +/** + * raptor_data_compare_arg_handler: + * @data1: first object + * @data2: second object + * @user_data: user data argument + * + * Function to compare two data objects with a user data argument + * + * Designed to be used with raptor_sort_r() and compatible functions + * such as raptor_sequence_sort_r() which uses it. + * + * Return value: compare value <0 if @data1 is before @data2, =0 if equal, >0 if @data1 is after @data2 + */ +typedef int (*raptor_data_compare_arg_handler)(const void *data1, const void *data2, void *user_data); + + +/** + * raptor_data_compare_handler: + * @data1: first data object + * @data2: second data object + * + * Function to compare two data objects - signature like strcmp() and function pssed to qsort() + * + * Designed to be passed into generic data structure constructors + * like raptor_new_avltree(). + * + * Return value: compare value <0 if @data1 is before @data2, =0 if equal, >0 if @data1 is after @data2 + */ +typedef int (*raptor_data_compare_handler)(const void* data1, const void* data2); + + +/** + * raptor_data_malloc_handler: + * @size: data size + * + * Typedef for a function to allocate memory - signature like malloc() + * + * Designed to be passed into constructors + * like raptor_www_fetch_to_string + * + * Return value: pointer to newly allocated memory or NULL on failure + */ +typedef void* (*raptor_data_malloc_handler)(size_t size); + + +/** + * raptor_data_free_handler: + * @data: data object or NULL + * + * Typedef for function to free a data object - signature like free() + * + * Designed to be passed into generic data structure constructors + * like raptor_new_avltree(). If @data is NULL, nothing should be done. + */ +typedef void (*raptor_data_free_handler)(void* data); + + +/** + * raptor_data_context_free_handler: + * @context: context data for the free function + * @object: object to free + * + * Handler function for freeing a sequence item with a contextual pointer. + * + * Set by raptor_new_sequence_with_context(). +*/ +typedef void (*raptor_data_context_free_handler)(void* context, void* object); + +/** + * raptor_data_print_handler: + * @object: object to print + * @fh: FILE* to print to + * + * Handler function for printing an object to a stream. + * + * Set by raptor_new_sequence() + * + * Return value: non-0 on failure + */ +typedef int (*raptor_data_print_handler)(void *object, FILE *fh); + +/** + * raptor_data_context_print_handler: + * @context: context data for the print function + * @object: object to print + * @fh: FILE* to print to + * + * Function function for printing an object with data context to a stream. + * + * Set by raptor_new_sequence_with_context() + * + * Return value: non-0 on failure + */ +typedef int (*raptor_data_context_print_handler)(void *context, void *object, FILE *fh); + +/** + * raptor_stringbuffer: + * + * Raptor string buffer class + */ +typedef struct raptor_stringbuffer_s raptor_stringbuffer; + + +/* Public functions */ + +#define raptor_new_world() raptor_new_world_internal(RAPTOR_VERSION) +/* The real target of the raptor_new_world() macro */ +RAPTOR_API +raptor_world *raptor_new_world_internal(unsigned int version_decimal); +RAPTOR_API +int raptor_world_open(raptor_world* world); +RAPTOR_API +void raptor_free_world(raptor_world* world); +RAPTOR_API +int raptor_world_set_libxslt_security_preferences(raptor_world *world, void *security_preferences); +RAPTOR_API +int raptor_world_set_flag(raptor_world *world, raptor_world_flag flag, int value); +RAPTOR_API +int raptor_world_set_log_handler(raptor_world *world, void *user_data, raptor_log_handler handler); +RAPTOR_API +void raptor_world_set_generate_bnodeid_handler(raptor_world* world, void *user_data, raptor_generate_bnodeid_handler handler); +RAPTOR_API +unsigned char* raptor_world_generate_bnodeid(raptor_world *world); +RAPTOR_API +void raptor_world_set_generate_bnodeid_parameters(raptor_world* world, char *prefix, int base); +RAPTOR_API +const char* raptor_log_level_get_label(raptor_log_level level); +RAPTOR_API +const char* raptor_domain_get_label(raptor_domain domain); + +/* Names */ +RAPTOR_API +int raptor_world_is_parser_name(raptor_world* world, const char *name); +RAPTOR_API +const char* raptor_world_guess_parser_name(raptor_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier); +RAPTOR_API +int raptor_world_is_serializer_name(raptor_world* world, const char *name); + +/* Syntax descriptions */ +RAPTOR_API +int raptor_world_get_parsers_count(raptor_world* world); +RAPTOR_API +int raptor_world_get_serializers_count(raptor_world* world); +RAPTOR_API +const raptor_syntax_description* raptor_world_get_parser_description(raptor_world* world, unsigned int counter); +RAPTOR_API +const raptor_syntax_description* raptor_world_get_serializer_description(raptor_world* world, unsigned int counter); +RAPTOR_API +int raptor_syntax_description_validate(raptor_syntax_description* desc); + +RAPTOR_API +raptor_option raptor_world_get_option_from_uri(raptor_world* world, raptor_uri *uri); + + +/* Term Class */ +RAPTOR_API +raptor_term* raptor_new_term_from_uri(raptor_world* world, raptor_uri* uri); +RAPTOR_API +raptor_term* raptor_new_term_from_counted_uri_string(raptor_world* world, const unsigned char *uri_string, size_t length); +RAPTOR_API +raptor_term* raptor_new_term_from_uri_string(raptor_world* world, const unsigned char *uri_string); +RAPTOR_API +raptor_term* raptor_new_term_from_literal(raptor_world* world, const unsigned char* literal, raptor_uri* datatype, const unsigned char* language); +RAPTOR_API +raptor_term* raptor_new_term_from_counted_literal(raptor_world* world, const unsigned char* literal, size_t literal_len, raptor_uri* datatype, const unsigned char* language, unsigned char language_len); +RAPTOR_API +raptor_term* raptor_new_term_from_blank(raptor_world* world, const unsigned char* blank); +RAPTOR_API +raptor_term* raptor_new_term_from_counted_blank(raptor_world* world, const unsigned char* blank, size_t length); +RAPTOR_API +raptor_term* raptor_new_term_from_counted_string(raptor_world* world, unsigned char* string, size_t length); +RAPTOR_API +raptor_term* raptor_term_copy(raptor_term* term); +RAPTOR_API +int raptor_term_compare(const raptor_term *t1, const raptor_term *t2); +RAPTOR_API +int raptor_term_equals(raptor_term* t1, raptor_term* t2); +RAPTOR_API +void raptor_free_term(raptor_term *term); + +RAPTOR_API +unsigned char* raptor_term_to_counted_string(raptor_term *term, size_t* len_p); +RAPTOR_API +unsigned char* raptor_term_to_string(raptor_term *term); +RAPTOR_API +int raptor_term_escaped_write(const raptor_term *term, unsigned int flags, raptor_iostream* iostr); +RAPTOR_API RAPTOR_DEPRECATED +int raptor_term_ntriples_write(const raptor_term *term, raptor_iostream* iostr); +RAPTOR_API +int raptor_uri_turtle_write(raptor_world *world, raptor_iostream* iostr, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri); +RAPTOR_API +int raptor_term_turtle_write(raptor_iostream* iostr, raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri); +RAPTOR_API +unsigned char* raptor_uri_to_turtle_counted_string(raptor_world *world, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri, size_t *len_p); +RAPTOR_API +unsigned char* raptor_uri_to_turtle_string(raptor_world *world, raptor_uri* uri, raptor_namespace_stack *nstack, raptor_uri *base_uri); +RAPTOR_API +unsigned char* raptor_term_to_turtle_counted_string(raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri, size_t *len_p); +RAPTOR_API +unsigned char* raptor_term_to_turtle_string(raptor_term* term, raptor_namespace_stack *nstack, raptor_uri *base_uri); + + +/* Statement Class */ +RAPTOR_API +void raptor_statement_init(raptor_statement *statement, raptor_world *world); +RAPTOR_API +void raptor_statement_clear(raptor_statement *statement); +RAPTOR_API +raptor_statement* raptor_new_statement(raptor_world *world); +RAPTOR_API +raptor_statement* raptor_new_statement_from_nodes(raptor_world* world, raptor_term *subject, raptor_term *predicate, raptor_term *object, raptor_term *graph); +RAPTOR_API +raptor_statement* raptor_statement_copy(raptor_statement *statement); +RAPTOR_API +void raptor_free_statement(raptor_statement *statement); + +RAPTOR_API +int raptor_statement_print(const raptor_statement * statement, FILE *stream); +RAPTOR_API +int raptor_statement_print_as_ntriples(const raptor_statement * statement, FILE *stream); +RAPTOR_API +int raptor_statement_compare(const raptor_statement *s1, const raptor_statement *s2); +RAPTOR_API +int raptor_statement_equals(const raptor_statement* s1, const raptor_statement* s2); + + +/* Parser Class */ +RAPTOR_API +raptor_parser* raptor_new_parser(raptor_world* world, const char *name); +RAPTOR_API +raptor_parser* raptor_new_parser_for_content(raptor_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier); +RAPTOR_API +void raptor_free_parser(raptor_parser* parser); + +/* methods */ + +/* Handlers */ +RAPTOR_API +void raptor_parser_set_statement_handler(raptor_parser* parser, void *user_data, raptor_statement_handler handler); +RAPTOR_API +void raptor_parser_set_graph_mark_handler(raptor_parser* parser, void *user_data, raptor_graph_mark_handler handler); +RAPTOR_API +void raptor_parser_set_namespace_handler(raptor_parser* parser, void *user_data, raptor_namespace_handler handler); +RAPTOR_API +void raptor_parser_set_uri_filter(raptor_parser* parser, raptor_uri_filter_func filter, void* user_data); +RAPTOR_API +raptor_locator* raptor_parser_get_locator(raptor_parser* rdf_parser); + + +/* Parsing functions */ +RAPTOR_API +int raptor_parser_parse_start(raptor_parser *rdf_parser, raptor_uri *uri); +RAPTOR_API +int raptor_parser_parse_chunk(raptor_parser* rdf_parser, const unsigned char *buffer, size_t len, int is_end); +RAPTOR_API +int raptor_parser_parse_file_stream(raptor_parser* rdf_parser, FILE *stream, const char *filename, raptor_uri *base_uri); +RAPTOR_API +int raptor_parser_parse_file(raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri); +RAPTOR_API +int raptor_parser_parse_uri(raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri); +RAPTOR_API +int raptor_parser_parse_uri_with_connection(raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri, void *connection); +RAPTOR_API +int raptor_parser_parse_iostream(raptor_parser* rdf_parser, raptor_iostream *iostr, raptor_uri *base_uri); +RAPTOR_API +void raptor_parser_parse_abort(raptor_parser* rdf_parser); +RAPTOR_API +const char* raptor_parser_get_name(raptor_parser *rdf_parser); +RAPTOR_API +const raptor_syntax_description* raptor_parser_get_description(raptor_parser *rdf_parser); + +/* parser option methods */ +RAPTOR_API +int raptor_parser_set_option(raptor_parser *parser, raptor_option option, const char* string, int integer); +RAPTOR_API +int raptor_parser_get_option(raptor_parser *parser, raptor_option option, char** string_p, int* integer_p); + +/* parser utility methods */ +RAPTOR_API +const char* raptor_parser_get_accept_header(raptor_parser* rdf_parser); +RAPTOR_API +raptor_world* raptor_parser_get_world(raptor_parser* rdf_parser); +RAPTOR_API +raptor_uri* raptor_parser_get_graph(raptor_parser* rdf_parser); + + +/* Locator Class */ +/* methods */ +RAPTOR_API +int raptor_locator_print(raptor_locator* locator, FILE *stream); +RAPTOR_API +int raptor_locator_format(char *buffer, size_t length, raptor_locator* locator); +RAPTOR_API +int raptor_locator_line(raptor_locator *locator); +RAPTOR_API +int raptor_locator_column(raptor_locator *locator); +RAPTOR_API +int raptor_locator_byte(raptor_locator *locator); +RAPTOR_API +const char* raptor_locator_file(raptor_locator *locator); +RAPTOR_API +const char* raptor_locator_uri(raptor_locator *locator); + + +/* Serializer Class */ +RAPTOR_API +raptor_serializer* raptor_new_serializer(raptor_world* world, const char *name); +RAPTOR_API +void raptor_free_serializer(raptor_serializer* rdf_serializer); + +/* methods */ +RAPTOR_API +int raptor_serializer_start_to_iostream(raptor_serializer *rdf_serializer, raptor_uri *uri, raptor_iostream *iostream); +RAPTOR_API +int raptor_serializer_start_to_filename(raptor_serializer *rdf_serializer, const char *filename); +RAPTOR_API +int raptor_serializer_start_to_string(raptor_serializer *rdf_serializer, raptor_uri *uri, void **string_p, size_t *length_p); +RAPTOR_API +int raptor_serializer_start_to_file_handle(raptor_serializer *rdf_serializer, raptor_uri *uri, FILE *fh); +RAPTOR_API +int raptor_serializer_set_namespace(raptor_serializer* rdf_serializer, raptor_uri *uri, const unsigned char *prefix); +RAPTOR_API +int raptor_serializer_set_namespace_from_namespace(raptor_serializer* rdf_serializer, raptor_namespace *nspace); +RAPTOR_API +int raptor_serializer_serialize_statement(raptor_serializer* rdf_serializer, raptor_statement *statement); +RAPTOR_API +int raptor_serializer_serialize_end(raptor_serializer *rdf_serializer); +RAPTOR_API +raptor_iostream* raptor_serializer_get_iostream(raptor_serializer *serializer); +RAPTOR_API +raptor_locator* raptor_serializer_get_locator(raptor_serializer *rdf_serializer); +RAPTOR_API +int raptor_serializer_flush(raptor_serializer *rdf_serializer); +RAPTOR_API +const raptor_syntax_description* raptor_serializer_get_description(raptor_serializer *rdf_serializer); + +/* serializer option methods */ +RAPTOR_API +int raptor_serializer_set_option(raptor_serializer *serializer, raptor_option option, const char* string, int integer); +RAPTOR_API +int raptor_serializer_get_option(raptor_serializer *serializer, raptor_option option, char** string_p, int* integer_p); + +/* utility methods */ +RAPTOR_API +raptor_world* raptor_serializer_get_world(raptor_serializer* rdf_serializer); + + +/* memory functions */ +RAPTOR_API +void raptor_free_memory(void *ptr); +RAPTOR_API +void* raptor_alloc_memory(size_t size); +RAPTOR_API +void* raptor_calloc_memory(size_t nmemb, size_t size); + + +/* URI Class */ +RAPTOR_API +raptor_uri* raptor_new_uri_from_counted_string(raptor_world* world, const unsigned char *uri_string, size_t length); +RAPTOR_API +raptor_uri* raptor_new_uri(raptor_world* world, const unsigned char *uri_string); +RAPTOR_API +raptor_uri* raptor_new_uri_from_uri_local_name(raptor_world* world, raptor_uri *uri, const unsigned char *local_name); +RAPTOR_API +raptor_uri* raptor_new_uri_relative_to_base(raptor_world* world, raptor_uri *base_uri, const unsigned char *uri_string); +RAPTOR_API +raptor_uri* raptor_new_uri_relative_to_base_counted(raptor_world* world, raptor_uri *base_uri, const unsigned char *uri_string, size_t uri_len); +RAPTOR_API +raptor_uri* raptor_new_uri_from_id(raptor_world* world, raptor_uri *base_uri, const unsigned char *id); +RAPTOR_API +raptor_uri* raptor_new_uri_from_uri_or_file_string(raptor_world* world, raptor_uri* base_uri, const unsigned char* uri_or_file_string); +RAPTOR_API +raptor_uri* raptor_new_uri_for_rdf_concept(raptor_world* world, const unsigned char *name); +RAPTOR_API +raptor_uri* raptor_new_uri_for_xmlbase(raptor_uri* old_uri); +RAPTOR_API +raptor_uri* raptor_new_uri_for_retrieval(raptor_uri* old_uri); +RAPTOR_API +void raptor_free_uri(raptor_uri *uri); + +/* methods */ +RAPTOR_API +int raptor_uri_equals(raptor_uri* uri1, raptor_uri* uri2); +RAPTOR_API +int raptor_uri_compare(raptor_uri* uri1, raptor_uri* uri2); +RAPTOR_API +raptor_uri* raptor_uri_copy(raptor_uri *uri); +RAPTOR_API +unsigned char* raptor_uri_as_string(raptor_uri *uri); +RAPTOR_API +unsigned char* raptor_uri_as_counted_string(raptor_uri *uri, size_t* len_p); +RAPTOR_API +unsigned char* raptor_uri_to_relative_counted_uri_string(raptor_uri *base_uri, raptor_uri *reference_uri, size_t *length_p); +RAPTOR_API +unsigned char* raptor_uri_to_relative_uri_string(raptor_uri *base_uri, raptor_uri *reference_uri); +RAPTOR_API +int raptor_uri_print(const raptor_uri* uri, FILE *stream); +RAPTOR_API +unsigned char* raptor_uri_to_counted_string(raptor_uri *uri, size_t *len_p); +RAPTOR_API +unsigned char* raptor_uri_to_string(raptor_uri *uri); +RAPTOR_API +raptor_world* raptor_uri_get_world(raptor_uri *uri); +RAPTOR_API +int raptor_uri_file_exists(raptor_uri* uri); +RAPTOR_API +int raptor_uri_escaped_write(raptor_uri* uri, raptor_uri* base_uri, unsigned int flags, raptor_iostream *iostr); + +/* XML utility functions */ +RAPTOR_API +int raptor_xml_escape_string_any(raptor_world* world, const unsigned char *string, size_t len, unsigned char *buffer, size_t length, char quote, int xml_version); +RAPTOR_API +int raptor_xml_escape_string_any_write(const unsigned char *string, size_t len, char quote, int xml_version, raptor_iostream* iostr); +RAPTOR_API +int raptor_xml_escape_string(raptor_world *world, const unsigned char *string, size_t len, unsigned char *buffer, size_t length, char quote); +RAPTOR_API +int raptor_xml_escape_string_write(const unsigned char *string, size_t len, char quote, raptor_iostream* iostr); +RAPTOR_API +int raptor_xml_name_check(const unsigned char *string, size_t length, int xml_version); + + +/* portable vsnprintf utility function */ +RAPTOR_API RAPTOR_DEPRECATED +char* raptor_vsnprintf(const char *format, va_list arguments) RAPTOR_PRINTF_FORMAT(1, 0); +RAPTOR_API +int raptor_vsnprintf2(char *buffer, size_t size, const char *format, va_list arguments) RAPTOR_PRINTF_FORMAT(3, 0); +RAPTOR_API +int raptor_snprintf(char *buffer, size_t size, const char *format, ...) RAPTOR_PRINTF_FORMAT(3, 4); +RAPTOR_API +int raptor_vasprintf(char **ret, const char *format, va_list arguments) RAPTOR_PRINTF_FORMAT(2, 0); + +/* RFC2396 URI resolving functions */ +RAPTOR_API +size_t raptor_uri_resolve_uri_reference(const unsigned char *base_uri, const unsigned char *reference_uri, unsigned char* buffer, size_t length); + +/* URI String utility functions */ +RAPTOR_API +unsigned char* raptor_uri_counted_filename_to_uri_string(const char *filename, size_t filename_len); +RAPTOR_API +unsigned char* raptor_uri_filename_to_uri_string(const char *filename); +RAPTOR_API +int raptor_uri_filename_exists(const unsigned char* path); +RAPTOR_API +char* raptor_uri_uri_string_to_filename(const unsigned char *uri_string); +RAPTOR_API +char* raptor_uri_uri_string_to_filename_fragment(const unsigned char *uri_string, unsigned char **fragment_p); +RAPTOR_API +int raptor_uri_uri_string_is_file_uri(const unsigned char* uri_string); +RAPTOR_API +int raptor_stringbuffer_append_uri_escaped_counted_string(raptor_stringbuffer* sb, const char* string, size_t length, int space_is_plus); +RAPTOR_API +char* raptor_uri_uri_string_to_counted_filename_fragment(const unsigned char *uri_string, size_t* len_p, unsigned char **fragment_p, size_t* fragment_len_p); +RAPTOR_API +int raptor_uri_uri_string_is_absolute(const unsigned char* uri_string); + + +/** + * RAPTOR_RDF_MS_URI: + * + * RDF Namespace URI (rdf:). + * + * Copy with raptor_uri_copy() to use. + */ +#define RAPTOR_RDF_MS_URI raptor_rdf_namespace_uri + +/** + * RAPTOR_RDF_SCHEMA_URI: + * + * RDF Schema Namespace URI (rdfs:). + * + * Copy with raptor_uri_copy() to use. + */ +#define RAPTOR_RDF_SCHEMA_URI raptor_rdf_schema_namespace_uri + +/** + * RAPTOR_XMLSCHEMA_DATATYPES_URI: + * + * XML Schema Datatypes URI (xsd:). + * + * Copy with raptor_uri_copy() to use. + */ +#define RAPTOR_XMLSCHEMA_DATATYPES_URI raptor_xmlschema_datatypes_namespace_uri + +/** + * RAPTOR_OWL_URI: + * + * OWL Namespace URI (owl:). + * + * Copy with raptor_uri_copy() to use. + */ +#define RAPTOR_OWL_URI raptor_owl_namespace_uri + + +/* raptor_www */ +RAPTOR_API +raptor_www* raptor_new_www(raptor_world* world); +RAPTOR_API +raptor_www* raptor_new_www_with_connection(raptor_world* world, void* connection); +RAPTOR_API +void raptor_free_www(raptor_www *www); +RAPTOR_API +int raptor_www_set_ssl_cert_options(raptor_www* www, const char* cert_filename, const char* cert_type, const char* cert_passphrase); +RAPTOR_API +int raptor_www_set_ssl_verify_options(raptor_www* www, int verify_peer, int verify_host); +RAPTOR_API +int raptor_www_set_user_agent2(raptor_www *www, const char *user_agent, size_t user_agent_len); +RAPTOR_API RAPTOR_DEPRECATED +void raptor_www_set_user_agent(raptor_www *www, const char *user_agent); +RAPTOR_API +int raptor_www_set_proxy2(raptor_www *www, const char *proxy, size_t proxy_len); +RAPTOR_API RAPTOR_DEPRECATED +void raptor_www_set_proxy(raptor_www *www, const char *proxy); +RAPTOR_API +int raptor_www_set_http_accept2(raptor_www *www, const char *value, size_t value_len); +RAPTOR_API RAPTOR_DEPRECATED +void raptor_www_set_http_accept(raptor_www *www, const char *value); +RAPTOR_API +void raptor_www_set_write_bytes_handler(raptor_www *www, raptor_www_write_bytes_handler handler, void *user_data); +RAPTOR_API +void raptor_www_set_content_type_handler(raptor_www *www, raptor_www_content_type_handler handler, void *user_data); +RAPTOR_API +void raptor_www_set_final_uri_handler(raptor_www* www, raptor_www_final_uri_handler handler, void *user_data); +RAPTOR_API +void raptor_www_set_uri_filter(raptor_www* www, raptor_uri_filter_func filter, void* user_data); +RAPTOR_API +void raptor_www_set_connection_timeout(raptor_www* www, int timeout); +RAPTOR_API +int raptor_www_set_http_cache_control(raptor_www* www, const char* cache_control); +RAPTOR_API +int raptor_www_fetch(raptor_www *www, raptor_uri *uri); +RAPTOR_API +int raptor_www_fetch_to_string(raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, raptor_data_malloc_handler const malloc_handler); +RAPTOR_API +void* raptor_www_get_connection(raptor_www *www); +RAPTOR_API +void raptor_www_abort(raptor_www *www, const char *reason); +RAPTOR_API +raptor_uri* raptor_www_get_final_uri(raptor_www* www); + + +/* XML QNames Class */ +RAPTOR_API +raptor_qname* raptor_new_qname(raptor_namespace_stack *nstack, const unsigned char *name, const unsigned char *value); +RAPTOR_API +raptor_qname* raptor_new_qname_from_namespace_local_name(raptor_world* world, raptor_namespace *ns, const unsigned char *local_name, const unsigned char *value); + +/* methods */ +RAPTOR_API +raptor_qname* raptor_qname_copy(raptor_qname *qname); +RAPTOR_API +void raptor_free_qname(raptor_qname* name); +RAPTOR_API +int raptor_qname_equal(raptor_qname *name1, raptor_qname *name2); +RAPTOR_API +unsigned char* raptor_qname_to_counted_name(raptor_qname *qname, size_t* length_p); +RAPTOR_API +const raptor_namespace* raptor_qname_get_namespace(raptor_qname* name); +RAPTOR_API +const unsigned char* raptor_qname_get_local_name(raptor_qname* name); +RAPTOR_API +const unsigned char* raptor_qname_get_value(raptor_qname* name); +RAPTOR_API +const unsigned char* raptor_qname_get_counted_value(raptor_qname* name, size_t* length_p); +RAPTOR_API +int raptor_qname_write(raptor_qname *qname, raptor_iostream* iostr); + +/* QName String utility functions */ +RAPTOR_API +raptor_uri* raptor_qname_string_to_uri(raptor_namespace_stack *nstack, const unsigned char *name, size_t name_len); +RAPTOR_API +unsigned char* raptor_qname_format_as_xml(const raptor_qname *qname, size_t *length_p); + +/* XML Namespaces Stack class */ +RAPTOR_API +raptor_namespace* raptor_new_namespace_from_uri(raptor_namespace_stack *nstack, const unsigned char *prefix, raptor_uri* ns_uri, int depth); +RAPTOR_API +raptor_namespace_stack* raptor_new_namespaces(raptor_world* world, int defaults); +RAPTOR_API +int raptor_namespaces_init(raptor_world* world, raptor_namespace_stack *nstack, int defaults); +RAPTOR_API +void raptor_namespaces_clear(raptor_namespace_stack *nstack); +RAPTOR_API +void raptor_free_namespaces(raptor_namespace_stack *nstack); + +/* methods */ +RAPTOR_API +void raptor_namespaces_start_namespace(raptor_namespace_stack *nstack, raptor_namespace *nspace); +RAPTOR_API +int raptor_namespaces_start_namespace_full(raptor_namespace_stack *nstack, const unsigned char *prefix, const unsigned char *ns_uri_string, int depth); +RAPTOR_API +void raptor_namespaces_end_for_depth(raptor_namespace_stack *nstack, int depth); +RAPTOR_API +raptor_namespace* raptor_namespaces_get_default_namespace(raptor_namespace_stack *nstack); +RAPTOR_API +raptor_namespace* raptor_namespaces_find_namespace(raptor_namespace_stack *nstack, const unsigned char *prefix, int prefix_length); +RAPTOR_API +raptor_namespace* raptor_namespaces_find_namespace_by_uri(raptor_namespace_stack *nstack, raptor_uri *ns_uri); +RAPTOR_API +int raptor_namespaces_namespace_in_scope(raptor_namespace_stack *nstack, const raptor_namespace *nspace); +RAPTOR_API +raptor_qname* raptor_new_qname_from_namespace_uri(raptor_namespace_stack *nstack, raptor_uri *uri, int xml_version); + + +/* XML Namespace Class */ +RAPTOR_API +raptor_namespace* raptor_new_namespace(raptor_namespace_stack *nstack, const unsigned char *prefix, const unsigned char *ns_uri_string, int depth); +RAPTOR_API +void raptor_free_namespace(raptor_namespace *ns); +RAPTOR_API +int raptor_namespace_stack_start_namespace(raptor_namespace_stack *nstack, raptor_namespace *ns, int new_depth); +RAPTOR_API +raptor_uri* raptor_namespace_get_uri(const raptor_namespace *ns); +RAPTOR_API +const unsigned char* raptor_namespace_get_prefix(const raptor_namespace *ns); +RAPTOR_API +const unsigned char* raptor_namespace_get_counted_prefix(const raptor_namespace *ns, size_t *length_p); +RAPTOR_API +unsigned char* raptor_namespace_format_as_xml(const raptor_namespace *ns, size_t *length_p); +RAPTOR_API +int raptor_namespace_write(raptor_namespace *ns, raptor_iostream* iostr); + +/* namespace string utility function */ +RAPTOR_API +int raptor_xml_namespace_string_parse(const unsigned char *string, unsigned char **prefix, unsigned char **uri_string); + +/* Sequence class */ +/** + * raptor_sequence: + * + * Raptor sequence class + */ +typedef struct raptor_sequence_s raptor_sequence; + +/* Sequence Class */ +RAPTOR_API +raptor_sequence* raptor_new_sequence(raptor_data_free_handler free_handler, raptor_data_print_handler print_handler); +RAPTOR_API +raptor_sequence* raptor_new_sequence_with_context(raptor_data_context_free_handler free_handler, raptor_data_context_print_handler print_handler, void* handler_context); +RAPTOR_API +void raptor_free_sequence(raptor_sequence* seq); + +/* methods */ +RAPTOR_API +int raptor_sequence_size(raptor_sequence* seq); +RAPTOR_API +int raptor_sequence_set_at(raptor_sequence* seq, int idx, void *data); +RAPTOR_API +int raptor_sequence_push(raptor_sequence* seq, void *data); +RAPTOR_API +int raptor_sequence_shift(raptor_sequence* seq, void *data); +RAPTOR_API +void* raptor_sequence_get_at(raptor_sequence* seq, int idx); +RAPTOR_API +void* raptor_sequence_pop(raptor_sequence* seq); +RAPTOR_API +void* raptor_sequence_unshift(raptor_sequence* seq); +RAPTOR_API +void* raptor_sequence_delete_at(raptor_sequence* seq, int idx); + +RAPTOR_API +void raptor_sequence_sort(raptor_sequence* seq, raptor_data_compare_handler compare); +RAPTOR_API +void raptor_sequence_sort_r(raptor_sequence* seq, raptor_data_compare_arg_handler compare, void* user_data); +RAPTOR_API +int raptor_sequence_swap(raptor_sequence* seq, int i, int j); +RAPTOR_API +int raptor_sequence_reverse(raptor_sequence* seq, int start_index, int length); +RAPTOR_API +int raptor_sequence_next_permutation(raptor_sequence *seq, raptor_data_compare_handler compare); + +/* helper for printing sequences of strings */ +RAPTOR_API +int raptor_sequence_print(raptor_sequence* seq, FILE* fh); +RAPTOR_API +int raptor_sequence_join(raptor_sequence* dest, raptor_sequence *src); + + +/* Unicode and UTF8 */ + +/** + * raptor_unichar: + * + * raptor Unicode codepoint + */ +typedef unsigned long raptor_unichar; +RAPTOR_API +int raptor_unicode_utf8_string_put_char(raptor_unichar c, unsigned char *output, size_t length); +RAPTOR_API +int raptor_unicode_utf8_string_get_char(const unsigned char *input, size_t length, raptor_unichar *output); +RAPTOR_API +int raptor_unicode_is_xml11_namestartchar(raptor_unichar c); +RAPTOR_API +int raptor_unicode_is_xml10_namestartchar(raptor_unichar c); +RAPTOR_API +int raptor_unicode_is_xml11_namechar(raptor_unichar c); +RAPTOR_API +int raptor_unicode_is_xml10_namechar(raptor_unichar c); +RAPTOR_API +int raptor_unicode_check_utf8_string(const unsigned char *string, size_t length); +RAPTOR_API +int raptor_unicode_utf8_strlen(const unsigned char *string, size_t length); +RAPTOR_API +size_t raptor_unicode_utf8_substr(unsigned char* dest, size_t* dest_length_p, const unsigned char* src, size_t src_length, int startingLoc, int length); + +/* Stringbuffer Class */ +RAPTOR_API +raptor_stringbuffer* raptor_new_stringbuffer(void); +RAPTOR_API +void raptor_free_stringbuffer(raptor_stringbuffer *stringbuffer); + +/* methods */ +RAPTOR_API +int raptor_stringbuffer_append_counted_string(raptor_stringbuffer* stringbuffer, const unsigned char *string, size_t length, int do_copy); +RAPTOR_API +int raptor_stringbuffer_append_string(raptor_stringbuffer* stringbuffer, const unsigned char *string, int do_copy); +RAPTOR_API +int raptor_stringbuffer_append_decimal(raptor_stringbuffer* stringbuffer, int integer); +RAPTOR_API +int raptor_stringbuffer_append_hexadecimal(raptor_stringbuffer* stringbuffer, int hex); +RAPTOR_API +int raptor_stringbuffer_append_stringbuffer(raptor_stringbuffer* stringbuffer, raptor_stringbuffer* append); +RAPTOR_API +int raptor_stringbuffer_prepend_counted_string(raptor_stringbuffer* stringbuffer, const unsigned char *string, size_t length, int do_copy); +RAPTOR_API +int raptor_stringbuffer_prepend_string(raptor_stringbuffer* stringbuffer, const unsigned char *string, int do_copy); +RAPTOR_API +unsigned char* raptor_stringbuffer_as_string(raptor_stringbuffer* stringbuffer); +RAPTOR_API +size_t raptor_stringbuffer_length(raptor_stringbuffer* stringbuffer); +RAPTOR_API +int raptor_stringbuffer_copy_to_string(raptor_stringbuffer* stringbuffer, unsigned char *string, size_t length); + +/** + * raptor_iostream_init_func: + * @context: stream context data + * + * Handler function for #raptor_iostream initialising. + * + * Return value: non-0 on failure. + */ +typedef int (*raptor_iostream_init_func) (void *context); + +/** + * raptor_iostream_finish_func: + * @context: stream context data + * + * Handler function for #raptor_iostream terminating. + * + */ +typedef void (*raptor_iostream_finish_func) (void *context); + +/** + * raptor_iostream_write_byte_func + * @context: stream context data + * @byte: byte to write + * + * Handler function for implementing raptor_iostream_write_byte(). + * + * Return value: non-0 on failure. + */ +typedef int (*raptor_iostream_write_byte_func) (void *context, const int byte); + +/** + * raptor_iostream_write_bytes_func: + * @context: stream context data + * @ptr: pointer to bytes to write + * @size: size of item + * @nmemb: number of items + * + * Handler function for implementing raptor_iostream_write_bytes(). + * + * Return value: non-0 on failure. + */ +typedef int (*raptor_iostream_write_bytes_func) (void *context, const void *ptr, size_t size, size_t nmemb); + +/** + * raptor_iostream_write_end_func: + * @context: stream context data + * + * Handler function for implementing raptor_iostream_write_end(). + * + * Return value: non-0 on failure. + */ +typedef int (*raptor_iostream_write_end_func) (void *context); + +/** + * raptor_iostream_read_bytes_func: + * @context: stream context data + * @ptr: pointer to buffer to read into + * @size: size of buffer + * @nmemb: number of items + * + * Handler function for implementing raptor_iostream_read_bytes(). + * + * Return value: number of items read, 0 or < @size on EOF, <0 on failure + */ +typedef int (*raptor_iostream_read_bytes_func) (void *context, void *ptr, size_t size, size_t nmemb); + +/** + * raptor_iostream_read_eof_func: + * @context: stream context data + * + * Handler function for implementing raptor_iostream_read_eof(). + * + * Return value: non-0 if EOF + */ +typedef int (*raptor_iostream_read_eof_func) (void *context); + +/** + * raptor_iostream_handler: + * @version: interface version. Presently 1 or 2. + * @init: initialisation handler - optional, called at most once (V1) + * @finish: finishing handler - optional, called at most once (V1) + * @write_byte: write byte handler - required (for writing) (V1) + * @write_bytes: write bytes handler - required (for writing) (V1) + * @write_end: write end handler - optional (for writing), called at most once (V1) + * @read_bytes: read bytes handler - required (for reading) (V2) + * @read_eof: read EOF handler - required (for reading) (V2) + * + * I/O stream implementation handler structure. + * + */ +typedef struct { + int version; + + /* V1 functions */ + raptor_iostream_init_func init; + raptor_iostream_finish_func finish; + raptor_iostream_write_byte_func write_byte; + raptor_iostream_write_bytes_func write_bytes; + raptor_iostream_write_end_func write_end; + + /* V2 functions */ + raptor_iostream_read_bytes_func read_bytes; + raptor_iostream_read_eof_func read_eof; +} raptor_iostream_handler; + + +/* I/O Stream Class */ +RAPTOR_API +raptor_iostream* raptor_new_iostream_from_handler(raptor_world* world, void *user_data, const raptor_iostream_handler* const handler); +RAPTOR_API +raptor_iostream* raptor_new_iostream_to_sink(raptor_world* world); +RAPTOR_API +raptor_iostream* raptor_new_iostream_to_filename(raptor_world* world, const char *filename); +RAPTOR_API +raptor_iostream* raptor_new_iostream_to_file_handle(raptor_world* world, FILE *handle); +RAPTOR_API +raptor_iostream* raptor_new_iostream_to_string(raptor_world* world, void **string_p, size_t *length_p, raptor_data_malloc_handler const malloc_handler); +RAPTOR_API +raptor_iostream* raptor_new_iostream_from_sink(raptor_world* world); +RAPTOR_API +raptor_iostream* raptor_new_iostream_from_filename(raptor_world* world, const char *filename); +RAPTOR_API +raptor_iostream* raptor_new_iostream_from_file_handle(raptor_world* world, FILE *handle); +RAPTOR_API +raptor_iostream* raptor_new_iostream_from_string(raptor_world* world, void *string, size_t length); +RAPTOR_API +void raptor_free_iostream(raptor_iostream *iostr); + +RAPTOR_API +int raptor_iostream_write_bytes(const void *ptr, size_t size, size_t nmemb, raptor_iostream *iostr); +RAPTOR_API +int raptor_iostream_write_byte(const int byte, raptor_iostream *iostr); +RAPTOR_API +int raptor_iostream_write_end(raptor_iostream *iostr); +RAPTOR_API +int raptor_iostream_string_write(const void *string, raptor_iostream *iostr); +RAPTOR_API +int raptor_iostream_counted_string_write(const void *string, size_t len, raptor_iostream *iostr); +RAPTOR_API +unsigned long raptor_iostream_tell(raptor_iostream *iostr); +RAPTOR_API +int raptor_iostream_decimal_write(int integer, raptor_iostream* iostr); +RAPTOR_API +int raptor_iostream_hexadecimal_write(unsigned int integer, int width, raptor_iostream* iostr); +RAPTOR_API +int raptor_stringbuffer_write(raptor_stringbuffer *sb, raptor_iostream* iostr); +RAPTOR_API +int raptor_uri_write(raptor_uri *uri, raptor_iostream *iostr); +RAPTOR_API +int raptor_iostream_read_bytes(void *ptr, size_t size, size_t nmemb, raptor_iostream* iostr); +RAPTOR_API +int raptor_iostream_read_eof(raptor_iostream *iostr); + +/* I/O Stream utility functions */ + +/** + * raptor_escaped_write_bitflags: + * @RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_BF : Allow \b \f, + * @RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_TNRU : Allow \t \n \r \u \U + * @RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8 : Use UTF-8 instead of \u \U for U+0080 or larger (will always use \u for U+0000..U+001F and U+007F) + * @RAPTOR_ESCAPED_WRITE_BITFLAG_SPARQL_URI_ESCAPES: Must escape #x00-#x20<>\"{}|^` in URIs + * @RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL: N-Triples literal + * @RAPTOR_ESCAPED_WRITE_NTRIPLES_URI: N-Triples URI + * @RAPTOR_ESCAPED_WRITE_SPARQL_LITERAL: SPARQL literal: allows raw UTF8 for printable literals + * @RAPTOR_ESCAPED_WRITE_SPARQL_LONG_LITERAL: SPARQL long literal: no BS-escapes allowed + * @RAPTOR_ESCAPED_WRITE_SPARQL_URI: SPARQL uri: have to escape certain characters + * @RAPTOR_ESCAPED_WRITE_TURTLE_URI: Turtle 2013 URIs (like SPARQL) + * @RAPTOR_ESCAPED_WRITE_TURTLE_LITERAL: Turtle 2013 literals (like SPARQL) + * @RAPTOR_ESCAPED_WRITE_TURTLE_LONG_LITERAL: Turtle 2013 long literals (like SPARQL) + * @RAPTOR_ESCAPED_WRITE_JSON_LITERAL: JSON literals: UTF-8 plus \b \f \t \r \n, \uXXXX only, no \U + * + * Bit flags for raptor_string_escaped_write() and friends. + */ +typedef enum { + RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_BF = 1, + RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_TNRU = 2, + RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8 = 4, + RAPTOR_ESCAPED_WRITE_BITFLAG_SPARQL_URI_ESCAPES = 8, + + /* N-Triples - favour writing \u, \U over UTF8 */ + RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL = RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_TNRU | RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_BF, + RAPTOR_ESCAPED_WRITE_NTRIPLES_URI = RAPTOR_ESCAPED_WRITE_BITFLAG_SPARQL_URI_ESCAPES, + + /* SPARQL literal: allows raw UTF8 for printable literals */ + RAPTOR_ESCAPED_WRITE_SPARQL_LITERAL = RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8, + + /* SPARQL long literal: no BS-escapes allowed */ + RAPTOR_ESCAPED_WRITE_SPARQL_LONG_LITERAL = RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8, + + /* SPARQL uri: have to escape certain characters */ + RAPTOR_ESCAPED_WRITE_SPARQL_URI = RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8 | RAPTOR_ESCAPED_WRITE_BITFLAG_SPARQL_URI_ESCAPES, + + /* Turtle (2013) escapes are like SPARQL */ + RAPTOR_ESCAPED_WRITE_TURTLE_URI = RAPTOR_ESCAPED_WRITE_SPARQL_URI, + RAPTOR_ESCAPED_WRITE_TURTLE_LITERAL = RAPTOR_ESCAPED_WRITE_SPARQL_LITERAL, + RAPTOR_ESCAPED_WRITE_TURTLE_LONG_LITERAL = RAPTOR_ESCAPED_WRITE_SPARQL_LONG_LITERAL, + + /* JSON literals: UTF-8 plus \b \f \t \r \n \uXXXX */ + RAPTOR_ESCAPED_WRITE_JSON_LITERAL = RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_TNRU | RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_BF | RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8 +} raptor_escaped_write_bitflags; + + +RAPTOR_API +int raptor_string_ntriples_write(const unsigned char *string, size_t len, const char delim, raptor_iostream *iostr); +RAPTOR_API +int raptor_bnodeid_ntriples_write(const unsigned char *bnodeid, size_t len, raptor_iostream *iostr); +RAPTOR_API RAPTOR_DEPRECATED +int raptor_string_python_write(const unsigned char *string, size_t len, const char delim, unsigned int mode, raptor_iostream *iostr); +RAPTOR_API +int raptor_statement_ntriples_write(const raptor_statement *statement, raptor_iostream* iostr, int write_graph_term); +RAPTOR_API +int raptor_string_escaped_write(const unsigned char *string, size_t len, const char delim, unsigned int flags, raptor_iostream *iostr); + + +/* Parser and Serializer options */ + +/** + * raptor_option_value_type: + * @RAPTOR_OPTION_VALUE_TYPE_BOOL: Boolean integer value. Non-0 is true + * @RAPTOR_OPTION_VALUE_TYPE_INT: Decimal integer value + * @RAPTOR_OPTION_VALUE_TYPE_STRING: String value + * @RAPTOR_OPTION_VALUE_TYPE_URI: URI String value. + * @RAPTOR_OPTION_VALUE_TYPE_LAST: internal + * + * Option value types. + */ +typedef enum { + RAPTOR_OPTION_VALUE_TYPE_BOOL, + RAPTOR_OPTION_VALUE_TYPE_INT, + RAPTOR_OPTION_VALUE_TYPE_STRING, + RAPTOR_OPTION_VALUE_TYPE_URI, + RAPTOR_OPTION_VALUE_TYPE_LAST = RAPTOR_OPTION_VALUE_TYPE_URI +} raptor_option_value_type; + + +/** + * raptor_option_description: + * @domain: domain ID + * @option: option ID + * @value_type: data type of option value + * @name: short name for option + * @name_len: length of @name + * @label: description of option + * @uri: URI identifying option + * + * Description of an option for a domain. + */ +typedef struct { + raptor_domain domain; + raptor_option option; + raptor_option_value_type value_type; + const char* name; + size_t name_len; + const char* label; + raptor_uri* uri; +} raptor_option_description; + + +RAPTOR_API +unsigned int raptor_option_get_count(void); +RAPTOR_API +const char* raptor_option_get_value_type_label(const raptor_option_value_type type); +RAPTOR_API +void raptor_free_option_description(raptor_option_description* option_description); +RAPTOR_API +raptor_option_description* raptor_world_get_option_description(raptor_world* world, const raptor_domain domain, const raptor_option option); + + +/* SAX2 element Class (raptor_xml_element) */ +RAPTOR_API +raptor_xml_element* raptor_new_xml_element(raptor_qname* name, const unsigned char* xml_language, raptor_uri* xml_base); +RAPTOR_API +raptor_xml_element* raptor_new_xml_element_from_namespace_local_name(raptor_namespace *ns, const unsigned char *name, const unsigned char *xml_language, raptor_uri *xml_base); +RAPTOR_API +void raptor_free_xml_element(raptor_xml_element *element); + +/* methods */ +RAPTOR_API +raptor_qname* raptor_xml_element_get_name(raptor_xml_element *xml_element); +RAPTOR_API +void raptor_xml_element_set_attributes(raptor_xml_element* xml_element, raptor_qname **attributes, int count); +RAPTOR_API +raptor_qname** raptor_xml_element_get_attributes(raptor_xml_element* xml_element); +RAPTOR_API +int raptor_xml_element_get_attributes_count(raptor_xml_element* xml_element); +RAPTOR_API +int raptor_xml_element_declare_namespace(raptor_xml_element* xml_element, raptor_namespace *nspace); +RAPTOR_API +int raptor_xml_element_write(raptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, int is_end, int depth, raptor_iostream *iostr); +RAPTOR_API +int raptor_xml_element_is_empty(raptor_xml_element* xml_element); +RAPTOR_API +const unsigned char* raptor_xml_element_get_language(raptor_xml_element* xml_element); + + +/* XML Writer Class (raptor_xml_writer) */ +RAPTOR_API +raptor_xml_writer* raptor_new_xml_writer(raptor_world* world, raptor_namespace_stack *nstack, raptor_iostream* iostr); +RAPTOR_API +void raptor_free_xml_writer(raptor_xml_writer* xml_writer); + +/* methods */ +RAPTOR_API +void raptor_xml_writer_empty_element(raptor_xml_writer* xml_writer, raptor_xml_element *element); +RAPTOR_API +void raptor_xml_writer_start_element(raptor_xml_writer* xml_writer, raptor_xml_element *element); +RAPTOR_API +void raptor_xml_writer_end_element(raptor_xml_writer* xml_writer, raptor_xml_element *element); +RAPTOR_API +void raptor_xml_writer_newline(raptor_xml_writer* xml_writer); +RAPTOR_API +void raptor_xml_writer_cdata(raptor_xml_writer* xml_writer, const unsigned char *s); +RAPTOR_API +void raptor_xml_writer_cdata_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len); +RAPTOR_API +void raptor_xml_writer_raw(raptor_xml_writer* xml_writer, const unsigned char *s); +RAPTOR_API +void raptor_xml_writer_raw_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len); +RAPTOR_API +void raptor_xml_writer_comment(raptor_xml_writer* xml_writer, const unsigned char *s); +RAPTOR_API +void raptor_xml_writer_comment_counted(raptor_xml_writer* xml_writer, const unsigned char *s, unsigned int len); +RAPTOR_API +void raptor_xml_writer_flush(raptor_xml_writer* xml_writer); +RAPTOR_API +int raptor_xml_writer_set_option(raptor_xml_writer *xml_writer, raptor_option option, char* string, int integer); +RAPTOR_API +int raptor_xml_writer_get_option(raptor_xml_writer *xml_writer, raptor_option option, char** string_p, int* integer_p); +RAPTOR_API +int raptor_xml_writer_get_depth(raptor_xml_writer *xml_writer); + +/** + * raptor_sax2_start_element_handler: + * @user_data: user data + * @xml_element: XML element + * + * SAX2 start element handler + */ +typedef void (*raptor_sax2_start_element_handler)(void *user_data, raptor_xml_element *xml_element); + +/** + * raptor_sax2_end_element_handler: + * @user_data: user data + * @xml_element: XML element + * + * SAX2 end element handler + */ +typedef void (*raptor_sax2_end_element_handler)(void *user_data, raptor_xml_element* xml_element); + +/** + * raptor_sax2_characters_handler: + * @user_data: user data + * @xml_element: XML element + * @s: string + * @len: string len + * + * SAX2 characters handler + */ +typedef void (*raptor_sax2_characters_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s, int len); + +/** + * raptor_sax2_cdata_handler: + * @user_data: user data + * @xml_element: XML element + * @s: string + * @len: string len + + * SAX2 CDATA section handler + */ +typedef void (*raptor_sax2_cdata_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s, int len); + +/** + * raptor_sax2_comment_handler: + * @user_data: user data + * @xml_element: XML element + * @s: string + * + * SAX2 XML comment handler + */ +typedef void (*raptor_sax2_comment_handler)(void *user_data, raptor_xml_element* xml_element, const unsigned char *s); + +/** + * raptor_sax2_unparsed_entity_decl_handler: + * @user_data: user data + * @entityName: entity name + * @base: base URI + * @systemId: system ID + * @publicId: public ID + * @notationName: notation name + * + * SAX2 unparsed entity (NDATA) handler + */ +typedef void (*raptor_sax2_unparsed_entity_decl_handler)(void *user_data, const unsigned char* entityName, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId, const unsigned char* notationName); + +/** + * raptor_sax2_external_entity_ref_handler: + * @user_data: user data + * @context: context + * @base: base URI + * @systemId: system ID + * @publicId: public ID + * + * SAX2 external entity reference handler + * + * Return value: 0 if processing should not continue because of a + * fatal error in the handling of the external entity. + */ +typedef int (*raptor_sax2_external_entity_ref_handler)(void *user_data, const unsigned char* context, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId); + + +/* SAX2 API */ +RAPTOR_API +raptor_sax2* raptor_new_sax2(raptor_world *world, raptor_locator *locator, void* user_data); +RAPTOR_API +void raptor_free_sax2(raptor_sax2 *sax2); + +/* methods */ +RAPTOR_API +void raptor_sax2_set_start_element_handler(raptor_sax2* sax2, raptor_sax2_start_element_handler handler); +RAPTOR_API +void raptor_sax2_set_end_element_handler(raptor_sax2* sax2, raptor_sax2_end_element_handler handler); +RAPTOR_API +void raptor_sax2_set_characters_handler(raptor_sax2* sax2, raptor_sax2_characters_handler handler); +RAPTOR_API +void raptor_sax2_set_cdata_handler(raptor_sax2* sax2, raptor_sax2_cdata_handler handler); +RAPTOR_API +void raptor_sax2_set_comment_handler(raptor_sax2* sax2, raptor_sax2_comment_handler handler); +RAPTOR_API +void raptor_sax2_set_unparsed_entity_decl_handler(raptor_sax2* sax2, raptor_sax2_unparsed_entity_decl_handler handler); +RAPTOR_API +void raptor_sax2_set_external_entity_ref_handler(raptor_sax2* sax2, raptor_sax2_external_entity_ref_handler handler); +RAPTOR_API +void raptor_sax2_set_namespace_handler(raptor_sax2* sax2, raptor_namespace_handler handler); +RAPTOR_API +void raptor_sax2_set_uri_filter(raptor_sax2* sax2, raptor_uri_filter_func filter, void *user_data); +RAPTOR_API +void raptor_sax2_parse_start(raptor_sax2 *sax2, raptor_uri *base_uri); +RAPTOR_API +int raptor_sax2_parse_chunk(raptor_sax2* sax2, const unsigned char *buffer, size_t len, int is_end); +RAPTOR_API +const unsigned char* raptor_sax2_inscope_xml_language(raptor_sax2* sax2); +RAPTOR_API +raptor_uri* raptor_sax2_inscope_base_uri(raptor_sax2* sax2); + + + +/* AVL Trees */ + +/** + * raptor_avltree: + * + * AVL Tree + */ +typedef struct raptor_avltree_s raptor_avltree; + +/** + * raptor_avltree_iterator: + * + * AVL Tree Iterator as created by raptor_new_avltree_iterator() + */ +typedef struct raptor_avltree_iterator_s raptor_avltree_iterator; + +/** + * raptor_avltree_visit_handler: + * @depth: depth of object in tree + * @data: data object being visited + * @user_data: user data arg to raptor_avltree_visit() + * + * AVL Tree visitor function as given to raptor_avltree_visit() + * + * Return value: non-0 to terminate visit early. + */ +typedef int (*raptor_avltree_visit_handler)(int depth, void* data, void *user_data); + + +/** + * raptor_avltree_bitflags: + * @RAPTOR_AVLTREE_FLAG_REPLACE_DUPLICATES: If set raptor_avltree_add() will replace any duplicate items. If not set, raptor_avltree_add() will not replace them and will return status >0 when adding a duplicate. (Default is not set) + * + * Bit flags for AVL Tree class constructor raptor_new_avltree() + **/ +typedef enum { + RAPTOR_AVLTREE_FLAG_REPLACE_DUPLICATES = 1 +} raptor_avltree_bitflags; + + +RAPTOR_API +raptor_avltree* raptor_new_avltree(raptor_data_compare_handler compare_handler, raptor_data_free_handler free_handler, unsigned int flags); +RAPTOR_API +void raptor_free_avltree(raptor_avltree* tree); + +/* methods */ +RAPTOR_API +int raptor_avltree_add(raptor_avltree* tree, void* p_data); +RAPTOR_API +void* raptor_avltree_remove(raptor_avltree* tree, void* p_data); +RAPTOR_API +int raptor_avltree_delete(raptor_avltree* tree, void* p_data); +RAPTOR_API +void raptor_avltree_trim(raptor_avltree* tree); +RAPTOR_API +void* raptor_avltree_search(raptor_avltree* tree, const void* p_data); +RAPTOR_API +int raptor_avltree_visit(raptor_avltree* tree, raptor_avltree_visit_handler visit_handler, void* user_data); +RAPTOR_API +int raptor_avltree_size(raptor_avltree* tree); +RAPTOR_API +void raptor_avltree_set_print_handler(raptor_avltree* tree, raptor_data_print_handler print_handler); +RAPTOR_API +int raptor_avltree_print(raptor_avltree* tree, FILE* stream); + +RAPTOR_API +raptor_avltree_iterator* raptor_new_avltree_iterator(raptor_avltree* tree, void* range, raptor_data_free_handler range_free_handler, int direction); +RAPTOR_API +void raptor_free_avltree_iterator(raptor_avltree_iterator* iterator); + +RAPTOR_API +int raptor_avltree_iterator_is_end(raptor_avltree_iterator* iterator); +RAPTOR_API +int raptor_avltree_iterator_next(raptor_avltree_iterator* iterator); +RAPTOR_API +void* raptor_avltree_iterator_get(raptor_avltree_iterator* iterator); + +/* utility methods */ +RAPTOR_API +void raptor_sort_r(void *base, size_t nel, size_t width, raptor_data_compare_arg_handler compar, void *user_data); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/raptor_abbrev.c b/src/raptor_abbrev.c new file mode 100644 index 0000000..d850e58 --- /dev/null +++ b/src/raptor_abbrev.c @@ -0,0 +1,642 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_abbrev.c - Code common to abbreviating serializers (ttl/rdfxmla) + * + * Copyright (C) 2006, Dave Robillard + * Copyright (C) 2004-2011, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * Copyright (C) 2005, Steve Shepard steveshep@gmail.com + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * raptor_abbrev_node implementation + * + */ + + +static raptor_abbrev_subject* raptor_new_abbrev_subject(raptor_abbrev_node* node); + +/** + * raptor_new_abbrev_node: + * @world: raptor world + * @term: term to use + * + * INTERNAL - Constructor for raptor_abbrev_node + * + * The @term is copied by the constructor. + * + * Return value: new raptor abbrev node or NULL on failure + **/ +raptor_abbrev_node* +raptor_new_abbrev_node(raptor_world* world, raptor_term *term) +{ + raptor_abbrev_node* node = NULL; + + if(term->type == RAPTOR_TERM_TYPE_UNKNOWN) + return NULL; + + node = RAPTOR_CALLOC(raptor_abbrev_node*, 1, sizeof(*node)); + if(node) { + node->world = world; + node->ref_count = 1; + node->term = raptor_term_copy(term); + } + + return node; +} + + +/** + * raptor_new_abbrev_node: + * @node: raptor abbrev node + * + * INTERNAL - Destructor for raptor_abbrev_node + */ +void +raptor_free_abbrev_node(raptor_abbrev_node* node) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(node, raptor_abbrev_node); + + if(--node->ref_count) + return; + + if(node->term) + raptor_free_term(node->term); + + RAPTOR_FREE(raptor_abbrev_node, node); +} + + +/** + * raptor_abbrev_node_compare: + * @node1: node 1 + * @node2: node 2 + * + * INTERNAL - compare two raptor_abbrev_nodes. + * + * This needs to be a strong ordering for use by raptor_avltree. + * This is very performance critical, anything to make it faster is worth it. + * + * Return value: <0, 0 or 1 if @node1 less than, equal or greater + * than @node2 respectively + */ +int +raptor_abbrev_node_compare(raptor_abbrev_node* node1, raptor_abbrev_node* node2) +{ + if(node1 == node2) + return 0; + + return raptor_term_compare(node1->term, node2->term); +} + + +/** + * raptor_abbrev_node_equals: + * @node1: node 1 + * @node2: node 2 + * + * INTERNAL - compare two raptor_abbrev_nodes for equality + * + * Return value: non-0 if nodes are equal + */ +int +raptor_abbrev_node_equals(raptor_abbrev_node* node1, raptor_abbrev_node* node2) +{ + return raptor_term_equals(node1->term, node2->term); +} + + +/** + * raptor_abbrev_node_lookup: + * @nodes: Tree of nodes to search + * @node: Node value to search for + * + * INTERNAL - Look in an avltree of nodes for a node described by parameters + * and if present create it, add it and return it + * + * Return value: the node found/created or NULL on failure + */ +raptor_abbrev_node* +raptor_abbrev_node_lookup(raptor_avltree* nodes, raptor_term* term) +{ + raptor_abbrev_node *lookup_node; + raptor_abbrev_node *rv_node; + + /* Create a temporary node for search comparison. */ + lookup_node = raptor_new_abbrev_node(term->world, term); + + if(!lookup_node) + return NULL; + + rv_node = (raptor_abbrev_node*)raptor_avltree_search(nodes, lookup_node); + + /* If not found, insert/return a new one */ + if(!rv_node) { + + if(raptor_avltree_add(nodes, lookup_node)) + return NULL; + else + return lookup_node; + + /* Found */ + } else { + raptor_free_abbrev_node(lookup_node); + return rv_node; + } +} + + +static raptor_abbrev_node** +raptor_new_abbrev_po(raptor_abbrev_node* predicate, raptor_abbrev_node* object) +{ + raptor_abbrev_node** nodes = NULL; + nodes = RAPTOR_CALLOC(raptor_abbrev_node**, 2, sizeof(raptor_abbrev_node*)); + if(!nodes) + return NULL; + + nodes[0] = predicate; + nodes[1] = object; + + return nodes; +} + + +static void +raptor_free_abbrev_po(raptor_abbrev_node** nodes) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(nodes, raptor_abbrev_node_pair); + + if(nodes[0]) + raptor_free_abbrev_node(nodes[0]); + if(nodes[1]) + raptor_free_abbrev_node(nodes[1]); + + RAPTOR_FREE(raptor_abbrev_nodes, nodes); +} + + +static int +raptor_compare_abbrev_po(raptor_abbrev_node** nodes1, + raptor_abbrev_node** nodes2) +{ + int d; + d = raptor_abbrev_node_compare(nodes1[0], nodes2[0]); + if(!d) + d = raptor_abbrev_node_compare(nodes1[1], nodes2[1]); + + return d; +} + + +#ifdef RAPTOR_DEBUG +static int +raptor_print_abbrev_po(void** object, FILE* handle) +{ + raptor_abbrev_node** nodes = (raptor_abbrev_node**)object; + raptor_abbrev_node* p = nodes[0]; + raptor_abbrev_node* o = nodes[1]; + + if(p && o) { + fputc('[', handle); + raptor_term_print_as_ntriples(p->term, handle); + fputs(" : ", handle); + raptor_term_print_as_ntriples(o->term, handle); + fputs("]\n", handle); + } + return 0; +} +#endif + + +/* + * raptor_abbrev_subject implementation + * + * The subject of triples, with all predicates and values + * linked from them. + * + **/ + + +static raptor_abbrev_subject* +raptor_new_abbrev_subject(raptor_abbrev_node* node) +{ + raptor_abbrev_subject* subject; + + if(!(node->term->type == RAPTOR_TERM_TYPE_URI || + node->term->type == RAPTOR_TERM_TYPE_BLANK)) { + raptor_log_error(node->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Subject node is type %d not a uri or blank node"); + return NULL; + } + + subject = RAPTOR_CALLOC(raptor_abbrev_subject*, 1, sizeof(*subject)); + + if(subject) { + subject->node = node; + subject->node->ref_count++; + subject->node->count_as_subject++; + + subject->node_type = NULL; + + subject->valid = 1; + + subject->properties = + raptor_new_avltree((raptor_data_compare_handler)raptor_compare_abbrev_po, + (raptor_data_free_handler)raptor_free_abbrev_po, + 0); +#ifdef RAPTOR_DEBUG + if(subject->properties) + raptor_avltree_set_print_handler(subject->properties, + (raptor_data_print_handler)raptor_print_abbrev_po); +#endif + + subject->list_items = + raptor_new_sequence((raptor_data_free_handler)raptor_free_abbrev_node, NULL); + + if(!subject->properties || !subject->list_items) { + raptor_free_abbrev_subject(subject); + subject = NULL; + } + + } + + return subject; +} + + +void +raptor_free_abbrev_subject(raptor_abbrev_subject* subject) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(subject, raptor_abbrev_subject); + + if(subject->node) + raptor_free_abbrev_node(subject->node); + + if(subject->node_type) + raptor_free_abbrev_node(subject->node_type); + + if(subject->properties) + raptor_free_avltree(subject->properties); + + if(subject->list_items) + raptor_free_sequence(subject->list_items); + + RAPTOR_FREE(raptor_subject, subject); +} + + +int +raptor_abbrev_subject_valid(raptor_abbrev_subject *subject) +{ + return subject->valid; +} + + +int +raptor_abbrev_subject_invalidate(raptor_abbrev_subject *subject) +{ + subject->valid = 0; + return 0; +} + + + + +/** + * raptor_subject_add_property: + * @subject: subject node to add to + * @predicate: predicate node + * @object: object node + * + * INTERNAL - Add predicate/object pair into properties array of a subject node. + * + * The subject node takes ownership of the predicate/object nodes. + * On error, predicate/object are freed immediately. + * + * Return value: <0 on failure, >0 if pair is a duplicate and it was not added + **/ +int +raptor_abbrev_subject_add_property(raptor_abbrev_subject* subject, + raptor_abbrev_node* predicate, + raptor_abbrev_node* object) +{ + int err; + raptor_abbrev_node** nodes; + + nodes = raptor_new_abbrev_po(predicate, object); + if(!nodes) + return -1; + + predicate->ref_count++; + object->ref_count++; + + if(raptor_avltree_search(subject->properties, nodes)) { + /* Already present - do not add a duplicate triple (s->[p o]) */ + raptor_free_abbrev_po(nodes); + return 1; + } + +#if 0 + fprintf(stderr, "Adding P,O "); + raptor_print_abbrev_po(stderr, nodes); + + raptor_avltree_dump(subject->properties, stderr); +#endif + err = raptor_avltree_add(subject->properties, nodes); + if(err) + return -1; +#if 0 + fprintf(stderr, "Result "); + raptor_avltree_print(subject->properties, stderr); + + raptor_avltree_dump(subject->properties, stderr); + + raptor_avltree_check(subject->properties); + + fprintf(stderr, "\n\n"); +#endif + + return 0; +} + + +int +raptor_abbrev_subject_compare(raptor_abbrev_subject* subject1, + raptor_abbrev_subject* subject2) +{ + return raptor_abbrev_node_compare(subject1->node, subject2->node); +} + + +/** + * raptor_abbrev_subject_find: + * @subjects: AVL-Tree of subject nodes + * @term: node to find + * + * INTERNAL - Find a subject node in an AVL-Tree of subject nodes + * + * Return value: node or NULL if not found or failure + */ +raptor_abbrev_subject* +raptor_abbrev_subject_find(raptor_avltree *subjects, raptor_term* node) +{ + raptor_abbrev_subject* rv_subject = NULL; + raptor_abbrev_node* lookup_node = NULL; + raptor_abbrev_subject* lookup = NULL; + + /* datatype and language are both NULL for a subject node */ + + lookup_node = raptor_new_abbrev_node(node->world, node); + if(!lookup_node) + return NULL; + + lookup = raptor_new_abbrev_subject(lookup_node); + if(!lookup) { + raptor_free_abbrev_node(lookup_node); + return NULL; + } + + rv_subject = (raptor_abbrev_subject*) raptor_avltree_search(subjects, lookup); + + raptor_free_abbrev_subject(lookup); + raptor_free_abbrev_node(lookup_node); + + return rv_subject; +} + + +/** + * raptor_abbrev_subject_lookup: + * @nodes: AVL-Tree of subject nodes + * @subjects: AVL-Tree of URI-subject nodes + * @blanks: AVL-Tree of blank-subject nodes + * @term: node to find + * + * INTERNAL - Find a subject node in the appropriate uri/blank AVL-Tree of subject nodes or add it + * + * Return value: node or NULL on failure + */ +raptor_abbrev_subject* +raptor_abbrev_subject_lookup(raptor_avltree* nodes, + raptor_avltree* subjects, raptor_avltree* blanks, + raptor_term* term) +{ + raptor_avltree *tree; + raptor_abbrev_subject* rv_subject; + + /* Search for specified resource. */ + tree = (term->type == RAPTOR_TERM_TYPE_BLANK) ? blanks : subjects; + rv_subject = raptor_abbrev_subject_find(tree, term); + + /* If not found, create one and insert it */ + if(!rv_subject) { + raptor_abbrev_node* node = raptor_abbrev_node_lookup(nodes, term); + if(node) { + rv_subject = raptor_new_abbrev_subject(node); + if(rv_subject) { + if(raptor_avltree_add(tree, rv_subject)) { + rv_subject = NULL; + } + } + } + } + + return rv_subject; +} + + +#ifdef ABBREV_DEBUG +void +raptor_print_subject(raptor_abbrev_subject* subject) +{ + int i; + unsigned char *subj; + unsigned char *pred; + unsigned char *obj; + raptor_avltree_iterator* iter = NULL; + + /* Note: The raptor_abbrev_node field passed as the first argument for + * raptor_term_to_string() is somewhat arbitrary, since as + * the data structure is designed, the first word in the value union + * is what was passed as the subject/predicate/object of the + * statement. + */ + subj = raptor_term_to_string(subject); + + if(subject->type) { + obj = raptor_term_to_string(subject); + fprintf(stderr,"[%s, http://www.w3.org/1999/02/22-rdf-syntax-ns#type, %s]\n", subj, obj); + RAPTOR_FREE(char*, obj); + } + + for(i = 0; i < raptor_sequence_size(subject->elements); i++) { + + raptor_abbrev_node* o = raptor_sequence_get_at(subject->elements, i); + if(o) { + obj = raptor_term_to_string(o); + fprintf(stderr,"[%s, [rdf:_%d], %s]\n", subj, i, obj); + RAPTOR_FREE(char*, obj); + } + + } + + + iter = raptor_new_avltree_iterator(subject->properties, NULL, NULL, 1); + while(iter) { + raptor_abbrev_node** nodes; + nodes = (raptor_abbrev_node**)raptor_avltree_iterator_get(iter); + if(!nodes) + break; + raptor_print_abbrev_po(stderr, nodes); + + if(raptor_avltree_iterator_next(iter)) + break; + } + if(iter) + raptor_free_avltree_iterator(iter); + + RAPTOR_FREE(char*, subj); + +} +#endif + + +/* helper functions */ + +/** + * raptor_new_qname_from_resource: + * @namespaces: sequence of namespaces (corresponding to nstack) + * @nstack: #raptor_namespace_stack to use/update + * @namespace_count: size of nstack (may be modified) + * @node: #raptor_abbrev_node to use + * + * INTERNAL - Make an XML QName from the URI associated with the node. + * + * Return value: the QName or NULL on failure + **/ +raptor_qname* +raptor_new_qname_from_resource(raptor_sequence* namespaces, + raptor_namespace_stack* nstack, + int* namespace_count, + raptor_abbrev_node* node) +{ + unsigned char* name = NULL; /* where to split predicate name */ + size_t name_len = 1; + unsigned char *uri_string; + size_t uri_len; + unsigned char *p; + raptor_uri *ns_uri; + raptor_namespace *ns; + raptor_qname *qname; + unsigned char *ns_uri_string; + size_t ns_uri_string_len; + + if(node->term->type != RAPTOR_TERM_TYPE_URI) { +#ifdef RAPTOR_DEBUG + RAPTOR_FATAL1("Node must be a URI\n"); +#else + return NULL; +#endif + } + + qname = raptor_new_qname_from_namespace_uri(nstack, node->term->value.uri, 10); + if(qname) + return qname; + + uri_string = raptor_uri_as_counted_string(node->term->value.uri, &uri_len); + + p= uri_string; + name_len = uri_len; + while(name_len >0) { + if(raptor_xml_name_check(p, name_len, 10)) { + name = p; + break; + } + p++; name_len--; + } + + if(!name || (name == uri_string)) + return NULL; + + ns_uri_string_len = uri_len - name_len; + ns_uri_string = RAPTOR_MALLOC(unsigned char*, ns_uri_string_len + 1); + if(!ns_uri_string) + return NULL; + memcpy(ns_uri_string, (const char*)uri_string, ns_uri_string_len); + ns_uri_string[ns_uri_string_len] = '\0'; + + ns_uri = raptor_new_uri_from_counted_string(node->world, ns_uri_string, + ns_uri_string_len); + RAPTOR_FREE(char*, ns_uri_string); + + if(!ns_uri) + return NULL; + + ns = raptor_namespaces_find_namespace_by_uri(nstack, ns_uri); + if(!ns) { + /* The namespace was not declared, so create one */ + unsigned char prefix[2 + MAX_ASCII_INT_SIZE + 1]; + (*namespace_count)++; + prefix[0] = 'n'; + prefix[1] = 's'; + (void)raptor_format_integer(RAPTOR_GOOD_CAST(char*,&prefix[2]), + MAX_ASCII_INT_SIZE + 1, *namespace_count, + /* base */ 10, -1, '\0'); + + ns = raptor_new_namespace_from_uri(nstack, prefix, ns_uri, 0); + + /* We'll most likely need this namespace again. Push it on our + * stack. It will be deleted in raptor_rdfxmla_serialize_terminate() + */ + if(raptor_sequence_push(namespaces, ns)) { + /* namespaces sequence has no free handler so we have to free + * the ns ourselves on error + */ + raptor_free_namespace(ns); + raptor_free_uri(ns_uri); + return NULL; + } + } + + qname = raptor_new_qname_from_namespace_local_name(node->world, ns, name, + NULL); + + raptor_free_uri(ns_uri); + + return qname; +} diff --git a/src/raptor_avltree.c b/src/raptor_avltree.c new file mode 100644 index 0000000..4001a92 --- /dev/null +++ b/src/raptor_avltree.c @@ -0,0 +1,1791 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_avltree.c - Balanced Binary Tree / AVL Tree + * + * This file is in the public domain. + * + * Based on public domain sources posted to comp.sources.misc in 1993 + * + * From: p...@vix.com (Paul Vixie) + * Newsgroups: comp.sources.unix + * Subject: v27i034: REPOST AVL Tree subroutines (replaces v11i020 from 1987), Part01/01 + * Date: 6 Sep 1993 13:51:22 -0700 + * Message-ID: <1.747348668.4037@gw.home.vix.com> + * + * ---------------------------------------------------------------------- + * Original headers below + */ + +/* as_tree - tree library for as + * vix 14dec85 [written] + * vix 02feb86 [added tree balancing from wirth "a+ds=p" p. 220-221] + * vix 06feb86 [added tree_mung()] + * vix 20jun86 [added tree_delete per wirth a+ds (mod2 v.) p. 224] + * vix 23jun86 [added delete uar to add for replaced nodes] + * vix 22jan93 [revisited; uses RCS, ANSI, POSIX; has bug fixes] + */ + + +/* This program text was created by Paul Vixie using examples from the book: + * "Algorithms & Data Structures," Niklaus Wirth, Prentice-Hall, 1986, ISBN + * 0-13-022005-1. This code and associated documentation is hereby placed + * in the public domain. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 +#define RAPTOR_AVLTREE_DEBUG1(msg) RAPTOR_DEBUG1(msg) +#else +#define RAPTOR_AVLTREE_DEBUG1(msg) +#endif + + +#define RAPTOR_AVLTREE_ENOMEM -1 +#define RAPTOR_AVLTREE_EXISTS 1 + + +#ifndef STANDALONE + +/* raptor_avltree.c */ +typedef struct raptor_avltree_node_s raptor_avltree_node; + +/* AVL-tree */ +struct raptor_avltree_s { + /* root node of tree */ + raptor_avltree_node* root; + + /* node comparison function (optional) */ + raptor_data_compare_handler compare_handler; + + /* node deletion function (optional) */ + raptor_data_free_handler free_handler; + + /* node print function (optional) */ + raptor_data_print_handler print_handler; + + /* tree bitflags - bitmask of #raptor_avltree_bitflags flags */ + unsigned int flags; + + /* number of nodes in tree */ + unsigned int size; +}; + + +/* AVL-tree node */ +struct raptor_avltree_node_s { + /* parent tree */ + struct raptor_avltree_node_s *parent; + + /* left child tree */ + struct raptor_avltree_node_s *left; + + /* right child tree */ + struct raptor_avltree_node_s *right; + + /* balance factor = + * height of the right tree minus the height of the left tree + * i.e. equal: 0 left larger: -1 right larger: 1 + */ + signed char balance; + + /* actual data */ + void* data; +}; + + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + + +/* local prototypes */ +static int raptor_avltree_sprout(raptor_avltree* tree, raptor_avltree_node* parent, raptor_avltree_node** node_pp, void* p_data, int *rebalancing_p); +static void* raptor_avltree_delete_internal(raptor_avltree* tree, raptor_avltree_node** node_pp, void* p_data, int *rebalancing_p); +static void* raptor_avltree_delete_internal2(raptor_avltree* tree, raptor_avltree_node** ppr_r, int *rebalancing_p, raptor_avltree_node** ppr_q); +static void raptor_avltree_balance_left(raptor_avltree* tree, raptor_avltree_node** node_pp, int *rebalancing_p); +static void raptor_avltree_balance_right(raptor_avltree* tree, raptor_avltree_node** node_pp, int *rebalancing_p); +static raptor_avltree_node* raptor_avltree_search_internal(raptor_avltree* tree, raptor_avltree_node* node, const void* p_data); +static int raptor_avltree_visit_internal(raptor_avltree* tree, raptor_avltree_node* node, int depth, raptor_avltree_visit_handler visit_fn, void* user_data); +static void raptor_free_avltree_internal(raptor_avltree* tree, raptor_avltree_node* node); +#ifdef RAPTOR_DEBUG +static void raptor_avltree_check_internal(raptor_avltree* tree, raptor_avltree_node* node, unsigned int* count_p); +#endif + + +/** + * raptor_new_avltree: + * @compare_handler: item comparison handler for ordering + * @free_handler: item free handler (or NULL) + * @flags: AVLTree flags - bitmask of #raptor_avltree_bitflags flags. + * + * AVL Tree Constructor + * + * Return value: new AVL Tree or NULL on failure + */ +raptor_avltree* +raptor_new_avltree(raptor_data_compare_handler compare_handler, + raptor_data_free_handler free_handler, + unsigned int flags) +{ + raptor_avltree* tree; + + tree = RAPTOR_MALLOC(raptor_avltree*, sizeof(*tree)); + if(!tree) + return NULL; + + tree->root = NULL; + tree->compare_handler = compare_handler; + tree->free_handler = free_handler; + tree->print_handler = NULL; + tree->flags = flags; + tree->size = 0; + + return tree; +} + + +/** + * raptor_free_avltree: + * @tree: AVLTree object + * + * AVL Tree destructor + */ +void +raptor_free_avltree(raptor_avltree* tree) +{ + if(!tree) + return; + + raptor_free_avltree_internal(tree, tree->root); + + RAPTOR_FREE(raptor_avltree, tree); +} + + +static void +raptor_free_avltree_internal(raptor_avltree* tree, raptor_avltree_node* node) +{ + if(node) { + raptor_free_avltree_internal(tree, node->left); + + raptor_free_avltree_internal(tree, node->right); + + if(tree->free_handler) + tree->free_handler(node->data); + tree->size--; + RAPTOR_FREE(raptor_avltree_node, node); + } +} + + +/* methods */ + +static raptor_avltree_node* +raptor_avltree_search_internal(raptor_avltree* tree, raptor_avltree_node* node, + const void* p_data) +{ + if(node) { + int cmp= tree->compare_handler(p_data, node->data); + + if(cmp > 0) + return raptor_avltree_search_internal(tree, node->right, p_data); + else if(cmp < 0) + return raptor_avltree_search_internal(tree, node->left, p_data); + + /* found */ + return node; + } + + /* otherwise not found */ + return NULL; +} + + +/** + * raptor_avltree_search: + * @tree: AVL Tree object + * @p_data: pointer to data item + * + * Find an item in an AVL Tree + * + * Return value: shared pointer to item (still owned by AVL Tree) or NULL on failure or if not found + */ +void* +raptor_avltree_search(raptor_avltree* tree, const void* p_data) +{ + raptor_avltree_node* node; + node = raptor_avltree_search_internal(tree, tree->root, p_data); + return node ? node->data : NULL; +} + + +/** + * raptor_avltree_add: + * @tree: AVL Tree object + * @p_data: pointer to data item + * + * add an item to an AVL Tree + * + * The item added becomes owned by the AVL Tree, and will be freed by + * the free_handler argument given to raptor_new_avltree(). + * + * Return value: 0 on success, >0 if equivalent item exists (and the old element remains in the tree), <0 on failure + */ +int +raptor_avltree_add(raptor_avltree* tree, void* p_data) +{ + int rebalancing = FALSE; + int rv; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Checking tree before adding\n"); + raptor_avltree_check(tree); +#endif + + rv = raptor_avltree_sprout(tree, NULL, &tree->root, p_data, + &rebalancing); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Checking tree after adding\n"); + raptor_avltree_check(tree); +#endif + + return rv; +} + + +/** + * raptor_avltree_remove: + * @tree: AVL Tree object + * @p_data: pointer to data item + * + * Remove an item from an AVL Tree and return it + * + * The item removed is no longer owned by the AVL Tree and is + * owned by the caller. + * + * Return value: object or NULL on failure or if not found + */ +void* +raptor_avltree_remove(raptor_avltree* tree, void* p_data) +{ + int rebalancing = FALSE; + void* rdata; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Checking tree before removing\n"); + raptor_avltree_dump(tree,stderr); + raptor_avltree_check(tree); +#endif + rdata = raptor_avltree_delete_internal(tree, &tree->root, p_data, + &rebalancing); + if(rdata) + tree->size--; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Checking tree after removing\n"); + raptor_avltree_dump(tree,stderr); + raptor_avltree_check(tree); +#endif + + return rdata; +} + + +/** + * raptor_avltree_delete: + * @tree: AVL Tree object + * @p_data: pointer to data item + * + * Remove an item from an AVL Tree and free it + * + * Return value: non-0 on failure + */ +int +raptor_avltree_delete(raptor_avltree* tree, void* p_data) +{ + void* rdata; + + rdata = raptor_avltree_remove(tree, p_data); + if(rdata) { + if(tree->free_handler) + tree->free_handler(rdata); + } + + return (rdata != NULL); +} + + +/** + * raptor_avltree_trim: + * @tree: AVLTree object + * + * Delete all nodes from an AVL tree but keep the shell. + */ +void +raptor_avltree_trim(raptor_avltree* tree) +{ + if(!tree) + return; + + raptor_free_avltree_internal(tree, tree->root); + tree->root = NULL; +} + + +static int +raptor_avltree_visit_internal(raptor_avltree* tree, raptor_avltree_node* node, + int depth, + raptor_avltree_visit_handler visit_handler, + void* user_data) +{ + if(!node) + return TRUE; + + if(!raptor_avltree_visit_internal(tree, node->left, depth+1, + visit_handler, user_data)) + return FALSE; + + if(!visit_handler(depth, node->data, user_data)) + return FALSE; + + if(!raptor_avltree_visit_internal(tree, node->right, depth+1, + visit_handler, user_data)) + return FALSE; + + return TRUE; +} + + +/** + * raptor_avltree_visit: + * @tree: AVL Tree object + * @visit_handler: visit function to call at each item + * @user_data: user data pointer fo visit function + * + * Perform an in-order visit of the items in the AVL Tree + * + * Return value: non-0 if traversal was terminated early by @visit_handler +*/ +int +raptor_avltree_visit(raptor_avltree* tree, + raptor_avltree_visit_handler visit_handler, + void* user_data) +{ + return raptor_avltree_visit_internal(tree, tree->root, 0, + visit_handler, user_data); +} + + +#ifdef RAPTOR_DEBUG +static void +raptor_avltree_print_node(raptor_avltree_node* node) +{ + fprintf(stderr, "%p: parent %p left %p right %p data %p", + RAPTOR_VOIDP(node), + RAPTOR_VOIDP(node->parent), + RAPTOR_VOIDP(node->left), + RAPTOR_VOIDP(node->right), + RAPTOR_VOIDP(node->data)); +} + + +static void +raptor_avltree_check_node(raptor_avltree* tree, raptor_avltree_node* node, + const char* fn, const char* where) +{ + if(node->parent) { + if((node->parent == node->left) || (node->parent == node->right)) { + if(fn && where) + fprintf(stderr, "%s (%s): ", fn, where); + fputs("ERROR bad node ", stderr); + raptor_avltree_print_node(node); + fputc('\n', stderr); + fflush(stderr); + abort(); + } + + if(node->parent->left != node && node->parent->right != node) { + if(fn && where) + fprintf(stderr, "%s (%s): ", fn, where); + fputs("ERROR parent node ", stderr); + raptor_avltree_print_node(node->parent); + fputs(" has no reference to child node ", stderr); + raptor_avltree_print_node(node); + fputc('\n', stderr); + fflush(stderr); + abort(); + } + } + + if(node->left) { + if(node->left->parent != node) { + if(fn && where) + fprintf(stderr, "%s (%s): ", fn, where); + fputs("ERROR left child node ", stderr); + raptor_avltree_print_node(node->left); + fputs(" has no reference to this[parent] node ", stderr); + raptor_avltree_print_node(node); + fputc('\n', stderr); + fflush(stderr); + abort(); + } + } + if(node->right) { + if(node->right->parent != node) { + if(fn && where) + fprintf(stderr, "%s (%s): ", fn, where); + fputs("ERROR right child node ", stderr); + raptor_avltree_print_node(node->right); + fputs(" has no reference to this[parent] node ", stderr); + raptor_avltree_print_node(node); + fputc('\n', stderr); + fflush(stderr); + abort(); + } + } +} +#endif + + +static int +raptor_avltree_sprout_left(raptor_avltree* tree, raptor_avltree_node** node_pp, + void* p_data, int *rebalancing_p) +{ + raptor_avltree_node *p1, *p2, *p_parent; + int rc; + + RAPTOR_AVLTREE_DEBUG1("LESS. raptor_avltree_sprouting left.\n"); + + p_parent = (*node_pp)->parent; + + rc = raptor_avltree_sprout(tree, *node_pp, &(*node_pp)->left, p_data, + rebalancing_p); + if(rc) + return rc; + + if(!*rebalancing_p) + return FALSE; + + /* left branch has grown longer */ + RAPTOR_AVLTREE_DEBUG1("LESS: left branch has grown\n"); + switch((*node_pp)->balance) { + case 1: + /* right branch WAS longer; balance is ok now */ + RAPTOR_AVLTREE_DEBUG1("LESS: case 1.. balance restored implicitly\n"); + (*node_pp)->balance = 0; + *rebalancing_p = FALSE; + break; + + case 0: + /* balance WAS okay; now left branch longer */ + RAPTOR_AVLTREE_DEBUG1("LESS: case 0.. balance bad but still ok\n"); + (*node_pp)->balance = -1; + break; + + case -1: + /* left branch was already too long. rebalance */ + RAPTOR_AVLTREE_DEBUG1("LESS: case -1: rebalancing\n"); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Tree before rebalancing\n"); + raptor_avltree_dump(tree, stderr); +#endif + p1 = (*node_pp)->left; + + if(p1->balance == -1) { + /* LL */ + RAPTOR_AVLTREE_DEBUG1("LESS: single LL\n"); + (*node_pp)->left = p1->right; + if((*node_pp)->left) + (*node_pp)->left->parent = (*node_pp); + p1->right = *node_pp; + if(p1->right) + p1->right->parent = p1; + (*node_pp)->balance = 0; + *node_pp = p1; + (*node_pp)->parent = p_parent; + } else { + /* double LR */ + RAPTOR_AVLTREE_DEBUG1("LESS: double LR\n"); + p2 = p1->right; + p1->right= p2->left; + if(p1->right) + p1->right->parent = p1; + p2->left = p1; + if(p2->left) + p2->left->parent = p2; + + (*node_pp)->left = p2->right; + if((*node_pp)->left) + (*node_pp)->left->parent = (*node_pp); + p2->right = *node_pp; + if(p2->right) + p2->right->parent = p2; + + if(p2->balance == -1) + (*node_pp)->balance = 1; + else + (*node_pp)->balance = 0; + + if(p2->balance == 1) + p1->balance = -1; + else + p1->balance = 0; + + *node_pp = p2; + (*node_pp)->parent = p_parent; + } /* end else */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Tree after rebalancing\n"); + raptor_avltree_dump(tree, stderr); +#endif + + (*node_pp)->balance = 0; + *rebalancing_p = FALSE; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + if(1) { + unsigned int discard = 0; + raptor_avltree_check_internal(tree, *node_pp, &discard); + } +#endif + } /* end switch */ + + return FALSE; +} + + +static int +raptor_avltree_sprout_right(raptor_avltree* tree, + raptor_avltree_node** node_pp, + void* p_data, int *rebalancing_p) +{ + raptor_avltree_node *p1, *p2, *p_parent; + int rc; + + RAPTOR_AVLTREE_DEBUG1("MORE: raptor_avltree_sprouting to the right\n"); + + p_parent = (*node_pp)->parent; + + rc = raptor_avltree_sprout(tree, *node_pp, &(*node_pp)->right, p_data, + rebalancing_p); + if(rc) + return rc; + + if(!*rebalancing_p) + return FALSE; + + /* right branch has grown longer */ + RAPTOR_AVLTREE_DEBUG1("MORE: right branch has grown\n"); + + switch((*node_pp)->balance) { + case -1: + RAPTOR_AVLTREE_DEBUG1("MORE: balance was off, fixed implicitly\n"); + (*node_pp)->balance = 0; + *rebalancing_p = FALSE; + break; + + case 0: + RAPTOR_AVLTREE_DEBUG1("MORE: balance was okay, now off but ok\n"); + (*node_pp)->balance = 1; + break; + + case 1: + RAPTOR_AVLTREE_DEBUG1("MORE: balance was off, need to rebalance\n"); + p1 = (*node_pp)->right; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Tree before rebalancing\n"); + raptor_avltree_dump(tree, stderr); +#endif + if(p1->balance == 1) { + /* RR */ + RAPTOR_AVLTREE_DEBUG1("MORE: single RR\n"); + (*node_pp)->right = p1->left; + if((*node_pp)->right) + (*node_pp)->right->parent = (*node_pp); + p1->left = *node_pp; + if(p1->left) + p1->left->parent = p1; + (*node_pp)->balance = 0; + *node_pp = p1; + (*node_pp)->parent = p_parent; + } else { + /* double RL */ + RAPTOR_AVLTREE_DEBUG1("MORE: double RL\n"); + + p2 = p1->left; + p1->left = p2->right; + if(p1->left) + p1->left->parent = p1; + p2->right = p1; + if(p2->right) + p2->right->parent = p2; + + (*node_pp)->right = p2->left; + if((*node_pp)->right) + (*node_pp)->right->parent = (*node_pp); + p2->left = *node_pp; + if(p2->left) + p2->left->parent = p2; + + if(p2->balance == 1) + (*node_pp)->balance = -1; + else + (*node_pp)->balance = 0; + + if(p2->balance == -1) + p1->balance = 1; + else + p1->balance = 0; + + *node_pp = p2; + (*node_pp)->parent = p_parent; + } /* end else */ + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Tree after rebalancing\n"); + raptor_avltree_dump(tree, stderr); +#endif + (*node_pp)->balance = 0; + *rebalancing_p = FALSE; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + if(1) { + unsigned int discard = 0; + raptor_avltree_check_internal(tree, *node_pp, &discard); + } +#endif + } /* end switch */ + + return FALSE; +} + + +/* grow a tree by sprouting with a new node + * + * Return values: + * 0 on success + * >0 if equivalent item exists (and the old element remains in the tree) + * <0 if memory is exhausted. + */ +static int +raptor_avltree_sprout(raptor_avltree* tree, raptor_avltree_node* parent, + raptor_avltree_node** node_pp, void* p_data, + int *rebalancing_p) +{ + int cmp; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_AVLTREE_DEBUG1("Enter\n"); + if ( *node_pp) { + raptor_avltree_print_node(*node_pp); + RAPTOR_AVLTREE_DEBUG1("\n"); + } + else { + RAPTOR_AVLTREE_DEBUG1("Nil node\n"); + } +#endif + + /* If grounded, add the node here, set the rebalance flag and return */ + if(!*node_pp) { + RAPTOR_AVLTREE_DEBUG1("grounded. adding new node, setting rebalancing flag true\n"); + *node_pp = RAPTOR_MALLOC(raptor_avltree_node*, sizeof(**node_pp)); + if(!*node_pp) { + if(tree->free_handler) + tree->free_handler(p_data); + return RAPTOR_AVLTREE_ENOMEM; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Creating new node %p\n", RAPTOR_VOIDP(*node_pp)); +#endif + + (*node_pp)->parent = parent; + (*node_pp)->left = NULL; + (*node_pp)->right = NULL; + (*node_pp)->balance = 0; + (*node_pp)->data= p_data; + *rebalancing_p = TRUE; + + tree->size++; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + raptor_avltree_check_node(tree, *node_pp, 0, 0); + + RAPTOR_AVLTREE_DEBUG1("Tree now looks this way\n"); + raptor_avltree_dump(tree,stderr); +#endif + + return FALSE; + } + + /* check node */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + raptor_avltree_check_node(tree, *node_pp, 0, 0); +#endif + /* compare the data */ + cmp = tree->compare_handler(p_data, (*node_pp)->data); + if(cmp < 0) + /* if LESS, prepare to move to the left. */ + return raptor_avltree_sprout_left(tree, node_pp, p_data, rebalancing_p); + else if(cmp > 0) + /* if MORE, prepare to move to the right. */ + return raptor_avltree_sprout_right(tree, node_pp, p_data, rebalancing_p); + + /* otherwise equivalent key */ + *rebalancing_p = FALSE; + + if(tree->flags & RAPTOR_AVLTREE_FLAG_REPLACE_DUPLICATES) { + /* replace item with equivalent key */ + if(tree->free_handler) + tree->free_handler((*node_pp)->data); + (*node_pp)->data= p_data; + + return FALSE; + } else { + /* ignore item with equivalent key */ + if(tree->free_handler) + tree->free_handler(p_data); + return RAPTOR_AVLTREE_EXISTS; + } +} + + +static void* +raptor_avltree_delete_internal(raptor_avltree* tree, + raptor_avltree_node** node_pp, + void* p_data, + int *rebalancing_p) +{ + int cmp; + void* rdata = NULL; + + RAPTOR_AVLTREE_DEBUG1("Enter\n"); + + if(*node_pp == NULL) { + RAPTOR_AVLTREE_DEBUG1("key not in tree\n"); + return rdata; + } + + if(p_data) + cmp = tree->compare_handler((*node_pp)->data, p_data); + else + cmp = 0; + + if(cmp > 0) { + RAPTOR_AVLTREE_DEBUG1("too high - scan left\n"); + rdata = raptor_avltree_delete_internal(tree, &(*node_pp)->left, p_data, + rebalancing_p); + if(*rebalancing_p) + raptor_avltree_balance_left(tree, node_pp, rebalancing_p); + + } else if(cmp < 0) { + RAPTOR_AVLTREE_DEBUG1("too low - scan right\n"); + rdata = raptor_avltree_delete_internal(tree, &(*node_pp)->right, p_data, + rebalancing_p); + if(*rebalancing_p) + raptor_avltree_balance_right(tree, node_pp, rebalancing_p); + + } else { + raptor_avltree_node *pr_q; + + RAPTOR_AVLTREE_DEBUG1("equal\n"); + pr_q = *node_pp; + + rdata = pr_q->data; + + if(pr_q->right == NULL) { + RAPTOR_AVLTREE_DEBUG1("right subtree null\n"); + *node_pp = pr_q->left; + if(*node_pp) + (*node_pp)->parent = pr_q->parent; + *rebalancing_p = TRUE; + } else if(pr_q->left == NULL) { + RAPTOR_AVLTREE_DEBUG1("right subtree non-null, left subtree null\n"); + *node_pp = pr_q->right; + if(*node_pp) + (*node_pp)->parent = pr_q->parent; + *rebalancing_p = TRUE; + } else { + RAPTOR_AVLTREE_DEBUG1("neither subtree null\n"); + rdata = raptor_avltree_delete_internal2(tree, &pr_q->left, rebalancing_p, + &pr_q); + if(*rebalancing_p) + raptor_avltree_balance_left(tree, node_pp, rebalancing_p); + } + + RAPTOR_FREE(raptor_avltree_node, pr_q); + } + + return rdata; +} + + +static void* +raptor_avltree_delete_internal2(raptor_avltree* tree, + raptor_avltree_node** ppr_r, + int *rebalancing_p, + raptor_avltree_node** ppr_q) +{ + void* rdata = NULL; + + RAPTOR_AVLTREE_DEBUG1("Enter\n"); + + if((*ppr_r)->right != NULL) { + rdata = raptor_avltree_delete_internal2(tree, + &(*ppr_r)->right, + rebalancing_p, + ppr_q); + if(*rebalancing_p) + raptor_avltree_balance_right(tree, ppr_r, rebalancing_p); + + } else { + raptor_avltree_node* ppr_r_left_new_parent; + rdata = (*ppr_q)->data; + + (*ppr_q)->data = (*ppr_r)->data; + *ppr_q = *ppr_r; + ppr_r_left_new_parent = (*ppr_r)->parent; + *ppr_r = (*ppr_r)->left; + if(*ppr_r) + (*ppr_r)->parent = ppr_r_left_new_parent; + *rebalancing_p = TRUE; + } + + return rdata; +} + + +static void +raptor_avltree_balance_left(raptor_avltree* tree, + raptor_avltree_node** node_pp, int *rebalancing_p) +{ + raptor_avltree_node *p1, *p2, *p_parent; + int b1, b2; + + RAPTOR_AVLTREE_DEBUG1("left branch has shrunk\n"); + + p_parent = (*node_pp)->parent; + + switch((*node_pp)->balance) { + case -1: + RAPTOR_AVLTREE_DEBUG1("was imbalanced, fixed implicitly\n"); + (*node_pp)->balance = 0; + break; + + case 0: + RAPTOR_AVLTREE_DEBUG1("was okay, is now one off\n"); + (*node_pp)->balance = 1; + *rebalancing_p = FALSE; + break; + + case 1: + RAPTOR_AVLTREE_DEBUG1("was already off, this is too much\n"); + p1 = (*node_pp)->right; + b1 = p1->balance; + + if(b1 >= 0) { + RAPTOR_AVLTREE_DEBUG1("single RR\n"); + (*node_pp)->right = p1->left; + if((*node_pp)->right) + (*node_pp)->right->parent = (*node_pp); + p1->left = *node_pp; + if(p1->left) + p1->left->parent = p1; + if(b1 == 0) { + RAPTOR_AVLTREE_DEBUG1("b1 == 0\n"); + (*node_pp)->balance = 1; + p1->balance = -1; + *rebalancing_p = FALSE; + } else { + RAPTOR_AVLTREE_DEBUG1("b1 != 0\n"); + (*node_pp)->balance = 0; + p1->balance = 0; + } + *node_pp = p1; + (*node_pp)->parent = p_parent; + } else { + RAPTOR_AVLTREE_DEBUG1("double RL\n"); + p2 = p1->left; + b2 = p2->balance; + p1->left = p2->right; + if(p1->left) + p1->left->parent = p1; + p2->right = p1; + if(p2->right) + p2->right->parent = p2; + (*node_pp)->right = p2->left; + if((*node_pp)->right) + (*node_pp)->right->parent = (*node_pp); + p2->left = *node_pp; + if(p2->left) + p2->left->parent = p2; + if(b2 == 1) + (*node_pp)->balance = -1; + else + (*node_pp)->balance = 0; + if(b2 == -1) + p1->balance = 1; + else + p1->balance = 0; + *node_pp = p2; + (*node_pp)->parent = p_parent; + p2->balance = 0; + } + break; + } /* end switch */ + +} + + +static void +raptor_avltree_balance_right(raptor_avltree* tree, + raptor_avltree_node** node_pp, int *rebalancing_p) +{ + raptor_avltree_node *p1, *p2, *p_parent; + int b1, b2; + + RAPTOR_AVLTREE_DEBUG1("right branch has shrunk\n"); + + p_parent = (*node_pp)->parent; + + switch((*node_pp)->balance) { + case 1: + RAPTOR_AVLTREE_DEBUG1("was imbalanced, fixed implicitly\n"); + (*node_pp)->balance = 0; + break; + + case 0: + RAPTOR_AVLTREE_DEBUG1("was okay, is now one off\n"); + (*node_pp)->balance = -1; + *rebalancing_p = FALSE; + break; + + case -1: + RAPTOR_AVLTREE_DEBUG1("was already off, this is too much\n"); + p1 = (*node_pp)->left; + b1 = p1->balance; + + if(b1 <= 0) { + RAPTOR_AVLTREE_DEBUG1("single LL\n"); + (*node_pp)->left = p1->right; + if((*node_pp)->left) + (*node_pp)->left->parent = (*node_pp); + p1->right = *node_pp; + if(p1->right) + p1->right->parent = p1; + if(b1 == 0) { + RAPTOR_AVLTREE_DEBUG1("b1 == 0\n"); + (*node_pp)->balance = -1; + p1->balance = 1; + *rebalancing_p = FALSE; + } else { + RAPTOR_AVLTREE_DEBUG1("b1 != 0\n"); + (*node_pp)->balance = 0; + p1->balance = 0; + } + *node_pp = p1; + (*node_pp)->parent = p_parent; + } else { + RAPTOR_AVLTREE_DEBUG1("double LR\n"); + p2 = p1->right; + b2 = p2->balance; + p1->right = p2->left; + if(p1->right) + p1->right->parent = p1; + p2->left = p1; + if(p2->left) + p2->left->parent = p2; + (*node_pp)->left = p2->right; + if((*node_pp)->left) + (*node_pp)->left->parent = (*node_pp); + p2->right = *node_pp; + if(p2->right) + p2->right->parent = p2; + if(b2 == -1) + (*node_pp)->balance = 1; + else + (*node_pp)->balance = 0; + if(b2 == 1) + p1->balance = -1; + else + p1->balance = 0; + *node_pp = p2; + (*node_pp)->parent = p_parent; + p2->balance = 0; + } + } /* end switch */ + +} + + +/** + * raptor_avltree_size: + * @tree: AVL Tree object + * + * Get the number of items in the AVL Tree + * + * Return value: number of items in tree + */ +int +raptor_avltree_size(raptor_avltree* tree) +{ + return tree->size; +} + + +/** + * raptor_avltree_set_print_handler: + * @tree: AVL Tree object + * @print_handler: print function + * + * Set the handler for printing an item in a tree + * + */ +void +raptor_avltree_set_print_handler(raptor_avltree* tree, + raptor_data_print_handler print_handler) +{ + tree->print_handler = print_handler; +} + + +/* Follow left children until a match for range is found (if range not NULL) */ +static raptor_avltree_node* +raptor_avltree_node_leftmost(raptor_avltree* tree, raptor_avltree_node* node, + void* range) +{ + /*assert(node); + assert(!range || tree->compare_handler(range, node->data) == 0);*/ + if(range) + while(node && node->left && + tree->compare_handler(range, node->left->data) == 0) + node = node->left; + else + while(node && node->left) + node = node->left; + + return node; +} + + +static raptor_avltree_node* +raptor_avltree_node_rightmost(raptor_avltree* tree, raptor_avltree_node* node, + void* range) +{ + /*assert(node); + assert(!range || tree->compare_handler(range, node->data) == 0);*/ + if(range) + while(node && node->right && + tree->compare_handler(range, node->right->data) == 0) + node = node->right; + else + while(node && node->right) + node = node->right; + return node; +} + + +/* Follow right children until a match for range is found (range required) */ +static raptor_avltree_node* +raptor_avltree_node_search_right(raptor_avltree* tree, + raptor_avltree_node* node, void* range) +{ + raptor_avltree_node* result; + + if(!node) + return NULL; + + result = node->right; + while(result) { + if(tree->compare_handler(range, result->data) == 0) { + return result; + } else { + result = result->right; + } + } + + return node; +} + + +/* Follow left children until a match for range is found (range required) */ +static raptor_avltree_node* +raptor_avltree_node_search_left(raptor_avltree* tree, + raptor_avltree_node* node, void* range) +{ + raptor_avltree_node* result; + + if(!node) + return NULL; + + result = node->left; + while(result) { + if(tree->compare_handler(range, result->data) == 0) { + return result; + } else { + result = result->left; + } + } + + return node; +} + + +static raptor_avltree_node* +raptor_avltree_node_prev(raptor_avltree* tree, raptor_avltree_node* node, + void* range) +{ + int up = 0; + + /*assert(!range || tree->compare_handler(range, node->data) == 0);*/ + + if(node->left) { + /* Should never go left if the current node is already < range */ + raptor_avltree_node* prev; + prev = raptor_avltree_node_rightmost(tree, node->left, NULL); + /*assert(!range ||tree->compare_handler(range, node->data) <= 0);*/ + if(range) { + if(tree->compare_handler(range, prev->data) == 0) { + up = 0; + node = prev; + } else { + up = 1; + } + } else { + node = prev; + up = 0; + } + } else { + up = 1; + } + + if(up) { + raptor_avltree_node* last = node; + /* Need to go up */ + node = node->parent; + while(node) { + + /* moving from right subtree to this node */ + if(node->right && last == node->right) { + break; + } + + /* moved up to find an unvisited left subtree */ + if(node->left && last != node->left) { + /* Should never go left if the current node is already > range */ + /*assert(!range ||tree->compare_handler(range, node->data) <= 0);*/ + node = raptor_avltree_node_rightmost(tree, node->left, range); + break; + } + last = node; + node = node->parent; + } + } + + if(node && range) { + if(tree->compare_handler(range, node->data) == 0) + return node; + else + return NULL; + } else { + return node; + } +} + + +/* Follow right children until a match for range is found (if range not NULL) */ +static raptor_avltree_node* +raptor_avltree_node_next(raptor_avltree* tree, raptor_avltree_node* node, + void* range) +{ + int up = 0; + + /*assert(!range || tree->compare_handler(range, node->data) == 0);*/ + + if(node->right) { + /* Should never go right if the current node is already > range */ + raptor_avltree_node* next; + next = raptor_avltree_node_leftmost(tree, node->right, NULL); + /*assert(!range ||tree->compare_handler(range, node->data) <= 0);*/ + if(range) { + if(tree->compare_handler(range, next->data) == 0) { + up = 0; + node = next; + } else { + up = 1; + } + } else { + node = next; + up = 0; + } + } else { + up = 1; + } + + if(up) { + raptor_avltree_node* last = node; + /* Need to go up */ + node = node->parent; + while(node) { + + /* moving from left subtree to this node */ + if(node->left && last == node->left) { + break; + } + + /* moved up to find an unvisited right subtree */ + if(node->right && last != node->right) { + /* Should never go right if the current node is already > range */ + /*assert(!range ||tree->compare_handler(range, node->data) <= 0);*/ + node = raptor_avltree_node_leftmost(tree, node->right, range); + break; + } + last = node; + node = node->parent; + } + } + + if(node && range) { + if(tree->compare_handler(range, node->data) == 0) + return node; + else + return NULL; + } else { + return node; + } +} + + +struct raptor_avltree_iterator_s { + raptor_avltree* tree; + raptor_avltree_node* root; + raptor_avltree_node* current; + void* range; + raptor_data_free_handler range_free_handler; + int direction; + int is_finished; +}; + + +/** + * raptor_new_avltree_iterator: + * @tree: #raptor_avltree object + * @range: range + * @range_free_handler: function to free @range object + * @direction: <0 to go 'backwards' otherwise 'forwards' + * + * Get an in-order iterator for the start of a range, or the entire contents + * + * If range is NULL, the entire tree is walked in order. If range + * specifies a range (i.e. the tree comparison function will 'match' + * (return 0 for) range and /several/ nodes), the iterator will be + * placed at the leftmost child matching range, and + * raptor_avltree_iterator_next will iterate over all nodes (and only + * nodes) that match range. + * + * Return value: a new #raptor_avltree_iterator object or NULL on failure + **/ +raptor_avltree_iterator* +raptor_new_avltree_iterator(raptor_avltree* tree, void* range, + raptor_data_free_handler range_free_handler, + int direction) +{ + raptor_avltree_iterator* iterator; + + iterator = RAPTOR_CALLOC(raptor_avltree_iterator*, 1, sizeof(*iterator)); + if(!iterator) + return NULL; + + iterator->is_finished = 0; + iterator->current = NULL; + + iterator->tree = tree; + iterator->range = range; + iterator->range_free_handler = range_free_handler; + iterator->direction = direction; + + if(range) { + /* find the topmost match (range is contained entirely in tree + * rooted here) + */ + iterator->current = raptor_avltree_search_internal(tree, tree->root, range); + } else { + iterator->current = tree->root; + } + + iterator->root = iterator->current; + + if(iterator->current) { + if(iterator->direction < 0) { + /* go down to find END of range (or tree) */ + while(1) { + raptor_avltree_node* pred; + iterator->current = raptor_avltree_node_rightmost(tree, + iterator->current, + range); + /* move left until a match is found */ + pred = raptor_avltree_node_search_left(tree, iterator->current->right, + range); + + if(pred && tree->compare_handler(range, pred->data) == 0) + iterator->current = pred; + else + break; + } + } else { + /* go down to find START of range (or tree) */ + while(1) { + raptor_avltree_node* pred; + iterator->current = raptor_avltree_node_leftmost(tree, + iterator->current, + range); + /* move right until a match is found */ + pred = raptor_avltree_node_search_right(tree, iterator->current->left, + range); + + if(pred && tree->compare_handler(range, pred->data) == 0) + iterator->current = pred; + else + break; + } + } + } + + return iterator; +} + + +/** + * raptor_free_avltree_iterator: + * @iterator: AVL Tree iterator object + * + * AVL Tree Iterator destructor + */ +void +raptor_free_avltree_iterator(raptor_avltree_iterator* iterator) +{ + if(!iterator) + return; + + if(iterator->range && iterator->range_free_handler) + iterator->range_free_handler(iterator->range); + + RAPTOR_FREE(raptor_avltree_iterator, iterator); +} + + +/** + * raptor_avltree_iterator_is_end: + * @iterator: AVL Tree iterator object + * + * Test if an iteration is finished + * + * Return value: non-0 if iteration is finished + */ +int +raptor_avltree_iterator_is_end(raptor_avltree_iterator* iterator) +{ + raptor_avltree_node *node = iterator->current; + + if(iterator->is_finished) + return 1; + iterator->is_finished = (node == NULL); + + return iterator->is_finished; +} + + +/** + * raptor_avltree_iterator_next: + * @iterator: AVL Tree iterator object + * + * Move iteration to next/prev object + * + * Return value: non-0 if iteration is finished + */ +int +raptor_avltree_iterator_next(raptor_avltree_iterator* iterator) +{ + raptor_avltree_node *node = iterator->current; + + if(!node || iterator->is_finished) + return 1; + + if(iterator->direction < 0) + iterator->current = raptor_avltree_node_prev(iterator->tree, node, + iterator->range); + else + iterator->current = raptor_avltree_node_next(iterator->tree, node, + iterator->range); + /* Stay within rooted subtree */ + if(iterator->root->parent == iterator->current) + iterator->current = NULL; + + iterator->is_finished = (iterator->current == NULL); + + return iterator->is_finished; +} + + +/** + * raptor_avltree_iterator_get: + * @iterator: AVL Tree iterator object + * + * Get current iteration object + * + * Return value: object or NULL if iteration is finished + */ +void* +raptor_avltree_iterator_get(raptor_avltree_iterator* iterator) +{ + raptor_avltree_node *node = iterator->current; + + if(iterator->is_finished) + return NULL; + + iterator->is_finished = (node == NULL); + if(iterator->is_finished) + return NULL; + + return node->data; +} + + +/** + * raptor_avltree_print: + * @tree: AVL Tree + * @stream: stream to print to + * + * Print the items in the tree in order to a stream (for debugging) + * + * Return value: non-0 on failure + */ +int +raptor_avltree_print(raptor_avltree* tree, FILE* stream) +{ + int i; + int rv = 0; + raptor_avltree_iterator* iter = NULL; + + fprintf(stream, "AVL Tree size %u\n", tree->size); + for(i = 0, (iter = raptor_new_avltree_iterator(tree, NULL, NULL, 1)); + iter && !rv; + i++, (rv = raptor_avltree_iterator_next(iter))) { + void* data = raptor_avltree_iterator_get(iter); + if(!data) + continue; + fprintf(stream, "%d) ", i); + if(tree->print_handler) + tree->print_handler(data, stream); + else + fprintf(stream, "Data Node %p\n", RAPTOR_VOIDP(data)); + } + /*assert(i == tree->size);*/ + + if(iter) + raptor_free_avltree_iterator(iter); + + return 0; +} + + +#ifdef RAPTOR_DEBUG + +static int +raptor_avltree_dump_internal(raptor_avltree* tree, raptor_avltree_node* node, + int depth, FILE* stream) +{ + int i; + if(!node) + return TRUE; + + for(i = 0; i < depth; i++) + fputs(" ", stream); + fprintf(stream, "Node %p: parent %p left %p right %p data %p\n", + RAPTOR_VOIDP(node), + RAPTOR_VOIDP(node->parent), + RAPTOR_VOIDP(node->left), + RAPTOR_VOIDP(node->right), + RAPTOR_VOIDP(node->data)); + if(tree->print_handler) { + for(i= 0; i < depth; i++) + fputs(" ", stream); + tree->print_handler(node->data, stream); + } + + if(!raptor_avltree_dump_internal(tree, node->left, depth+1, stream)) + return FALSE; + + if(!raptor_avltree_dump_internal(tree, node->right, depth+1, stream)) + return FALSE; + + return TRUE; +} + + +/* debugging tree dump with pointers and depth indenting */ +int +raptor_avltree_dump(raptor_avltree* tree, FILE* stream) +{ + fprintf(stream, "Dumping avltree %p size %u\n", RAPTOR_VOIDP(tree), + tree->size); + + return raptor_avltree_dump_internal(tree, tree->root, 0, stream); +} + + +static void +raptor_avltree_check_internal(raptor_avltree* tree, raptor_avltree_node* node, + unsigned int* count_p) +{ + if(!node) + return; + + (*count_p)++; + + raptor_avltree_check_node(tree, node, NULL, NULL); + + raptor_avltree_check_internal(tree, node->left, count_p); + + raptor_avltree_check_internal(tree, node->right, count_p); +} + + +/* debugging tree check - parent/child pointers and counts */ +void +raptor_avltree_check(raptor_avltree* tree) +{ + unsigned int count = 0; + + raptor_avltree_check_internal(tree, tree->root, &count); + if(count != tree->size) { + fprintf(stderr, "Tree %p nodes count is %u. actual count %u\n", + RAPTOR_VOIDP(tree), tree->size, count); + abort(); + } +} + +#endif + +#endif + + +#ifdef STANDALONE + +#include + +typedef struct +{ + FILE *fh; + int count; + const char** results; + int failed; +} visit_state; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 +static int +print_string(int depth, void* data, void *user_data) +{ + visit_state* vs = (visit_state*)user_data; + + fprintf(vs->fh, "%3d: %s\n", vs->count, (char*) data); + vs->count++; + return 1; +} +#endif + +static int +check_string(int depth, void* data, void *user_data) +{ + visit_state* vs = (visit_state*)user_data; + const char* result = vs->results[vs->count]; + + if(strcmp((const char*)data, result)) { + fprintf(vs->fh, "%3d: Expected '%s' but found '%s'\n", vs->count, + result, (char*)data); + vs->failed = 1; + } + vs->count++; + + return 1; +} + +static int +compare_strings(const void *l, const void *r) +{ + return strcmp((const char*)l, (const char*)r); +} + + +/* one more prototype */ +int main(int argc, char *argv[]); + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *program = raptor_basename(argv[0]); +#define ITEM_COUNT 8 + const char *items[ITEM_COUNT+1] = { "ron", "amy", "jen", "bij", "jib", "daj", "jim", "def", NULL }; +#define DELETE_COUNT 2 + const char *delete_items[DELETE_COUNT+1] = { "jen", "jim", NULL }; +#define RESULT_COUNT (ITEM_COUNT-DELETE_COUNT) + const char *results[RESULT_COUNT+1] = { "amy", "bij", "daj", "def", "jib", "ron", NULL}; + + raptor_avltree* tree; + raptor_avltree_iterator* iter; + visit_state vs; + int i; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + tree = raptor_new_avltree(compare_strings, + NULL, /* no free as they are static pointers above */ + 0); + if(!tree) { + fprintf(stderr, "%s: Failed to create tree\n", program); + exit(1); + } + for(i = 0; items[i]; i++) { + int rc; + void* node; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Adding tree item '%s'\n", program, items[i]); +#endif + + rc = raptor_avltree_add(tree, (void*)items[i]); + if(rc) { + fprintf(stderr, + "%s: Adding tree item %d '%s' failed, returning error %d\n", + program, i, items[i], rc); + exit(1); + } + +#ifdef RAPTOR_DEBUG + raptor_avltree_check(tree); +#endif + + node = raptor_avltree_search(tree, (void*)items[i]); + if(!node) { + fprintf(stderr, + "%s: Tree did NOT contain item %d '%s' as expected\n", + program, i, items[i]); + exit(1); + } + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Printing tree\n", program); + vs.fh = stderr; + vs.count = 0; + raptor_avltree_visit(tree, print_string, &vs); + + fprintf(stderr, "%s: Dumping tree\n", program); + raptor_avltree_dump(tree, stderr); +#endif + + + + for(i = 0; delete_items[i]; i++) { + int rc; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Deleting tree item '%s'\n", program, delete_items[i]); +#endif + + rc = raptor_avltree_delete(tree, (void*)delete_items[i]); + if(!rc) { + fprintf(stderr, + "%s: Deleting tree item %d '%s' failed, returning error %d\n", + program, i, delete_items[i], rc); + exit(1); + } + +#ifdef RAPTOR_DEBUG + raptor_avltree_check(tree); +#endif + } + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Walking tree forwards via iterator\n", program); +#endif + iter = raptor_new_avltree_iterator(tree, NULL, NULL, 1); + for(i = 0; 1; i++) { + const char* data = (const char*)raptor_avltree_iterator_get(iter); + const char* result = results[i]; + if((!data && data != result) || (data && strcmp(data, result))) { + fprintf(stderr, "%3d: Forwards iterator expected '%s' but found '%s'\n", + i, result, data); + exit(1); + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%3d: Got '%s'\n", i, data); +#endif + if(raptor_avltree_iterator_next(iter)) + break; + if(i > RESULT_COUNT) { + fprintf(stderr, "Forward iterator did not end on result %i as expected\n", i); + exit(1); + } + } + raptor_free_avltree_iterator(iter); + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Checking tree\n", program); +#endif + vs.count = 0; + vs.results = results; + vs.failed = 0; + raptor_avltree_visit(tree, check_string, &vs); + if(vs.failed) { + fprintf(stderr, "%s: Checking tree failed\n", program); + exit(1); + } + + + for(i = 0; results[i]; i++) { + const char* result = results[i]; + char* data = (char*)raptor_avltree_remove(tree, (void*)result); + if(!data) { + fprintf(stderr, "%s: remove %i failed at item '%s'\n", program, i, + result); + exit(1); + } + if(strcmp(data, result)) { + fprintf(stderr, "%s: remove %i returned %s not %s as expected\n", program, + i, data, result); + exit(1); + } + } + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Freeing tree\n", program); +#endif + raptor_free_avltree(tree); + + raptor_free_world(world); + + /* keep gcc -Wall happy */ + return(0); +} + +#endif diff --git a/src/raptor_concepts.c b/src/raptor_concepts.c new file mode 100644 index 0000000..443edb0 --- /dev/null +++ b/src/raptor_concepts.c @@ -0,0 +1,199 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_concepts.c - Raptor RDF namespace concepts + * + * Copyright (C) 2010, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * http://www.w3.org/TR/rdf-syntax-grammar/#section-grammar-summary + * + * coreSyntaxTerms := rdf:RDF | rdf:ID | rdf:about | rdf:bagID | + rdf:parseType | rdf:resource | rdf:nodeID | rdf:datatype + * syntaxTerms := coreSyntaxTerms | rdf:Description | rdf:li + * oldTerms := rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID + * + * nodeElementURIs := anyURI - ( coreSyntaxTerms | rdf:li | oldTerms ) + * propertyElementURIs := anyURI - ( coreSyntaxTerms | rdf:Description | oldTerms ) + * propertyAttributeURIs := anyURI - ( coreSyntaxTerms | rdf:Description | rdf:li | oldTerms ) + * + * So, forbidden terms in the RDF namespace are: + * nodeElements + * RDF | ID | about | bagID | parseType | resource | nodeID | datatype | + * li | aboutEach | aboutEachPrefix | bagID + * + * propertyElements + * RDF | ID | about | bagID | parseType | resource | nodeID | datatype | + * Description | aboutEach | aboutEachPrefix | bagID + * + * propertyAttributes + * RDF | ID | about | bagID | parseType | resource | nodeID | datatype | + * Description | li | aboutEach | aboutEachPrefix | bagID + * + * Information about rdf attributes: + * raptor_term_type type + * Set when the attribute is a property rather than just syntax + * NOTE: raptor_rdfxml_process_property_attributes() expects only + * RAPTOR_TERM_TYPE_NONE, + * RAPTOR_TERM_TYPE_LITERAL or RAPTOR_TERM_TYPE_URI + * allowed_unprefixed_on_attribute + * If allowed for legacy reasons to be unprefixed as an attribute. + * + */ + +/* (number of terms in RDF NS) + 1: for final sentinel row */ +const raptor_rdf_ns_term_info raptor_rdf_ns_terms_info[RDF_NS_LAST + 2] = { + /* term allowed boolean flags: + * node element; property element; property attr; unprefixed attr + */ + /* syntax only */ + { "RDF", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 0 }, /* just root */ + { "Description", RAPTOR_TERM_TYPE_UNKNOWN, 1, 0, 0, 0 }, + { "li", RAPTOR_TERM_TYPE_UNKNOWN, 0, 1, 0, 0 }, + { "about", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 1 }, + { "aboutEach", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 0 }, /* deprecated */ + { "aboutEachPrefix", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 0 }, /* deprecated */ + { "ID", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 1 }, + { "bagID", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 1 }, + { "resource", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 1 }, + { "parseType", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 1 }, + { "nodeID", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 0 }, + { "datatype", RAPTOR_TERM_TYPE_UNKNOWN, 0, 0, 0, 0 }, + + /* rdf:Property-s */ + { "type", RAPTOR_TERM_TYPE_URI , 1, 1, 1, 1 }, + { "value", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "subject", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "predicate", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "object", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "first", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "rest", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + + /* rdfs:Class-s */ + { "Seq", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "Bag", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "Alt", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "Statement", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "Property", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "List", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + + /* rdfs:Resource-s */ + { "nil", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + + /* datatypes */ + { "XMLLiteral", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + { "PlainLiteral", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + /* RDF 1.1 */ + /* http://www.w3.org/TR/2013/WD-rdf11-concepts-20130723/#section-html */ + { "HTML", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + /* http://www.w3.org/TR/2013/WD-rdf11-concepts-20130723/#section-Datatypes */ + { "langString", RAPTOR_TERM_TYPE_LITERAL, 1, 1, 1, 0 }, + + /* internal */ + { NULL , RAPTOR_TERM_TYPE_UNKNOWN, 1, 1, 1, 0 } +}; + + + +int +raptor_concepts_init(raptor_world* world) +{ + int i; + + for(i = 0; i < RDF_NS_LAST + 1; i++) { + unsigned char* name = (unsigned char*)raptor_rdf_ns_terms_info[i].name; + world->concepts[i] = raptor_new_uri_for_rdf_concept(world, name); + if(!world->concepts[i]) + return 1; + + /* only make a term for things that are not syntax-only */ + /* OR use: + raptor_rdf_ns_terms_info[i].allowed_as_nodeElement || + raptor_rdf_ns_terms_info[i].allowed_as_propertyElement || + raptor_rdf_ns_terms_info[i].allowed_as_propertyAttribute) + */ + if(i > RDF_NS_LAST_SYNTAX_TERM) { + world->terms[i] = raptor_new_term_from_uri(world, world->concepts[i]); + if(!world->terms[i]) + return 1; + } + } + + world->xsd_namespace_uri = raptor_new_uri(world, raptor_xmlschema_datatypes_namespace_uri); + if(!world->xsd_namespace_uri) + return 1; + + world->xsd_boolean_uri = raptor_new_uri_from_uri_local_name(world, world->xsd_namespace_uri, (const unsigned char*)"boolean"); + if(!world->xsd_boolean_uri) + return 1; + + world->xsd_decimal_uri = raptor_new_uri_from_uri_local_name(world, world->xsd_namespace_uri, (const unsigned char*)"decimal"); + if(!world->xsd_decimal_uri) + return 1; + + world->xsd_double_uri = raptor_new_uri_from_uri_local_name(world, world->xsd_namespace_uri, (const unsigned char*)"double"); + if(!world->xsd_double_uri) + return 1; + + world->xsd_integer_uri = raptor_new_uri_from_uri_local_name(world, world->xsd_namespace_uri, (const unsigned char*)"integer"); + if(!world->xsd_integer_uri) + return 1; + + return 0; +} + + + +void +raptor_concepts_finish(raptor_world* world) +{ + int i; + + for(i = 0; i < RDF_NS_LAST + 1; i++) { + raptor_uri* concept_uri = world->concepts[i]; + if(concept_uri) { + raptor_free_uri(concept_uri); + world->concepts[i] = NULL; + } + if(world->terms[i]) + raptor_free_term(world->terms[i]); + } + + if(world->xsd_boolean_uri) + raptor_free_uri(world->xsd_boolean_uri); + if(world->xsd_decimal_uri) + raptor_free_uri(world->xsd_decimal_uri); + if(world->xsd_double_uri) + raptor_free_uri(world->xsd_double_uri); + if(world->xsd_integer_uri) + raptor_free_uri(world->xsd_integer_uri); + + if(world->xsd_namespace_uri) + raptor_free_uri(world->xsd_namespace_uri); +} diff --git a/src/raptor_config.h.in b/src/raptor_config.h.in new file mode 100644 index 0000000..d587114 --- /dev/null +++ b/src/raptor_config.h.in @@ -0,0 +1,346 @@ +/* src/raptor_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + +/* have to check C99 vsnprintf at runtime because cross compiling */ +#undef CHECK_VSNPRINTF_RUNTIME + +/* Flex version as a decimal */ +#undef FLEX_VERSION_DECIMAL + +/* vsnprintf has C99 compatible return value */ +#undef HAVE_C99_VSNPRINTF + +/* Have curl/curl.h */ +#undef HAVE_CURL_CURL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FETCH_H + +/* Define to 1 if you have the `getopt' function. */ +#undef HAVE_GETOPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* INN parsedate function present */ +#undef HAVE_INN_PARSEDATE + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `isascii' function. */ +#undef HAVE_ISASCII + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBXML_HASH_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBXML_HTMLPARSER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBXML_NANOHTTP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBXML_PARSER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBXML_SAX2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBXSLT_XSLT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the `qsort_r' function. */ +#undef HAVE_QSORT_R + +/* Define to 1 if you have the `qsort_s' function. */ +#undef HAVE_QSORT_S + +/* Raptor raptor_parse_date available */ +#undef HAVE_RAPTOR_PARSE_DATE + +/* Define to 1 if you have the `setjmp' function. */ +#undef HAVE_SETJMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_SETJMP_H + +/* Define to 1 if you have the `stat' function. */ +#undef HAVE_STAT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the `stricmp' function. */ +#undef HAVE_STRICMP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* have the strtok_r function */ +#undef HAVE_STRTOK_R + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define to 1 if you have the `xmlCtxtUseOptions' function. */ +#undef HAVE_XMLCTXTUSEOPTIONS + +/* Define to 1 if you have the `xmlSAX2InternalSubset' function. */ +#undef HAVE_XMLSAX2INTERNALSUBSET + +/* YAJL has API version 2 */ +#undef HAVE_YAJL2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_YAJL_YAJL_PARSE_H + +/* Is __FUNCTION__ available */ +#undef HAVE___FUNCTION__ + +/* ICU UC major version */ +#undef ICU_UC_MAJOR_VERSION + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Define to 1 if maintainer mode is enabled. */ +#undef MAINTAINER_MODE + +/* need 'extern int optind' declaration? */ +#undef NEED_OPTIND_DECLARATION + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if debug messages are enabled. */ +#undef RAPTOR_DEBUG + +/* Use ICU for Unicode NFC check */ +#undef RAPTOR_ICU_NFC + +/* does libxml struct xmlEntity have a field etype */ +#undef RAPTOR_LIBXML_ENTITY_ETYPE + +/* does libxml struct xmlEntity have a field name_length */ +#undef RAPTOR_LIBXML_ENTITY_NAME_LENGTH + +/* does libxml have HTML_PARSE_NONET */ +#undef RAPTOR_LIBXML_HTML_PARSE_NONET + +/* does libxml xmlSAXHandler have externalSubset field */ +#undef RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET + +/* does libxml xmlSAXHandler have initialized field */ +#undef RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED + +/* does libxml have XML_PARSE_NONET */ +#undef RAPTOR_LIBXML_XML_PARSE_NONET + +/* Minimum supported package version */ +#undef RAPTOR_MIN_VERSION_DECIMAL + +/* Building GRDDL parser */ +#undef RAPTOR_PARSER_GRDDL + +/* Building guess parser */ +#undef RAPTOR_PARSER_GUESS + +/* Building JSON parser */ +#undef RAPTOR_PARSER_JSON + +/* Building N-Quads parser */ +#undef RAPTOR_PARSER_NQUADS + +/* Building N-Triples parser */ +#undef RAPTOR_PARSER_NTRIPLES + +/* Building RDFA parser */ +#undef RAPTOR_PARSER_RDFA + +/* Building RDF/XML parser */ +#undef RAPTOR_PARSER_RDFXML + +/* Building RSS Tag Soup parser */ +#undef RAPTOR_PARSER_RSS + +/* Building TRiG parser */ +#undef RAPTOR_PARSER_TRIG + +/* Building Turtle parser */ +#undef RAPTOR_PARSER_TURTLE + +/* Building Atom 1.0 serializer */ +#undef RAPTOR_SERIALIZER_ATOM + +/* Building GraphViz DOT serializer */ +#undef RAPTOR_SERIALIZER_DOT + +/* Building HTML Table serializer */ +#undef RAPTOR_SERIALIZER_HTML + +/* Building JSON serializer */ +#undef RAPTOR_SERIALIZER_JSON + +/* Building mKR serializer */ +#undef RAPTOR_SERIALIZER_MKR + +/* Building N-Quads serializer */ +#undef RAPTOR_SERIALIZER_NQUADS + +/* Building N-Triples serializer */ +#undef RAPTOR_SERIALIZER_NTRIPLES + +/* Building RDF/XML serializer */ +#undef RAPTOR_SERIALIZER_RDFXML + +/* Building RDF/XML-abbreviated serializer */ +#undef RAPTOR_SERIALIZER_RDFXML_ABBREV + +/* Building RSS 1.0 serializer */ +#undef RAPTOR_SERIALIZER_RSS_1_0 + +/* Building Turtle serializer */ +#undef RAPTOR_SERIALIZER_TURTLE + +/* Release version as a decimal */ +#undef RAPTOR_VERSION_DECIMAL + +/* Major version number */ +#undef RAPTOR_VERSION_MAJOR + +/* Minor version number */ +#undef RAPTOR_VERSION_MINOR + +/* Release version number */ +#undef RAPTOR_VERSION_RELEASE + +/* Have libcurl WWW library */ +#undef RAPTOR_WWW_LIBCURL + +/* Have libfetch WWW library */ +#undef RAPTOR_WWW_LIBFETCH + +/* Have libxml available as a WWW library */ +#undef RAPTOR_WWW_LIBXML + +/* No WWW library */ +#undef RAPTOR_WWW_NONE + +/* Check XML 1.1 Names */ +#undef RAPTOR_XML_1_1 + +/* Use libxml XML parser */ +#undef RAPTOR_XML_LIBXML + +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS + +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif diff --git a/src/raptor_config_cmake.h.in b/src/raptor_config_cmake.h.in new file mode 100644 index 0000000..2e1582b --- /dev/null +++ b/src/raptor_config_cmake.h.in @@ -0,0 +1,136 @@ +/* raptor_config.h */ + +#define RAPTOR_VERSION_DECIMAL @RAPTOR_VERSION_DECIMAL@ +#define RAPTOR_MIN_VERSION_DECIMAL @RAPTOR_MIN_VERSION_DECIMAL@ + +#cmakedefine HAVE_ERRNO_H +#cmakedefine HAVE_FCNTL_H +#cmakedefine HAVE_GETOPT_H +#cmakedefine HAVE_LIMITS_H +#cmakedefine HAVE_MATH_H +#cmakedefine HAVE_SETJMP_H +#cmakedefine HAVE_STDDEF_H +#cmakedefine HAVE_STDLIB_H +#cmakedefine HAVE_STRING_H +#cmakedefine HAVE_UNISTD_H +#cmakedefine HAVE_TIME_H +#cmakedefine HAVE_SYS_PARAM_H +#cmakedefine HAVE_TIME_H +#cmakedefine HAVE_SYS_STAT_H +#cmakedefine HAVE_SYS_STAT_H +#cmakedefine HAVE_SYS_TIME_H + +#cmakedefine TIME_WITH_SYS_TIME + +#cmakedefine HAVE_ACCESS +#cmakedefine HAVE__ACCESS +#cmakedefine HAVE_GETOPT +#cmakedefine HAVE_GETOPT_LONG +#cmakedefine HAVE_GETTIMEOFDAY +#cmakedefine HAVE_ISASCII +#cmakedefine HAVE_SETJMP +#cmakedefine HAVE_SNPRINTF +#cmakedefine HAVE__SNPRINTF +#cmakedefine HAVE_STAT +#cmakedefine HAVE_STRCASECMP +#cmakedefine HAVE_STRICMP +#cmakedefine HAVE__STRICMP +#cmakedefine HAVE_STRTOK_R +#cmakedefine HAVE_VASPRINTF +#cmakedefine HAVE_VSNPRINTF +#cmakedefine HAVE__VSNPRINTF + +#cmakedefine HAVE___FUNCTION__ + +#define SIZEOF_UNSIGNED_CHAR @SIZEOF_UNSIGNED_CHAR@ +#define SIZEOF_UNSIGNED_SHORT @SIZEOF_UNSIGNED_SHORT@ +#define SIZEOF_UNSIGNED_INT @SIZEOF_UNSIGNED_INT@ +#define SIZEOF_UNSIGNED_LONG @SIZEOF_UNSIGNED_LONG@ +#define SIZEOF_UNSIGNED_LONG_LONG @SIZEOF_UNSIGNED_LONG_LONG@ + +#cmakedefine HAVE_XMLCTXTUSEOPTIONS +#cmakedefine HAVE_XMLSAX2INTERNALSUBSET +#cmakedefine RAPTOR_LIBXML_ENTITY_ETYPE +#cmakedefine RAPTOR_LIBXML_ENTITY_NAME_LENGTH +#cmakedefine RAPTOR_LIBXML_HTML_PARSE_NONET +#cmakedefine RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET +#cmakedefine RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED +#cmakedefine RAPTOR_LIBXML_XML_PARSE_NONET + +#cmakedefine RAPTOR_STATIC +#cmakedefine HAVE_RAPTOR_PARSE_DATE +#define @RAPTOR_WWW_DEFINE@ +#define @RAPTOR_XML_DEFINE@ +#cmakedefine RAPTOR_XML_1_1 + +#cmakedefine RAPTOR_PARSER_RDFXML +#cmakedefine RAPTOR_PARSER_NTRIPLES +#cmakedefine RAPTOR_PARSER_TURTLE +#cmakedefine RAPTOR_PARSER_TRIG +#cmakedefine RAPTOR_PARSER_RSS +#cmakedefine RAPTOR_PARSER_GRDDL +#cmakedefine RAPTOR_PARSER_GUESS +#cmakedefine RAPTOR_PARSER_RDFA +#cmakedefine RAPTOR_PARSER_JSON +#cmakedefine RAPTOR_PARSER_NQUADS + +#cmakedefine RAPTOR_SERIALIZER_RDFXML +#cmakedefine RAPTOR_SERIALIZER_NTRIPLES +#cmakedefine RAPTOR_SERIALIZER_RDFXML_ABBREV +#cmakedefine RAPTOR_SERIALIZER_TURTLE +#cmakedefine RAPTOR_SERIALIZER_MKR +#cmakedefine RAPTOR_SERIALIZER_RSS_1_0 +#cmakedefine RAPTOR_SERIALIZER_ATOM +#cmakedefine RAPTOR_SERIALIZER_DOT +#cmakedefine RAPTOR_SERIALIZER_HTML +#cmakedefine RAPTOR_SERIALIZER_JSON +#cmakedefine RAPTOR_SERIALIZER_NQUADS + +#ifdef WIN32 +# define WIN32_LEAN_AND_MEAN +# define _CRT_NONSTDC_NO_DEPRECATE +# define _CRT_SECURE_NO_DEPRECATE + +# ifdef _MSC_VER +# if _MSC_VER >= 1300 +# define __func__ __FUNCTION__ +# else + /* better than nothing */ +# define raptor_str(s) #s +# define __func__ "func@" __FILE__ ":" raptor_str(__LINE__) +# endif +# endif + +# define RAPTOR_INLINE __inline + +# define S_ISTYPE(mode, mask) (((mode) & _S_IFMT) == (mask)) +# define S_ISDIR(mode) S_ISTYPE((mode), _S_IFDIR) +# define S_ISREG(mode) S_ISTYPE((mode), _S_IFREG) + + /* Mode bits for access() */ +# define R_OK 04 +# define W_OK 02 + +# if !defined(HAVE_ACCESS) && defined(HAVE__ACCESS) +# define access(p,m) _access(p,m) +# endif +# ifndef HAVE_STRCASECMP +# if defined(HAVE__STRICMP) +# define strcasecmp(a,b) _stricmp(a,b) +# elif defined(HAVE_STRICMP) +# define strcasecmp(a,b) stricmp(a,b) +# endif +# endif +# if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF) +# define snprintf _snprintf +# endif +# if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF) +# define vsnprintf _vsnprintf +# endif + + /* These prevent parsedate.c from declaring malloc() and free() */ +# define YYMALLOC malloc +# define YYFREE free +#endif + +/* end raptor_config.h */ diff --git a/src/raptor_escaped.c b/src/raptor_escaped.c new file mode 100644 index 0000000..b6c61d8 --- /dev/null +++ b/src/raptor_escaped.c @@ -0,0 +1,289 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_escaped.c - Raptor escaped writing utilities + * + * Copyright (C) 2013, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/** + * raptor_string_escaped_write: + * @string: UTF-8 string to write + * @len: length of UTF-8 string + * @delim: Terminating delimiter character for string (such as " or >) or \0 for no escaping. + * @flags: bit flags - see #raptor_escaped_write_bitflags + * @iostr: #raptor_iostream to write to + * + * Write a UTF-8 string formatted using different escapes to a #raptor_iostream + * + * Supports writing escapes in the Python, N-Triples, Turtle, JSON, mKR, + * SPARQL styles to an iostream. + * + * Return value: non-0 on failure such as bad UTF-8 encoding. + **/ +int +raptor_string_escaped_write(const unsigned char *string, + size_t len, + const char delim, + unsigned int flags, + raptor_iostream *iostr) +{ + unsigned char c; + int unichar_len; + raptor_unichar unichar; + + if(!string) + return 1; + + for(; (c=*string); string++, len--) { + if((delim && c == delim && (delim == '\'' || delim == '"')) || + c == '\\') { + raptor_iostream_write_byte('\\', iostr); + raptor_iostream_write_byte(c, iostr); + continue; + } + + if(delim && c == delim) { + raptor_iostream_counted_string_write("\\u", 2, iostr); + raptor_iostream_hexadecimal_write(c, 4, iostr); + continue; + } + + if(flags & RAPTOR_ESCAPED_WRITE_BITFLAG_SPARQL_URI_ESCAPES) { + /* Must escape #x00-#x20<>\"{}|^` */ + if(c <= 0x20 || + c == '<' || c == '>' || c == '\\' || c == '"' || + c == '{' || c == '}' || c == '|' || c == '^' || c == '`') { + raptor_iostream_counted_string_write("\\u", 2, iostr); + raptor_iostream_hexadecimal_write(c, 4, iostr); + continue; + } else if(c < 0x7f) { + raptor_iostream_write_byte(c, iostr); + continue; + } + } + + if(flags & RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_TNRU) { + if(c == 0x09) { + raptor_iostream_counted_string_write("\\t", 2, iostr); + continue; + } else if(c == 0x0a) { + raptor_iostream_counted_string_write("\\n", 2, iostr); + continue; + } else if(c == 0x0d) { + raptor_iostream_counted_string_write("\\r", 2, iostr); + continue; + } else if(c < 0x20 || c == 0x7f) { + raptor_iostream_counted_string_write("\\u", 2, iostr); + raptor_iostream_hexadecimal_write(c, 4, iostr); + continue; + } + } + + if(flags & RAPTOR_ESCAPED_WRITE_BITFLAG_BS_ESCAPES_BF) { + if(c == 0x08) { + /* JSON has \b for backspace */ + raptor_iostream_counted_string_write("\\b", 2, iostr); + continue; + } else if(c == 0x0b) { + /* JSON has \f for formfeed */ + raptor_iostream_counted_string_write("\\f", 2, iostr); + continue; + } + } + + /* Just format remaining characters */ + if(c < 0x7f) { + raptor_iostream_write_byte(c, iostr); + continue; + } + + /* It is unicode */ + unichar_len = raptor_unicode_utf8_string_get_char(string, len, &unichar); + if(unichar_len < 0 || RAPTOR_GOOD_CAST(size_t, unichar_len) > len) + /* UTF-8 encoding had an error or ended in the middle of a string */ + return 1; + + if(flags & RAPTOR_ESCAPED_WRITE_BITFLAG_UTF8) { + /* UTF-8 is allowed so no need to escape */ + raptor_iostream_counted_string_write(string, unichar_len, iostr); + } else { + if(unichar < 0x10000) { + raptor_iostream_counted_string_write("\\u", 2, iostr); + raptor_iostream_hexadecimal_write(RAPTOR_GOOD_CAST(unsigned int, unichar), 4, iostr); + } else { + raptor_iostream_counted_string_write("\\U", 2, iostr); + raptor_iostream_hexadecimal_write(RAPTOR_GOOD_CAST(unsigned int, unichar), 8, iostr); + } + } + + unichar_len--; /* since loop does len-- */ + string += unichar_len; len -= unichar_len; + + } + + return 0; +} + + +/** + * raptor_string_python_write: + * @string: UTF-8 string to write + * @len: length of UTF-8 string + * @delim: Terminating delimiter character for string (such as " or >) + * or \0 for no escaping. + * @mode: mode 0=N-Triples mode, 1=Turtle (allow raw UTF-8), 2=Turtle long string (allow raw UTF-8), 3=JSON + * @iostr: #raptor_iostream to write to + * + * Write a UTF-8 string using Python-style escapes (N-Triples, Turtle, JSON, mKR) to a #raptor_iostream + * + * @Deprecated: use raptor_string_escaped_write() where the features + * requested are bits that can be individually chosen. + * + * Return value: non-0 on failure such as bad UTF-8 encoding. + **/ +int +raptor_string_python_write(const unsigned char *string, + size_t len, + const char delim, + unsigned int mode, + raptor_iostream *iostr) +{ + unsigned int flags = 0; + + switch(mode) { + case 0: + flags = RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL; + break; + + case 1: + flags = RAPTOR_ESCAPED_WRITE_TURTLE_LITERAL; + break; + + case 2: + flags = RAPTOR_ESCAPED_WRITE_TURTLE_LONG_LITERAL; + break; + + case 3: + flags = RAPTOR_ESCAPED_WRITE_JSON_LITERAL; + break; + + default: + return 1; + } + + return raptor_string_escaped_write(string, len, delim, flags, iostr); +} + + + +/** + * raptor_term_escaped_write: + * @term: term to write + * @flags: bit flags - see #raptor_escaped_write_bitflags + * @iostr: raptor iostream + * + * Write a #raptor_term formatted with escapes to a #raptor_iostream + * + * Return value: non-0 on failure + **/ +int +raptor_term_escaped_write(const raptor_term *term, + unsigned int flags, + raptor_iostream* iostr) +{ + const char* quotes="\"\"\"\""; + + if(!term) + return 1; + + switch(term->type) { + case RAPTOR_TERM_TYPE_LITERAL: + if(flags == RAPTOR_ESCAPED_WRITE_TURTLE_LONG_LITERAL) + raptor_iostream_counted_string_write(quotes, 3, iostr); + else + raptor_iostream_write_byte('"', iostr); + raptor_string_escaped_write(term->value.literal.string, + term->value.literal.string_len, + '"', + flags, + iostr); + if(flags == RAPTOR_ESCAPED_WRITE_TURTLE_LONG_LITERAL) + raptor_iostream_counted_string_write(quotes, 3, iostr); + else + raptor_iostream_write_byte('"', iostr); + + if(term->value.literal.language) { + raptor_iostream_write_byte('@', iostr); + raptor_iostream_counted_string_write(term->value.literal.language, + term->value.literal.language_len, + iostr); + } + if(term->value.literal.datatype) { + if(flags == RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL) + flags = RAPTOR_ESCAPED_WRITE_NTRIPLES_URI; + else if(flags == RAPTOR_ESCAPED_WRITE_TURTLE_LITERAL) + flags = RAPTOR_ESCAPED_WRITE_TURTLE_URI; + + raptor_iostream_counted_string_write("^^", 2, iostr); + raptor_uri_escaped_write(term->value.literal.datatype, NULL, + flags, iostr); + } + + break; + + case RAPTOR_TERM_TYPE_BLANK: + raptor_iostream_counted_string_write("_:", 2, iostr); + + raptor_iostream_counted_string_write(term->value.blank.string, + term->value.blank.string_len, + iostr); + break; + + case RAPTOR_TERM_TYPE_URI: + if(flags == RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL) + flags = RAPTOR_ESCAPED_WRITE_NTRIPLES_URI; + else if(flags == RAPTOR_ESCAPED_WRITE_TURTLE_LITERAL) + flags = RAPTOR_ESCAPED_WRITE_TURTLE_URI; + + raptor_uri_escaped_write(term->value.uri, NULL, flags, iostr); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(term->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Triple has unsupported term type %u", + term->type); + return 1; + } + + return 0; +} diff --git a/src/raptor_general.c b/src/raptor_general.c new file mode 100644 index 0000000..bf3c3ae --- /dev/null +++ b/src/raptor_general.c @@ -0,0 +1,771 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_general.c - Raptor general routines + * + * Copyright (C) 2000-2014, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#ifdef MAINTAINER_MODE +#include +#endif + +/* statics */ + +const char * const raptor_short_copyright_string = "Copyright 2000-2023 David Beckett. Copyright 2000-2005 University of Bristol"; + +const char * const raptor_copyright_string = "Copyright (C) 2000-2023 David Beckett - http://www.dajobe.org/\nCopyright (C) 2000-2005 University of Bristol - http://www.bristol.ac.uk/"; + +const char * const raptor_license_string = "LGPL 2.1 or newer, GPL 2 or newer, Apache 2.0 or newer.\nSee http://librdf.org/raptor/LICENSE.html for full terms."; + +const char * const raptor_home_url_string = "http://librdf.org/raptor/"; + +/** + * raptor_version_string: + * + * Library full version as a string. + * + * See also #raptor_version_decimal. + */ +const char * const raptor_version_string = RAPTOR_VERSION_STRING +#ifdef GIT_VERSION +" GIT " GIT_VERSION +#endif +; + +/** + * raptor_version_major: + * + * Library major version number as a decimal integer. + */ +const unsigned int raptor_version_major = RAPTOR_VERSION_MAJOR; + +/** + * raptor_version_minor: + * + * Library minor version number as a decimal integer. + */ +const unsigned int raptor_version_minor = RAPTOR_VERSION_MINOR; + +/** + * raptor_version_release: + * + * Library release version number as a decimal integer. + */ +const unsigned int raptor_version_release = RAPTOR_VERSION_RELEASE; + +/** + * raptor_version_decimal: + * + * Library full version as a decimal integer. + * + * See also #raptor_version_string. + */ +const unsigned int raptor_version_decimal = RAPTOR_VERSION_DECIMAL; + + +/** + * raptor_new_world: + * @version_decimal: raptor version as a decimal integer as defined by the macro #RAPTOR_VERSION and static int #raptor_version_decimal + * + * Allocate a new raptor_world object. + * + * Allocation of the world and initialization are decoupled to allow + * changing settings on the world object before init. + * + * Settings and configuration of the world may be made after creating + * the object and before the world is initialized using methods such + * as raptor_world_set_flag(), raptor_world_set_log_handler(), + * raptor_world_set_generate_bnodeid_handler(). Some configuration + * may not be changed after initialization. + * + * The raptor_world is initialized with raptor_world_open(). + * + * Return value: uninitialized raptor_world object or NULL on failure + */ +raptor_world * +raptor_new_world_internal(unsigned int version_decimal) +{ + raptor_world *world; + + if(version_decimal < RAPTOR_MIN_VERSION_DECIMAL) { + fprintf(stderr, + "raptor_new_world() called via header from version %u but minimum supported version is %u\n", + version_decimal, RAPTOR_GOOD_CAST(unsigned int, RAPTOR_MIN_VERSION_DECIMAL)); + return NULL; + } + + world = RAPTOR_CALLOC(raptor_world*, 1, sizeof(*world)); + if(world) { + world->magic = RAPTOR2_WORLD_MAGIC; + + /* set default flags - can be updated by raptor_world_set_flag() */ + + /* set: RAPTOR_LIBXML_FLAGS_GENERIC_ERROR_SAVE + * set: RAPTOR_LIBXML_FLAGS_STRUCTURED_ERROR_SAVE + */ + world->libxml_flags = RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE | + RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE ; + /* set: URI Interning */ + world->uri_interning = 1; + + world->internal_ignore_errors = 0; + } + + return world; +} + + +/** + * raptor_world_open: + * @world: raptor_world object + * + * Initialise the raptor library. + * + * Initializes a #raptor_world object created by raptor_new_world(). + * Allocation and initialization are decoupled to allow + * changing settings on the world object before init. + * + * The initialized world object is used with subsequent raptor API calls. + * + * Return value: non-0 on failure + */ +int +raptor_world_open(raptor_world* world) +{ + int rc; + + if(!world) + return -1; + + if(world->opened) + return 0; /* not an error */ + + world->opened = 1; + + rc = raptor_uri_init(world); + if(rc) + return rc; + + rc = raptor_concepts_init(world); + if(rc) + return rc; + + rc = raptor_parsers_init(world); + if(rc) + return rc; + + rc = raptor_serializers_init(world); + if(rc) + return rc; + + rc = raptor_sax2_init(world); + if(rc) + return rc; + + rc = raptor_www_init(world); + if(rc) + return rc; + +#ifdef RAPTOR_XML_LIBXML + rc = raptor_libxml_init(world); + if(rc) + return rc; +#endif + + return 0; +} + + +/** + * raptor_free_world: + * @world: raptor_world object + * + * Terminate the raptor library. + * + * Destroys the raptor_world object and all related information. + */ +void +raptor_free_world(raptor_world* world) +{ + if(!world) + return; + + if(world->default_generate_bnodeid_handler_prefix) + RAPTOR_FREE(char*, world->default_generate_bnodeid_handler_prefix); + +#ifdef RAPTOR_XML_LIBXML + raptor_libxml_finish(world); +#endif + + raptor_www_finish(world); + + raptor_sax2_finish(world); + + raptor_serializers_finish(world); + + raptor_parsers_finish(world); + + raptor_concepts_finish(world); + + raptor_uri_finish(world); + + RAPTOR_FREE(raptor_world, world); +} + + +/** + * raptor_world_set_generate_bnodeid_handler: + * @world: #raptor_world world object + * @user_data: user data pointer for callback + * @handler: generate ID callback function + * + * Set the generate ID handler function. + * + * Sets the function to generate IDs for the library. The handler is + * called with the @user_data parameter. + * + * The final argument of the callback method is user_bnodeid, the value of + * the rdf:nodeID attribute that the user provided if any (or NULL). + * It can either be returned directly as the generated value when present or + * modified. The passed in value must be free()d if it is not used. + * + * If handler is NULL, the default method is used + * + **/ +void +raptor_world_set_generate_bnodeid_handler(raptor_world* world, + void *user_data, + raptor_generate_bnodeid_handler handler) +{ + world->generate_bnodeid_handler_user_data = user_data; + world->generate_bnodeid_handler = handler; +} + + +static unsigned char* +raptor_world_default_generate_bnodeid_handler(void *user_data, + unsigned char *user_bnodeid) +{ + raptor_world *world = (raptor_world*)user_data; + int id; + unsigned char *buffer; + const char* prefix; + unsigned int prefix_length; + size_t id_length; + + if(user_bnodeid) + return user_bnodeid; + + id = ++world->default_generate_bnodeid_handler_base; + + id_length = raptor_format_integer(NULL, 0, id, /* base */ 10, -1, '\0'); + + if(world->default_generate_bnodeid_handler_prefix) { + prefix = world->default_generate_bnodeid_handler_prefix; + prefix_length = world->default_generate_bnodeid_handler_prefix_length; + } else { + prefix = "genid"; + prefix_length = 5; /* strlen("genid") */ + } + + buffer = RAPTOR_MALLOC(unsigned char*, id_length + prefix_length + 1); + if(!buffer) + return NULL; + + memcpy(buffer, prefix, prefix_length); + (void)raptor_format_integer(RAPTOR_GOOD_CAST(char*, &buffer[prefix_length]), + id_length + 1, id, /* base */ 10,-1, '\0'); + + return buffer; +} + + +/** + * raptor_world_generate_bnodeid: + * @world: raptor_world object + * + * Generate an new blank node ID + * + * Return value: newly allocated generated ID or NULL on failure + **/ +unsigned char* +raptor_world_generate_bnodeid(raptor_world *world) +{ + return raptor_world_internal_generate_id(world, NULL); +} + + +unsigned char* +raptor_world_internal_generate_id(raptor_world *world, + unsigned char *user_bnodeid) +{ + if(world->generate_bnodeid_handler) + return world->generate_bnodeid_handler(world->generate_bnodeid_handler_user_data, + user_bnodeid); + else + return raptor_world_default_generate_bnodeid_handler(world, user_bnodeid); +} + + +/** + * raptor_world_set_generate_bnodeid_parameters: + * @world: #raptor_world object + * @prefix: prefix string + * @base: integer base identifier + * + * Set default ID generation parameters. + * + * Sets the parameters for the default algorithm used to generate IDs. + * The default algorithm uses both @prefix and @base to generate a new + * identifier. The exact identifier generated is not guaranteed to + * be a strict concatenation of @prefix and @base but will use both + * parts. The @prefix parameter is copied to generate an ID. + * + * For finer control of the generated identifiers, use + * raptor_world_set_generate_bnodeid_handler(). + * + * If @prefix is NULL, the default prefix is used (currently "genid") + * If @base is less than 1, it is initialised to 1. + * + **/ +void +raptor_world_set_generate_bnodeid_parameters(raptor_world* world, + char *prefix, int base) +{ + char *prefix_copy = NULL; + unsigned int length = 0; + + if(--base < 0) + base = 0; + + if(prefix) { + length = RAPTOR_BAD_CAST(unsigned int, strlen(prefix)); + + prefix_copy = RAPTOR_MALLOC(char*, length + 1); + if(!prefix_copy) + return; + + memcpy(prefix_copy, prefix, length+1); + } + + if(world->default_generate_bnodeid_handler_prefix) + RAPTOR_FREE(char*, world->default_generate_bnodeid_handler_prefix); + + world->default_generate_bnodeid_handler_prefix = prefix_copy; + world->default_generate_bnodeid_handler_prefix_length = length; + world->default_generate_bnodeid_handler_base = base; +} + + +/** + * raptor_world_set_libxslt_security_preferences: + * @world: world + * @security_preferences: security preferences (an #xsltSecurityPrefsPtr) or NULL + * + * Set libxslt security preferences policy object + * + * The @security_preferences object will NOT become owned by + * #raptor_world. + * + * If libxslt is compiled into the library, @security_preferences + * should be an #xsltSecurityPrefsPtr and will be used to call + * xsltSetCtxtSecurityPrefs() when an XSLT engine is initialised. + * If @security_preferences is NULL, this will disable all raptor's + * calls to xsltSetCtxtSecurityPrefs(). + * + * If libxslt is not compiled in, the object set here is not used. + * + * Return value: 0 on success, non-0 on failure: <0 on errors and >0 if world is already opened + */ +int +raptor_world_set_libxslt_security_preferences(raptor_world *world, + void *security_preferences) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1); + + if(world->opened) + return 1; + + world->xslt_security_preferences = security_preferences; + world->xslt_security_preferences_policy = 1; + + return 0; +} + + +/** + * raptor_world_set_flag: + * @world: world + * @flag: flag + * @value: value + * + * Set library-wide configuration + * + * This function is used to control raptor-wide options across + * classes. These options must be set before raptor_world_open() is + * called explicitly or implicitly (by creating a raptor object). + * There is no enumeration function for these flags because they are + * not user options and must be set before the library is + * initialised. For similar reasons, there is no get function. + * + * See the #raptor_world_flags documentation for full details of + * what the flags mean. + * + * Return value: 0 on success, non-0 on failure: <0 on errors (-1 if flag is unknown, -2 if value is illegal) and >0 if world is already opened + */ +int +raptor_world_set_flag(raptor_world *world, raptor_world_flag flag, int value) +{ + int rc = 0; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1); + + if(world->opened) + return 1; + + switch(flag) { + case RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE: + case RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE: + if(value) + world->libxml_flags |= (int)flag; + else + world->libxml_flags &= ~(int)flag; + break; + + case RAPTOR_WORLD_FLAG_URI_INTERNING: + world->uri_interning = value; + break; + + case RAPTOR_WORLD_FLAG_WWW_SKIP_INIT_FINISH: + world->www_skip_www_init_finish = value; + break; + } + + return rc; +} + + +/** + * raptor_world_set_log_handler: + * @world: world object + * @user_data: user data to pass to function + * @handler: pointer to the function + * + * Set the message (error, warning, info) handling function. + * + * The function will receive callbacks when messages are generated + * + * Return value: non-0 on failure + **/ +int +raptor_world_set_log_handler(raptor_world *world, void *user_data, + raptor_log_handler handler) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1); + + world->message_handler_user_data = user_data; + world->message_handler = handler; + + return 0; +} + + +/** + * raptor_basename: + * @name: path + * + * Get the basename of a path + * + * Return value: filename part of a pathname + **/ +const char* +raptor_basename(const char *name) +{ + const char *p; + if((p = strrchr(name, '/'))) + name = p+1; + else if((p = strrchr(name, '\\'))) + name = p+1; + + return name; +} + + +const unsigned char * const raptor_xml_literal_datatype_uri_string = (const unsigned char *)"http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"; +const unsigned int raptor_xml_literal_datatype_uri_string_len = 53; + +/** + * raptor_check_ordinal: + * @name: ordinal string + * + * Check an RDF property ordinal, the n in rdf:_n + * + * Return value: ordinal integer or <0 if string is not a valid ordinal + */ +int +raptor_check_ordinal(const unsigned char *name) +{ + int ordinal= -1; + unsigned char c; + + while((c=*name++)) { + if(c < '0' || c > '9') + return -1; + if(ordinal <0) + ordinal = 0; + ordinal *= 10; + ordinal += (c - '0'); + } + return ordinal; +} + + +static const char* const raptor_domain_labels[RAPTOR_DOMAIN_LAST + 1] = { + "none", + "I/O Stream", + "XML Namespace", + "RDF Parser", + "XML QName", + "XML SAX2", + "RDF Serializer", + "RDF Term", + "Turtle Writer", + "URI", + "World", + "WWW", + "XML Writer" +}; + + +/** + * raptor_domain_get_label: + * @domain: domain + * + * Get label for a domain + * + * Return value: label string or NULL if domain is not valid + */ +const char* +raptor_domain_get_label(raptor_domain domain) +{ + return (domain <= RAPTOR_DOMAIN_LAST) ? raptor_domain_labels[domain] : NULL; +} + + + +/* internal */ +void +raptor_world_internal_set_ignore_errors(raptor_world* world, int flag) +{ + world->internal_ignore_errors = flag; +} + + +/** + * raptor_free_memory: + * @ptr: memory pointer + * + * Free memory allocated inside raptor. + * + * Some systems require memory allocated in a library to + * be deallocated in that library. This function allows + * memory allocated by raptor to be freed. + * + * Examples include the result of the '_to_' methods that returns + * allocated memory such as raptor_uri_filename_to_uri_string, + * raptor_uri_filename_to_uri_string + * and raptor_uri_uri_string_to_filename_fragment + * + **/ +void +raptor_free_memory(void *ptr) +{ + if(!ptr) + return; + + RAPTOR_FREE(void, ptr); +} + + +/** + * raptor_alloc_memory: + * @size: size of memory to allocate + * + * Allocate memory inside raptor. + * + * Some systems require memory allocated in a library to + * be deallocated in that library. This function allows + * memory to be allocated inside the raptor shared library + * that can be freed inside raptor either internally or via + * raptor_free_memory. + * + * Examples include using this in the raptor_world_generate_bnodeid() handler + * code to create new strings that will be used internally + * as short identifiers and freed later on by the parsers. + * + * Return value: the address of the allocated memory or NULL on failure + * + **/ +void* +raptor_alloc_memory(size_t size) +{ + return RAPTOR_MALLOC(void*, size); +} + + +/** + * raptor_calloc_memory: + * @nmemb: number of members + * @size: size of item + * + * Allocate zeroed array of items inside raptor. + * + * Some systems require memory allocated in a library to + * be deallocated in that library. This function allows + * memory to be allocated inside the raptor shared library + * that can be freed inside raptor either internally or via + * raptor_free_memory. + * + * Examples include using this in the raptor_world_generate_bnodeid() handler + * code to create new strings that will be used internally + * as short identifiers and freed later on by the parsers. + * + * Return value: the address of the allocated memory or NULL on failure + * + **/ +void* +raptor_calloc_memory(size_t nmemb, size_t size) +{ + return RAPTOR_CALLOC(void*, nmemb, size); +} + + +#if defined (RAPTOR_DEBUG) && defined(RAPTOR_MEMORY_SIGN) +void* +raptor_sign_malloc(size_t size) +{ + int *p; + + size += sizeof(int); + + p = (int*)malloc(size); + *p++ = RAPTOR_SIGN_KEY; + return p; +} + +void* +raptor_sign_calloc(size_t nmemb, size_t size) +{ + int *p; + + /* turn into bytes */ + size = nmemb*size + sizeof(int); + + p = (int*)calloc(1, size); + *p++ = RAPTOR_SIGN_KEY; + return p; +} + +void* +raptor_sign_realloc(void *ptr, size_t size) +{ + int *p; + + if(!ptr) + return raptor_sign_malloc(size); + + p = (int*)ptr; + p--; + + if(*p != RAPTOR_SIGN_KEY) + RAPTOR_FATAL3("memory signature %08X != %08X", *p, RAPTOR_SIGN_KEY); + + size += sizeof(int); + + p = (int*)realloc(p, size); + *p++= RAPTOR_SIGN_KEY; + return p; +} + +void +raptor_sign_free(void *ptr) +{ + int *p; + + if(!ptr) + return; + + p = (int*)ptr; + p--; + + if(*p != RAPTOR_SIGN_KEY) + RAPTOR_FATAL3("memory signature %08X != %08X", *p, RAPTOR_SIGN_KEY); + + free(p); +} +#endif + + +int +raptor_check_world_internal(raptor_world* world, const char* name) +{ + static int __warned = 0; + + if(!world) { + fprintf(stderr, "%s called with NULL world object\n", name); + RAPTOR_ASSERT_DIE(return 1) + } + + /* In Raptor V1 ABI the first int of raptor_world is the 'opened' field */ + if(world->magic == RAPTOR1_WORLD_MAGIC_1 || + world->magic == RAPTOR1_WORLD_MAGIC_2) { + if(!__warned++) + fprintf(stderr, "%s called with Raptor V1 world object\n", name); + return 1; + } + + if(world->magic != RAPTOR2_WORLD_MAGIC) { + if(!__warned++) + fprintf(stderr, "%s called with invalid Raptor V2 world object\n", name); + return 1; + } + + return 0; +} diff --git a/src/raptor_grddl.c b/src/raptor_grddl.c new file mode 100644 index 0000000..b54d8c8 --- /dev/null +++ b/src/raptor_grddl.c @@ -0,0 +1,2131 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_grddl.c - Raptor GRDDL (+microformats) Parser implementation + * + * Copyright (C) 2005-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +/* + * Specifications: + * Gleaning Resource Descriptions from Dialects of Languages (GRDDL) + * W3C Recommendation 11 September 2007 + * http://www.w3.org/TR/2007/REC-grddl-20070911/ + * http://www.w3.org/TR/grddl/ + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#include +/* for xmlXPathRegisterNs() */ +#include +#include +#include + +#include +#include +#include +#include + + +/* + * libxslt API notes + * + * Inputs to an XSLT transformation process with libxslt are: + * 1. A set of (key:value) parameters. + * 2. An xsltStylesheetPtr for the XSLT sheet + * Which could be made from a file or an xmlDoc; and the xmlDoc. + * made from a file or memory buffer. + * 3. An xmlDoc for the XML source + * Which could be made from a file or a memory buffer. + * + */ + + +static void raptor_grddl_filter_triples(void *user_data, raptor_statement *statement); + +static void raptor_grddl_xsltGenericError_handler(void *user_data, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 0); + +static void raptor_libxslt_set_global_state(raptor_parser *rdf_parser); +static void raptor_libxslt_reset_global_state(raptor_parser *rdf_parser); + + +typedef struct +{ + /* transformation (XSLT) or profile URI */ + raptor_uri* uri; + /* base URI in effect when the above was found */ + raptor_uri* base_uri; +} grddl_xml_context; + + +/* + * XSLT parser object + */ +struct raptor_grddl_parser_context_s { + raptor_world* world; + raptor_parser* rdf_parser; + + /* HTML document ctxt */ + htmlParserCtxtPtr html_ctxt; + /* XML document ctxt */ + xmlParserCtxtPtr xml_ctxt; + + /* Create xpath evaluation context */ + xmlXPathContextPtr xpathCtx; + + /* parser for dealing with the result */ + raptor_parser* internal_parser; + /* ... constructed with this name */ + const char* internal_parser_name; + + /* URI of root namespace of document */ + raptor_uri* root_ns_uri; + + /* List of transformation URIs for document */ + raptor_sequence* doc_transform_uris; + + /* Copy of the user data statement_handler overwritten to point to + * raptor_grddl_filter_triples() + */ + void* saved_user_data; + raptor_statement_handler saved_statement_handler; + + /* URI data-view:namespaceTransformation */ + raptor_uri* namespace_transformation_uri; + + /* URI data-view:profileTransformation */ + raptor_uri* profile_transformation_uri; + + /* List of namespace / URIs */ + raptor_sequence* profile_uris; + + /* List of visited URIs */ + raptor_sequence* visited_uris; + + /* Depth of GRDDL parsers - 0 means that the lists above + * are owned by this parser: visited_uris + * */ + int grddl_depth; + + /* Content-Type of top-level document */ + char* content_type; + + /* Check content type once */ + int content_type_check; + + /* stringbuffer to use to store retrieved document */ + raptor_stringbuffer* sb; + + /* non-0 to perform an additional RDF/XML parse on a retrieved document + * because it has been identified as RDF/XML. */ + int process_this_as_rdfxml; + + /* non-0 to perform GRDL processing on document */ + int grddl_processing; + + /* non-0 to perform XML Include processing on document */ + int xinclude_processing; + + /* non-0 to perform HTML Base processing on document */ + int html_base_processing; + + /* non-0 to perform HTML processing on document */ + int html_link_processing; + + xmlGenericErrorFunc saved_xsltGenericError; + void *saved_xsltGenericErrorContext; + + xsltSecurityPrefsPtr saved_xsltSecurityPrefs; +}; + + +typedef struct raptor_grddl_parser_context_s raptor_grddl_parser_context; + + +static void +raptor_grddl_xsltGenericError_handler(void *user_data, const char *msg, ...) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + va_list arguments; + size_t msg_len; + size_t length; + char *nmsg; + + if(!msg || *msg == '\n') + return; + + va_start(arguments, msg); + + msg_len = strlen(msg); + +#define PREFIX "libxslt error: " +#define PREFIX_LENGTH 15 + length = PREFIX_LENGTH + msg_len + 1; + nmsg = RAPTOR_MALLOC(char*, length); + if(nmsg) { + memcpy(nmsg, PREFIX, PREFIX_LENGTH); + memcpy(nmsg + PREFIX_LENGTH, msg, msg_len + 1); + if(nmsg[length-1] == '\n') + nmsg[length-1] = '\0'; + } + + PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START + raptor_parser_log_error_varargs(rdf_parser, RAPTOR_LOG_LEVEL_ERROR, + nmsg ? nmsg : msg, arguments); + PRAGMA_IGNORE_WARNING_END + + if(nmsg) + RAPTOR_FREE(char*, nmsg); + + va_end(arguments); +} + + +static grddl_xml_context* +raptor_new_xml_context(raptor_world* world, raptor_uri* uri, + raptor_uri* base_uri) +{ + grddl_xml_context* xml_context; + + xml_context = RAPTOR_MALLOC(grddl_xml_context*, sizeof(*xml_context)); + if(uri) + uri = raptor_uri_copy(uri); + if(base_uri) + base_uri = raptor_uri_copy(base_uri); + xml_context->uri = uri; + xml_context->base_uri = base_uri; + + return xml_context; +} + + +static void +grddl_free_xml_context(void* userdata) +{ + grddl_xml_context* xml_context = (grddl_xml_context*)userdata; + + if(xml_context->uri) + raptor_free_uri(xml_context->uri); + if(xml_context->base_uri) + raptor_free_uri(xml_context->base_uri); + RAPTOR_FREE(grddl_xml_context, xml_context); +} + + +static int +raptor_grddl_parse_init_common(raptor_parser* rdf_parser, const char *name) +{ + raptor_grddl_parser_context* grddl_parser; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + grddl_parser->world = rdf_parser->world; + grddl_parser->rdf_parser = rdf_parser; + + /* Sequence of grddl_xml_context* URIs of XSLT sheets to transform + * the document */ + grddl_parser->doc_transform_uris = raptor_new_sequence((raptor_data_free_handler)grddl_free_xml_context, NULL); + + grddl_parser->grddl_processing = 1; + grddl_parser->xinclude_processing = 1; + grddl_parser->html_base_processing = 0; + grddl_parser->html_link_processing = 1; + + return 0; +} + + +/* 58 == strlen(grddl_namespaceTransformation_uri_string) */ +#define GRDDL_NAMESPACETRANSFORMATION_URI_STRING_LEN 58 +static const unsigned char * const grddl_namespaceTransformation_uri_string = (const unsigned char*)"http://www.w3.org/2003/g/data-view#namespaceTransformation"; + +/* 56 == strlen(grddl_profileTransformation_uri_string) */ +#define GRDDL_PROFILETRANSFORMATION_URI_STRING_LEN 56 +static const unsigned char * const grddl_profileTransformation_uri_string = (const unsigned char*)"http://www.w3.org/2003/g/data-view#profileTransformation"; + + +static int +raptor_grddl_parse_init(raptor_parser* rdf_parser, const char *name) +{ + raptor_grddl_parser_context* grddl_parser; + raptor_world* world = rdf_parser->world; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + raptor_grddl_parse_init_common(rdf_parser, name); + + /* Sequence of URIs from */ + grddl_parser->profile_uris = raptor_new_sequence((raptor_data_free_handler)grddl_free_xml_context, NULL); + + grddl_parser->namespace_transformation_uri = raptor_new_uri_from_counted_string(world, grddl_namespaceTransformation_uri_string, GRDDL_NAMESPACETRANSFORMATION_URI_STRING_LEN); + grddl_parser->profile_transformation_uri = raptor_new_uri_from_counted_string(world, grddl_profileTransformation_uri_string, GRDDL_PROFILETRANSFORMATION_URI_STRING_LEN); + + /* Sequence of URIs visited - may be overwritten if this is not + * the depth 0 grddl parser + */ + grddl_parser->visited_uris = raptor_new_sequence((raptor_data_free_handler)raptor_free_uri, (raptor_data_print_handler)raptor_uri_print); + + return 0; +} + + +static void +raptor_grddl_parse_terminate(raptor_parser *rdf_parser) +{ + raptor_grddl_parser_context *grddl_parser; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + if(grddl_parser->xml_ctxt) { + if(grddl_parser->xml_ctxt->myDoc) { + xmlFreeDoc(grddl_parser->xml_ctxt->myDoc); + grddl_parser->xml_ctxt->myDoc = NULL; + } + xmlFreeParserCtxt(grddl_parser->xml_ctxt); + } + + if(grddl_parser->html_ctxt) { + if(grddl_parser->html_ctxt->myDoc) { + xmlFreeDoc(grddl_parser->html_ctxt->myDoc); + grddl_parser->html_ctxt->myDoc = NULL; + } + htmlFreeParserCtxt(grddl_parser->html_ctxt); + } + + if(grddl_parser->xpathCtx) + xmlXPathFreeContext(grddl_parser->xpathCtx); + + if(grddl_parser->internal_parser) + raptor_free_parser(grddl_parser->internal_parser); + + if(grddl_parser->root_ns_uri) + raptor_free_uri(grddl_parser->root_ns_uri); + + if(grddl_parser->doc_transform_uris) + raptor_free_sequence(grddl_parser->doc_transform_uris); + + if(grddl_parser->profile_uris) + raptor_free_sequence(grddl_parser->profile_uris); + + if(grddl_parser->namespace_transformation_uri) + raptor_free_uri(grddl_parser->namespace_transformation_uri); + + if(grddl_parser->profile_transformation_uri) + raptor_free_uri(grddl_parser->profile_transformation_uri); + + if(!grddl_parser->grddl_depth) { + if(grddl_parser->visited_uris) + raptor_free_sequence(grddl_parser->visited_uris); + } + + if(grddl_parser->content_type) + RAPTOR_FREE(char*, grddl_parser->content_type); + + if(grddl_parser->sb) + raptor_free_stringbuffer(grddl_parser->sb); +} + + +static void +raptor_grddl_parser_add_parent(raptor_parser *rdf_parser, + raptor_grddl_parser_context* parent_grddl_parser) +{ + raptor_grddl_parser_context* grddl_parser; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + /* Do not set parent twice */ + if(grddl_parser->visited_uris == parent_grddl_parser->visited_uris) + return; + + /* free any sequence here */ + if(grddl_parser->visited_uris) + raptor_free_sequence(grddl_parser->visited_uris); + + /* share parent's list and do not free it here */ + grddl_parser->visited_uris = parent_grddl_parser->visited_uris; + grddl_parser->grddl_depth = parent_grddl_parser->grddl_depth + 1; + + grddl_parser->saved_user_data = parent_grddl_parser->rdf_parser; + grddl_parser->saved_statement_handler = raptor_grddl_filter_triples; +} + + + +static int +raptor_grddl_parse_start(raptor_parser *rdf_parser) +{ + raptor_grddl_parser_context* grddl_parser; + raptor_locator *locator = &rdf_parser->locator; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + locator->line = 1; + + grddl_parser->content_type_check = 0; + grddl_parser->process_this_as_rdfxml = 0; + + return 0; +} + + +#define MATCH_IS_VALUE_LIST 1 +#define MATCH_IS_PROFILE 2 +#define MATCH_IS_HARDCODED 4 +/* stop looking for other hardcoded matches */ +#define MATCH_LAST 8 +static struct { + const xmlChar* xpath; + int flags; + const xmlChar* xslt_sheet_uri; +} match_table[]={ + /* XHTML document where the GRDDL profile is in + * inside the html + * Value of @rel is a space-separated list of link types. + */ + { + (const xmlChar*)"/html:html/html:head[contains(@profile,\"http://www.w3.org/2003/g/data-view\")]/html:link[contains(@rel,\"transformation\")]/@href", + 0, + NULL + } + , + /* XHTML document where the GRDDL profile is in + * inside the html + * Value of @rel is a space-separated list of link types. + */ + { + (const xmlChar*)"/html:html/html:head[contains(@profile,\"http://www.w3.org/2003/g/data-view\")]/../..//html:a[contains(@rel,\"transformation\")]/@href", + 0, + NULL + } + , + /* XML document linking to transform via attribute dataview:transformation + * on the root element. + * Example: http://www.w3.org/2004/01/rdxh/grddl-p3p-example + **/ + { + (const xmlChar*)"/*/@dataview:transformation", + MATCH_IS_VALUE_LIST, + NULL + } + , + /* hCalendar microformat http://microformats.org/wiki/hcalendar */ + { + (const xmlChar*)"//*[contains(concat(' ', concat(normalize-space(@class),' ')),' vevent ')]", + MATCH_IS_HARDCODED, + (const xmlChar*)"http://www.w3.org/2002/12/cal/glean-hcal.xsl" + } + , + /* hReview microformat http://microformats.org/wiki/review */ + { + (const xmlChar*)"//*[contains(concat(' ', concat(normalize-space(@class),' ')),' hreview ')]", + MATCH_IS_HARDCODED | MATCH_LAST, /* stop here since hCard is inside hReview */ + (const xmlChar*)"http://www.w3.org/2001/sw/grddl-wg/doc29/hreview2rdfxml.xsl" + } + , + /* hCard microformat http://microformats.org/wiki/hcard */ + { + (const xmlChar*)"//*[contains(concat(' ', concat(normalize-space(@class),' ')),' vcard ')]", + MATCH_IS_HARDCODED, + (const xmlChar*)"http://www.w3.org/2006/vcard/hcard2rdf.xsl" + } + , + { + NULL, + 0, + NULL + } +}; + + +static const char* const grddl_namespace_uris_ignore_list[] = { + "http://www.w3.org/1999/xhtml", + "http://www.w3.org/1999/02/22-rdf-syntax-ns#", + "http://www.w3.org/2001/XMLSchema", + NULL +}; + + +/* add URI to XSLT transformation URI list */ +static void +raptor_grddl_add_transform_xml_context(raptor_grddl_parser_context* grddl_parser, + grddl_xml_context* xml_context) +{ + int i; + raptor_uri* uri = xml_context->uri; + int size; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Found document transformation URI '%s'\n", + raptor_uri_as_string(uri)); +#endif + + size = raptor_sequence_size(grddl_parser->doc_transform_uris); + for(i = 0; i < size; i++) { + grddl_xml_context* xc; + xc = (grddl_xml_context*)raptor_sequence_get_at(grddl_parser->doc_transform_uris, i); + if(raptor_uri_equals(uri, xc->uri)) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Already seen XSLT URI '%s'\n", raptor_uri_as_string(uri)); +#endif + grddl_free_xml_context(xml_context); + return; + } + } + + RAPTOR_DEBUG3("Adding new document transformation XSLT URI %s with base URI %s\n", + (uri ? (const char*)raptor_uri_as_string(uri): "(NONE)"), + (xml_context->base_uri ? (const char*)raptor_uri_as_string(xml_context->base_uri) : "(NONE)")); + + raptor_sequence_push(grddl_parser->doc_transform_uris, xml_context); +} + + +static void +raptor_grddl_filter_triples(void *user_data, raptor_statement *statement) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + raptor_grddl_parser_context* grddl_parser; + int i; + raptor_uri* predicate_uri; + int size; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + /* Look for a triple */ + if(statement->subject->type != RAPTOR_TERM_TYPE_URI || + statement->predicate->type != RAPTOR_TERM_TYPE_URI || + statement->object->type != RAPTOR_TERM_TYPE_URI) + return; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + RAPTOR_DEBUG2("Parser %p: Relaying statement: ", RAPTOR_VOIDP(rdf_parser)); + raptor_statement_print(statement, stderr); + fputc('\n', stderr); +#endif + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("Parser %p: Checking against %d profile URIs\n", + RAPTOR_VOIDP(rdf_parser), + raptor_sequence_size(grddl_parser->profile_uris)); +#endif + + /* Look for(i = 0, root namespace URI) + * data-view:namespaceTransformation ?tr + * or (i>0, profile URIs) + * data-view:profileTransformation ?tr + * and then ?tr becomes a new document transformation URI + */ + predicate_uri = grddl_parser->namespace_transformation_uri; + size = raptor_sequence_size(grddl_parser->profile_uris); + for(i = 0; i < size; i++) { + grddl_xml_context* xml_context; + raptor_uri* profile_uri; + grddl_xml_context* new_xml_context; + + xml_context = (grddl_xml_context*)raptor_sequence_get_at(grddl_parser->profile_uris, i); + profile_uri = xml_context->uri; + + if(i == 1) + predicate_uri = grddl_parser->profile_transformation_uri; + + if(!profile_uri) + continue; + + if(raptor_uri_equals(statement->subject->value.uri, profile_uri) && + raptor_uri_equals(statement->predicate->value.uri, predicate_uri)) { + raptor_uri* uri = statement->object->value.uri; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG4("Parser %p: Matches profile URI #%d '%s'\n", + RAPTOR_VOIDP(rdf_parser), + i, raptor_uri_as_string(profile_uri)); +#endif + + new_xml_context = raptor_new_xml_context(rdf_parser->world, uri, + rdf_parser->base_uri); + raptor_grddl_add_transform_xml_context(grddl_parser, new_xml_context); + } else { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG4("Parser %p: Failed to match profile URI #%d '%s'\n", + RAPTOR_VOIDP(rdf_parser), + i, raptor_uri_as_string(profile_uri)); +#endif + } + + } + +} + + +static int +raptor_grddl_ensure_internal_parser(raptor_parser* rdf_parser, + const char* parser_name, int filter) +{ + raptor_grddl_parser_context* grddl_parser; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + if(!grddl_parser->internal_parser_name || + !strcmp(parser_name, "guess") || + strcmp(grddl_parser->internal_parser_name, parser_name)) { + /* construct a new parser if none in use or not what is required */ + if(grddl_parser->internal_parser) { + unsigned int our_emit_flags = rdf_parser->emit_graph_marks; + + /* copy back bit flags from parser about to be destroyed */ + raptor_parser_copy_flags_state(rdf_parser, + grddl_parser->internal_parser); + + /* restore whatever graph makrs state we had here */ + rdf_parser->emit_graph_marks = our_emit_flags ? 1 : 0; + + RAPTOR_DEBUG3("Parser %p: Freeing internal %s parser.\n", + RAPTOR_VOIDP(rdf_parser), + grddl_parser->internal_parser_name); + + raptor_free_parser(grddl_parser->internal_parser); + grddl_parser->internal_parser = NULL; + grddl_parser->internal_parser_name = NULL; + } + + RAPTOR_DEBUG3("Parser %p: Allocating new internal %s parser.\n", + RAPTOR_VOIDP(rdf_parser), parser_name); + grddl_parser->internal_parser = raptor_new_parser(rdf_parser->world, + parser_name); + if(!grddl_parser->internal_parser) { + raptor_parser_error(rdf_parser, "Failed to create %s parser", + parser_name); + return 1; + } + + /* initialise the new parser with the outer state */ + grddl_parser->internal_parser_name = parser_name; + if(raptor_parser_copy_user_state(grddl_parser->internal_parser, rdf_parser)) + return 1; + + /* Disable graph marks in newly constructed internal parser */ + grddl_parser->internal_parser->emit_graph_marks = 0; + + grddl_parser->saved_user_data = rdf_parser->user_data; + grddl_parser->saved_statement_handler = rdf_parser->statement_handler; + } + + /* Filter the triples for profile/namespace URIs */ + if(filter) { + grddl_parser->internal_parser->user_data = rdf_parser; + grddl_parser->internal_parser->statement_handler = raptor_grddl_filter_triples; + } else { + grddl_parser->internal_parser->user_data = grddl_parser->saved_user_data; + grddl_parser->internal_parser->statement_handler = grddl_parser->saved_statement_handler; + } + + return 0; +} + + +/* Run a GRDDL transform using a pre-parsed XSLT stylesheet already + * formed into a libxml document (with URI) + */ +static int +raptor_grddl_run_grddl_transform_doc(raptor_parser* rdf_parser, + grddl_xml_context* xml_context, + xmlDocPtr xslt_doc, + xmlDocPtr doc) +{ + raptor_world* world = rdf_parser->world; + raptor_grddl_parser_context* grddl_parser; + int ret = 0; + xsltStylesheetPtr sheet = NULL; + xmlDocPtr res = NULL; + xmlChar *doc_txt = NULL; + int doc_txt_len = 0; + const char* parser_name; + const char* params[7]; + const unsigned char* base_uri_string; + size_t base_uri_len; + raptor_uri* xslt_uri; + raptor_uri* base_uri; + char *quoted_base_uri = NULL; + xsltTransformContextPtr userCtxt = NULL; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + xslt_uri = xml_context->uri; + base_uri = xml_context->base_uri ? xml_context->base_uri : xml_context->uri; + + base_uri_string = raptor_uri_as_counted_string(base_uri, &base_uri_len); + + RAPTOR_DEBUG3("Running GRDDL transform with XSLT URI '%s' with doc base URI '%s'\n", + raptor_uri_as_string(xslt_uri), + base_uri_string); + + raptor_libxslt_set_global_state(rdf_parser); + + /* This calls xsltGetDefaultSecurityPrefs() */ + sheet = xsltParseStylesheetDoc(xslt_doc); + if(!sheet) { + raptor_parser_error(rdf_parser, "Failed to parse stylesheet in '%s'", + raptor_uri_as_string(xslt_uri)); + ret = 1; + goto cleanup_xslt; + } + + /* This calls xsltGetDefaultSecurityPrefs() */ + userCtxt = xsltNewTransformContext(sheet, doc); + + /* set per-transform security preferences */ + if(world->xslt_security_preferences) + xsltSetCtxtSecurityPrefs((xsltSecurityPrefs*)world->xslt_security_preferences, + userCtxt); + + /* set per-transform generic error handler */ + xsltSetTransformErrorFunc(userCtxt, rdf_parser, + raptor_grddl_xsltGenericError_handler); + + + /* + * Define 'base', 'Base' and 'url' params to allow some XSLT sheets to work: + * base: + * http://www.w3.org/2000/07/uri43/uri.xsl + * Base: + * http://www.w3.org/2000/08/w3c-synd/home2rss.xsl + * url: (optional) + * http://www.w3.org/2001/sw/grddl-wg/td/RDFa2RDFXML.xsl + */ + quoted_base_uri = RAPTOR_MALLOC(char*, base_uri_len + 3); + quoted_base_uri[0] = '\''; + memcpy(quoted_base_uri + 1, (const char*)base_uri_string, base_uri_len); + quoted_base_uri[base_uri_len + 1] = '\''; + quoted_base_uri[base_uri_len + 2] = '\0'; + + params[0] = "base"; + params[1] = (const char*)quoted_base_uri; + params[2] = "Base"; + params[3] = (const char*)quoted_base_uri; + params[4] = "url"; + params[5] = (const char*)quoted_base_uri; + params[6] = NULL; + + res = xsltApplyStylesheetUser(sheet, doc, params, NULL, NULL, userCtxt); + + if(!res) { + raptor_parser_error(rdf_parser, "Failed to apply stylesheet in '%s'", + raptor_uri_as_string(xslt_uri)); + ret = 1; + goto cleanup_xslt; + } + + if(res->type == XML_HTML_DOCUMENT_NODE) { + if(sheet->method != NULL) + xmlFree(sheet->method); + sheet->method = (xmlChar*)xmlMalloc(5); + memcpy(sheet->method, "html", 5); + } + + /* write the resulting XML to a string */ + xsltSaveResultToString(&doc_txt, &doc_txt_len, res, sheet); + + if(!doc_txt || !doc_txt_len) { + raptor_parser_warning(rdf_parser, "XSLT returned an empty document"); + goto cleanup_xslt; + } + + RAPTOR_DEBUG4("XSLT returned %d bytes document method %s media type %s\n", + doc_txt_len, + (sheet->method ? (const char*)sheet->method : "NULL"), + (sheet->mediaType ? (const char*)sheet->mediaType : "NULL")); + + /* Set mime types for XSLT content */ + if(sheet->mediaType == NULL && sheet->method) { + if(!(strcmp((const char*)sheet->method, "text"))) { + sheet->mediaType = (xmlChar*)xmlMalloc(11); + memcpy(sheet->mediaType, "text/plain",11); + } else if(!(strcmp((const char*)sheet->method, "xml"))) { + sheet->mediaType = (xmlChar*)xmlMalloc(16); + memcpy(sheet->mediaType, "application/xml",16); + } else if(!(strcmp((const char*)sheet->method, "html"))) { + sheet->mediaType = (xmlChar*)xmlMalloc(10); + memcpy(sheet->mediaType, "text/html",10); + } + } + + /* Assume all that all media XML is RDF/XML and also that + * with no information at all we have RDF/XML + */ + if(!sheet->mediaType || + (sheet->mediaType && + !strcmp((const char*)sheet->mediaType, "application/xml"))) { + if(sheet->mediaType) + xmlFree(sheet->mediaType); + sheet->mediaType = (xmlChar*)xmlMalloc(20); + memcpy(sheet->mediaType, "application/rdf+xml",20); + } + + parser_name = raptor_world_guess_parser_name(rdf_parser->world, NULL, + (const char*)sheet->mediaType, + doc_txt, doc_txt_len, NULL); + if(!parser_name) { + RAPTOR_DEBUG3("Parser %p: Guessed no parser from mime type '%s' and content - ending", + RAPTOR_VOIDP(rdf_parser), sheet->mediaType); + goto cleanup_xslt; + } + + RAPTOR_DEBUG4("Parser %p: Guessed parser %s from mime type '%s' and content\n", + RAPTOR_VOIDP(rdf_parser), parser_name, sheet->mediaType); + + if(!strcmp((const char*)parser_name, "grddl")) { + RAPTOR_DEBUG2("Parser %p: Ignoring guess to run grddl parser - ending", + RAPTOR_VOIDP(rdf_parser)); + goto cleanup_xslt; + } + + ret = raptor_grddl_ensure_internal_parser(rdf_parser, parser_name, 0); + if(ret) + goto cleanup_xslt; + + if(grddl_parser->internal_parser) { + /* generate the triples */ + ret = raptor_parser_parse_start(grddl_parser->internal_parser, base_uri); + if(!ret) + ret = raptor_parser_parse_chunk(grddl_parser->internal_parser, + doc_txt, doc_txt_len, 1); + } + + cleanup_xslt: + + if(userCtxt) + xsltFreeTransformContext(userCtxt); + + if(quoted_base_uri) + RAPTOR_FREE(char*, quoted_base_uri); + + if(doc_txt) + xmlFree(doc_txt); + + if(res) + xmlFreeDoc(res); + + if(sheet) + xsltFreeStylesheet(sheet); + + raptor_libxslt_reset_global_state(rdf_parser); + + return ret; +} + + +typedef struct +{ + raptor_parser* rdf_parser; + xmlParserCtxtPtr xc; + raptor_uri* base_uri; +} raptor_grddl_xml_parse_bytes_context; + + +static void +raptor_grddl_uri_xml_parse_bytes(raptor_www* www, + void *userdata, + const void *ptr, size_t size, size_t nmemb) +{ + raptor_grddl_xml_parse_bytes_context* xpbc; + size_t len = size * nmemb; + int rc = 0; + + xpbc = (raptor_grddl_xml_parse_bytes_context*)userdata; + + if(!xpbc->xc) { + xmlParserCtxtPtr xc; + + xc = xmlCreatePushParserCtxt(NULL, NULL, + (const char*)ptr, RAPTOR_BAD_CAST(int, len), + (const char*)raptor_uri_as_string(xpbc->base_uri)); + if(!xc) + rc = 1; + else { + int libxml_options = 0; + +#ifdef RAPTOR_LIBXML_XML_PARSE_NONET + if(RAPTOR_OPTIONS_GET_NUMERIC(xpbc->rdf_parser, RAPTOR_OPTION_NO_NET)) + libxml_options |= XML_PARSE_NONET; +#endif +#ifdef HAVE_XMLCTXTUSEOPTIONS + xmlCtxtUseOptions(xc, libxml_options); +#endif + + xc->replaceEntities = 1; + xc->loadsubset = 1; + } + xpbc->xc = xc; + } else + rc = xmlParseChunk(xpbc->xc, (const char*)ptr, RAPTOR_BAD_CAST(int, len), 0); + + if(rc) + raptor_parser_error(xpbc->rdf_parser, "XML Parsing failed"); +} + + +#define FETCH_IGNORE_ERRORS 1 +#define FETCH_ACCEPT_XSLT 2 + +static int +raptor_grddl_fetch_uri(raptor_parser* rdf_parser, + raptor_uri* uri, + raptor_www_write_bytes_handler write_bytes_handler, + void* write_bytes_user_data, + raptor_www_content_type_handler content_type_handler, + void* content_type_user_data, + int flags) +{ + raptor_www *www; + const char *accept_h; + int ret = 0; + int ignore_errors = (flags & FETCH_IGNORE_ERRORS); + + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NO_NET)) { + if(!raptor_uri_uri_string_is_file_uri(raptor_uri_as_string(uri))) + return 1; + } + + www = raptor_new_www(rdf_parser->world); + if(!www) + return 1; + + if(raptor_www_set_user_agent2(www, "grddl/0.1", 0)) + goto cleanup_www; + + if(flags & FETCH_ACCEPT_XSLT) { + if(raptor_www_set_http_accept2(www, "application/xml", 0)) + goto cleanup_www; + } else { + accept_h = raptor_parser_get_accept_header(rdf_parser); + if(accept_h) { + ret = raptor_www_set_http_accept2(www, accept_h, 0); + RAPTOR_FREE(char*, accept_h); + if(ret) + goto cleanup_www; + } + } + if(rdf_parser->uri_filter) + raptor_www_set_uri_filter(www, rdf_parser->uri_filter, + rdf_parser->uri_filter_user_data); + if(ignore_errors) + raptor_world_internal_set_ignore_errors(rdf_parser->world, 1); + + raptor_www_set_write_bytes_handler(www, write_bytes_handler, + write_bytes_user_data); + raptor_www_set_content_type_handler(www, content_type_handler, + content_type_user_data); + + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_WWW_TIMEOUT) > 0) + raptor_www_set_connection_timeout(www, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_WWW_TIMEOUT)); + + ret = raptor_www_fetch(www, uri); + + raptor_free_www(www); + + if(ignore_errors) + raptor_world_internal_set_ignore_errors(rdf_parser->world, 0); + + return ret; + +cleanup_www: + raptor_free_www(www); + + return 1; +} + + +/* Run a GRDDL transform using a XSLT stylesheet at a given URI */ +static int +raptor_grddl_run_grddl_transform_uri(raptor_parser* rdf_parser, + grddl_xml_context* xml_context, + xmlDocPtr doc) +{ + xmlParserCtxtPtr xslt_ctxt = NULL; + raptor_grddl_xml_parse_bytes_context xpbc; + int ret = 0; + raptor_uri* xslt_uri; + raptor_uri* base_uri; + raptor_uri* old_locator_uri; + raptor_locator *locator = &rdf_parser->locator; + + xslt_uri = xml_context->uri; + base_uri = xml_context->base_uri ? xml_context->base_uri : xml_context->uri; + + RAPTOR_DEBUG3("Running GRDDL transform with XSLT URI %s and base URI %s\n", + raptor_uri_as_string(xslt_uri), + raptor_uri_as_string(base_uri)); + + /* make an xsltStylesheetPtr via the raptor_grddl_uri_xml_parse_bytes + * callback as bytes are returned + */ + xpbc.xc = NULL; + xpbc.rdf_parser = rdf_parser; + xpbc.base_uri = base_uri; + + old_locator_uri = locator->uri; + locator->uri = xslt_uri; + ret = raptor_grddl_fetch_uri(rdf_parser, + xslt_uri, + raptor_grddl_uri_xml_parse_bytes, &xpbc, + NULL, NULL, + FETCH_ACCEPT_XSLT); + xslt_ctxt = xpbc.xc; + if(ret) { + locator->uri = old_locator_uri; + raptor_parser_warning(rdf_parser, "Fetching XSLT document URI '%s' failed", + raptor_uri_as_string(xslt_uri)); + ret = 0; + } else { + xmlParseChunk(xpbc.xc, NULL, 0, 1); + + ret = raptor_grddl_run_grddl_transform_doc(rdf_parser, + xml_context, + xslt_ctxt->myDoc, + doc); + locator->uri = old_locator_uri; + } + + if(xslt_ctxt) + xmlFreeParserCtxt(xslt_ctxt); + + return ret; +} + + +static int +raptor_grddl_seen_uri(raptor_grddl_parser_context* grddl_parser, + raptor_uri* uri) +{ + int i; + int seen = 0; + raptor_sequence* seq = grddl_parser->visited_uris; + int size; + + size = raptor_sequence_size(seq); + for(i = 0; i < size; i++) { + raptor_uri* vuri = (raptor_uri*)raptor_sequence_get_at(seq, i); + if(raptor_uri_equals(uri, vuri)) { + seen = 1; + break; + } + } + +#ifdef RAPTOR_DEBUG + if(seen) + RAPTOR_DEBUG2("Already seen URI '%s'\n", raptor_uri_as_string(uri)); +#endif + + return seen; +} + + +static void +raptor_grddl_done_uri(raptor_grddl_parser_context* grddl_parser, + raptor_uri* uri) +{ + if(!grddl_parser->visited_uris) + return; + + if(!raptor_grddl_seen_uri(grddl_parser, uri)) { + raptor_sequence* seq = grddl_parser->visited_uris; + raptor_sequence_push(seq, raptor_uri_copy(uri)); + } +} + + +static raptor_sequence* +raptor_grddl_run_xpath_match(raptor_parser* rdf_parser, + xmlDocPtr doc, + const xmlChar* xpathExpr, + int flags) +{ + raptor_grddl_parser_context* grddl_parser; + /* Evaluate xpath expression */ + xmlXPathObjectPtr xpathObj = NULL; + raptor_sequence* seq = NULL; + xmlNodeSetPtr nodes; + int i; + int size; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + seq = raptor_new_sequence((raptor_data_free_handler)grddl_free_xml_context, NULL); + + /* Evaluate xpath expression */ + xpathObj = xmlXPathEvalExpression(xpathExpr, + grddl_parser->xpathCtx); + if(!xpathObj) { + raptor_parser_error(rdf_parser, + "Unable to evaluate XPath expression \"%s\"", + xpathExpr); + raptor_free_sequence(seq); seq = NULL; + goto cleanup_xpath_match; + } + + nodes = xpathObj->nodesetval; + if(!nodes || xmlXPathNodeSetIsEmpty(nodes)) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("No match found with XPath expression \"%s\" over '%s'\n", + xpathExpr, raptor_uri_as_string(rdf_parser->base_uri)); +#endif + raptor_free_sequence(seq); seq = NULL; + goto cleanup_xpath_match; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("Found match with XPath expression \"%s\" over '%s'\n", + xpathExpr, raptor_uri_as_string(rdf_parser->base_uri)); +#endif + + size = xmlXPathNodeSetGetLength(nodes); + for(i = 0; i < size; i++) { + xmlNodePtr node = nodes->nodeTab[i]; + const unsigned char* uri_string = NULL; + xmlChar *base_uri_string; + raptor_uri* base_uri = NULL; + raptor_uri* uri = NULL; + + if(node->type != XML_ATTRIBUTE_NODE && + node->type != XML_ELEMENT_NODE) { + raptor_parser_error(rdf_parser, "Got unexpected node type %u", + node->type); + continue; + } + + + /* xmlNodeGetBase() returns base URI or NULL and must be freed + * with xmlFree() + */ + if(grddl_parser->html_base_processing) { + xmlElementType savedType = doc->type; + doc->type = XML_HTML_DOCUMENT_NODE; + base_uri_string = xmlNodeGetBase(doc, node); + doc->type = savedType; + } else + base_uri_string = xmlNodeGetBase(doc, node); + + + if(node->type == XML_ATTRIBUTE_NODE) + uri_string = (const unsigned char*)node->children->content; + else { /* XML_ELEMENT_NODE */ + if(node->ns) + uri_string = (const unsigned char*)node->ns->href; + } + + + if(base_uri_string) { + base_uri = raptor_new_uri(rdf_parser->world, base_uri_string); + xmlFree(base_uri_string); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("XML base URI of match is '%s'\n", + raptor_uri_as_string(base_uri)); +#endif + } else if(rdf_parser->base_uri) + base_uri = raptor_uri_copy(rdf_parser->base_uri); + else + base_uri = NULL; + + if(uri_string && (flags & MATCH_IS_VALUE_LIST)) { + char *start; + char *end; + char* buffer; + size_t list_len = strlen((const char*)uri_string); + + buffer = RAPTOR_MALLOC(char*, list_len + 1); + memcpy(buffer, uri_string, list_len + 1); + + for(start = end = buffer; end; start = end+1) { + grddl_xml_context* xml_context; + + end = strchr(start, ' '); + if(end) + *end = '\0'; + + if(start == end) + continue; + + RAPTOR_DEBUG2("Got list match URI '%s'\n", start); + + uri = raptor_new_uri_relative_to_base(rdf_parser->world, + base_uri, + (const unsigned char*)start); + if(flags & MATCH_IS_PROFILE && + !strcmp((const char*)raptor_uri_as_string(uri), + "http://www.w3.org/2003/g/data-view'")) { + raptor_free_uri(uri); + continue; + } + + xml_context = raptor_new_xml_context(rdf_parser->world, uri, base_uri); + raptor_sequence_push(seq, xml_context); + } + RAPTOR_FREE(char*, buffer); + } else if(flags & MATCH_IS_HARDCODED) { + RAPTOR_DEBUG2("Got hardcoded XSLT match for %s\n", xpathExpr); + /* return at first match, that's enough */ + if(base_uri) + raptor_free_uri(base_uri); + break; + } else if(uri_string) { + grddl_xml_context* xml_context; + RAPTOR_DEBUG2("Got single match URI '%s'\n", uri_string); + + uri = raptor_new_uri_relative_to_base(rdf_parser->world, base_uri, + uri_string); + xml_context = raptor_new_xml_context(rdf_parser->world, uri, base_uri); + raptor_sequence_push(seq, xml_context); + raptor_free_uri(uri); + } + + if(base_uri) + raptor_free_uri(base_uri); + } + + cleanup_xpath_match: + if(xpathObj) + xmlXPathFreeObject(xpathObj); + + return seq; +} + + +static void +raptor_grddl_check_recursive_content_type_handler(raptor_www* www, + void* userdata, + const char* content_type) +{ + raptor_parser* rdf_parser = (raptor_parser*)userdata; + raptor_grddl_parser_context* grddl_parser; + size_t len; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + if(!content_type) + return; + + len = strlen(content_type)+1; + if(grddl_parser->content_type) + RAPTOR_FREE(char*, grddl_parser->content_type); + grddl_parser->content_type = RAPTOR_MALLOC(char*, len + 1); + memcpy(grddl_parser->content_type, content_type, len + 1); + + if(!strncmp(content_type, "application/rdf+xml", 19)) { + grddl_parser->process_this_as_rdfxml = 1; + + RAPTOR_DEBUG2("Parser %p: Found RDF/XML content type\n", + RAPTOR_VOIDP(rdf_parser)); + raptor_parser_save_content(rdf_parser, 1); + } + + if(!strncmp(content_type, "text/html", 9) || + !strncmp(content_type, "application/html+xml", 20)) { + RAPTOR_DEBUG3("Parser %p: Found HTML content type '%s'\n", + RAPTOR_VOIDP(rdf_parser), content_type); + grddl_parser->html_base_processing = 1; + } + +} + +#define RECURSIVE_FLAGS_IGNORE_ERRORS 1 +#define RECURSIVE_FLAGS_FILTER 2 + +static int +raptor_grddl_run_recursive(raptor_parser* rdf_parser, raptor_uri* uri, + const char *parser_name, int flags) +{ + raptor_grddl_parser_context* grddl_parser; + raptor_www_content_type_handler content_type_handler = NULL; + int ret = 0; + const unsigned char* ibuffer = NULL; + size_t ibuffer_len = 0; + raptor_parse_bytes_context rpbc; + int ignore_errors = (flags & RECURSIVE_FLAGS_IGNORE_ERRORS) > 0; + int filter = (flags & RECURSIVE_FLAGS_FILTER) > 0; + int fetch_uri_flags = 0; + int is_grddl=!strcmp(parser_name, "grddl"); + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + if(raptor_grddl_seen_uri(grddl_parser, uri)) + return 0; + + if(is_grddl) + content_type_handler = raptor_grddl_check_recursive_content_type_handler; + + if(raptor_grddl_ensure_internal_parser(rdf_parser, parser_name, filter)) + return !ignore_errors; + + RAPTOR_DEBUG3("Running recursive %s operation on URI '%s'\n", + parser_name, raptor_uri_as_string(uri)); + + if(is_grddl) + raptor_grddl_parser_add_parent(grddl_parser->internal_parser, grddl_parser); + + rpbc.rdf_parser = grddl_parser->internal_parser; + rpbc.base_uri = NULL; + rpbc.final_uri = NULL; + rpbc.started = 0; + + if(ignore_errors) + fetch_uri_flags |=FETCH_IGNORE_ERRORS; + + if(raptor_grddl_fetch_uri(grddl_parser->internal_parser, + uri, + raptor_parser_parse_uri_write_bytes, &rpbc, + content_type_handler, grddl_parser->internal_parser, + fetch_uri_flags)) { + if(!ignore_errors) + raptor_parser_warning(rdf_parser, + "Fetching GRDDL document URI '%s' failed\n", + raptor_uri_as_string(uri)); + ret = 0; + goto tidy; + } + + if(ignore_errors) + raptor_world_internal_set_ignore_errors(rdf_parser->world, 1); + + raptor_parser_parse_chunk(grddl_parser->internal_parser, NULL, 0, 1); + + /* If content was saved, process it as RDF/XML */ + ibuffer = raptor_parser_get_content(grddl_parser->internal_parser, + &ibuffer_len); + if(ibuffer && strcmp(parser_name, "rdfxml")) { + RAPTOR_DEBUG2("Running additional RDF/XML parse on URI '%s' content\n", + raptor_uri_as_string(uri)); + + if(raptor_grddl_ensure_internal_parser(rdf_parser, "rdfxml", 1)) + ret = 1; + else { + if(raptor_parser_parse_start(grddl_parser->internal_parser, uri)) + ret = 1; + else { + ret = raptor_parser_parse_chunk(grddl_parser->internal_parser, ibuffer, + ibuffer_len, 1); + } + } + + raptor_parser_save_content(grddl_parser->internal_parser, 0); + } + + if(ibuffer) + RAPTOR_FREE(char*, ibuffer); + + if(rpbc.final_uri) + raptor_free_uri(rpbc.final_uri); + + if(ignore_errors) { + raptor_world_internal_set_ignore_errors(rdf_parser->world, 0); + ret = 0; + } + + tidy: + + return ret; +} + + +static void +raptor_grddl_libxml_discard_error(void* user_data, const char *msg, ...) +{ + return; +} + + +static int +raptor_grddl_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *s, size_t len, + int is_end) +{ + raptor_grddl_parser_context* grddl_parser; + int i; + int ret = 0; + const unsigned char* uri_string; + raptor_uri* uri; + /* XML document DOM */ + xmlDocPtr doc; + int expri; + unsigned char* buffer = NULL; + size_t buffer_len = 0; + int buffer_is_libxml = 0; + int loop; + + if(!is_end && !rdf_parser->emitted_default_graph) { + /* Cannot tell if we have a statement yet but must ensure that + * the start default graph mark is done once and done before any + * statements. + */ + raptor_parser_start_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph++; + } + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + if(grddl_parser->content_type && !grddl_parser->content_type_check) { + grddl_parser->content_type_check++; + if(!strncmp(grddl_parser->content_type, "application/rdf+xml", 19)) { + RAPTOR_DEBUG3("Parser %p: Found document with type '%s' is RDF/XML\n", + RAPTOR_VOIDP(rdf_parser), grddl_parser->content_type); + grddl_parser->process_this_as_rdfxml = 1; + } + if(!strncmp(grddl_parser->content_type, "text/html", 9) || + !strncmp(grddl_parser->content_type, "application/html+xml", 20)) { + RAPTOR_DEBUG3("Parser %p: Found document with type '%s' is HTML\n", + RAPTOR_VOIDP(rdf_parser), grddl_parser->content_type); + grddl_parser->html_base_processing = 1; + } + } + + if(!grddl_parser->sb) + grddl_parser->sb = raptor_new_stringbuffer(); + + raptor_stringbuffer_append_counted_string(grddl_parser->sb, s, len, 1); + + if(!is_end) + return 0; + + buffer_len = raptor_stringbuffer_length(grddl_parser->sb); + buffer = RAPTOR_MALLOC(unsigned char*, buffer_len + 1); + if(buffer) + raptor_stringbuffer_copy_to_string(grddl_parser->sb, + buffer, buffer_len); + + + uri_string = raptor_uri_as_string(rdf_parser->base_uri); + + /* Discard parsing errors */ + raptor_world_internal_set_ignore_errors(rdf_parser->world, 1); + + RAPTOR_DEBUG4("Parser %p: URI %s: processing %d bytes of content\n", + RAPTOR_VOIDP(rdf_parser), uri_string, (int)buffer_len); + + for(loop = 0; loop < 2; loop++) { + int rc; + + if(loop == 0) { + int libxml_options = 0; + + RAPTOR_DEBUG2("Parser %p: Creating an XML parser\n", + RAPTOR_VOIDP(rdf_parser)); + + /* try to create an XML parser context */ + grddl_parser->xml_ctxt = xmlCreatePushParserCtxt(NULL, NULL, + (const char*)buffer, + RAPTOR_BAD_CAST(int, buffer_len), + (const char*)uri_string); + if(!grddl_parser->xml_ctxt) { + RAPTOR_DEBUG2("Parser %p: Creating an XML parser failed\n", + RAPTOR_VOIDP(rdf_parser)); + continue; + } + +#ifdef RAPTOR_LIBXML_XML_PARSE_NONET + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NO_NET)) + libxml_options |= XML_PARSE_NONET; +#endif +#ifdef HAVE_XMLCTXTUSEOPTIONS + xmlCtxtUseOptions(grddl_parser->xml_ctxt, libxml_options); +#endif + + + grddl_parser->xml_ctxt->vctxt.warning = raptor_grddl_libxml_discard_error; + grddl_parser->xml_ctxt->vctxt.error = raptor_grddl_libxml_discard_error; + + grddl_parser->xml_ctxt->replaceEntities = 1; + grddl_parser->xml_ctxt->loadsubset = 1; + } else { /* loop is 1 */ + + /* try to create an HTML parser context */ + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_HTML_TAG_SOUP)) { + xmlCharEncoding enc; + int options; + + RAPTOR_DEBUG2("Parser %p: Creating an HTML parser\n", + RAPTOR_VOIDP(rdf_parser)); + + enc = xmlDetectCharEncoding((const unsigned char*)buffer, + RAPTOR_BAD_CAST(int, buffer_len)); + grddl_parser->html_ctxt = htmlCreatePushParserCtxt(/*sax*/ NULL, + /*user_data*/ NULL, + (const char *)buffer, + RAPTOR_BAD_CAST(int, buffer_len), + (const char *)uri_string, + enc); + if(!grddl_parser->html_ctxt) { + RAPTOR_DEBUG2("Parser %p: Creating an HTML parser failed\n", + RAPTOR_VOIDP(rdf_parser)); + continue; + } + + /* HTML parser */ + grddl_parser->html_ctxt->replaceEntities = 1; + grddl_parser->html_ctxt->loadsubset = 1; + + grddl_parser->html_ctxt->vctxt.error = raptor_grddl_libxml_discard_error; + + /* HTML_PARSE_NOWARNING disables sax->warning, vxtxt.warning */ + /* HTML_PARSE_NOERROR disables sax->error, vctxt.error */ + options = HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING; +#ifdef HTML_PARSE_RECOVER + options |= HTML_PARSE_RECOVER; +#endif +#ifdef RAPTOR_LIBXML_HTML_PARSE_NONET + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NO_NET)) + options |= HTML_PARSE_NONET; +#endif + + htmlCtxtUseOptions(grddl_parser->html_ctxt, options); + + } else /* No HTML tag soup allowed so continue loop */ + continue; + } + + + if(grddl_parser->html_ctxt) { + RAPTOR_DEBUG2("Parser %p: Parsing as HTML\n", RAPTOR_VOIDP(rdf_parser)); + rc = htmlParseChunk(grddl_parser->html_ctxt, (const char*)s, 0, 1); + RAPTOR_DEBUG3("Parser %p: Parsing as HTML %s\n", + RAPTOR_VOIDP(rdf_parser), + (rc ? "failed" : "succeeded")); + if(rc) { + if(grddl_parser->html_ctxt->myDoc) { + xmlFreeDoc(grddl_parser->html_ctxt->myDoc); + grddl_parser->html_ctxt->myDoc = NULL; + } + htmlFreeParserCtxt(grddl_parser->html_ctxt); + grddl_parser->html_ctxt = NULL; + } + } else { + RAPTOR_DEBUG2("Parser %p: Parsing as XML\n", RAPTOR_VOIDP(rdf_parser)); + rc = xmlParseChunk(grddl_parser->xml_ctxt, (const char*)s, 0, 1); + RAPTOR_DEBUG3("Parser %p: Parsing as XML %s\n", RAPTOR_VOIDP(rdf_parser), + (rc ? "failed" : "succeeded")); + if(rc) { + if(grddl_parser->xml_ctxt->myDoc) { + xmlFreeDoc(grddl_parser->xml_ctxt->myDoc); + grddl_parser->xml_ctxt->myDoc = NULL; + } + xmlFreeParserCtxt(grddl_parser->xml_ctxt); + grddl_parser->xml_ctxt = NULL; + } + } + + if(!rc) + break; + + } + + /* Restore error handling */ + raptor_world_internal_set_ignore_errors(rdf_parser->world, 0); + + if(!grddl_parser->html_ctxt && !grddl_parser->xml_ctxt) { + raptor_parser_error(rdf_parser, "Failed to create HTML or XML parsers"); + ret = 1; + goto tidy; + } + + raptor_grddl_done_uri(grddl_parser, rdf_parser->base_uri); + + if(grddl_parser->html_ctxt) + doc = grddl_parser->html_ctxt->myDoc; + else + doc = grddl_parser->xml_ctxt->myDoc; + if(!doc) { + raptor_parser_error(rdf_parser, + "Failed to create XML DOM for GRDDL document"); + ret = 1; + goto tidy; + } + + if(!grddl_parser->grddl_processing) + goto transform; + + + if(grddl_parser->xinclude_processing) { + RAPTOR_DEBUG3("Parser %p: Running XInclude processing on URI '%s'\n", + RAPTOR_VOIDP(rdf_parser), + raptor_uri_as_string(rdf_parser->base_uri)); + if(xmlXIncludeProcess(doc) < 0) { + raptor_parser_error(rdf_parser, + "XInclude processing failed for GRDDL document"); + ret = 1; + goto tidy; + } else { + int blen; + + /* write the result of XML Include to buffer */ + RAPTOR_FREE(char*, buffer); + xmlDocDumpFormatMemory(doc, (xmlChar**)&buffer, &blen, + 1 /* indent the result */); + buffer_len = blen; + buffer_is_libxml = 1; + + RAPTOR_DEBUG3("Parser %p: XML Include processing returned %d bytes document\n", + RAPTOR_VOIDP(rdf_parser), (int)buffer_len); + } + } + + + RAPTOR_DEBUG3("Parser %p: Running top-level GRDDL on URI '%s'\n", + RAPTOR_VOIDP(rdf_parser), + raptor_uri_as_string(rdf_parser->base_uri)); + + /* Work out if there is a root namespace URI */ + if(1) { + xmlNodePtr xnp; + xmlNsPtr rootNs = NULL; + const unsigned char* ns_uri_string = NULL; + + xnp = xmlDocGetRootElement(doc); + if(xnp) { + rootNs = xnp->ns; + if(rootNs) + ns_uri_string = (const unsigned char*)(rootNs->href); + } + + if(ns_uri_string) { + int n; + + RAPTOR_DEBUG3("Parser %p: Root namespace URI is %s\n", + RAPTOR_VOIDP(rdf_parser), ns_uri_string); + + if(!strcmp((const char*)ns_uri_string, + (const char*)raptor_rdf_namespace_uri) && + !strcmp((const char*)xnp->name, "RDF")) { + RAPTOR_DEBUG3("Parser %p: Root element of %s is rdf:RDF - process this as RDF/XML later\n", + RAPTOR_VOIDP(rdf_parser), + raptor_uri_as_string(rdf_parser->base_uri)); + grddl_parser->process_this_as_rdfxml = 1; + } + + for(n = 0; grddl_namespace_uris_ignore_list[n]; n++) { + if(!strcmp(grddl_namespace_uris_ignore_list[n], + (const char*)ns_uri_string)) { + /* ignore this namespace */ + RAPTOR_DEBUG3("Parser %p: Ignoring GRDDL for namespace URI '%s'\n", + RAPTOR_VOIDP(rdf_parser), ns_uri_string); + ns_uri_string = NULL; + break; + } + } + if(ns_uri_string) { + grddl_xml_context* xml_context; + + grddl_parser->root_ns_uri = raptor_new_uri_relative_to_base(rdf_parser->world, + rdf_parser->base_uri, + ns_uri_string); + xml_context = raptor_new_xml_context(rdf_parser->world, + grddl_parser->root_ns_uri, + rdf_parser->base_uri); + raptor_sequence_push(grddl_parser->profile_uris, xml_context); + + RAPTOR_DEBUG3("Parser %p: Processing GRDDL namespace URI '%s'\n", + RAPTOR_VOIDP(rdf_parser), + raptor_uri_as_string(grddl_parser->root_ns_uri)); + raptor_grddl_run_recursive(rdf_parser, grddl_parser->root_ns_uri, + "grddl", + RECURSIVE_FLAGS_IGNORE_ERRORS | + RECURSIVE_FLAGS_FILTER); + } + + } + } + + /* Always put something at the start of the list even if NULL + * so later it can be searched for in output triples + */ + if(!grddl_parser->root_ns_uri) { + grddl_xml_context* xml_context; + xml_context = raptor_new_xml_context(rdf_parser->world, NULL, NULL); + raptor_sequence_push(grddl_parser->profile_uris, xml_context); + } + + + /* Create the XPath evaluation context */ + if(!grddl_parser->xpathCtx) { + grddl_parser->xpathCtx = xmlXPathNewContext(doc); + if(!grddl_parser->xpathCtx) { + raptor_parser_error(rdf_parser, + "Failed to create XPath context for GRDDL document"); + ret = 1; + goto tidy; + } + + xmlXPathRegisterNs(grddl_parser->xpathCtx, + (const xmlChar*)"html", + (const xmlChar*)"http://www.w3.org/1999/xhtml"); + xmlXPathRegisterNs(grddl_parser->xpathCtx, + (const xmlChar*)"dataview", + (const xmlChar*)"http://www.w3.org/2003/g/data-view#"); + } + + /* Try URIs */ + if(1) { + raptor_sequence* result; + result = raptor_grddl_run_xpath_match(rdf_parser, doc, + (const xmlChar*)"/html:html/html:head/@profile", + MATCH_IS_VALUE_LIST | MATCH_IS_PROFILE); + if(result) { + int size; + + RAPTOR_DEBUG4("Parser %p: Found %d URIs in URI '%s'\n", + RAPTOR_VOIDP(rdf_parser), raptor_sequence_size(result), + raptor_uri_as_string(rdf_parser->base_uri)); + + + /* Store profile URIs, skipping NULLs or the GRDDL profile itself */ + while(raptor_sequence_size(result)) { + grddl_xml_context* xml_context; + + xml_context = (grddl_xml_context*)raptor_sequence_unshift(result); + if(!xml_context) + continue; + uri = xml_context->uri; + if(!strcmp("http://www.w3.org/2003/g/data-view", + (const char*)raptor_uri_as_string(uri))) { + RAPTOR_DEBUG3("Ignoring of URI %s: URI %s\n", + raptor_uri_as_string(rdf_parser->base_uri), + raptor_uri_as_string(uri)); + grddl_free_xml_context(xml_context); + continue; + } + raptor_sequence_push(grddl_parser->profile_uris, xml_context); + } + raptor_free_sequence(result); + + + /* Recursive GRDDL through all the URIs */ + size = raptor_sequence_size(grddl_parser->profile_uris); + for(i = 1; i < size; i++) { + grddl_xml_context* xml_context; + + xml_context = (grddl_xml_context*)raptor_sequence_get_at(grddl_parser->profile_uris, i); + uri = xml_context->uri; + if(!uri) + continue; + + RAPTOR_DEBUG4("Processing #%d of URI %s: URI %s\n", + i, raptor_uri_as_string(rdf_parser->base_uri), + raptor_uri_as_string(uri)); + ret = raptor_grddl_run_recursive(rdf_parser, uri, + "grddl", + RECURSIVE_FLAGS_IGNORE_ERRORS| + RECURSIVE_FLAGS_FILTER); + } + } + + } /* end head profile URIs */ + + + /* Try XHTML document with alternate forms + * + * Value of @href is a URI + */ + if(grddl_parser->html_link_processing && + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_HTML_LINK)) { + raptor_sequence* result; + result = raptor_grddl_run_xpath_match(rdf_parser, doc, + (const xmlChar*)"/html:html/html:head/html:link[@type=\"application/rdf+xml\"]/@href", + 0); + if(result) { + RAPTOR_DEBUG4("Parser %p: Found %d URIs in URI '%s'\n", + RAPTOR_VOIDP(rdf_parser), raptor_sequence_size(result), + raptor_uri_as_string(rdf_parser->base_uri)); + + /* Recursively parse all the URIs, skipping NULLs */ + i = 0; + while(raptor_sequence_size(result)) { + grddl_xml_context* xml_context; + + xml_context = (grddl_xml_context*)raptor_sequence_unshift(result); + if(!xml_context) + continue; + + uri = xml_context->uri; + if(uri) { + RAPTOR_DEBUG4("Processing #%d of URI %s: URI %s\n", + i, raptor_uri_as_string(rdf_parser->base_uri), + raptor_uri_as_string(uri)); + i++; + ret = raptor_grddl_run_recursive(rdf_parser, uri, "guess", + RECURSIVE_FLAGS_IGNORE_ERRORS); + } + grddl_free_xml_context(xml_context); + } + + raptor_free_sequence(result); + } + } + + + /* Try all XPaths */ + for(expri = 0; match_table[expri].xpath; expri++) { + raptor_sequence* result; + int flags = match_table[expri].flags; + + if((flags & MATCH_IS_HARDCODED) && + !RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_MICROFORMATS)) + continue; + + result = raptor_grddl_run_xpath_match(rdf_parser, doc, + match_table[expri].xpath, flags); + if(result) { + if(match_table[expri].xslt_sheet_uri) { + grddl_xml_context* xml_context; + + /* Ignore what matched, use a hardcoded XSLT URI */ + uri_string = match_table[expri].xslt_sheet_uri; + RAPTOR_DEBUG3("Parser %p: Using hard-coded XSLT URI '%s'\n", + RAPTOR_VOIDP(rdf_parser), uri_string); + + raptor_free_sequence(result); + result = raptor_new_sequence((raptor_data_free_handler)grddl_free_xml_context, NULL); + + uri = raptor_new_uri_relative_to_base(rdf_parser->world, + rdf_parser->base_uri, uri_string); + + xml_context = raptor_new_xml_context(rdf_parser->world, uri, + rdf_parser->base_uri); + raptor_sequence_push(result, xml_context); + + raptor_free_uri(uri); + } + + while(raptor_sequence_size(result)) { + grddl_xml_context* xml_context; + + xml_context = (grddl_xml_context*)raptor_sequence_unshift(result); + if(!xml_context) + break; + + raptor_grddl_add_transform_xml_context(grddl_parser, xml_context); + } + raptor_free_sequence(result); + + if(flags & MATCH_LAST) + break; + } + + + if(rdf_parser->failed) + break; + + } /* end XPath expression loop */ + + if(rdf_parser->failed) { + ret = 1; + goto tidy; + } + + + /* Process this document's content buffer as RDF/XML */ + if(grddl_parser->process_this_as_rdfxml && buffer) { + RAPTOR_DEBUG3("Parser %p: Running additional RDF/XML parse on root document URI '%s' content\n", + RAPTOR_VOIDP(rdf_parser), + raptor_uri_as_string(rdf_parser->base_uri)); + + if(raptor_grddl_ensure_internal_parser(rdf_parser, "rdfxml", 0)) + ret = 1; + else { + if(raptor_parser_parse_start(grddl_parser->internal_parser, + rdf_parser->base_uri)) + ret = 1; + else { + ret = raptor_parser_parse_chunk(grddl_parser->internal_parser, buffer, + buffer_len, 1); + } + } + + } + + + /* Apply all transformation URIs seen */ + transform: + while(raptor_sequence_size(grddl_parser->doc_transform_uris)) { + grddl_xml_context* xml_context; + + xml_context = (grddl_xml_context*)raptor_sequence_unshift(grddl_parser->doc_transform_uris); + ret = raptor_grddl_run_grddl_transform_uri(rdf_parser, xml_context, doc); + grddl_free_xml_context(xml_context); + if(ret) + break; + } + + if(rdf_parser->emitted_default_graph) { + /* May or may not have generated statements but we must close the + * start default graph mark above + */ + raptor_parser_end_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph--; + } + + + tidy: + if(buffer) { + if(buffer_is_libxml) + xmlFree((xmlChar*)buffer); + else + RAPTOR_FREE(char*, buffer); + } + + if(grddl_parser->sb) { + raptor_free_stringbuffer(grddl_parser->sb); + grddl_parser->sb = NULL; + } + + if(grddl_parser->xml_ctxt) { + if(grddl_parser->xml_ctxt->myDoc) { + xmlFreeDoc(grddl_parser->xml_ctxt->myDoc); + grddl_parser->xml_ctxt->myDoc = NULL; + } + xmlFreeParserCtxt(grddl_parser->xml_ctxt); + grddl_parser->xml_ctxt = NULL; + } + if(grddl_parser->html_ctxt) { + if(grddl_parser->html_ctxt->myDoc) { + xmlFreeDoc(grddl_parser->html_ctxt->myDoc); + grddl_parser->html_ctxt->myDoc = NULL; + } + xmlFreeParserCtxt(grddl_parser->html_ctxt); + grddl_parser->html_ctxt = NULL; + } + + if(grddl_parser->xpathCtx) { + xmlXPathFreeContext(grddl_parser->xpathCtx); + grddl_parser->xpathCtx = NULL; + } + + return (ret != 0); +} + + +static int +raptor_grddl_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score = 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "xhtml")) + score = 4; + if(!strcmp((const char*)suffix, "html")) + score = 2; + } else if(identifier) { + if(strstr((const char*)identifier, "xhtml")) + score = 4; + } + + return score; +} + + +static void +raptor_grddl_parse_content_type_handler(raptor_parser* rdf_parser, + const char* content_type) +{ + raptor_grddl_parser_context* grddl_parser; + + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + if(content_type) { + size_t len = strlen(content_type) + 1; + if(grddl_parser->content_type) + RAPTOR_FREE(char*, grddl_parser->content_type); + + grddl_parser->content_type = RAPTOR_MALLOC(char*, len + 1); + memcpy(grddl_parser->content_type, content_type, len + 1); + } +} + + + +static const char* const grddl_names[2] = { "grddl", NULL }; + +#define GRDDL_TYPES_COUNT 2 +static const raptor_type_q grddl_types[GRDDL_TYPES_COUNT + 1] = { + { "text/html", 9, 2}, + { "application/xhtml+xml", 21, 4}, + { NULL, 0, 0} +}; + +static int +raptor_grddl_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = grddl_names; + + factory->desc.mime_types = grddl_types; + + factory->desc.label = "Gleaning Resource Descriptions from Dialects of Languages"; + factory->desc.uri_strings = NULL; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_grddl_parser_context); + + factory->init = raptor_grddl_parse_init; + factory->terminate = raptor_grddl_parse_terminate; + factory->start = raptor_grddl_parse_start; + factory->chunk = raptor_grddl_parse_chunk; + factory->recognise_syntax = raptor_grddl_parse_recognise_syntax; + factory->content_type_handler= raptor_grddl_parse_content_type_handler; + + return rc; +} + + +int +raptor_init_parser_grddl_common(raptor_world* world) +{ +#ifdef HAVE_XSLTINIT + xsltInit(); +#endif + + if(!world->xslt_security_preferences && + !world->xslt_security_preferences_policy) { + xsltSecurityPrefsPtr raptor_xslt_sec = NULL; + + raptor_xslt_sec = xsltNewSecurityPrefs(); + + /* no read from file (read from URI with scheme = file) */ + xsltSetSecurityPrefs(raptor_xslt_sec, XSLT_SECPREF_READ_FILE, + xsltSecurityForbid); + + /* no create/write to file */ + xsltSetSecurityPrefs(raptor_xslt_sec, XSLT_SECPREF_WRITE_FILE, + xsltSecurityForbid); + + /* no create directory */ + xsltSetSecurityPrefs(raptor_xslt_sec, XSLT_SECPREF_CREATE_DIRECTORY, + xsltSecurityForbid); + + /* yes read from URI with scheme != file (XSLT_SECPREF_READ_NETWORK) */ + + /* no write to network (you can 'write' with GET params anyway) */ + xsltSetSecurityPrefs(raptor_xslt_sec, XSLT_SECPREF_WRITE_NETWORK, + xsltSecurityForbid); + + world->xslt_security_preferences = (void*)raptor_xslt_sec; + } + + return 0; +} + + +int +raptor_init_parser_grddl(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_grddl_parser_register_factory); +} + + +void +raptor_terminate_parser_grddl_common(raptor_world *world) +{ + if(world->xslt_security_preferences && + !world->xslt_security_preferences_policy) { + + /* Free the security preferences object owned by raptor world */ + xsltFreeSecurityPrefs((xsltSecurityPrefsPtr)world->xslt_security_preferences); + world->xslt_security_preferences = NULL; + } + + xsltCleanupGlobals(); +} + + + +/* + * Save libxslt global state that needs overwriting. + * + * Initialise the global state with raptor GRDDL parser values. + * + * Restored by raptor_libxslt_reset_global_state() + */ +static void +raptor_libxslt_set_global_state(raptor_parser *rdf_parser) +{ + raptor_grddl_parser_context* grddl_parser; + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + /* save global (libxslt-wide) generic error handler */ + grddl_parser->saved_xsltGenericError = xsltGenericError; + grddl_parser->saved_xsltGenericErrorContext = xsltGenericErrorContext; + + /* set global (libxslt-wide) generic error handler to raptor GRDDL parser */ + xsltSetGenericErrorFunc(rdf_parser, + raptor_grddl_xsltGenericError_handler); + + /* save global (libxslt-wide) default security prefs */ + grddl_parser->saved_xsltSecurityPrefs = xsltGetDefaultSecurityPrefs(); + + if(grddl_parser->world->xslt_security_preferences && + !grddl_parser->world->xslt_security_preferences_policy) { + /* set global (libxslt-wide) security preferences to raptor */ + xsltSetDefaultSecurityPrefs((xsltSecurityPrefs*)grddl_parser->world->xslt_security_preferences); + } +} + + +/* + * Restore libxslt global state that raptor_libxslt_set_global_state() + * overwrote back to the original values. + * + */ +static void +raptor_libxslt_reset_global_state(raptor_parser* rdf_parser) +{ + raptor_grddl_parser_context* grddl_parser; + grddl_parser = (raptor_grddl_parser_context*)rdf_parser->context; + + /* restore global (libxslt-wide) default security prefs */ + xsltSetDefaultSecurityPrefs(grddl_parser->saved_xsltSecurityPrefs); + + /* restore global (libxslt-wide) generic error handler */ + xsltSetGenericErrorFunc(grddl_parser->saved_xsltGenericErrorContext, + grddl_parser->saved_xsltGenericError); +} + diff --git a/src/raptor_guess.c b/src/raptor_guess.c new file mode 100644 index 0000000..0417f0f --- /dev/null +++ b/src/raptor_guess.c @@ -0,0 +1,263 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_guess.c - Raptor guessing real parser implementation + * + * Copyright (C) 2005-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * guess parser object + */ +struct raptor_guess_parser_context_s { + /* content type got from URI request */ + char* content_type; + + /* URI from start_parse */ + raptor_uri* uri; + + /* Non-0 when we need to guess */ + int do_guess; + + /* Actual parser to use */ + raptor_parser* parser; +}; + + +typedef struct raptor_guess_parser_context_s raptor_guess_parser_context; + + +static int +raptor_guess_parse_init(raptor_parser* rdf_parser, const char *name) +{ + raptor_guess_parser_context *guess_parser = (raptor_guess_parser_context*)rdf_parser->context; + guess_parser->content_type = NULL; + + guess_parser->do_guess = 1; + + return 0; +} + + +static void +raptor_guess_parse_terminate(raptor_parser *rdf_parser) +{ + raptor_guess_parser_context *guess_parser = (raptor_guess_parser_context*)rdf_parser->context; + + if(guess_parser->content_type) + RAPTOR_FREE(char*, guess_parser->content_type); + + if(guess_parser->parser) + raptor_free_parser(guess_parser->parser); +} + + +static void +raptor_guess_parse_content_type_handler(raptor_parser* rdf_parser, + const char* content_type) +{ + raptor_guess_parser_context* guess_parser = (raptor_guess_parser_context*)rdf_parser->context; + + if(content_type) { + const char *p; + size_t len; + + if((p = strchr(content_type,';'))) + len = p-content_type; + else + len = strlen(content_type); + + guess_parser->content_type = RAPTOR_MALLOC(char*, len + 1); + memcpy(guess_parser->content_type, content_type, len); + guess_parser->content_type[len]='\0'; + + RAPTOR_DEBUG2("Got content type '%s'\n", guess_parser->content_type); + } +} + + +static int +raptor_guess_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *buffer, size_t len, + int is_end) +{ + raptor_guess_parser_context* guess_parser = (raptor_guess_parser_context*)rdf_parser->context; + + if(guess_parser->do_guess) { + const unsigned char *identifier = NULL; + const char *name; + + guess_parser->do_guess = 0; + + if(rdf_parser->base_uri) + identifier = raptor_uri_as_string(rdf_parser->base_uri); + + name = raptor_world_guess_parser_name(rdf_parser->world, + NULL, guess_parser->content_type, + buffer, len, identifier); + if(!name) { + raptor_parser_error(rdf_parser, + "Failed to guess parser from content type '%s'", + guess_parser->content_type ? + guess_parser->content_type : "(none)"); + raptor_parser_parse_abort(rdf_parser); + if(guess_parser->parser) { + raptor_free_parser(guess_parser->parser); + guess_parser->parser = NULL; + } + return 1; + } else { + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Guessed parser name '%s'\n", name); +#endif + + /* If there is an existing guessed parser factory present and + * it's different from the wanted parser, free it + */ + if(guess_parser->parser) { + raptor_parser_factory* factory = raptor_world_get_parser_factory(rdf_parser->world, name); + + if(guess_parser->parser->factory != factory) { + raptor_free_parser(guess_parser->parser); + guess_parser->parser = NULL; + } + } + + if(!guess_parser->parser) { + guess_parser->parser = raptor_new_parser(rdf_parser->world, name); + if(!guess_parser->parser) + return 1; + } + + /* copy any user data to the grddl parser */ + if(raptor_parser_copy_user_state(guess_parser->parser, rdf_parser)) + return 1; + + if(raptor_parser_parse_start(guess_parser->parser, rdf_parser->base_uri)) + return 1; + } + } + + + /* now we can pass on calls to internal guess_parser */ + return raptor_parser_parse_chunk(guess_parser->parser, buffer, len, is_end); +} + + +static const char* +raptor_guess_accept_header(raptor_parser* rdf_parser) +{ + return raptor_parser_get_accept_header_all(rdf_parser->world); +} + + +static const char* +raptor_guess_guess_get_name(raptor_parser* rdf_parser) +{ + raptor_guess_parser_context *guess_parser; + guess_parser = (raptor_guess_parser_context*)rdf_parser->context; + + if(guess_parser) + return raptor_parser_get_name(guess_parser->parser); + else + return rdf_parser->factory->desc.names[0]; +} + + +static const raptor_syntax_description* +raptor_guess_guess_get_description(raptor_parser* rdf_parser) +{ + raptor_guess_parser_context *guess_parser; + guess_parser = (raptor_guess_parser_context*)rdf_parser->context; + + if(guess_parser && guess_parser->parser) + return raptor_parser_get_description(guess_parser->parser); + else + return &rdf_parser->factory->desc; +} + + +static raptor_locator * +raptor_guess_guess_get_locator(raptor_parser *rdf_parser) +{ + raptor_guess_parser_context *guess_parser; + guess_parser = (raptor_guess_parser_context*)rdf_parser->context; + + if(guess_parser && guess_parser->parser) + return raptor_parser_get_locator(guess_parser->parser); + else + return &rdf_parser->locator; +} + + +static const char* const guess_names[2] = { "guess", NULL }; + +static int +raptor_guess_parser_register_factory(raptor_parser_factory *factory) +{ + factory->desc.names = guess_names; + + factory->desc.mime_types = NULL; + + factory->desc.label = "Pick the parser to use using content type and URI"; + factory->desc.uri_strings = NULL; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_guess_parser_context); + + factory->init = raptor_guess_parse_init; + factory->terminate = raptor_guess_parse_terminate; + factory->chunk = raptor_guess_parse_chunk; + factory->content_type_handler = raptor_guess_parse_content_type_handler; + factory->accept_header = raptor_guess_accept_header; + factory->get_name = raptor_guess_guess_get_name; + factory->get_description = raptor_guess_guess_get_description; + factory->get_locator = raptor_guess_guess_get_locator; + + return 0; +} + + +int +raptor_init_parser_guess(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_guess_parser_register_factory); +} diff --git a/src/raptor_internal.h b/src/raptor_internal.h new file mode 100644 index 0000000..e6f98e9 --- /dev/null +++ b/src/raptor_internal.h @@ -0,0 +1,1528 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_internal.h - Redland Parser Toolkit for RDF (Raptor) internals + * + * Copyright (C) 2002-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2002-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + + +#ifndef RAPTOR_INTERNAL_H +#define RAPTOR_INTERNAL_H + +#ifdef __cplusplus +extern "C" { +#define RAPTOR_EXTERN_C extern "C" +#else +#define RAPTOR_EXTERN_C +#endif + +#ifdef RAPTOR_INTERNAL + +/* for the memory allocation functions */ +#ifdef HAVE_STDLIB_H +#include +#undef HAVE_STDLIB_H +#endif + +/* Some internal functions are needed by the test programs */ +#ifndef RAPTOR_INTERNAL_API +#define RAPTOR_INTERNAL_API RAPTOR_API +#endif + +/* Can be over-ridden or undefined in a config.h file or -Ddefine */ +#ifndef RAPTOR_INLINE +#define RAPTOR_INLINE inline +#endif + +#ifdef LIBRDF_DEBUG +#define RAPTOR_DEBUG 1 +#endif + +#if defined(RAPTOR_MEMORY_SIGN) +#define RAPTOR_SIGN_KEY 0x08A61080 +void* raptor_sign_malloc(size_t size); +void* raptor_sign_calloc(size_t nmemb, size_t size); +void* raptor_sign_realloc(void *ptr, size_t size); +void raptor_sign_free(void *ptr); + +#define RAPTOR_MALLOC(type, size) (type)raptor_sign_malloc(size) +#define RAPTOR_CALLOC(type, nmemb, size) (type)raptor_sign_calloc(nmemb, size) +#define RAPTOR_REALLOC(type, ptr, size) (type)raptor_sign_realloc(ptr, size) +#define RAPTOR_FREE(type, ptr) raptor_sign_free((void*)ptr) + +#else +#define RAPTOR_MALLOC(type, size) (type)malloc(size) +#define RAPTOR_CALLOC(type, nmemb, size) (type)calloc(nmemb, size) +#define RAPTOR_REALLOC(type, ptr, size) (type)realloc(ptr, size) +#define RAPTOR_FREE(type, ptr) free((void*)ptr) + +#endif + +#ifdef HAVE___FUNCTION__ +#else +#define __FUNCTION__ "???" +#endif + +#ifndef RAPTOR_DEBUG_FH +#define RAPTOR_DEBUG_FH stderr +#endif + +#ifdef RAPTOR_DEBUG +/* Debugging messages */ +#define RAPTOR_DEBUG1(msg) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: " msg, __FILE__, __LINE__, __FUNCTION__); } while(0) +#define RAPTOR_DEBUG2(msg, arg1) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: " msg, __FILE__, __LINE__, __FUNCTION__, arg1);} while(0) +#define RAPTOR_DEBUG3(msg, arg1, arg2) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: " msg, __FILE__, __LINE__, __FUNCTION__, arg1, arg2);} while(0) +#define RAPTOR_DEBUG4(msg, arg1, arg2, arg3) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: " msg, __FILE__, __LINE__, __FUNCTION__, arg1, arg2, arg3);} while(0) +#define RAPTOR_DEBUG5(msg, arg1, arg2, arg3, arg4) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: " msg, __FILE__, __LINE__, __FUNCTION__, arg1, arg2, arg3, arg4);} while(0) +#define RAPTOR_DEBUG6(msg, arg1, arg2, arg3, arg4, arg5) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: " msg, __FILE__, __LINE__, __FUNCTION__, arg1, arg2, arg3, arg4, arg5);} while(0) + +#ifndef RAPTOR_ASSERT_DIE +#define RAPTOR_ASSERT_DIE(x) abort(); +#endif + +#else +/* DEBUGGING TURNED OFF */ + +/* No debugging messages */ +#define RAPTOR_DEBUG1(msg) +#define RAPTOR_DEBUG2(msg, arg1) +#define RAPTOR_DEBUG3(msg, arg1, arg2) +#define RAPTOR_DEBUG4(msg, arg1, arg2, arg3) +#define RAPTOR_DEBUG5(msg, arg1, arg2, arg3, arg4) +#define RAPTOR_DEBUG6(msg, arg1, arg2, arg3, arg4, arg5) + +#define SYSTEM_MALLOC(size) malloc(size) +#define SYSTEM_FREE(ptr) free(ptr) + +#ifndef RAPTOR_ASSERT_DIE +#define RAPTOR_ASSERT_DIE(x) x; +#endif + +#endif + + +#ifdef RAPTOR_DISABLE_ASSERT_MESSAGES +#define RAPTOR_ASSERT_REPORT(line) +#else +#define RAPTOR_ASSERT_REPORT(msg) fprintf(RAPTOR_DEBUG_FH, "%s:%d: (%s) assertion failed: " msg "\n", __FILE__, __LINE__, __FUNCTION__); +#endif + + +#ifdef RAPTOR_DISABLE_ASSERT + +#define RAPTOR_ASSERT(condition, msg) +#define RAPTOR_ASSERT_RETURN(condition, msg, ret) +#define RAPTOR_ASSERT_OBJECT_POINTER_RETURN(pointer, type) do { \ + if(!pointer) \ + return; \ +} while(0) +#define RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(pointer, type, ret) + +#else + +#define RAPTOR_ASSERT(condition, msg) do { \ + if(condition) { \ + RAPTOR_ASSERT_REPORT(msg) \ + RAPTOR_ASSERT_DIE(return) \ + } \ +} while(0) + +#define RAPTOR_ASSERT_RETURN(condition, msg, ret) do { \ + if(condition) { \ + RAPTOR_ASSERT_REPORT(msg) \ + RAPTOR_ASSERT_DIE(return ret) \ + } \ +} while(0) + +#define RAPTOR_ASSERT_OBJECT_POINTER_RETURN(pointer, type) do { \ + if(!pointer) { \ + RAPTOR_ASSERT_REPORT("object pointer of type " #type " is NULL.") \ + RAPTOR_ASSERT_DIE(return) \ + } \ +} while(0) + +#define RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(pointer, type, ret) do { \ + if(!pointer) { \ + RAPTOR_ASSERT_REPORT("object pointer of type " #type " is NULL.") \ + RAPTOR_ASSERT_DIE(return ret) \ + } \ +} while(0) + +#endif + +/* _Pragma() is C99 and is the only way to include pragmas since you + * cannot use #pragma in a macro + * + * #if defined __STDC_VERSION__ && (__STDC_VERSION__ >= 199901L) + * + * Valid for clang or GCC >= 4.9.0 + */ +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((4) << 16) + (9))) +#define PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wformat-nonliteral\"") +#define PRAGMA_IGNORE_WARNING_LONG_LONG_START \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wlong-long\"") +#define PRAGMA_IGNORE_WARNING_END \ + _Pragma ("GCC diagnostic pop") +#else +#define PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START +#define PRAGMA_IGNORE_WARNING_LONG_LONG_STAR +#define PRAGMA_IGNORE_WARNING_END +#endif + + +/* Fatal errors - always happen */ +#define RAPTOR_FATAL1(msg) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: fatal error: " msg, __FILE__, __LINE__ , __FUNCTION__); abort();} while(0) +#define RAPTOR_FATAL2(msg,arg) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: fatal error: " msg, __FILE__, __LINE__ , __FUNCTION__, arg); abort();} while(0) +#define RAPTOR_FATAL3(msg,arg1,arg2) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: fatal error: " msg, __FILE__, __LINE__ , __FUNCTION__, arg1, arg2); abort();} while(0) +#define RAPTOR_FATAL4(msg,arg1,arg2,arg3) do {fprintf(RAPTOR_DEBUG_FH, "%s:%d:%s: fatal error: " msg, __FILE__, __LINE__ , __FUNCTION__, arg1, arg2, arg3); abort();} while(0) + +#define MAX_ASCII_INT_SIZE 13 + +/* XML parser includes */ + +#ifdef RAPTOR_XML_LIBXML + +/* newer ICU (via libxml/encoding.h) requires C++ context */ +#ifdef __cplusplus +extern "C++" { +#endif +#include +#ifdef __cplusplus +} +#endif + +/* libxml-only prototypes */ + + +/* raptor_libxml.c exports */ +extern void raptor_libxml_sax_init(raptor_sax2* sax2); +extern void raptor_libxml_generic_error(void* user_data, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +extern int raptor_libxml_init(raptor_world* world); +extern void raptor_libxml_finish(raptor_world* world); + +extern void raptor_libxml_validation_error(void *context, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 3); +extern void raptor_libxml_validation_warning(void *context, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 3); +void raptor_libxml_free(xmlParserCtxtPtr xc); + +/* raptor_parse.c - exported to libxml part */ +extern void raptor_libxml_update_document_locator(raptor_sax2* sax2, raptor_locator* locator); + +/* end of libxml-only */ +#endif + + +typedef struct raptor_parser_factory_s raptor_parser_factory; +typedef struct raptor_serializer_factory_s raptor_serializer_factory; +typedef struct raptor_id_set_s raptor_id_set; +typedef struct raptor_uri_detail_s raptor_uri_detail; + + +/* raptor_option.c */ + +/* These are bits and may be bit-ORed */ +/** + * raptor_option_area: + * @RAPTOR_OPTION_AREA_NONE: internal + * @RAPTOR_OPTION_AREA_PARSER: #raptor_parser (public) + * @RAPTOR_OPTION_AREA_SERIALIZER: #raptor_serializer (public) + * @RAPTOR_OPTION_AREA_XML_WRITER: #raptor_xml_writer (public) + * @RAPTOR_OPTION_AREA_TURTLE_WRITER: #raptor_turtle_writer (internal) + * @RAPTOR_OPTION_AREA_SAX2: #raptor_sax2 (public) + * + * Internal - raptor option areas +*/ +typedef enum { + RAPTOR_OPTION_AREA_NONE = 0, + RAPTOR_OPTION_AREA_PARSER = 1, + RAPTOR_OPTION_AREA_SERIALIZER = 2, + RAPTOR_OPTION_AREA_XML_WRITER = 4, + RAPTOR_OPTION_AREA_TURTLE_WRITER = 8, + RAPTOR_OPTION_AREA_SAX2 = 16 +} raptor_option_area; + +typedef union +{ + char* string; + int integer; +} raptor_str_int; + +typedef struct +{ + raptor_option_area area; + raptor_str_int options[RAPTOR_OPTION_LAST+1]; +} raptor_object_options; + + +#define RAPTOR_OPTIONS_GET_NUMERIC(object, option) \ + ((object)->options.options[(int)option].integer) +#define RAPTOR_OPTIONS_GET_STRING(object, option) \ + ((object)->options.options[(int)option].string) + +#define RAPTOR_OPTIONS_SET_NUMERIC(object, option, value) do { \ + (object)->options.options[(int)option].integer = value; \ +} while(0) +#define RAPTOR_OPTIONS_SET_STRING(object, option, value) do { \ + (object)->options.options[(int)option].string = value; \ +} while(0) + +int raptor_option_value_is_numeric(const raptor_option option); +int raptor_option_is_valid_for_area(const raptor_option option, raptor_option_area area); + +void raptor_object_options_init(raptor_object_options* options, raptor_option_area area); +void raptor_object_options_clear(raptor_object_options* options); +int raptor_object_options_copy_state(raptor_object_options* to, raptor_object_options* from); +int raptor_object_options_get_option(raptor_object_options *options, raptor_option option, char** string_p, int* integer_p); +int raptor_object_options_set_option(raptor_object_options *options, raptor_option option, const char* string, int integer); + + + + +/* raptor_concepts.c */ + +/* + * raptor_rdf_ns_term_id: + * + * RDF namespace syntax terms, properties and classes. + * + * The order must match names in the raptor_rdf_ns_terms_info table + * + */ +typedef enum { + /* These terms are used only in the RDF/XML syntax; never in RDF graph */ + RDF_NS_RDF = 0, + RDF_NS_Description = 1, + RDF_NS_li = 2, + RDF_NS_about = 3, + RDF_NS_aboutEach = 4, + RDF_NS_aboutEachPrefix = 5, + RDF_NS_ID = 6, + RDF_NS_bagID = 7, + RDF_NS_resource = 8, + RDF_NS_parseType = 9, + RDF_NS_nodeID = 10, + RDF_NS_datatype = 11, + /* These terms are all properties in RDF model (of type rdf:Property) */ + RDF_NS_type = 12, + RDF_NS_value = 13, + RDF_NS_subject = 14, + RDF_NS_predicate = 15, + RDF_NS_object = 16, + RDF_NS_first = 17, + RDF_NS_rest = 18, + /* These terms are all classes in the RDF model (of type rdfs:Class) */ + RDF_NS_Seq = 19, + RDF_NS_Bag = 20, + RDF_NS_Alt = 21, + RDF_NS_Statement = 22, + RDF_NS_Property = 23, + RDF_NS_List = 24, + /* These terms are all resources in the RDF model (of type rdfs:Resource) */ + RDF_NS_nil = 25, + + /* These terms are datatypes (used as a literal datatype URI) */ + RDF_NS_XMLLiteral = 26, + RDF_NS_PlainLiteral = 27, /* http://www.w3.org/TR/rdf-text/ */ + /* RDF 1.1 datatypes */ + RDF_NS_HTML = 28, + RDF_NS_langString = 29, + + /* These terms are internal */ + RDF_NS_LAST_SYNTAX_TERM = RDF_NS_datatype, + + RDF_NS_LAST = RDF_NS_langString +} raptor_rdf_ns_term_id; + + +typedef struct { + /* term name */ + const char *name; + + /* RDF/XML: the statement object type of this when used as an attribute */ + raptor_term_type type; + + /* RDF/XML: name restrictions */ + unsigned int allowed_as_nodeElement : 1; + unsigned int allowed_as_propertyElement : 1; + unsigned int allowed_as_propertyAttribute : 1; + unsigned int allowed_unprefixed_on_attribute : 1; +} raptor_rdf_ns_term_info; + + +extern const raptor_rdf_ns_term_info raptor_rdf_ns_terms_info[(RDF_NS_LAST + 1) + 1]; + +#define RAPTOR_RDF_RDF_URI(world) world->concepts[RDF_NS_RDF] +#define RAPTOR_RDF_Description_URI(world) world->concepts[RDF_NS_Description] +#define RAPTOR_RDF_li_URI(world) world->concepts[RDF_NS_li] +#define RAPTOR_RDF_about(world) world->concepts[RDF_NS_about] +#define RAPTOR_RDF_aboutEach(world) world->concepts[RDF_NS_aboutEach] +#define RAPTOR_RDF_aboutEachPrefix(world) world->concepts[RDF_NS_aboutEachPrefix] +#define RAPTOR_RDF_ID_URI(world) world->concepts[RDF_NS_ID] +#define RAPTOR_RDF_bagID_URI(world) world->concepts[RDF_NS_bagID] +#define RAPTOR_RDF_resource_URI(world) world->concepts[RDF_NS_resource] +#define RAPTOR_RDF_parseType_URI(world) world->concepts[RDF_NS_parseType] +#define RAPTOR_RDF_nodeID_URI(world) world->concepts[RDF_NS_nodeID] +#define RAPTOR_RDF_datatype_URI(world) world->concepts[RDF_NS_datatype] + +#define RAPTOR_RDF_type_URI(world) world->concepts[RDF_NS_type] +#define RAPTOR_RDF_value_URI(world) world->concepts[RDF_NS_value] +#define RAPTOR_RDF_subject_URI(world) world->concepts[RDF_NS_subject] +#define RAPTOR_RDF_predicate_URI(world) world->concepts[RDF_NS_predicate] +#define RAPTOR_RDF_object_URI(world) world->concepts[RDF_NS_object] +#define RAPTOR_RDF_first_URI(world) world->concepts[RDF_NS_first] +#define RAPTOR_RDF_rest_URI(world) world->concepts[RDF_NS_rest] + +#define RAPTOR_RDF_Seq_URI(world) world->concepts[RDF_NS_Seq] +#define RAPTOR_RDF_Bag_URI(world) world->concepts[RDF_NS_Bag] +#define RAPTOR_RDF_Alt_URI(world) world->concepts[RDF_NS_Alt] +#define RAPTOR_RDF_Statement_URI(world) world->concepts[RDF_NS_Statement] +#define RAPTOR_RDF_Property_URI(world) world->concepts[RDF_NS_Property] +#define RAPTOR_RDF_List_URI(world) world->concepts[RDF_NS_List] + +#define RAPTOR_RDF_nil_URI(world) world->concepts[RDF_NS_nil] +#define RAPTOR_RDF_XMLLiteral_URI(world) world->concepts[RDF_NS_XMLLiteral] +#define RAPTOR_RDF_PlainLiteral_URI(world) world->concepts[RDF_NS_PlainLiteral] + + +/* syntax only (RDF:RDF ... RDF:datatype) are not provided as terms */ + +#define RAPTOR_RDF_type_term(world) world->terms[RDF_NS_type] +#define RAPTOR_RDF_value_term(world) world->terms[RDF_NS_value] +#define RAPTOR_RDF_subject_term(world) world->terms[RDF_NS_subject] +#define RAPTOR_RDF_predicate_term(world) world->terms[RDF_NS_predicate] +#define RAPTOR_RDF_object_term(world) world->terms[RDF_NS_object] +#define RAPTOR_RDF_first_term(world) world->terms[RDF_NS_first] +#define RAPTOR_RDF_rest_term(world) world->terms[RDF_NS_rest] + +#define RAPTOR_RDF_Seq_term(world) world->terms[RDF_NS_Seq] +#define RAPTOR_RDF_Bag_term(world) world->terms[RDF_NS_Bag] +#define RAPTOR_RDF_Alt_term(world) world->terms[RDF_NS_Alt] +#define RAPTOR_RDF_Statement_term(world) world->terms[RDF_NS_Statement] +#define RAPTOR_RDF_Property_term(world) world->terms[RDF_NS_Property] +#define RAPTOR_RDF_List_term(world) world->terms[RDF_NS_List] + +#define RAPTOR_RDF_nil_term(world) world->terms[RDF_NS_nil] +#define RAPTOR_RDF_XMLLiteral_term(world) world->terms[RDF_NS_XMLLiteral] +#define RAPTOR_RDF_PlainLiteral_term(world) world->terms[RDF_NS_PlainLiteral] + + +int raptor_concepts_init(raptor_world* world); +void raptor_concepts_finish(raptor_world* world); + + + +/* raptor_iostream.c */ +raptor_world* raptor_iostream_get_world(raptor_iostream *iostr); + + +/* Raptor Namespace Stack node */ +struct raptor_namespace_stack_s { + raptor_world* world; + int size; + + int table_size; + raptor_namespace** table; + raptor_namespace* def_namespace; + + raptor_uri *rdf_ms_uri; + raptor_uri *rdf_schema_uri; +}; + + +/* Forms: + * 1) prefix=NULL uri= - default namespace defined + * 2) prefix=NULL, uri=NULL - no default namespace + * 3) prefix=, uri= - regular pair defined : + */ +struct raptor_namespace_s { + /* next down the stack, NULL at bottom */ + struct raptor_namespace_s* next; + + raptor_namespace_stack *nstack; + + /* NULL means is the default namespace */ + const unsigned char *prefix; + /* needed to safely compare prefixed-names */ + unsigned int prefix_length; + /* URI of namespace or NULL for default */ + raptor_uri *uri; + /* parsing depth that this ns was added. It will + * be deleted when the parser leaves this depth + */ + int depth; + /* Non 0 if is xml: prefixed name */ + int is_xml; + /* Non 0 if is RDF M&S Namespace */ + int is_rdf_ms; + /* Non 0 if is RDF Schema Namespace */ + int is_rdf_schema; +}; + +raptor_namespace** raptor_namespace_stack_to_array(raptor_namespace_stack *nstack, size_t *size_p); + +#ifdef RAPTOR_XML_LIBXML +#define RAPTOR_LIBXML_MAGIC 0x8AF108 +#endif + + +/* Size of buffer to use when reading from a file */ +#if defined(BUFSIZ) && BUFSIZ > 4096 +#define RAPTOR_READ_BUFFER_SIZE BUFSIZ +#else +#define RAPTOR_READ_BUFFER_SIZE 4096 +#endif + + +/* + * Raptor parser object + */ +struct raptor_parser_s { + raptor_world* world; + +#ifdef RAPTOR_XML_LIBXML + int magic; +#endif + + /* can be filled with error location information */ + raptor_locator locator; + + /* non-0 if parser had fatal error and cannot continue */ + unsigned int failed : 1; + + /* non-0 to enable emitting graph marks (default set). Intended + * for use by GRDDL the parser on it's child parsers to prevent + * multiple start/end marks on the default graph. + */ + unsigned int emit_graph_marks : 1; + + /* non-0 if have emitted start default graph mark */ + unsigned int emitted_default_graph : 1; + + /* generated ID counter */ + int genid; + + /* base URI of RDF/XML */ + raptor_uri *base_uri; + + /* static statement for use in passing to user code */ + raptor_statement statement; + + /* Options (per-object) */ + raptor_object_options options; + + /* stuff for our user */ + void *user_data; + + /* parser callbacks */ + raptor_statement_handler statement_handler; + + raptor_graph_mark_handler graph_mark_handler; + + void* uri_filter_user_data; + raptor_uri_filter_func uri_filter; + + /* parser specific stuff */ + void *context; + + struct raptor_parser_factory_s* factory; + + /* namespace callback */ + raptor_namespace_handler namespace_handler; + + void* namespace_handler_user_data; + + raptor_stringbuffer* sb; + + /* raptor_www pointer stored here to allow cleanup on error */ + raptor_www* www; + + /* internal data for lexers */ + void* lexer_user_data; + + /* internal read buffer */ + unsigned char buffer[RAPTOR_READ_BUFFER_SIZE + 1]; +}; + + +/** A Parser Factory */ +struct raptor_parser_factory_s { + raptor_world* world; + + struct raptor_parser_factory_s* next; + + /* the rest of this structure is populated by the + parser-specific register function */ + + size_t context_length; + + /* static desc that the parser registration initialises */ + raptor_syntax_description desc; + + /* create a new parser */ + int (*init)(raptor_parser* parser, const char *name); + + /* destroy a parser */ + void (*terminate)(raptor_parser* parser); + + /* start a parse */ + int (*start)(raptor_parser* parser); + + /* parse a chunk of memory */ + int (*chunk)(raptor_parser* parser, const unsigned char *buffer, size_t len, int is_end); + + /* finish the parser factory */ + void (*finish_factory)(raptor_parser_factory* factory); + + /* score recognition of the syntax by a block of characters, the + * content identifier or it's suffix or a mime type + * (different from the factory-registered one) + */ + int (*recognise_syntax)(raptor_parser_factory* factory, const unsigned char *buffer, size_t len, const unsigned char *identifier, const unsigned char *suffix, const char *mime_type); + + /* get the Content-Type value of a URI request */ + void (*content_type_handler)(raptor_parser* rdf_parser, const char* content_type); + + /* get the Accept header of a URI request (OPTIONAL) */ + const char* (*accept_header)(raptor_parser* rdf_parser); + + /* get the name (OPTIONAL) */ + const char* (*get_name)(raptor_parser* rdf_parser); + + /* get the description (OPTIONAL) */ + const raptor_syntax_description* (*get_description)(raptor_parser* rdf_parser); + + /* get the current graph (OPTIONAL) - if not implemented, the current graph is always the default (NULL) and start/end graph marks are synthesised */ + raptor_uri* (*get_graph)(raptor_parser* rdf_parser); + + /* get the locator (OPTIONAL) */ + raptor_locator* (*get_locator)(raptor_parser* rdf_parser); +}; + + +/* + * Raptor serializer object + */ +struct raptor_serializer_s { + raptor_world* world; + + /* can be filled with error location information */ + raptor_locator locator; + + /* non 0 if serializer had fatal error and cannot continue */ + int failed; + + /* base URI of RDF/XML */ + raptor_uri *base_uri; + + /* serializer specific stuff */ + void *context; + + /* destination stream for the serialization */ + raptor_iostream *iostream; + + /* if true, iostream was made here so free it */ + int free_iostream_on_end; + + struct raptor_serializer_factory_s* factory; + + /* Options (per-object) */ + raptor_object_options options; +}; + + +/** A Serializer Factory for a syntax */ +struct raptor_serializer_factory_s { + raptor_world* world; + + struct raptor_serializer_factory_s* next; + + /* the rest of this structure is populated by the + serializer-specific register function */ + size_t context_length; + + /* static desc that the parser registration initialises */ + raptor_syntax_description desc; + + /* create a new serializer */ + int (*init)(raptor_serializer* serializer, const char *name); + + /* destroy a serializer */ + void (*terminate)(raptor_serializer* serializer); + + /* add a namespace */ + int (*declare_namespace)(raptor_serializer* serializer, raptor_uri *uri, const unsigned char *prefix); + + /* start a serialization */ + int (*serialize_start)(raptor_serializer* serializer); + + /* serialize a statement */ + int (*serialize_statement)(raptor_serializer* serializer, raptor_statement *statment); + + /* end a serialization */ + int (*serialize_end)(raptor_serializer* serializer); + + /* finish the serializer factory */ + void (*finish_factory)(raptor_serializer_factory* factory); + + /* add a namespace using an existing namespace */ + int (*declare_namespace_from_namespace)(raptor_serializer* serializer, raptor_namespace *nspace); + + /* flush current serialization state */ + int (*serialize_flush)(raptor_serializer* serializer); +}; + + +/* for raptor_parser_parse_uri_write_bytes() when used as a handler for + * raptor_www_set_write_bytes_handler() + */ +typedef struct +{ + raptor_parser* rdf_parser; + raptor_uri* base_uri; + raptor_uri* final_uri; + int started; +} raptor_parse_bytes_context; + + +/* raptor_serialize.c */ +raptor_serializer_factory* raptor_serializer_register_factory(raptor_world* world, int (*factory) (raptor_serializer_factory*)); + + +/* raptor_general.c */ + +raptor_parser_factory* raptor_world_register_parser_factory(raptor_world* world, int (*factory) (raptor_parser_factory*)); +int raptor_parser_factory_add_mime_type(raptor_parser_factory* factory, const char* mime_type, int q); + +unsigned char* raptor_world_internal_generate_id(raptor_world *world, unsigned char *user_bnodeid); + +#ifdef RAPTOR_DEBUG +void raptor_stats_print(raptor_parser *rdf_parser, FILE *stream); +#endif +RAPTOR_INTERNAL_API const char* raptor_basename(const char *name); +int raptor_term_print_as_ntriples(const raptor_term *term, FILE* stream); + +/* raptor_ntriples.c */ +size_t raptor_ntriples_parse_term(raptor_world* world, raptor_locator* locator, unsigned char *string, size_t *len_p, raptor_term** term_p, int allow_turtle); + +/* raptor_parse.c */ +raptor_parser_factory* raptor_world_get_parser_factory(raptor_world* world, const char *name); +void raptor_delete_parser_factories(void); +RAPTOR_INTERNAL_API const char* raptor_parser_get_accept_header_all(raptor_world* world); +int raptor_parser_set_uri_filter_no_net(void *user_data, raptor_uri* uri); +void raptor_parser_parse_uri_write_bytes(raptor_www* www, void *userdata, const void *ptr, size_t size, size_t nmemb); +void raptor_parser_fatal_error(raptor_parser* parser, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); +void raptor_parser_error(raptor_parser* parser, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); +RAPTOR_INTERNAL_API void raptor_parser_log_error(raptor_parser* parser, raptor_log_level level, const char *message, ...) RAPTOR_PRINTF_FORMAT(3, 4); +RAPTOR_INTERNAL_API void raptor_parser_log_error_varargs(raptor_parser* parser, raptor_log_level level, const char *message, va_list arguments) RAPTOR_PRINTF_FORMAT(3, 0); +void raptor_parser_warning(raptor_parser* parser, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +/* logging */ +void raptor_world_internal_set_ignore_errors(raptor_world* world, int flag); +void raptor_log_error_varargs(raptor_world* world, raptor_log_level level, raptor_locator* locator, const char* message, va_list arguments) RAPTOR_PRINTF_FORMAT(4, 0); +RAPTOR_INTERNAL_API void raptor_log_error_formatted(raptor_world* world, raptor_log_level level, raptor_locator* locator, const char* message, ...) RAPTOR_PRINTF_FORMAT(4, 5); +void raptor_log_error(raptor_world* world, raptor_log_level level, raptor_locator* locator, const char* message); + + +/* raptor_parse.c */ + +typedef struct raptor_rdfxml_parser_s raptor_rdfxml_parser; + +/* Prototypes for common libxml parsing event-handling functions */ +extern void raptor_xml_start_element_handler(void *user_data, const unsigned char *name, const unsigned char **atts); +extern void raptor_xml_end_element_handler(void *user_data, const unsigned char *name); +/* s is not 0 terminated. */ +extern void raptor_xml_characters_handler(void *user_data, const unsigned char *s, int len); +extern void raptor_xml_cdata_handler(void *user_data, const unsigned char *s, int len); +void raptor_xml_comment_handler(void *user_data, const unsigned char *s); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 +void raptor_rdfxml_parser_stats_print(raptor_rdfxml_parser* rdf_xml_parser, FILE *stream); +#endif + +void raptor_parser_copy_flags_state(raptor_parser *to_parser, raptor_parser *from_parser); +int raptor_parser_copy_user_state(raptor_parser *to_parser, raptor_parser *from_parser); + +/* raptor_general.c */ +extern int raptor_valid_xml_ID(raptor_parser *rdf_parser, const unsigned char *string); +int raptor_check_ordinal(const unsigned char *name); + +/* raptor_locator.c */ + + +#ifdef HAVE_STRCASECMP +#define raptor_strcasecmp strcasecmp +#define raptor_strncasecmp strncasecmp +#else +#ifdef HAVE_STRICMP +#define raptor_strcasecmp stricmp +#define raptor_strncasecmp strnicmp +#endif +#endif + +/* raptor_nfc_icu.c */ +int raptor_nfc_icu_check (const unsigned char* string, size_t len); + + +/* raptor_namespace.c */ + +#ifdef RAPTOR_DEBUG +void raptor_namespace_print(FILE *stream, raptor_namespace* ns); +#endif + +void raptor_parser_start_namespace(raptor_parser* rdf_parser, raptor_namespace* nspace); + + +/* + * Raptor XML-namespace qualified name (qname), for elements or attributes + * + * namespace is only defined when the XML name has a namespace and + * only then is uri also given. + */ +struct raptor_qname_s { + raptor_world* world; + /* Name - always present */ + const unsigned char *local_name; + int local_name_length; + /* Namespace or NULL if not in a namespace */ + const raptor_namespace *nspace; + /* URI of namespace+local_name or NULL if not defined */ + raptor_uri *uri; + /* optional value - used when name is an attribute */ + const unsigned char *value; + size_t value_length; +}; + + + +/* raptor_qname.c */ +#ifdef RAPTOR_DEBUG +void raptor_qname_print(FILE *stream, raptor_qname* name); +#endif + + +/* raptor_uri.c */ + +int raptor_uri_init(raptor_world* world); +void raptor_uri_finish(raptor_world* world); +raptor_uri* raptor_new_uri_from_rdf_ordinal(raptor_world* world, int ordinal); +size_t raptor_uri_normalize_path(unsigned char* path_buffer, size_t path_len); + +/* parsers */ +int raptor_init_parser_rdfxml(raptor_world* world); +int raptor_init_parser_ntriples(raptor_world* world); +int raptor_init_parser_turtle(raptor_world* world); +int raptor_init_parser_trig(raptor_world* world); +int raptor_init_parser_n3(raptor_world* world); +int raptor_init_parser_grddl_common(raptor_world* world); +int raptor_init_parser_grddl(raptor_world* world); +int raptor_init_parser_guess(raptor_world* world); +int raptor_init_parser_rss(raptor_world* world); +int raptor_init_parser_rdfa(raptor_world* world); +int raptor_init_parser_json(raptor_world* world); +int raptor_init_parser_nquads(raptor_world* world); + +void raptor_terminate_parser_grddl_common(raptor_world *world); + +#ifdef RAPTOR_PARSER_RDFA +#define rdfa_add_item raptor_librdfa_rdfa_add_item +#define rdfa_append_to_list_mapping raptor_librdfa_rdfa_append_to_list_mapping +#define rdfa_canonicalize_string raptor_librdfa_rdfa_canonicalize_string +#define rdfa_complete_current_property_value_triples raptor_librdfa_rdfa_complete_current_property_value_triples +#define rdfa_complete_incomplete_triples raptor_librdfa_rdfa_complete_incomplete_triples +#define rdfa_complete_list_triples raptor_librdfa_rdfa_complete_list_triples +#define rdfa_complete_object_literal_triples raptor_librdfa_rdfa_complete_object_literal_triples +#define rdfa_complete_relrev_triples raptor_librdfa_rdfa_complete_relrev_triples +#define rdfa_complete_type_triples raptor_librdfa_rdfa_complete_type_triples +#define rdfa_copy_list raptor_librdfa_rdfa_copy_list +#define rdfa_copy_mapping raptor_librdfa_rdfa_copy_mapping +#define rdfa_create_bnode raptor_librdfa_rdfa_create_bnode +#define rdfa_create_context raptor_librdfa_rdfa_create_context +#define rdfa_create_list raptor_librdfa_rdfa_create_list +#define rdfa_create_list_mapping raptor_librdfa_rdfa_create_list_mapping +#define rdfa_create_mapping raptor_librdfa_rdfa_create_mapping +#define rdfa_create_new_element_context raptor_librdfa_rdfa_create_new_element_context +#define rdfa_create_triple raptor_librdfa_rdfa_create_triple +#define rdfa_establish_new_1_0_subject raptor_librdfa_rdfa_establish_new_1_0_subject +#define rdfa_establish_new_1_0_subject_with_relrev raptor_librdfa_ablish_new_1_0_subject_with_relrev +#define rdfa_establish_new_1_1_subject raptor_librdfa_ablish_new_1_1_subject +#define rdfa_establish_new_1_1_subject_with_relrev raptor_librdfa_ablish_new_1_1_subject_with_relrev +#define rdfa_establish_new_inlist_triples raptor_librdfa_ablish_new_inlist_triples +#define rdfa_free_context raptor_librdfa_free_context +#define rdfa_free_context_stack raptor_librdfa_free_context_stack +#define rdfa_free_list raptor_librdfa_rdfa_free_list +#define rdfa_free_mapping raptor_librdfa_rdfa_free_mapping +#define rdfa_free_triple raptor_librdfa_rdfa_free_triple +#define rdfa_get_buffer raptor_librdfa_rdfa_get_buffer +#define rdfa_get_curie_type raptor_librdfa_rdfa_get_curie_type +#define rdfa_get_list_mapping raptor_librdfa_rdfa_get_list_mapping +#define rdfa_get_mapping raptor_librdfa_rdfa_get_mapping +#define rdfa_init_base raptor_librdfa_rdfa_init_base +#define rdfa_init_context raptor_librdfa_rdfa_init_context +#define rdfa_iri_get_base raptor_librdfa_rdfa_iri_get_base +#define rdfa_join_string raptor_librdfa_rdfa_join_string +#define rdfa_n_append_string raptor_librdfa_rdfa_n_append_string +#define rdfa_names raptor_librdfa_rdfa_names +#define rdfa_next_mapping raptor_librdfa_rdfa_next_mapping +#define rdfa_parse raptor_librdfa_rdfa_parse +#define rdfa_parse_buffer raptor_librdfa_rdfa_parse_buffer +#define rdfa_parse_chunk raptor_librdfa_rdfa_parse_chunk +#define rdfa_parse_end raptor_librdfa_rdfa_parse_end +#define rdfa_parse_start raptor_librdfa_rdfa_parse_start +#define rdfa_pop_item raptor_librdfa_rdfa_pop_item +#define rdfa_print_list raptor_librdfa_rdfa_print_list +#define rdfa_print_mapping raptor_librdfa_rdfa_print_mapping +#define rdfa_print_string raptor_librdfa_rdfa_print_string +#define rdfa_print_triple raptor_librdfa_rdfa_print_triple +#define rdfa_print_triple_list raptor_librdfa_rdfa_print_triple_list +#define rdfa_push_item raptor_librdfa_rdfa_push_item +#define rdfa_replace_list raptor_librdfa_rdfa_replace_list +#define rdfa_replace_string raptor_librdfa_rdfa_replace_string +#define rdfa_resolve_curie raptor_librdfa_rdfa_resolve_curie +#define rdfa_resolve_curie_list raptor_librdfa_rdfa_resolve_curie_list +#define rdfa_resolve_relrev_curie raptor_librdfa_rdfa_resolve_relrev_curie +#define rdfa_resolve_uri raptor_librdfa_rdfa_resolve_uri +#define rdfa_save_incomplete_list_triples raptor_librdfa_rdfa_save_incomplete_list_triples +#define rdfa_save_incomplete_triples raptor_librdfa_rdfa_save_incomplete_triples +#define rdfa_set_buffer_filler raptor_librdfa_rdfa_set_buffer_filler +#define rdfa_set_default_graph_triple_handler raptor_librdfa_rdfa_set_default_graph_triple_handler +#define rdfa_set_processor_graph_triple_handler raptor_librdfa_rdfa_set_processor_graph_triple_handler +#define rdfa_setup_initial_context raptor_librdfa_rdfa_setup_initial_context +#define rdfa_update_language raptor_librdfa_rdfa_update_language +#define rdfa_update_mapping raptor_librdfa_rdfa_update_mapping +#define rdfa_update_uri_mappings raptor_librdfa_rdfa_update_uri_mappings +#define rdfa_uri_strings raptor_librdfa_rdfa_uri_strings +#endif + +/* raptor_parse.c */ +int raptor_parsers_init(raptor_world* world); +void raptor_parsers_finish(raptor_world *world); + +void raptor_parser_save_content(raptor_parser* rdf_parser, int save); +const unsigned char* raptor_parser_get_content(raptor_parser* rdf_parser, size_t* length_p); +void raptor_parser_start_graph(raptor_parser* parser, raptor_uri* uri, int is_declared); +void raptor_parser_end_graph(raptor_parser* parser, raptor_uri* uri, int is_declared); + +/* raptor_rss.c */ +int raptor_init_serializer_rss10(raptor_world* world); +int raptor_init_serializer_atom(raptor_world* world); + +extern const unsigned char * const raptor_atom_namespace_uri; + +/* raptor_rfc2396.c */ +RAPTOR_INTERNAL_API raptor_uri_detail* raptor_new_uri_detail(const unsigned char *uri_string); +RAPTOR_INTERNAL_API void raptor_free_uri_detail(raptor_uri_detail* uri_detail); +unsigned char* raptor_uri_detail_to_string(raptor_uri_detail *ud, size_t* len_p); + +/* serializers */ +/* raptor_serializer.c */ +int raptor_serializers_init(raptor_world* world); +void raptor_serializers_finish(raptor_world* world); + +/* raptor_serializer_dot.c */ +int raptor_init_serializer_dot(raptor_world* world); + +/* raptor_serializer_ntriples.c */ +int raptor_init_serializer_ntriples(raptor_world* world); +int raptor_init_serializer_nquads(raptor_world* world); + +/* raptor_serialize_rdfxml.c */ +int raptor_init_serializer_rdfxml(raptor_world* world); + +/* raptor_serialize_rdfxmla.c */ +int raptor_init_serializer_rdfxmla(raptor_world* world); + +/* raptor_serialize_turtle.c */ +int raptor_init_serializer_turtle(raptor_world* world); +int raptor_init_serializer_mkr(raptor_world* world); + +/* raptor_serialize_html.c */ +int raptor_init_serializer_html(raptor_world* world); + +/* raptor_serialize_json.c */ +int raptor_init_serializer_json(raptor_world* world); + +/* raptor_unicode.c */ +extern const raptor_unichar raptor_unicode_max_codepoint; + +int raptor_unicode_is_namestartchar(raptor_unichar c); +int raptor_unicode_is_namechar(raptor_unichar c); +int raptor_unicode_check_utf8_nfc_string(const unsigned char *input, size_t length); + +/* raptor_www*.c */ +#ifdef RAPTOR_WWW_LIBXML +#include +#include +#include +#endif + +#ifdef RAPTOR_WWW_LIBCURL +#include +#include +#endif + +/* Size of buffer used in various raptor_www places for I/O */ +#ifndef RAPTOR_WWW_BUFFER_SIZE +#define RAPTOR_WWW_BUFFER_SIZE 4096 +#endif + +/* WWW library state */ +struct raptor_www_s { + raptor_world* world; + char *type; + int free_type; + size_t total_bytes; + int failed; + int status_code; + + raptor_uri *uri; + +#ifdef RAPTOR_WWW_LIBCURL + CURL* curl_handle; + char error_buffer[CURL_ERROR_SIZE]; + int curl_init_here; + int checked_status; +#endif + +#ifdef RAPTOR_WWW_LIBXML + void *ctxt; + int is_end; + void *old_xmlGenericErrorContext; +#endif + + char buffer[RAPTOR_WWW_BUFFER_SIZE + 1]; + + char *user_agent; + + /* proxy URL string or NULL for none */ + char *proxy; + + void *write_bytes_userdata; + raptor_www_write_bytes_handler write_bytes; + void *content_type_userdata; + raptor_www_content_type_handler content_type; + + void* uri_filter_user_data; + raptor_uri_filter_func uri_filter; + + /* can be filled with error location information */ + raptor_locator locator; + + char *http_accept; + + FILE* handle; + + int connection_timeout; + + /* The URI returned after any redirections */ + raptor_uri* final_uri; + + void *final_uri_userdata; + raptor_www_final_uri_handler final_uri_handler; + + char* cache_control; +}; + + + +/* internal */ +void raptor_www_libxml_init(raptor_www *www); +void raptor_www_libxml_free(raptor_www *www); +int raptor_www_libxml_fetch(raptor_www *www); + +void raptor_www_error(raptor_www *www, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +int raptor_www_curl_init(raptor_www *www); +void raptor_www_curl_free(raptor_www *www); +int raptor_www_curl_fetch(raptor_www *www); +int raptor_www_curl_set_ssl_cert_options(raptor_www* www, const char* cert_filename, const char* cert_type, const char* cert_passphrase); +int raptor_www_curl_set_ssl_verify_options(raptor_www* www, int verify_peer, int verify_host); + +void raptor_www_libfetch_init(raptor_www *www); +void raptor_www_libfetch_free(raptor_www *www); +int raptor_www_libfetch_fetch(raptor_www *www); + +/* raptor_set.c */ +RAPTOR_INTERNAL_API raptor_id_set* raptor_new_id_set(raptor_world* world); +RAPTOR_INTERNAL_API void raptor_free_id_set(raptor_id_set* set); +RAPTOR_INTERNAL_API int raptor_id_set_add(raptor_id_set* set, raptor_uri* base_uri, const unsigned char *item, size_t item_len); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 +void raptor_id_set_stats_print(raptor_id_set* set, FILE *stream); +#endif + +/* raptor_sax2.c */ +/* + * SAX2 elements/attributes on stack + */ +struct raptor_xml_element_s { + /* NULL at bottom of stack */ + struct raptor_xml_element_s *parent; + raptor_qname *name; + raptor_qname **attributes; + unsigned int attribute_count; + + /* value of xml:lang attribute on this element or NULL */ + const unsigned char *xml_language; + + /* URI of xml:base attribute value on this element or NULL */ + raptor_uri *base_uri; + + /* CDATA content of element and checks for mixed content */ + raptor_stringbuffer* content_cdata_sb; + unsigned int content_cdata_length; + /* how many cdata blocks seen */ + unsigned int content_cdata_seen; + /* how many contained elements seen */ + unsigned int content_element_seen; + + raptor_sequence *declared_nspaces; + + void* user_data; +}; + + +struct raptor_sax2_s { +#ifdef RAPTOR_XML_LIBXML + int magic; +#endif + raptor_world* world; + void* user_data; + +#ifdef RAPTOR_XML_LIBXML + /* structure holding sax event handlers */ + xmlSAXHandler sax; + /* parser context */ + xmlParserCtxtPtr xc; + /* pointer to SAX document locator */ + xmlSAXLocatorPtr loc; + +#if LIBXML_VERSION < 20425 + /* flag for some libxml eversions*/ + int first_read; +#endif + +#endif + + /* element depth */ + int depth; + + /* stack of elements - elements add after current_element */ + raptor_xml_element *root_element; + raptor_xml_element *current_element; + + /* start of an element */ + raptor_sax2_start_element_handler start_element_handler; + /* end of an element */ + raptor_sax2_end_element_handler end_element_handler; + /* characters */ + raptor_sax2_characters_handler characters_handler; + /* like */ + raptor_sax2_cdata_handler cdata_handler; + /* comment */ + raptor_sax2_comment_handler comment_handler; + /* unparsed (NDATA) entity */ + raptor_sax2_unparsed_entity_decl_handler unparsed_entity_decl_handler; + /* external entity reference */ + raptor_sax2_external_entity_ref_handler external_entity_ref_handler; + + raptor_locator *locator; + + /* New XML namespace callback */ + raptor_namespace_handler namespace_handler; + + raptor_object_options options; + + /* stack of namespaces, most recently added at top */ + raptor_namespace_stack namespaces; /* static */ + + /* base URI for resolving relative URIs or xml:base URIs */ + raptor_uri* base_uri; + + /* sax2 init failed - do not try to do anything with it */ + int failed; + + /* call SAX2 handlers if non-0 */ + int enabled; + + void* uri_filter_user_data; + raptor_uri_filter_func uri_filter; +}; + +int raptor_sax2_init(raptor_world* world); +void raptor_sax2_finish(raptor_world* world); + + +raptor_xml_element* raptor_xml_element_pop(raptor_sax2* sax2); +void raptor_xml_element_push(raptor_sax2* sax2, raptor_xml_element* element); +int raptor_sax2_get_depth(raptor_sax2* sax2); +void raptor_sax2_inc_depth(raptor_sax2* sax2); +void raptor_sax2_dec_depth(raptor_sax2* sax2); +void raptor_sax2_update_document_locator(raptor_sax2* sax2, raptor_locator* locator); +int raptor_sax2_set_option(raptor_sax2 *sax2, raptor_option option, char* string, int integer); + +#ifdef RAPTOR_DEBUG +void raptor_print_xml_element(raptor_xml_element *element, FILE* stream); +#endif + +void raptor_sax2_start_element(void* user_data, const unsigned char *name, const unsigned char **atts); +void raptor_sax2_end_element(void* user_data, const unsigned char *name); +void raptor_sax2_characters(void* user_data, const unsigned char *s, int len); +void raptor_sax2_cdata(void* user_data, const unsigned char *s, int len); +void raptor_sax2_comment(void* user_data, const unsigned char *s); +void raptor_sax2_unparsed_entity_decl(void* user_data, const unsigned char* entityName, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId, const unsigned char* notationName); +int raptor_sax2_external_entity_ref(void* user_data, const unsigned char* context, const unsigned char* base, const unsigned char* systemId, const unsigned char* publicId); +int raptor_sax2_check_load_uri_string(raptor_sax2* sax2, const unsigned char* uri_string); + +/* turtle_parser.y and turtle_lexer.l */ +typedef struct raptor_turtle_parser_s raptor_turtle_parser; + +/* n3_parser.y and n3_lexer.l */ +typedef struct raptor_n3_parser_s raptor_n3_parser; + +/* raptor_rfc2396.c */ +struct raptor_uri_detail_s +{ + size_t uri_len; + /* buffer is the same size as the original uri_len */ + unsigned char *buffer; + + /* URI Components. These all point into buffer */ + unsigned char *scheme; + unsigned char *authority; + unsigned char *path; + unsigned char *query; + unsigned char *fragment; + + /* Lengths of the URI Components */ + size_t scheme_len; + size_t authority_len; + size_t path_len; + size_t query_len; + size_t fragment_len; + + /* Flags */ + int is_hierarchical; +}; + + +/* for time_t */ +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_TIME_H +#include +#endif + +/* parsedate.c */ +#ifdef HAVE_INN_PARSEDATE +#include +#define RAPTOR_PARSEDATE_FUNCTION parsedate +#else +#ifdef HAVE_RAPTOR_PARSE_DATE +time_t raptor_parse_date(const char *p, time_t *now); +#define RAPTOR_PARSEDATE_FUNCTION raptor_parse_date +#else +#ifdef HAVE_CURL_CURL_H +#include +#define RAPTOR_PARSEDATE_FUNCTION curl_getdate +#endif +#endif +#endif + +/* only used internally now */ +typedef void (*raptor_simple_message_handler)(void *user_data, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); + + +/* turtle_common.c */ +RAPTOR_INTERNAL_API int raptor_stringbuffer_append_turtle_string(raptor_stringbuffer* stringbuffer, const unsigned char *text, size_t len, int delim, raptor_simple_message_handler error_handler, void *error_data, int is_uri); + + +/* raptor_abbrev.c */ + +typedef struct { + raptor_world* world; + int ref_count; /* count of references to this node */ + int count_as_subject; /* count of this blank/resource node as subject */ + int count_as_object; /* count of this blank/resource node as object */ + + raptor_term* term; +} raptor_abbrev_node; + +#ifdef RAPTOR_DEBUG +#define RAPTOR_DEBUG_ABBREV_NODE(label, node) \ + do { \ + RAPTOR_DEBUG1(label " "); \ + raptor_term_print_as_ntriples(node->term, RAPTOR_DEBUG_FH); \ + fprintf(RAPTOR_DEBUG_FH, " (refcount %d subject %d object %d)\n", \ + node->ref_count, \ + node->count_as_subject, \ + node->count_as_object); \ + } while(0) +#else +#define RAPTOR_DEBUG_ABBREV_NODE(label, node) +#endif + +typedef struct { + raptor_abbrev_node* node; /* node representing the subject of + * this resource */ + raptor_abbrev_node* node_type; /* the rdf:type of this resource */ + raptor_avltree *properties; /* list of properties + * (predicate/object pair) of this + * subject */ + raptor_sequence *list_items; /* list of container elements if + * is rdf container */ + int valid; /* set 0 for blank nodes that do not + * need to be referred to again */ +} raptor_abbrev_subject; + + +raptor_abbrev_node* raptor_new_abbrev_node(raptor_world* world, raptor_term* term); +void raptor_free_abbrev_node(raptor_abbrev_node* node); +int raptor_abbrev_node_compare(raptor_abbrev_node* node1, raptor_abbrev_node* node2); +int raptor_abbrev_node_equals(raptor_abbrev_node* node1, raptor_abbrev_node* node2); +raptor_abbrev_node* raptor_abbrev_node_lookup(raptor_avltree* nodes, raptor_term* term); + +void raptor_free_abbrev_subject(raptor_abbrev_subject* subject); +int raptor_abbrev_subject_add_property(raptor_abbrev_subject* subject, raptor_abbrev_node* predicate, raptor_abbrev_node* object); +int raptor_abbrev_subject_compare(raptor_abbrev_subject* subject1, raptor_abbrev_subject* subject2); +raptor_abbrev_subject* raptor_abbrev_subject_find(raptor_avltree *subjects, raptor_term* node); +raptor_abbrev_subject* raptor_abbrev_subject_lookup(raptor_avltree* nodes, raptor_avltree* subjects, raptor_avltree* blanks, raptor_term* term); +int raptor_abbrev_subject_valid(raptor_abbrev_subject *subject); +int raptor_abbrev_subject_invalidate(raptor_abbrev_subject *subject); + + +/* avltree */ +#ifdef RAPTOR_DEBUG +int raptor_avltree_dump(raptor_avltree* tree, FILE* stream); +void raptor_avltree_check(raptor_avltree* tree); +#endif + + +raptor_qname* raptor_new_qname_from_resource(raptor_sequence* namespaces, raptor_namespace_stack* nstack, int* namespace_count, raptor_abbrev_node* node); + + +/** + * raptor_turtle_writer: + * + * Raptor Turtle Writer class + */ +typedef struct raptor_turtle_writer_s raptor_turtle_writer; + +/** + * raptor_turtle_writer_flags: + * @TURTLE_WRITER_FLAG_AUTO_INDENT: auto indent + * @TURTLE_WRITER_FLAG_MKR: write mkr not turtle + * + * Bit flags for raptor_new_turtle_writer() + */ +typedef enum { + TURTLE_WRITER_FLAG_AUTO_INDENT = 1, + TURTLE_WRITER_FLAG_MKR = 2 +} raptor_turtle_writer_flags; + + +/* Turtle Writer Class (raptor_turtle_writer) */ +RAPTOR_INTERNAL_API raptor_turtle_writer* raptor_new_turtle_writer(raptor_world* world, raptor_uri* base_uri, int write_base_uri, raptor_namespace_stack *nstack, raptor_iostream* iostr, int flags); +RAPTOR_INTERNAL_API void raptor_free_turtle_writer(raptor_turtle_writer* turtle_writer); +RAPTOR_INTERNAL_API void raptor_turtle_writer_raw(raptor_turtle_writer* turtle_writer, const unsigned char *s); +RAPTOR_INTERNAL_API void raptor_turtle_writer_raw_counted(raptor_turtle_writer* turtle_writer, const unsigned char *s, unsigned int len); +RAPTOR_INTERNAL_API void raptor_turtle_writer_namespace_prefix(raptor_turtle_writer* turtle_writer, raptor_namespace* ns); +void raptor_turtle_writer_base(raptor_turtle_writer* turtle_writer, raptor_uri* base_uri); +RAPTOR_INTERNAL_API void raptor_turtle_writer_increase_indent(raptor_turtle_writer *turtle_writer); +RAPTOR_INTERNAL_API void raptor_turtle_writer_decrease_indent(raptor_turtle_writer *turtle_writer); +RAPTOR_INTERNAL_API void raptor_turtle_writer_newline(raptor_turtle_writer *turtle_writer); +RAPTOR_INTERNAL_API int raptor_turtle_writer_reference(raptor_turtle_writer* turtle_writer, raptor_uri* uri); +RAPTOR_INTERNAL_API int raptor_turtle_writer_literal(raptor_turtle_writer* turtle_writer, raptor_namespace_stack *nstack, const unsigned char *s, const unsigned char* lang, raptor_uri* datatype); +RAPTOR_INTERNAL_API void raptor_turtle_writer_csv_string(raptor_turtle_writer* turtle_writer, const unsigned char *s); +RAPTOR_INTERNAL_API void raptor_turtle_writer_qname(raptor_turtle_writer* turtle_writer, raptor_qname* qname); +RAPTOR_INTERNAL_API int raptor_turtle_writer_quoted_counted_string(raptor_turtle_writer* turtle_writer, const unsigned char *s, size_t length); +void raptor_turtle_writer_comment(raptor_turtle_writer* turtle_writer, const unsigned char *s); +RAPTOR_INTERNAL_API int raptor_turtle_writer_set_option(raptor_turtle_writer *turtle_writer, raptor_option option, int value); +int raptor_turtle_writer_set_option_string(raptor_turtle_writer *turtle_writer, raptor_option option, const unsigned char *value); +int raptor_turtle_writer_get_option(raptor_turtle_writer *turtle_writer, raptor_option option); +const unsigned char *raptor_turtle_writer_get_option_string(raptor_turtle_writer *turtle_writer, raptor_option option); +void raptor_turtle_writer_bnodeid(raptor_turtle_writer* turtle_writer, const unsigned char *bnodeid, size_t len); +int raptor_turtle_writer_uri(raptor_turtle_writer* turtle_writer, raptor_uri* uri); +int raptor_turtle_writer_term(raptor_turtle_writer* turtle_writer, raptor_term* term); +int raptor_turtle_is_legal_turtle_qname(raptor_qname* qname); + + +/** + * raptor_json_writer: + * + * Raptor JSON Writer class + */ +typedef struct raptor_json_writer_s raptor_json_writer; + +/* raptor_json_writer.c */ +raptor_json_writer* raptor_new_json_writer(raptor_world* world, raptor_uri* base_uri, raptor_iostream* iostr); +void raptor_free_json_writer(raptor_json_writer* json_writer); + +int raptor_json_writer_newline(raptor_json_writer* json_writer); +int raptor_json_writer_key_value(raptor_json_writer* json_writer, const char* key, size_t key_len, const char* value, size_t value_len); +int raptor_json_writer_start_block(raptor_json_writer* json_writer, char c); +int raptor_json_writer_end_block(raptor_json_writer* json_writer, char c); +int raptor_json_writer_literal_object(raptor_json_writer* json_writer, unsigned char* s, size_t s_len, unsigned char* lang, raptor_uri* datatype); +int raptor_json_writer_blank_object(raptor_json_writer* json_writer, const unsigned char* blank, size_t blank_len); +int raptor_json_writer_uri_object(raptor_json_writer* json_writer, raptor_uri* uri); +int raptor_json_writer_term(raptor_json_writer* json_writer, raptor_term *term); +int raptor_json_writer_key_uri_value(raptor_json_writer* json_writer, const char* key, size_t key_len, raptor_uri* uri); + +/* raptor_memstr.c */ +const char* raptor_memstr(const char *haystack, size_t haystack_len, const char *needle); + +/* raptor_serialize_rdfxmla.c special functions for embedding rdf/xml */ +int raptor_rdfxmla_serialize_set_write_rdf_RDF(raptor_serializer* serializer, int value); +int raptor_rdfxmla_serialize_set_xml_writer(raptor_serializer* serializer, raptor_xml_writer* xml_writer, raptor_namespace_stack *nstack); +int raptor_rdfxmla_serialize_set_single_node(raptor_serializer* serializer, raptor_uri* uri); +int raptor_rdfxmla_serialize_set_write_typed_nodes(raptor_serializer* serializer, int value); + +/* snprintf.c */ +size_t raptor_format_integer(char* buffer, size_t bufsize, int integer, unsigned int base, int width, char padding); + +/* raptor_world structure */ +#define RAPTOR1_WORLD_MAGIC_1 0 +#define RAPTOR1_WORLD_MAGIC_2 1 +#define RAPTOR2_WORLD_MAGIC 0xC4129CEF + +#define RAPTOR_CHECK_CONSTRUCTOR_WORLD(world) \ + do { \ + if(raptor_check_world_internal(world, __FUNCTION__)) \ + return NULL; \ + } while(0) + + +RAPTOR_INTERNAL_API int raptor_check_world_internal(raptor_world* world, const char* name); + + + +struct raptor_world_s { + /* signature to check this is a world object */ + unsigned int magic; + + /* world has been initialized with raptor_world_open() */ + int opened; + + /* internal flag used to ignore errors for e.g. child GRDDL parsers */ + int internal_ignore_errors; + + void* message_handler_user_data; + raptor_log_handler message_handler; + + /* sequence of parser factories */ + raptor_sequence *parsers; + + /* sequence of serializer factories */ + raptor_sequence *serializers; + + /* raptor_rss_common initialisation counter */ + int rss_common_initialised; + + /* raptor_rss_{namespaces,types,fields}_info const data initialized to raptor_uri,raptor_qname objects */ + raptor_uri **rss_namespaces_info_uris; + raptor_uri **rss_types_info_uris; + raptor_qname **rss_types_info_qnames; + raptor_uri **rss_fields_info_uris; + raptor_qname **rss_fields_info_qnames; + + /* raptor_www v2 flags */ + int www_skip_www_init_finish; + int www_initialized; + + /* This is used to store a #xsltSecurityPrefsPtr typed object + * pointer when libxslt is compiled in. + */ + void* xslt_security_preferences; + /* 0 raptor owns the above object and should free it with + * xsltFreeSecurityPrefs() on exit + * 1 user set the above object and raptor does not own it + */ + int xslt_security_preferences_policy; + + /* Flags for libxml set by raptor_world_set_libxml_flags(). + * See #raptor_libxml_flags for meanings + */ + int libxml_flags; + +#ifdef RAPTOR_XML_LIBXML + void *libxml_saved_structured_error_context; + xmlStructuredErrorFunc libxml_saved_structured_error_handler; + + void *libxml_saved_generic_error_context; + xmlGenericErrorFunc libxml_saved_generic_error_handler; +#endif + + raptor_avltree *uris_tree; + + raptor_uri* concepts[RDF_NS_LAST + 1]; + + raptor_term* terms[RDF_NS_LAST + 1]; + + /* last log message - points to data it does not own */ + raptor_log_message message; + + /* should */ + int uri_interning; + + /* generate blank node ID policy */ + void *generate_bnodeid_handler_user_data; + raptor_generate_bnodeid_handler generate_bnodeid_handler; + + int default_generate_bnodeid_handler_base; + char *default_generate_bnodeid_handler_prefix; + unsigned int default_generate_bnodeid_handler_prefix_length; + + raptor_uri* xsd_namespace_uri; + raptor_uri* xsd_boolean_uri; + raptor_uri* xsd_decimal_uri; + raptor_uri* xsd_double_uri; + raptor_uri* xsd_integer_uri; +}; + +/* raptor_www.c */ +int raptor_www_init(raptor_world* world); +void raptor_www_finish(raptor_world* world); + + + +#define RAPTOR_LANG_LEN_FROM_INT(len) (int)(len) +#define RAPTOR_LANG_LEN_TO_SIZE_T(len) (size_t)(len) + +/* Safe casts: widening a value */ +#define RAPTOR_GOOD_CAST(t, v) (t)(v) + +/* Unsafe casts: narrowing a value */ +#define RAPTOR_BAD_CAST(t, v) (t)(v) + +/* Cast to void* for debugging prints with %p */ +#define RAPTOR_VOIDP(p) (void*)p + +/* end of RAPTOR_INTERNAL */ +#endif + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/raptor_iostream.c b/src/raptor_iostream.c new file mode 100644 index 0000000..ba7b77a --- /dev/null +++ b/src/raptor_iostream.c @@ -0,0 +1,1666 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_iostream.c - Raptor I/O-stream class for abstracting I/O + * + * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifndef STANDALONE + +#define RAPTOR_IOSTREAM_MODE_READ 1 +#define RAPTOR_IOSTREAM_MODE_WRITE 2 + +#define RAPTOR_IOSTREAM_FLAGS_EOF 1 +#define RAPTOR_IOSTREAM_FLAGS_FREE_HANDLER 2 + +struct raptor_iostream_s +{ + raptor_world *world; + + void *user_data; + const raptor_iostream_handler* handler; + size_t offset; + unsigned int mode; + int flags; +}; + + + +/* prototypes for local functions */ + + +static int +raptor_iostream_calculate_modes(const raptor_iostream_handler * const handler) +{ + int mode = 0; + + /* API V1 checks */ + if((handler->version >= 1) && + handler->read_bytes) + mode |= RAPTOR_IOSTREAM_MODE_READ; + + /* API V2 checks */ + if((handler->version >= 2) && + (handler->write_byte || handler->write_bytes)) + mode |= RAPTOR_IOSTREAM_MODE_WRITE; + + return mode; +} + + +/* Return non-0 if handler is legal and OK for given mode (if not 0 = ANY) */ +static int +raptor_iostream_check_handler(const raptor_iostream_handler * const handler, + unsigned int user_mode) +{ + int mode; + + if(handler->version < 1 || handler->version > 2) + return 0; + + mode = raptor_iostream_calculate_modes(handler); + if(user_mode && !(user_mode & mode)) + return 0; + + return (mode != 0); +} + + +/** + * raptor_new_iostream_from_handler: + * @world: raptor_world object + * @user_data: pointer to context information to pass in to calls + * @handler: pointer to handler methods + * + * Create a new iostream over a user-defined handler + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +raptor_iostream* +raptor_new_iostream_from_handler(raptor_world *world, + void *user_data, + const raptor_iostream_handler* const handler) +{ + raptor_iostream* iostr; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(handler, raptor_iostream_handler, NULL); + + raptor_world_open(world); + + if(!raptor_iostream_check_handler(handler, 0)) + return NULL; + + iostr = RAPTOR_CALLOC(raptor_iostream*, 1, sizeof(*iostr)); + if(!iostr) + return NULL; + + iostr->world = world; + iostr->handler = handler; + iostr->user_data = (void*)user_data; + iostr->mode = raptor_iostream_calculate_modes(handler); + + if(iostr->handler->init && + iostr->handler->init(iostr->user_data)) { + RAPTOR_FREE(raptor_iostream, iostr); + return NULL; + } + return iostr; +} + + + +/* Local handlers for reading/writing to/from a sink */ + +static int +raptor_sink_iostream_write_byte(void *user_data, const int byte) +{ + return 0; +} + +static int +raptor_sink_iostream_write_bytes(void *user_data, const void *ptr, + size_t size, size_t nmemb) +{ + return RAPTOR_BAD_CAST(int, size * nmemb); /* success */ +} + +static int +raptor_sink_iostream_read_bytes(void *user_data, void *ptr, + size_t size, size_t nmemb) +{ + return 0; +} + +static int +raptor_sink_iostream_read_eof(void *user_data) +{ + return 1; /* EOF always */ +} + +static const raptor_iostream_handler raptor_iostream_sink_handler = { + /* .version = */ 2, + /* .init = */ NULL, + /* .finish = */ NULL, + /* .write_byte = */ raptor_sink_iostream_write_byte, + /* .write_bytes = */ raptor_sink_iostream_write_bytes, + /* .write_end = */ NULL, + /* .read_bytes = */ raptor_sink_iostream_read_bytes, + /* .read_eof = */ raptor_sink_iostream_read_eof +}; + + +/** + * raptor_new_iostream_to_sink: + * @world: raptor_world object + * + * Create a new write iostream to a sink, throwing away all data. + * + * Provides an that throw away all writes and returns end of input + * immediately on reads. Same as raptor_new_iostream_from_sink() + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +raptor_iostream* +raptor_new_iostream_to_sink(raptor_world *world) +{ + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + return raptor_new_iostream_from_handler(world, + NULL, &raptor_iostream_sink_handler); +} + + +/* Local handlers for reading/writing from a filename */ + +static void +raptor_filename_iostream_finish(void *user_data) +{ + FILE* handle = (FILE*)user_data; + fclose(handle); +} + +static int +raptor_filename_iostream_write_byte(void *user_data, const int byte) +{ + FILE* handle = (FILE*)user_data; + return (fputc(byte, handle) == byte); +} + +static int +raptor_filename_iostream_write_bytes(void *user_data, + const void *ptr, size_t size, size_t nmemb) +{ + FILE* handle = (FILE*)user_data; + return RAPTOR_BAD_CAST(int, fwrite(ptr, size, nmemb, handle)); +} + +static int +raptor_filename_iostream_write_end(void *user_data) +{ + FILE* handle = (FILE*)user_data; + return fclose(handle); +} + +static int +raptor_filename_iostream_read_bytes(void *user_data, + void *ptr, size_t size, size_t nmemb) +{ + FILE* handle = (FILE*)user_data; + return RAPTOR_BAD_CAST(int, fread(ptr, size, nmemb, handle)); +} + +static int +raptor_filename_iostream_read_eof(void *user_data) +{ + FILE* handle = (FILE*)user_data; + return feof(handle); +} + +static const raptor_iostream_handler raptor_iostream_write_filename_handler = { + /* .version = */ 2, + /* .init = */ NULL, + /* .finish = */ raptor_filename_iostream_finish, + /* .write_byte = */ raptor_filename_iostream_write_byte, + /* .write_bytes = */ raptor_filename_iostream_write_bytes, + /* .write_end = */ raptor_filename_iostream_write_end, + /* .read_bytes = */ NULL, + /* .read_eof = */ NULL +}; + + +/** + * raptor_new_iostream_to_filename: + * @world: raptor world + * @filename: Output filename to open and write to + * + * Constructor - create a new iostream writing to a filename. + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +raptor_iostream* +raptor_new_iostream_to_filename(raptor_world *world, const char *filename) +{ + FILE *handle; + raptor_iostream* iostr; + const raptor_iostream_handler* handler; + const unsigned int mode = RAPTOR_IOSTREAM_MODE_WRITE; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + if(!filename) + return NULL; + + handler = &raptor_iostream_write_filename_handler; + if(!raptor_iostream_check_handler(handler, mode)) + return NULL; + + handle = fopen(filename, "wb"); + if(!handle) + return NULL; + + iostr = RAPTOR_CALLOC(raptor_iostream*, 1, sizeof(*iostr)); + if(!iostr) { + fclose(handle); + return NULL; + } + + iostr->world = world; + iostr->handler = handler; + iostr->user_data = (void*)handle; + iostr->mode = mode; + + if(iostr->handler->init && + iostr->handler->init(iostr->user_data)) { + raptor_free_iostream(iostr); + return NULL; + } + return iostr; +} + + +static const raptor_iostream_handler raptor_iostream_write_file_handler = { + /* .version = */ 2, + /* .init = */ NULL, + /* .finish = */ NULL, + /* .write_byte = */ raptor_filename_iostream_write_byte, + /* .write_bytes = */ raptor_filename_iostream_write_bytes, + /* .write_end = */ NULL, + /* .read_bytes = */ NULL, + /* .read_eof = */ NULL +}; + + +/** + * raptor_new_iostream_to_file_handle: + * @world: raptor world + * @handle: FILE* handle to write to + * + * Constructor - create a new iostream writing to a FILE*. + * + * The @handle must already be open for writing. + * NOTE: This does not fclose the @handle when it is finished. + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +raptor_iostream* +raptor_new_iostream_to_file_handle(raptor_world *world, FILE *handle) +{ + raptor_iostream* iostr; + const raptor_iostream_handler* handler; + const unsigned int mode = RAPTOR_IOSTREAM_MODE_WRITE; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + if(!handle) + return NULL; + + handler = &raptor_iostream_write_file_handler; + if(!raptor_iostream_check_handler(handler, mode)) + return NULL; + + iostr = RAPTOR_CALLOC(raptor_iostream*, 1, sizeof(*iostr)); + if(!iostr) + return NULL; + + iostr->world = world; + iostr->handler = handler; + iostr->user_data = (void*)handle; + iostr->mode = mode; + + if(iostr->handler->init && iostr->handler->init(iostr->user_data)) { + RAPTOR_FREE(raptor_iostream, iostr); + return NULL; + } + return iostr; +} + + + +struct raptor_write_string_iostream_context { + raptor_stringbuffer *sb; + void *(*malloc_handler)(size_t size); + void **string_p; + size_t *length_p; +}; + + +/* Local handlers for writing to a string */ + +static void +raptor_write_string_iostream_finish(void *user_data) +{ + struct raptor_write_string_iostream_context* con; + size_t len; + void *str = NULL; + + con = (struct raptor_write_string_iostream_context*)user_data; + len = raptor_stringbuffer_length(con->sb); + + *con->string_p = NULL; + if(con->length_p) + *con->length_p = len; + + str = (void*)con->malloc_handler(len+1); + if(str) { + if(len) + raptor_stringbuffer_copy_to_string(con->sb, (unsigned char*)str, len+1); + else + *(char*)str='\0'; + *con->string_p = str; + } + + if(!str && con->length_p) + *con->length_p = 0; + + raptor_free_stringbuffer(con->sb); + RAPTOR_FREE(raptor_write_string_iostream_context, con); + return; +} + +static int +raptor_write_string_iostream_write_byte(void *user_data, const int byte) +{ + struct raptor_write_string_iostream_context* con; + unsigned char buf = (unsigned char)byte; + + con = (struct raptor_write_string_iostream_context*)user_data; + return raptor_stringbuffer_append_counted_string(con->sb, &buf, 1, 1); +} + + +static int +raptor_write_string_iostream_write_bytes(void *user_data, const void *ptr, + size_t size, size_t nmemb) +{ + struct raptor_write_string_iostream_context* con; + + con = (struct raptor_write_string_iostream_context*)user_data; + if(raptor_stringbuffer_append_counted_string(con->sb, + (const unsigned char*)ptr, size * nmemb, 1)) + return 0; /* failure */ + return RAPTOR_BAD_CAST(int, size * nmemb); /* success */ +} + +static const raptor_iostream_handler raptor_iostream_write_string_handler = { + /* .version = */ 2, + /* .init = */ NULL, + /* .finish = */ raptor_write_string_iostream_finish, + /* .write_byte = */ raptor_write_string_iostream_write_byte, + /* .write_bytes = */ raptor_write_string_iostream_write_bytes, + /* .write_end = */ NULL, + /* .read_bytes = */ NULL, + /* .read_eof = */ NULL +}; + + +/** + * raptor_new_iostream_to_string: + * @world: raptor world + * @string_p: pointer to location to hold string + * @length_p: pointer to location to hold length of string (or NULL) + * @malloc_handler: pointer to malloc() to use to make string (or NULL) + * + * Constructor - create a new iostream writing to a string. + * + * If @malloc_handler is null, raptor will allocate it using it's + * own memory allocator. *@string_p is set to NULL on failure (and + * *@length_p to 0 if @length_p is not NULL). + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +RAPTOR_EXTERN_C +raptor_iostream* +raptor_new_iostream_to_string(raptor_world *world, + void **string_p, size_t *length_p, + raptor_data_malloc_handler const malloc_handler) +{ + raptor_iostream* iostr; + struct raptor_write_string_iostream_context* con; + const raptor_iostream_handler* handler; + const unsigned int mode = RAPTOR_IOSTREAM_MODE_WRITE; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!string_p) + return NULL; + + raptor_world_open(world); + + handler = &raptor_iostream_write_string_handler; + if(!raptor_iostream_check_handler(handler, mode)) + return NULL; + + iostr = RAPTOR_CALLOC(raptor_iostream*, 1, sizeof(*iostr)); + if(!iostr) + return NULL; + + con = RAPTOR_CALLOC(struct raptor_write_string_iostream_context*, 1, + sizeof(*con)); + if(!con) { + RAPTOR_FREE(raptor_iostream, iostr); + return NULL; + } + + con->sb = raptor_new_stringbuffer(); + if(!con->sb) { + RAPTOR_FREE(raptor_iostream, iostr); + RAPTOR_FREE(raptor_write_string_iostream_context, con); + return NULL; + } + + con->string_p = string_p; + *string_p = NULL; + + con->length_p = length_p; + if(length_p) + *length_p = 0; + + if(malloc_handler) + con->malloc_handler = malloc_handler; + else + con->malloc_handler = raptor_alloc_memory; + + iostr->world = world; + iostr->handler = handler; + iostr->user_data = (void*)con; + iostr->mode = mode; + + if(iostr->handler->init && iostr->handler->init(iostr->user_data)) { + raptor_free_iostream(iostr); + return NULL; + } + return iostr; +} + + +/** + * raptor_new_iostream_from_sink: + * @world: raptor world + * + * Create a new read iostream from a sink, returning no data. + * + * Provides an I/O source that returns end of input immediately on + * reads, and throw away all writes. Same as + * raptor_new_iostream_to_sink() + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +raptor_iostream* +raptor_new_iostream_from_sink(raptor_world *world) +{ + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + return raptor_new_iostream_from_handler(world, NULL, + &raptor_iostream_sink_handler); +} + + +static const raptor_iostream_handler raptor_iostream_read_filename_handler = { + /* .version = */ 2, + /* .init = */ NULL, + /* .finish = */ raptor_filename_iostream_finish, + /* .write_byte = */ NULL, + /* .write_bytes = */ NULL, + /* .write_end = */ NULL, + /* .read_bytes = */ raptor_filename_iostream_read_bytes, + /* .read_eof = */ raptor_filename_iostream_read_eof +}; + + +/** + * raptor_new_iostream_from_filename: + * @world: raptor world + * @filename: Input filename to open and read from + * + * Constructor - create a new iostream reading from a filename. + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +raptor_iostream* +raptor_new_iostream_from_filename(raptor_world *world, const char *filename) +{ + FILE *handle; + raptor_iostream* iostr; + const raptor_iostream_handler* handler; + const unsigned int mode = RAPTOR_IOSTREAM_MODE_READ; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!filename) + return NULL; + + raptor_world_open(world); + + handler = &raptor_iostream_read_filename_handler; + if(!raptor_iostream_check_handler(handler, mode)) + return NULL; + + handle = fopen(filename, "rb"); + if(!handle) + return NULL; + + iostr = RAPTOR_CALLOC(raptor_iostream*, 1, sizeof(*iostr)); + if(!iostr) { + fclose(handle); + return NULL; + } + + iostr->world = world; + iostr->handler = handler; + iostr->user_data = (void*)handle; + iostr->mode = mode; + + if(iostr->handler->init && + iostr->handler->init(iostr->user_data)) { + raptor_free_iostream(iostr); + return NULL; + } + return iostr; +} + + +static const raptor_iostream_handler raptor_iostream_read_file_handle_handler = { + /* .version = */ 2, + /* .init = */ NULL, + /* .finish = */ NULL, + /* .write_byte = */ NULL, + /* .write_bytes = */ NULL, + /* .write_end = */ NULL, + /* .read_bytes = */ raptor_filename_iostream_read_bytes, + /* .read_eof = */ raptor_filename_iostream_read_eof +}; + + +/** + * raptor_new_iostream_from_file_handle: + * @world: raptor world + * @handle: Input file_handle to open and read from + * + * Constructor - create a new iostream reading from a file_handle. + * + * The @handle must already be open for reading. + * NOTE: This does not fclose the @handle when it is finished. + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +raptor_iostream* +raptor_new_iostream_from_file_handle(raptor_world *world, FILE *handle) +{ + raptor_iostream* iostr; + const raptor_iostream_handler* handler; + const unsigned int mode = RAPTOR_IOSTREAM_MODE_READ; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!handle) + return NULL; + + raptor_world_open(world); + + handler = &raptor_iostream_read_file_handle_handler; + if(!raptor_iostream_check_handler(handler, mode)) + return NULL; + + iostr = RAPTOR_CALLOC(raptor_iostream*, 1, sizeof(*iostr)); + if(!iostr) + return NULL; + + iostr->world = world; + iostr->handler = handler; + iostr->user_data = (void*)handle; + iostr->mode = mode; + + if(iostr->handler->init && + iostr->handler->init(iostr->user_data)) { + RAPTOR_FREE(raptor_iostream, iostr); + return NULL; + } + return iostr; +} + + +/** + * raptor_free_iostream: + * @iostr: iostream object + * + * Destructor - destroy an iostream. + **/ +void +raptor_free_iostream(raptor_iostream *iostr) +{ + if(!iostr) + return; + + if(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) + raptor_iostream_write_end(iostr); + + if(iostr->handler->finish) + iostr->handler->finish(iostr->user_data); + + if((iostr->flags & RAPTOR_IOSTREAM_FLAGS_FREE_HANDLER)) + RAPTOR_FREE(raptor_iostream_handler, iostr->handler); + + RAPTOR_FREE(raptor_iostream, iostr); +} + + + +/** + * raptor_iostream_write_byte: + * @byte: byte to write + * @iostr: raptor iostream + * + * Write a byte to the iostream. + * + * Return value: non-0 on failure + **/ +int +raptor_iostream_write_byte(const int byte, raptor_iostream *iostr) +{ + iostr->offset++; + + if(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) + return 1; + if(!iostr->handler->write_byte) + return 1; + if(!(iostr->mode & RAPTOR_IOSTREAM_MODE_WRITE)) + return 1; + return iostr->handler->write_byte(iostr->user_data, byte); +} + + +/** + * raptor_iostream_write_bytes: + * @ptr: start of objects to write + * @size: size of object + * @nmemb: number of objects + * @iostr: raptor iostream + * + * Write bytes to the iostream. + * + * Return value: number of objects actually written, which may be less than nmemb. <0 on failure + **/ +int +raptor_iostream_write_bytes(const void *ptr, size_t size, size_t nmemb, + raptor_iostream *iostr) +{ + int nobj; + + if(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) + return -1; + if(!iostr->handler->write_bytes) + return -1; + if(!(iostr->mode & RAPTOR_IOSTREAM_MODE_WRITE)) + return -1; + + nobj = iostr->handler->write_bytes(iostr->user_data, ptr, size, nmemb); + if(nobj > 0) + iostr->offset += (size * nobj); + + return nobj; +} + + +/** + * raptor_iostream_string_write: + * @string: string + * @iostr: raptor iostream + * + * Write a NULL-terminated string to the iostream. + * + * Return value: non-0 on failure + **/ +int +raptor_iostream_string_write(const void *string, raptor_iostream *iostr) +{ + size_t len = strlen((const char*)string); + int nobj = raptor_iostream_write_bytes(string, 1, len, iostr); + return (RAPTOR_BAD_CAST(size_t, nobj) != len); +} + + +/** + * raptor_iostream_counted_string_write: + * @string: string + * @len: string length + * @iostr: raptor iostream + * + * Write a counted string to the iostream. + * + * Return value: non-0 on failure + **/ +int +raptor_iostream_counted_string_write(const void *string, size_t len, + raptor_iostream *iostr) +{ + int nobj = raptor_iostream_write_bytes(string, 1, len, iostr); + return (RAPTOR_BAD_CAST(size_t, nobj) != len); +} + + +/** + * raptor_uri_write: + * @uri: URI + * @iostr: raptor iostream + * + * Write a raptor URI to the iostream. + * + * Return value: non-0 on failure + **/ +int +raptor_uri_write(raptor_uri* uri, raptor_iostream* iostr) +{ + size_t len; + const void *string = raptor_uri_as_counted_string(uri, &len); + int nobj = raptor_iostream_write_bytes(string, 1, len, iostr); + return (RAPTOR_BAD_CAST(size_t, nobj) != len); +} + + +/** + * raptor_iostream_write_end: + * @iostr: raptor iostream + * + * End writing to the iostream. + * + * Return value: non-0 on failure + **/ +int +raptor_iostream_write_end(raptor_iostream *iostr) +{ + int rc = 0; + + if(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) + return 1; + if(iostr->handler->write_end) + rc = iostr->handler->write_end(iostr->user_data); + iostr->flags |= RAPTOR_IOSTREAM_FLAGS_EOF; + + return rc; +} + + +/** + * raptor_stringbuffer_write: + * @sb: #raptor_stringbuffer to write + * @iostr: raptor iostream + * + * Write a stringbuffer to an iostream. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_write(raptor_stringbuffer *sb, raptor_iostream* iostr) +{ + size_t length; + if(!sb) + return 1; + + length = raptor_stringbuffer_length(sb); + if(length) { + int nobj = raptor_iostream_write_bytes(raptor_stringbuffer_as_string(sb), + 1, length, iostr); + return (RAPTOR_BAD_CAST(size_t, nobj) != length); + } else + return 0; +} + + +/** + * raptor_iostream_decimal_write: + * @integer: integer to format as decimal + * @iostr: raptor iostream + * + * Write an integer in decimal to the iostream. + * + * Return value: non-0 on failure + **/ +int +raptor_iostream_decimal_write(int integer, raptor_iostream* iostr) +{ + /* enough for 64 bit signed integer + * INT64_MAX is 9223372036854775807 (19 digits) + 1 for sign + */ + unsigned char buf[20]; + unsigned char *p; + int i = integer; + size_t length = 1; + int nobj; + + if(integer < 0) { + length++; + i= -integer; + } + while(i /= 10) + length++; + + p = buf+length-1; + i = integer; + if(i < 0) + i= -i; + do { + *p-- = RAPTOR_GOOD_CAST(unsigned char, '0' + (i %10)); + i /= 10; + } while(i); + if(integer < 0) + *p= '-'; + + nobj = raptor_iostream_write_bytes(buf, 1, length, iostr); + return (RAPTOR_BAD_CAST(size_t, nobj) != length); +} + + +/** + * raptor_iostream_hexadecimal_write: + * @integer: unsigned integer to format as hexadecimal + * @width: field width + * @iostr: raptor iostream + * + * Write an integer in hexadecimal to the iostream. + * + * Always 0-fills the entire field and writes in uppercase A-F + * + * Return value: non-0 on failure + **/ +int +raptor_iostream_hexadecimal_write(unsigned int integer, int width, + raptor_iostream* iostr) +{ + char *buf; + int nobj; + + if(width < 1) + return 1; + + buf = RAPTOR_MALLOC(char*, width + 1); + if(!buf) + return 1; + + (void)raptor_format_integer(buf, width + 1, integer, /* base */ 16, + width, '0'); + + nobj = raptor_iostream_write_bytes(buf, 1, width, iostr); + RAPTOR_FREE(char*, buf); + return (nobj != width); +} + + + +/** + * raptor_iostream_read_bytes: + * @ptr: start of buffer to read objects into + * @size: size of object + * @nmemb: number of objects to read + * @iostr: raptor iostream + * + * Read bytes to the iostream. + * + * Return value: number of objects read, 0 or less than nmemb on EOF, <0 on failure + **/ +int +raptor_iostream_read_bytes(void *ptr, size_t size, size_t nmemb, + raptor_iostream *iostr) +{ + int count; + + if(!(iostr->mode & RAPTOR_IOSTREAM_MODE_READ)) + return -1; + + if(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) + return 0; + + if(!iostr->handler->read_bytes) + count= -1; + else + count = iostr->handler->read_bytes(iostr->user_data, ptr, size, nmemb); + + if(count > 0) + iostr->offset += (size*count); + + if(RAPTOR_BAD_CAST(size_t, count) < nmemb) + iostr->flags |= RAPTOR_IOSTREAM_FLAGS_EOF; + + return count; +} + + +/** + * raptor_iostream_read_eof: + * @iostr: raptor read iostream + * + * Check if an read iostream has ended + * + * Return value: non-0 if EOF (or not a read iostream) + **/ +int +raptor_iostream_read_eof(raptor_iostream *iostr) +{ + /* Streams without read are always EOF */ + if(!(iostr->mode & RAPTOR_IOSTREAM_MODE_READ)) + return 1; + + if(!(iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) && + iostr->handler->read_eof && + iostr->handler->read_eof(iostr->user_data)) + iostr->flags |= RAPTOR_IOSTREAM_FLAGS_EOF; + + return ((iostr->flags & RAPTOR_IOSTREAM_FLAGS_EOF) != 0); +} + + +struct raptor_read_string_iostream_context { + /* input buffer */ + void* string; + size_t length; + /* pointer into buffer */ + size_t offset; +}; + + +/* Local handlers for reading from a string */ + +static void +raptor_read_string_iostream_finish(void *user_data) +{ + struct raptor_read_string_iostream_context* con; + + con = (struct raptor_read_string_iostream_context*)user_data; + RAPTOR_FREE(raptor_read_string_iostream_context, con); + return; +} + +static int +raptor_read_string_iostream_read_bytes(void *user_data, void *ptr, + size_t size, size_t nmemb) +{ + struct raptor_read_string_iostream_context* con; + size_t avail; + size_t blen; + + if(!ptr || size <= 0 || !nmemb) + return -1; + + con = (struct raptor_read_string_iostream_context*)user_data; + if(con->offset >= con->length) + return 0; + + avail = (con->length - con->offset) / size; + if(avail > nmemb) + avail = nmemb; + blen = (avail * size); + memcpy(ptr, (char*)con->string + con->offset, blen); + con->offset += blen; + + return RAPTOR_BAD_CAST(int, avail); +} + +static int +raptor_read_string_iostream_read_eof(void *user_data) +{ + struct raptor_read_string_iostream_context* con; + + con = (struct raptor_read_string_iostream_context*)user_data; + return (con->offset >= con->length); +} + + +static const raptor_iostream_handler raptor_iostream_read_string_handler = { + /* .version = */ 2, + /* .init = */ NULL, + /* .finish = */ raptor_read_string_iostream_finish, + /* .write_byte = */ NULL, + /* .write_bytes = */ NULL, + /* .write_end = */ NULL, + /* .read_bytes = */ raptor_read_string_iostream_read_bytes, + /* .read_eof = */ raptor_read_string_iostream_read_eof +}; + + +/** + * raptor_new_iostream_from_string: + * @world: raptor world + * @string: pointer to string + * @length: length of string + * + * Constructor - create a new iostream reading from a string. + * + * Return value: new #raptor_iostream object or NULL on failure + **/ +raptor_iostream* +raptor_new_iostream_from_string(raptor_world *world, + void *string, size_t length) +{ + raptor_iostream* iostr; + struct raptor_read_string_iostream_context* con; + const raptor_iostream_handler* handler; + const unsigned int mode = RAPTOR_IOSTREAM_MODE_READ; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!string) + return NULL; + + raptor_world_open(world); + + handler = &raptor_iostream_read_string_handler; + if(!raptor_iostream_check_handler(handler, mode)) + return NULL; + + iostr = RAPTOR_CALLOC(raptor_iostream*, 1, sizeof(*iostr)); + if(!iostr) + return NULL; + + con = RAPTOR_CALLOC(struct raptor_read_string_iostream_context*, 1, + sizeof(*con)); + if(!con) { + RAPTOR_FREE(raptor_iostream, iostr); + return NULL; + } + + con->string = string; + con->length = length; + + iostr->world = world; + iostr->handler = handler; + iostr->user_data = (void*)con; + iostr->mode = mode; + + if(iostr->handler->init && iostr->handler->init(iostr->user_data)) { + raptor_free_iostream(iostr); + return NULL; + } + return iostr; +} + + +/** + * raptor_iostream_tell: + * @iostr: raptor iostream + * + * Get the offset in the iostream. + * + * Return value: offset in iostream + **/ +unsigned long +raptor_iostream_tell(raptor_iostream *iostr) +{ + return RAPTOR_BAD_CAST(unsigned long, iostr->offset); +} + + +/* internal */ +raptor_world* +raptor_iostream_get_world(raptor_iostream *iostr) +{ + return iostr->world; +} + + +#endif + + + +#ifdef STANDALONE + +/* one more prototype */ +int main(int argc, char *argv[]); + + +static const char *program; + +#define READ_BUFFER_SIZE 256 + + +static int +test_write_to_filename(raptor_world *world, const char* filename, + const char* test_string, size_t test_string_len, + const unsigned int expected_bytes_count) +{ + raptor_iostream *iostr = NULL; + unsigned long count; + int rc = 0; + const char* const label="write iostream to filename"; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Testing %s '%s'\n", program, label, filename); +#endif + + iostr = raptor_new_iostream_to_filename(world, filename); + if(!iostr) { + fprintf(stderr, "%s: Failed to create %s '%s'\n", program, label, filename); + rc = 1; + goto tidy; + } + + raptor_iostream_write_bytes(test_string, 1, test_string_len, iostr); + raptor_iostream_write_byte('\n', iostr); + + count = raptor_iostream_tell(iostr); + if(count != expected_bytes_count) { + fprintf(stderr, "%s: %s wrote %d bytes, expected %d\n", program, label, + (int)count, expected_bytes_count); + rc = 1; + goto tidy; + } + + tidy: + if(iostr) + raptor_free_iostream(iostr); + remove(filename); + + if(rc) + fprintf(stderr, "%s: FAILED Testing %s\n", program, label); + + return rc; +} + + +static int +test_write_to_file_handle(raptor_world *world, FILE* handle, + const char* test_string, size_t test_string_len, + const unsigned int expected_bytes_count) +{ + raptor_iostream *iostr = NULL; + unsigned long count; + int rc = 0; + const char* const label="write iostream to file handle"; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Testing %s\n", program, label); +#endif + + iostr = raptor_new_iostream_to_file_handle(world, handle); + if(!iostr) { + fprintf(stderr, "%s: Failed to create %s\n", program, label); + rc = 1; + goto tidy; + } + + raptor_iostream_write_bytes(test_string, 1, test_string_len, iostr); + raptor_iostream_write_byte('\n', iostr); + + count = raptor_iostream_tell(iostr); + if(count != expected_bytes_count) { + fprintf(stderr, "%s: %s wrote %d bytes, expected %d\n", program, label, + (int)count, expected_bytes_count); + rc = 1; + } + + tidy: + if(iostr) + raptor_free_iostream(iostr); + + if(rc) + fprintf(stderr, "%s: FAILED Testing %s\n", program, label); + + return rc; +} + + +static int +test_write_to_string(raptor_world *world, + const char* test_string, size_t test_string_len, + const unsigned int expected_bytes_count) +{ + raptor_iostream *iostr = NULL; + unsigned long count; + int rc = 0; + void *string = NULL; + size_t string_len; + const char* const label="write iostream to a string"; + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Testing %s\n", program, label); +#endif + + iostr = raptor_new_iostream_to_string(world, &string, &string_len, NULL); + if(!iostr) { + fprintf(stderr, "%s: Failed to create write iostream to string\n", + program); + rc = 1; + goto tidy; + } + + raptor_iostream_write_bytes(test_string, 1, test_string_len, iostr); + raptor_iostream_write_byte('\n', iostr); + + count = raptor_iostream_tell(iostr); + if(count != expected_bytes_count) { + fprintf(stderr, "%s: %s wrote %d bytes, expected %d\n", program, label, + (int)count, expected_bytes_count); + rc = 1; + } + + raptor_free_iostream(iostr); iostr = NULL; + + if(!string) { + fprintf(stderr, "%s: %s failed to create a string\n", program, label); + return 1; + } + if(string_len != count) { + fprintf(stderr, "%s: %s created a string length %d, expected %d\n", + program, label, (int)string_len, (int)count); + return 1; + } + + tidy: + if(string) + raptor_free_memory(string); + if(iostr) + raptor_free_iostream(iostr); + + if(rc) + fprintf(stderr, "%s: FAILED Testing %s\n", program, label); + + return rc; +} + + +static int +test_write_to_sink(raptor_world *world, + const char* test_string, size_t test_string_len, + const unsigned int expected_bytes_count) +{ + raptor_iostream *iostr = NULL; + unsigned long count; + int rc = 0; + const char* const label="write iostream to sink"; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Testing %s\n", program, label); +#endif + + iostr = raptor_new_iostream_to_sink(world); + if(!iostr) { + fprintf(stderr, "%s: Failed to create %s\n", program, label); + rc = 1; + goto tidy; + } + + raptor_iostream_write_bytes(test_string, 1, test_string_len, iostr); + raptor_iostream_write_byte('\n', iostr); + + count = raptor_iostream_tell(iostr); + if(count != expected_bytes_count) { + fprintf(stderr, "%s: %s wrote %d bytes, expected %d\n", program, label, + (int)count, expected_bytes_count); + rc = 1; + } + + tidy: + if(iostr) + raptor_free_iostream(iostr); + + if(rc) + fprintf(stderr, "%s: FAILED Testing %s\n", program, label); + + return rc; +} + + +static int +test_read_from_filename(raptor_world *world, + const char* filename, + const char* test_string, size_t test_string_len, + const int expected_len, + const int expected_len2) +{ + raptor_iostream *iostr = NULL; + char buffer[READ_BUFFER_SIZE]; + int count; + int rc = 0; + const char* const label="read iostream from filename"; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Testing %s '%s'\n", program, label, filename); +#endif + + iostr = raptor_new_iostream_from_filename(world, filename); + if(!iostr) { + fprintf(stderr, "%s: Failed to create %s '%s'\n", program, label, filename); + rc = 1; + goto tidy; + } + + count = raptor_iostream_read_bytes(buffer, 1, test_string_len, iostr); + if(count != expected_len) { + fprintf(stderr, "%s: %s read %d bytes, expected %d\n", program, label, + (int)count, (int)expected_len); + rc = 1; + goto tidy; + } + + count = raptor_iostream_read_bytes(buffer, 1, test_string_len, iostr); + if(count != expected_len2) { + fprintf(stderr, "%s: %s read %d bytes, expected %d\n", program, label, + (int)count, (int)expected_len2); + rc = 1; + goto tidy; + } + + if(!raptor_iostream_read_eof(iostr)) { + fprintf(stderr, "%s: %s not EOF as expected\n", program, label); + rc = 1; + goto tidy; + } + + if(strncmp(buffer, test_string, test_string_len)) { + fprintf(stderr, "%s: %s returned '%s' expected '%s'\n", program, label, + buffer, test_string); + rc = 1; + } + + tidy: + if(iostr) + raptor_free_iostream(iostr); + + if(rc) + fprintf(stderr, "%s: FAILED Testing %s\n", program, label); + + return rc; +} + + +static int +test_read_from_file_handle(raptor_world *world, FILE* handle, + const char* test_string, size_t test_string_len, + const unsigned int expected_len, + const unsigned int expected_len2) +{ + raptor_iostream *iostr = NULL; + char buffer[READ_BUFFER_SIZE]; + unsigned long count; + int rc = 0; + const char* const label="read iostream from file handle"; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Testing %s\n", program, label); +#endif + + iostr = raptor_new_iostream_from_file_handle(world, handle); + if(!iostr) { + fprintf(stderr, "%s: Failed to create %s\n", program, label); + rc = 1; + goto tidy; + } + + count = raptor_iostream_read_bytes(buffer, 1, test_string_len, iostr); + if(count != expected_len) { + fprintf(stderr, "%s: %s read %d bytes, expected %d\n", program, label, + (int)count, (int)expected_len); + rc = 1; + } + + count = raptor_iostream_read_bytes(buffer, 1, test_string_len, iostr); + if(count != expected_len2) { + fprintf(stderr, "%s: %s read %d bytes, expected %d\n", program, label, + (int)count, (int)expected_len2); + rc = 1; + goto tidy; + } + + if(!raptor_iostream_read_eof(iostr)) { + fprintf(stderr, "%s: %s not EOF as expected\n", program, label); + rc = 1; + } + + if(strncmp(buffer, test_string, test_string_len)) { + fprintf(stderr, "%s: %s returned '%s' expected '%s'\n", program, label, + buffer, test_string); + rc = 1; + } + + tidy: + if(iostr) + raptor_free_iostream(iostr); + + if(rc) + fprintf(stderr, "%s: FAILED Testing %s\n", program, label); + + return rc; +} + + +static int +test_read_from_string(raptor_world *world, + const char* test_string, size_t test_string_len, + const unsigned int expected_len) +{ + raptor_iostream *iostr = NULL; + char buffer[READ_BUFFER_SIZE]; + unsigned long count; + int rc = 0; + const char* const label="read iostream from a string"; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Testing %s\n", program, label); +#endif + + iostr = raptor_new_iostream_from_string(world, + (void*)test_string, test_string_len); + if(!iostr) { + fprintf(stderr, "%s: Failed to create %s\n", program, label); + rc = 1; + goto tidy; + } + + count = raptor_iostream_read_bytes(buffer, 1, test_string_len, iostr); + if(count != expected_len) { + fprintf(stderr, "%s: %s read %d bytes, expected %d\n", program, label, + (int)count, (int)expected_len); + rc = 1; + } + + if(!raptor_iostream_read_eof(iostr)) { + fprintf(stderr, "%s: %s not EOF as expected\n", program, label); + rc = 1; + } + + if(strncmp(buffer, test_string, test_string_len)) { + fprintf(stderr, "%s: %s returned '%s' expected '%s'\n", program, label, + buffer, test_string); + rc = 1; + } + + tidy: + if(iostr) + raptor_free_iostream(iostr); + + if(rc) + fprintf(stderr, "%s: FAILED Testing %s\n", program, label); + + return rc; +} + + +static int +test_read_from_sink(raptor_world *world, size_t read_len, size_t expected_len) +{ + raptor_iostream *iostr = NULL; + char buffer[READ_BUFFER_SIZE]; + unsigned long count; + int rc = 0; + const char* const label="read iostream from sink"; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Testing %s\n", program, label); +#endif + expected_len = 0; + iostr = raptor_new_iostream_from_sink(world); + if(!iostr) { + fprintf(stderr, "%s: Failed to create %s\n", program, label); + rc = 1; + goto tidy; + } + + count = raptor_iostream_read_bytes(buffer, 1, read_len, iostr); + if(count != expected_len) { + fprintf(stderr, "%s: %s read %d bytes, expected %d\n", program, label, + (int)count, (int)expected_len); + rc = 1; + } + + if(!raptor_iostream_read_eof(iostr)) { + fprintf(stderr, "%s: %s not EOF as expected\n", program, label); + rc = 1; + } + + tidy: + if(iostr) + raptor_free_iostream(iostr); + + if(rc) + fprintf(stderr, "%s: FAILED Testing %s\n", program, label); + + return rc; +} + + +#define OUT_FILENAME "out.bin" +#define OUT_BYTES_COUNT 14 +#define TEST_STRING "Hello, world!" +#define TEST_STRING_LEN 13 +#define IN_FILENAME "in.bin" + + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + FILE *handle = NULL; + int failures = 0; + + program = raptor_basename(argv[0]); + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + /* Write tests */ + failures+= test_write_to_filename(world, (const char*)OUT_FILENAME, + TEST_STRING, TEST_STRING_LEN, (int)OUT_BYTES_COUNT); + handle = fopen((const char*)OUT_FILENAME, "wb"); + if(!handle) { + fprintf(stderr, "%s: Failed to create write file handle to file %s\n", + program, OUT_FILENAME); + failures++; + } else { + failures+= test_write_to_file_handle(world, + handle, TEST_STRING, TEST_STRING_LEN, + (int)OUT_BYTES_COUNT); + fclose(handle); + remove(OUT_FILENAME); + } + + failures+= test_write_to_string(world, + TEST_STRING, + TEST_STRING_LEN, (int)OUT_BYTES_COUNT); + failures+= test_write_to_sink(world, + TEST_STRING, + TEST_STRING_LEN, (int)OUT_BYTES_COUNT); + + remove(OUT_FILENAME); + + + /* Read tests */ + handle = fopen((const char*)IN_FILENAME, "wb"); + if(!handle) { + fprintf(stderr, "%s: Failed to create write handle to file %s\n", + program, IN_FILENAME); + failures++; + } else { + fwrite(TEST_STRING, 1, TEST_STRING_LEN, handle); + fclose(handle); + + failures+= test_read_from_filename(world, + (const char*)IN_FILENAME, + TEST_STRING, TEST_STRING_LEN, + TEST_STRING_LEN, 0); + handle = fopen((const char*)IN_FILENAME, "rb"); + if(!handle) { + fprintf(stderr, "%s: Failed to create read file handle to file %s\n", + program, IN_FILENAME); + failures++; + } else { + failures+= test_read_from_file_handle(world, + handle, + TEST_STRING, TEST_STRING_LEN, + TEST_STRING_LEN, 0); + fclose(handle); handle = NULL; + } + } + + failures+= test_read_from_string(world, + TEST_STRING, TEST_STRING_LEN, + TEST_STRING_LEN); + failures+= test_read_from_sink(world, TEST_STRING_LEN, 0); + + remove(IN_FILENAME); + + raptor_free_world(world); + + return failures; +} + +#endif diff --git a/src/raptor_json.c b/src/raptor_json.c new file mode 100644 index 0000000..6032c8a --- /dev/null +++ b/src/raptor_json.c @@ -0,0 +1,782 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_json.c - Raptor JSON Parser + * + * RDF/JSON + * http://n2.talis.com/wiki/RDF_JSON_Specification + * + * Copyright (C) 2001-2010, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +#include + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +typedef enum { + RAPTOR_JSON_STATE_ROOT, + RAPTOR_JSON_STATE_MAP_ROOT, + RAPTOR_JSON_STATE_TRIPLES_KEY, + RAPTOR_JSON_STATE_TRIPLES_ARRAY, + RAPTOR_JSON_STATE_TRIPLES_TRIPLE, + RAPTOR_JSON_STATE_TRIPLES_TERM, + RAPTOR_JSON_STATE_RESOURCES_SUBJECT_KEY, + RAPTOR_JSON_STATE_RESOURCES_PREDICATE, + RAPTOR_JSON_STATE_RESOURCES_OBJECT_ARRAY, + RAPTOR_JSON_STATE_RESOURCES_OBJECT +} raptor_json_parse_state; + +typedef enum { + RAPTOR_JSON_TERM_UNKNOWN, + RAPTOR_JSON_TERM_SUBJECT, + RAPTOR_JSON_TERM_PREDICATE, + RAPTOR_JSON_TERM_OBJECT +} raptor_json_term; + +typedef enum { + RAPTOR_JSON_ATTRIB_UNKNOWN, + RAPTOR_JSON_ATTRIB_VALUE, + RAPTOR_JSON_ATTRIB_LANG, + RAPTOR_JSON_ATTRIB_TYPE, + RAPTOR_JSON_ATTRIB_DATATYPE +} raptor_json_term_attrib; + + +/* When YAJL V1 support is dropped, this can be removed */ +#ifdef HAVE_YAJL2 +#define RAPTOR_YAJL_LEN_TYPE size_t +#else +#define RAPTOR_YAJL_LEN_TYPE unsigned int +#endif + +/* + * JSON parser object + */ +struct raptor_json_parser_context_s { +#ifdef HAVE_YAJL2 +#else + yajl_parser_config config; +#endif + yajl_handle handle; + + /* Parser state */ + raptor_json_parse_state state; + raptor_json_term term; + raptor_json_term_attrib attrib; + + /* Temporary storage, while creating terms */ + raptor_term_type term_type; + unsigned char* term_value; + unsigned char* term_datatype; + unsigned char* term_lang; + + /* Temporary storage, while creating statements */ + raptor_statement statement; +}; + +typedef struct raptor_json_parser_context_s raptor_json_parser_context; + + +static void +raptor_json_reset_term(raptor_json_parser_context *context) +{ + if(context->term_value) + RAPTOR_FREE(char*, context->term_value); + if(context->term_lang) + RAPTOR_FREE(char*, context->term_lang); + if(context->term_datatype) + RAPTOR_FREE(char*, context->term_datatype); + + context->term_value = NULL; + context->term_lang = NULL; + context->term_datatype = NULL; + context->term_type = RAPTOR_TERM_TYPE_UNKNOWN; + context->attrib = RAPTOR_JSON_ATTRIB_UNKNOWN; +} + +static unsigned char* +raptor_json_cstring_from_counted_string(raptor_parser *rdf_parser, const unsigned char* str, RAPTOR_YAJL_LEN_TYPE len) +{ + unsigned char *cstr = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!cstr) { + raptor_parser_fatal_error(rdf_parser, "Out of memory"); + return NULL; + } + + memcpy(cstr, str, len); + cstr[len] = '\0'; + + return cstr; +} + +static raptor_term* +raptor_json_new_term_from_counted_string(raptor_parser *rdf_parser, const unsigned char* str, size_t len) +{ + raptor_term *term = NULL; + + if(len > 2 && str[0] == '_' && str[1] == ':') { + const unsigned char *node_id = &str[2]; + term = raptor_new_term_from_counted_blank(rdf_parser->world, node_id, len - 2); + + } else { + raptor_uri *uri = raptor_new_uri_from_counted_string(rdf_parser->world, str, len); + if(!uri) { + unsigned char* cstr = raptor_json_cstring_from_counted_string(rdf_parser, str, RAPTOR_BAD_CAST(int, len)); + raptor_parser_error(rdf_parser, "Could not create uri from '%s'", cstr); + RAPTOR_FREE(char*, cstr); + return NULL; + } + + term = raptor_new_term_from_uri(rdf_parser->world, uri); + raptor_free_uri(uri); + } + + return term; +} + + +static raptor_term* +raptor_json_generate_term(raptor_parser *rdf_parser) +{ + raptor_json_parser_context *context = (raptor_json_parser_context*)rdf_parser->context; + raptor_term *term = NULL; + + if(!context->term_value) { + raptor_parser_error(rdf_parser, "No value for term defined"); + return NULL; + } + + switch(context->term_type) { + case RAPTOR_TERM_TYPE_URI: { + raptor_uri *uri = raptor_new_uri(rdf_parser->world, context->term_value); + if(!uri) { + raptor_parser_error(rdf_parser, "Could not create uri from '%s'", context->term_value); + return NULL; + } + term = raptor_new_term_from_uri(rdf_parser->world, uri); + raptor_free_uri(uri); + break; + } + case RAPTOR_TERM_TYPE_LITERAL: { + raptor_uri *datatype_uri = NULL; + if(context->term_datatype) { + datatype_uri = raptor_new_uri(rdf_parser->world, context->term_datatype); + } + term = raptor_new_term_from_literal(rdf_parser->world, context->term_value, datatype_uri, context->term_lang); + if(datatype_uri) + raptor_free_uri(datatype_uri); + break; + } + case RAPTOR_TERM_TYPE_BLANK: { + unsigned char *node_id = context->term_value; + if(strlen((const char*)node_id) > 2 && node_id[0] == '_' && node_id[1] == ':') { + node_id = &node_id[2]; + } + term = raptor_new_term_from_blank(rdf_parser->world, node_id); + break; + } + case RAPTOR_TERM_TYPE_UNKNOWN: + raptor_parser_error(rdf_parser, "No type for term defined"); + break; + } + + return term; +} + + +static int raptor_json_yajl_null(void * ctx) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_parser_error(rdf_parser, "Nulls are not valid in RDF/JSON"); + return 0; +} + +static int raptor_json_yajl_boolean(void * ctx, int b) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_parser_error(rdf_parser, "Booleans are not valid in RDF/JSON"); + return 0; +} + +#ifdef HAVE_YAJL2 +#define YAJL_INTEGER_CALLBACK_ARG_TYPE long long +#else +#define YAJL_INTEGER_CALLBACK_ARG_TYPE long +#endif +PRAGMA_IGNORE_WARNING_LONG_LONG_START +static int raptor_json_yajl_integer(void * ctx, + YAJL_INTEGER_CALLBACK_ARG_TYPE integerVal) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_parser_error(rdf_parser, "Integers are not valid in RDF/JSON"); + return 0; +} +PRAGMA_IGNORE_WARNING_END + +static int raptor_json_yajl_double(void * ctx, double d) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_parser_error(rdf_parser, "Floats are not valid in RDF/JSON"); + return 0; +} + +static int raptor_json_yajl_string(void * ctx, const unsigned char * str, + RAPTOR_YAJL_LEN_TYPE len) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_json_parser_context *context; + context = (raptor_json_parser_context*)rdf_parser->context; + + if(context->state == RAPTOR_JSON_STATE_TRIPLES_TERM || + context->state == RAPTOR_JSON_STATE_RESOURCES_OBJECT) { + switch(context->attrib) { + case RAPTOR_JSON_ATTRIB_VALUE: + context->term_value = raptor_json_cstring_from_counted_string(rdf_parser, str, len); + break; + case RAPTOR_JSON_ATTRIB_LANG: + context->term_lang = raptor_json_cstring_from_counted_string(rdf_parser, str, len); + break; + case RAPTOR_JSON_ATTRIB_TYPE: + if(!strncmp((const char*)str, "uri", len)) { + context->term_type = RAPTOR_TERM_TYPE_URI; + } else if(!strncmp((const char*)str, "literal", len)) { + context->term_type = RAPTOR_TERM_TYPE_LITERAL; + } else if(!strncmp((const char*)str, "bnode", len)) { + context->term_type = RAPTOR_TERM_TYPE_BLANK; + } else { + unsigned char * cstr = raptor_json_cstring_from_counted_string(rdf_parser, str, len); + context->term_type = RAPTOR_TERM_TYPE_UNKNOWN; + raptor_parser_error(rdf_parser, "Unknown term type: %s", cstr); + RAPTOR_FREE(char*, cstr); + } + break; + case RAPTOR_JSON_ATTRIB_DATATYPE: + context->term_datatype = raptor_json_cstring_from_counted_string(rdf_parser, str, len); + break; + case RAPTOR_JSON_ATTRIB_UNKNOWN: + default: + raptor_parser_error(rdf_parser, "Unsupported term attribute in raptor_json_string"); + break; + } + } else { + raptor_parser_error(rdf_parser, "Unexpected JSON string"); + return 0; + } + return 1; +} + +static int raptor_json_yajl_map_key(void * ctx, const unsigned char * str, + RAPTOR_YAJL_LEN_TYPE len) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_json_parser_context *context; + context = (raptor_json_parser_context*)rdf_parser->context; + + if(context->state == RAPTOR_JSON_STATE_MAP_ROOT) { + if(!strncmp((const char*)str, "triples", len)) { + context->state = RAPTOR_JSON_STATE_TRIPLES_KEY; + return 1; + } else { + if(context->statement.subject) + raptor_free_term(context->statement.subject); + context->statement.subject = raptor_json_new_term_from_counted_string(rdf_parser, str, len); + if(!context->statement.subject) + return 0; + context->state = RAPTOR_JSON_STATE_RESOURCES_SUBJECT_KEY; + return 1; + } + } else if(context->state == RAPTOR_JSON_STATE_RESOURCES_PREDICATE) { + if(context->statement.predicate) + raptor_free_term(context->statement.predicate); + context->statement.predicate = raptor_json_new_term_from_counted_string(rdf_parser, str, len); + if(!context->statement.predicate) + return 0; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_TRIPLE) { + if(!strncmp((const char*)str, "subject", len)) { + context->term = RAPTOR_JSON_TERM_SUBJECT; + return 1; + } else if(!strncmp((const char*)str, "predicate", len)) { + context->term = RAPTOR_JSON_TERM_PREDICATE; + return 1; + } else if(!strncmp((const char*)str, "object", len)) { + context->term = RAPTOR_JSON_TERM_OBJECT; + return 1; + } else { + raptor_parser_error(rdf_parser, "Unexpected JSON key name in triple definition"); + return 0; + } + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_TERM || + context->state == RAPTOR_JSON_STATE_RESOURCES_OBJECT) { + if(!strncmp((const char*)str, "value", len)) { + context->attrib = RAPTOR_JSON_ATTRIB_VALUE; + return 1; + } else if(!strncmp((const char*)str, "type", len)) { + context->attrib = RAPTOR_JSON_ATTRIB_TYPE; + return 1; + } else if(!strncmp((const char*)str, "datatype", len)) { + context->attrib = RAPTOR_JSON_ATTRIB_DATATYPE; + return 1; + } else if(!strncmp((const char*)str, "lang", len)) { + context->attrib = RAPTOR_JSON_ATTRIB_LANG; + return 1; + } else { + context->attrib = RAPTOR_JSON_ATTRIB_UNKNOWN; + raptor_parser_error(rdf_parser, "Unexpected key name in triple definition"); + return 0; + } + } else { + raptor_parser_error(rdf_parser, "Unexpected JSON map key"); + return 0; + } +} + +static int raptor_json_yajl_start_map(void * ctx) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_json_parser_context *context; + context = (raptor_json_parser_context*)rdf_parser->context; + + if(context->state == RAPTOR_JSON_STATE_ROOT) { + context->state = RAPTOR_JSON_STATE_MAP_ROOT; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_RESOURCES_SUBJECT_KEY) { + context->state = RAPTOR_JSON_STATE_RESOURCES_PREDICATE; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_RESOURCES_OBJECT_ARRAY) { + context->state = RAPTOR_JSON_STATE_RESOURCES_OBJECT; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_ARRAY) { + raptor_statement_clear(&context->statement); + context->term = RAPTOR_JSON_TERM_UNKNOWN; + context->state = RAPTOR_JSON_STATE_TRIPLES_TRIPLE; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_TRIPLE) { + context->state = RAPTOR_JSON_STATE_TRIPLES_TERM; + raptor_json_reset_term(context); + return 1; + } else { + raptor_parser_error(rdf_parser, "Unexpected start of JSON map"); + return 0; + } +} + + +static int raptor_json_yajl_end_map(void * ctx) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_json_parser_context *context; + context = (raptor_json_parser_context*)rdf_parser->context; + + if(context->state == RAPTOR_JSON_STATE_RESOURCES_OBJECT) { + context->statement.object = raptor_json_generate_term(rdf_parser); + if(!context->statement.object) + return 0; + + /* Generate the statement */ + (*rdf_parser->statement_handler)(rdf_parser->user_data, &context->statement); + + raptor_free_term(context->statement.object); + context->statement.object = NULL; + raptor_json_reset_term(context); + + context->state = RAPTOR_JSON_STATE_RESOURCES_OBJECT_ARRAY; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_RESOURCES_PREDICATE) { + context->state = RAPTOR_JSON_STATE_MAP_ROOT; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_TERM) { + raptor_term *term = raptor_json_generate_term(rdf_parser); + if(!term) + return 0; + + /* Store the term in the statement */ + switch(context->term) { + case RAPTOR_JSON_TERM_SUBJECT: + if(context->statement.subject) + raptor_free_term(context->statement.subject); + context->statement.subject = term; + break; + case RAPTOR_JSON_TERM_PREDICATE: + if(context->statement.predicate) + raptor_free_term(context->statement.predicate); + context->statement.predicate = term; + break; + case RAPTOR_JSON_TERM_OBJECT: + if(context->statement.object) + raptor_free_term(context->statement.object); + context->statement.object = term; + break; + case RAPTOR_JSON_TERM_UNKNOWN: + default: + raptor_parser_error(rdf_parser, "Unknown term in raptor_json_end_map"); + break; + } + + context->state = RAPTOR_JSON_STATE_TRIPLES_TRIPLE; + raptor_json_reset_term(context); + return 1; + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_TRIPLE) { + if(!context->statement.subject) { + raptor_parser_error(rdf_parser, "Triple is missing a subject term"); + return 0; + } else if(!context->statement.predicate) { + raptor_parser_error(rdf_parser, "Triple is missing a predicate term"); + return 0; + } else if(!context->statement.object) { + raptor_parser_error(rdf_parser, "Triple is missing a object term"); + return 0; + } else { + /* Generate the statement */ + (*rdf_parser->statement_handler)(rdf_parser->user_data, &context->statement); + } + raptor_statement_clear(&context->statement); + context->state = RAPTOR_JSON_STATE_TRIPLES_ARRAY; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_KEY) { + context->state = RAPTOR_JSON_STATE_MAP_ROOT; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_MAP_ROOT) { + context->state = RAPTOR_JSON_STATE_ROOT; + return 1; + } else { + raptor_parser_error(rdf_parser, "Unexpected end of JSON map"); + return 0; + } +} + +static int raptor_json_yajl_start_array(void * ctx) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_json_parser_context *context; + context = (raptor_json_parser_context*)rdf_parser->context; + + if(context->state == RAPTOR_JSON_STATE_RESOURCES_PREDICATE) { + context->state = RAPTOR_JSON_STATE_RESOURCES_OBJECT_ARRAY; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_KEY) { + context->state = RAPTOR_JSON_STATE_TRIPLES_ARRAY; + return 1; + } else { + raptor_parser_error(rdf_parser, "Unexpected start of array"); + return 0; + } +} + +static int raptor_json_yajl_end_array(void * ctx) +{ + raptor_parser* rdf_parser = (raptor_parser*)ctx; + raptor_json_parser_context *context; + context = (raptor_json_parser_context*)rdf_parser->context; + + if(context->state == RAPTOR_JSON_STATE_RESOURCES_OBJECT_ARRAY) { + context->state = RAPTOR_JSON_STATE_RESOURCES_PREDICATE; + return 1; + } else if(context->state == RAPTOR_JSON_STATE_TRIPLES_ARRAY) { + context->state = RAPTOR_JSON_STATE_MAP_ROOT; + return 1; + } else { + raptor_parser_error(rdf_parser, "Unexpected end of array"); + return 0; + } +} + + +static void* +raptor_json_yajl_malloc(void *ctx, RAPTOR_YAJL_LEN_TYPE sz) +{ + return RAPTOR_MALLOC(void*, sz); +} + +static void* +raptor_json_yajl_realloc(void *ctx, void * ptr, RAPTOR_YAJL_LEN_TYPE sz) +{ + return RAPTOR_REALLOC(void*, ptr, sz); +} + +static void +raptor_json_yajl_free(void *ctx, void * ptr) +{ + RAPTOR_FREE(char*, ptr); +} + +static yajl_alloc_funcs raptor_json_yajl_alloc_funcs = { + raptor_json_yajl_malloc, + raptor_json_yajl_realloc, + raptor_json_yajl_free, + NULL +}; + +static yajl_callbacks raptor_json_yajl_callbacks = { + raptor_json_yajl_null, + raptor_json_yajl_boolean, + raptor_json_yajl_integer, + raptor_json_yajl_double, + NULL, + raptor_json_yajl_string, + raptor_json_yajl_start_map, + raptor_json_yajl_map_key, + raptor_json_yajl_end_map, + raptor_json_yajl_start_array, + raptor_json_yajl_end_array +}; + + + +/** + * raptor_json_parse_init: + * + * Initialise the Raptor JSON parser. + * + * Return value: non 0 on failure + **/ + +static int +raptor_json_parse_init(raptor_parser* rdf_parser, const char *name) +{ + raptor_json_parser_context *context; + context = (raptor_json_parser_context*)rdf_parser->context; + + /* Initialse the static statement */ + raptor_statement_init(&context->statement, rdf_parser->world); + + /* Configure the parser */ +#ifdef HAVE_YAJL2 +#else + context->config.allowComments = 1; + context->config.checkUTF8 = 0; +#endif + + return 0; +} + + +/* + * raptor_json_parse_terminate - Free the Raptor JSON parser + * @rdf_parser: parser object + * + **/ +static void +raptor_json_parse_terminate(raptor_parser* rdf_parser) +{ + raptor_json_parser_context *context; + context = (raptor_json_parser_context*)rdf_parser->context; + + if(context->handle) + yajl_free(context->handle); + + raptor_json_reset_term(context); + raptor_statement_clear(&context->statement); +} + + + +static int +raptor_json_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *s, size_t len, + int is_end) +{ + raptor_json_parser_context *context = (raptor_json_parser_context*)rdf_parser->context; + yajl_status status; + int result = 0; + + if(len) { + /* Parse the chunk passed to us */ + status = yajl_parse(context->handle, s, RAPTOR_BAD_CAST(int, len)); + + if(status != yajl_status_ok +#ifdef HAVE_YAJL2 +#else + && status != yajl_status_insufficient_data +#endif + ) + { + unsigned char * str = yajl_get_error(context->handle, 1, s, RAPTOR_BAD_CAST(int, len)); + raptor_parser_error(rdf_parser, "YAJL error: %s", (const char *) str); + result = 1; + yajl_free_error(context->handle, str); + } + } + + if(is_end) { + /* parse any remaining buffered data */ +#ifdef HAVE_YAJL2 +#else +#define yajl_complete_parse(h) yajl_parse_complete(h) +#endif + status = yajl_complete_parse(context->handle); + + if(status != yajl_status_ok) + { + unsigned char * str = yajl_get_error(context->handle, 0, NULL, 0); + raptor_parser_error(rdf_parser, "YAJL error: %s", (const char *) str); + result = 1; + yajl_free_error(context->handle, str); + } + + raptor_json_reset_term(context); + raptor_statement_clear(&context->statement); + } + + return result; +} + + +static int +raptor_json_parse_start(raptor_parser* rdf_parser) +{ + raptor_json_parser_context *context = (raptor_json_parser_context*)rdf_parser->context; + + /* Destroy the old parser */ + if(context->handle) + yajl_free(context->handle); + + /* Initialise a new parser */ + context->handle = yajl_alloc( + &raptor_json_yajl_callbacks, +#ifdef HAVE_YAJL2 +#else + &context->config, +#endif + &raptor_json_yajl_alloc_funcs, + (void *)rdf_parser + ); + + if(!context->handle) { + raptor_parser_fatal_error(rdf_parser, "Failed to initialise YAJL parser"); + return 1; + } + + /* Initialise the parse state */ +#ifdef HAVE_YAJL2 + yajl_config(context->handle, yajl_allow_comments, 1); + yajl_config(context->handle, yajl_dont_validate_strings, 1); +#else +#endif + + context->state = RAPTOR_JSON_STATE_ROOT; + raptor_json_reset_term(context); + raptor_statement_clear(&context->statement); + + return 0; +} + + +static int +raptor_json_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + unsigned int pos = 0; + int score = 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "json")) + score = 8; + if(!strcmp((const char*)suffix, "js")) + score = 3; + } else if(identifier) { + if(strstr((const char*)identifier, "json")) + score = 4; + } + + if(mime_type && strstr((const char*)mime_type, "json")) + score += 6; + + /* Is the first non-whitespace character a curly brace? */ + while(posdesc.names = json_names; + + factory->desc.mime_types = json_types; + + factory->desc.label = "RDF/JSON (either Triples or Resource-Centric)"; + factory->desc.uri_strings = json_uri_strings; + + factory->desc.flags = 0; + + factory->context_length = sizeof(raptor_json_parser_context); + + factory->init = raptor_json_parse_init; + factory->terminate = raptor_json_parse_terminate; + factory->start = raptor_json_parse_start; + factory->chunk = raptor_json_parse_chunk; + factory->recognise_syntax = raptor_json_parse_recognise_syntax; + + return rc; +} + + +int +raptor_init_parser_json(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_json_parser_register_factory); +} diff --git a/src/raptor_json_writer.c b/src/raptor_json_writer.c new file mode 100644 index 0000000..dd57be0 --- /dev/null +++ b/src/raptor_json_writer.c @@ -0,0 +1,345 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_json_writer.c - Raptor JSON Writer + * + * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_LIMITS_H +#include +#endif + + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#ifndef STANDALONE + +struct raptor_json_writer_s { + raptor_world* world; + + raptor_uri* base_uri; + + /* outputting to this iostream */ + raptor_iostream *iostr; + + /* current indent */ + int indent; + + /* indent step */ + int indent_step; +}; + + + +/** + * raptor_new_json_writer: + * @world: raptor_world object + * @base_uri: Base URI for the writer + * @iostr: I/O stream to write to + * + * INTERNAL - Constructor - Create a new JSON writer writing to a raptor_iostream + * + * Return value: a new #raptor_json_writer object or NULL on failure + **/ +raptor_json_writer* +raptor_new_json_writer(raptor_world* world, + raptor_uri* base_uri, + raptor_iostream* iostr) +{ + raptor_json_writer* json_writer; + + json_writer = RAPTOR_CALLOC(raptor_json_writer*, 1, sizeof(*json_writer)); + + if(!json_writer) + return NULL; + + json_writer->world = world; + json_writer->iostr = iostr; + json_writer->base_uri = base_uri; + + json_writer->indent_step = 2; + + return json_writer; +} + + +/** + * raptor_free_json_writer: + * @json_writer: JSON writer object + * + * INTERNAL - Destructor - Free JSON Writer + * + **/ +void +raptor_free_json_writer(raptor_json_writer* json_writer) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(json_writer, raptor_json_writer); + + RAPTOR_FREE(raptor_json_writer, json_writer); +} + + +static int +raptor_json_writer_quoted(raptor_json_writer* json_writer, + const char *value, size_t value_len) +{ + int rc = 0; + + if(!value) { + raptor_iostream_counted_string_write("\"\"", 2, json_writer->iostr); + return 0; + } + + raptor_iostream_write_byte('\"', json_writer->iostr); + rc = raptor_string_escaped_write((const unsigned char*)value, value_len, + '"', RAPTOR_ESCAPED_WRITE_JSON_LITERAL, + json_writer->iostr); + raptor_iostream_write_byte('\"', json_writer->iostr); + + return rc; +} + + +static int +raptor_json_writer_spaces(raptor_json_writer* json_writer, int depth) +{ + int i; + for(i = 0; i < depth; i++) + raptor_iostream_write_byte(' ', json_writer->iostr); + return 0; +} + + +int +raptor_json_writer_newline(raptor_json_writer* json_writer) +{ + raptor_iostream_write_byte('\n', json_writer->iostr); + if(json_writer->indent) + raptor_json_writer_spaces(json_writer, json_writer->indent); + return 0; +} + + +int +raptor_json_writer_key_value(raptor_json_writer* json_writer, + const char* key, size_t key_len, + const char* value, size_t value_len) +{ + if(!key_len && key) + key_len = strlen(key); + if(!value_len && value) + value_len = strlen(value); + + raptor_json_writer_quoted(json_writer, key, key_len); + raptor_iostream_counted_string_write(" : ", 3, json_writer->iostr); + raptor_json_writer_quoted(json_writer, value, value_len); + + return 0; +} + + +int +raptor_json_writer_key_uri_value(raptor_json_writer* json_writer, + const char* key, size_t key_len, + raptor_uri* uri) +{ + const char* value; + size_t value_len; + int rc = 0; + + value = (const char*)raptor_uri_to_relative_counted_uri_string(json_writer->base_uri, uri, &value_len); + if(!value) + return 1; + + if(key) + rc = raptor_json_writer_key_value(json_writer, key, key_len, + value, value_len); + else + rc = raptor_json_writer_quoted(json_writer, value, value_len); + + RAPTOR_FREE(char*, value); + + return rc; +} + + +int +raptor_json_writer_start_block(raptor_json_writer* json_writer, char c) +{ + json_writer->indent += json_writer->indent_step; + raptor_iostream_write_byte(c, json_writer->iostr); + return 0; +} + + +int +raptor_json_writer_end_block(raptor_json_writer* json_writer, char c) +{ + raptor_iostream_write_byte(c, json_writer->iostr); + json_writer->indent -= json_writer->indent_step; + return 0; +} + + +int +raptor_json_writer_literal_object(raptor_json_writer* json_writer, + unsigned char* s, size_t s_len, + unsigned char* lang, + raptor_uri* datatype) +{ + raptor_json_writer_start_block(json_writer, '{'); + raptor_json_writer_newline(json_writer); + + raptor_iostream_counted_string_write("\"value\" : ", 10, json_writer->iostr); + + raptor_json_writer_quoted(json_writer, (const char*)s, s_len); + + if(datatype || lang) { + raptor_iostream_write_byte(',', json_writer->iostr); + raptor_json_writer_newline(json_writer); + + if(datatype) + raptor_json_writer_key_uri_value(json_writer, "datatype", 8, datatype); + + if(lang) { + if(datatype) { + raptor_iostream_write_byte(',', json_writer->iostr); + raptor_json_writer_newline(json_writer); + } + + raptor_json_writer_key_value(json_writer, "lang", 4, + (const char*)lang, 0); + } + } + + raptor_iostream_write_byte(',', json_writer->iostr); + raptor_json_writer_newline(json_writer); + + raptor_json_writer_key_value(json_writer, "type", 4, "literal", 7); + + raptor_json_writer_newline(json_writer); + + raptor_json_writer_end_block(json_writer, '}'); + raptor_json_writer_newline(json_writer); + + return 0; +} + + +int +raptor_json_writer_blank_object(raptor_json_writer* json_writer, + const unsigned char* blank, + size_t blank_len) +{ + raptor_json_writer_start_block(json_writer, '{'); + raptor_json_writer_newline(json_writer); + + raptor_iostream_counted_string_write("\"value\" : \"_:", 13, + json_writer->iostr); + raptor_iostream_counted_string_write((const char*)blank, blank_len, + json_writer->iostr); + raptor_iostream_counted_string_write("\",", 2, json_writer->iostr); + raptor_json_writer_newline(json_writer); + + raptor_iostream_counted_string_write("\"type\" : \"bnode\"", 16, + json_writer->iostr); + raptor_json_writer_newline(json_writer); + + raptor_json_writer_end_block(json_writer, '}'); + return 0; +} + + +int +raptor_json_writer_uri_object(raptor_json_writer* json_writer, + raptor_uri* uri) +{ + raptor_json_writer_start_block(json_writer, '{'); + raptor_json_writer_newline(json_writer); + + raptor_json_writer_key_uri_value(json_writer, "value", 5, uri); + raptor_iostream_write_byte(',', json_writer->iostr); + raptor_json_writer_newline(json_writer); + + raptor_iostream_counted_string_write("\"type\" : \"uri\"", 14, + json_writer->iostr); + raptor_json_writer_newline(json_writer); + + raptor_json_writer_end_block(json_writer, '}'); + + return 0; +} + + +int +raptor_json_writer_term(raptor_json_writer* json_writer, + raptor_term *term) +{ + int rc = 0; + + switch(term->type) { + case RAPTOR_TERM_TYPE_URI: + rc = raptor_json_writer_uri_object(json_writer, term->value.uri); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + rc = raptor_json_writer_literal_object(json_writer, + term->value.literal.string, + term->value.literal.string_len, + term->value.literal.language, + term->value.literal.datatype); + break; + + case RAPTOR_TERM_TYPE_BLANK: + rc = raptor_json_writer_blank_object(json_writer, + term->value.blank.string, + term->value.blank.string_len); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(json_writer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, + "Triple has unsupported term type %u", + term->type); + rc = 1; + break; + } + + return rc; +} + +#endif diff --git a/src/raptor_librdfa.c b/src/raptor_librdfa.c new file mode 100644 index 0000000..60eded0 --- /dev/null +++ b/src/raptor_librdfa.c @@ -0,0 +1,398 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_librdfa.c - Raptor RDFA Parser via librdfa implementation + * + * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#include "rdfa.h" +#include "rdfa_utils.h" + + +#define RAPTOR_DEFAULT_RDFA_VERSION 0 + +/* + * RDFA parser object + */ +struct raptor_librdfa_parser_context_s { + /* librdfa object */ + rdfacontext* context; + + /* static statement for use in passing to user code */ + raptor_statement statement; + + /* 10 for 1.0 11 for 1.1 or otherwise is default (== 1.1) */ + int rdfa_version; +}; + + +typedef struct raptor_librdfa_parser_context_s raptor_librdfa_parser_context; + + +static int +raptor_librdfa_parse_init(raptor_parser* rdf_parser, const char *name) +{ + raptor_librdfa_parser_context *librdfa_parser; + int rdfa_version = RAPTOR_DEFAULT_RDFA_VERSION; + + librdfa_parser = (raptor_librdfa_parser_context*)rdf_parser->context; + + raptor_statement_init(&rdf_parser->statement, rdf_parser->world); + + if(!strcmp(name, "rdfa11")) + rdfa_version = 11; + else if(!strcmp(name, "rdfa10")) + rdfa_version = 10; + + librdfa_parser->rdfa_version = rdfa_version; + + return 0; +} + + +static void +raptor_librdfa_parse_terminate(raptor_parser* rdf_parser) +{ + raptor_librdfa_parser_context *librdfa_parser; + + librdfa_parser = (raptor_librdfa_parser_context*)rdf_parser->context; + + if(librdfa_parser->context) { + rdfa_parse_end(librdfa_parser->context); + rdfa_free_context(librdfa_parser->context); + librdfa_parser->context = NULL; + } +} + + +static void +raptor_librdfa_generate_statement(rdftriple* triple, void* callback_data) +{ + raptor_parser* parser = (raptor_parser*)callback_data; + raptor_statement *s = &parser->statement; + raptor_term *subject_term = NULL; + raptor_term *predicate_term = NULL; + raptor_uri *predicate_uri = NULL; + raptor_term *object_term = NULL; + + if(!parser->emitted_default_graph) { + raptor_parser_start_graph(parser, NULL, 0); + parser->emitted_default_graph++; + } + + if(!parser->statement_handler) + goto cleanup; + + if(!triple->subject || !triple->predicate || !triple->object) { +#ifdef RAPTOR_DEBUG + RAPTOR_FATAL1("Triple has NULL parts\n"); +#else + rdfa_free_triple(triple); + return; +#endif + } + + if(triple->predicate[0] == '_') { + raptor_parser_warning(parser, + "Ignoring RDFa triple with blank node predicate %s.", + triple->predicate); + rdfa_free_triple(triple); + return; + } + + if(triple->object_type == RDF_TYPE_NAMESPACE_PREFIX) { +#ifdef RAPTOR_DEBUG + RAPTOR_FATAL1("Triple has namespace object type\n"); +#else + rdfa_free_triple(triple); + return; +#endif + } + + if((triple->subject[0] == '_') && (triple->subject[1] == ':')) { + subject_term = raptor_new_term_from_blank(parser->world, + (const unsigned char*)triple->subject + 2); + } else { + raptor_uri* subject_uri; + + subject_uri = raptor_new_uri(parser->world, + (const unsigned char*)triple->subject); + subject_term = raptor_new_term_from_uri(parser->world, subject_uri); + raptor_free_uri(subject_uri); + subject_uri = NULL; + } + s->subject = subject_term; + + + predicate_uri = raptor_new_uri(parser->world, + (const unsigned char*)triple->predicate); + if(!predicate_uri) + goto cleanup; + + predicate_term = raptor_new_term_from_uri(parser->world, predicate_uri); + raptor_free_uri(predicate_uri); + predicate_uri = NULL; + s->predicate = predicate_term; + + + if(triple->object_type == RDF_TYPE_IRI) { + if((triple->object[0] == '_') && (triple->object[1] == ':')) { + object_term = raptor_new_term_from_blank(parser->world, + (const unsigned char*)triple->object + 2); + } else { + raptor_uri* object_uri; + object_uri = raptor_new_uri(parser->world, + (const unsigned char*)triple->object); + if(!object_uri) + goto cleanup; + + object_term = raptor_new_term_from_uri(parser->world, object_uri); + raptor_free_uri(object_uri); + } + } else if(triple->object_type == RDF_TYPE_PLAIN_LITERAL) { + object_term = raptor_new_term_from_literal(parser->world, + (const unsigned char*)triple->object, + NULL, + (const unsigned char*)triple->language); + + } else if(triple->object_type == RDF_TYPE_XML_LITERAL) { + raptor_uri* datatype_uri; + datatype_uri = raptor_new_uri_from_counted_string(parser->world, + (const unsigned char*)raptor_xml_literal_datatype_uri_string, + raptor_xml_literal_datatype_uri_string_len); + object_term = raptor_new_term_from_literal(parser->world, + (const unsigned char*)triple->object, + datatype_uri, + NULL); + raptor_free_uri(datatype_uri); + } else if(triple->object_type == RDF_TYPE_TYPED_LITERAL) { + raptor_uri *datatype_uri = NULL; + const unsigned char* language = (const unsigned char*)triple->language; + + if(triple->datatype) { + /* If datatype, no language allowed */ + language = NULL; + datatype_uri = raptor_new_uri(parser->world, + (const unsigned char*)triple->datatype); + if(!datatype_uri) + goto cleanup; + } + + object_term = raptor_new_term_from_literal(parser->world, + (const unsigned char*)triple->object, + datatype_uri, + language); + raptor_free_uri(datatype_uri); + } else { + raptor_log_error_formatted(parser->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Triple has unknown object term type %u", + s->object->type); + goto cleanup; + } + s->object = object_term; + + /* Generate statement */ + (*parser->statement_handler)(parser->user_data, s); + + cleanup: + rdfa_free_triple(triple); + + if(subject_term) + raptor_free_term(subject_term); + if(predicate_term) + raptor_free_term(predicate_term); + if(object_term) + raptor_free_term(object_term); +} + + +static void +raptor_librdfa_sax2_new_namespace_handler(void *user_data, + raptor_namespace* nspace) +{ + raptor_parser* rdf_parser; + rdf_parser = (raptor_parser*)user_data; + raptor_parser_start_namespace(rdf_parser, nspace); +} + + + +static int +raptor_librdfa_parse_start(raptor_parser* rdf_parser) +{ + raptor_locator *locator = &rdf_parser->locator; + raptor_librdfa_parser_context *librdfa_parser; + int rc; + char* base_uri_string = NULL; + + librdfa_parser = (raptor_librdfa_parser_context*)rdf_parser->context; + + locator->line = -1; + locator->column = -1; + locator->byte = 0; + + if(rdf_parser->base_uri) + base_uri_string = (char*)raptor_uri_as_string(rdf_parser->base_uri); + else + /* base URI is required for rdfa - checked in rdfa_create_context() */ + return 1; + + if(librdfa_parser->context) + rdfa_free_context(librdfa_parser->context); + librdfa_parser->context = rdfa_create_context(base_uri_string); + if(!librdfa_parser->context) + return 1; + + librdfa_parser->context->namespace_handler = raptor_librdfa_sax2_new_namespace_handler; + librdfa_parser->context->namespace_handler_user_data = rdf_parser; + librdfa_parser->context->world = rdf_parser->world; + librdfa_parser->context->locator = &rdf_parser->locator; + + librdfa_parser->context->callback_data = rdf_parser; + /* returns triples */ + rdfa_set_default_graph_triple_handler(librdfa_parser->context, + raptor_librdfa_generate_statement); + + /* returns RDFa Processing Graph error triples - not used by raptor */ + rdfa_set_processor_graph_triple_handler(librdfa_parser->context, NULL); + + librdfa_parser->context->raptor_rdfa_version = librdfa_parser->rdfa_version; + + rc = rdfa_parse_start(librdfa_parser->context); + if(rc != RDFA_PARSE_SUCCESS) + return 1; + + return 0; +} + + +static int +raptor_librdfa_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *s, size_t len, + int is_end) +{ + raptor_librdfa_parser_context *librdfa_parser; + int rval; + + librdfa_parser = (raptor_librdfa_parser_context*)rdf_parser->context; + rval = rdfa_parse_chunk(librdfa_parser->context, (char*)s, len, is_end); + + if(is_end) { + if(rdf_parser->emitted_default_graph) { + raptor_parser_end_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph--; + } + } + + return rval != RDFA_PARSE_SUCCESS; +} + +static int +raptor_librdfa_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score = 0; + + if(identifier) { + if(strstr((const char*)identifier, "RDFa")) + score = 10; + } + + if(buffer && len) { +#define HAS_RDFA_1 (raptor_memstr((const char*)buffer, len, "-//W3C//DTD XHTML+RDFa 1.0//EN") != NULL) +#define HAS_RDFA_2 (raptor_memstr((const char*)buffer, len, "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd") != NULL) + + if(HAS_RDFA_1 || HAS_RDFA_2) + score = 10; + } + + return score; +} + + +static const char* const rdfa_names[4] = { "rdfa", "rdfa11", "rdfa10", NULL }; + +static const char* const rdfa_uri_strings[3] = { + "http://www.w3.org/ns/formats/RDFa", + "http://www.w3.org/TR/rdfa/", + NULL +}; + +#define RDFA_TYPES_COUNT 2 +static const raptor_type_q html_types[RDFA_TYPES_COUNT + 1] = { + { "text/html", 9, 6}, + { "application/xhtml+xml", 21, 8}, + { NULL, 0, 0} +}; + +static int +raptor_librdfa_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = rdfa_names; + + factory->desc.mime_types = html_types; + + factory->desc.label = "RDF/A via librdfa"; + factory->desc.uri_strings = rdfa_uri_strings; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_librdfa_parser_context); + + factory->init = raptor_librdfa_parse_init; + factory->terminate = raptor_librdfa_parse_terminate; + factory->start = raptor_librdfa_parse_start; + factory->chunk = raptor_librdfa_parse_chunk; + factory->recognise_syntax = raptor_librdfa_parse_recognise_syntax; + + return rc; +} + + +int +raptor_init_parser_rdfa(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_librdfa_parser_register_factory); +} diff --git a/src/raptor_libxml.c b/src/raptor_libxml.c new file mode 100644 index 0000000..538c2c8 --- /dev/null +++ b/src/raptor_libxml.c @@ -0,0 +1,889 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_libxml.c - Raptor libxml functions + * + * Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifdef RAPTOR_XML_LIBXML + + +/* prototypes */ +static void raptor_libxml_warning(void* user_data, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 3); +static void raptor_libxml_error_common(void* user_data, const char *msg, va_list args, const char *prefix, int is_fatal) RAPTOR_PRINTF_FORMAT(2, 0); +static void raptor_libxml_error(void *context, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 3); +static void raptor_libxml_fatal_error(void *context, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +static void raptor_libxml_xmlStructuredError_handler_global(void *user_data, xmlErrorPtr err); +static void raptor_libxml_xmlStructuredError_handler_parsing(void *user_data, xmlErrorPtr err); + + + +static const char* const xml_warning_prefix="XML parser warning - "; +static const char* const xml_error_prefix="XML parser error - "; +static const char* const xml_generic_error_prefix="XML error - "; +static const char* const xml_fatal_error_prefix="XML parser fatal error - "; +static const char* const xml_validation_error_prefix="XML parser validation error - "; +static const char* const xml_validation_warning_prefix="XML parser validation warning - "; + + +#ifdef HAVE_XMLSAX2INTERNALSUBSET +/* SAX2 - 2.6.0 or later */ +#define libxml2_internalSubset xmlSAX2InternalSubset +#define libxml2_externalSubset xmlSAX2ExternalSubset +#define libxml2_isStandalone xmlSAX2IsStandalone +#define libxml2_hasInternalSubset xmlSAX2HasInternalSubset +#define libxml2_hasExternalSubset xmlSAX2HasExternalSubset +#define libxml2_resolveEntity xmlSAX2ResolveEntity +#define libxml2_getEntity xmlSAX2GetEntity +#define libxml2_getParameterEntity xmlSAX2GetParameterEntity +#define libxml2_entityDecl xmlSAX2EntityDecl +#define libxml2_unparsedEntityDecl xmlSAX2UnparsedEntityDecl +#define libxml2_startDocument xmlSAX2StartDocument +#define libxml2_endDocument xmlSAX2EndDocument +#else +/* SAX1 - before libxml2 2.6.0 */ +#define libxml2_internalSubset internalSubset +#define libxml2_externalSubset externalSubset +#define libxml2_isStandalone isStandalone +#define libxml2_hasInternalSubset hasInternalSubset +#define libxml2_hasExternalSubset hasExternalSubset +#define libxml2_resolveEntity resolveEntity +#define libxml2_getEntity getEntity +#define libxml2_getParameterEntity getParameterEntity +#define libxml2_entityDecl entityDecl +#define libxml2_unparsedEntityDecl unparsedEntityDecl +#define libxml2_startDocument startDocument +#define libxml2_endDocument endDocument +#endif + + +static void +raptor_libxml_internalSubset(void* user_data, const xmlChar *name, + const xmlChar *ExternalID, const xmlChar *SystemID) { + raptor_sax2* sax2 = (raptor_sax2*)user_data; + libxml2_internalSubset(sax2->xc, name, ExternalID, SystemID); +} + + +#ifdef RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET +static void +raptor_libxml_externalSubset(void* user_data, const xmlChar *name, + const xmlChar *ExternalID, const xmlChar *SystemID) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + libxml2_externalSubset(sax2->xc, name, ExternalID, SystemID); +} +#endif + + +static int +raptor_libxml_isStandalone (void* user_data) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + return libxml2_isStandalone(sax2->xc); +} + + +static int +raptor_libxml_hasInternalSubset (void* user_data) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + return libxml2_hasInternalSubset(sax2->xc); +} + + +static int +raptor_libxml_hasExternalSubset (void* user_data) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + return libxml2_hasExternalSubset(sax2->xc); +} + + +static xmlParserInputPtr +raptor_libxml_resolveEntity(void* user_data, + const xmlChar *publicId, const xmlChar *systemId) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + xmlParserCtxtPtr ctxt = sax2->xc; + const unsigned char *uri_string = NULL; + xmlParserInputPtr entity_input = NULL; + int load_entity = 0; + + if(ctxt->input) + uri_string = RAPTOR_GOOD_CAST(const unsigned char *, ctxt->input->filename); + + if(!uri_string) + uri_string = RAPTOR_GOOD_CAST(const unsigned char *, ctxt->directory); + + load_entity = RAPTOR_OPTIONS_GET_NUMERIC(sax2, RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES); + if(load_entity) + load_entity = raptor_sax2_check_load_uri_string(sax2, uri_string); + + if(load_entity) { + entity_input = xmlLoadExternalEntity(RAPTOR_GOOD_CAST(const char*, uri_string), + RAPTOR_GOOD_CAST(const char*, publicId), + ctxt); + } else { + RAPTOR_DEBUG4("Not loading entity URI %s by policy for publicId '%s' systemId '%s'\n", uri_string, publicId, systemId); + } + + return entity_input; +} + + +static xmlEntityPtr +raptor_libxml_getEntity(void* user_data, const xmlChar *name) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + xmlParserCtxtPtr xc = sax2->xc; + xmlEntityPtr ret = NULL; + + if(!xc) + return NULL; + + if(!xc->inSubset) { + /* looks for hardcoded set of entity names - lt, gt etc. */ + ret = xmlGetPredefinedEntity(name); + if(ret) { + RAPTOR_DEBUG2("Entity '%s' found in predefined set\n", name); + return ret; + } + } + + /* This section uses xmlGetDocEntity which looks for entities in + * memory only, never from a file or URI + */ + if(xc->myDoc && (xc->myDoc->standalone == 1)) { + RAPTOR_DEBUG2("Entity '%s' document is standalone\n", name); + /* Document is standalone: no entities are required to interpret doc */ + if(xc->inSubset == 2) { + xc->myDoc->standalone = 0; + ret = xmlGetDocEntity(xc->myDoc, name); + xc->myDoc->standalone = 1; + } else { + ret = xmlGetDocEntity(xc->myDoc, name); + if(!ret) { + xc->myDoc->standalone = 0; + ret = xmlGetDocEntity(xc->myDoc, name); + xc->myDoc->standalone = 1; + } + } + } else { + ret = xmlGetDocEntity(xc->myDoc, name); + } + + if(ret && !ret->children && + (ret->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) { + /* Entity is an external general parsed entity. It may be in a + * catalog file, user file or user URI + */ + int val = 0; + xmlNodePtr children; + int load_entity = 0; + + load_entity = RAPTOR_OPTIONS_GET_NUMERIC(sax2, RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES); + if(load_entity) + load_entity = raptor_sax2_check_load_uri_string(sax2, ret->URI); + + if(!load_entity) { + RAPTOR_DEBUG2("Not getting entity URI %s by policy\n", ret->URI); + children = xmlNewText((const xmlChar*)""); + } else { + /* Disable SAX2 handlers so that the SAX2 events do not all get + * sent to callbacks during dealing with the entity parsing. + */ + sax2->enabled = 0; + val = xmlParseCtxtExternalEntity(xc, ret->URI, ret->ExternalID, &children); + sax2->enabled = 1; + } + + if(!val) { + xmlAddChildList((xmlNodePtr)ret, children); + } else { + xc->validate = 0; + return NULL; + } + + ret->owner = 1; + +#if LIBXML_VERSION >= 20627 + /* Checked field was released in 2.6.27 on 2006-10-25 + * http://git.gnome.org/browse/libxml2/commit/?id=a37a6ad91a61d168ecc4b29263def3363fff4da6 + * + */ + + /* Mark this entity as having been checked - never do this again */ + if(!ret->checked) + ret->checked = 1; +#endif + } + + return ret; +} + + +static xmlEntityPtr +raptor_libxml_getParameterEntity(void* user_data, const xmlChar *name) { + raptor_sax2* sax2 = (raptor_sax2*)user_data; + return libxml2_getParameterEntity(sax2->xc, name); +} + + +static void +raptor_libxml_entityDecl(void* user_data, const xmlChar *name, int type, + const xmlChar *publicId, const xmlChar *systemId, + xmlChar *content) { + raptor_sax2* sax2 = (raptor_sax2*)user_data; + libxml2_entityDecl(sax2->xc, name, type, publicId, systemId, content); +} + + +static void +raptor_libxml_unparsedEntityDecl(void* user_data, const xmlChar *name, + const xmlChar *publicId, const xmlChar *systemId, + const xmlChar *notationName) { + raptor_sax2* sax2 = (raptor_sax2*)user_data; + libxml2_unparsedEntityDecl(sax2->xc, name, publicId, systemId, notationName); +} + + +static void +raptor_libxml_startDocument(void* user_data) { + raptor_sax2* sax2 = (raptor_sax2*)user_data; + libxml2_startDocument(sax2->xc); +} + + +static void +raptor_libxml_endDocument(void* user_data) { + raptor_sax2* sax2 = (raptor_sax2*)user_data; + xmlParserCtxtPtr xc = sax2->xc; + + libxml2_endDocument(sax2->xc); + + if(xc->myDoc) { + xmlFreeDoc(xc->myDoc); + xc->myDoc = NULL; + } +} + + + +static void +raptor_libxml_set_document_locator(void* user_data, xmlSAXLocatorPtr loc) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + sax2->loc = loc; +} + + +void +raptor_libxml_update_document_locator(raptor_sax2* sax2, + raptor_locator* locator) +{ + /* for storing error info */ + xmlSAXLocatorPtr loc = sax2 ? sax2->loc : NULL; + xmlParserCtxtPtr xc= sax2 ? sax2->xc : NULL; + + if(xc && xc->inSubset) + return; + + if(!locator) + return; + + locator->line= -1; + locator->column= -1; + + if(!xc) + return; + + if(loc) { + locator->line = loc->getLineNumber(xc); + /* Seems to be broken */ + /* locator->column = loc->getColumnNumber(xc); */ + } + +} + + +static void +raptor_libxml_warning(void* user_data, const char *msg, ...) +{ + raptor_sax2* sax2 = NULL; + va_list args; + int prefix_length = RAPTOR_BAD_CAST(int, strlen(xml_warning_prefix)); + int length; + char *nmsg; + int msg_len; + + /* Work around libxml2 bug - sometimes the sax2->error + * returns a ctx, sometimes the userdata + */ + if(((raptor_sax2*)user_data)->magic == RAPTOR_LIBXML_MAGIC) + sax2 = (raptor_sax2*)user_data; + else + /* user_data is not userData */ + sax2 = (raptor_sax2*)((xmlParserCtxtPtr)user_data)->userData; + + va_start(args, msg); + + raptor_libxml_update_document_locator(sax2, sax2->locator); + + msg_len = RAPTOR_BAD_CAST(int, strlen(msg)); + length = prefix_length + msg_len + 1; + nmsg = RAPTOR_MALLOC(char*, length); + if(nmsg) { + memcpy(nmsg, xml_warning_prefix, prefix_length); /* Do not copy NUL */ + memcpy(nmsg + prefix_length, msg, msg_len + 1); /* Copy NUL */ + if(nmsg[length-2] == '\n') + nmsg[length-2]='\0'; + } + + PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START + raptor_log_error_varargs(sax2->world, + RAPTOR_LOG_LEVEL_WARN, + sax2->locator, + nmsg ? nmsg : msg, + args); + PRAGMA_IGNORE_WARNING_END + + if(nmsg) + RAPTOR_FREE(char*, nmsg); + va_end(args); +} + + +static void +raptor_libxml_error_common(void* user_data, const char *msg, va_list args, + const char *prefix, int is_fatal) +{ + raptor_sax2* sax2 = NULL; + int prefix_length = RAPTOR_BAD_CAST(int, strlen(prefix)); + int length; + char *nmsg; + int msg_len; + raptor_world* world = NULL; + raptor_locator* locator = NULL; + raptor_log_level l; + + if(user_data) { + /* Work around libxml2 bug - sometimes the sax2->error + * returns a user_data, sometimes the userdata + */ + if(((raptor_sax2*)user_data)->magic == RAPTOR_LIBXML_MAGIC) + sax2 = (raptor_sax2*)user_data; + else + /* user_data is not userData */ + sax2 = (raptor_sax2*)((xmlParserCtxtPtr)user_data)->userData; + } + + if(sax2) { + world = sax2->world; + locator = sax2->locator; + + if(locator) + raptor_libxml_update_document_locator(sax2, sax2->locator); + } + + msg_len = RAPTOR_BAD_CAST(int, strlen(msg)); + length = prefix_length + msg_len + 1; + nmsg = RAPTOR_MALLOC(char*, length); + if(nmsg) { + memcpy(nmsg, prefix, prefix_length); /* Do not copy NUL */ + memcpy(nmsg + prefix_length, msg, msg_len + 1); /* Copy NUL */ + if(nmsg[length-1] == '\n') + nmsg[length-1]='\0'; + } + + l = (is_fatal) ? RAPTOR_LOG_LEVEL_FATAL: RAPTOR_LOG_LEVEL_ERROR; + + PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START + raptor_log_error_varargs(world, + l, + locator, + nmsg ? nmsg : msg, + args); + PRAGMA_IGNORE_WARNING_END + + if(nmsg) + RAPTOR_FREE(char*, nmsg); +} + + +static void +raptor_libxml_error(void* user_data, const char *msg, ...) +{ + va_list args; + + va_start(args, msg); + raptor_libxml_error_common(user_data, msg, args, xml_error_prefix, 0); + va_end(args); +} + + + +void +raptor_libxml_generic_error(void* user_data, const char *msg, ...) +{ + raptor_world* world = (raptor_world*)user_data; + va_list args; + const char* prefix = xml_generic_error_prefix; + int prefix_length = RAPTOR_BAD_CAST(int, strlen(prefix)); + int length; + char *nmsg; + int msg_len; + + va_start(args, msg); + + msg_len = RAPTOR_BAD_CAST(int, strlen(msg)); + length = prefix_length + msg_len + 1; + nmsg = RAPTOR_MALLOC(char*, length); + if(nmsg) { + memcpy(nmsg, prefix, prefix_length); /* Do not copy NUL */ + memcpy(nmsg + prefix_length, msg, msg_len + 1); /* Copy NUL */ + if(nmsg[length-1] == '\n') + nmsg[length-1]='\0'; + } + + PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START + raptor_log_error_varargs(world, RAPTOR_LOG_LEVEL_ERROR, + /* locator */ NULL, + nmsg ? nmsg : msg, + args); + PRAGMA_IGNORE_WARNING_END + + if(nmsg) + RAPTOR_FREE(char*, nmsg); + + va_end(args); +} + + +static void +raptor_libxml_fatal_error(void* user_data, const char *msg, ...) +{ + va_list args; + + va_start(args, msg); + raptor_libxml_error_common(user_data, msg, args, xml_fatal_error_prefix, 1); + va_end(args); +} + + +void +raptor_libxml_validation_error(void* user_data, const char *msg, ...) +{ + va_list args; + + va_start(args, msg); + raptor_libxml_error_common(user_data, msg, args, + xml_validation_error_prefix, 1); + va_end(args); +} + + +void +raptor_libxml_validation_warning(void* user_data, const char *msg, ...) +{ + va_list args; + raptor_sax2* sax2 = (raptor_sax2*)user_data; + int prefix_length = RAPTOR_GOOD_CAST(int, strlen(xml_validation_warning_prefix)); + int length; + char *nmsg; + int msg_len; + + va_start(args, msg); + + raptor_libxml_update_document_locator(sax2, sax2->locator); + + msg_len = RAPTOR_BAD_CAST(int, strlen(msg)); + length = prefix_length + msg_len + 1; + nmsg = RAPTOR_MALLOC(char*, length); + if(nmsg) { + memcpy(nmsg, xml_validation_warning_prefix, prefix_length); /* Do not copy NUL */ + memcpy(nmsg + prefix_length, msg, msg_len + 1); /* Copy NUL */ + if(nmsg[length-2] == '\n') + nmsg[length-2]='\0'; + } + + PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START + raptor_log_error_varargs(sax2->world, + RAPTOR_LOG_LEVEL_WARN, + sax2->locator, + nmsg ? nmsg : msg, + args); + PRAGMA_IGNORE_WARNING_END + + if(nmsg) + RAPTOR_FREE(char*, nmsg); + va_end(args); +} + + +/* + * Initialise libxml for a particular SAX2 setup +*/ +void +raptor_libxml_sax_init(raptor_sax2* sax2) +{ + xmlSAXHandler *sax = &sax2->sax; + + sax->internalSubset = raptor_libxml_internalSubset; + sax->isStandalone = raptor_libxml_isStandalone; + sax->hasInternalSubset = raptor_libxml_hasInternalSubset; + sax->hasExternalSubset = raptor_libxml_hasExternalSubset; + sax->resolveEntity = raptor_libxml_resolveEntity; + sax->getEntity = raptor_libxml_getEntity; + sax->getParameterEntity = raptor_libxml_getParameterEntity; + sax->entityDecl = raptor_libxml_entityDecl; + sax->attributeDecl = NULL; /* attributeDecl */ + sax->elementDecl = NULL; /* elementDecl */ + sax->notationDecl = NULL; /* notationDecl */ + sax->unparsedEntityDecl = raptor_libxml_unparsedEntityDecl; + sax->setDocumentLocator = raptor_libxml_set_document_locator; + sax->startDocument = raptor_libxml_startDocument; + sax->endDocument = raptor_libxml_endDocument; + sax->startElement= raptor_sax2_start_element; + sax->endElement= raptor_sax2_end_element; + sax->reference = NULL; /* reference */ + sax->characters= raptor_sax2_characters; + sax->cdataBlock= raptor_sax2_cdata; /* like */ + sax->ignorableWhitespace= raptor_sax2_cdata; + sax->processingInstruction = NULL; /* processingInstruction */ + sax->comment = raptor_sax2_comment; /* comment */ + sax->warning = (warningSAXFunc)raptor_libxml_warning; + sax->error = (errorSAXFunc)raptor_libxml_error; + sax->fatalError = (fatalErrorSAXFunc)raptor_libxml_fatal_error; + sax->serror = (xmlStructuredErrorFunc)raptor_libxml_xmlStructuredError_handler_parsing; + +#ifdef RAPTOR_LIBXML_XMLSAXHANDLER_EXTERNALSUBSET + sax->externalSubset = raptor_libxml_externalSubset; +#endif + +#ifdef RAPTOR_LIBXML_XMLSAXHANDLER_INITIALIZED + sax->initialized = 1; +#endif +} + + +void +raptor_libxml_free(xmlParserCtxtPtr xc) { + libxml2_endDocument(xc); + + if(xc->myDoc) { + xmlFreeDoc(xc->myDoc); + xc->myDoc = NULL; + } + + xmlFreeParserCtxt(xc); +} + + +int +raptor_libxml_init(raptor_world* world) +{ + xmlInitParser(); + + if(world->libxml_flags & RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE) { + world->libxml_saved_structured_error_context = xmlGenericErrorContext; + world->libxml_saved_structured_error_handler = xmlStructuredError; + /* sets xmlGenericErrorContext and xmlStructuredError */ + xmlSetStructuredErrorFunc(world, + (xmlStructuredErrorFunc)raptor_libxml_xmlStructuredError_handler_global); + } + + if(world->libxml_flags & RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE) { + world->libxml_saved_generic_error_context = xmlGenericErrorContext; + world->libxml_saved_generic_error_handler = xmlGenericError; + /* sets xmlGenericErrorContext and xmlGenericError */ + xmlSetGenericErrorFunc(world, + (xmlGenericErrorFunc)raptor_libxml_generic_error); + } + + return 0; +} + + +void +raptor_libxml_finish(raptor_world* world) +{ + if(world->libxml_flags & RAPTOR_WORLD_FLAG_LIBXML_STRUCTURED_ERROR_SAVE) + xmlSetStructuredErrorFunc(world->libxml_saved_structured_error_context, + world->libxml_saved_structured_error_handler); + + if(world->libxml_flags & RAPTOR_WORLD_FLAG_LIBXML_GENERIC_ERROR_SAVE) + xmlSetGenericErrorFunc(world->libxml_saved_generic_error_context, + world->libxml_saved_generic_error_handler); + + xmlCleanupParser(); +} + + +#if LIBXML_VERSION >= 20632 +#define XML_LAST_DL XML_FROM_SCHEMATRONV +#else +#if LIBXML_VERSION >= 20621 +#define XML_LAST_DL XML_FROM_I18N +#else +#if LIBXML_VERSION >= 20617 +#define XML_LAST_DL XML_FROM_WRITER +#else +#if LIBXML_VERSION >= 20616 +#define XML_LAST_DL XML_FROM_CHECK +#else +#if LIBXML_VERSION >= 20615 +#define XML_LAST_DL XML_FROM_VALID +#else +#define XML_LAST_DL XML_FROM_XSLT +#endif +#endif +#endif +#endif +#endif + +/* All other symbols not specifically below noted were added during + * the period 2-10 October 2003 which is before the minimum libxml2 + * version 2.6.8 release date of Mar 23 2004. + * + * When the minimum libxml2 version goes up, the #ifdefs for + * older versions can be removed. + */ +static const char* const raptor_libxml_domain_labels[XML_LAST_DL+2]= { + NULL, /* XML_FROM_NONE */ + "parser", /* XML_FROM_PARSER */ + "tree", /* XML_FROM_TREE */ + "namespace", /* XML_FROM_NAMESPACE */ + "validity", /* XML_FROM_DTD */ + "HTML parser", /* XML_FROM_HTML */ + "memory", /* XML_FROM_MEMORY */ + "output", /* XML_FROM_OUTPUT */ + "I/O" , /* XML_FROM_IO */ + "FTP", /* XML_FROM_FTP */ +#if LIBXML_VERSION >= 20618 + /* 2005-02-13 - v2.6.18 */ + "HTTP", /* XML_FROM_HTTP */ +#endif + "XInclude", /* XML_FROM_XINCLUDE */ + "XPath", /* XML_FROM_XPATH */ + "parser", /* XML_FROM_XPOINTER */ + "regexp", /* XML_FROM_REGEXP */ + "Schemas datatype", /* XML_FROM_DATATYPE */ + "Schemas parser", /* XML_FROM_SCHEMASP */ + "Schemas validity", /* XML_FROM_SCHEMASV */ + "Relax-NG parser", /* XML_FROM_RELAXNGP */ + "Relax-NG validity", /* XML_FROM_RELAXNGV */ + "Catalog", /* XML_FROM_CATALOG */ + "C14", /* XML_FROM_C14N */ + "XSLT", /* XML_FROM_XSLT */ +#if LIBXML_VERSION >= 20615 + /* 2004-10-07 - v2.6.15 */ + "validity", /* XML_FROM_VALID */ +#endif +#if LIBXML_VERSION >= 20616 + /* 2004-11-04 - v2.6.16 */ + "checking", /* XML_FROM_CHECK */ +#endif +#if LIBXML_VERSION >= 20617 + /* 2005-01-04 - v2.6.17 */ + "writer", /* XML_FROM_WRITER */ +#endif +#if LIBXML_VERSION >= 20621 + /* 2005-08-24 - v2.6.21 */ + "module", /* XML_FROM_MODULE */ + "encoding", /* XML_FROM_I18N */ +#endif +#if LIBXML_VERSION >= 20632 + /* 2008-04-08 - v2.6.32 */ + "schematronv", /* XML_FROM_SCHEMATRONV */ +#endif + NULL +}; + + +static void +raptor_libxml_xmlStructuredError_handler_common(raptor_world *world, + raptor_locator *locator, + xmlErrorPtr err) +{ + raptor_stringbuffer* sb; + char *nmsg; + raptor_log_level level = RAPTOR_LOG_LEVEL_ERROR; + + if(err == NULL || err->code == XML_ERR_OK || err->level == XML_ERR_NONE) + return; + + /* Do not warn about things with no location */ + if(err->level == XML_ERR_WARNING && !err->file) + return; + + /* XML fatal errors never cause an abort */ + if(err->level == XML_ERR_FATAL) + err->level = XML_ERR_ERROR; + + + sb = raptor_new_stringbuffer(); + if(err->domain != XML_FROM_HTML) + raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"XML ", + 4, 1); + + if(err->domain != XML_FROM_NONE && err->domain < XML_LAST_DL) { + const unsigned char* label; + label = (const unsigned char*)raptor_libxml_domain_labels[(int)err->domain]; + raptor_stringbuffer_append_string(sb, label, 1); + raptor_stringbuffer_append_counted_string(sb, + (const unsigned char*)" ", 1, 1); + } + + if(err->level == XML_ERR_WARNING) + raptor_stringbuffer_append_counted_string(sb, + (const unsigned char*)"warning: ", + 9, 1); + else /* XML_ERR_ERROR or XML_ERR_FATAL */ + raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)"error: ", + 7, 1); + + if(err->message) { + unsigned char* msg; + size_t len; + msg = (unsigned char*)err->message; + len= strlen((const char*)msg); + if(len && msg[len-1] == '\n') + msg[--len]='\0'; + + raptor_stringbuffer_append_counted_string(sb, msg, len, 1); + } + +#if LIBXML_VERSION >= 20618 + /* 2005-02-13 - v2.6.18 */ + + /* str1 has the detailed HTTP error */ + if(err->domain == XML_FROM_HTTP && err->str1) { + unsigned char* msg; + size_t len; + msg = (unsigned char*)err->str1; + len= strlen((const char*)msg); + if(len && msg[len-1] == '\n') + msg[--len]='\0'; + + raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" - ", + 3, 1); + raptor_stringbuffer_append_counted_string(sb, msg, len, 1); + } +#endif + + /* When err->domain == XML_FROM_XPATH then err->int1 is + * the offset into err->str1, the line with the error + */ + if(err->domain == XML_FROM_XPATH && err->str1) { + raptor_stringbuffer_append_counted_string(sb, (const unsigned char*)" in ", + 4, 1); + raptor_stringbuffer_append_string(sb, (const unsigned char*)err->str1, 1); + } + + nmsg = (char*)raptor_stringbuffer_as_string(sb); + if(err->level == XML_ERR_FATAL) + level = RAPTOR_LOG_LEVEL_FATAL; + else if(err->level == XML_ERR_ERROR) + level = RAPTOR_LOG_LEVEL_ERROR; + else + level = RAPTOR_LOG_LEVEL_WARN; + + raptor_log_error(world, level, locator, nmsg); + + raptor_free_stringbuffer(sb); +} + + +/* user_data is a raptor_world* */ +static void +raptor_libxml_xmlStructuredError_handler_global(void *user_data, + xmlErrorPtr err) +{ + raptor_world *world = NULL; + + /* user_data may point to a raptor_world* */ + if(user_data) { + world = (raptor_world*)user_data; + if(world->magic != RAPTOR2_WORLD_MAGIC) + world = NULL; + } + + raptor_libxml_xmlStructuredError_handler_common(world, NULL, err); +} + + +/* user_data may be a raptor_sax2; err->ctxt->userData may point to a + * raptor_sax2* */ +static void +raptor_libxml_xmlStructuredError_handler_parsing(void *user_data, + xmlErrorPtr err) +{ + raptor_sax2* sax2 = NULL; + + /* user_data may point to a raptor_sax2* */ + if(user_data) { + sax2 = (raptor_sax2*)user_data; + if(sax2->magic != RAPTOR_LIBXML_MAGIC) + sax2 = NULL; + } + + /* err->ctxt->userData may point to a raptor_sax2* */ + if(err && err->ctxt) { + xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr)err->ctxt; + if(ctxt->userData) { + sax2 = (raptor_sax2*)ctxt->userData; + if(sax2->magic != RAPTOR_LIBXML_MAGIC) + sax2 = NULL; + } + } + + if(sax2) + raptor_libxml_xmlStructuredError_handler_common(sax2->world, sax2->locator, + err); + else + raptor_libxml_xmlStructuredError_handler_common(NULL, NULL, err); +} + + +/* end if RAPTOR_XML_LIBXML */ +#endif diff --git a/src/raptor_locator.c b/src/raptor_locator.c new file mode 100644 index 0000000..11e08da --- /dev/null +++ b/src/raptor_locator.c @@ -0,0 +1,248 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_locator.c - Raptor parsing locator functions + * + * Copyright (C) 2002-2006, David Beckett http://www.dajobe.org/ + * Copyright (C) 2002-2006, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/** + * raptor_locator_print: + * @locator: #raptor_locator to print + * @stream: stream to print to + * + * Print a raptor locator to a stream. + * + * Return value: non-0 on failure + **/ +int +raptor_locator_print(raptor_locator* locator, FILE *stream) +{ + if(!locator) + return 1; + + if(locator->uri) + fprintf(stream, "URI %s", raptor_uri_as_string(locator->uri)); + else if(locator->file) + fprintf(stream, "file %s", locator->file); + else + return 0; + if(locator->line >= 0) { + fprintf(stream, ":%d", locator->line); + if(locator->column >= 0) + fprintf(stream, " column %d", locator->column); + } + + return 0; +} + + +/** + * raptor_locator_format: + * @buffer: buffer to store format + * @length: size of buffer (excluding NUL) + * @locator: #raptor_locator to format + * + * Format a raptor locator as a string. + * + * If buffer is NULL or @length is insufficient for the size of + * the locator, returns the number of additional bytes required + * in the buffer to write the locator. Writes a terminating '\0'. + * + * Return value: 0 on success, >0 if additional bytes required in buffer, <0 on failure + **/ +int +raptor_locator_format(char *buffer, size_t length, raptor_locator* locator) +{ + size_t bufsize = 0; + const char* label_str; + size_t label_len = 0; + const char* value_str = NULL; + size_t value_len; + + if(!locator) + return -1; + + #define URI_STR "URI " + #define URI_STR_LEN 4 /* strlen(URI_STR) */ + #define FILE_STR "file " + #define FILE_STR_LEN 5 /* strlen(FILE_STR) */ + #define COLUMN_STR " column " + #define COLUMN_STR_LEN 8 /* strlen(COLUMN_STR) */ + + if(locator->uri) { + label_str = URI_STR; + label_len = URI_STR_LEN; + value_str = (const char*)raptor_uri_as_counted_string(locator->uri, + &value_len); + } else if(locator->file) { + label_str = FILE_STR; + label_len = FILE_STR_LEN; + value_str = locator->file; + value_len = strlen(value_str); + } else + return -1; + + bufsize = label_len + value_len; + + if(locator->line > 0) { + bufsize += 1 + raptor_format_integer(NULL, 0, locator->line, /* base */ 10, + -1, '\0'); + if(locator->column >= 0) + bufsize += COLUMN_STR_LEN + + raptor_format_integer(NULL, 0, locator->column, /* base */ 10, + -1, '\0'); + } + + if(!buffer || !length || length < (bufsize + 1)) /* +1 for NUL */ + return RAPTOR_BAD_CAST(int, bufsize); + + + memcpy(buffer, label_str, label_len); + buffer += label_len; + memcpy(buffer, value_str, value_len); + buffer += value_len; + + if(locator->line > 0) { + *buffer ++= ':'; + buffer += raptor_format_integer(buffer, length, + locator->line, /* base */ 10, + -1, '\0'); + if(locator->column >= 0) { + memcpy(buffer, COLUMN_STR, COLUMN_STR_LEN); + buffer += COLUMN_STR_LEN; + buffer += raptor_format_integer(buffer, length, + locator->column, /* base */ 10, + -1, '\0'); + } + } + *buffer = '\0'; + + return 0; +} + + +/** + * raptor_locator_line: + * @locator: locator + * + * Get line number from locator. + * + * Return value: integer line number, or -1 if there is no line number available + **/ +int +raptor_locator_line(raptor_locator *locator) +{ + if(!locator) + return -1; + return locator->line; +} + + +/** + * raptor_locator_column: + * @locator: locator + * + * Get column number from locator. + * + * Return value: integer column number, or -1 if there is no column number available + **/ +int +raptor_locator_column(raptor_locator *locator) +{ + if(!locator) + return -1; + return locator->column; +} + + +/** + * raptor_locator_byte: + * @locator: locator + * + * Get the locator byte offset from locator. + * + * Return value: integer byte number, or -1 if there is no byte offset available + **/ +int +raptor_locator_byte(raptor_locator *locator) +{ + if(!locator) + return -1; + return locator->byte; +} + + +/** + * raptor_locator_file: + * @locator: locator + * + * Get file name from locator. + * + * Return value: string file name, or NULL if there is no filename available + **/ +const char * +raptor_locator_file(raptor_locator *locator) +{ + if(!locator) + return NULL; + return locator->file; +} + + +/** + * raptor_locator_uri: + * @locator: locator + * + * Get URI from locator. + * + * Returns a pointer to a shared string version of the URI in + * the locator. This must be copied if it is needed. + * + * Return value: string URI, or NULL if there is no URI available + **/ +const char * +raptor_locator_uri(raptor_locator *locator) +{ + if(!locator) + return NULL; + + return (const char*)raptor_uri_as_string(locator->uri); +} diff --git a/src/raptor_log.c b/src/raptor_log.c new file mode 100644 index 0000000..a4495e9 --- /dev/null +++ b/src/raptor_log.c @@ -0,0 +1,163 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_log.c - Raptor log handling + * + * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +static const char* const raptor_log_level_labels[RAPTOR_LOG_LEVEL_LAST + 1] = { + "none", + "trace", + "debug", + "info", + "warning", + "error", + "fatal error" +}; + + +/** + * raptor_log_level_get_label: + * @level: log message level + * + * Get label for a log message level + * + * Return value: label string or NULL if level is not valid + */ +const char* +raptor_log_level_get_label(raptor_log_level level) +{ + return (level <= RAPTOR_LOG_LEVEL_LAST) ? raptor_log_level_labels[level] : NULL; +} + + +void +raptor_log_error_varargs(raptor_world* world, raptor_log_level level, + raptor_locator* locator, + const char* message, va_list arguments) +{ + char *buffer = NULL; + size_t length; + + if(level == RAPTOR_LOG_LEVEL_NONE) + return; + + if(world && world->internal_ignore_errors) + return; + + length = raptor_vasprintf(&buffer, message, arguments); + if(!buffer) { + if(locator) { + raptor_locator_print(locator, stderr); + fputc(' ', stderr); + } + fputs("raptor ", stderr); + fputs(raptor_log_level_labels[level], stderr); + fputs(" - ", stderr); + vfprintf(stderr, message, arguments); + fputc('\n', stderr); + return; + } + + if(length >= 1 && buffer[length-1] == '\n') + buffer[length-1]='\0'; + + raptor_log_error(world, level, locator, buffer); + + RAPTOR_FREE(char*, buffer); +} + + +void +raptor_log_error_formatted(raptor_world* world, raptor_log_level level, + raptor_locator* locator, + const char* message, ...) +{ + va_list arguments; + + va_start(arguments, message); + raptor_log_error_varargs(world, level, locator, message, arguments); + va_end(arguments); +} + + +/* internal */ +void +raptor_log_error(raptor_world* world, raptor_log_level level, + raptor_locator* locator, const char* text) +{ + raptor_log_handler handler; + + if(level == RAPTOR_LOG_LEVEL_NONE) + return; + + if(world) { + if(world->internal_ignore_errors) + return; + + memset(&world->message, '\0', sizeof(world->message)); + world->message.code = -1; + world->message.domain = RAPTOR_DOMAIN_NONE; + world->message.level = level; + world->message.locator = locator; + world->message.text = text; + + handler = world->message_handler; + if(handler) { + /* This is the place in raptor that ALL of the user error handler + * functions are called. + */ + handler(world->message_handler_user_data, &world->message); + return; + } + } + + /* default - print it to stderr */ + if(locator) { + raptor_locator_print(locator, stderr); + fputc(' ', stderr); + } + fputs("raptor ", stderr); + fputs(raptor_log_level_labels[level], stderr); + fputs(" - ", stderr); + fputs(text, stderr); + fputc('\n', stderr); +} diff --git a/src/raptor_memstr.c b/src/raptor_memstr.c new file mode 100644 index 0000000..2168e91 --- /dev/null +++ b/src/raptor_memstr.c @@ -0,0 +1,76 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_memstr.c - search for a string in a block of memory + * + * Copyright (C) 2008, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * raptor_memstr: + * @haystack: memory block to search in + * @haystack_len: size of memory block + * @needle: string to search with + * + * INTERNAL: Search for a string in a block of memory + * + * The block of memory in @haystack may not be NUL terminated but + * the searching for @needle will end if a NUL is found in @haystack. + * + * Return value: pointer to match string or NULL on failure or failed to find + */ +const char* +raptor_memstr(const char *haystack, size_t haystack_len, const char *needle) +{ + size_t needle_len; + const char *p; + + if(!haystack || !needle) + return NULL; + + if(!*needle) + return haystack; + + needle_len = strlen(needle); + + /* loop invariant: haystack_len is always length of remaining buffer at *p */ + for(p = haystack; + (haystack_len >= needle_len) && *p; + p++, haystack_len--) { + + /* check match */ + if(!memcmp(p, needle, needle_len)) + return p; + } + + return NULL; +} + + diff --git a/src/raptor_namespace.c b/src/raptor_namespace.c new file mode 100644 index 0000000..20c769e --- /dev/null +++ b/src/raptor_namespace.c @@ -0,0 +1,1160 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_namespace.c - Raptor XML namespace classes + * + * Copyright (C) 2002-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* Define these for far too much output */ +#undef RAPTOR_DEBUG_VERBOSE + + +/* + * Namespaces in XML + * http://www.w3.org/TR/1999/REC-xml-names-19990114/#nsc-NSDeclared + * (section 4) says: + * + * -------------------------------------------------------------------- + * The prefix xml is by definition bound to the namespace name + * http://www.w3.org/XML/1998/namespace + * -------------------------------------------------------------------- + * + * Errata NE05 + * http://www.w3.org/XML/xml-names-19990114-errata#NE05 + * changes that to read: + * + * -------------------------------------------------------------------- + * The prefix xml is by definition bound to the namespace name + * http://www.w3.org/XML/1998/namespace. It may, but need not, be + * declared, and must not be bound to any other namespace name. No + * other prefix may be bound to this namespace name. + * + * The prefix xmlns is used only to declare namespace bindings and is + * by definition bound to the namespace name + * http://www.w3.org/2000/xmlns/. It must not be declared. No other + * prefix may be bound to this namespace name. + * + * All other prefixes beginning with the three-letter sequence x, m, l, + * in any case combination, are reserved. This means that + * * users should not use them except as defined by later specifications + * * processors must not treat them as fatal errors. + * -------------------------------------------------------------------- + * + * Thus should define it in the table of namespaces before we start. + * + * We *can* also define others, but let's not. + * + */ + +#ifndef STANDALONE +const unsigned char * const raptor_xml_namespace_uri = (const unsigned char *)"http://www.w3.org/XML/1998/namespace"; +const unsigned char * const raptor_rdf_namespace_uri = (const unsigned char *)"http://www.w3.org/1999/02/22-rdf-syntax-ns#"; +const unsigned int raptor_rdf_namespace_uri_len = 43; +const unsigned char * const raptor_rdf_schema_namespace_uri = (const unsigned char *)"http://www.w3.org/2000/01/rdf-schema#"; +const unsigned int raptor_rdf_schema_namespace_uri_len = 37; +const unsigned char * const raptor_xmlschema_datatypes_namespace_uri = (const unsigned char *)"http://www.w3.org/2001/XMLSchema#"; +const unsigned char * const raptor_owl_namespace_uri = (const unsigned char *)"http://www.w3.org/2002/07/owl#"; + + +/* hash function to hash namespace prefix strings (usually short strings) + * + * Uses DJ Bernstein original hash function - good on short text keys. + */ +static unsigned int +raptor_hash_ns_string(const unsigned char *str, int length) +{ + unsigned int hash = 5381; + int c; + + for(; length && (c = *str++); length--) { + hash = ((hash << 5) + hash) + c; /* hash * 33 + c */ + } + + return hash; +} + + +#define RAPTOR_NAMESPACES_HASHTABLE_SIZE 1024 +/** + * raptor_namespaces_init: + * @world: raptor_world object + * @nstack: #raptor_namespace_stack to initialise + * @defaults: namespaces to initialise. + * + * Initialise an existing namespaces stack object + * + * This sets up the stack optionally with some common RDF namespaces. + * + * @defaults can be 0 for none, 1 for just XML, 2 for RDF, RDFS, OWL + * and XSD (RDQL uses this) or 3+ undefined. + * + * Return value: non-0 on error + */ +int +raptor_namespaces_init(raptor_world* world, + raptor_namespace_stack *nstack, + int defaults) +{ + int failures = 0; + + nstack->world = world; + + nstack->size = 0; + + nstack->table_size = RAPTOR_NAMESPACES_HASHTABLE_SIZE; + nstack->table = RAPTOR_CALLOC(raptor_namespace**, + RAPTOR_NAMESPACES_HASHTABLE_SIZE, + sizeof(raptor_namespace*)); + if(!nstack->table) + return -1; + + nstack->def_namespace = NULL; + + nstack->rdf_ms_uri = raptor_new_uri_from_counted_string(nstack->world, + (const unsigned char*)raptor_rdf_namespace_uri, + raptor_rdf_namespace_uri_len); + failures += !nstack->rdf_ms_uri; + + nstack->rdf_schema_uri = raptor_new_uri_from_counted_string(nstack->world, + (const unsigned char*)raptor_rdf_schema_namespace_uri, + raptor_rdf_schema_namespace_uri_len); + failures += !nstack->rdf_schema_uri; + + /* raptor_new_namespace_from_uri() that eventually gets called by + * raptor_new_namespace() in raptor_namespaces_start_namespace_full() + * needs rdf_ms_uri and rdf_schema_uri + * - do not call if we had failures initializing those uris */ + if(defaults && !failures) { + /* defined at level -1 since always 'present' when inside the XML world */ + failures += raptor_namespaces_start_namespace_full(nstack, + (const unsigned char*)"xml", + raptor_xml_namespace_uri, -1); + if(defaults >= 2) { + failures += raptor_namespaces_start_namespace_full(nstack, + (const unsigned char*)"rdf", + raptor_rdf_namespace_uri, 0); + failures += raptor_namespaces_start_namespace_full(nstack, + (const unsigned char*)"rdfs", + raptor_rdf_schema_namespace_uri, 0); + failures += raptor_namespaces_start_namespace_full(nstack, + (const unsigned char*)"xsd", + raptor_xmlschema_datatypes_namespace_uri, 0); + failures += raptor_namespaces_start_namespace_full(nstack, + (const unsigned char*)"owl", + raptor_owl_namespace_uri, 0); + } + } + return failures; +} + + +/** + * raptor_new_namespaces: + * @world: raptor_world object + * @defaults: namespaces to initialise + * + * Constructor - create a new #raptor_namespace_stack. + * + * See raptor_namespaces_init() for the values of @defaults. + * + * Return value: a new namespace stack or NULL on failure + **/ +raptor_namespace_stack * +raptor_new_namespaces(raptor_world* world, int defaults) +{ + raptor_namespace_stack *nstack; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + nstack = RAPTOR_CALLOC(raptor_namespace_stack*, 1, sizeof(*nstack)); + if(!nstack) + return NULL; + + if(raptor_namespaces_init(world, nstack, defaults)) { + raptor_free_namespaces(nstack); + nstack = NULL; + } + + return nstack; +} + + +/** + * raptor_namespaces_start_namespace: + * @nstack: namespace stack + * @nspace: namespace to start + * + * Start a namespace on a stack of namespaces. + **/ +void +raptor_namespaces_start_namespace(raptor_namespace_stack *nstack, + raptor_namespace *nspace) +{ + unsigned int hash = raptor_hash_ns_string(nspace->prefix, + nspace->prefix_length); + const int bucket = hash % nstack->table_size; + + nstack->size++; + + if(nstack->table[bucket]) + nspace->next = nstack->table[bucket]; + nstack->table[bucket] = nspace; + + if(!nstack->def_namespace) + nstack->def_namespace = nspace; + +#ifndef STANDALONE +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG3("start namespace prefix %s depth %d\n", nspace->prefix ? (char*)nspace->prefix : "(default)", nspace->depth); +#endif +#endif + +} + + +/** + * raptor_namespaces_start_namespace_full: + * @nstack: namespace stack + * @prefix: new namespace prefix (or NULL) + * @ns_uri_string: new namespace URI (or NULL) + * @depth: new namespace depth + * + * Create a new namespace and start it on a stack of namespaces. + * + * See raptor_new_namespace() for the meanings of @prefix, + * @ns_uri_string and @depth for namespaces. + * + * Return value: non-0 on failure + **/ +int +raptor_namespaces_start_namespace_full(raptor_namespace_stack *nstack, + const unsigned char *prefix, + const unsigned char *ns_uri_string, + int depth) +{ + raptor_namespace *ns; + + ns = raptor_new_namespace(nstack, prefix, ns_uri_string, depth); + if(!ns) + return 1; + + raptor_namespaces_start_namespace(nstack, ns); + return 0; +} + + +/** + * raptor_namespaces_clear: + * @nstack: namespace stack + * + * Empty a namespace stack of namespaces and any other resources. + **/ +void +raptor_namespaces_clear(raptor_namespace_stack *nstack) +{ + if(nstack->table) { + int bucket; + + for(bucket = 0; bucket < nstack->table_size; bucket++) { + raptor_namespace *ns = nstack->table[bucket]; + while(ns) { + raptor_namespace* next_ns = ns->next; + + raptor_free_namespace(ns); + nstack->size--; + ns = next_ns; + } + nstack->table[bucket] = NULL; + } + + RAPTOR_FREE(raptor_namespaces, nstack->table); + nstack->table = NULL; + nstack->table_size = 0; + } + + if(nstack->world) { + if(nstack->rdf_ms_uri) { + raptor_free_uri(nstack->rdf_ms_uri); + nstack->rdf_ms_uri = NULL; + } + if(nstack->rdf_schema_uri) { + raptor_free_uri(nstack->rdf_schema_uri); + nstack->rdf_schema_uri = NULL; + } + } + + nstack->size = 0; + + nstack->world = NULL; +} + + +/** + * raptor_free_namespaces: + * @nstack: namespace stack + * + * Destructor - destroy a namespace stack + **/ +void +raptor_free_namespaces(raptor_namespace_stack *nstack) +{ + if(!nstack) + return; + + raptor_namespaces_clear(nstack); + + RAPTOR_FREE(raptor_namespace_stack, nstack); +} + + +/** + * raptor_namespaces_end_for_depth: + * @nstack: namespace stack + * @depth: depth + * + * End all namespaces at the given depth in the namespace stack. + **/ +void +raptor_namespaces_end_for_depth(raptor_namespace_stack *nstack, int depth) +{ + int bucket; + for(bucket = 0; bucket < nstack->table_size; bucket++) { + while(nstack->table[bucket] && + nstack->table[bucket]->depth == depth) { + raptor_namespace* ns = nstack->table[bucket]; + raptor_namespace* next_ns = ns->next; + +#ifndef STANDALONE +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG3("namespace prefix %s depth %d\n", + ns->prefix ? (char*)ns->prefix : "(default)", depth); +#endif +#endif + raptor_free_namespace(ns); + nstack->size--; + + nstack->table[bucket] = next_ns; + } + } +} + + +/** + * raptor_namespaces_get_default_namespace: + * @nstack: namespace stack + * + * Get the current default namespace in-scope in a stack. + * + * Return value: #raptor_namespace or NULL if no default namespace is in scope + **/ +raptor_namespace* +raptor_namespaces_get_default_namespace(raptor_namespace_stack *nstack) +{ + unsigned int hash = raptor_hash_ns_string((const unsigned char *)"", 0); + const int bucket = hash % nstack->table_size; + raptor_namespace* ns; + + for(ns = nstack->table[bucket]; ns && ns->prefix; ns = ns->next) + ; + return ns; +} + + +/** + * raptor_namespaces_find_namespace: + * @nstack: namespace stack + * @prefix: namespace prefix to find + * @prefix_length: length of prefix. + * + * Find a namespace in a namespace stack by prefix. + * + * Note that this uses the @length so that the prefix may be a prefix (sic) + * of a longer string. If @prefix is NULL, the default namespace will + * be returned if present, @prefix_length length is ignored in this case. + * + * Return value: #raptor_namespace for the prefix or NULL on failure + **/ +raptor_namespace* +raptor_namespaces_find_namespace(raptor_namespace_stack *nstack, + const unsigned char *prefix, int prefix_length) +{ + raptor_namespace* ns; + unsigned int hash = raptor_hash_ns_string(prefix, prefix_length); + int bucket; + + if(!nstack || !nstack->table_size) + return NULL; + + bucket = hash % (nstack->table_size); + for(ns = nstack->table[bucket]; ns ; ns = ns->next) { + if(!prefix) { + if(!ns->prefix) + break; + } else { + if((unsigned int)prefix_length == ns->prefix_length && + !strncmp((char*)prefix, (char*)ns->prefix, prefix_length)) + break; + } + } + + return ns; +} + + +/** + * raptor_namespaces_find_namespace_by_uri: + * @nstack: namespace stack + * @ns_uri: namespace URI to find + * + * Find a namespace in a namespace stack by namespace URI. + * + * Return value: #raptor_namespace for the URI or NULL on failure + **/ +raptor_namespace* +raptor_namespaces_find_namespace_by_uri(raptor_namespace_stack *nstack, + raptor_uri *ns_uri) +{ + int bucket; + + if(!ns_uri) + return NULL; + + for(bucket = 0; bucket < nstack->table_size; bucket++) { + raptor_namespace* ns; + for(ns = nstack->table[bucket]; ns ; ns = ns->next) + if(raptor_uri_equals(ns->uri, ns_uri)) + return ns; + } + + return NULL; +} + + +/** + * raptor_namespaces_namespace_in_scope: + * @nstack: namespace stack + * @nspace: namespace + * + * Test if a given namespace is in-scope in the namespace stack. + * + * Return value: non-0 if the namespace is in scope. + **/ +int +raptor_namespaces_namespace_in_scope(raptor_namespace_stack *nstack, + const raptor_namespace *nspace) +{ + raptor_namespace* ns; + int bucket; + + for(bucket = 0; bucket < nstack->table_size; bucket++) { + for(ns = nstack->table[bucket]; ns ; ns = ns->next) + if(raptor_uri_equals(ns->uri, nspace->uri)) + return 1; + } + return 0; +} + + +/** + * raptor_new_namespace_from_uri: + * @nstack: namespace stack + * @prefix: namespace prefix string + * @ns_uri: namespace URI + * @depth: depth of namespace in the stack + * + * Constructor - create a new namespace from a prefix and URI object. + * + * This declares but does not enable the namespace declaration (or 'start' it) + * Use raptor_namespaces_start_namespace() to make the namespace + * enabled and in scope for binding prefixes. + * + * Alternatively use raptor_namespaces_start_namespace_full() can construct + * and enable a namespace in one call. + * + * Return value: a new #raptor_namespace or NULL on failure + **/ +raptor_namespace* +raptor_new_namespace_from_uri(raptor_namespace_stack *nstack, + const unsigned char *prefix, + raptor_uri* ns_uri, int depth) +{ + unsigned int prefix_length = 0; + unsigned int len; + raptor_namespace *ns; + unsigned char *p; + +#ifndef STANDALONE +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG4("namespace prefix %s uri %s depth %d\n", + prefix ? (char*)prefix : "(default)", + ns_uri ? (char*)raptor_uri_as_string(ns_uri) : "(none)", + depth); +#endif +#endif + + if(prefix && !ns_uri) { + /* failed to find namespace - now what? */ + raptor_log_error_formatted(nstack->world, RAPTOR_LOG_LEVEL_ERROR, + /* locator */ NULL, + "The namespace URI for prefix \"%s\" is empty.", + prefix); + return NULL; + } + + + len = sizeof(raptor_namespace); + if(prefix) { + prefix_length = (unsigned int)strlen((char*)prefix); + len += prefix_length + 1; + } + + /* Just one malloc for structure + namespace (maybe) + prefix (maybe)*/ + ns = RAPTOR_CALLOC(raptor_namespace*, 1, len); + if(!ns) + return NULL; + + p = (unsigned char*)ns + sizeof(raptor_namespace); + if(ns_uri) { + ns->uri = raptor_uri_copy(ns_uri); + if(!ns->uri) { + RAPTOR_FREE(raptor_namespace, ns); + return NULL; + } + } + if(prefix) { + ns->prefix = (const unsigned char*)memcpy(p, prefix, prefix_length + 1); + ns->prefix_length = prefix_length; + + if(!strcmp((char*)ns->prefix, "xml")) + ns->is_xml = 1; + } + ns->depth = depth; + + /* set convienience flags when there is a defined namespace URI */ + if(ns->uri) { + if(raptor_uri_equals(ns->uri, nstack->rdf_ms_uri)) + ns->is_rdf_ms = 1; + else if(raptor_uri_equals(ns->uri, nstack->rdf_schema_uri)) + ns->is_rdf_schema = 1; + } + + ns->nstack = nstack; + + return ns; +} + + +/** + * raptor_new_namespace: + * @nstack: namespace stack + * @prefix: namespace prefix string + * @ns_uri_string: namespace URI string + * @depth: depth of namespace in the stack + * + * Constructor - create a new namespace from a prefix and URI string with a depth scope. + * + * This declares but does not enable the namespace declaration (or 'start' it) + * Use raptor_namespaces_start_namespace() to make the namespace + * enabled and in scope for binding prefixes. + * + * Alternatively use raptor_namespaces_start_namespace_full() can construct + * and enable a namespace in one call. + * + * The @depth is a way to use the stack of namespaces for providing scoped + * namespaces where inner scope namespaces override outer scope namespaces. + * This is primarily for RDF/XML and XML syntaxes that have hierarchical + * elements. The main use of this is raptor_namespaces_end_for_depth() + * to disable ('end') all namespaces at a given depth. Otherwise set this + * to 0. + * + * Return value: a new #raptor_namespace or NULL on failure + **/ +raptor_namespace* +raptor_new_namespace(raptor_namespace_stack *nstack, + const unsigned char *prefix, + const unsigned char *ns_uri_string, int depth) +{ + raptor_uri* ns_uri = NULL; + raptor_namespace* ns; + + /* Convert an empty namespace string "" to a NULL pointer */ + if(ns_uri_string && !*ns_uri_string) + ns_uri_string = NULL; + + if(ns_uri_string) { + ns_uri = raptor_new_uri(nstack->world, ns_uri_string); + if(!ns_uri) + return NULL; + } + ns = raptor_new_namespace_from_uri(nstack, prefix, ns_uri, depth); + if(ns_uri) + raptor_free_uri(ns_uri); + + return ns; +} + + +/** + * raptor_namespace_stack_start_namespace: + * @nstack: namespace stack + * @ns: namespace + * @new_depth: new depth + * + * Copy an existing namespace to a namespace stack with a new depth + * and start it. + * + * The @depth is a way to use the stack of namespaces for providing scoped + * namespaces where inner scope namespaces override outer scope namespaces. + * This is primarily for RDF/XML and XML syntaxes that have hierarchical + * elements. The main use of this is raptor_namespaces_end_for_depth() + * to disable ('end') all namespaces at a given depth. If depths are + * not being needed it is unlikely this call is ever needed to copy an + * existing namespace at a new depth. + * + * Return value: non-0 on failure + **/ +int +raptor_namespace_stack_start_namespace(raptor_namespace_stack *nstack, + raptor_namespace *ns, + int new_depth) +{ + raptor_namespace *new_ns; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(nstack, raptor_namespace_stack, 1); + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(ns, raptor_namespace, 1); + + new_ns = raptor_new_namespace_from_uri(nstack, ns->prefix, ns->uri, new_depth); + if(!new_ns) + return 1; + + raptor_namespaces_start_namespace(nstack, new_ns); + return 0; +} + + +/** + * raptor_free_namespace: + * @ns: namespace object + * + * Destructor - destroy a namespace. + **/ +void +raptor_free_namespace(raptor_namespace *ns) +{ + if(!ns) + return; + + if(ns->uri) + raptor_free_uri(ns->uri); + + RAPTOR_FREE(raptor_namespace, ns); +} + + +/** + * raptor_namespace_get_uri: + * @ns: namespace object + * + * Get the namespace URI. + * + * Return value: namespace URI or NULL + **/ +raptor_uri* +raptor_namespace_get_uri(const raptor_namespace *ns) +{ + return ns->uri; +} + + +/** + * raptor_namespace_get_prefix: + * @ns: namespace object + * + * Get the namespace prefix. + * + * Return value: prefix string or NULL + **/ +const unsigned char* +raptor_namespace_get_prefix(const raptor_namespace *ns) +{ + return (const unsigned char*)ns->prefix; +} + + +/** + * raptor_namespace_get_counted_prefix: + * @ns: namespace object + * @length_p: pointer to store length or NULL + * + * Get the namespace prefix and length. + * + * Return value: prefix string or NULL + **/ +const unsigned char* +raptor_namespace_get_counted_prefix(const raptor_namespace *ns, size_t *length_p) +{ + if(length_p) + *length_p=ns->prefix_length; + return (const unsigned char*)ns->prefix; +} + + +/** + * raptor_namespace_format_as_xml: + * @ns: namespace object + * @length_p: pointer to length (or NULL) + * + * Format a namespace in an XML style into a newly allocated string. + * + * Generates a string of the form xmlns:prefix="uri", + * xmlns="uri", xmlns:prefix="" or xmlns="" depending on the + * namespace's prefix or URI. Double quotes are always used. + * + * If @length_p is not NULL, the length of the string is + * stored in the address it points to. + * + * See also raptor_xml_namespace_string_parse() + * + * Return value: namespace formatted as newly allocated string or NULL on failure + **/ +unsigned char * +raptor_namespace_format_as_xml(const raptor_namespace *ns, size_t *length_p) +{ + size_t uri_length = 0L; + const unsigned char *uri_string = NULL; + size_t xml_uri_length = 0L; + size_t length; + unsigned char *buffer; + const char quote='"'; + unsigned char *p; + + if(ns->uri) { + int xlength; + + uri_string = raptor_uri_as_counted_string(ns->uri, &uri_length); + xlength = raptor_xml_escape_string(ns->nstack->world, + uri_string, uri_length, + NULL, 0, quote); + if(xlength < 0) + return NULL; + xml_uri_length = RAPTOR_GOOD_CAST(size_t, xlength); + } + + /* 8 = length of [[xmlns=""] */ + length = 8 + xml_uri_length + ns->prefix_length; + + if(ns->prefix) + length++; /* for : */ + + if(length_p) + *length_p = length; + + buffer = RAPTOR_MALLOC(unsigned char*, length + 1); + if(!buffer) + return NULL; + + p = buffer; + + memcpy(p, "xmlns", 5); + p += 5; + + if(ns->prefix) { + *p++ = ':'; + memcpy(p, ns->prefix, ns->prefix_length); + p += ns->prefix_length; + } + *p++ = '='; + *p++ = quote; + if(uri_length) { + int xlength; + + xlength = raptor_xml_escape_string(ns->nstack->world, + uri_string, uri_length, + p, xml_uri_length, quote); + if(xlength < 0) + return NULL; + p += RAPTOR_GOOD_CAST(size_t, xlength); + } + *p++ = quote; + /* *p used here since we never need to use value of p again [CLANG] */ + *p = '\0'; + + return buffer; +} + + +/** + * raptor_namespace_write: + * @ns: namespace to write + * @iostr: raptor iosteram + * + * Write a formatted namespace to an iostream + * + * Return value: non-0 on failure + **/ +int +raptor_namespace_write(raptor_namespace *ns, raptor_iostream* iostr) +{ + size_t uri_length = 0L; + const unsigned char *uri_string = NULL; + + if(!ns || !iostr) + return 1; + + if(ns->uri) + uri_string = raptor_uri_as_counted_string(ns->uri, &uri_length); + + raptor_iostream_counted_string_write("xmlns", 5, iostr); + if(ns->prefix) { + raptor_iostream_write_byte(':', iostr); + raptor_iostream_string_write(ns->prefix, iostr); + } + raptor_iostream_counted_string_write("=\"", 2, iostr); + if(uri_length) + raptor_iostream_counted_string_write(uri_string, uri_length, iostr); + raptor_iostream_write_byte('"', iostr); + + return 0; +} + + +/** + * raptor_xml_namespace_string_parse: + * @string: string to parse + * @prefix: pointer to location to store namespace prefix + * @uri_string: pointer to location to store namespace URI + * + * Parse a string containing an XML style namespace declaration + * into a namespace prefix and URI pair. + * + * The string is of the form xmlns:prefix="uri", + * xmlns="uri", xmlns:prefix="" or xmlns="". + * The quotes can be single or double quotes. + * + * Two values are returned from this function into *@prefix and + * *@uri_string. Either but not both may be NULL. + * + * See also raptor_namespace_format_as_xml() + * + * Return value: non-0 on failure. + **/ +int +raptor_xml_namespace_string_parse(const unsigned char *string, + unsigned char **prefix, + unsigned char **uri_string) +{ + const unsigned char *t; + unsigned char quote; + + if((!prefix || !uri_string)) + return 1; + + if(!string || (string && !*string)) + return 1; + + if(strncmp((const char*)string, "xmlns", 5)) + return 1; + + *prefix = NULL; + *uri_string = NULL; + + /* + * Four cases are expected and handled: + * xmlns="" + * xmlns="uri" + * xmlns:foo="" + * xmlns:foo="uri" + * + * (with " or ' quotes) + */ + + /* skip "xmlns" */ + string += 5; + + if(*string == ':') { + /* non-empty prefix */ + t = ++string; + while(*string && *string != '=') + string++; + if(!*string || string == t) + return 1; + + *prefix = RAPTOR_MALLOC(unsigned char*, string - t + 1); + if(!*prefix) + return 1; + memcpy(*prefix, t, string - t); + (*prefix)[string-t] = '\0'; + } + + if(*string++ != '=') + return 1; + + if(*string != '"' && *string != '\'') + return 1; + quote = *string++; + + t = string; + while(*string && *string != quote) + string++; + + if(*string != quote) + return 1; + + if(!(string - t)) + /* xmlns...="" */ + *uri_string = NULL; + else { + *uri_string = RAPTOR_MALLOC(unsigned char*, string - t + 1); + if(!*uri_string) + return 1; + memcpy(*uri_string, t, string - t); + (*uri_string)[string - t] = '\0'; + } + + return 0; +} + + +/** + * raptor_new_qname_from_namespace_uri: + * @nstack: namespace stack + * @uri: URI to use to make qname + * @xml_version: XML Version + * + * Make an appropriate XML Qname from the namespaces on a namespace stack + * + * Makes a qname from the in-scope namespaces in a stack if the URI matches + * the prefix and the rest is a legal XML name. + * + * Return value: #raptor_qname for the URI or NULL on failure + **/ +raptor_qname* +raptor_new_qname_from_namespace_uri(raptor_namespace_stack *nstack, + raptor_uri *uri, int xml_version) +{ + unsigned char *uri_string; + size_t uri_len; + raptor_namespace* ns = NULL; + unsigned char *ns_uri_string; + size_t ns_uri_len; + unsigned char *name = NULL; + int bucket; + + if(!uri) + return NULL; + + uri_string = raptor_uri_as_counted_string(uri, &uri_len); + + for(bucket = 0; bucket < nstack->table_size; bucket++) { + for(ns = nstack->table[bucket]; ns ; ns = ns->next) { + if(!ns->uri) + continue; + + ns_uri_string = raptor_uri_as_counted_string(ns->uri, + &ns_uri_len); + if(ns_uri_len >= uri_len) + continue; + if(strncmp((const char*)uri_string, (const char*)ns_uri_string, + ns_uri_len)) + continue; + + /* uri_string is a prefix of ns_uri_string */ + name = uri_string + ns_uri_len; + if(!raptor_xml_name_check(name, uri_len-ns_uri_len, xml_version)) + name = NULL; + + /* If name is set, we've found a prefix with a legal XML name value */ + if(name) + break; + } + if(name) + break; + } + + if(!ns) + return NULL; + + return raptor_new_qname_from_namespace_local_name(nstack->world, ns, + name, NULL); +} + + +#ifdef RAPTOR_DEBUG +void +raptor_namespace_print(FILE *stream, raptor_namespace* ns) +{ + const unsigned char *uri_string; + + uri_string = raptor_uri_as_string(ns->uri); + if(ns->prefix) + fprintf(stream, "%s:%s", ns->prefix, uri_string); + else + fprintf(stream, "(default):%s", uri_string); +} +#endif + + +raptor_namespace** +raptor_namespace_stack_to_array(raptor_namespace_stack *nstack, + size_t *size_p) +{ + raptor_namespace** ns_list; + size_t size = 0; + int bucket; + + ns_list = RAPTOR_CALLOC(raptor_namespace**, nstack->size, + sizeof(raptor_namespace*)); + if(!ns_list) + return NULL; + + for(bucket = 0; bucket < nstack->table_size; bucket++) { + raptor_namespace* ns; + + for(ns = nstack->table[bucket]; ns; ns = ns->next) { + int skip = 0; + unsigned int i; + if(ns->depth < 1) + continue; + + for(i = 0; i < size; i++) { + raptor_namespace* ns2 = ns_list[i]; + if((!ns->prefix && !ns2->prefix) || + (ns->prefix && ns2->prefix && + !strcmp((const char*)ns->prefix, (const char*)ns2->prefix))) { + /* this prefix was seen (overridden) earlier so skip */ + skip = 1; + break; + } + } + if(!skip) + ns_list[size++] = ns; + } + } + + if(size_p) + *size_p = size; + + return ns_list; +} + +#endif /* !STANDALONE */ + + +#ifdef STANDALONE + + +/* one more prototype */ +int main(int argc, char *argv[]); + + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *program = raptor_basename(argv[0]); + raptor_namespace_stack namespaces; /* static */ + raptor_namespace* ns; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + raptor_namespaces_init(world, &namespaces, 1); + + raptor_namespaces_start_namespace_full(&namespaces, + (const unsigned char*)"ex1", + (const unsigned char*)"http://example.org/ns1", + 0); + + raptor_namespaces_start_namespace_full(&namespaces, + (const unsigned char*)"ex2", + (const unsigned char*)"http://example.org/ns2", + 1); + + if(raptor_namespaces_find_namespace(&namespaces, NULL, 0)) { + fprintf(stderr, "%s: Default namespace found when should not be found, returning error\n", + program); + return(1); + } + + raptor_namespaces_start_namespace_full(&namespaces, + NULL, + (const unsigned char*)"http://example.org/ns3", + 2); + + ns = raptor_namespaces_find_namespace(&namespaces, NULL, 0); + if(!ns) { + fprintf(stderr, "%s: Default namespace not found when should not be found, returning error\n", + program); + return(1); + } + + ns = raptor_namespaces_find_namespace(&namespaces, (const unsigned char*)"ex2", 3); + if(!ns) { + fprintf(stderr, "%s: namespace ex2 not found when should not be found, returning error\n", + program); + return(1); + } + + raptor_namespaces_end_for_depth(&namespaces, 2); + + raptor_namespaces_end_for_depth(&namespaces, 1); + + raptor_namespaces_end_for_depth(&namespaces, 0); + + raptor_namespaces_clear(&namespaces); + + raptor_free_world(world); + + /* keep gcc -Wall happy */ + return(0); +} + +#endif + +/* + * Local Variables: + * mode:c + * c-basic-offset: 2 + * End: + */ diff --git a/src/raptor_nfc_icu.c b/src/raptor_nfc_icu.c new file mode 100644 index 0000000..03d2459 --- /dev/null +++ b/src/raptor_nfc_icu.c @@ -0,0 +1,112 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_nfc_icu.c - Raptor Unicode NFC checking via ICU library + * + * Copyright (C) 2012, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_STDLIB_H +#include +#endif + +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#include +#if ICU_UC_MAJOR_VERSION >= 56 +#include +#else +#include +#endif + + +/* + * raptor_nfc_icu_check: + * @input: UTF-8 string + * @length: length of string + * @error: pointer to error flag (or NULL) + * + * INTERNAL - Unicode Normal Form C (NFC) check function via ICU + * + * If errorp is not NULL, it is set to non-0 on error + * + * Return value: <0 on error, 0 if is not NFC, >0 if is NFC + **/ +int +raptor_nfc_icu_check(const unsigned char* string, size_t len) +{ +#if ICU_UC_MAJOR_VERSION >= 56 + /* norm2 is be a singleton - do not attempt to free it */ + const UNormalizer2 *norm2; +#endif + UErrorCode error_code = U_ZERO_ERROR; + UNormalizationCheckResult res; + UChar *dest; /* UTF-16 */ + int32_t dest_capacity = len << 1; + int32_t dest_length; + int rc = 0; + + /* ICU functions take a UTF-16 string so convert */ + dest = RAPTOR_MALLOC(UChar*, dest_capacity + 1); + if(!dest) + goto error; + + (void)u_strFromUTF8(dest, dest_capacity, &dest_length, + (const char *)string, (int32_t)len, &error_code); + if(!U_SUCCESS(error_code)) + goto error; + + /* unorm_quickCheck was deprecated in ICU UC V56 */ +#if ICU_UC_MAJOR_VERSION >= 56 + norm2 = unorm2_getNFCInstance(&error_code); + if(!U_SUCCESS(error_code)) + goto error; + + res = unorm2_quickCheck(norm2, dest, dest_length, &error_code); +#else + res = unorm_quickCheck(dest, dest_length, UNORM_NFC, &error_code); +#endif + if(!U_SUCCESS(error_code)) + goto error; + + /* success */ + rc = (res == UNORM_YES); + goto cleanup; + +error: + rc = -1; + +cleanup: + if(dest) + RAPTOR_FREE(UChar*, dest); + + return rc; +} diff --git a/src/raptor_nfc_test.c b/src/raptor_nfc_test.c new file mode 100644 index 0000000..625cf93 --- /dev/null +++ b/src/raptor_nfc_test.c @@ -0,0 +1,292 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_nfc_test.c - Raptor Unicode NFC validation check + * + * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * It operates over the Unicode NormalizationTest.txt + * which tests normalization the process, NOT normalization checking. + * It says: + * " CONFORMANCE: + * 1. The following invariants must be true for all conformant implementations + * NFC + * c2 == NFC(c1) == NFC(c2) == NFC(c3) + * c4 == NFC(c4) == NFC(c5) + * " + * + * It does NOT require that c1, c3 and c5 are NFC. + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include /* for isprint() */ +#include +#ifdef HAVE_ERRNO_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#undef RAPTOR_NFC_DECODE_DEBUG + + +/* + * decode_to_utf8: + * @utf8_string: destination utf8 buffer (FIXME big enough!) + * @unicode_string: first char of string + * @end: last char of unicode_string + */ +static size_t +decode_to_utf8(unsigned char *utf8_string, size_t utf8_string_length, + const char *unicode_string, const char *end) +{ + unsigned char *u = utf8_string; + const char *p = unicode_string; + +#ifdef RAPTOR_NFC_DECODE_DEBUG + fputs("decode_to_utf8: string '", stderr); + (void)fwrite(unicode_string, sizeof(char), (end-unicode_string) + 1, stderr); + fputs("' converts to:\n ", stderr); +#endif + + while(p < end) { + unsigned long c = 0; + char *endptr; + int unicode_width; + + if(*p == ' ') { + p++; + continue; + } + + c = (unsigned long)strtol(p, &endptr, 16); + +#ifdef RAPTOR_NFC_DECODE_DEBUG + fprintf(stderr, "U+%04lX ", c); +#endif + + p = (const char*)endptr; + + unichar_width = raptor_unicode_utf8_string_put_char(c, u, (end-p)); + if(unichar_width < 0) { + fprintf(stderr, + "decode_to_utf8 Illegal Unicode character with code point #x%lX.", + unichar); + break; + } + + u += (size_t)unichar_width; + + if((u-utf8_string) > RAPTOR_GOOD_CAST(int, utf8_string_length)) { + fprintf(stderr, + "decode_to_utf8 overwrote utf8_string buffer at byte %ld\n", + (u-utf8_string)); + abort(); + } + } + +#ifdef RAPTOR_NFC_DECODE_DEBUG + fputs("\n", stderr); +#endif + + return u-utf8_string; +} + + + +static void +utf8_print(const unsigned char *input, size_t length, FILE *stream) +{ + size_t i = 0; + + while(i < length && *input) { + unsigned long c; + int size = raptor_unicode_utf8_string_get_char(input, length - i, &c); + if(size <= 0) + return; + + if(i) + fputc(' ', stream); + fprintf(stream, "U+%04X", RAPTOR_GOOD_CAST(int, c)); + input += size; + i += size; + } +} + + +int +main (int argc, char *argv[]) +{ + const char *program = raptor_basename(argv[0]); + const char *filename; + FILE *fh; + int rc = 0; + unsigned int line = 1; + size_t max_c2_len = 0; + size_t max_c4_len = 0; + int passes = 0; + int fails = 0; + + if(argc != 2) { + fprintf(stderr, + "USAGE %s [path to NormalizationTest.txt]\n" + "Get it at http://unicode.org/Public/UNIDATA/NormalizationTest.txt\n", + program); + return 1; + } + + filename = argv[1]; + fh = fopen(filename, "r"); + if(!fh) { + fprintf(stderr, "%s: file '%s' open failed - %s\n", + program, filename, strerror(errno)); + return 1; + } + +#define LINE_BUFFER_SIZE 1024 + +/* FIXME big enough for Unicode 4 (c2 max 16; c4 max 33) */ +#define UNISTR_SIZE 40 + + for(;!feof(fh); line++) { + char buffer[LINE_BUFFER_SIZE]; + char *p, *start; + unsigned char column2[UNISTR_SIZE]; + unsigned char column4[UNISTR_SIZE]; + size_t column2_len, column4_len; + int nfc_rc; + int error; + + p = fgets(buffer, LINE_BUFFER_SIZE, fh); + if(!p) { + if(ferror(fh)) { + fprintf(stderr, "%s: file '%s' read failed - %s\n", + program, filename, strerror(errno)); + rc = 1; + break; + } + /* assume feof */ + break; + }; + +#if 0 + fprintf(stderr, "%s:%d: line '%s'\n", program, line, buffer); +#endif + + /* skip lines */ + if(*p == '@' || *p == '#') + continue; + + + /* skip column 1 */ + while(*p++ != ';') + ; + + /* read column 2 into column2, column2_len */ + start = p; + /* find end column 2 */ + while(*p++ != ';') + ; + + column2_len = decode_to_utf8(column2, UNISTR_SIZE, start, p-2); + if(column2_len > max_c2_len) + max_c2_len = column2_len; + +#if 0 + fprintf(stderr, "UTF8 column 2 (%ld bytes) is: '", column2_len); + utf8_print(column2, column2_len, stderr); + fputs("'\n", stderr); +#endif + + /* skip column 3 */ + while(*p++ != ';') + ; + + /* read column 4 into column4, column4_len */ + start = p; + /* find end column 4 */ + while(*p++ != ';') + ; + + column4_len = decode_to_utf8(column4, UNISTR_SIZE, start, p-2); + if(column4_len > max_c4_len) + max_c4_len = column4_len; + +#if 0 + fprintf(stderr, "UTF8 column 4 (%ld bytes) is: '", column4_len); + utf8_print(column4, column4_len, stderr); + fputs("'\n", stderr); +#endif + + if(!raptor_unicode_check_utf8_string(column2, column2_len)) { + fprintf(stderr, "%s:%d: UTF8 column 2 failed on: '", filename, line); + utf8_print(column2, column2_len, stderr); + fputs("'\n", stderr); + fails++; + } else + passes++; + + /* Column 2 must be NFC */ + nfc_rc = raptor_nfc_check(column2, column2_len, &error); + if(!nfc_rc) { + fprintf(stderr, "%s:%d: NFC column 2 failed on: '", filename, line); + utf8_print(column2, column2_len, stderr); + fprintf(stderr, "' at byte %d of %d\n", error, (int)column2_len); + fails++; + } else + passes++; + + if(column2_len == column4_len && !memcmp(column2, column4, column2_len)) + continue; + + if(!raptor_unicode_check_utf8_string(column4, column4_len)) { + fprintf(stderr, "%s:%d: UTF8 column 4 failed on: '", filename, line); + utf8_print(column4, column4_len, stderr); + fputs("'\n", stderr); + fails++; + } else + passes++; + + /* Column 4 must be in NFC */ + nfc_rc = raptor_nfc_check(column4, column4_len, &error); + if(!nfc_rc) { + fprintf(stderr, "%s:%d: NFC column 4 failed on: '", filename, line); + utf8_print(column4, column4_len, stderr); + fprintf(stderr, "' at byte %d of %d\n", error, (int)column4_len); + fails++; + } else + passes++; + } + + fclose(fh); + + fprintf(stderr, "%s: max column 2 len: %d, max column 4 len: %d\n", program, + (int)max_c2_len, (int)max_c4_len); + fprintf(stderr, "%s: passes: %d fails: %d\n", program, + passes, fails); + + return rc; +} diff --git a/src/raptor_ntriples.c b/src/raptor_ntriples.c new file mode 100644 index 0000000..3276e79 --- /dev/null +++ b/src/raptor_ntriples.c @@ -0,0 +1,723 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_ntriples.c - Raptor N-Triples parsing utilities + * + * Copyright (C) 2013, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* These are for 7-bit ASCII and not locale-specific */ +#define IS_ASCII_ALPHA(c) (((c) > 0x40 && (c) < 0x5B) || ((c) > 0x60 && (c) < 0x7B)) +#define IS_ASCII_UPPER(c) ((c) > 0x40 && (c) < 0x5B) +#define IS_ASCII_DIGIT(c) ((c) > 0x2F && (c) < 0x3A) +#define IS_ASCII_PRINT(c) ((c) > 0x1F && (c) < 0x7F) +#define TO_ASCII_LOWER(c) ((c)+0x20) + +typedef enum { + RAPTOR_TERM_CLASS_URI, /* ends on > */ + RAPTOR_TERM_CLASS_BNODEID, /* ends on first non [A-Za-z][A-Za-z0-9]* */ + RAPTOR_TERM_CLASS_STRING, /* ends on non-escaped " */ + RAPTOR_TERM_CLASS_LANGUAGE /* ends on first non [a-z0-9]+ ('-' [a-z0-9]+ )? */ +} raptor_ntriples_term_class; + + +static int +raptor_ntriples_term_valid(unsigned char c, int position, + raptor_ntriples_term_class term_class) +{ + int result = 0; + + switch(term_class) { + case RAPTOR_TERM_CLASS_URI: + /* ends on > */ + result = (c != '>'); + break; + + case RAPTOR_TERM_CLASS_BNODEID: + /* ends on first non [A-Za-z0-9_:][-.A-Za-z0-9]* */ + result = IS_ASCII_ALPHA(c) || IS_ASCII_DIGIT(c) || c == '_' || c == ':'; + if(position) + /* FIXME + * This isn't correct; '.' is allowed in positions 1..N-1 but + * this calling convention of character-by-character cannot + * check this. + */ + result = (result || c == '-' || c == '.'); + break; + + case RAPTOR_TERM_CLASS_STRING: + /* ends on " */ + result = (c != '"'); + break; + + case RAPTOR_TERM_CLASS_LANGUAGE: + /* ends on first non [a-zA-Z]+ ('-' [a-zA-Z0-9]+ )? + * Accept _ as synonym / typo for -. + */ + result = IS_ASCII_ALPHA(c); + if(position) + result = (result || IS_ASCII_DIGIT(c) || c == '-' || c == '_'); + break; + + default: + RAPTOR_DEBUG2("Unknown N-Triples term class %u", term_class); + } + + return result; +} + + +/* + * raptor_ntriples_parse_term_internal: + * @world: raptor world + * @locator: locator object (in/out) (or NULL) + * @start: pointer to starting character of string (in) + * @dest: destination of string (in) + * @lenp: pointer to length of string (in/out) + * @dest_lenp: pointer to length of destination string (out) + * @end_char: string ending character + * @class: string class + * + * INTERNAL - Parse an N-Triples term with escapes. + * + * Relies that @dest is long enough; it need only be as large as the + * input string @start since when UTF-8 encoding, the escapes are + * removed and the result is always less than or equal to length of + * input. + * + * N-Triples strings / URIs are written in ASCII at present; + * characters outside the printable ASCII range are discarded with a + * warning. See the grammar for full details of the allowed ranges. + * + * UTF-8 and the \u and \U esapes are both allowed. + * + * URIs may not have \t \b \n \r \f or raw ' ' or \u0020 or \u003C or \u003E + * + * Return value: Non 0 on failure + **/ +static int +raptor_ntriples_parse_term_internal(raptor_world* world, + raptor_locator* locator, + const unsigned char **start, + unsigned char *dest, + size_t *lenp, size_t *dest_lenp, + char end_char, + raptor_ntriples_term_class term_class) +{ + const unsigned char *p = *start; + unsigned char c = '\0'; + size_t ulen = 0; + unsigned long unichar = 0; + unsigned int position = 0; + int end_char_seen = 0; + + /* find end of string, fixing backslashed characters on the way */ + while(*lenp > 0) { + int unichar_width; + + c = *p; + + p++; + (*lenp)--; + if(locator) { + locator->column++; + locator->byte++; + } + + if(term_class == RAPTOR_TERM_CLASS_URI && c == ' ') { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, + "URI error - illegal character %d (0x%02X) found.", + c, RAPTOR_GOOD_CAST(unsigned int, c)); + return 1; + } + + if(c > 0x7f) { + /* just copy the UTF-8 bytes through */ + int unichar_len; + unichar_len = raptor_unicode_utf8_string_get_char(p - 1, 1 + *lenp, NULL); + if(unichar_len < 0 || RAPTOR_GOOD_CAST(size_t, unichar_len) > *lenp) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, + "UTF-8 encoding error at character %d (0x%02X) found.", + c, RAPTOR_GOOD_CAST(unsigned int, c)); + /* UTF-8 encoding had an error or ended in the middle of a string */ + return 1; + } + memmove(dest, p-1, unichar_len); + dest += unichar_len; + + unichar_len--; /* p, *lenp were moved on by 1 earlier */ + + p += unichar_len; + (*lenp) -= unichar_len; + if(locator) { + locator->column += unichar_len; + locator->byte += unichar_len; + } + continue; + } + + if(c != '\\') { + /* finish at non-backslashed end_char */ + if(end_char && c == end_char) { + end_char_seen = 1; + break; + } + + if(!raptor_ntriples_term_valid(c, position, term_class)) { + if(end_char) { + /* end char was expected, so finding an invalid thing is an error */ + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Missing terminating '%c' (found '%c')", end_char, c); + return 0; + } else { + /* it's the end - so rewind 1 to save next char */ + p--; + (*lenp)++; + if(locator) { + locator->column--; + locator->byte--; + } + if(term_class == RAPTOR_TERM_CLASS_BNODEID && dest[-1] == '.') { + /* If bnode id ended on '.' move back one */ + dest--; + + p--; + (*lenp)++; + if(locator) { + locator->column--; + locator->byte--; + } + } + break; + } + } + + /* otherwise store and move on */ + *dest++ = c; + position++; + continue; + } + + if(!*lenp) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "\\ at end of input."); + return 0; + } + + c = *p; + + p++; + (*lenp)--; + if(locator) { + locator->column++; + locator->byte++; + } + + switch(c) { + case '"': + case '\\': + *dest++ = c; + break; + case 'b': + case 'f': + case 'n': + case 'r': + case 't': + if(term_class == RAPTOR_TERM_CLASS_URI) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "URI error - illegal URI escape '\\%c'.", c); + return 1; + } + + if(c == 'b') + *dest++ = '\b'; + else if(c == 'f') + *dest++ = '\f'; + else if(c == 'n') + *dest++ = '\n'; + else if(c == 'r') + *dest++ = '\r'; + else /* 't' */ + *dest++ = '\t'; + break; + case '<': + case '>': + case '{': + case '}': + case '|': + case '^': + case '`': + /* Turtle 2013 allows these in URIs (as well as \" and \\) */ + *dest++ = c; + break; + + case 'u': + case 'U': + ulen = (c == 'u') ? 4 : 8; + + if(*lenp < ulen) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "%c over end of input.", c); + return 0; + } + + if(1) { + unsigned int ii; + int n = 0; + + for(ii = 0; ii < ulen; ii++) { + char cc = p[ii]; + if(!isxdigit(RAPTOR_GOOD_CAST(char, cc))) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "N-Triples string error - illegal hex digit %c in Unicode escape '%c%s...'", + cc, c, p); + n = 1; + break; + } + } + + if(n) + break; + + n = sscanf((const char*)p, ((ulen == 4) ? "%04lx" : "%08lx"), &unichar); + if(n != 1) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Illegal Uncode escape '%c%s...'", c, p); + break; + } + } + + p += ulen; + (*lenp) -= ulen; + if(locator) { + locator->column += RAPTOR_GOOD_CAST(int, ulen); + locator->byte += RAPTOR_GOOD_CAST(int, ulen); + } + + if(term_class == RAPTOR_TERM_CLASS_URI && + (unichar == 0x0020 || unichar == 0x003C || unichar == 0x003E)) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "URI error - illegal Unicode escape \\u%04lX in URI.", unichar); + break; + } + + if(unichar > raptor_unicode_max_codepoint) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Illegal Unicode character with code point #x%lX (max #x%lX).", unichar, raptor_unicode_max_codepoint); + break; + } + + unichar_width = raptor_unicode_utf8_string_put_char(unichar, dest, 4); + if(unichar_width < 0) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Illegal Unicode character with code point #x%lX.", unichar); + break; + } + + /* The destination length is set here to 4 since we know that in + * all cases, the UTF-8 encoded output sequence is always shorter + * than the input sequence, and the buffer is edited in place. + * \uXXXX: 6 bytes input - UTF-8 max 3 bytes output + * \uXXXXXXXX: 10 bytes input - UTF-8 max 4 bytes output + */ + dest += (int)unichar_width; + break; + + default: + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Illegal string escape \\%c in \"%s\"", c, (char*)start); + return 0; + } + + position++; + } /* end while */ + + + if(end_char && !end_char_seen) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Missing terminating '%c' before end of input.", end_char); + return 1; + } + + /* terminate dest, can be shorter than source */ + *dest = '\0'; + + if(dest_lenp) + *dest_lenp = p - *start; + + *start = p; + + return 0; +} + + +static int +raptor_parse_turtle_term_internal(raptor_world* world, + raptor_locator* locator, + const unsigned char **start, + unsigned char *dest, + size_t *len_p, size_t *dest_lenp, + raptor_uri** datatype_uri_p) +{ + const unsigned char *p = *start; + unsigned int position = 0; + /* 0 = xsd:integer; 1= xsd:decimal; 2= xsd:double */ + short dtype = 0; + int after_e = 0; + + while(*len_p > 0) { + unsigned char c = *p; + + if(after_e) { + if(!((c >= '0' && c <'9') || c == '+' || c == '-')) + break; + after_e = 0; + } else if((position > 0 && (c == '+' || c == '-')) || + !((c >= '0' && c <'9') || c == '.' || c == 'e' || c == 'E')) + break; + + if(c == '.') + dtype = 1; + else if(c == 'e' || c == 'E') { + dtype = 2; + after_e = 1; + } + + p++; + (*len_p)--; + if(locator) { + locator->column++; + locator->byte++; + } + + *dest++ = c; + + position++; + } + + *dest = '\0'; + + if(dest_lenp) + *dest_lenp = p - *start; + + *start = p; + + if(dtype == 0) + *datatype_uri_p = raptor_uri_copy(world->xsd_integer_uri); + else if (dtype == 1) + *datatype_uri_p = raptor_uri_copy(world->xsd_decimal_uri); + else + *datatype_uri_p = raptor_uri_copy(world->xsd_double_uri); + + return 0; +} + + +/* + * raptor_ntriples_parse_term: + * @world: raptor world + * @locator: raptor locator (in/out) (or NULL) + * @string: string input (in) + * @len_p: pointer to length of @string (in/out) + * @term_p: pointer to store term (out) + * @allow_turtle: non-0 to allow Turtle forms such as integers, boolean + * + * INTERNAL - Parse an N-Triples string into a #raptor_term + * + * The @len_p destination and @locator fields are modified as parsing + * proceeds to be used in error messages. The final value is written + * into the #raptor_term pointed at by @term_p + * + * Return value: number of bytes processed or 0 on failure + */ +size_t +raptor_ntriples_parse_term(raptor_world* world, raptor_locator* locator, + unsigned char *string, size_t *len_p, + raptor_term** term_p, int allow_turtle) +{ + unsigned char *p = string; + unsigned char *dest; + size_t term_length = 0; + + switch(*p) { + case '<': + dest = p; + + p++; + (*len_p)--; + if(locator) { + locator->column++; + locator->byte++; + } + + if(raptor_ntriples_parse_term_internal(world, locator, + (const unsigned char**)&p, + dest, len_p, &term_length, + '>', RAPTOR_TERM_CLASS_URI)) { + goto fail; + } + + if(1) { + raptor_uri *uri; + + /* Check for bad ordinal predicate */ + if(!strncmp((const char*)dest, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#_", 44)) { + int ordinal = raptor_check_ordinal(dest + 44); + if(ordinal <= 0) + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Illegal ordinal value %d in property '%s'.", ordinal, dest); + } + if(raptor_uri_uri_string_is_absolute(dest) <= 0) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "URI '%s' is not absolute.", dest); + goto fail; + } + + uri = raptor_new_uri(world, dest); + if(!uri) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Could not create URI for '%s'", (const char *)dest); + goto fail; + } + + *term_p = raptor_new_term_from_uri(world, uri); + raptor_free_uri(uri); + } + break; + + case '-': + case '+': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if(allow_turtle) { + raptor_uri* datatype_uri = NULL; + + dest = p; + + if(raptor_parse_turtle_term_internal(world, locator, + (const unsigned char**)&p, + dest, len_p, &term_length, + &datatype_uri)) { + goto fail; + } + + *term_p = raptor_new_term_from_literal(world, + dest, + datatype_uri, + NULL /* language */); + } else + goto fail; + break; + + case '"': + dest = p; + + p++; + (*len_p)--; + if(locator) { + locator->column++; + locator->byte++; + } + + if(raptor_ntriples_parse_term_internal(world, locator, + (const unsigned char**)&p, + dest, len_p, &term_length, + '"', RAPTOR_TERM_CLASS_STRING)) { + goto fail; + } + + if(1) { + unsigned char *object_literal_language = NULL; + unsigned char *object_literal_datatype = NULL; + raptor_uri* datatype_uri = NULL; + + if(*len_p && *p == '@') { + unsigned char *q; + size_t lang_len; + + object_literal_language = p; + + /* Skip - */ + p++; + (*len_p)--; + if(locator) { + locator->column++; + locator->byte++; + } + + if(!*len_p) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Missing language after \"string\"-"); + goto fail; + } + + if(raptor_ntriples_parse_term_internal(world, locator, + (const unsigned char**)&p, + object_literal_language, len_p, &lang_len, + '\0', RAPTOR_TERM_CLASS_LANGUAGE)) { + goto fail; + } + + if(!lang_len) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Invalid language tag at @%s", p); + goto fail; + } + + /* Normalize language to lowercase + * http://www.w3.org/TR/rdf-concepts/#dfn-language-identifier + * Also convert _ to - as synonym / typo. + */ + for(q = object_literal_language; *q; q++) { + if(IS_ASCII_UPPER(*q)) + *q = RAPTOR_GOOD_CAST(unsigned char, TO_ASCII_LOWER(*q)); + if(*q == '_') + *q = '-'; + } + + } + + if(*len_p > 1 && *p == '^' && p[1] == '^') { + + object_literal_datatype = p; + + /* Skip ^^ */ + p += 2; + *len_p -= 2; + if(locator) { + locator->column += 2; + locator->byte += 2; + } + + if(!*len_p || (*len_p && *p != '<')) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Missing datatype URI-ref in\"string\"^^ after ^^"); + goto fail; + } + + p++; + (*len_p)--; + if(locator) { + locator->column++; + locator->byte++; + } + + if(raptor_ntriples_parse_term_internal(world, locator, + (const unsigned char**)&p, + object_literal_datatype, len_p, NULL, + '>', RAPTOR_TERM_CLASS_URI)) { + goto fail; + } + + if(raptor_uri_uri_string_is_absolute(object_literal_datatype) <= 0) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Datatype URI '%s' is not absolute.", object_literal_datatype); + goto fail; + } + + } + + if(object_literal_datatype && object_literal_language) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Typed literal used with a language - ignoring the language"); + object_literal_language = NULL; + } + + if(object_literal_datatype) { + datatype_uri = raptor_new_uri(world, + object_literal_datatype); + if(!datatype_uri) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Could not create literal datatype uri '%s'", object_literal_datatype); + goto fail; + } + object_literal_language = NULL; + } + + *term_p = raptor_new_term_from_literal(world, + dest, + datatype_uri, + object_literal_language); + if(datatype_uri) + raptor_free_uri(datatype_uri); + } + + break; + + + case '_': + /* store where _ was */ + dest = p; + + p++; + (*len_p)--; + if(locator) { + locator->column++; + locator->byte++; + } + + if(!*len_p || (*len_p > 0 && *p != ':')) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Illegal bNodeID - _ not followed by :"); + goto fail; + } + + /* Found ':' - move on */ + + p++; + (*len_p)--; + if(locator) { + locator->column++; + locator->byte++; + } + + if(raptor_ntriples_parse_term_internal(world, locator, + (const unsigned char**)&p, + dest, len_p, &term_length, + '\0', + RAPTOR_TERM_CLASS_BNODEID)) { + goto fail; + } + + if(!term_length) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, locator, "Bad or missing bNodeID after _:"); + goto fail; + } + + *term_p = raptor_new_term_from_blank(world, dest); + + break; + + default: + RAPTOR_DEBUG2("Unknown term type '%c'", *p); + goto fail; + } + + fail: + + return p - string; +} diff --git a/src/raptor_option.c b/src/raptor_option.c new file mode 100644 index 0000000..119dfb8 --- /dev/null +++ b/src/raptor_option.c @@ -0,0 +1,718 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_option.c - Class options + * + * Copyright (C) 2004-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +static const struct +{ + raptor_option option; + raptor_option_area area; + raptor_option_value_type value_type; + const char *name; + const char *label; +} raptor_options_list[RAPTOR_OPTION_LAST + 1] = { + { RAPTOR_OPTION_SCANNING, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "scanForRDF", + "RDF/XML parser scans for rdf:RDF in XML content" + }, + { RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "allowNonNsAttributes", + "RDF/XML parser allows bare 'name' rather than namespaced 'rdf:name'" + }, + { RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "allowOtherParsetypes", + "RDF/XML parser allows user-defined rdf:parseType values" + }, + { RAPTOR_OPTION_ALLOW_BAGID, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "allowBagID", + "RDF/XML parser allows rdf:bagID" + }, + { RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "allowRDFtypeRDFlist", + "RDF/XML parser generates the collection rdf:type rdf:List triple" + }, + { RAPTOR_OPTION_NORMALIZE_LANGUAGE, + (raptor_option_area)(RAPTOR_OPTION_AREA_PARSER | RAPTOR_OPTION_AREA_SAX2), + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "normalizeLanguage", + "RDF/XML parser normalizes xml:lang values to lowercase" + }, + { RAPTOR_OPTION_NON_NFC_FATAL, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "nonNFCfatal", + "RDF/XML parser makes non-NFC literals a fatal error" + }, + { RAPTOR_OPTION_WARN_OTHER_PARSETYPES, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "warnOtherParseTypes", + "RDF/XML parser warns about unknown rdf:parseType values" + }, + { RAPTOR_OPTION_CHECK_RDF_ID, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "checkRdfID", + "RDF/XML parser checks rdf:ID values for duplicates" + }, + { RAPTOR_OPTION_RELATIVE_URIS, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "relativeURIs", + "Serializers write relative URIs wherever possible." + }, + { RAPTOR_OPTION_WRITER_AUTO_INDENT, + (raptor_option_area)(RAPTOR_OPTION_AREA_XML_WRITER | RAPTOR_OPTION_AREA_TURTLE_WRITER), + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "autoIndent", + "Turtle and XML Writer automatically indent elements." + }, + { RAPTOR_OPTION_WRITER_AUTO_EMPTY, + (raptor_option_area)(RAPTOR_OPTION_AREA_XML_WRITER | RAPTOR_OPTION_AREA_TURTLE_WRITER), + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "autoEmpty", + "Turtle and XML Writer automatically detect and abbreviate empty elements." + }, + { RAPTOR_OPTION_WRITER_INDENT_WIDTH, + (raptor_option_area)(RAPTOR_OPTION_AREA_XML_WRITER | RAPTOR_OPTION_AREA_TURTLE_WRITER), + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "indentWidth", + "Turtle and XML Writer use as number of spaces to indent." + }, + { RAPTOR_OPTION_WRITER_XML_VERSION, + (raptor_option_area)(RAPTOR_OPTION_AREA_SERIALIZER | RAPTOR_OPTION_AREA_XML_WRITER), + RAPTOR_OPTION_VALUE_TYPE_INT, + "xmlVersion", + "Serializers and XML Writer use as XML version to write." + }, + { RAPTOR_OPTION_WRITER_XML_DECLARATION, + (raptor_option_area)(RAPTOR_OPTION_AREA_SERIALIZER | RAPTOR_OPTION_AREA_XML_WRITER), + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "xmlDeclaration", + "Serializers and XML Writer write XML declaration." + }, + { RAPTOR_OPTION_NO_NET, + (raptor_option_area)(RAPTOR_OPTION_AREA_PARSER | RAPTOR_OPTION_AREA_SAX2), + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "noNet", + "Parsers and SAX2 XML Parser deny internal network requests." + }, + { RAPTOR_OPTION_RESOURCE_BORDER, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "resourceBorder", + "DOT serializer resource border color" + }, + { RAPTOR_OPTION_LITERAL_BORDER, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "literalBorder", + "DOT serializer literal border color" + }, + { RAPTOR_OPTION_BNODE_BORDER, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "bnodeBorder", + "DOT serializer blank node border color" + }, + { RAPTOR_OPTION_RESOURCE_FILL, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "resourceFill", + "DOT serializer resource fill color" + }, + { RAPTOR_OPTION_LITERAL_FILL, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "literalFill", + "DOT serializer literal fill color" + }, + { RAPTOR_OPTION_BNODE_FILL, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "bnodeFill", + "DOT serializer blank node fill color" + }, + { RAPTOR_OPTION_HTML_TAG_SOUP, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "htmlTagSoup", + "GRDDL parser uses a lax HTML parser" + }, + { RAPTOR_OPTION_MICROFORMATS, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "microformats", + "GRDDL parser looks for microformats" + }, + { RAPTOR_OPTION_HTML_LINK, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "htmlLink", + "GRDDL parser looks for " + }, + { RAPTOR_OPTION_WWW_TIMEOUT, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_INT, + "wwwTimeout", + "Parser WWW request retrieval timeout" + }, + { RAPTOR_OPTION_WRITE_BASE_URI, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "writeBaseURI", + "Serializers write a base URI directive @base / xml:base" + }, + { RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "wwwHttpCacheControl", + "Parser WWW request HTTP Cache-Control: header value" + }, + { RAPTOR_OPTION_WWW_HTTP_USER_AGENT, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "wwwHttpUserAgent", + "Parser WWW request HTTP User-Agent: header value" + }, + { RAPTOR_OPTION_JSON_CALLBACK, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "jsonCallback", + "JSON serializer callback function name" + }, + { RAPTOR_OPTION_JSON_EXTRA_DATA, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "jsonExtraData", + "JSON serializer callback data parameter" + }, + { RAPTOR_OPTION_RSS_TRIPLES, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "rssTriples", + "Atom and RSS serializers write extra RDF triples" + }, + { RAPTOR_OPTION_ATOM_ENTRY_URI, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_URI, + "atomEntryUri", + "Atom serializer writes an atom:entry with this URI (otherwise atom:feed)" + }, + { RAPTOR_OPTION_PREFIX_ELEMENTS, + RAPTOR_OPTION_AREA_SERIALIZER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "prefixElements", + "Atom and RSS serializers write namespace-prefixed elements" + }, + { RAPTOR_OPTION_STRICT, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "strict", + "Operate in strict conformance mode (otherwise lax)" + }, + { RAPTOR_OPTION_WWW_CERT_FILENAME, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "wwwCertFilename", + "SSL client certificate filename" + }, + { RAPTOR_OPTION_WWW_CERT_TYPE, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "wwwCertType", + "SSL client certificate type" + }, + { RAPTOR_OPTION_WWW_CERT_PASSPHRASE, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_STRING, + "wwwCertPassphrase", + "SSL client certificate passphrase" + }, + { RAPTOR_OPTION_NO_FILE, + (raptor_option_area)(RAPTOR_OPTION_AREA_PARSER | RAPTOR_OPTION_AREA_SAX2), + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "noFile", + "Parsers and SAX2 deny internal file requests." + }, + { RAPTOR_OPTION_WWW_SSL_VERIFY_PEER, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_INT, + "wwwSslVerifyPeer", + "SSL verify peer certficate" + }, + { RAPTOR_OPTION_WWW_SSL_VERIFY_HOST, + RAPTOR_OPTION_AREA_PARSER, + RAPTOR_OPTION_VALUE_TYPE_INT, + "wwwSslVerifyHost", + "SSL verify host matching" + }, + { RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES, + (raptor_option_area)(RAPTOR_OPTION_AREA_PARSER | RAPTOR_OPTION_AREA_SAX2), + RAPTOR_OPTION_VALUE_TYPE_BOOL, + "loadExternalEntities", + "Parsers and SAX2 should load external entities." + } +}; + + +static const char * const raptor_option_uri_prefix = "http://feature.librdf.org/raptor-"; +/* NOTE: this is strlen(raptor_option_uri_prefix) */ +static const int raptor_option_uri_prefix_len = 33; + + +static raptor_option_area +raptor_option_get_option_area_for_domain(raptor_domain domain) +{ + raptor_option_area area = RAPTOR_OPTION_AREA_NONE; + + if(domain == RAPTOR_DOMAIN_PARSER) + area = RAPTOR_OPTION_AREA_PARSER; + else if(domain == RAPTOR_DOMAIN_SERIALIZER) + area = RAPTOR_OPTION_AREA_SERIALIZER; + else if(domain == RAPTOR_DOMAIN_SAX2) + area = RAPTOR_OPTION_AREA_SAX2; + else if(domain == RAPTOR_DOMAIN_XML_WRITER) + area = RAPTOR_OPTION_AREA_XML_WRITER; + else if(domain == RAPTOR_DOMAIN_TURTLE_WRITER) + area = RAPTOR_OPTION_AREA_TURTLE_WRITER; + + return area; +} + + +/** + * raptor_free_option_description: + * @option_description: option description + * + * Destructor - free an option description object. + */ +void +raptor_free_option_description(raptor_option_description* option_description) +{ + if(!option_description) + return; + + /* these are shared strings pointing to static data in raptor_options_list[] */ + /* RAPTOR_FREE(char*, option_description->name); */ + /* RAPTOR_FREE(char*, option_description->label); */ + + if(option_description->uri) + raptor_free_uri(option_description->uri); + + RAPTOR_FREE(raptor_option_description, option_description); +} + + +/** + * raptor_world_get_option_description: + * @world: raptor world object + * @domain: domain + * @option: option enumeration (0+) + * + * Get a description of an option for a domain. + * + * The returned description must be freed with + * raptor_free_option_description(). + * + * Return value: option description or NULL on failure or if option is unknown + **/ +raptor_option_description* +raptor_world_get_option_description(raptor_world* world, + const raptor_domain domain, + const raptor_option option) +{ + raptor_option_area area; + raptor_option_description *option_description = NULL; + raptor_uri *base_uri = NULL; + int i; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL); + + raptor_world_open(world); + + area = raptor_option_get_option_area_for_domain(domain); + if(area == RAPTOR_OPTION_AREA_NONE) + return NULL; + + for(i = 0; i <= RAPTOR_OPTION_LAST; i++) { + if(raptor_options_list[i].option == option && + (raptor_options_list[i].area & area)) + break; + } + + if(i > RAPTOR_OPTION_LAST) + return NULL; + + option_description = RAPTOR_CALLOC(raptor_option_description*, 1, + sizeof(*option_description)); + if(!option_description) + return NULL; + + option_description->domain = domain; + option_description->option = option; + option_description->value_type = raptor_options_list[i].value_type; + option_description->name = raptor_options_list[i].name; + option_description->name_len = strlen(option_description->name); + option_description->label = raptor_options_list[i].label; + + base_uri = raptor_new_uri_from_counted_string(world, + (const unsigned char*)raptor_option_uri_prefix, + raptor_option_uri_prefix_len); + if(!base_uri) { + raptor_free_option_description(option_description); + return NULL; + } + + option_description->uri = raptor_new_uri_from_uri_local_name(world, + base_uri, + (const unsigned char*)raptor_options_list[i].name); + raptor_free_uri(base_uri); + if(!option_description->uri) { + raptor_free_option_description(option_description); + return NULL; + } + + return option_description; +} + + + +int +raptor_option_is_valid_for_area(const raptor_option option, + raptor_option_area area) +{ + if(option > RAPTOR_OPTION_LAST) + return 0; + return (raptor_options_list[option].area & area) != 0; +} + + +int +raptor_option_value_is_numeric(const raptor_option option) +{ + raptor_option_value_type t = raptor_options_list[option].value_type; + + return t == RAPTOR_OPTION_VALUE_TYPE_BOOL || + t == RAPTOR_OPTION_VALUE_TYPE_INT; +} + + +/** + * raptor_world_get_option_from_uri: + * @world: raptor_world instance + * @uri: option URI + * + * Get an option ID from a URI + * + * Option URIs are the concatenation of the string + * "http://feature.librdf.org/raptor-" plus the short name. + * + * They are automatically returned for any option described with + * raptor_world_get_option_description(). + * + * Return value: < 0 if the option is unknown or on error + **/ +raptor_option +raptor_world_get_option_from_uri(raptor_world* world, raptor_uri *uri) +{ + unsigned char *uri_string; + int i; + raptor_option option = (raptor_option)-1; + + if(!uri) + return option; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, (raptor_option)-1); + + raptor_world_open(world); + + uri_string = raptor_uri_as_string(uri); + if(strncmp((const char*)uri_string, raptor_option_uri_prefix, + raptor_option_uri_prefix_len)) + return option; + + uri_string += raptor_option_uri_prefix_len; + + for(i = 0; i <= RAPTOR_OPTION_LAST; i++) + if(!strcmp(raptor_options_list[i].name, (const char*)uri_string)) { + option = (raptor_option)i; + break; + } + + return option; +} + + +/** + * raptor_option_get_count: + * + * Get the count of options defined. + * + * This is prefered to the compile time-only symbol #RAPTOR_OPTION_LAST + * and returns a count of the number of options which is + * #RAPTOR_OPTION_LAST + 1. + * + * Return value: count of options in the #raptor_option enumeration + **/ +unsigned int +raptor_option_get_count(void) +{ + return RAPTOR_OPTION_LAST + 1; +} + + +const char* const +raptor_option_value_type_labels[RAPTOR_OPTION_VALUE_TYPE_URI + 1] = { + "boolean", + "integer", + "string", + "uri" +}; + + +/** + * raptor_option_get_value_type_label: + * @type: value type + * + * Get a label for a value type + * + * Return value: label for type or NULL for invalid type + */ +const char* +raptor_option_get_value_type_label(const raptor_option_value_type type) +{ + if(type > RAPTOR_OPTION_VALUE_TYPE_LAST) + return NULL; + return raptor_option_value_type_labels[type]; +} + + +int +raptor_object_options_copy_state(raptor_object_options* to, + raptor_object_options* from) +{ + int rc = 0; + int i; + + to->area = from->area; + for(i = 0; !rc && i <= RAPTOR_OPTION_LAST; i++) { + if(raptor_option_value_is_numeric((raptor_option)i)) + to->options[i].integer = from->options[i].integer; + else { + /* non-numeric values may need allocations */ + char* string = from->options[i].string; + if(string) { + size_t len = strlen(string); + to->options[i].string = RAPTOR_MALLOC(char*, len + 1); + if(to->options[i].string) + memcpy(to->options[i].string, string, len + 1); + else + rc = 1; + } + } + } + + return rc; +} + + +void +raptor_object_options_init(raptor_object_options* options, + raptor_option_area area) +{ + int i; + + options->area = area; + + for(i = 0; i <= RAPTOR_OPTION_LAST; i++) { + if(raptor_option_value_is_numeric((raptor_option)i)) + options->options[i].integer = 0; + else + options->options[i].string = NULL; + } + + /* Initialise default options that are not 0 or NULL */ + + /* Emit @base directive or equivalent */ + options->options[RAPTOR_OPTION_WRITE_BASE_URI].integer = 1; + + /* Emit relative URIs where possible */ + options->options[RAPTOR_OPTION_RELATIVE_URIS].integer = 1; + + /* XML 1.0 output */ + options->options[RAPTOR_OPTION_WRITER_XML_VERSION].integer = 10; + + /* Write XML declaration */ + options->options[RAPTOR_OPTION_WRITER_XML_DECLARATION].integer = 1; + + /* Indent 2 spaces */ + options->options[RAPTOR_OPTION_WRITER_INDENT_WIDTH].integer = 2; + + /* lax (no strict) parsing */ + options->options[RAPTOR_OPTION_STRICT].integer = 0; + + /* SSL verify peers */ + options->options[RAPTOR_OPTION_WWW_SSL_VERIFY_PEER].integer = 1; + + /* SSL fully verify hosts */ + options->options[RAPTOR_OPTION_WWW_SSL_VERIFY_HOST].integer = 2; + +} + + +void +raptor_object_options_clear(raptor_object_options* options) +{ + int i; + + for(i = 0; i <= RAPTOR_OPTION_LAST; i++) { + if(raptor_option_value_is_numeric((raptor_option)i)) + continue; + + if(options->options[i].string) + RAPTOR_FREE(char*, options->options[i].string); + } +} + + +/* + * raptor_object_options_get_option: + * @options: options object + * @option: option to get value + * @string_p: pointer to where to store string value + * @integer_p: pointer to where to store integer value + * + * INTERNAL - get option value + * + * Any string value returned in *@string_p is shared and must be + * copied by the caller. + * + * The allowed options vary by the area field of @options. + * + * Return value: option value or < 0 for an illegal option + **/ +int +raptor_object_options_get_option(raptor_object_options* options, + raptor_option option, + char** string_p, int* integer_p) +{ + if(!raptor_option_is_valid_for_area(option, options->area)) + return 1; + + if(raptor_option_value_is_numeric(option)) { + /* numeric options */ + int value = options->options[(int)option].integer; + if(integer_p) + *integer_p = value; + } else { + /* non-numeric options */ + char* string = options->options[(int)option].string; + if(string_p) + *string_p = string; + } + + return 0; +} + + +/* + * raptor_object_options_set_option: + * @options: options object + * @option: option to set + * @string: string option value (or NULL) + * @integer: integer option value + * + * INTERNAL - set option + * + * If @string is not NULL and the option type is numeric, the string + * value is converted to an integer and used in preference to @integer. + * + * If @string is NULL and the option type is not numeric, an error is + * returned. + * + * The @string values used are copied. + * + * The allowed options vary by the area field of @options. + * + * Return value: non 0 on failure or if the option is unknown + **/ +int +raptor_object_options_set_option(raptor_object_options *options, + raptor_option option, + const char* string, int integer) +{ + if(!raptor_option_is_valid_for_area(option, options->area)) + return 1; + + if(raptor_option_value_is_numeric(option)) { + /* numeric options */ + if(string) + integer = atoi((const char*)string); + + options->options[(int)option].integer = integer; + return 0; + } else { + /* non-numeric options */ + char *string_copy; + size_t len = 0; + + if(string) + len = strlen((const char*)string); + string_copy = RAPTOR_MALLOC(char*, len + 1); + if(!string_copy) + return 1; + + if(len) + memcpy(string_copy, string, len); + string_copy[len] = '\0'; + + options->options[(int)option].string = string_copy; + } + + return 0; +} diff --git a/src/raptor_parse.c b/src/raptor_parse.c new file mode 100644 index 0000000..9bc0a39 --- /dev/null +++ b/src/raptor_parse.c @@ -0,0 +1,1832 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_parse.c - Raptor Parser API + * + * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif +#ifdef HAVE_FCNTL_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifndef STANDALONE + +/* prototypes for helper functions */ +static void raptor_parser_set_strict(raptor_parser* rdf_parser, int is_strict); + +/* helper methods */ + +static void +raptor_free_parser_factory(raptor_parser_factory* factory) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(factory, raptor_parser_factory); + + if(factory->finish_factory) + factory->finish_factory(factory); + + RAPTOR_FREE(raptor_parser_factory, factory); +} + + +/* class methods */ + +int +raptor_parsers_init(raptor_world *world) +{ + int rc = 0; + + world->parsers = raptor_new_sequence((raptor_data_free_handler)raptor_free_parser_factory, NULL); + if(!world->parsers) + return 1; + +#ifdef RAPTOR_PARSER_RDFXML + rc+= raptor_init_parser_rdfxml(world) != 0; +#endif + +#ifdef RAPTOR_PARSER_NTRIPLES + rc+= raptor_init_parser_ntriples(world) != 0; +#endif + +#ifdef RAPTOR_PARSER_N3 + rc+= raptor_init_parser_n3(world) != 0; +#endif + +#ifdef RAPTOR_PARSER_TURTLE + rc+= raptor_init_parser_turtle(world) != 0; +#endif + +#ifdef RAPTOR_PARSER_TRIG + rc+= raptor_init_parser_trig(world) != 0; +#endif + +#ifdef RAPTOR_PARSER_RSS + rc+= raptor_init_parser_rss(world) != 0; +#endif + +#if defined(RAPTOR_PARSER_GRDDL) + rc+= raptor_init_parser_grddl_common(world) != 0; + +#ifdef RAPTOR_PARSER_GRDDL + rc+= raptor_init_parser_grddl(world) != 0; +#endif + +#endif + +#ifdef RAPTOR_PARSER_GUESS + rc+= raptor_init_parser_guess(world) != 0; +#endif + +#ifdef RAPTOR_PARSER_RDFA + rc+= raptor_init_parser_rdfa(world) != 0; +#endif + +#ifdef RAPTOR_PARSER_JSON + rc+= raptor_init_parser_json(world) != 0; +#endif + +#ifdef RAPTOR_PARSER_NQUADS + rc+= raptor_init_parser_nquads(world) != 0; +#endif + + return rc; +} + + +/* + * raptor_finish_parsers - delete all the registered parsers + */ +void +raptor_parsers_finish(raptor_world *world) +{ + if(world->parsers) { + raptor_free_sequence(world->parsers); + world->parsers = NULL; + } +#if defined(RAPTOR_PARSER_GRDDL) + raptor_terminate_parser_grddl_common(world); +#endif +} + + +/* + * raptor_world_register_parser_factory: + * @world: raptor world + * @factory: pointer to function to call to register the factory + * + * Internal - Register a parser via parser factory. + * + * All strings set in the @factory method are shared with the + * #raptor_parser_factory + * + * Return value: new factory object or NULL on failure + **/ +RAPTOR_EXTERN_C +raptor_parser_factory* +raptor_world_register_parser_factory(raptor_world* world, + int (*factory) (raptor_parser_factory*)) +{ + raptor_parser_factory *parser = NULL; + + parser = RAPTOR_CALLOC(raptor_parser_factory*, 1, sizeof(*parser)); + if(!parser) + return NULL; + + parser->world = world; + + parser->desc.mime_types = NULL; + + if(raptor_sequence_push(world->parsers, parser)) + return NULL; /* on error, parser is already freed by the sequence */ + + /* Call the parser registration function on the new object */ + if(factory(parser)) + return NULL; /* parser is owned and freed by the parsers sequence */ + + if(raptor_syntax_description_validate(&parser->desc)) { + raptor_log_error(world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Parser description failed to validate\n"); + goto tidy; + } + + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Registered parser %s\n", parser->desc.names[0]); +#endif + + return parser; + + /* Clean up on failure */ + tidy: + raptor_free_parser_factory(parser); + return NULL; +} + + +/* + * raptor_world_get_parser_factory: + * @world: world object + * @name: the factory name or NULL for the default factory + * + * INTERNAL - Get a parser factory by name. + * + * Return value: the factory object or NULL if there is no such factory + **/ +raptor_parser_factory* +raptor_world_get_parser_factory(raptor_world *world, const char *name) +{ + raptor_parser_factory *factory = NULL; + + /* return 1st parser if no particular one wanted - why? */ + if(!name) { + factory = (raptor_parser_factory *)raptor_sequence_get_at(world->parsers, 0); + if(!factory) { + RAPTOR_DEBUG1("No (default) parsers registered\n"); + return NULL; + } + } else { + int i; + + for(i = 0; + (factory = (raptor_parser_factory*)raptor_sequence_get_at(world->parsers, i)); + i++) { + int namei; + const char* fname; + + for(namei = 0; (fname = factory->desc.names[namei]); namei++) { + if(!strcmp(fname, name)) + break; + } + if(fname) + break; + } + } + + return factory; +} + + +/** + * raptor_world_get_parsers_count: + * @world: world object + * + * Get number of parsers + * + * Return value: number of parsers or <0 on failure + **/ +int +raptor_world_get_parsers_count(raptor_world* world) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1); + + raptor_world_open(world); + + return raptor_sequence_size(world->parsers); +} + + +/** + * raptor_world_get_parser_description: + * @world: world object + * @counter: index into the list of parsers + * + * Get parser descriptive syntax information + * + * Return value: description or NULL if counter is out of range + **/ +const raptor_syntax_description* +raptor_world_get_parser_description(raptor_world* world, + unsigned int counter) +{ + raptor_parser_factory *factory; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL); + + raptor_world_open(world); + + factory = (raptor_parser_factory*)raptor_sequence_get_at(world->parsers, + counter); + + if(!factory) + return NULL; + + return &factory->desc; +} + + +/** + * raptor_world_is_parser_name: + * @world: world object + * @name: the syntax name + * + * Check the name of a parser is known. + * + * Return value: non 0 if name is a known syntax name + */ +int +raptor_world_is_parser_name(raptor_world* world, const char *name) +{ + if(!name) + return 0; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, 0); + + raptor_world_open(world); + + return (raptor_world_get_parser_factory(world, name) != NULL); +} + + +/** + * raptor_new_parser: + * @world: world object + * @name: the parser name or NULL for default parser + * + * Constructor - create a new raptor_parser object. + * + * Return value: a new #raptor_parser object or NULL on failure + */ +raptor_parser* +raptor_new_parser(raptor_world* world, const char *name) +{ + raptor_parser_factory* factory; + raptor_parser* rdf_parser; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + factory = raptor_world_get_parser_factory(world, name); + if(!factory) + return NULL; + + rdf_parser = RAPTOR_CALLOC(raptor_parser*, 1, sizeof(*rdf_parser)); + if(!rdf_parser) + return NULL; + + rdf_parser->world = world; + raptor_statement_init(&rdf_parser->statement, world); + + rdf_parser->context = RAPTOR_CALLOC(void*, 1, factory->context_length); + if(!rdf_parser->context) { + raptor_free_parser(rdf_parser); + return NULL; + } + +#ifdef RAPTOR_XML_LIBXML + rdf_parser->magic = RAPTOR_LIBXML_MAGIC; +#endif + rdf_parser->factory = factory; + + /* Bit flags */ + rdf_parser->failed = 0; + rdf_parser->emit_graph_marks = 1; + rdf_parser->emitted_default_graph = 0; + + raptor_object_options_init(&rdf_parser->options, RAPTOR_OPTION_AREA_PARSER); + + /* set parsing strictness from default value */ + raptor_parser_set_strict(rdf_parser, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_STRICT)); + + if(factory->init(rdf_parser, name)) { + raptor_free_parser(rdf_parser); + return NULL; + } + + return rdf_parser; +} + + +/** + * raptor_new_parser_for_content: + * @world: world object + * @uri: URI identifying the syntax (or NULL) + * @mime_type: mime type identifying the content (or NULL) + * @buffer: buffer of content to guess (or NULL) + * @len: length of buffer + * @identifier: identifier of content (or NULL) + * + * Constructor - create a new raptor_parser. + * + * Uses raptor_world_guess_parser_name() to find a parser by scoring + * recognition of the syntax by a block of characters, the content + * identifier or a mime type. The content identifier is typically a + * filename or URI or some other identifier. + * + * Return value: a new #raptor_parser object or NULL on failure + **/ +raptor_parser* +raptor_new_parser_for_content(raptor_world* world, + raptor_uri *uri, const char *mime_type, + const unsigned char *buffer, size_t len, + const unsigned char *identifier) +{ + const char* name; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + name = raptor_world_guess_parser_name(world, uri, mime_type, + buffer, len, identifier); + return name ? raptor_new_parser(world, name) : NULL; +} + + +/** + * raptor_parser_parse_start: + * @rdf_parser: RDF parser + * @uri: base URI or may be NULL if no base URI is required + * + * Start a parse of content with base URI. + * + * Parsers that need a base URI can be identified using a syntax + * description returned by raptor_world_get_parser_description() + * statically or raptor_parser_get_description() on a constructed + * parser. + * + * Return value: non-0 on failure, <0 if a required base URI was missing + **/ +int +raptor_parser_parse_start(raptor_parser *rdf_parser, raptor_uri *uri) +{ + if((rdf_parser->factory->desc.flags & RAPTOR_SYNTAX_NEED_BASE_URI) && !uri) { + raptor_parser_error(rdf_parser, "Missing base URI for %s parser.", + rdf_parser->factory->desc.names[0]); + return -1; + } + + if(uri) + uri = raptor_uri_copy(uri); + + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; + + rdf_parser->locator.uri = uri; + rdf_parser->locator.line = -1; + rdf_parser->locator.column = -1; + rdf_parser->locator.byte = -1; + + if(rdf_parser->factory->start) + return rdf_parser->factory->start(rdf_parser); + else + return 0; +} + + + + +/** + * raptor_parser_parse_chunk: + * @rdf_parser: RDF parser + * @buffer: content to parse + * @len: length of buffer + * @is_end: non-0 if this is the end of the content (such as EOF) + * + * Parse a block of content into triples. + * + * This method can only be called after raptor_parser_parse_start() has + * initialised the parser. + * + * Return value: non-0 on failure. + **/ +int +raptor_parser_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *buffer, size_t len, int is_end) +{ + if(rdf_parser->sb) + raptor_stringbuffer_append_counted_string(rdf_parser->sb, buffer, len, 1); + + return rdf_parser->factory->chunk(rdf_parser, buffer, len, is_end); +} + + +/** + * raptor_free_parser: + * @parser: #raptor_parser object + * + * Destructor - destroy a raptor_parser object. + * + **/ +void +raptor_free_parser(raptor_parser* rdf_parser) +{ + if(!rdf_parser) + return; + + if(rdf_parser->factory) + rdf_parser->factory->terminate(rdf_parser); + + if(rdf_parser->www) + raptor_free_www(rdf_parser->www); + + if(rdf_parser->context) + RAPTOR_FREE(raptor_parser_context, rdf_parser->context); + + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + + if(rdf_parser->sb) + raptor_free_stringbuffer(rdf_parser->sb); + + raptor_object_options_clear(&rdf_parser->options); + + RAPTOR_FREE(raptor_parser, rdf_parser); +} + + +/** + * raptor_parser_parse_file_stream: + * @rdf_parser: parser + * @stream: FILE* of RDF content + * @filename: filename of content or NULL if it has no name + * @base_uri: the base URI to use + * + * Parse RDF content from a FILE*. + * + * After draining the FILE* stream (EOF), fclose is not called on it. + * + * Return value: non 0 on failure + **/ +int +raptor_parser_parse_file_stream(raptor_parser* rdf_parser, + FILE *stream, const char* filename, + raptor_uri *base_uri) +{ + int rc = 0; + raptor_locator *locator = &rdf_parser->locator; + + if(!stream || !base_uri) + return 1; + + locator->line= locator->column = -1; + locator->file= filename; + + if(raptor_parser_parse_start(rdf_parser, base_uri)) + return 1; + + while(!feof(stream)) { + size_t len = fread(rdf_parser->buffer, 1, RAPTOR_READ_BUFFER_SIZE, stream); + int is_end = (len < RAPTOR_READ_BUFFER_SIZE); + rdf_parser->buffer[len] = '\0'; + rc = raptor_parser_parse_chunk(rdf_parser, rdf_parser->buffer, len, is_end); + if(rc || is_end) + break; + } + + return (rc != 0); +} + + +/** + * raptor_parser_parse_file: + * @rdf_parser: parser + * @uri: URI of RDF content or NULL to read from standard input + * @base_uri: the base URI to use (or NULL if the same) + * + * Parse RDF content at a file URI. + * + * If @uri is NULL (source is stdin), then the @base_uri is required. + * + * Return value: non 0 on failure + **/ +int +raptor_parser_parse_file(raptor_parser* rdf_parser, raptor_uri *uri, + raptor_uri *base_uri) +{ + int rc = 0; + int free_base_uri = 0; + const char *filename = NULL; + FILE *fh = NULL; +#if defined(HAVE_UNISTD_H) && defined(HAVE_SYS_STAT_H) + struct stat buf; +#endif + + if(uri) { + filename = raptor_uri_uri_string_to_filename(raptor_uri_as_string(uri)); + if(!filename) + return 1; + +#if defined(HAVE_UNISTD_H) && defined(HAVE_SYS_STAT_H) + if(!stat(filename, &buf) && S_ISDIR(buf.st_mode)) { + raptor_parser_error(rdf_parser, "Cannot read from a directory '%s'", + filename); + goto cleanup; + } +#endif + + fh = fopen(filename, "r"); + if(!fh) { + raptor_parser_error(rdf_parser, "file '%s' open failed - %s", + filename, strerror(errno)); + goto cleanup; + } + if(!base_uri) { + base_uri = raptor_uri_copy(uri); + free_base_uri = 1; + } + } else { + if(!base_uri) + return 1; + fh = stdin; + } + + rc = raptor_parser_parse_file_stream(rdf_parser, fh, filename, base_uri); + + cleanup: + if(uri) { + if(fh) + fclose(fh); + RAPTOR_FREE(char*, filename); + } + if(free_base_uri) + raptor_free_uri(base_uri); + + return rc; +} + + +void +raptor_parser_parse_uri_write_bytes(raptor_www* www, + void *userdata, const void *ptr, + size_t size, size_t nmemb) +{ + raptor_parse_bytes_context* rpbc = (raptor_parse_bytes_context*)userdata; + size_t len = size * nmemb; + + if(!rpbc->started) { + raptor_uri* base_uri = rpbc->base_uri; + + if(!base_uri) { + rpbc->final_uri = raptor_www_get_final_uri(www); + /* base URI after URI resolution is finally chosen */ + base_uri = rpbc->final_uri ? rpbc->final_uri : www->uri; + } + + if(raptor_parser_parse_start(rpbc->rdf_parser, base_uri)) + raptor_www_abort(www, "Parsing failed"); + rpbc->started = 1; + } + + if(raptor_parser_parse_chunk(rpbc->rdf_parser, (unsigned char*)ptr, len, 0)) + raptor_www_abort(www, "Parsing failed"); +} + + +static void +raptor_parser_parse_uri_content_type_handler(raptor_www* www, void* userdata, + const char* content_type) +{ + raptor_parser* rdf_parser = (raptor_parser*)userdata; + if(rdf_parser->factory->content_type_handler) + rdf_parser->factory->content_type_handler(rdf_parser, content_type); +} + + +int +raptor_parser_set_uri_filter_no_net(void *user_data, raptor_uri* uri) +{ + unsigned char* uri_string = raptor_uri_as_string(uri); + + if(raptor_uri_uri_string_is_file_uri(uri_string)) + return 0; + + raptor_parser_error((raptor_parser*)user_data, + "Network fetch of URI '%s' denied", uri_string); + return 1; +} + + +/** + * raptor_parser_parse_uri: + * @rdf_parser: parser + * @uri: URI of RDF content + * @base_uri: the base URI to use (or NULL if the same) + * + * Parse the RDF content at URI. + * + * Sends an HTTP Accept: header whent the URI is of the HTTP protocol, + * see raptor_parser_parse_uri_with_connection() for details including + * how the @base_uri is used. + * + * Return value: non 0 on failure + **/ +int +raptor_parser_parse_uri(raptor_parser* rdf_parser, raptor_uri *uri, + raptor_uri *base_uri) +{ + return raptor_parser_parse_uri_with_connection(rdf_parser, uri, base_uri, + NULL); +} + + +/** + * raptor_parser_parse_uri_with_connection: + * @rdf_parser: parser + * @uri: URI of RDF content + * @base_uri: the base URI to use (or NULL if the same) + * @connection: connection object pointer or NULL to create a new one + * + * Parse RDF content at URI using existing WWW connection. + * + * If @base_uri is not given and during resolution of the URI, a + * protocol redirection occurs, the final resolved URI will be + * used as the base URI. If redirection does not occur, the + * base URI will be @uri. + * + * If @base_uri is given, it overrides the process above. + * + * When @connection is NULL and a MIME Type exists for the parser + * type, this type is sent in an HTTP Accept: header in the form + * Accept: MIME-TYPE along with a wildcard of 0.1 quality, so MIME-TYPE is + * prefered rather than the sole answer. The latter part may not be + * necessary but should ensure an HTTP 200 response. + * + * Return value: non 0 on failure + **/ +int +raptor_parser_parse_uri_with_connection(raptor_parser* rdf_parser, + raptor_uri *uri, + raptor_uri *base_uri, void *connection) +{ + int ret = 0; + raptor_parse_bytes_context rpbc; + char* ua = NULL; + char* cert_filename = NULL; + char* cert_type = NULL; + char* cert_passphrase = NULL; + int ssl_verify_peer; + int ssl_verify_host; + + if(connection) { + if(rdf_parser->www) + raptor_free_www(rdf_parser->www); + rdf_parser->www = raptor_new_www_with_connection(rdf_parser->world, + connection); + if(!rdf_parser->www) + return 1; + } else { + const char *accept_h; + + if(rdf_parser->www) + raptor_free_www(rdf_parser->www); + rdf_parser->www = raptor_new_www(rdf_parser->world); + if(!rdf_parser->www) + return 1; + + accept_h = raptor_parser_get_accept_header(rdf_parser); + if(accept_h) { + ret = raptor_www_set_http_accept2(rdf_parser->www, accept_h, 0); + RAPTOR_FREE(char*, accept_h); + if(ret) + return 1; + } + } + + rpbc.rdf_parser = rdf_parser; + rpbc.base_uri = base_uri; + rpbc.final_uri = NULL; + rpbc.started = 0; + + if(rdf_parser->uri_filter) + raptor_www_set_uri_filter(rdf_parser->www, rdf_parser->uri_filter, + rdf_parser->uri_filter_user_data); + else if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NO_NET)) + raptor_www_set_uri_filter(rdf_parser->www, + raptor_parser_set_uri_filter_no_net, rdf_parser); + + raptor_www_set_write_bytes_handler(rdf_parser->www, + raptor_parser_parse_uri_write_bytes, + &rpbc); + + raptor_www_set_content_type_handler(rdf_parser->www, + raptor_parser_parse_uri_content_type_handler, + rdf_parser); + + raptor_www_set_http_cache_control(rdf_parser->www, + RAPTOR_OPTIONS_GET_STRING(rdf_parser, + RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL)); + + ua = RAPTOR_OPTIONS_GET_STRING(rdf_parser, RAPTOR_OPTION_WWW_HTTP_USER_AGENT); + if(ua) { + if(raptor_www_set_user_agent2(rdf_parser->www, ua, 0)) + return 1; + } + + cert_filename = RAPTOR_OPTIONS_GET_STRING(rdf_parser, + RAPTOR_OPTION_WWW_CERT_FILENAME); + cert_type = RAPTOR_OPTIONS_GET_STRING(rdf_parser, + RAPTOR_OPTION_WWW_CERT_TYPE); + cert_passphrase = RAPTOR_OPTIONS_GET_STRING(rdf_parser, + RAPTOR_OPTION_WWW_CERT_PASSPHRASE); + if(cert_filename || cert_type || cert_passphrase) + raptor_www_set_ssl_cert_options(rdf_parser->www, cert_filename, + cert_type, cert_passphrase); + + ssl_verify_peer = RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, + RAPTOR_OPTION_WWW_SSL_VERIFY_PEER); + ssl_verify_host = RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, + RAPTOR_OPTION_WWW_SSL_VERIFY_HOST); + raptor_www_set_ssl_verify_options(rdf_parser->www, ssl_verify_peer, + ssl_verify_host); + + ret = raptor_www_fetch(rdf_parser->www, uri); + + if(!rpbc.started && !ret) + ret = raptor_parser_parse_start(rdf_parser, base_uri); + + if(rpbc.final_uri) + raptor_free_uri(rpbc.final_uri); + + if(ret) { + raptor_free_www(rdf_parser->www); + rdf_parser->www = NULL; + return 1; + } + + if(raptor_parser_parse_chunk(rdf_parser, NULL, 0, 1)) + rdf_parser->failed = 1; + + raptor_free_www(rdf_parser->www); + rdf_parser->www = NULL; + + return rdf_parser->failed; +} + + +/* + * raptor_parser_fatal_error - Fatal Error from a parser - Internal + */ +void +raptor_parser_fatal_error(raptor_parser* parser, const char *message, ...) +{ + va_list arguments; + + va_start(arguments, message); + if(parser) { + parser->failed = 1; + raptor_log_error_varargs(parser->world, + RAPTOR_LOG_LEVEL_FATAL, + &parser->locator, + message, arguments); + } else + raptor_log_error_varargs(NULL, + RAPTOR_LOG_LEVEL_FATAL, NULL, + message, arguments); + va_end(arguments); +} + + +/* + * raptor_parser_error - Error from a parser - Internal + */ +void +raptor_parser_error(raptor_parser* parser, const char *message, ...) +{ + va_list arguments; + + va_start(arguments, message); + + raptor_parser_log_error_varargs(parser, RAPTOR_LOG_LEVEL_ERROR, + message, arguments); + + va_end(arguments); +} + + +/** + * raptor_parser_log_error_varargs: + * @parser: parser (or NULL) + * @level: log level + * @message: error format message + * @arguments: varargs for message + * + * Error from a parser - Internal. + */ +void +raptor_parser_log_error_varargs(raptor_parser* parser, + raptor_log_level level, + const char *message, va_list arguments) +{ + if(parser) + raptor_log_error_varargs(parser->world, + level, + &parser->locator, + message, arguments); + else + raptor_log_error_varargs(NULL, + level, + NULL, + message, arguments); +} + + +/** + * raptor_parser_log_error: + * @parser: parser (or NULL) + * @level: log level + * @message: error format message + * + * Error from a parser - Internal. + */ +void +raptor_parser_log_error(raptor_parser* parser, + raptor_log_level level, + const char *message, ...) +{ + va_list arguments; + + va_start(arguments, message); + + if(parser) + raptor_log_error_varargs(parser->world, + level, + &parser->locator, + message, arguments); + else + raptor_log_error_varargs(NULL, + level, + NULL, + message, arguments); + + va_end(arguments); +} + + +/* + * raptor_parser_warning - Warning from a parser - Internal + */ +void +raptor_parser_warning(raptor_parser* parser, const char *message, ...) +{ + va_list arguments; + + va_start(arguments, message); + + if(parser) + raptor_log_error_varargs(parser->world, + RAPTOR_LOG_LEVEL_WARN, + &parser->locator, + message, arguments); + else + raptor_log_error_varargs(NULL, + RAPTOR_LOG_LEVEL_WARN, + NULL, + message, arguments); + + va_end(arguments); +} + + + +/* PUBLIC FUNCTIONS */ + +/** + * raptor_parser_set_statement_handler: + * @parser: #raptor_parser parser object + * @user_data: user data pointer for callback + * @handler: new statement callback function + * + * Set the statement handler function for the parser. + * + * Use this to set the function to receive statements as the parsing + * proceeds. The statement argument to @handler is shared and must be + * copied by the caller with raptor_statement_copy(). + **/ +void +raptor_parser_set_statement_handler(raptor_parser* parser, + void *user_data, + raptor_statement_handler handler) +{ + parser->user_data = user_data; + parser->statement_handler = handler; +} + + +/** + * raptor_parser_set_graph_mark_handler: + * @parser: #raptor_parser parser object + * @user_data: user data pointer for callback + * @handler: new graph callback function + * + * Set the graph mark handler function for the parser. + * + * See #raptor_graph_mark_handler and #raptor_graph_mark_flags for + * the marks that may be returned by the handler. + * + **/ +void +raptor_parser_set_graph_mark_handler(raptor_parser* parser, + void *user_data, + raptor_graph_mark_handler handler) +{ + parser->user_data = user_data; + parser->graph_mark_handler = handler; +} + + +/** + * raptor_parser_set_namespace_handler: + * @parser: #raptor_parser parser object + * @user_data: user data pointer for callback + * @handler: new namespace callback function + * + * Set the namespace handler function for the parser. + * + * When a prefix/namespace is seen in a parser, call the given + * @handler with the prefix string and the #raptor_uri namespace URI. + * Either can be NULL for the default prefix or default namespace. + * + * The handler function does not deal with duplicates so any + * namespace may be declared multiple times. + * + **/ +void +raptor_parser_set_namespace_handler(raptor_parser* parser, + void *user_data, + raptor_namespace_handler handler) +{ + parser->namespace_handler = handler; + parser->namespace_handler_user_data = user_data; +} + + +/** + * raptor_parser_set_uri_filter: + * @parser: parser object + * @filter: URI filter function + * @user_data: User data to pass to filter function + * + * Set URI filter function for WWW retrieval. + **/ +void +raptor_parser_set_uri_filter(raptor_parser* parser, + raptor_uri_filter_func filter, + void *user_data) +{ + parser->uri_filter = filter; + parser->uri_filter_user_data = user_data; +} + + +/** + * raptor_parser_set_option: + * @parser: #raptor_parser parser object + * @option: option to set from enumerated #raptor_option values + * @string: string option value (or NULL) + * @integer: integer option value + * + * Set parser option. + * + * If @string is not NULL and the option type is numeric, the string + * value is converted to an integer and used in preference to @integer. + * + * If @string is NULL and the option type is not numeric, an error is + * returned. + * + * The @string values used are copied. + * + * The allowed options are available via + * raptor_world_get_option_description(). + * + * Return value: non 0 on failure or if the option is unknown + **/ +int +raptor_parser_set_option(raptor_parser *parser, raptor_option option, + const char* string, int integer) +{ + int rc; + + rc = raptor_object_options_set_option(&parser->options, option, + string, integer); + if(option == RAPTOR_OPTION_STRICT && !rc) { + int is_strict = RAPTOR_OPTIONS_GET_NUMERIC(parser, RAPTOR_OPTION_STRICT); + raptor_parser_set_strict(parser, is_strict); + } + + return rc; +} + + +/** + * raptor_parser_get_option: + * @parser: #raptor_parser parser object + * @option: option to get value + * @string_p: pointer to where to store string value + * @integer_p: pointer to where to store integer value + * + * Get parser option. + * + * Any string value returned in *@string_p is shared and must + * be copied by the caller. + * + * The allowed options are available via + * raptor_world_get_option_description(). + * + * Return value: option value or < 0 for an illegal option + **/ +int +raptor_parser_get_option(raptor_parser *parser, raptor_option option, + char** string_p, int* integer_p) +{ + return raptor_object_options_get_option(&parser->options, option, + string_p, integer_p); +} + + +/** + * raptor_parser_set_strict: + * @rdf_parser: #raptor_parser object + * @is_strict: Non 0 for strict parsing + * + * INTERNAL - Set parser to strict / lax mode. + * + **/ +static void +raptor_parser_set_strict(raptor_parser* rdf_parser, int is_strict) +{ + is_strict = (is_strict) ? 1 : 0; + + /* Initialise default parser mode */ + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_SCANNING, 0); + + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES, !is_strict); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES, !is_strict); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_BAGID, !is_strict); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST, 0); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_NORMALIZE_LANGUAGE, 1); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_NON_NFC_FATAL, is_strict); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_WARN_OTHER_PARSETYPES, !is_strict); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_CHECK_RDF_ID, 1); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_HTML_TAG_SOUP, !is_strict); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_MICROFORMATS, !is_strict); + RAPTOR_OPTIONS_SET_NUMERIC(rdf_parser, RAPTOR_OPTION_HTML_LINK, !is_strict); +} + + +/** + * raptor_parser_get_name: + * @rdf_parser: #raptor_parser parser object + * + * Get the name of a parser. + * + * Use raptor_parser_get_description() to get the alternate names and + * aliases as well as other descriptive values. + * + * Return value: the short name for the parser. + **/ +const char* +raptor_parser_get_name(raptor_parser *rdf_parser) +{ + if(rdf_parser->factory->get_name) + return rdf_parser->factory->get_name(rdf_parser); + else + return rdf_parser->factory->desc.names[0]; +} + + +/** + * raptor_parser_get_description: + * @rdf_parser: #raptor_parser parser object + * + * Get description of the syntaxes of the parser. + * + * The returned description is static and lives as long as the raptor + * library (raptor world). + * + * Return value: description of syntax + **/ +const raptor_syntax_description* +raptor_parser_get_description(raptor_parser *rdf_parser) +{ + if(rdf_parser->factory->get_description) + return rdf_parser->factory->get_description(rdf_parser); + else + return &rdf_parser->factory->desc; +} + + + +/** + * raptor_parser_parse_abort: + * @rdf_parser: #raptor_parser parser object + * + * Abort an ongoing parsing. + * + * Causes any ongoing generation of statements by a parser to be + * terminated and the parser to return controlto the application + * as soon as draining any existing buffers. + * + * Most useful inside raptor_parser_parse_file() or + * raptor_parser_parse_uri() when the Raptor library is directing the + * parsing and when one of the callback handlers such as as set by + * raptor_parser_set_statement_handler() requires to return to the main + * application code. + **/ +void +raptor_parser_parse_abort(raptor_parser *rdf_parser) +{ + rdf_parser->failed = 1; +} + + +/** + * raptor_parser_get_locator: + * @rdf_parser: raptor parser + * + * Get the current raptor locator object. + * + * Return value: raptor locator + **/ +raptor_locator* +raptor_parser_get_locator(raptor_parser *rdf_parser) +{ + if(rdf_parser->factory->get_locator) + return rdf_parser->factory->get_locator(rdf_parser); + else + return &rdf_parser->locator; +} + + +#ifdef RAPTOR_DEBUG +void +raptor_stats_print(raptor_parser *rdf_parser, FILE *stream) +{ +#ifdef RAPTOR_PARSER_RDFXML +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + if(!strcmp(rdf_parser->factory->desc.names[0], "rdfxml")) { + raptor_rdfxml_parser *rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + fputs("raptor parser stats\n ", stream); + raptor_rdfxml_parser_stats_print(rdf_xml_parser, stream); + } +#endif +#endif +} +#endif + + +struct syntax_score +{ + int score; + raptor_parser_factory* factory; +}; + + +static int +compare_syntax_score(const void *a, const void *b) { + return ((struct syntax_score*)b)->score - ((struct syntax_score*)a)->score; +} + +#define RAPTOR_MIN_GUESS_SCORE 2 + +/** + * raptor_world_guess_parser_name: + * @world: world object + * @uri: URI identifying the syntax (or NULL) + * @mime_type: mime type identifying the content (or NULL) + * @buffer: buffer of content to guess (or NULL) + * @len: length of buffer + * @identifier: identifier of content (or NULL) + * + * Guess a parser name for content. + * + * Find a parser by scoring recognition of the syntax by a block of + * characters, the content identifier or a mime type. The content + * identifier is typically a filename or URI or some other identifier. + * + * If the guessing finds only low scores, NULL will be returned. + * + * Return value: a parser name or NULL if no guess could be made + **/ +const char* +raptor_world_guess_parser_name(raptor_world* world, + raptor_uri *uri, const char *mime_type, + const unsigned char *buffer, size_t len, + const unsigned char *identifier) +{ + unsigned int i; + raptor_parser_factory *factory; + unsigned char *suffix = NULL; + struct syntax_score* scores; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL); + + raptor_world_open(world); + + scores = RAPTOR_CALLOC(struct syntax_score*, + raptor_sequence_size(world->parsers), + sizeof(struct syntax_score)); + if(!scores) + return NULL; + + if(identifier) { + unsigned char *p = (unsigned char*)strrchr((const char*)identifier, '.'); + if(p) { + unsigned char *from, *to; + + p++; + suffix = RAPTOR_MALLOC(unsigned char*, strlen((const char*)p) + 1); + if(!suffix) { + RAPTOR_FREE(syntax_scores, scores); + return NULL; + } + + for(from = p, to = suffix; *from; ) { + unsigned char c = *from++; + /* discard the suffix if it wasn't '\.[a-zA-Z0-9]+$' */ + if(!isalpha(c) && !isdigit(c)) { + RAPTOR_FREE(char*, suffix); + suffix = NULL; + to = NULL; + break; + } + *to++ = isupper(c) ? (unsigned char)tolower(c): c; + } + if(to) + *to = '\0'; + } + } + + for(i = 0; + (factory = (raptor_parser_factory*)raptor_sequence_get_at(world->parsers, i)); + i++) { + int score = -1; + const raptor_type_q* type_q = NULL; + + if(mime_type && factory->desc.mime_types) { + int j; + type_q = NULL; + for(j = 0; + (type_q = &factory->desc.mime_types[j]) && type_q->mime_type; + j++) { + if(!strcmp(mime_type, type_q->mime_type)) + break; + } + /* got an exact match mime type - score it via the Q */ + if(type_q) + score = type_q->q; + } + /* mime type match has high Q - return factory as result */ + if(score >= 10) + break; + + if(uri && factory->desc.uri_strings) { + int j; + const char* uri_string = (const char*)raptor_uri_as_string(uri); + const char* factory_uri_string = NULL; + + for(j = 0; + (factory_uri_string = factory->desc.uri_strings[j]); + j++) { + if(!strcmp(uri_string, factory_uri_string)) + break; + } + if(factory_uri_string) + /* got an exact match syntax for URI - return factory as result */ + break; + } + + if(factory->recognise_syntax) { + int c = -1; + + /* Only use first N bytes to avoid HTML documents that contain + * RDF/XML examples + */ +#define FIRSTN 1024 +#if FIRSTN > RAPTOR_READ_BUFFER_SIZE +#error "RAPTOR_READ_BUFFER_SIZE is not large enough" +#endif + if(buffer && len && len > FIRSTN) { + c = buffer[FIRSTN]; + ((char*)buffer)[FIRSTN] = '\0'; + } + + score += factory->recognise_syntax(factory, buffer, len, + identifier, suffix, + mime_type); + + if(c >= 0) + ((char*)buffer)[FIRSTN] = RAPTOR_GOOD_CAST(char, c); + } + + scores[i].score = score < 10 ? score : 10; + scores[i].factory = factory; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + RAPTOR_DEBUG3("Score %15s : %d\n", factory->desc.names[0], score); +#endif + } + + if(!factory) { + /* sort the scores and pick a factory if score is good enough */ + qsort(scores, i, sizeof(struct syntax_score), compare_syntax_score); + + if(scores[0].score >= RAPTOR_MIN_GUESS_SCORE) + factory = scores[0].factory; + } + + if(suffix) + RAPTOR_FREE(char*, suffix); + + RAPTOR_FREE(syntax_scores, scores); + + return factory ? factory->desc.names[0] : NULL; +} + + +/* + * raptor_parser_copy_flags_state: + * @to_parser: destination parser + * @from_parser: source parser + * + * Copy status flags between parsers - INTERNAL. + **/ +void +raptor_parser_copy_flags_state(raptor_parser *to_parser, + raptor_parser *from_parser) +{ + to_parser->failed = from_parser->failed; + to_parser->emit_graph_marks = from_parser->emit_graph_marks; + to_parser->emitted_default_graph = from_parser->emitted_default_graph; +} + + + +/* + * raptor_parser_copy_user_state: + * @to_parser: destination parser + * @from_parser: source parser + * + * Copy user state between parsers - INTERNAL. + * + * Return value: non-0 on failure + **/ +int +raptor_parser_copy_user_state(raptor_parser *to_parser, + raptor_parser *from_parser) +{ + int rc = 0; + + to_parser->user_data = from_parser->user_data; + to_parser->statement_handler = from_parser->statement_handler; + to_parser->namespace_handler = from_parser->namespace_handler; + to_parser->namespace_handler_user_data = from_parser->namespace_handler_user_data; + to_parser->uri_filter = from_parser->uri_filter; + to_parser->uri_filter_user_data = from_parser->uri_filter_user_data; + + /* copy bit flags */ + raptor_parser_copy_flags_state(to_parser, from_parser); + + /* copy options */ + if(!rc) + rc = raptor_object_options_copy_state(&to_parser->options, + &from_parser->options); + + return rc; +} + + +/* + * raptor_parser_start_namespace: + * @rdf_parser: parser + * @nspace: namespace starting + * + * Internal - Invoke start namespace handler + **/ +void +raptor_parser_start_namespace(raptor_parser* rdf_parser, + raptor_namespace* nspace) +{ + if(!rdf_parser->namespace_handler) + return; + + (*rdf_parser->namespace_handler)(rdf_parser->namespace_handler_user_data, + nspace); +} + + +/** + * raptor_parser_get_accept_header: + * @rdf_parser: parser + * + * Get an HTTP Accept value for the parser. + * + * The returned string must be freed by the caller such as with + * raptor_free_memory(). + * + * Return value: a new Accept: header string or NULL on failure + **/ +const char* +raptor_parser_get_accept_header(raptor_parser* rdf_parser) +{ + raptor_parser_factory *factory = rdf_parser->factory; + char *accept_header = NULL; + size_t len; + char *p; + int i; + const raptor_type_q* type_q; + + if(factory->accept_header) + return factory->accept_header(rdf_parser); + + if(!factory->desc.mime_types) + return NULL; + + len = 0; + for(i = 0; + (type_q = &factory->desc.mime_types[i]) && type_q->mime_type; + i++) { + len += type_q->mime_type_len + 2; /* ", " */ + if(type_q->q < 10) + len += 6; /* ";q=X.Y" */ + } + + /* 9 = strlen("\*\/\*;q=0.1") */ +#define ACCEPT_HEADER_LEN 9 + accept_header = RAPTOR_MALLOC(char*, len + ACCEPT_HEADER_LEN + 1); + if(!accept_header) + return NULL; + + p = accept_header; + for(i = 0; + (type_q = &factory->desc.mime_types[i]) && type_q->mime_type; + i++) { + memcpy(p, type_q->mime_type, type_q->mime_type_len); + p += type_q->mime_type_len; + if(type_q->q < 10) { + *p++ = ';'; + *p++ = 'q'; + *p++ = '='; + *p++ = '0'; + *p++ = '.'; + *p++ = RAPTOR_GOOD_CAST(char, '0' + (type_q->q)); + } + + *p++ = ','; + *p++ = ' '; + } + + memcpy(p, "*/*;q=0.1", ACCEPT_HEADER_LEN + 1); + + return accept_header; +} + + +const char* +raptor_parser_get_accept_header_all(raptor_world* world) +{ + raptor_parser_factory *factory; + char *accept_header = NULL; + size_t len; + char *p; + int i; + + len = 0; + for(i = 0; + (factory = (raptor_parser_factory*)raptor_sequence_get_at(world->parsers, i)); + i++) { + const raptor_type_q* type_q; + int j; + + for(j = 0; + (type_q = &factory->desc.mime_types[j]) && type_q->mime_type; + j++) { + len += type_q->mime_type_len + 2; /* ", " */ + if(type_q->q < 10) + len += 6; /* ";q=X.Y" */ + } + } + + /* 9 = strlen("\*\/\*;q=0.1") */ +#define ACCEPT_HEADER_LEN 9 + accept_header = RAPTOR_MALLOC(char*, len + ACCEPT_HEADER_LEN + 1); + if(!accept_header) + return NULL; + + p = accept_header; + for(i = 0; + (factory = (raptor_parser_factory*)raptor_sequence_get_at(world->parsers, i)); + i++) { + const raptor_type_q* type_q; + int j; + + for(j = 0; + (type_q = &factory->desc.mime_types[j]) && type_q->mime_type; + j++) { + memcpy(p, type_q->mime_type, type_q->mime_type_len); + p+= type_q->mime_type_len; + if(type_q->q < 10) { + *p++ = ';'; + *p++ = 'q'; + *p++ = '='; + *p++ = '0'; + *p++ = '.'; + *p++ = RAPTOR_GOOD_CAST(char, '0' + (type_q->q)); + } + + *p++ = ','; + *p++ = ' '; + } + + } + + memcpy(p, "*/*;q=0.1", ACCEPT_HEADER_LEN + 1); + + return accept_header; +} + + +void +raptor_parser_save_content(raptor_parser* rdf_parser, int save) +{ + if(rdf_parser->sb) + raptor_free_stringbuffer(rdf_parser->sb); + + rdf_parser->sb= save ? raptor_new_stringbuffer() : NULL; +} + + +const unsigned char* +raptor_parser_get_content(raptor_parser* rdf_parser, size_t* length_p) +{ + unsigned char* buffer; + size_t len; + + if(!rdf_parser->sb) + return NULL; + + len = raptor_stringbuffer_length(rdf_parser->sb); + buffer = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!buffer) + return NULL; + + raptor_stringbuffer_copy_to_string(rdf_parser->sb, buffer, len); + + if(length_p) + *length_p=len; + + return buffer; +} + + +void +raptor_parser_start_graph(raptor_parser* parser, raptor_uri* uri, + int is_declared) +{ + int flags = RAPTOR_GRAPH_MARK_START; + if(is_declared) + flags |= RAPTOR_GRAPH_MARK_DECLARED; + + if(!parser->emit_graph_marks) + return; + + if(parser->graph_mark_handler) + (*parser->graph_mark_handler)(parser->user_data, uri, flags); +} + + +void +raptor_parser_end_graph(raptor_parser* parser, raptor_uri* uri, int is_declared) +{ + int flags = 0; + if(is_declared) + flags |= RAPTOR_GRAPH_MARK_DECLARED; + + if(!parser->emit_graph_marks) + return; + + if(parser->graph_mark_handler) + (*parser->graph_mark_handler)(parser->user_data, uri, flags); +} + + +/** + * raptor_parser_get_world: + * @rdf_parser: parser + * + * Get the #raptor_world object associated with a parser. + * + * Return value: raptor_world* pointer + **/ +raptor_world * +raptor_parser_get_world(raptor_parser* rdf_parser) +{ + return rdf_parser->world; +} + + +/** + * raptor_parser_get_graph: + * @rdf_parser: parser + * + * Get the current graph for the parser + * + * The returned URI is owned by the caller and must be freed with + * raptor_free_uri() + * + * Return value: raptor_uri* graph name or NULL for the default graph + **/ +raptor_uri* +raptor_parser_get_graph(raptor_parser* rdf_parser) +{ + if(rdf_parser->factory->get_graph) + return rdf_parser->factory->get_graph(rdf_parser); + return NULL; +} + + +/** + * raptor_parser_parse_iostream: + * @rdf_parser: parser + * @iostr: iostream to read from + * @base_uri: the base URI to use (or NULL) + * + * Parse content from an iostream + * + * If the parser requires a base URI and @base_uri is NULL, an error + * will be generated and the function will fail. + * + * Return value: non 0 on failure, <0 if a required base URI was missing + **/ +int +raptor_parser_parse_iostream(raptor_parser* rdf_parser, raptor_iostream *iostr, + raptor_uri *base_uri) +{ + int rc = 0; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(rdf_parser, raptor_parser, 1); + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(iostr, raptor_iostr, 1); + + rc = raptor_parser_parse_start(rdf_parser, base_uri); + if(rc) + return rc; + + while(!raptor_iostream_read_eof(iostr)) { + int ilen; + size_t len; + int is_end; + + ilen = raptor_iostream_read_bytes(rdf_parser->buffer, 1, + RAPTOR_READ_BUFFER_SIZE, iostr); + if(ilen < 0) + break; + len = RAPTOR_GOOD_CAST(size_t, ilen); + is_end = (len < RAPTOR_READ_BUFFER_SIZE); + + rc = raptor_parser_parse_chunk(rdf_parser, rdf_parser->buffer, len, is_end); + if(rc || is_end) + break; + } + + return rc; +} + + +/* end not STANDALONE */ +#endif + + +#ifdef STANDALONE +#include + +int main(int argc, char *argv[]); + + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *program = raptor_basename(argv[0]); + int i; + const char *s; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Known options:\n", program); +#endif + + for(i = 0; i <= (int)raptor_option_get_count(); i++) { + raptor_option_description *od; + int fn; + + od = raptor_world_get_option_description(world, + RAPTOR_DOMAIN_PARSER, + (raptor_option)i); + if(!od) + continue; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, " %2d %-20s %s <%s>\n", i, od->name, od->label, + (od->uri ? (const char*)raptor_uri_as_string(od->uri) : "")); +#endif + fn = raptor_world_get_option_from_uri(world, od->uri); + if(fn != i) { + fprintf(stderr, + "%s: raptor_option_from_uri() returned %d expected %d\n", + program, fn, i); + return 1; + } + raptor_free_option_description(od); + } + + s = raptor_parser_get_accept_header_all(world); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "Default HTTP accept header: '%s'\n", s); +#endif + if(!s) { + fprintf(stderr, "%s: raptor_parser_get_accept_header_all() failed\n", + program); + return 1; + } + RAPTOR_FREE(char*, s); + + raptor_free_world(world); + + return 0; +} + +#endif diff --git a/src/raptor_permute_test.c b/src/raptor_permute_test.c new file mode 100644 index 0000000..ad504fb --- /dev/null +++ b/src/raptor_permute_test.c @@ -0,0 +1,342 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_permute.c - Test of permutations of ints in a sequence + * + * Copyright (C) 2011, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#define PERMUTE_DEBUG 0 + + +typedef struct +{ + raptor_sequence* seq; + int* contents; +} intseq; + + +static int +print_handler(void *object, FILE *fh) +{ + int* pi = (int*)object; + fprintf(fh, "%d", *pi); + return 0; +} + + +static intseq* +new_intseq(int size) +{ + intseq* iseq; + int i; + + iseq = RAPTOR_CALLOC(intseq*, 1, sizeof(*iseq)); + iseq->contents = RAPTOR_CALLOC(int*, size, sizeof(int)); + /* will be a sequence of int* pointing into iseq->contents */ + iseq->seq = raptor_new_sequence(NULL, print_handler); + + for(i = 0; i < (int)size; i++) { + iseq->contents[i] = i + 1; + raptor_sequence_set_at(iseq->seq, i, &iseq->contents[i]); + } + + return iseq; +} + +static void +free_intseq(intseq* iseq) +{ + if(iseq->contents) + RAPTOR_FREE(int*, iseq->contents); + + if(iseq->seq) + raptor_free_sequence(iseq->seq); + + RAPTOR_FREE(intseq*, iseq); +} + +static void +intseq_print(intseq *iseq, FILE* stream) +{ + raptor_sequence_print(iseq->seq, stream); +} + +static int +intseq_reverse(intseq *iseq, int start_index, int length) +{ + return raptor_sequence_reverse(iseq->seq, start_index, length); +} + +static int +intseq_compare_at(const void* a, const void* b) +{ + int* ia = (int*)a; + int* ib = (int*)b; + return *ia - *ib; +} + +static int +intseq_next_permutation(intseq *iseq) +{ + return raptor_sequence_next_permutation(iseq->seq, intseq_compare_at); +} + +static int +intseq_get_at(intseq *iseq, int idx) +{ + return *(int*)(raptor_sequence_get_at(iseq->seq, idx)); +} + +#define MAX_SIZE 5 + +int expected_results_size5[120][5] = { + {1, 2, 3, 4, 5}, + {1, 2, 3, 5, 4}, + {1, 2, 4, 3, 5}, + {1, 2, 4, 5, 3}, + {1, 2, 5, 3, 4}, + {1, 2, 5, 4, 3}, + {1, 3, 2, 4, 5}, + {1, 3, 2, 5, 4}, + {1, 3, 4, 2, 5}, + {1, 3, 4, 5, 2}, + {1, 3, 5, 2, 4}, + {1, 3, 5, 4, 2}, + {1, 4, 2, 3, 5}, + {1, 4, 2, 5, 3}, + {1, 4, 3, 2, 5}, + {1, 4, 3, 5, 2}, + {1, 4, 5, 2, 3}, + {1, 4, 5, 3, 2}, + {1, 5, 2, 3, 4}, + {1, 5, 2, 4, 3}, + {1, 5, 3, 2, 4}, + {1, 5, 3, 4, 2}, + {1, 5, 4, 2, 3}, + {1, 5, 4, 3, 2}, + {2, 1, 3, 4, 5}, + {2, 1, 3, 5, 4}, + {2, 1, 4, 3, 5}, + {2, 1, 4, 5, 3}, + {2, 1, 5, 3, 4}, + {2, 1, 5, 4, 3}, + {2, 3, 1, 4, 5}, + {2, 3, 1, 5, 4}, + {2, 3, 4, 1, 5}, + {2, 3, 4, 5, 1}, + {2, 3, 5, 1, 4}, + {2, 3, 5, 4, 1}, + {2, 4, 1, 3, 5}, + {2, 4, 1, 5, 3}, + {2, 4, 3, 1, 5}, + {2, 4, 3, 5, 1}, + {2, 4, 5, 1, 3}, + {2, 4, 5, 3, 1}, + {2, 5, 1, 3, 4}, + {2, 5, 1, 4, 3}, + {2, 5, 3, 1, 4}, + {2, 5, 3, 4, 1}, + {2, 5, 4, 1, 3}, + {2, 5, 4, 3, 1}, + {3, 1, 2, 4, 5}, + {3, 1, 2, 5, 4}, + {3, 1, 4, 2, 5}, + {3, 1, 4, 5, 2}, + {3, 1, 5, 2, 4}, + {3, 1, 5, 4, 2}, + {3, 2, 1, 4, 5}, + {3, 2, 1, 5, 4}, + {3, 2, 4, 1, 5}, + {3, 2, 4, 5, 1}, + {3, 2, 5, 1, 4}, + {3, 2, 5, 4, 1}, + {3, 4, 1, 2, 5}, + {3, 4, 1, 5, 2}, + {3, 4, 2, 1, 5}, + {3, 4, 2, 5, 1}, + {3, 4, 5, 1, 2}, + {3, 4, 5, 2, 1}, + {3, 5, 1, 2, 4}, + {3, 5, 1, 4, 2}, + {3, 5, 2, 1, 4}, + {3, 5, 2, 4, 1}, + {3, 5, 4, 1, 2}, + {3, 5, 4, 2, 1}, + {4, 1, 2, 3, 5}, + {4, 1, 2, 5, 3}, + {4, 1, 3, 2, 5}, + {4, 1, 3, 5, 2}, + {4, 1, 5, 2, 3}, + {4, 1, 5, 3, 2}, + {4, 2, 1, 3, 5}, + {4, 2, 1, 5, 3}, + {4, 2, 3, 1, 5}, + {4, 2, 3, 5, 1}, + {4, 2, 5, 1, 3}, + {4, 2, 5, 3, 1}, + {4, 3, 1, 2, 5}, + {4, 3, 1, 5, 2}, + {4, 3, 2, 1, 5}, + {4, 3, 2, 5, 1}, + {4, 3, 5, 1, 2}, + {4, 3, 5, 2, 1}, + {4, 5, 1, 2, 3}, + {4, 5, 1, 3, 2}, + {4, 5, 2, 1, 3}, + {4, 5, 2, 3, 1}, + {4, 5, 3, 1, 2}, + {4, 5, 3, 2, 1}, + {5, 1, 2, 3, 4}, + {5, 1, 2, 4, 3}, + {5, 1, 3, 2, 4}, + {5, 1, 3, 4, 2}, + {5, 1, 4, 2, 3}, + {5, 1, 4, 3, 2}, + {5, 2, 1, 3, 4}, + {5, 2, 1, 4, 3}, + {5, 2, 3, 1, 4}, + {5, 2, 3, 4, 1}, + {5, 2, 4, 1, 3}, + {5, 2, 4, 3, 1}, + {5, 3, 1, 2, 4}, + {5, 3, 1, 4, 2}, + {5, 3, 2, 1, 4}, + {5, 3, 2, 4, 1}, + {5, 3, 4, 1, 2}, + {5, 3, 4, 2, 1}, + {5, 4, 1, 2, 3}, + {5, 4, 1, 3, 2}, + {5, 4, 2, 1, 3}, + {5, 4, 2, 3, 1}, + {5, 4, 3, 1, 2}, + {5, 4, 3, 2, 1} +}; + +int main (int argc, char *argv[]) +{ + const char *program = raptor_basename(argv[0]); + int failures = 0; + raptor_world *world; + int size; + int expected_counts[MAX_SIZE + 1] = { 1, 1, 2, 6, 24, 120 }; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + for(size = 0; size <= MAX_SIZE; size++) { + intseq* iseq; + int count; + + iseq = new_intseq(size); + +#if PERMUTE_DEBUG > 0 + fprintf(stderr, "%s: Permutation test %d. Initial state: ", program, size); + intseq_print(iseq, stderr); + fputc('\n', stderr); +#endif + + for(count = 1; 1; count++) { +#if PERMUTE_DEBUG > 1 + fprintf(stderr, "Permutation %3d: ", count); + intseq_print(iseq, stderr); + fputc('\n', stderr); +#endif + if(size == 5) { + int* expected_result = expected_results_size5[count - 1]; + int j; + int ok = 1; + + for(j = 0; j < size; j++) { + int actual = intseq_get_at(iseq, j); + int expected = expected_result[j]; + if(actual != expected) { + ok = 0; + break; + } + } + if(!ok) { + fprintf(stderr, "%s: FAILED test %d result %d - returned ", + program, size, count); + intseq_print(iseq, stderr); + fputs(" expected [", stderr); + for(j = 0; j < size; j++) { + fprintf(stderr, "%d, ", expected_result[j]); + } + fputs("]\n", stderr); + + failures++; + } + } + + if(intseq_next_permutation(iseq)) + break; + } + +#if PERMUTE_DEBUG > 0 + fprintf(stderr, "%s: Returned %d results. Final state: ", program, count); + intseq_print(iseq, stderr); + fputc('\n', stderr); +#endif + + free_intseq(iseq); + + if(count != expected_counts[size]) { + fprintf(stderr, "%s: FAILED test %d - returned %d items expected %d\n", + program, size, count, expected_counts[size]); + failures++; + break; + } + } + + + /* This is mainly a test for crashes */ + for(size = 0; size <= MAX_SIZE; size++) { + intseq* iseq; + int st; + + iseq = new_intseq(size); + + for(st = 0; st < size + 1; st++) { + intseq_reverse(iseq, 0, st) ; + intseq_reverse(iseq, st, st) ; + intseq_reverse(iseq, st, 0) ; + } + + free_intseq(iseq); + + } + + raptor_free_world(world); + + return failures; +} diff --git a/src/raptor_qname.c b/src/raptor_qname.c new file mode 100644 index 0000000..3995f8f --- /dev/null +++ b/src/raptor_qname.c @@ -0,0 +1,695 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_qname.c - Raptor XML qname class + * + * Copyright (C) 2002-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2002-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * Namespaces in XML + * http://www.w3.org/TR/1999/REC-xml-names-19990114/#defaulting + * says: + * + * -------------------------------------------------------------------- + * 5.2 Namespace Defaulting + * + * A default namespace is considered to apply to the element where it + * is declared (if that element has no namespace prefix), and to all + * elements with no prefix within the content of that element. + * + * If the URI reference in a default namespace declaration is empty, + * then unprefixed elements in the scope of the declaration are not + * considered to be in any namespace. + * + * Note that default namespaces do not apply directly to attributes. + * + * [...] + * + * 5.3 Uniqueness of Attributes + * + * In XML documents conforming to this specification, no tag may + * contain two attributes which: + * + * 1. have identical names, or + * + * 2. have qualified names with the same local part and with + * prefixes which have been bound to namespace names that are + * identical. + * -------------------------------------------------------------------- + */ + +/** + * raptor_new_qname: + * @nstack: namespace stack to look up for namespaces + * @name: element or attribute name + * @value: attribute value (else is an element) + * + * Constructor - create a new XML qname. + * + * Create a new qname from the local element/attribute name, + * with optional (attribute) value. The namespace stack is used + * to look up the name and find the namespace and generate the + * URI of the qname. + * + * Return value: a new #raptor_qname object or NULL on failure + **/ +raptor_qname* +raptor_new_qname(raptor_namespace_stack *nstack, + const unsigned char *name, + const unsigned char *value) +{ + raptor_qname* qname; + const unsigned char *p; + raptor_namespace* ns; + unsigned char* new_name; + unsigned int prefix_length; + unsigned int local_name_length = 0; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("name %s\n", name); +#endif + + qname = RAPTOR_CALLOC(raptor_qname*, 1, sizeof(*qname)); + if(!qname) + return NULL; + qname->world = nstack->world; + + if(value) { + size_t value_length = strlen((char*)value); + unsigned char* new_value; + + new_value = RAPTOR_MALLOC(unsigned char*, value_length + 1); + if(!new_value) { + RAPTOR_FREE(raptor_qname, qname); + return NULL; + } + + memcpy(new_value, value, value_length + 1); /* copy NUL */ + qname->value = new_value; + qname->value_length = value_length; + } + + + /* Find : */ + for(p = name; *p && *p != ':'; p++) + ; + + + if(!*p) { + local_name_length = (unsigned int)(p - name); + + /* No : in the name */ + new_name = RAPTOR_MALLOC(unsigned char*, local_name_length + 1); + if(!new_name) { + raptor_free_qname(qname); + return NULL; + } + memcpy(new_name, name, local_name_length); /* no NUL to copy */ + new_name[local_name_length] = '\0'; + qname->local_name = new_name; + qname->local_name_length = local_name_length; + + /* For elements only, pick up the default namespace if there is one */ + if(!value) { + ns = raptor_namespaces_get_default_namespace(nstack); + + if(ns) { + qname->nspace = ns; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Found default namespace with URI %s\n", ns->uri ? raptor_uri_as_string(ns->uri) : (unsigned char*)"None"); +#endif + } else { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG1("No default namespace defined\n"); +#endif + } + } /* if is_element */ + + } else { + /* There is a namespace prefix */ + + prefix_length = (unsigned int)(p - name); + p++; + + /* p now is at start of local_name */ + local_name_length = (unsigned int)strlen((char*)p); + new_name = RAPTOR_MALLOC(unsigned char*, local_name_length + 1); + if(!new_name) { + raptor_free_qname(qname); + return NULL; + } + memcpy(new_name, p, local_name_length); /* No NUL to copy */ + new_name[local_name_length] = '\0'; + qname->local_name = new_name; + qname->local_name_length = local_name_length; + + /* Find the namespace */ + ns = raptor_namespaces_find_namespace(nstack, name, prefix_length); + + if(!ns) { + /* failed to find namespace - now what? */ + raptor_log_error_formatted(qname->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "The namespace prefix in \"%s\" was not declared.", name); + } else { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("Found namespace prefix %s URI %s\n", ns->prefix, ns->uri ? raptor_uri_as_string(ns->uri) : (unsigned char*)"None"); +#endif + qname->nspace = ns; + } + } + + + + /* If namespace has a URI and a local_name is defined, create the URI + * for this element + */ + if(qname->nspace && local_name_length) { + raptor_uri *uri = raptor_namespace_get_uri(qname->nspace); + if(uri) + uri = raptor_new_uri_from_uri_local_name(qname->world, uri, new_name); + + qname->uri = uri; + } + + + return qname; +} + + +/** + * raptor_new_qname_from_namespace_local_name: + * @world: raptor_world object + * @ns: namespace of qname (or NULL) + * @local_name: element or attribute name + * @value: attribute value (else is an element) + * + * Constructor - create a new XML qname. + * + * Create a new qname from the namespace and local element/attribute name, + * with optional (attribute) value. + * + * Return value: a new #raptor_qname object or NULL on failure + **/ +raptor_qname* +raptor_new_qname_from_namespace_local_name(raptor_world* world, + raptor_namespace *ns, + const unsigned char *local_name, + const unsigned char *value) +{ + raptor_qname* qname; + unsigned char* new_name; + unsigned int local_name_length; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!local_name) + return NULL; + + local_name_length = (unsigned int)strlen((char*)local_name); + + raptor_world_open(world); + + qname = RAPTOR_CALLOC(raptor_qname*, 1, sizeof(*qname)); + if(!qname) + return NULL; + qname->world = world; + + if(value) { + unsigned int value_length = (unsigned int)strlen((char*)value); + unsigned char* new_value; + + new_value = RAPTOR_MALLOC(unsigned char*, value_length + 1); + if(!new_value) { + RAPTOR_FREE(raptor_qname, qname); + return NULL; + } + + memcpy(new_value, value, value_length + 1); /* Copy NUL */ + qname->value = new_value; + qname->value_length = value_length; + } + + new_name = RAPTOR_MALLOC(unsigned char*, local_name_length + 1); + if(!new_name) { + raptor_free_qname(qname); + return NULL; + } + + memcpy(new_name, local_name, local_name_length); /* No NUL to copy */ + new_name[local_name_length] = '\0'; + qname->local_name = new_name; + qname->local_name_length = local_name_length; + + qname->nspace = ns; + + if(qname->nspace) { + qname->uri = raptor_namespace_get_uri(qname->nspace); + if(qname->uri) + qname->uri = raptor_new_uri_from_uri_local_name(qname->world, qname->uri, new_name); + } + + return qname; +} + + +/** + * raptor_qname_copy: + * @qname: existing qname + * + * Copy constructor - copy an existing XML qname. + * + * Return value: a new #raptor_qname object or NULL on failure + **/ +raptor_qname* +raptor_qname_copy(raptor_qname *qname) +{ + raptor_qname* new_qname; + unsigned char* new_name; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(qname, raptor_qname, NULL); + + new_qname = RAPTOR_CALLOC(raptor_qname*, 1, sizeof(*qname)); + if(!new_qname) + return NULL; + new_qname->world = qname->world; + + if(qname->value) { + size_t value_length = qname->value_length; + unsigned char* new_value; + + new_value = RAPTOR_MALLOC(unsigned char*, value_length + 1); + if(!new_value) { + RAPTOR_FREE(raptor_qname, new_qname); + return NULL; + } + + memcpy(new_value, qname->value, value_length + 1); /* Copy NUL */ + new_qname->value = new_value; + new_qname->value_length = value_length; + } + + new_name = RAPTOR_MALLOC(unsigned char*, qname->local_name_length + 1); + if(!new_name) { + raptor_free_qname(new_qname); + return NULL; + } + + memcpy(new_name, qname->local_name, qname->local_name_length + 1); /* Copy NUL */ + new_qname->local_name = new_name; + new_qname->local_name_length = qname->local_name_length; + + new_qname->nspace = qname->nspace; + + new_qname->uri = raptor_namespace_get_uri(new_qname->nspace); + if(new_qname->uri) + new_qname->uri = raptor_new_uri_from_uri_local_name(qname->world, new_qname->uri, new_name); + + return new_qname; +} + + +#ifdef RAPTOR_DEBUG +void +raptor_qname_print(FILE *stream, raptor_qname* name) +{ + if(name->nspace) { + const unsigned char *prefix = raptor_namespace_get_prefix(name->nspace); + if(prefix) + fprintf(stream, "%s:%s", prefix, name->local_name); + else + fprintf(stream, "(default):%s", name->local_name); + } else + fputs((char*)name->local_name, stream); +} +#endif + + +/** + * raptor_free_qname: + * @name: #raptor_qname object + * + * Destructor - destroy a raptor_qname object. + **/ +void +raptor_free_qname(raptor_qname* name) +{ + if(!name) + return; + + if(name->local_name) + RAPTOR_FREE(char*, name->local_name); + + if(name->uri && name->nspace) + raptor_free_uri(name->uri); + + if(name->value) + RAPTOR_FREE(char*, name->value); + RAPTOR_FREE(raptor_qname, name); +} + + +/** + * raptor_qname_equal: + * @name1: first #raptor_qname + * @name2: second #raptor_name + * + * Compare two XML Qnames for equality. + * + * Return value: non-0 if the qnames are equal. + **/ +int +raptor_qname_equal(raptor_qname *name1, raptor_qname *name2) +{ + if(name1->nspace != name2->nspace) + return 0; + if(name1->local_name_length != name2->local_name_length) + return 0; + if(strcmp((char*)name1->local_name, (char*)name2->local_name)) + return 0; + return 1; +} + + + +/** + * raptor_qname_string_to_uri: + * @nstack: #raptor_namespace_stack to decode the namespace + * @name: QName string or NULL + * @name_len: QName string length + * + * Get the URI for a qname. + * + * Utility function to turn a string representing a QName in the + * N3 style, into a new URI representing it. A NULL name or name ":" + * returns the default namespace URI. A name "p:" returns + * namespace name (URI) for the namespace with prefix "p". + * + * Partially equivalent to + * qname = raptor_new_qname(nstack, name, NULL); + * uri = raptor_uri_copy(qname->uri); + * raptor_free_qname(qname) + * but without making the qname, and it also handles the NULL and + * ":" name cases as well as error checking. + * + * Return value: new #raptor_uri object or NULL on failure + **/ +raptor_uri* +raptor_qname_string_to_uri(raptor_namespace_stack *nstack, + const unsigned char *name, size_t name_len) +{ + raptor_uri *uri = NULL; + const unsigned char *p; + const unsigned char *original_name = name; + const unsigned char *local_name = NULL; + unsigned int local_name_length = 0; + raptor_namespace* ns; + + /* Empty string is default namespace URI */ + if(!name) { + ns = raptor_namespaces_get_default_namespace(nstack); + } else { + /* If starts with :, it is relative to default namespace, so skip it */ + if(*name == ':') { + name++; + name_len--; + p = name + name_len; + } else { + for(p = name; *p && *p != ':'; p++) + ; + } + + /* If ends with :, it is the URI of a namespace */ + if(RAPTOR_GOOD_CAST(size_t, p-name) == (name_len - 1)) { + ns = raptor_namespaces_find_namespace(nstack, name, + RAPTOR_BAD_CAST(int, (name_len - 1))); + } else { + if(!*p) { + local_name = name; + local_name_length = (unsigned int)(p - name); + + /* pick up the default namespace if there is one */ + ns = raptor_namespaces_get_default_namespace(nstack); + } else { + /* There is a namespace prefix */ + unsigned int prefix_length = (unsigned int)(p - name); + p++; + + local_name = p; + local_name_length = (unsigned int)strlen((char*)p); + + /* Find the namespace */ + ns = raptor_namespaces_find_namespace(nstack, name, prefix_length); + } + } + } + + if(!ns) { + raptor_log_error_formatted(nstack->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "The namespace prefix in \"%s\" was not declared.", + original_name); + } + + + + /* If namespace has a URI and a local_name is defined, return the URI + * for this name + */ + if(ns && (uri = raptor_namespace_get_uri(ns))) { + if(local_name_length) + uri = raptor_new_uri_from_uri_local_name(nstack->world, uri, local_name); + else + uri = raptor_uri_copy(uri); + } + + return uri; +} + + +/** + * raptor_qname_write: + * @qname: QName to write + * @iostr: raptor iosteram + * + * Write a formatted qname to an iostream + * + * Return value: non-0 on failure + **/ +int +raptor_qname_write(raptor_qname *qname, raptor_iostream* iostr) +{ + if(qname->nspace && qname->nspace->prefix_length > 0) { + raptor_iostream_counted_string_write(qname->nspace->prefix, + qname->nspace->prefix_length, + iostr); + raptor_iostream_write_byte(':', iostr); + } + + raptor_iostream_counted_string_write(qname->local_name, + qname->local_name_length, + iostr); + return 0; +} + + +/** + * raptor_qname_to_counted_name: + * @qname: QName to write + * @length_p: pointer to variable to store length of name (or NULL) + * + * Get the string form of a QName name + * + * Return value: new string name or NULL on failure + **/ +unsigned char* +raptor_qname_to_counted_name(raptor_qname *qname, size_t* length_p) +{ + size_t len = qname->local_name_length; + unsigned char* s; + unsigned char *p; + + if(qname->nspace && qname->nspace->prefix_length > 0) + len+= 1 + qname->nspace->prefix_length; + + if(length_p) + *length_p=len; + + s = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!s) + return NULL; + + p = s; + if(qname->nspace && qname->nspace->prefix_length > 0) { + memcpy(p, qname->nspace->prefix, qname->nspace->prefix_length); /* Do not copy NUL */ + p += qname->nspace->prefix_length; + *p++ = ':'; + } + + memcpy(p, qname->local_name, qname->local_name_length + 1); /* Copy final NUL */ + + return s; +} + + +/** + * raptor_qname_get_namespace: + * @name: #raptor_qname object + * + * Get the #raptor_namespace of an XML QName. + * + * Return value: the namespace + **/ +const raptor_namespace* +raptor_qname_get_namespace(raptor_qname* name) +{ + return name->nspace; +} + + +/** + * raptor_qname_get_local_name: + * @name: #raptor_qname object + * + * Get the #raptor_local_name of an XML QName. + * + * Return value: the local_name + **/ +const unsigned char* +raptor_qname_get_local_name(raptor_qname* name) +{ + return name->local_name; +} + + +/** + * raptor_qname_get_value: + * @name: #raptor_qname object + * + * Get the #raptor_value of an XML QName. + * + * Return value: the value + **/ +const unsigned char* +raptor_qname_get_value(raptor_qname* name) +{ + return name->value; +} + +/** + * raptor_qname_get_counted_value: + * @name: #raptor_qname object + * @length_p: pointer to variable to store length of name (or NULL) + * + * Get the #raptor_value of an XML QName. + * + * Return value: the value + **/ +const unsigned char* +raptor_qname_get_counted_value(raptor_qname* name, size_t* length_p) +{ + if(length_p) + *length_p=name->value_length; + return name->value; +} + + +/** + * raptor_qname_format_as_xml: + * @qname: qname object + * @length_p: pointer to length (or NULL) + * + * Format a qname in an XML style into a newly allocated string. + * + * Generates a string of the form a:b="value" or a="value" + * depending on the qname's prefix. Double quotes are always used. + * + * If @length_p is not NULL, the length of the string is + * stored in the address it points to. + * + * Return value: qname formatted as newly allocated string or NULL on failure + **/ +unsigned char* +raptor_qname_format_as_xml(const raptor_qname *qname, size_t *length_p) +{ + size_t length; + unsigned char *buffer; + const char quote='"'; + unsigned char *p; + + length = qname->local_name_length + 3 /* ="" */; + if(qname->value_length) + length += raptor_xml_escape_string(qname->world, + qname->value, qname->value_length, + NULL, 0, quote); + + if(qname->nspace && qname->nspace->prefix_length > 0) + length += qname->nspace->prefix_length + 1; /* for : */ + + if(length_p) + *length_p = length; + + buffer = RAPTOR_MALLOC(unsigned char*, length + 1); + if(!buffer) + return NULL; + + p = buffer; + + if(qname->nspace && qname->nspace->prefix_length > 0) { + memcpy(p, qname->nspace->prefix, qname->nspace->prefix_length); + p += qname->nspace->prefix_length; + *p++ = ':'; + } + memcpy(p, qname->local_name, qname->local_name_length); + p += qname->local_name_length; + *p++ = '='; + *p++ = quote; + if(qname->value_length) { + p += raptor_xml_escape_string(qname->world, + qname->value, qname->value_length, + p, length, quote); + } + *p++ = quote; + /* *p used here since we never need to use value of p again [CLANG] */ + *p = '\0'; + + return buffer; +} + + diff --git a/src/raptor_rdfxml.c b/src/raptor_rdfxml.c new file mode 100644 index 0000000..2a742d0 --- /dev/null +++ b/src/raptor_rdfxml.c @@ -0,0 +1,3224 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_rdfxml.c - Raptor RDF/XML Parser + * + * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#ifdef HAVE_STRINGS_H +#include +#endif +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* Define these for far too much output */ +#undef RAPTOR_DEBUG_VERBOSE +#undef RAPTOR_DEBUG_CDATA + + +/* Raptor structures */ + +typedef enum { + /* Catch uninitialised state */ + RAPTOR_STATE_INVALID = 0, + + /* Skipping current tree of elements - used to recover finding + * illegal content, when parsling permissively. + */ + RAPTOR_STATE_SKIPPING, + + /* Not in RDF grammar yet - searching for a start element. + * + * This can be (goto NODE_ELEMENT_LIST) but since it is optional, + * the start element can also be one of + * http://www.w3.org/TR/rdf-syntax-grammar/#nodeElementURIs + * + * If RDF content is assumed, go straight to OBJ + */ + RAPTOR_STATE_UNKNOWN, + + /* A list of node elements + * http://www.w3.org/TR/rdf-syntax-grammar/#nodeElementList + */ + RAPTOR_STATE_NODE_ELEMENT_LIST, + + /* Found an */ + RAPTOR_STATE_DESCRIPTION, + + /* Found a property element + * http://www.w3.org/TR/rdf-syntax-grammar/#propertyElt + */ + RAPTOR_STATE_PROPERTYELT, + + /* A property element that is an ordinal - rdf:li, rdf:_n + */ + RAPTOR_STATE_MEMBER_PROPERTYELT, + + /* Found a node element + * http://www.w3.org/TR/rdf-syntax-grammar/#nodeElement + */ + RAPTOR_STATE_NODE_ELEMENT, + + /* A property element with rdf:parseType="Literal" + * http://www.w3.org/TR/rdf-syntax-grammar/#parseTypeLiteralPropertyElt + */ + RAPTOR_STATE_PARSETYPE_LITERAL, + + /* A property element with rdf:parseType="Resource" + * http://www.w3.org/TR/rdf-syntax-grammar/#parseTypeResourcePropertyElt + */ + RAPTOR_STATE_PARSETYPE_RESOURCE, + + /* A property element with rdf:parseType="Collection" + * http://www.w3.org/TR/rdf-syntax-grammar/#parseTypeCollectionPropertyElt + * + * (This also handles daml:Collection) + */ + RAPTOR_STATE_PARSETYPE_COLLECTION, + + /* A property element with a rdf:parseType attribute and a value + * not "Literal" or "Resource" + * http://www.w3.org/TR/rdf-syntax-grammar/#parseTypeOtherPropertyElt + */ + RAPTOR_STATE_PARSETYPE_OTHER, + + RAPTOR_STATE_PARSETYPE_LAST = RAPTOR_STATE_PARSETYPE_OTHER + + +} raptor_state; + + +static const char* const raptor_state_names[RAPTOR_STATE_PARSETYPE_LAST+2] = { + "INVALID", + "SKIPPING", + "UNKNOWN", + "nodeElementList", + "propertyElt", + "Description", + "propertyElt", + "memberPropertyElt", + "nodeElement", + "parseTypeLiteral", + "parseTypeResource", + "parseTypeCollection", + "parseTypeOther" +}; + + +static const char * raptor_rdfxml_state_as_string(raptor_state state) +{ + if(state < 1 || state > RAPTOR_STATE_PARSETYPE_LAST) + state = (raptor_state)0; + return raptor_state_names[(int)state]; +} + + +/* + * raptor_rdfxml_check_propertyElement_name: + * @name: rdf namespace term + * + * Check if an rdf namespace name is allowed to be used as a Node Element. + * + * Return value: < 0 if unknown rdf namespace term, 0 if known and not allowed, > 0 if known and allowed + */ +static int +raptor_rdfxml_check_nodeElement_name(const char *name) +{ + int i; + + if(*name == '_') + return 1; + + for(i = 0; raptor_rdf_ns_terms_info[i].name; i++) + if(!strcmp(raptor_rdf_ns_terms_info[i].name, name)) + return raptor_rdf_ns_terms_info[i].allowed_as_nodeElement; + + return -1; +} + + +/* + * raptor_rdfxml_check_propertyElement_name: + * @name: rdf namespace term + * + * Check if an rdf namespace name is allowed to be used as a Property Element. + * + * Return value: < 0 if unknown rdf namespace term, 0 if known and not allowed, > 0 if known and allowed + */ +static int +raptor_rdfxml_check_propertyElement_name(const char *name) +{ + int i; + + if(*name == '_') + return 1; + + for(i = 0; raptor_rdf_ns_terms_info[i].name; i++) + if(!strcmp(raptor_rdf_ns_terms_info[i].name, (const char*)name)) + return raptor_rdf_ns_terms_info[i].allowed_as_propertyElement; + + return -1; +} + + +static int +raptor_rdfxml_check_propertyAttribute_name(const char *name) +{ + int i; + + if(*name == '_') + return 1; + + for(i = 0; raptor_rdf_ns_terms_info[i].name; i++) + if(!strcmp(raptor_rdf_ns_terms_info[i].name, (const char*)name)) + return raptor_rdf_ns_terms_info[i].allowed_as_propertyAttribute; + + return -1; +} + + +typedef enum { + /* undetermined yet - whitespace is stored */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_UNKNOWN, + + /* literal content - no elements, cdata allowed, whitespace significant + * blah + */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL, + + /* parseType literal content (WF XML) - all content preserved + * blah + */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL, + + /* top-level nodes - 0+ elements expected, no cdata, whitespace ignored, + * any non-whitespace cdata is error + * only used for or implict + */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_NODES, + + /* properties - 0+ elements expected, no cdata, whitespace ignored, + * any non-whitespace cdata is error + * blah blah + */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES, + + /* property content - all content preserved + * any content type changes when first non-whitespace found + * ... + */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT, + + /* resource URI given - no element, no cdata, whitespace ignored, + * any non-whitespace cdata is error + * + * + */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE, + + /* skipping content - all content is preserved + * Used when skipping content for unknown parseType-s, + * error recovery, some other reason + */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PRESERVED, + + /* parseType Collection - all content preserved + * Parsing of this determined by RDF/XML (Revised) closed collection rules + * ... + */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_COLLECTION, + + /* Like above but handles "daml:collection" */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION, + + /* dummy for use in strings below */ + RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LAST + +} raptor_rdfxml_element_content_type; + + +static const struct { + const char * name; + int whitespace_significant; + /* non-blank cdata */ + int cdata_allowed; + /* XML element content */ + int element_allowed; + /* Do RDF-specific processing? (property attributes, rdf: attributes, ...) */ + int rdf_processing; +} rdf_content_type_info[RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LAST]={ + {"Unknown", 1, 1, 1, 0 }, + {"Literal", 1, 1, 0, 0 }, + {"XML Literal", 1, 1, 1, 0 }, + {"Nodes", 0, 0, 1, 1 }, + {"Properties", 0, 1, 1, 1 }, + {"Property Content",1, 1, 1, 1 }, + {"Resource", 0, 0, 0, 0 }, + {"Preserved", 1, 1, 1, 0 }, + {"Collection", 1, 1, 1, 1 }, + {"DAML Collection", 1, 1, 1, 1 }, +}; + + + +static const char * +raptor_rdfxml_element_content_type_as_string(raptor_rdfxml_element_content_type type) +{ + if(type >= RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LAST) + return "INVALID"; + + return rdf_content_type_info[type].name; +} + + + + + +/* + * Raptor Element/attributes on stack + */ +struct raptor_rdfxml_element_s { + raptor_world* world; + + raptor_xml_element *xml_element; + + /* NULL at bottom of stack */ + struct raptor_rdfxml_element_s *parent; + + /* attributes declared in M&S */ + const unsigned char * rdf_attr[RDF_NS_LAST + 1]; + /* how many of above seen */ + int rdf_attr_count; + + /* state that this production matches */ + raptor_state state; + + /* how to handle the content inside this XML element */ + raptor_rdfxml_element_content_type content_type; + + + /* starting state for children of this element */ + raptor_state child_state; + + /* starting content type for children of this element */ + raptor_rdfxml_element_content_type child_content_type; + + + /* Reified statement identifier */ + raptor_term* reified; + + unsigned const char* reified_id; + + /* Bag identifier */ + raptor_term* bag; + int last_bag_ordinal; /* starts at 0, so first predicate is rdf:_1 */ + + /* Subject identifier (URI/anon ID), type, source + * + * When the XML element represents a node, this is the identifier + */ + raptor_term* subject; + + /* Predicate URI + * + * When the XML element represents a node or predicate, + * this is the identifier of the predicate + */ + raptor_term* predicate; + + /* Object identifier (URI/anon ID), type, source + * + * When this XML element generates a statement that needs an object, + * possibly from a child element, this is the identifier of the object + */ + raptor_term* object; + + /* URI of datatype of literal */ + raptor_uri *object_literal_datatype; + + /* last ordinal used, so initialising to 0 works, emitting rdf:_1 first */ + int last_ordinal; + + /* If this element's parseType is a Collection + * this identifies the anon node of current tail of the collection(list). + */ + const unsigned char *tail_id; + + /* RDF/XML specific checks */ + + /* all cdata so far is whitespace */ + unsigned int content_cdata_all_whitespace; +}; + +typedef struct raptor_rdfxml_element_s raptor_rdfxml_element; + + +#define RAPTOR_RDFXML_N_CONCEPTS 5 + +/* + * Raptor parser object + */ +struct raptor_rdfxml_parser_s { + raptor_sax2 *sax2; + + /* stack of elements - elements add after current_element */ + raptor_rdfxml_element *root_element; + raptor_rdfxml_element *current_element; + + raptor_uri* concepts[RAPTOR_RDFXML_N_CONCEPTS]; + + /* set of seen rdf:ID / rdf:bagID values (with in-scope base URI) */ + raptor_id_set* id_set; + + void *xml_content; + size_t xml_content_length; + raptor_iostream* iostream; + + /* writer for building parseType="Literal" content */ + raptor_xml_writer* xml_writer; +}; + + + + +/* static variables */ + +#define RAPTOR_DAML_NS_URI(rdf_xml_parser) rdf_xml_parser->concepts[0] + +#define RAPTOR_DAML_List_URI(rdf_xml_parser) rdf_xml_parser->concepts[1] +#define RAPTOR_DAML_first_URI(rdf_xml_parser) rdf_xml_parser->concepts[2] +#define RAPTOR_DAML_rest_URI(rdf_xml_parser) rdf_xml_parser->concepts[3] +#define RAPTOR_DAML_nil_URI(rdf_xml_parser) rdf_xml_parser->concepts[4] + +/* RAPTOR_RDFXML_N_CONCEPTS defines size of array */ + + +/* prototypes for element functions */ +static raptor_rdfxml_element* raptor_rdfxml_element_pop(raptor_rdfxml_parser *rdf_parser); +static void raptor_rdfxml_element_push(raptor_rdfxml_parser *rdf_parser, raptor_rdfxml_element* element); + +static int raptor_rdfxml_record_ID(raptor_parser *rdf_parser, raptor_rdfxml_element *element, const unsigned char *id); + +/* prototypes for grammar functions */ +static void raptor_rdfxml_start_element_grammar(raptor_parser *parser, raptor_rdfxml_element *element); +static void raptor_rdfxml_end_element_grammar(raptor_parser *parser, raptor_rdfxml_element *element); +static void raptor_rdfxml_cdata_grammar(raptor_parser *parser, const unsigned char *s, int len, int is_cdata); + + +/* prototype for statement related functions */ +static void raptor_rdfxml_generate_statement(raptor_parser *rdf_parser, raptor_term *subject, raptor_uri *predicate_uri, raptor_term *object, raptor_term *reified, raptor_rdfxml_element *bag_element); + + + +/* Prototypes for parsing data functions */ +static int raptor_rdfxml_parse_init(raptor_parser* rdf_parser, const char *name); +static void raptor_rdfxml_parse_terminate(raptor_parser *rdf_parser); +static int raptor_rdfxml_parse_start(raptor_parser* rdf_parser); +static int raptor_rdfxml_parse_chunk(raptor_parser* rdf_parser, const unsigned char *buffer, size_t len, int is_end); +static void raptor_rdfxml_update_document_locator(raptor_parser *rdf_parser); + +static raptor_uri* raptor_rdfxml_inscope_base_uri(raptor_parser *rdf_parser); + + +static raptor_rdfxml_element* +raptor_rdfxml_element_pop(raptor_rdfxml_parser *rdf_xml_parser) +{ + raptor_rdfxml_element *element = rdf_xml_parser->current_element; + + if(!element) + return NULL; + + rdf_xml_parser->current_element = element->parent; + if(rdf_xml_parser->root_element == element) /* just deleted root */ + rdf_xml_parser->root_element = NULL; + + return element; +} + + +static void +raptor_rdfxml_element_push(raptor_rdfxml_parser *rdf_xml_parser, raptor_rdfxml_element* element) +{ + element->parent = rdf_xml_parser->current_element; + rdf_xml_parser->current_element = element; + if(!rdf_xml_parser->root_element) + rdf_xml_parser->root_element = element; +} + + +static void +raptor_free_rdfxml_element(raptor_rdfxml_element *element) +{ + int i; + + /* Free special RDF M&S attributes */ + for(i = 0; i <= RDF_NS_LAST; i++) + if(element->rdf_attr[i]) + RAPTOR_FREE(char*, element->rdf_attr[i]); + + if(element->subject) + raptor_free_term(element->subject); + if(element->predicate) + raptor_free_term(element->predicate); + if(element->object) + raptor_free_term(element->object); + if(element->bag) + raptor_free_term(element->bag); + if(element->reified) + raptor_free_term(element->reified); + + if(element->tail_id) + RAPTOR_FREE(char*, (char*)element->tail_id); + if(element->object_literal_datatype) + raptor_free_uri(element->object_literal_datatype); + + if(element->reified_id) + RAPTOR_FREE(char*, (char*)element->reified_id); + + RAPTOR_FREE(raptor_rdfxml_element, element); +} + + +static void +raptor_rdfxml_sax2_new_namespace_handler(void *user_data, + raptor_namespace* nspace) +{ + raptor_parser* rdf_parser; + const unsigned char* namespace_name; + size_t namespace_name_len; + raptor_uri* uri = raptor_namespace_get_uri(nspace); + + rdf_parser = (raptor_parser*)user_data; + raptor_parser_start_namespace(rdf_parser, nspace); + + if(!uri) + return; + + namespace_name = raptor_uri_as_counted_string(uri, &namespace_name_len); + + if(namespace_name_len == raptor_rdf_namespace_uri_len-1 && + !strncmp((const char*)namespace_name, + (const char*)raptor_rdf_namespace_uri, + namespace_name_len)) { + const unsigned char *prefix = raptor_namespace_get_prefix(nspace); + raptor_parser_warning(rdf_parser, + "Declaring a namespace with prefix %s to URI %s - one letter short of the RDF namespace URI and probably a mistake.", + prefix, namespace_name); + } + + if(namespace_name_len > raptor_rdf_namespace_uri_len && + !strncmp((const char*)namespace_name, + (const char*)raptor_rdf_namespace_uri, + raptor_rdf_namespace_uri_len)) { + raptor_parser_error(rdf_parser, + "Declaring a namespace URI %s to which the RDF namespace URI is a prefix is forbidden.", + namespace_name); + } +} + + + +static void +raptor_rdfxml_start_element_handler(void *user_data, + raptor_xml_element* xml_element) +{ + raptor_parser* rdf_parser; + raptor_rdfxml_parser* rdf_xml_parser; + raptor_rdfxml_element* element; + int ns_attributes_count = 0; + raptor_qname** named_attrs = NULL; + int i; + int count_bumped = 0; + + rdf_parser = (raptor_parser*)user_data; + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + if(rdf_parser->failed) + return; + + raptor_rdfxml_update_document_locator(rdf_parser); + + /* Create new element structure */ + element = RAPTOR_CALLOC(raptor_rdfxml_element*, 1, sizeof(*element)); + if(!element) { + raptor_parser_fatal_error(rdf_parser, "Out of memory"); + rdf_parser->failed = 1; + return; + } + element->world = rdf_parser->world; + element->xml_element = xml_element; + + raptor_rdfxml_element_push(rdf_xml_parser, element); + + named_attrs = raptor_xml_element_get_attributes(xml_element); + ns_attributes_count = raptor_xml_element_get_attributes_count(xml_element); + + /* RDF-specific processing of attributes */ + if(ns_attributes_count) { + raptor_qname** new_named_attrs; + int offset = 0; + raptor_rdfxml_element* parent_element; + + parent_element = element->parent; + + /* Allocate new array to move namespaced-attributes to if + * rdf processing is performed + */ + new_named_attrs = RAPTOR_CALLOC(raptor_qname**, ns_attributes_count, + sizeof(raptor_qname*)); + if(!new_named_attrs) { + raptor_parser_fatal_error(rdf_parser, "Out of memory"); + rdf_parser->failed = 1; + return; + } + + for(i = 0; i < ns_attributes_count; i++) { + raptor_qname* attr = named_attrs[i]; + + /* If: + * 1 We are handling RDF content and RDF processing is allowed on + * this element + * OR + * 2 We are not handling RDF content and + * this element is at the top level (top level Desc. / typedNode) + * i.e. we have no parent + * then handle the RDF attributes + */ + if((parent_element && + rdf_content_type_info[parent_element->child_content_type].rdf_processing) || + !parent_element) { + + /* Save pointers to some RDF M&S attributes */ + + /* If RDF namespace-prefixed attributes */ + if(attr->nspace && attr->nspace->is_rdf_ms) { + const unsigned char *attr_name = attr->local_name; + int j; + + for(j = 0; j <= RDF_NS_LAST; j++) + if(!strcmp((const char*)attr_name, + raptor_rdf_ns_terms_info[j].name)) { + element->rdf_attr[j] = attr->value; + element->rdf_attr_count++; + /* Delete it if it was stored elsewhere */ +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG3("Found RDF namespace attribute '%s' URI %s\n", + (char*)attr_name, attr->value); +#endif + /* make sure value isn't deleted from qname structure */ + attr->value = NULL; + raptor_free_qname(attr); + attr = NULL; + break; + } + } /* end if RDF namespaced-prefixed attributes */ + + if(!attr) + continue; + + /* If non namespace-prefixed RDF attributes found on an element */ + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES) && + !attr->nspace) { + const unsigned char *attr_name = attr->local_name; + int j; + + for(j = 0; j <= RDF_NS_LAST; j++) + if(!strcmp((const char*)attr_name, + raptor_rdf_ns_terms_info[j].name)) { + element->rdf_attr[j] = attr->value; + element->rdf_attr_count++; + if(!raptor_rdf_ns_terms_info[j].allowed_unprefixed_on_attribute) + raptor_parser_warning(rdf_parser, + "Using rdf attribute '%s' without the RDF namespace has been deprecated.", + attr_name); + + /* Delete it if it was stored elsewhere */ + /* make sure value isn't deleted from qname structure */ + attr->value = NULL; + raptor_free_qname(attr); + attr = NULL; + break; + } + } /* end if non-namespace prefixed RDF attributes */ + + if(!attr) + continue; + + } /* end if leave literal XML alone */ + + if(attr) + new_named_attrs[offset++] = attr; + } + + /* new attribute count is set from attributes that haven't been skipped */ + ns_attributes_count = offset; + if(!ns_attributes_count) { + /* all attributes were deleted so delete the new array */ + RAPTOR_FREE(raptor_qname_array, new_named_attrs); + new_named_attrs = NULL; + } + + RAPTOR_FREE(raptor_qname_array, named_attrs); + named_attrs = new_named_attrs; + raptor_xml_element_set_attributes(xml_element, + named_attrs, ns_attributes_count); + } /* end if ns_attributes_count */ + + + /* start from unknown; if we have a parent, it may set this */ + element->state = RAPTOR_STATE_UNKNOWN; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_UNKNOWN; + + if(element->parent && + element->parent->child_content_type != RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_UNKNOWN) { + element->content_type = element->parent->child_content_type; + + if(element->parent->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE && + element->content_type != RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_COLLECTION && + element->content_type != RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) { + raptor_qname* parent_el_name; + parent_el_name = raptor_xml_element_get_name(element->parent->xml_element); + /* If parent has an rdf:resource, this element should not be here */ + raptor_parser_error(rdf_parser, + "property element '%s' has multiple object node elements, skipping.", + parent_el_name->local_name); + element->state = RAPTOR_STATE_SKIPPING; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PRESERVED; + + } else { + if(!element->parent->child_state) { + raptor_parser_fatal_error(rdf_parser, + "%s: Internal error: no parent element child_state set", + __FUNCTION__); + return; + } + + element->state = element->parent->child_state; + element->parent->xml_element->content_element_seen++; + count_bumped++; + + /* leave literal XML alone */ + if(!rdf_content_type_info[element->content_type].cdata_allowed) { + if(element->parent->xml_element->content_element_seen && + element->parent->xml_element->content_cdata_seen) { + raptor_qname* parent_el_name; + + parent_el_name = raptor_xml_element_get_name(element->parent->xml_element); + /* Uh oh - mixed content, the parent element has cdata too */ + raptor_parser_warning(rdf_parser, "element '%s' has mixed content.", + parent_el_name->local_name); + } + + /* If there is some existing all-whitespace content cdata + * before this node element, delete it + */ + if(element->parent->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES && + element->parent->xml_element->content_element_seen && + element->parent->content_cdata_all_whitespace && + element->parent->xml_element->content_cdata_length) { + + element->parent->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + + raptor_free_stringbuffer(element->parent->xml_element->content_cdata_sb); + element->parent->xml_element->content_cdata_sb = NULL; + element->parent->xml_element->content_cdata_length = 0; + } + + } /* end if leave literal XML alone */ + + } /* end if parent has no rdf:resource */ + + } /* end if element->parent */ + + +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG2("Using content type %s\n", + rdf_content_type_info[element->content_type].name); + + fprintf(stderr, "raptor_rdfxml_start_element_handler: Start ns-element: "); + raptor_print_xml_element(xml_element, stderr); +#endif + + + /* Check for non namespaced stuff when not in a parseType literal, other */ + if(rdf_content_type_info[element->content_type].rdf_processing) { + const raptor_namespace* ns; + + ns = raptor_xml_element_get_name(xml_element)->nspace; + /* The element */ + + /* If has no namespace or the namespace has no name (xmlns="") */ + if((!ns || (ns && !raptor_namespace_get_uri(ns))) && element->parent) { + raptor_qname* parent_el_name; + + parent_el_name = raptor_xml_element_get_name(element->parent->xml_element); + + raptor_parser_error(rdf_parser, + "Using an element '%s' without a namespace is forbidden.", + parent_el_name->local_name); + element->state = RAPTOR_STATE_SKIPPING; + /* Remove count above so that parent thinks this is empty */ + if(count_bumped) + element->parent->xml_element->content_element_seen--; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PRESERVED; + } + + + /* Check for any remaining non-namespaced attributes */ + if(named_attrs) { + for(i = 0; i < ns_attributes_count; i++) { + raptor_qname *attr = named_attrs[i]; + /* Check if any attributes are non-namespaced */ + if(!attr->nspace || + (attr->nspace && !raptor_namespace_get_uri(attr->nspace))) { + raptor_parser_error(rdf_parser, + "Using an attribute '%s' without a namespace is forbidden.", + attr->local_name); + raptor_free_qname(attr); + named_attrs[i] = NULL; + } + } + } + } + + + if(element->rdf_attr[RDF_NS_aboutEach] || + element->rdf_attr[RDF_NS_aboutEachPrefix]) { + raptor_parser_warning(rdf_parser, + "element '%s' has aboutEach / aboutEachPrefix, skipping.", + raptor_xml_element_get_name(xml_element)->local_name); + element->state = RAPTOR_STATE_SKIPPING; + /* Remove count above so that parent thinks this is empty */ + if(count_bumped) + element->parent->xml_element->content_element_seen--; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PRESERVED; + } + + /* Right, now ready to enter the grammar */ + raptor_rdfxml_start_element_grammar(rdf_parser, element); + + return; +} + + +static void +raptor_rdfxml_end_element_handler(void *user_data, + raptor_xml_element* xml_element) +{ + raptor_parser* rdf_parser; + raptor_rdfxml_parser* rdf_xml_parser; + raptor_rdfxml_element* element; + + rdf_parser = (raptor_parser*)user_data; + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + if(!rdf_parser->failed) { + raptor_rdfxml_update_document_locator(rdf_parser); + + raptor_rdfxml_end_element_grammar(rdf_parser, + rdf_xml_parser->current_element); + } + + element = raptor_rdfxml_element_pop(rdf_xml_parser); + if(element) { + if(element->parent) { + /* Do not change this; PROPERTYELT will turn into MEMBER if necessary + * See the switch case for MEMBER / PROPERTYELT where the test is done. + * + * PARSETYPE_RESOURCE should never be propogated up since it + * will turn the next child (node) element into a property + */ + if(element->state != RAPTOR_STATE_MEMBER_PROPERTYELT && + element->state != RAPTOR_STATE_PARSETYPE_RESOURCE) + element->parent->child_state = element->state; + } + + raptor_free_rdfxml_element(element); + } +} + + +/* cdata (and ignorable whitespace for libxml). + * s 0 terminated is for libxml + */ +static void +raptor_rdfxml_characters_handler(void *user_data, + raptor_xml_element* xml_element, + const unsigned char *s, int len) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + + raptor_rdfxml_cdata_grammar(rdf_parser, s, len, 0); +} + + +/* cdata (and ignorable whitespace for libxml). + * s is 0 terminated for libxml2 + */ +static void +raptor_rdfxml_cdata_handler(void *user_data, raptor_xml_element* xml_element, + const unsigned char *s, int len) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + + raptor_rdfxml_cdata_grammar(rdf_parser, s, len, 1); +} + + +/* comment handler + * s is 0 terminated + */ +static void +raptor_rdfxml_comment_handler(void *user_data, raptor_xml_element* xml_element, + const unsigned char *s) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + raptor_rdfxml_parser* rdf_xml_parser; + raptor_rdfxml_element* element; + + if(rdf_parser->failed || !xml_element) + return; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + element = rdf_xml_parser->current_element; + + if(element) { + if(element->child_content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL) + raptor_xml_writer_comment(rdf_xml_parser->xml_writer, s); + } + + +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG2("XML Comment '%s'\n", s); +#endif +} + + +static const unsigned char* const daml_namespace_uri_string = (const unsigned char*)"http://www.daml.org/2001/03/daml+oil#"; +static const int daml_namespace_uri_string_len = 37; + + +static int +raptor_rdfxml_parse_init(raptor_parser* rdf_parser, const char *name) +{ + raptor_rdfxml_parser* rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + raptor_sax2* sax2; + raptor_world* world = rdf_parser->world; + + /* Allocate sax2 object */ + sax2 = raptor_new_sax2(rdf_parser->world, &rdf_parser->locator, rdf_parser); + rdf_xml_parser->sax2 = sax2; + if(!sax2) + return 1; + + /* Initialize sax2 element handlers */ + raptor_sax2_set_start_element_handler(sax2, raptor_rdfxml_start_element_handler); + raptor_sax2_set_end_element_handler(sax2, raptor_rdfxml_end_element_handler); + raptor_sax2_set_characters_handler(sax2, raptor_rdfxml_characters_handler); + raptor_sax2_set_cdata_handler(sax2, raptor_rdfxml_cdata_handler); + raptor_sax2_set_comment_handler(sax2, raptor_rdfxml_comment_handler); + raptor_sax2_set_namespace_handler(sax2, raptor_rdfxml_sax2_new_namespace_handler); + + /* Allocate uris */ + RAPTOR_DAML_NS_URI(rdf_xml_parser) = raptor_new_uri_from_counted_string(world, + daml_namespace_uri_string, + daml_namespace_uri_string_len); + + RAPTOR_DAML_List_URI(rdf_xml_parser) = raptor_new_uri_from_uri_local_name(world, RAPTOR_DAML_NS_URI(rdf_xml_parser), (const unsigned char *)"List"); + RAPTOR_DAML_first_URI(rdf_xml_parser) = raptor_new_uri_from_uri_local_name(world, RAPTOR_DAML_NS_URI(rdf_xml_parser) ,(const unsigned char *)"first"); + RAPTOR_DAML_rest_URI(rdf_xml_parser) = raptor_new_uri_from_uri_local_name(world, RAPTOR_DAML_NS_URI(rdf_xml_parser), (const unsigned char *)"rest"); + RAPTOR_DAML_nil_URI(rdf_xml_parser) = raptor_new_uri_from_uri_local_name(world, RAPTOR_DAML_NS_URI(rdf_xml_parser), (const unsigned char *)"nil"); + + /* Check for uri allocation failures */ + if(!RAPTOR_DAML_NS_URI(rdf_xml_parser) || + !RAPTOR_DAML_List_URI(rdf_xml_parser) || + !RAPTOR_DAML_first_URI(rdf_xml_parser) || + !RAPTOR_DAML_rest_URI(rdf_xml_parser) || + !RAPTOR_DAML_nil_URI(rdf_xml_parser)) + return 1; + + /* Everything succeeded */ + return 0; +} + + +static int +raptor_rdfxml_parse_start(raptor_parser* rdf_parser) +{ + raptor_uri *uri = rdf_parser->base_uri; + raptor_rdfxml_parser* rdf_xml_parser; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + /* base URI required for RDF/XML */ + if(!uri) + return 1; + + /* Optionally normalize language to lowercase + * http://www.w3.org/TR/rdf-concepts/#dfn-language-identifier + */ + raptor_sax2_set_option(rdf_xml_parser->sax2, + RAPTOR_OPTION_NORMALIZE_LANGUAGE, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NORMALIZE_LANGUAGE)); + + /* Optionally forbid internal network and file requests in the XML parser */ + raptor_sax2_set_option(rdf_xml_parser->sax2, + RAPTOR_OPTION_NO_NET, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NO_NET)); + raptor_sax2_set_option(rdf_xml_parser->sax2, + RAPTOR_OPTION_NO_FILE, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NO_FILE)); + raptor_sax2_set_option(rdf_xml_parser->sax2, + RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES)); + if(rdf_parser->uri_filter) + raptor_sax2_set_uri_filter(rdf_xml_parser->sax2, rdf_parser->uri_filter, + rdf_parser->uri_filter_user_data); + + raptor_sax2_parse_start(rdf_xml_parser->sax2, uri); + + /* Delete any existing id_set */ + if(rdf_xml_parser->id_set) { + raptor_free_id_set(rdf_xml_parser->id_set); + rdf_xml_parser->id_set = NULL; + } + + /* Create a new id_set if needed */ + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_CHECK_RDF_ID)) { + rdf_xml_parser->id_set = raptor_new_id_set(rdf_parser->world); + if(!rdf_xml_parser->id_set) + return 1; + } + + return 0; +} + + +static void +raptor_rdfxml_parse_terminate(raptor_parser *rdf_parser) +{ + raptor_rdfxml_parser* rdf_xml_parser; + raptor_rdfxml_element* element; + int i; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + if(rdf_xml_parser->sax2) { + raptor_free_sax2(rdf_xml_parser->sax2); + rdf_xml_parser->sax2 = NULL; + } + + while( (element = raptor_rdfxml_element_pop(rdf_xml_parser)) ) + raptor_free_rdfxml_element(element); + + + for(i = 0; i < RAPTOR_RDFXML_N_CONCEPTS; i++) { + raptor_uri* concept_uri = rdf_xml_parser->concepts[i]; + if(concept_uri) { + raptor_free_uri(concept_uri); + rdf_xml_parser->concepts[i] = NULL; + } + } + + if(rdf_xml_parser->id_set) { + raptor_free_id_set(rdf_xml_parser->id_set); + rdf_xml_parser->id_set = NULL; + } + + if (rdf_xml_parser->xml_writer) { + raptor_free_xml_writer(rdf_xml_parser->xml_writer); + rdf_xml_parser->xml_writer = NULL; + } + + if (rdf_xml_parser->iostream) { + raptor_free_iostream(rdf_xml_parser->iostream); + rdf_xml_parser->iostream = NULL; + } + + if (rdf_xml_parser->xml_content) { + RAPTOR_FREE(char*, rdf_xml_parser->xml_content); + rdf_xml_parser->xml_content = NULL; + rdf_xml_parser->xml_content_length = 0; + } +} + + +static int +raptor_rdfxml_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score = 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "rdf") || + !strcmp((const char*)suffix, "rdfs") || + !strcmp((const char*)suffix, "foaf") || + !strcmp((const char*)suffix, "doap") || + !strcmp((const char*)suffix, "owl") || + !strcmp((const char*)suffix, "daml")) + score = 9; + if(!strcmp((const char*)suffix, "rss")) + score = 3; + } + + if(identifier) { + if(strstr((const char*)identifier, "rss1")) + score += 5; + else if(!suffix && strstr((const char*)identifier, "rss")) + score += 3; + else if(!suffix && strstr((const char*)identifier, "rdf")) + score += 2; + else if(!suffix && strstr((const char*)identifier, "RDF")) + score += 2; + } + + if(mime_type) { + if(strstr((const char*)mime_type, "html")) + score -= 4; + else if(!strcmp((const char*)mime_type, "text/rdf")) + score += 7; + else if(!strcmp((const char*)mime_type, "application/xml")) + score += 5; + } + + if(buffer && len) { + /* Check it's an XML namespace declared and not N3 or Turtle which + * mention the namespace URI but not in this form. + */ +#define HAS_RDF_XMLNS1 (raptor_memstr((const char*)buffer, len, "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#") != NULL) +#define HAS_RDF_XMLNS2 (raptor_memstr((const char*)buffer, len, "xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#") != NULL) +#define HAS_RDF_XMLNS3 (raptor_memstr((const char*)buffer, len, "xmlns=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#") != NULL) +#define HAS_RDF_XMLNS4 (raptor_memstr((const char*)buffer, len, "xmlns='http://www.w3.org/1999/02/22-rdf-syntax-ns#") != NULL) +#define HAS_RDF_ENTITY1 (raptor_memstr((const char*)buffer, len, "!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'") != NULL) +#define HAS_RDF_ENTITY2 (raptor_memstr((const char*)buffer, len, "!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"") != NULL) +#define HAS_RDF_ENTITY3 (raptor_memstr((const char*)buffer, len, "xmlns:rdf=\"&rdf;\"") != NULL) +#define HAS_RDF_ENTITY4 (raptor_memstr((const char*)buffer, len, "xmlns:rdf='&rdf;'") != NULL) +#define HAS_HTML_NS (raptor_memstr((const char*)buffer, len, "http://www.w3.org/1999/xhtml") != NULL) +#define HAS_HTML_ROOT (raptor_memstr((const char*)buffer, len, "context; + if(rdf_parser->failed) + return 1; + + rc = raptor_sax2_parse_chunk(rdf_xml_parser->sax2, buffer, len, is_end); + + if(is_end) { + if(rdf_parser->emitted_default_graph) { + raptor_parser_end_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph--; + } + } + + return rc; +} + + +static void +raptor_rdfxml_generate_statement(raptor_parser *rdf_parser, + raptor_term *subject_term, + raptor_uri *predicate_uri, + raptor_term *object_term, + raptor_term *reified_term, + raptor_rdfxml_element* bag_element) +{ + raptor_statement *statement = &rdf_parser->statement; + raptor_term* predicate_term = NULL; + int free_reified_term = 0; + + if(rdf_parser->failed) + return; + +#ifdef RAPTOR_DEBUG_VERBOSE + if(!subject_term) + RAPTOR_FATAL1("Statement has no subject\n"); + + if(!predicate_uri) + RAPTOR_FATAL1("Statement has no predicate\n"); + + if(!object_term) + RAPTOR_FATAL1("Statement has no object\n"); + +#endif + + predicate_term = raptor_new_term_from_uri(rdf_parser->world, predicate_uri); + if(!predicate_term) + return; + + statement->subject = subject_term; + statement->predicate = predicate_term; + statement->object = object_term; + +#ifdef RAPTOR_DEBUG_VERBOSE + fprintf(stderr, "raptor_rdfxml_generate_statement: Generating statement: "); + raptor_statement_print(statement, stderr); + fputc('\n', stderr); +#endif + + if(!rdf_parser->emitted_default_graph) { + raptor_parser_start_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph++; + } + + if(!rdf_parser->statement_handler) + goto generate_tidy; + + /* Generate the statement; or is it a fact? */ + (*rdf_parser->statement_handler)(rdf_parser->user_data, statement); + + + /* the bagID mess */ + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_BAGID) && + bag_element && bag_element->bag) { + raptor_term* bag = bag_element->bag; + raptor_uri* bag_predicate_uri = NULL; + raptor_term* bag_predicate_term = NULL; + + statement->subject = bag; + + bag_element->last_bag_ordinal++; + + /* new URI object */ + bag_predicate_uri = raptor_new_uri_from_rdf_ordinal(rdf_parser->world, + bag_element->last_bag_ordinal); + if(!bag_predicate_uri) + goto generate_tidy; + + bag_predicate_term = raptor_new_term_from_uri(rdf_parser->world, + bag_predicate_uri); + raptor_free_uri(bag_predicate_uri); + + if(!bag_predicate_term) + goto generate_tidy; + + statement->predicate = bag_predicate_term; + + if(!reified_term || !reified_term->value.blank.string) { + unsigned char *reified_id = NULL; + + /* reified_term is NULL so generate a bag ID */ + reified_id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!reified_id) + goto generate_tidy; + + reified_term = raptor_new_term_from_blank(rdf_parser->world, reified_id); + RAPTOR_FREE(char*, reified_id); + + if(!reified_term) + goto generate_tidy; + free_reified_term = 1; + } + + statement->object = reified_term; + (*rdf_parser->statement_handler)(rdf_parser->user_data, statement); + + if(bag_predicate_term) + raptor_free_term(bag_predicate_term); + } + + + /* return if is there no reified ID (that is valid) */ + if(!reified_term || !reified_term->value.blank.string) + goto generate_tidy; + + + /* otherwise generate reified statements */ + + statement->subject = reified_term; + statement->predicate = RAPTOR_RDF_type_term(rdf_parser->world); + statement->object = RAPTOR_RDF_Statement_term(rdf_parser->world); + (*rdf_parser->statement_handler)(rdf_parser->user_data, statement); + + /* statement->subject = reified_term; */ + statement->predicate = RAPTOR_RDF_subject_term(rdf_parser->world); + statement->object = subject_term; + (*rdf_parser->statement_handler)(rdf_parser->user_data, statement); + + + /* statement->subject = reified_term; */ + statement->predicate = RAPTOR_RDF_predicate_term(rdf_parser->world); + statement->object = predicate_term; + (*rdf_parser->statement_handler)(rdf_parser->user_data, statement); + + /* statement->subject = reified_term; */ + statement->predicate = RAPTOR_RDF_object_term(rdf_parser->world); + statement->object = object_term; + (*rdf_parser->statement_handler)(rdf_parser->user_data, statement); + + + generate_tidy: + /* Tidy up things allocated here */ + if(predicate_term) + raptor_free_term(predicate_term); + if(free_reified_term && reified_term) + raptor_free_term(reified_term); +} + + + +/** + * raptor_rdfxml_element_has_property_attributes: + * @element: element with the property attributes + * + * Return true if the element has at least one property attribute. + * + **/ +static int +raptor_rdfxml_element_has_property_attributes(raptor_rdfxml_element *element) +{ + int i; + + if(element->xml_element->attribute_count > 0) + return 1; + + /* look for rdf: properties */ + for(i = 0; i <= RDF_NS_LAST; i++) { + if(element->rdf_attr[i] && + raptor_rdf_ns_terms_info[i].type != RAPTOR_TERM_TYPE_UNKNOWN) + return 1; + } + return 0; +} + + +/** + * raptor_rdfxml_process_property_attributes: + * @rdf_parser: Raptor parser object + * @attributes_element: element with the property attributes + * @resource_element: element that defines the resource URI + * subject->value etc. + * @property_node_identifier: Use this identifier for the resource URI + * and count any ordinals for it locally + * + * Process the property attributes for an element for a given resource. + * + **/ +static int +raptor_rdfxml_process_property_attributes(raptor_parser *rdf_parser, + raptor_rdfxml_element *attributes_element, + raptor_rdfxml_element *resource_element, + raptor_term *property_node_identifier) +{ + unsigned int i; + raptor_term *resource_identifier; + + resource_identifier = property_node_identifier ? property_node_identifier : resource_element->subject; + + + /* Process attributes as propAttr* = * (propName="string")* + */ + for(i = 0; i < attributes_element->xml_element->attribute_count; i++) { + raptor_qname* attr = attributes_element->xml_element->attributes[i]; + const unsigned char *name; + const unsigned char *value; + int handled = 0; + + if(!attr) + continue; + + name = attr->local_name; + value = attr->value; + + if(!attr->nspace) { + raptor_rdfxml_update_document_locator(rdf_parser); + raptor_parser_error(rdf_parser, + "Using property attribute '%s' without a namespace is forbidden.", + name); + continue; + } + + + if(!raptor_unicode_check_utf8_nfc_string(value, strlen((const char*)value))) { + raptor_log_level l; + + raptor_rdfxml_update_document_locator(rdf_parser); + l = (RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NON_NFC_FATAL)) ? RAPTOR_LOG_LEVEL_ERROR : + RAPTOR_LOG_LEVEL_WARN; + raptor_parser_log_error(rdf_parser, l, + "Property attribute '%s' has a string not in Unicode Normal Form C: %s", + name, value); + continue; + } + + + /* Generate the property statement using one of these properties: + * 1) rdf:_n + * 2) the URI from the rdf:* attribute where allowed + * 3) otherwise forbidden (including rdf:li) + */ + if(attr->nspace->is_rdf_ms) { + /* is rdf: namespace */ + + if(*name == '_') { + int ordinal; + + /* recognise rdf:_ */ + name++; + ordinal = raptor_check_ordinal(name); + if(ordinal < 1) { + raptor_rdfxml_update_document_locator(rdf_parser); + raptor_parser_error(rdf_parser, + "Illegal ordinal value %d in property attribute '%s' seen on containing element '%s'.", + ordinal, attr->local_name, name); + } + } else { + int rc; + + raptor_rdfxml_update_document_locator(rdf_parser); + + rc = raptor_rdfxml_check_propertyAttribute_name((const char*)name); + if(!rc) + raptor_parser_error(rdf_parser, + "RDF term %s is forbidden as a property attribute.", + name); + else if(rc < 0) + raptor_parser_warning(rdf_parser, + "Unknown RDF namespace property attribute '%s'.", + name); + } + + } /* end is RDF namespace property */ + + + if(!handled) { + raptor_term* object_term; + + object_term = raptor_new_term_from_literal(rdf_parser->world, + (unsigned char*)value, + NULL, NULL); + + /* else not rdf: namespace or unknown in rdf: namespace so + * generate a statement with a literal object + */ + raptor_rdfxml_generate_statement(rdf_parser, + resource_identifier, + attr->uri, + object_term, + NULL, /* Property attributes are never reified*/ + resource_element); + + raptor_free_term(object_term); + } + + } /* end for ... attributes */ + + + /* Handle rdf property attributes + * (only rdf:type and rdf:value at present) + */ + for(i = 0; i <= RDF_NS_LAST; i++) { + const unsigned char *value = attributes_element->rdf_attr[i]; + size_t value_len; + int object_is_literal; + raptor_uri *property_uri; + raptor_term* object_term; + + if(!value) + continue; + + value_len = strlen((const char*)value); + + object_is_literal = (raptor_rdf_ns_terms_info[i].type == RAPTOR_TERM_TYPE_LITERAL); + + if(raptor_rdf_ns_terms_info[i].type == RAPTOR_TERM_TYPE_UNKNOWN) { + const char *name = raptor_rdf_ns_terms_info[i].name; + int rc = raptor_rdfxml_check_propertyAttribute_name(name); + if(!rc) { + raptor_rdfxml_update_document_locator(rdf_parser); + raptor_parser_error(rdf_parser, + "RDF term %s is forbidden as a property attribute.", + name); + continue; + } else if(rc < 0) + raptor_parser_warning(rdf_parser, + "Unknown RDF namespace property attribute '%s'.", + name); + } + + if(object_is_literal && + !raptor_unicode_check_utf8_nfc_string(value, value_len)) { + raptor_log_level l; + + raptor_rdfxml_update_document_locator(rdf_parser); + l = (RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NON_NFC_FATAL)) ? RAPTOR_LOG_LEVEL_ERROR : + RAPTOR_LOG_LEVEL_WARN; + + raptor_parser_log_error(rdf_parser, l, + "Property attribute '%s' has a string not in Unicode Normal Form C: %s", + raptor_rdf_ns_terms_info[i].name, value); + continue; + } + + property_uri = raptor_new_uri_for_rdf_concept(rdf_parser->world, + (const unsigned char*)raptor_rdf_ns_terms_info[i].name); + + if(object_is_literal) { + object_term = raptor_new_term_from_literal(rdf_parser->world, + (unsigned char*)value, + NULL, NULL); + } else { + raptor_uri *base_uri; + raptor_uri *object_uri; + base_uri = raptor_rdfxml_inscope_base_uri(rdf_parser); + object_uri = raptor_new_uri_relative_to_base(rdf_parser->world, + base_uri, value); + object_term = raptor_new_term_from_uri(rdf_parser->world, object_uri); + raptor_free_uri(object_uri); + } + + raptor_rdfxml_generate_statement(rdf_parser, + resource_identifier, + property_uri, + object_term, + NULL, /* Property attributes are never reified*/ + resource_element); + + raptor_free_term(object_term); + + raptor_free_uri(property_uri); + + } /* end for rdf:property values */ + + return 0; +} + + +static void +raptor_rdfxml_start_element_grammar(raptor_parser *rdf_parser, + raptor_rdfxml_element *element) +{ + raptor_rdfxml_parser *rdf_xml_parser; + int finished; + raptor_state state; + raptor_xml_element* xml_element; + raptor_qname* el_qname; + const unsigned char *el_name; + int element_in_rdf_ns; + int rc = 0; + raptor_uri* base_uri; + raptor_uri* element_name_uri; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + xml_element = element->xml_element; + el_qname = raptor_xml_element_get_name(xml_element); + el_name = el_qname->local_name; + element_in_rdf_ns = (el_qname->nspace && el_qname->nspace->is_rdf_ms); + base_uri = raptor_rdfxml_inscope_base_uri(rdf_parser); + element_name_uri = el_qname->uri; + + state = element->state; +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG2("Starting in state %s\n", raptor_rdfxml_state_as_string(state)); +#endif + + finished = 0; + while(!finished) { + + switch(state) { + case RAPTOR_STATE_SKIPPING: + element->child_state = state; + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PRESERVED; + finished = 1; + break; + + case RAPTOR_STATE_UNKNOWN: + /* found ? */ + + if(element_in_rdf_ns) { + if(raptor_uri_equals(element_name_uri, + RAPTOR_RDF_RDF_URI(rdf_parser->world))) { + element->child_state = RAPTOR_STATE_NODE_ELEMENT_LIST; + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_NODES; + /* Yes - need more content before can continue, + * so wait for another element + */ + finished = 1; + break; + } + if(raptor_uri_equals(element_name_uri, + RAPTOR_RDF_Description_URI(rdf_parser->world))) { + state = RAPTOR_STATE_DESCRIPTION; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES; + /* Yes - found something so move immediately to description */ + break; + } + + if(element_in_rdf_ns) { + rc = raptor_rdfxml_check_nodeElement_name((const char*)el_name); + if(!rc) { + raptor_parser_error(rdf_parser, + "rdf:%s is forbidden as a node element.", + el_name); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } else if(rc < 0) { + raptor_parser_warning(rdf_parser, + "rdf:%s is an unknown RDF namespaced element.", + el_name); + } + } + } + + /* If scanning for element, can continue */ + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_SCANNING)) { + finished = 1; + break; + } + + /* Otherwise the choice of the next state can be made + * from the current element by the OBJ state + */ + state = RAPTOR_STATE_NODE_ELEMENT_LIST; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_NODES; + break; + + + case RAPTOR_STATE_NODE_ELEMENT_LIST: + /* Handling + * http://www.w3.org/TR/rdf-syntax-grammar/#nodeElementList + * + * Everything goes to nodeElement + */ + + state = RAPTOR_STATE_NODE_ELEMENT; + + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES; + + break; + + + + case RAPTOR_STATE_DESCRIPTION: + case RAPTOR_STATE_NODE_ELEMENT: + case RAPTOR_STATE_PARSETYPE_RESOURCE: + case RAPTOR_STATE_PARSETYPE_COLLECTION: + /* Handling or other node element + * http://www.w3.org/TR/rdf-syntax-grammar/#nodeElement + * + * or a property element acting as a node element for + * rdf:parseType="Resource" + * http://www.w3.org/TR/rdf-syntax-grammar/#parseTypeResourcePropertyElt + * or rdf:parseType="Collection" (and daml:Collection) + * http://www.w3.org/TR/rdf-syntax-grammar/#parseTypeCollectionPropertyElt + * + * Only create a bag if bagID given + */ + + if(!element_name_uri) { + /* We cannot handle this */ + raptor_parser_warning(rdf_parser, "Using node element '%s' without a namespace is forbidden.", + el_qname->local_name); + raptor_rdfxml_update_document_locator(rdf_parser); + element->state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + + if(element_in_rdf_ns) { + rc = raptor_rdfxml_check_nodeElement_name((const char*)el_name); + if(!rc) { + raptor_parser_error(rdf_parser, + "rdf:%s is forbidden as a node element.", + el_name); + state = RAPTOR_STATE_SKIPPING; + element->state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } else if(rc < 0) { + raptor_parser_warning(rdf_parser, + "rdf:%s is an unknown RDF namespaced element.", + el_name); + } + } + + if(element->content_type != RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_COLLECTION && + element->content_type != RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION && + element->parent && + (element->parent->state == RAPTOR_STATE_PROPERTYELT || + element->parent->state == RAPTOR_STATE_MEMBER_PROPERTYELT) && + element->parent->xml_element->content_element_seen > 1) { + raptor_rdfxml_update_document_locator(rdf_parser); + raptor_parser_error(rdf_parser, "The enclosing property already has an object"); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + + if(state == RAPTOR_STATE_NODE_ELEMENT || + state == RAPTOR_STATE_DESCRIPTION || + state == RAPTOR_STATE_PARSETYPE_COLLECTION) { + if(element_in_rdf_ns && + raptor_uri_equals(element_name_uri, + RAPTOR_RDF_Description_URI(rdf_parser->world))) + state = RAPTOR_STATE_DESCRIPTION; + else + state = RAPTOR_STATE_NODE_ELEMENT; + } + + + if((element->rdf_attr[RDF_NS_ID]!=NULL) + + (element->rdf_attr[RDF_NS_about]!=NULL) + + (element->rdf_attr[RDF_NS_nodeID]!=NULL) > 1) { + raptor_rdfxml_update_document_locator(rdf_parser); + raptor_parser_error(rdf_parser, "Multiple attributes of rdf:ID, rdf:about and rdf:nodeID on element '%s' - only one allowed.", el_name); + } + + if(element->rdf_attr[RDF_NS_ID]) { + unsigned char* subject_id; + raptor_uri* subject_uri; + + subject_id = (unsigned char*)element->rdf_attr[RDF_NS_ID]; + + if(!raptor_valid_xml_ID(rdf_parser, subject_id)) { + raptor_parser_error(rdf_parser, "Illegal rdf:ID value '%s'", + subject_id); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + if(raptor_rdfxml_record_ID(rdf_parser, element, subject_id)) { + raptor_parser_error(rdf_parser, "Duplicated rdf:ID value '%s'", + subject_id); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + + /* after this, subject_id is the owner of the ID string */ + element->rdf_attr[RDF_NS_ID] = NULL; + + subject_uri = raptor_new_uri_from_id(rdf_parser->world, base_uri, + subject_id); + RAPTOR_FREE(char*, subject_id); + + if(!subject_uri) + goto oom; + element->subject = raptor_new_term_from_uri(rdf_parser->world, + subject_uri); + raptor_free_uri(subject_uri); + + if(!element->subject) + goto oom; + + } else if(element->rdf_attr[RDF_NS_about]) { + raptor_uri* subject_uri; + + subject_uri = raptor_new_uri_relative_to_base(rdf_parser->world, + base_uri, + (const unsigned char*)element->rdf_attr[RDF_NS_about]); + if(!subject_uri) + goto oom; + + element->subject = raptor_new_term_from_uri(rdf_parser->world, + subject_uri); + raptor_free_uri(subject_uri); + + RAPTOR_FREE(char*, element->rdf_attr[RDF_NS_about]); + element->rdf_attr[RDF_NS_about] = NULL; + if(!element->subject) + goto oom; + + } else if(element->rdf_attr[RDF_NS_nodeID]) { + unsigned char* subject_id; + subject_id = raptor_world_internal_generate_id(rdf_parser->world, + (unsigned char*)element->rdf_attr[RDF_NS_nodeID]); + if(!subject_id) + goto oom; + + element->subject = raptor_new_term_from_blank(rdf_parser->world, + subject_id); + RAPTOR_FREE(char*, subject_id); + + element->rdf_attr[RDF_NS_nodeID] = NULL; + if(!element->subject) + goto oom; + + if(!raptor_valid_xml_ID(rdf_parser, element->subject->value.blank.string)) { + raptor_parser_error(rdf_parser, "Illegal rdf:nodeID value '%s'", + (const char*)element->subject->value.blank.string); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + } else if(element->parent && + element->parent->child_content_type != RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_COLLECTION && + element->parent->child_content_type != RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION && + element->parent->object) { + /* copy from parent (property element), it has a URI for us */ + element->subject = raptor_term_copy(element->parent->object); + } else { + unsigned char* subject_id; + subject_id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!subject_id) + goto oom; + + element->subject = raptor_new_term_from_blank(rdf_parser->world, + subject_id); + RAPTOR_FREE(char*, subject_id); + + if(!element->subject) + goto oom; + } + + + if(element->rdf_attr[RDF_NS_bagID]) { + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_BAGID)) { + unsigned char* bag_id; + raptor_uri* bag_uri = NULL; + + bag_id = (unsigned char*)element->rdf_attr[RDF_NS_bagID]; + element->rdf_attr[RDF_NS_bagID] = NULL; + + bag_uri = raptor_new_uri_from_id(rdf_parser->world, + base_uri, bag_id); + if(!bag_uri) { + RAPTOR_FREE(char*, bag_id); + goto oom; + } + + element->bag = raptor_new_term_from_uri(rdf_parser->world, bag_uri); + raptor_free_uri(bag_uri); + + if(!raptor_valid_xml_ID(rdf_parser, bag_id)) { + raptor_parser_error(rdf_parser, "Illegal rdf:bagID value '%s'", + bag_id); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + RAPTOR_FREE(char*, bag_id); + break; + } + if(raptor_rdfxml_record_ID(rdf_parser, element, bag_id)) { + raptor_parser_error(rdf_parser, "Duplicated rdf:bagID value '%s'", + bag_id); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + RAPTOR_FREE(char*, bag_id); + break; + } + + RAPTOR_FREE(char*, bag_id); + raptor_parser_warning(rdf_parser, "rdf:bagID is deprecated."); + + + raptor_rdfxml_generate_statement(rdf_parser, + element->bag, + RAPTOR_RDF_type_URI(rdf_parser->world), + RAPTOR_RDF_Bag_term(rdf_parser->world), + NULL, + NULL); + } else { + /* bagID forbidden */ + raptor_parser_error(rdf_parser, "rdf:bagID is forbidden."); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + } + + + if(element->parent) { + + /* In a rdf:parseType="Collection" the resources are appended + * to the list at the genid element->parent->tail_id + */ + if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_COLLECTION || + element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) { + /* rdf:type rdf:List */ + const unsigned char * idList; + raptor_uri *predicate_uri; + raptor_term* idList_term; + raptor_term* object_term; + + idList = raptor_world_generate_bnodeid(rdf_parser->world); + if(!idList) + goto oom; + /* idList string is saved below in element->parent->tail_id */ + + idList_term = raptor_new_term_from_blank(rdf_parser->world, idList); + if(!idList_term) { + RAPTOR_FREE(char*, idList); + goto oom; + } + + if((element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) || + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST)) { + raptor_uri* class_uri = NULL; + + if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) { + class_uri = RAPTOR_DAML_List_URI(rdf_xml_parser); + object_term = raptor_new_term_from_uri(rdf_parser->world, + class_uri); + } else + object_term = raptor_term_copy(RAPTOR_RDF_List_term(rdf_parser->world)); + + raptor_rdfxml_generate_statement(rdf_parser, + idList_term, + RAPTOR_RDF_type_URI(rdf_parser->world), + object_term, + NULL, + element); + raptor_free_term(object_term); + } + + predicate_uri = (element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) ? RAPTOR_DAML_first_URI(rdf_xml_parser) : RAPTOR_RDF_first_URI(rdf_parser->world); + + /* rdf:first uri> */ + raptor_rdfxml_generate_statement(rdf_parser, + idList_term, + predicate_uri, + element->subject, + NULL, + NULL); + + /* If there is no rdf:parseType="Collection" */ + if(!element->parent->tail_id) { + /* Free any existing object still around. + * I suspect this can never happen. + */ + if(element->parent->object) + raptor_free_term(element->parent->object); + + element->parent->object = raptor_new_term_from_blank(rdf_parser->world, + idList); + } else { + raptor_term* tail_id_term; + + tail_id_term = raptor_new_term_from_blank(rdf_parser->world, + element->parent->tail_id); + + predicate_uri = (element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) ? RAPTOR_DAML_rest_URI(rdf_xml_parser) : RAPTOR_RDF_rest_URI(rdf_parser->world); + + /* _:tail_id rdf:rest _:listRest */ + raptor_rdfxml_generate_statement(rdf_parser, + tail_id_term, + predicate_uri, + idList_term, + NULL, + NULL); + + raptor_free_term(tail_id_term); + } + + /* update new tail */ + if(element->parent->tail_id) + RAPTOR_FREE(char*, (char*)element->parent->tail_id); + + element->parent->tail_id = idList; + + raptor_free_term(idList_term); + } else if(element->parent->state != RAPTOR_STATE_UNKNOWN && + element->state != RAPTOR_STATE_PARSETYPE_RESOURCE) { + /* If there is a parent element (property) containing this + * element (node) and it has no object, set it from this subject + */ + + if(element->parent->object) { + raptor_rdfxml_update_document_locator(rdf_parser); + raptor_parser_error(rdf_parser, + "Tried to set multiple objects of a statement"); + } else { + /* Store URI of this node in our parent as the property object */ + element->parent->object = raptor_term_copy(element->subject); + element->parent->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + } + + } + } + + + /* If this is a node element, generate the rdf:type statement + * from this node + */ + if(state == RAPTOR_STATE_NODE_ELEMENT) { + raptor_term* el_name_term; + + el_name_term = raptor_new_term_from_uri(rdf_parser->world, + element_name_uri); + + raptor_rdfxml_generate_statement(rdf_parser, + element->subject, + RAPTOR_RDF_type_URI(rdf_parser->world), + el_name_term, + element->reified, + element); + + raptor_free_term(el_name_term); + } + + if(raptor_rdfxml_process_property_attributes(rdf_parser, element, + element, NULL)) + goto oom; + + /* for both productions now need some more content or + * property elements before can do any more work. + */ + + element->child_state = RAPTOR_STATE_PROPERTYELT; + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES; + finished = 1; + break; + + + case RAPTOR_STATE_PARSETYPE_OTHER: + /* FALLTHROUGH */ + + case RAPTOR_STATE_PARSETYPE_LITERAL: + raptor_xml_writer_start_element(rdf_xml_parser->xml_writer, xml_element); + element->child_state = RAPTOR_STATE_PARSETYPE_LITERAL; + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL; + + finished = 1; + break; + + /* Handle all the detail of the various options of property element + * http://www.w3.org/TR/rdf-syntax-grammar/#propertyElt + * + * All the attributes must be scanned here to see what additional + * property element work is needed. No triples are generated + * until the end of this element, until it is clear if the + * element was empty. + */ + case RAPTOR_STATE_MEMBER_PROPERTYELT: + case RAPTOR_STATE_PROPERTYELT: + + if(!element_name_uri) { + raptor_parser_error(rdf_parser, "Using property element '%s' without a namespace is forbidden.", + raptor_xml_element_get_name(element->parent->xml_element)->local_name); + raptor_rdfxml_update_document_locator(rdf_parser); + element->state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + + /* Handling rdf:li as a property, noting special processing */ + if(element_in_rdf_ns && + raptor_uri_equals(element_name_uri, + RAPTOR_RDF_li_URI(rdf_parser->world))) { + state = RAPTOR_STATE_MEMBER_PROPERTYELT; + } + + + if(element_in_rdf_ns) { + rc = raptor_rdfxml_check_propertyElement_name((const char*)el_name); + if(!rc) { + raptor_parser_error(rdf_parser, + "rdf:%s is forbidden as a property element.", + el_name); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } else if(rc < 0) { + raptor_parser_warning(rdf_parser, + "rdf:%s is an unknown RDF namespaced element.", + el_name); + } + } + + + /* rdf:ID on a property element - reify a statement. + * Allowed on all property element forms + */ + if(element->rdf_attr[RDF_NS_ID]) { + raptor_uri *reified_uri; + + element->reified_id = element->rdf_attr[RDF_NS_ID]; + element->rdf_attr[RDF_NS_ID] = NULL; + reified_uri = raptor_new_uri_from_id(rdf_parser->world, base_uri, + element->reified_id); + if(!reified_uri) + goto oom; + + element->reified = raptor_new_term_from_uri(rdf_parser->world, + reified_uri); + raptor_free_uri(reified_uri); + + if(!element->reified) + goto oom; + + if(!raptor_valid_xml_ID(rdf_parser, element->reified_id)) { + raptor_parser_error(rdf_parser, "Illegal rdf:ID value '%s'", + element->reified_id); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + if(raptor_rdfxml_record_ID(rdf_parser, element, element->reified_id)) { + raptor_parser_error(rdf_parser, "Duplicated rdf:ID value '%s'", + element->reified_id); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + } + + /* rdf:datatype on a property element. + * Only allowed for + * http://www.w3.org/TR/rdf-syntax-grammar/#literalPropertyElt + */ + if(element->rdf_attr[RDF_NS_datatype]) { + raptor_uri *datatype_uri; + + datatype_uri = raptor_new_uri_relative_to_base(rdf_parser->world, + base_uri, + (const unsigned char*)element->rdf_attr[RDF_NS_datatype]); + element->object_literal_datatype = datatype_uri; + RAPTOR_FREE(char*, element->rdf_attr[RDF_NS_datatype]); + element->rdf_attr[RDF_NS_datatype] = NULL; + if(!element->object_literal_datatype) + goto oom; + } + + if(element->rdf_attr[RDF_NS_bagID]) { + + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_BAGID)) { + + if(element->rdf_attr[RDF_NS_resource] || + element->rdf_attr[RDF_NS_parseType]) { + + raptor_parser_error(rdf_parser, "rdf:bagID is forbidden on property element '%s' with an rdf:resource or rdf:parseType attribute.", el_name); + /* prevent this being used later either */ + RAPTOR_FREE(char*, element->rdf_attr[RDF_NS_bagID]); + element->rdf_attr[RDF_NS_bagID] = NULL; + } else { + unsigned char* bag_id; + raptor_uri* bag_uri; + + bag_id = (unsigned char*)element->rdf_attr[RDF_NS_bagID]; + element->rdf_attr[RDF_NS_bagID] = NULL; + bag_uri = raptor_new_uri_from_id(rdf_parser->world, base_uri, + bag_id); + if(!bag_uri) { + RAPTOR_FREE(char*, bag_id); + goto oom; + } + + element->bag = raptor_new_term_from_uri(rdf_parser->world, + bag_uri); + raptor_free_uri(bag_uri); + + if(!element->bag) { + RAPTOR_FREE(char*, bag_id); + goto oom; + } + + if(!raptor_valid_xml_ID(rdf_parser, bag_id)) { + raptor_parser_error(rdf_parser, "Illegal rdf:bagID value '%s'", + bag_id); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + RAPTOR_FREE(char*, bag_id); + break; + } + if(raptor_rdfxml_record_ID(rdf_parser, element, bag_id)) { + raptor_parser_error(rdf_parser, + "Duplicated rdf:bagID value '%s'", bag_id); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + RAPTOR_FREE(char*, bag_id); + finished = 1; + break; + } + + RAPTOR_FREE(char*, bag_id); + raptor_parser_warning(rdf_parser, "rdf:bagID is deprecated."); + } + } else { + /* bagID forbidden */ + raptor_parser_error(rdf_parser, "rdf:bagID is forbidden."); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + } /* if rdf:bagID on property element */ + + + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT; + + if(element->rdf_attr[RDF_NS_parseType]) { + const unsigned char *parse_type; + int i; + int is_parseType_Literal = 0; + + parse_type = element->rdf_attr[RDF_NS_parseType]; + + if(raptor_rdfxml_element_has_property_attributes(element)) { + raptor_parser_error(rdf_parser, "Property attributes cannot be used with rdf:parseType='%s'", parse_type); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + finished = 1; + break; + } + + /* Check for bad combinations of things with parseType */ + for(i = 0; i <= RDF_NS_LAST; i++) + if(element->rdf_attr[i] && i != RDF_NS_parseType) { + raptor_parser_error(rdf_parser, "Attribute '%s' cannot be used with rdf:parseType='%s'", raptor_rdf_ns_terms_info[i].name, parse_type); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + break; + } + + + if(!strcmp((char*)parse_type, "Literal")) + is_parseType_Literal = 1; + else if(!strcmp((char*)parse_type, "Resource")) { + unsigned char* subject_id; + + state = RAPTOR_STATE_PARSETYPE_RESOURCE; + element->child_state = RAPTOR_STATE_PROPERTYELT; + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES; + + /* create a node for the subject of the contained properties */ + subject_id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!subject_id) + goto oom; + + element->subject = raptor_new_term_from_blank(rdf_parser->world, + subject_id); + RAPTOR_FREE(char*, subject_id); + + if(!element->subject) + goto oom; + } else if(!strcmp((char*)parse_type, "Collection")) { + /* An rdf:parseType="Collection" appears as a single node */ + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + element->child_state = RAPTOR_STATE_PARSETYPE_COLLECTION; + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_COLLECTION; + } else { + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES) && + !raptor_strcasecmp((char*)parse_type, "daml:collection")) { + /* A DAML collection appears as a single node */ + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + element->child_state = RAPTOR_STATE_PARSETYPE_COLLECTION; + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION; + } else { + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_WARN_OTHER_PARSETYPES)) { + raptor_parser_warning(rdf_parser, "Unknown rdf:parseType value '%s' taken as 'Literal'", parse_type); + } + is_parseType_Literal = 1; + } + + } + + if(is_parseType_Literal) { + raptor_xml_writer* xml_writer; + + /* rdf:parseType="Literal" - explicitly or default + * if the parseType value is not recognised + */ + rdf_xml_parser->xml_content = NULL; + rdf_xml_parser->xml_content_length = 0; + rdf_xml_parser->iostream = + raptor_new_iostream_to_string(rdf_parser->world, + &rdf_xml_parser->xml_content, + &rdf_xml_parser->xml_content_length, + raptor_alloc_memory); + if(!rdf_xml_parser->iostream) + goto oom; + xml_writer = raptor_new_xml_writer(rdf_parser->world, NULL, + rdf_xml_parser->iostream); + rdf_xml_parser->xml_writer = xml_writer; + if(!rdf_xml_parser->xml_writer) + goto oom; + + raptor_xml_writer_set_option(rdf_xml_parser->xml_writer, + RAPTOR_OPTION_WRITER_XML_DECLARATION, + NULL, 0); + + element->child_state = RAPTOR_STATE_PARSETYPE_LITERAL; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL; + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL; + } + } else { + + /* Can only be the empty property element case + * http://www.w3.org/TR/rdf-syntax-grammar/#emptyPropertyElt + */ + + /* The presence of the rdf:resource or rdf:nodeID + * attributes is checked at element close time + */ + + /* + * Assign reified URI here so we don't reify property attributes + * using this id + */ + if(element->reified_id && !element->reified) { + raptor_uri* reified_uri; + reified_uri = raptor_new_uri_from_id(rdf_parser->world, base_uri, + element->reified_id); + if(!reified_uri) + goto oom; + element->reified = raptor_new_term_from_uri(rdf_parser->world, + reified_uri); + raptor_free_uri(reified_uri); + + if(!element->reified) + goto oom; + } + + if(element->rdf_attr[RDF_NS_resource] || + element->rdf_attr[RDF_NS_nodeID]) { + /* Done - wait for end of this element to end in order to + * check the element was empty as expected */ + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + } else { + /* Otherwise process content in obj (value) state */ + element->child_state = RAPTOR_STATE_NODE_ELEMENT_LIST; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT; + } + } + + finished = 1; + + break; + + + case RAPTOR_STATE_INVALID: + default: + raptor_parser_fatal_error(rdf_parser, + "%s Internal error - unexpected parser state %u - %s", + __FUNCTION__, + state, raptor_rdfxml_state_as_string(state)); + finished = 1; + + } /* end switch */ + + if(state != element->state) { + element->state = state; +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG3("Moved to state %d - %s\n", state, + raptor_rdfxml_state_as_string(state)); +#endif + } + + } /* end while */ + +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG2("Ending in state %s\n", raptor_rdfxml_state_as_string(state)); +#endif + + return; + + oom: + raptor_parser_fatal_error(rdf_parser, "Out of memory, skipping"); + element->state = RAPTOR_STATE_SKIPPING; +} + + +static void +raptor_rdfxml_end_element_grammar(raptor_parser *rdf_parser, + raptor_rdfxml_element *element) +{ + raptor_rdfxml_parser *rdf_xml_parser; + raptor_state state; + int finished; + raptor_xml_element* xml_element = element->xml_element; + raptor_qname* el_qname; + const unsigned char *el_name; + int element_in_rdf_ns; + raptor_uri* element_name_uri; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + el_qname = raptor_xml_element_get_name(xml_element); + el_name = el_qname->local_name; + element_in_rdf_ns= (el_qname->nspace && el_qname->nspace->is_rdf_ms); + element_name_uri = el_qname->uri; + + + state = element->state; +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG2("Starting in state %s\n", raptor_rdfxml_state_as_string(state)); +#endif + + finished= 0; + while(!finished) { + switch(state) { + case RAPTOR_STATE_SKIPPING: + finished = 1; + break; + + case RAPTOR_STATE_UNKNOWN: + finished = 1; + break; + + case RAPTOR_STATE_NODE_ELEMENT_LIST: + if(element_in_rdf_ns && + raptor_uri_equals(element_name_uri, + RAPTOR_RDF_RDF_URI(rdf_parser->world))) { + /* end of RDF - boo hoo */ + state = RAPTOR_STATE_UNKNOWN; + finished = 1; + break; + } + /* When scanning, another element ending is outside the RDF + * world so this can happen without further work + */ + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_SCANNING)) { + state = RAPTOR_STATE_UNKNOWN; + finished = 1; + break; + } + /* otherwise found some junk after RDF content in an RDF-only + * document (probably never get here since this would be + * a mismatched XML tag and cause an error earlier) + */ + raptor_rdfxml_update_document_locator(rdf_parser); + raptor_parser_warning(rdf_parser, + "Element '%s' ended, expected end of RDF element", + el_name); + state = RAPTOR_STATE_UNKNOWN; + finished = 1; + break; + + + case RAPTOR_STATE_DESCRIPTION: + case RAPTOR_STATE_NODE_ELEMENT: + case RAPTOR_STATE_PARSETYPE_RESOURCE: + + /* If there is a parent element containing this element and + * the parent isn't a description, has an identifier, + * create the statement between this node using parent property + * (Need to check for identifier so that top-level typed nodes + * don't get connect to parent element) + */ + if(state == RAPTOR_STATE_NODE_ELEMENT && + element->parent && element->parent->subject) { + raptor_rdfxml_generate_statement(rdf_parser, + element->parent->subject, + element_name_uri, + element->subject, + NULL, + element); + } else if(state == RAPTOR_STATE_PARSETYPE_RESOURCE && + element->parent && element->parent->subject) { + /* Handle rdf:li as the rdf:parseType="resource" property */ + if(element_in_rdf_ns && + raptor_uri_equals(element_name_uri, + RAPTOR_RDF_li_URI(rdf_parser->world))) { + raptor_uri* ordinal_predicate_uri; + + element->parent->last_ordinal++; + ordinal_predicate_uri = raptor_new_uri_from_rdf_ordinal(rdf_parser->world, element->parent->last_ordinal); + + raptor_rdfxml_generate_statement(rdf_parser, + element->parent->subject, + ordinal_predicate_uri, + element->subject, + element->reified, + element->parent); + raptor_free_uri(ordinal_predicate_uri); + } else { + raptor_rdfxml_generate_statement(rdf_parser, + element->parent->subject, + element_name_uri, + element->subject, + element->reified, + element->parent); + } + } + finished = 1; + break; + + case RAPTOR_STATE_PARSETYPE_COLLECTION: + + finished = 1; + break; + + case RAPTOR_STATE_PARSETYPE_OTHER: + /* FALLTHROUGH */ + + case RAPTOR_STATE_PARSETYPE_LITERAL: + element->parent->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL; + + raptor_xml_writer_end_element(rdf_xml_parser->xml_writer, xml_element); + + finished = 1; + break; + + + case RAPTOR_STATE_PROPERTYELT: + case RAPTOR_STATE_MEMBER_PROPERTYELT: + /* A property element + * http://www.w3.org/TR/rdf-syntax-grammar/#propertyElt + * + * Literal content part is handled here. + * The element content is handled in the internal states + * Empty content is checked here. + */ + + if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT) { + if(xml_element->content_cdata_seen) + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL; + else if(xml_element->content_element_seen) + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES; + else { + /* Empty Literal */ + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL; + } + + } + + + /* Handle terminating a rdf:parseType="Collection" list */ + if(element->child_content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_COLLECTION || + element->child_content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) { + raptor_term* nil_term; + + if(element->child_content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) { + raptor_uri* nil_uri = RAPTOR_DAML_nil_URI(rdf_xml_parser); + nil_term = raptor_new_term_from_uri(rdf_parser->world, nil_uri); + } else { + nil_term = raptor_term_copy(RAPTOR_RDF_nil_term(rdf_parser->world)); + } + + if(!element->tail_id) { + /* If No List: set object of statement to rdf:nil */ + element->object = raptor_term_copy(nil_term); + } else { + raptor_uri* rest_uri = NULL; + raptor_term* tail_id_term; + + if(element->child_content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION) + rest_uri = RAPTOR_DAML_rest_URI(rdf_xml_parser); + else + rest_uri = RAPTOR_RDF_rest_URI(rdf_parser->world); + + tail_id_term = raptor_new_term_from_blank(rdf_parser->world, + element->tail_id); + + /* terminate the list */ + raptor_rdfxml_generate_statement(rdf_parser, + tail_id_term, + rest_uri, + nil_term, + NULL, + NULL); + + raptor_free_term(tail_id_term); + } + + raptor_free_term(nil_term); + + } /* end rdf:parseType="Collection" termination */ + + +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG3("Content type %s (%d)\n", + raptor_rdfxml_element_content_type_as_string(element->content_type), + element->content_type); +#endif + + switch(element->content_type) { + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE: + + if(raptor_rdfxml_element_has_property_attributes(element) && + element->child_state == RAPTOR_STATE_DESCRIPTION) { + raptor_parser_error(rdf_parser, + "Property element '%s' has both property attributes and a node element content", + el_name); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + break; + } + + if(!element->object) { + if(element->rdf_attr[RDF_NS_resource]) { + raptor_uri* resource_uri; + resource_uri = raptor_new_uri_relative_to_base(rdf_parser->world, + raptor_rdfxml_inscope_base_uri(rdf_parser), + (const unsigned char*)element->rdf_attr[RDF_NS_resource]); + if(!resource_uri) + goto oom; + + element->object = raptor_new_term_from_uri(rdf_parser->world, + resource_uri); + raptor_free_uri(resource_uri); + + RAPTOR_FREE(char*, element->rdf_attr[RDF_NS_resource]); + element->rdf_attr[RDF_NS_resource] = NULL; + if(!element->object) + goto oom; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + } else if(element->rdf_attr[RDF_NS_nodeID]) { + unsigned char* resource_id; + resource_id = raptor_world_internal_generate_id(rdf_parser->world, + (unsigned char*)element->rdf_attr[RDF_NS_nodeID]); + if(!resource_id) + goto oom; + + element->object = raptor_new_term_from_blank(rdf_parser->world, + resource_id); + RAPTOR_FREE(char*, resource_id); + element->rdf_attr[RDF_NS_nodeID] = NULL; + if(!element->object) + goto oom; + + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + if(!raptor_valid_xml_ID(rdf_parser, + element->object->value.blank.string)) { + raptor_parser_error(rdf_parser, "Illegal rdf:nodeID value '%s'", (const char*)element->object->value.blank.string); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + break; + } + } else { + unsigned char* resource_id; + resource_id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!resource_id) + goto oom; + + element->object = raptor_new_term_from_blank(rdf_parser->world, + resource_id); + RAPTOR_FREE(char*, resource_id); + + if(!element->object) + goto oom; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + } + + if(raptor_rdfxml_process_property_attributes(rdf_parser, element, + element->parent, + element->object)) + goto oom; + + } + + /* We know object is a resource, so delete any unsignficant + * whitespace so that FALLTHROUGH code below finds the object. + */ + if(xml_element->content_cdata_length) { + raptor_free_stringbuffer(xml_element->content_cdata_sb); + xml_element->content_cdata_sb = NULL; + xml_element->content_cdata_length = 0; + } + + /* FALLTHROUGH */ + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL: + + if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL) { + + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_ALLOW_BAGID)) { + /* Only an empty literal can have a rdf:bagID */ + if(element->bag) { + if(xml_element->content_cdata_length > 0) { + raptor_parser_error(rdf_parser, + "rdf:bagID is forbidden on a literal property element '%s'.", + el_name); + + /* prevent this being used later either */ + element->rdf_attr[RDF_NS_bagID] = NULL; + } else { + raptor_rdfxml_generate_statement(rdf_parser, + element->bag, + RAPTOR_RDF_type_URI(rdf_parser->world), + RAPTOR_RDF_Bag_term(rdf_parser->world), + NULL, + NULL); + } + } + } /* if rdf:bagID */ + + /* If there is empty literal content with properties + * generate a node to hang properties off + */ + if(raptor_rdfxml_element_has_property_attributes(element) && + xml_element->content_cdata_length > 0) { + raptor_parser_error(rdf_parser, + "Literal property element '%s' has property attributes", + el_name); + state = RAPTOR_STATE_SKIPPING; + element->child_state = RAPTOR_STATE_SKIPPING; + break; + } + + if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL && + raptor_rdfxml_element_has_property_attributes(element) && + !element->object) { + unsigned char* object_id; + object_id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!object_id) + goto oom; + + element->object = raptor_new_term_from_blank(rdf_parser->world, + object_id); + RAPTOR_FREE(char*, object_id); + + if(!element->object) + goto oom; + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_RESOURCE; + } + + if(raptor_rdfxml_process_property_attributes(rdf_parser, element, + element, + element->object)) + goto oom; + } + + + /* just be friendly to older compilers and don't declare + * variables in the middle of a block + */ + if(1) { + raptor_uri *predicate_uri = NULL; + int predicate_ordinal = -1; + raptor_term* object_term = NULL; + + if(state == RAPTOR_STATE_MEMBER_PROPERTYELT) { + predicate_ordinal = ++element->parent->last_ordinal; + predicate_uri = raptor_new_uri_from_rdf_ordinal(rdf_parser->world, + predicate_ordinal); + + } else { + predicate_uri = element_name_uri; + } + + + if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL) { + unsigned char* literal = NULL; + raptor_uri* literal_datatype; + unsigned char* literal_language = NULL; + + /* an empty stringbuffer - empty CDATA - is OK */ + if(raptor_stringbuffer_length(xml_element->content_cdata_sb)) { + literal = raptor_stringbuffer_as_string(xml_element->content_cdata_sb); + if(!literal) + goto oom; + } + + literal_datatype = element->object_literal_datatype; + if(!literal_datatype) + literal_language = (unsigned char*)raptor_sax2_inscope_xml_language(rdf_xml_parser->sax2); + + if(!literal_datatype && literal && + !raptor_unicode_check_utf8_nfc_string(literal, + xml_element->content_cdata_length)) { + raptor_log_level l; + + raptor_rdfxml_update_document_locator(rdf_parser); + l = (RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NON_NFC_FATAL)) ? RAPTOR_LOG_LEVEL_ERROR : + RAPTOR_LOG_LEVEL_WARN; + + raptor_parser_log_error(rdf_parser, l, + "Property element '%s' has a string not in Unicode Normal Form C: %s", + el_name, literal); + } + + object_term = raptor_new_term_from_literal(rdf_parser->world, + literal, + literal_datatype, + literal_language); + } else { + object_term = raptor_term_copy(element->object); + } + + raptor_rdfxml_generate_statement(rdf_parser, + element->parent->subject, + predicate_uri, + object_term, + element->reified, + element->parent); + + if(predicate_ordinal >= 0) + raptor_free_uri(predicate_uri); + + raptor_free_term(object_term); + } + + break; + + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PRESERVED: + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL: + { + unsigned char *buffer; + size_t length; + raptor_term* xmlliteral_term = NULL; + + if(rdf_xml_parser->xml_writer) { + raptor_xml_writer_flush(rdf_xml_parser->xml_writer); + + raptor_free_iostream(rdf_xml_parser->iostream); + rdf_xml_parser->iostream = NULL; + + buffer = (unsigned char*)rdf_xml_parser->xml_content; + length = rdf_xml_parser->xml_content_length; + } else { + buffer = raptor_stringbuffer_as_string(xml_element->content_cdata_sb); + length = xml_element->content_cdata_length; + } + + if(!raptor_unicode_check_utf8_nfc_string(buffer, length)) { + raptor_log_level l; + + raptor_rdfxml_update_document_locator(rdf_parser); + l = (RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NON_NFC_FATAL)) ? RAPTOR_LOG_LEVEL_ERROR : + RAPTOR_LOG_LEVEL_WARN; + + raptor_parser_log_error(rdf_parser, l, + "Property element '%s' has XML literal content not in Unicode Normal Form C: %s", + el_name, buffer); + } + + xmlliteral_term = raptor_new_term_from_literal(rdf_parser->world, + buffer, + RAPTOR_RDF_XMLLiteral_URI(rdf_parser->world), + NULL); + + if(state == RAPTOR_STATE_MEMBER_PROPERTYELT) { + raptor_uri* predicate_uri; + + element->parent->last_ordinal++; + predicate_uri = raptor_new_uri_from_rdf_ordinal(rdf_parser->world, element->parent->last_ordinal); + + raptor_rdfxml_generate_statement(rdf_parser, + element->parent->subject, + predicate_uri, + xmlliteral_term, + element->reified, + element->parent); + + raptor_free_uri(predicate_uri); + } else { + raptor_rdfxml_generate_statement(rdf_parser, + element->parent->subject, + element_name_uri, + xmlliteral_term, + element->reified, + element->parent); + } + + raptor_free_term(xmlliteral_term); + + /* Finish the xml writer iostream for parseType="Literal" */ + if(rdf_xml_parser->xml_writer) { + raptor_free_xml_writer(rdf_xml_parser->xml_writer); + rdf_xml_parser->xml_writer = NULL; + RAPTOR_FREE(char*, rdf_xml_parser->xml_content); + rdf_xml_parser->xml_content = NULL; + rdf_xml_parser->xml_content_length = 0; + } + } + + break; + + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_COLLECTION: + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_DAML_COLLECTION: + + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_NODES: + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES: + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT: + + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_UNKNOWN: + case RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LAST: + default: + raptor_parser_fatal_error(rdf_parser, + "%s: Internal error in state RAPTOR_STATE_PROPERTYELT - got unexpected content type %s (%u)", + __FUNCTION__, + raptor_rdfxml_element_content_type_as_string(element->content_type), + element->content_type); + } /* end switch */ + + finished = 1; + break; + + case RAPTOR_STATE_INVALID: + default: + raptor_parser_fatal_error(rdf_parser, + "%s: Internal error - unexpected parser state %u - %s", + __FUNCTION__, + state, + raptor_rdfxml_state_as_string(state)); + finished = 1; + + } /* end switch */ + + if(state != element->state) { + element->state = state; +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG3("Moved to state %d - %s\n", state, + raptor_rdfxml_state_as_string(state)); +#endif + } + + } /* end while */ + +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG2("Ending in state %s\n", raptor_rdfxml_state_as_string(state)); +#endif + + return; + + oom: + raptor_parser_fatal_error(rdf_parser, "Out of memory, skipping"); + element->state = RAPTOR_STATE_SKIPPING; +} + + + +static void +raptor_rdfxml_cdata_grammar(raptor_parser *rdf_parser, + const unsigned char *s, int len, + int is_cdata) +{ + raptor_rdfxml_parser* rdf_xml_parser; + raptor_rdfxml_element* element; + raptor_xml_element* xml_element; + raptor_state state; + int all_whitespace = 1; + int i; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + if(rdf_parser->failed) + return; + +#ifdef RAPTOR_DEBUG_CDATA + RAPTOR_DEBUG2("Adding characters (is_cdata=%d): '", is_cdata); + (void)fwrite(s, 1, len, stderr); + fprintf(stderr, "' (%d bytes)\n", len); +#endif + + for(i = 0; i < len; i++) + if(!isspace(s[i])) { + all_whitespace = 0; + break; + } + + element = rdf_xml_parser->current_element; + + /* this file is very broke - probably not XML, whatever */ + if(!element) + return; + + xml_element = element->xml_element; + + raptor_rdfxml_update_document_locator(rdf_parser); + + /* cdata never changes the parser state + * and the containing element state always determines what to do. + * Use the child_state first if there is one, since that applies + */ + state = element->child_state; +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG2("Working in state %s\n", raptor_rdfxml_state_as_string(state)); +#endif + + +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG3("Content type %s (%d)\n", + raptor_rdfxml_element_content_type_as_string(element->content_type), + element->content_type); +#endif + + + + if(state == RAPTOR_STATE_SKIPPING) + return; + + if(state == RAPTOR_STATE_UNKNOWN) { + /* Ignore all cdata if still looking for RDF */ + if(RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_SCANNING)) + return; + + /* Ignore all whitespace cdata before first element */ + if(all_whitespace) + return; + + /* This probably will never happen since that would make the + * XML not be well-formed + */ + raptor_parser_warning(rdf_parser, "Character data before RDF element."); + } + + + if(element->child_content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTIES) { + /* If found non-whitespace content, move to literal content */ + if(!all_whitespace) + element->child_content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL; + } + + + if(!rdf_content_type_info[element->child_content_type].whitespace_significant) { + + /* Whitespace is ignored except for literal or preserved content types */ + if(all_whitespace) { +#ifdef RAPTOR_DEBUG_CDATA + RAPTOR_DEBUG2("Ignoring whitespace cdata inside element '%s'\n", + raptor_xml_element_get_name(element->parent->xml_element)->local_name); +#endif + return; + } + + if(xml_element->content_cdata_seen && xml_element->content_element_seen) { + raptor_qname* parent_el_name; + + parent_el_name = raptor_xml_element_get_name(element->parent->xml_element); + /* Uh oh - mixed content, this element has elements too */ + raptor_parser_warning(rdf_parser, "element '%s' has mixed content.", + parent_el_name->local_name); + } + } + + + if(element->content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_PROPERTY_CONTENT) { + element->content_type = RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_LITERAL; +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG3("Content type changed to %s (%d)\n", + raptor_rdfxml_element_content_type_as_string(element->content_type), + element->content_type); +#endif + } + + if(element->child_content_type == RAPTOR_RDFXML_ELEMENT_CONTENT_TYPE_XML_LITERAL) + raptor_xml_writer_cdata_counted(rdf_xml_parser->xml_writer, s, len); + else { + raptor_stringbuffer_append_counted_string(xml_element->content_cdata_sb, + s, len, 1); + element->content_cdata_all_whitespace &= all_whitespace; + + /* adjust stored length */ + xml_element->content_cdata_length += len; + } + + +#ifdef RAPTOR_DEBUG_CDATA + RAPTOR_DEBUG3("Content cdata now: %d bytes\n", + xml_element->content_cdata_length); +#endif +#ifdef RAPTOR_DEBUG_VERBOSE + RAPTOR_DEBUG2("Ending in state %s\n", raptor_rdfxml_state_as_string(state)); +#endif +} + + + +/** + * raptor_rdfxml_inscope_base_uri: + * @rdf_parser: Raptor parser object + * + * Return the in-scope base URI. + * + * Looks for the innermost xml:base on an element or document URI + * + * Return value: The URI string value or NULL on failure. + **/ +static raptor_uri* +raptor_rdfxml_inscope_base_uri(raptor_parser *rdf_parser) +{ + raptor_rdfxml_parser* rdf_xml_parser; + raptor_uri* base_uri; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + base_uri = raptor_sax2_inscope_base_uri(rdf_xml_parser->sax2); + if(!base_uri) + base_uri = rdf_parser->base_uri; + + return base_uri; +} + + +/** + * raptor_rdfxml_record_ID: + * @rdf_parser: Raptor parser object + * @element: Current element + * @id: ID string + * + * Record an rdf:ID / rdf:bagID value (with xml base) and check it hasn't been seen already. + * + * Record and check the ID values, if they have been seen already. + * per in-scope-base URI. + * + * Return value: non-zero if already seen, or failure + **/ +static int +raptor_rdfxml_record_ID(raptor_parser *rdf_parser, + raptor_rdfxml_element *element, + const unsigned char *id) +{ + raptor_rdfxml_parser *rdf_xml_parser; + raptor_uri* base_uri; + size_t id_len; + int rc; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + if(!RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_CHECK_RDF_ID)) + return 0; + + base_uri = raptor_rdfxml_inscope_base_uri(rdf_parser); + + id_len = strlen((const char*)id); + + rc = raptor_id_set_add(rdf_xml_parser->id_set, base_uri, id, id_len); + + return (rc != 0); +} + + + +static void +raptor_rdfxml_update_document_locator(raptor_parser *rdf_parser) +{ + raptor_rdfxml_parser *rdf_xml_parser; + + rdf_xml_parser = (raptor_rdfxml_parser*)rdf_parser->context; + + raptor_sax2_update_document_locator(rdf_xml_parser->sax2, + &rdf_parser->locator); +} + + + +static void +raptor_rdfxml_parse_finish_factory(raptor_parser_factory* factory) +{ +} + + +static const char* const rdfxml_names[3] = { "rdfxml", "raptor", NULL}; + +static const char* const rdfxml_uri_strings[3] = { + "http://www.w3.org/ns/formats/RDF_XML", + "http://www.w3.org/TR/rdf-syntax-grammar", + NULL +}; + +#define RDFXML_TYPES_COUNT 2 +static const raptor_type_q rdfxml_types[RDFXML_TYPES_COUNT + 1] = { + { "application/rdf+xml", 19, 10}, + { "text/rdf", 8, 6}, + { NULL, 0, 0} +}; + +static int +raptor_rdfxml_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = rdfxml_names; + + factory->desc.mime_types = rdfxml_types; + + factory->desc.label = "RDF/XML"; + factory->desc.uri_strings = rdfxml_uri_strings; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_rdfxml_parser); + + factory->init = raptor_rdfxml_parse_init; + factory->terminate = raptor_rdfxml_parse_terminate; + factory->start = raptor_rdfxml_parse_start; + factory->chunk = raptor_rdfxml_parse_chunk; + factory->finish_factory = raptor_rdfxml_parse_finish_factory; + factory->recognise_syntax = raptor_rdfxml_parse_recognise_syntax; + + return rc; +} + + +int +raptor_init_parser_rdfxml(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_rdfxml_parser_register_factory); +} + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 +void +raptor_rdfxml_parser_stats_print(raptor_rdfxml_parser* rdf_xml_parser, + FILE *stream) +{ + fputs("rdf:ID set ", stream); + raptor_id_set_stats_print(rdf_xml_parser->id_set, stream); +} +#endif diff --git a/src/raptor_rfc2396.c b/src/raptor_rfc2396.c new file mode 100644 index 0000000..89183d9 --- /dev/null +++ b/src/raptor_rfc2396.c @@ -0,0 +1,881 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_rfc2396.c - Raptor URI resolving from RFC2396 and RFC3986 + * + * Copyright (C) 2004-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifndef STANDALONE + +/** + * raptor_new_uri_detail: + * @uri_string: The URI string to split + * + * Create a URI detailed structure from a URI string. + * + **/ +raptor_uri_detail* +raptor_new_uri_detail(const unsigned char *uri_string) +{ + const unsigned char *s = NULL; + unsigned char *b = NULL; + raptor_uri_detail *ud; + size_t uri_len; + + if(!uri_string) + return NULL; + + uri_len = strlen((const char*)uri_string); + + /* The extra +5 is for the 5 \0s that may be added for each component + * even if the entire URI is empty + */ + ud = RAPTOR_CALLOC(raptor_uri_detail*, 1, sizeof(*ud) + uri_len + 5 + 1); + if(!ud) + return NULL; + ud->uri_len = uri_len; + ud->buffer = (unsigned char*)((unsigned char*)ud + sizeof(raptor_uri_detail)); + + s = uri_string; + b = ud->buffer; + + + /* Split the URI into it's syntactic components */ + + /* + * scheme is checked in more detail since it is important + * to recognise absolute URIs for resolving, and it is easy to do. + * + * scheme = alpha *( alpha | digit | "+" | "-" | "." ) + * RFC 2396 section 3.1 Scheme Component + */ + if(*s && isalpha((int)*s)) { + s++; + + while(*s && (isalnum((int)*s) || + (*s == '+') || (*s == '-') || (*s == '.'))) + s++; + + if(*s == ':') { + /* it matches the URI scheme grammar, so store this as a scheme */ + ud->scheme = b; + ud->scheme_len = s-uri_string; + + while(*uri_string != ':') + *b++ = *uri_string++; + + *b++ = '\0'; + + /* and move past the : */ + s++; + } else + s = uri_string; + } + + + /* authority */ + if(*s && s[1] && *s == '/' && s[1] == '/') { + ud->authority = b; + + s += 2; /* skip "//" */ + + while(*s && *s != '/' && *s != '?' && *s != '#') + *b++ = *s++; + + ud->authority_len = b-ud->authority; + + *b++ = '\0'; + } + + + /* path */ + if(*s && *s != '?' && *s != '#') { + ud->path = b; + + while(*s && *s != '?' && *s != '#') + *b++ = *s++; + + ud->path_len = b-ud->path; + + *b++ = '\0'; + } + + + /* query */ + if(*s && *s == '?') { + ud->query = b; + + s++; + + while(*s && *s != '#') + *b++ = *s++; + + ud->query_len = b-ud->query; + + *b++ = '\0'; + } + + + /* fragment identifier - RFC2396 Section 4.1 */ + if(*s && *s == '#') { + ud->fragment = b; + + s++; + + while(*s) + *b++ = *s++; + + ud->fragment_len = b-ud->fragment; + + *b='\0'; + } + + ud->is_hierarchical = (ud->path && *ud->path == '/'); + + return ud; +} + + +void +raptor_free_uri_detail(raptor_uri_detail* uri_detail) +{ + /* Also frees the uri_detail->buffer allocated in raptor_uri_parse() */ + RAPTOR_FREE(raptor_uri_detail, uri_detail); +} + + +unsigned char* +raptor_uri_detail_to_string(raptor_uri_detail *ud, size_t* len_p) +{ + size_t len = 0; + unsigned char *buffer, *p; + + if(ud->scheme) + len+= ud->scheme_len+1; /* : */ + if(ud->authority) + len+= 2 + ud->authority_len; /* // */ + if(ud->path) + len+= ud->path_len; + if(ud->fragment) + len+= 1 + ud->fragment_len; /* # */ + if(ud->query) + len+= 1 + ud->query_len; /* ? */ + + if(len_p) + *len_p=len; + + buffer = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!buffer) + return NULL; + + p = buffer; + + if(ud->scheme) { + unsigned char *src = ud->scheme; + while(*src) + *p++ = *src++; + *p++ = ':'; + } + if(ud->authority) { + unsigned char *src = ud->authority; + *p++ = '/'; + *p++ = '/'; + while(*src) + *p++ = *src++; + } + if(ud->path) { + unsigned char *src = ud->path; + while(*src) + *p++ = *src++; + } + if(ud->fragment) { + unsigned char *src = ud->fragment; + *p++ = '#'; + while(*src) + *p++ = *src++; + } + if(ud->query) { + unsigned char *src = ud->query; + *p++ = '?'; + while(*src) + *p++ = *src++; + } + *p='\0'; + + return buffer; +} + + +/* + * raptor_uri_normalize_path: + * @path_buffer: URI/file path + * @path_len: length of above + * + * INTERNAL - normalize a URI path (POSIX path too) + * + * Return value: new path length or 0 on failure + */ +size_t +raptor_uri_normalize_path(unsigned char* path_buffer, size_t path_len) +{ + unsigned char *p, *cur, *prev, *s; + unsigned char last_char; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + RAPTOR_DEBUG3("Input path \"%s\" (%zu)\n", (const char*)path_buffer, path_len); +#endif + + /* remove all "./" path components */ + for(p = (prev = path_buffer); *p; p++) { + if(*p != '/') + continue; + + if(p == (prev+1) && *prev == '.') { + unsigned char *dest = prev; + + p++; + while(*p) + *dest++ = *p++; + *dest= '\0'; + + p = prev; + path_len -= 2; + if(!*p) + break; + } else { + prev = p+1; + } + } + + if(p == (prev+1) && *prev == '.') { + /* Remove "." at the end of a path */ + *prev = '\0'; + path_len--; + } + + +#if defined(RAPTOR_DEBUG) + if(path_len != strlen((const char*)path_buffer)) + RAPTOR_FATAL4("Path '%s' length %ld does not match calculated %ld.", (const char*)path_buffer, (long)strlen((const char*)path_buffer), (long)path_len); +#endif + + /* Remove all "/../" path components */ + + /* + * The pointers: + * /../ + * prev-^ cur-^ + * and p points to the previous prev (can be NULL) + */ + prev = NULL; + cur = NULL; + p = NULL; + last_char='\0'; + + for(s = path_buffer; *s; last_char=*s++) { + + /* find the path components */ + if(*s != '/') { + /* If it is the start or following a /, record a new path component */ + if(!last_char || last_char == '/') { + /* Store 2 path components */ + if(!prev) + prev = s; + else if(!cur) + cur = s; + } + continue; + } + + + /* Wait till there are two path components */ + if(!prev || !cur) + continue; + +#if defined(RAPTOR_DEBUG) + if(path_len != strlen((const char*)path_buffer)) + RAPTOR_FATAL3("Path length %ld does not match calculated %ld.", (long)strlen((const char*)path_buffer), (long)path_len); +#endif + + /* If the current one is '..' */ + if(s == (cur+2) && cur[0] == '.' && cur[1] == '.') { + + /* and if the previous one isn't '..' + * (which means it is beyond the root such as a path "/foo/../..") + */ + if(cur != (prev+3) || prev[0] != '.' || prev[1] != '.') { + unsigned char *dest = prev; + + /* remove the /../ + * prev-^ cur-^ ^-s + */ + size_t len = s-prev+1; /* length of path component we are removing */ + + s++; + while(*s) + *dest++ = *s++; + *dest = '\0'; + path_len -= len; + + if(p && p < prev) { + /* We know the previous prev path component and we didn't do + * two adjustments in a row, so can adjust the + * pointers to continue the newly shortened path: + * s to the / before (autoincremented by the loop) + * prev to the previous prev path component + * cur to NULL. Will be set by the next loop iteration since s + * points to a '/', last_char will be set to *s. */ + s = prev-1; + prev = p; + cur = NULL; + p = NULL; + } else { + /* Otherwise must start from the beginning again */ + prev = NULL; + cur = NULL; + p = NULL; + s = path_buffer; + } + + } + + } else { + /* otherwise this is not a special path component so + * shift the path components stack + */ + p = prev; + prev = cur; + cur = NULL; + } + + } + + + if(prev && s == (cur+2) && cur[0] == '.' && cur[1] == '.') { + /* Remove /.. at the end of the path */ + *prev = '\0'; + path_len -= (s-prev); + } + + +#if defined(RAPTOR_DEBUG) + if(path_len != strlen((const char*)path_buffer)) + RAPTOR_FATAL3("Path length %ld does not match calculated %ld.", (long)strlen((const char*)path_buffer), (long)path_len); +#endif + + /* RFC3986 Appendix C.2 / 5.4.2 Abnormal Examples + * Remove leading /../ and /./ + */ + for(p = path_buffer; p; ) { + if(!strncmp((const char *)p, "/../", 4)) { + path_len -= 3; + memmove(p, p+3, path_len+1); + } else if(!strncmp((const char *)p, "/./", 3)) { + path_len -= 2; + memmove(p, p+2, path_len+1); + } else + break; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + fprintf(stderr, " Normalized path \"%s\" (%zu)\n", path_buffer, path_len); +#endif + + return path_len; +} + + + +/** + * raptor_uri_resolve_uri_reference: + * @base_uri: Base URI string + * @reference_uri: Reference URI string + * @buffer: Destination URI output buffer + * @length: Length of destination output buffer + * + * Resolve a URI against a base URI to create a new absolute URI. + * + * Return value: length of resolved string or 0 on failure (such as @buffer too small) + **/ +size_t +raptor_uri_resolve_uri_reference(const unsigned char *base_uri, + const unsigned char *reference_uri, + unsigned char *buffer, size_t length) +{ + raptor_uri_detail *ref = NULL; + raptor_uri_detail *base = NULL; + raptor_uri_detail result; /* static - pointers go to inside ref or base */ + unsigned char *path_buffer = NULL; + unsigned char *p; + size_t result_len = 0; + size_t l; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + RAPTOR_DEBUG4("base uri='%s', reference_uri='%s, buffer size %d\n", + (base_uri ? (const char*)base_uri : "NULL"), + (reference_uri ? (const char*)reference_uri : "NULL"), + (int)length); +#endif + + *buffer = '\0'; + memset(&result, 0, sizeof(result)); + + ref = raptor_new_uri_detail(reference_uri); + if(!ref) + goto resolve_tidy; + + + /* is reference URI "" or "#frag"? */ + if(!ref->scheme && !ref->authority && !ref->path && !ref->query) { + unsigned char c; + + /* Copy base URI to result up to '\0' or '#' */ + for(p = buffer, l = length; + (c = *base_uri) && c != '#' && l; + p++, base_uri++, l--) + *p = c; + + if(!l) { + result_len = 0; + goto resolve_tidy; + } + *p = '\0'; + + if(ref->fragment) { + unsigned char *src = ref->fragment; + /* Append any fragment */ + *p++ = '#'; + while(*src && l) { + *p++ = *src++; + l--; + } + if(!l) { + result_len = 0; + goto resolve_tidy; + } + *p = '\0'; + } + + result_len = p - buffer; + goto resolve_tidy; + } + + /* reference has a scheme - is an absolute URI */ + if(ref->scheme) { + /* Copy over schema and authority */ + result.scheme = ref->scheme; + result.scheme_len = ref->scheme_len; + result.authority = ref->authority; + result.authority_len = ref->authority_len; + + /* Allocate path so it can be normalized below */ + result.path_len = ref->path_len; + path_buffer = RAPTOR_MALLOC(unsigned char*, result.path_len + 1); + if(!path_buffer) { + result_len = 0; + goto resolve_tidy; + } + if(ref->path_len) + memcpy(path_buffer, ref->path, ref->path_len); + path_buffer[result.path_len] = '\0'; + result.path = path_buffer; + + goto normalize; + } + + + /* now the reference URI must be schemeless, i.e. relative */ + base = raptor_new_uri_detail(base_uri); + if(!base) + goto resolve_tidy; + + /* result URI must be of the base URI scheme */ + result.scheme = base->scheme; + result.scheme_len = base->scheme_len; + + /* an authority is given ( [user:pass@]hostname[:port] for http) + * so the reference URI is like //authority + */ + if(ref->authority) { + result.authority = ref->authority; + result.authority_len = ref->authority_len; + result.path = ref->path; + result.path_len = ref->path_len; + goto resolve_end; + } + + /* no - so now we have path (maybe with query, fragment) relative to base */ + result.authority = base->authority; + result.authority_len = base->authority_len; + + + if(ref->is_hierarchical || !base->is_hierarchical) { + /* if the reference path is absolute OR the base URI + * is a non-hierarchical URI then just copy the reference path + * to the result and normalize. + */ + path_buffer = RAPTOR_MALLOC(unsigned char*, ref->path_len + 1); + if(!path_buffer) { + result_len = 0; + goto resolve_tidy; + } + result.path = path_buffer; + result.path_len = ref->path_len; + if(ref->path) + memcpy(path_buffer, ref->path, result.path_len); + path_buffer[result.path_len] = '\0'; + goto normalize; + } + + + /* need to resolve relative path */ + + /* Build the result path in path_buffer */ + result.path_len = 0; + + if(base->path) + result.path_len += base->path_len; + else { + /* Add a missing path - makes the base URI 1 character longer */ + base->path = (unsigned char*)"/"; /* static, but copied and not free()d */ + base->path_len = 1; + base->uri_len++; + result.path_len++; + } + + if(ref->path) + result.path_len += ref->path_len; + + /* the resulting path can be no longer than result.path_len */ + path_buffer = RAPTOR_MALLOC(unsigned char*, result.path_len + 1); + if(!path_buffer) { + result_len = 0; + goto resolve_tidy; + } + result.path = path_buffer; + *path_buffer = '\0'; + + if(!ref->path) { + /* If there is no reference path, copy the full base over */ + result.path_len = base->path_len; + memcpy(path_buffer, base->path, result.path_len); + } else { + /** Otherwise copy base path up to previous / and append ref path */ + for(p = base->path + base->path_len - 1; p > base->path && *p != '/'; p--) + ; + + if(p >= base->path) { + result.path_len = p-base->path + 1; + + /* Found a /, copy everything before that to path_buffer */ + memcpy(path_buffer, base->path, result.path_len); + path_buffer[result.path_len] = '\0'; + } + + memcpy(path_buffer + result.path_len, ref->path, ref->path_len + 1); + result.path_len += ref->path_len; + } + path_buffer[result.path_len] = '\0'; + + normalize: + + result.path_len = raptor_uri_normalize_path(path_buffer, result.path_len); + + resolve_end: + + if(ref->query) { + result.query = ref->query; + result.query_len = ref->query_len; + } + + if(ref->fragment) { + result.fragment = ref->fragment; + result.fragment_len = ref->fragment_len; + } + + l = 0; + if(result.scheme) + l = result.scheme_len + 1; + if(result.authority) + l += 2 + result.authority_len; + if(result.path) + l += result.path_len; + if(result.query) + l += 1 + result.query_len; + if(result.fragment) + l += 1 + result.fragment_len; + + if(l > length) { + /* Output buffer is too small */ + result_len = 0; + goto resolve_tidy; + } + + p = buffer; + if(result.scheme) { + memcpy(p, result.scheme, result.scheme_len); + p += result.scheme_len; + *p++ = ':'; + } + + if(result.authority) { + *p++ = '/'; + *p++ = '/'; + memcpy(p, result.authority, result.authority_len); + p+= result.authority_len; + } + + if(result.path) { + memcpy(p, result.path, result.path_len); + p+= result.path_len; + } + + if(result.query) { + *p++ = '?'; + memcpy(p, result.query, result.query_len); + p+= result.query_len; + } + + if(result.fragment) { + *p++ = '#'; + memcpy(p, result.fragment, result.fragment_len); + p+= result.fragment_len; + } + *p = '\0'; + + result_len = p - buffer; + + resolve_tidy: + if(path_buffer) + RAPTOR_FREE(char*, path_buffer); + if(base) + raptor_free_uri_detail(base); + if(ref) + raptor_free_uri_detail(ref); + +#ifdef RAPTOR_DEBUG + RAPTOR_ASSERT(result_len && strlen((const char*)buffer) != result_len, + "URI string is not declared length"); +#endif + + return result_len; +} + +#endif + + + +#ifdef STANDALONE + +#include + +/* one more prototype */ +int main(int argc, char *argv[]); + +static const char *program; + + +static int +check_resolve(const char *base_uri, const char *reference_uri, + const char *result_uri) +{ + unsigned char buffer[1024]; + + raptor_uri_resolve_uri_reference((const unsigned char*)base_uri, + (const unsigned char*)reference_uri, + buffer, sizeof(buffer)); + + if(strcmp((const char*)buffer, result_uri)) { + fprintf(stderr, + "%s: raptor_uri_resolve_uri_reference(%s, %s) FAILED giving '%s' != '%s'\n", + program, base_uri, reference_uri, + buffer, result_uri); + return 1; + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + fprintf(stderr, + "%s: raptor_uri_resolve_uri_reference(%s, %s) OK giving '%s'\n", + program, base_uri, reference_uri, + buffer); +#endif + return 0; +} + + +static int +check_parses(const char *uri_string) { + raptor_uri_detail* ud; + ud = raptor_new_uri_detail((unsigned const char*)uri_string); + if(!ud) { + fprintf(stderr, "%s: raptor_new_uri_detail(%s) FAILED to parse\n", + program, uri_string); + return 1; + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + fprintf(stderr, "%s: raptor_new_uri_detail(%s) OK\n", + program, uri_string); +#endif + raptor_free_uri_detail(ud); + return 0; +} + + +int +main(int argc, char *argv[]) +{ + const char *base_uri="http://example.org/bpath/cpath/d;p?querystr#frag"; + int failures = 0; + + program = raptor_basename(argv[0]); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Using base URI '%s'\n", program, base_uri); +#endif + + /* Tests from RFC2396 Appendix C + * and RFC3986 Section 5 + * + * Modifications: + * - add 'path' when items are path components to make easier to read + * - use example.org instead of 'a' for the authority + * - results are against the base_uri above + */ + + /* Appendix C.1 / 5.4.1 Normal Examples */ + failures += check_resolve(base_uri, "g:h", "g:h"); + failures += check_resolve(base_uri, "gpath", "http://example.org/bpath/cpath/gpath"); + failures += check_resolve(base_uri, "./gpath", "http://example.org/bpath/cpath/gpath"); + failures += check_resolve(base_uri, "gpath/", "http://example.org/bpath/cpath/gpath/"); + failures += check_resolve(base_uri, "/gpath", "http://example.org/gpath"); + failures += check_resolve(base_uri, "//gpath", "http://gpath"); + failures += check_resolve(base_uri, "?y", "http://example.org/bpath/cpath/d;p?y"); + failures += check_resolve(base_uri, "gpath?y", "http://example.org/bpath/cpath/gpath?y"); + failures += check_resolve(base_uri, "#s", "http://example.org/bpath/cpath/d;p?querystr#s"); + failures += check_resolve(base_uri, "gpath#s", "http://example.org/bpath/cpath/gpath#s"); + failures += check_resolve(base_uri, "gpath?y#s", "http://example.org/bpath/cpath/gpath?y#s"); + failures += check_resolve(base_uri, ";x", "http://example.org/bpath/cpath/;x"); + failures += check_resolve(base_uri, "gpath;x", "http://example.org/bpath/cpath/gpath;x"); + failures += check_resolve(base_uri, "gpath;x?y#s", "http://example.org/bpath/cpath/gpath;x?y#s"); + failures += check_resolve(base_uri, ".", "http://example.org/bpath/cpath/"); + failures += check_resolve(base_uri, "./", "http://example.org/bpath/cpath/"); + failures += check_resolve(base_uri, "..", "http://example.org/bpath/"); + failures += check_resolve(base_uri, "../", "http://example.org/bpath/"); + failures += check_resolve(base_uri, "../gpath", "http://example.org/bpath/gpath"); + failures += check_resolve(base_uri, "../..", "http://example.org/"); + failures += check_resolve(base_uri, "../../", "http://example.org/"); + failures += check_resolve(base_uri, "../../gpath", "http://example.org/gpath"); + + + /* Appendix C.2 / 5.4.2 Abnormal Examples */ + failures += check_resolve(base_uri, "", "http://example.org/bpath/cpath/d;p?querystr"); /* This is a Normal Example in RFC 3986 */ + + failures += check_resolve(base_uri, "../../../gpath", "http://example.org/gpath"); /* RFC 3986 changed the answer here */ + failures += check_resolve(base_uri, "../../../../gpath", "http://example.org/gpath"); /* RFC 3986 changed the answer here */ + + failures += check_resolve(base_uri, "/./gpath", "http://example.org/gpath"); /* RFC 3986 changed the answer here */ + failures += check_resolve(base_uri, "/../gpath", "http://example.org/gpath"); /* RFC 3986 changed the answer here */ + failures += check_resolve(base_uri, "gpath.", "http://example.org/bpath/cpath/gpath."); + failures += check_resolve(base_uri, ".gpath", "http://example.org/bpath/cpath/.gpath"); + failures += check_resolve(base_uri, "gpath..", "http://example.org/bpath/cpath/gpath.."); + failures += check_resolve(base_uri, "..gpath", "http://example.org/bpath/cpath/..gpath"); + + failures += check_resolve(base_uri, "./../gpath", "http://example.org/bpath/gpath"); + failures += check_resolve(base_uri, "./gpath/.", "http://example.org/bpath/cpath/gpath/"); + failures += check_resolve(base_uri, "gpath/./hpath", "http://example.org/bpath/cpath/gpath/hpath"); + failures += check_resolve(base_uri, "gpath/../hpath", "http://example.org/bpath/cpath/hpath"); + failures += check_resolve(base_uri, "gpath;x = 1/./y", "http://example.org/bpath/cpath/gpath;x = 1/y"); + failures += check_resolve(base_uri, "gpath;x = 1/../y", "http://example.org/bpath/cpath/y"); + + failures += check_resolve(base_uri, "gpath?y/./x", "http://example.org/bpath/cpath/gpath?y/./x"); + failures += check_resolve(base_uri, "gpath?y/../x", "http://example.org/bpath/cpath/gpath?y/../x"); + failures += check_resolve(base_uri, "gpath#s/./x", "http://example.org/bpath/cpath/gpath#s/./x"); + failures += check_resolve(base_uri, "gpath#s/../x", "http://example.org/bpath/cpath/gpath#s/../x"); + + /* RFC 3986 makes this the strict answer but also allows + * http://example.org/bpath/cpath/gauthority + * for backward compatibility + */ + failures += check_resolve(base_uri, "http:gauthority", "http:gauthority"); + + + /* Examples from 1.3 */ + failures += check_parses("ftp://ftp.is.co.za/rfc/rfc1808.txt"); + failures += check_parses("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles"); + failures += check_parses("http://www.math.uio.no/faq/compression-faq/part1.html"); + failures += check_parses("mailto:mduerst@ifi.unizh.ch"); + failures += check_parses("news:comp.infosystems.www.servers.unix"); + failures += check_parses("telnet://melvyl.ucop.edu/"); + failures += check_parses(""); + + /* This is a not-crashing test */ + raptor_new_uri_detail(NULL); + + /* Extra checks not in RFC2396 */ + + /* RDF xml:base check that fragments and query strings are removed */ + failures += check_resolve(base_uri, "gpath/../../../hpath", "http://example.org/hpath"); + + /* RFC3986 changed the answer to this test + * Was "RDF xml:base check that extra ../ are not lost" + * with answer "http://example.org/../../../absfile" + */ + failures += check_resolve("http://example.org/dir/file", "../../../absfile", "http://example.org/absfile"); + + /* RDF xml:base check that an absolute URI replaces */ + failures += check_resolve("http://example.org/dir/file", "http://another.example.org/dir2/file2", "http://another.example.org/dir2/file2"); + + /* base URI and relative URI with no absolute path works */ + failures += check_resolve("foo:", "not_scheme:blah", "foo:not_scheme:blah"); + + /* Issue#000177 http://bugs.librdf.org/mantis/view.php?id=177 */ + failures += check_resolve("foo:1234", "9999", "foo:9999"); + + /* RDFa 1.1 test 0114 */ + failures += check_resolve("http://example.org/file", + "?foo=bar../baz", + "http://example.org/file?foo=bar../baz"); + + /* BUG 556 - http://bugs.librdf.org/mantis/view.php?id=556 */ + failures += check_resolve("http://example.com/folder1/folder2/", + "http://example.com/folder1/folder2/../folder1/../entity1", + "http://example.com/folder1/entity1"); + + return failures; +} + +#endif diff --git a/src/raptor_rss.c b/src/raptor_rss.c new file mode 100644 index 0000000..ebbbbbb --- /dev/null +++ b/src/raptor_rss.c @@ -0,0 +1,1733 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_rss.c - Raptor Feeds (RSS and Atom) tag soup parser + * + * Copyright (C) 2003-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#ifdef HAVE_STRINGS_H +#include +#endif +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif + + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" +#include "raptor_rss.h" + + +/* local prototypes */ + +static void raptor_rss_uplift_items(raptor_parser* rdf_parser); +static int raptor_rss_emit(raptor_parser* rdf_parser); + +static void raptor_rss_start_element_handler(void *user_data, raptor_xml_element* xml_element); +static void raptor_rss_end_element_handler(void *user_data, raptor_xml_element* xml_element); +static void raptor_rss_cdata_handler(void *user_data, raptor_xml_element* xml_element, const unsigned char *s, int len); +static void raptor_rss_comment_handler(void *user_data, raptor_xml_element* xml_element, const unsigned char *s); +static void raptor_rss_sax2_new_namespace_handler(void *user_data, raptor_namespace* nspace); + +/* + * RSS parser object + */ +struct raptor_rss_parser_s { + /* static model */ + raptor_rss_model model; + + /* current line */ + char *line; + /* current line length */ + int line_length; + /* current char in line buffer */ + int offset; + + /* static statement for use in passing to user code */ + raptor_statement statement; + + raptor_sax2 *sax2; + + /* rss node type of current CONTAINER item */ + raptor_rss_type current_type; + + /* one place stack */ + raptor_rss_type prev_type; + raptor_rss_fields_type current_field; + + /* emptyness of current element */ + int element_is_empty; + + /* stack of namespaces */ + raptor_namespace_stack *nstack; + + /* non-0 if this is an atom 1.0 parser */ + int is_atom; + + /* namespaces declared here */ + raptor_namespace* nspaces[RAPTOR_RSS_NAMESPACES_SIZE]; + + /* namespaces seen during parsing or creating output model */ + char nspaces_seen[RAPTOR_RSS_NAMESPACES_SIZE]; + + /* current BLOCK pointer (inside CONTAINER of type current_type) */ + raptor_rss_block *current_block; +}; + +typedef struct raptor_rss_parser_s raptor_rss_parser; + + +typedef enum { + RAPTOR_RSS_CONTENT_TYPE_NONE, + RAPTOR_RSS_CONTENT_TYPE_XML, + RAPTOR_RSS_CONTENT_TYPE_TEXT +} raptor_rss_content_type; + + +struct raptor_rss_element_s +{ + raptor_world* world; + + raptor_uri* uri; + + /* Two types of content */ + raptor_rss_content_type type; + + /* 1) XML */ + raptor_xml_writer* xml_writer; + /* XML written to this iostream to the xml_content string */ + raptor_iostream* iostream; + /* ends up here */ + void *xml_content; + size_t xml_content_length; + + /* 2) cdata */ + raptor_stringbuffer* sb; +}; + +typedef struct raptor_rss_element_s raptor_rss_element; + + +static void +raptor_free_rss_element(raptor_rss_element *rss_element) +{ + if(rss_element->uri) + raptor_free_uri(rss_element->uri); + if(rss_element->type == RAPTOR_RSS_CONTENT_TYPE_XML) { + if(rss_element->xml_writer) + raptor_free_xml_writer(rss_element->xml_writer); + if(rss_element->iostream) + raptor_free_iostream(rss_element->iostream); + if(rss_element->xml_content) + raptor_free_memory(rss_element->xml_content); + } + if(rss_element->sb) + raptor_free_stringbuffer(rss_element->sb); + + RAPTOR_FREE(raptor_rss_element, rss_element); +} + + +static int +raptor_rss_parse_init(raptor_parser* rdf_parser, const char *name) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + raptor_sax2* sax2; + int n; + + raptor_rss_common_init(rdf_parser->world); + + raptor_rss_model_init(rdf_parser->world, &rss_parser->model); + + rss_parser->prev_type = RAPTOR_RSS_NONE; + rss_parser->current_field = RAPTOR_RSS_FIELD_NONE; + rss_parser->current_type = RAPTOR_RSS_NONE; + rss_parser->current_block = NULL; + + if(rss_parser->sax2) { + raptor_free_sax2(rss_parser->sax2); + rss_parser->sax2 = NULL; + } + + rss_parser->nstack = raptor_new_namespaces(rdf_parser->world, 1); + + /* Initialise the namespaces */ + for(n = 0; n < RAPTOR_RSS_NAMESPACES_SIZE; n++) { + unsigned const char* prefix; + raptor_uri* uri; + raptor_namespace* nspace = NULL; + + prefix = (unsigned const char*)raptor_rss_namespaces_info[n].prefix; + uri = rdf_parser->world->rss_namespaces_info_uris[n]; + if(prefix && uri) + nspace = raptor_new_namespace_from_uri(rss_parser->nstack, + prefix, uri, 0); + rss_parser->nspaces[n] = nspace; + } + + sax2 = raptor_new_sax2(rdf_parser->world, &rdf_parser->locator, rdf_parser); + rss_parser->sax2 = sax2; + + raptor_sax2_set_start_element_handler(sax2, raptor_rss_start_element_handler); + raptor_sax2_set_end_element_handler(sax2, raptor_rss_end_element_handler); + raptor_sax2_set_characters_handler(sax2, raptor_rss_cdata_handler); + raptor_sax2_set_cdata_handler(sax2, raptor_rss_cdata_handler); + raptor_sax2_set_comment_handler(sax2, raptor_rss_comment_handler); + raptor_sax2_set_namespace_handler(sax2, raptor_rss_sax2_new_namespace_handler); + + raptor_statement_init(&rss_parser->statement, rdf_parser->world); + + return 0; +} + + +static void +raptor_rss_parse_terminate(raptor_parser *rdf_parser) +{ + raptor_rss_parser *rss_parser = (raptor_rss_parser*)rdf_parser->context; + int n; + + if(rss_parser->sax2) + raptor_free_sax2(rss_parser->sax2); + + raptor_rss_model_clear(&rss_parser->model); + + for(n = 0; n < RAPTOR_RSS_NAMESPACES_SIZE; n++) { + if(rss_parser->nspaces[n]) + raptor_free_namespace(rss_parser->nspaces[n]); + } + + if(rss_parser->nstack) + raptor_free_namespaces(rss_parser->nstack); + + raptor_rss_common_terminate(rdf_parser->world); +} + + +static int +raptor_rss_parse_start(raptor_parser *rdf_parser) +{ + raptor_uri *uri = rdf_parser->base_uri; + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + int n; + + /* base URI required for RSS */ + if(!uri) + return 1; + + for(n = 0; n < RAPTOR_RSS_NAMESPACES_SIZE; n++) + rss_parser->nspaces_seen[n] = 'N'; + + /* Optionally forbid internal network and file requests in the XML parser */ + raptor_sax2_set_option(rss_parser->sax2, + RAPTOR_OPTION_NO_NET, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NO_NET)); + raptor_sax2_set_option(rss_parser->sax2, + RAPTOR_OPTION_NO_FILE, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_NO_FILE)); + raptor_sax2_set_option(rss_parser->sax2, + RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(rdf_parser, RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES)); + if(rdf_parser->uri_filter) + raptor_sax2_set_uri_filter(rss_parser->sax2, rdf_parser->uri_filter, + rdf_parser->uri_filter_user_data); + + raptor_sax2_parse_start(rss_parser->sax2, uri); + + return 0; +} + + + +static int +raptor_rss_add_container(raptor_rss_parser *rss_parser, const char *name) +{ + raptor_rss_type type = RAPTOR_RSS_NONE; + + if(!strcmp(name, "rss") || !strcmp(name, "rdf") || !strcmp(name, "RDF")) { + /* rss */ + } else if(!raptor_strcasecmp(name, "channel")) { + /* rss or atom 0.3 channel */ + type = RAPTOR_RSS_CHANNEL; + } else if(!strcmp(name, "feed")) { + /* atom 1.0 feed */ + type = RAPTOR_RSS_CHANNEL; + rss_parser->is_atom = 1; + } else if(!strcmp(name, "item")) { + type = RAPTOR_RSS_ITEM; + } else if(!strcmp(name, "entry")) { + type = RAPTOR_RSS_ITEM; + rss_parser->is_atom = 1; + } else { + int i; + for(i = 0; i < RAPTOR_RSS_COMMON_SIZE; i++) { + if(!(raptor_rss_items_info[i].flags & RAPTOR_RSS_ITEM_CONTAINER)) + continue; + + if(!strcmp(name, raptor_rss_items_info[i].name)) { + /* rss and atom clash on the author name field (rss) or type (atom) */ + if(i != RAPTOR_ATOM_AUTHOR || + (i == RAPTOR_ATOM_AUTHOR && rss_parser->is_atom)) { + type = (raptor_rss_type)i; + break; + } + } + } + } + + if(type != RAPTOR_RSS_NONE) { + if(type == RAPTOR_RSS_ITEM) + raptor_rss_model_add_item(&rss_parser->model); + else + raptor_rss_model_add_common(&rss_parser->model, type); + + /* Inner container - push the current type onto a 1-place stack */ + if(rss_parser->current_type != RAPTOR_RSS_NONE) + rss_parser->prev_type = rss_parser->current_type; + + rss_parser->current_type = type; + } + + return (type == RAPTOR_RSS_NONE); +} + + +static raptor_uri* +raptor_rss_promote_namespace_uri(raptor_world *world, raptor_uri* nspace_URI) +{ + /* RSS 0.9 and RSS 1.1 namespaces => RSS 1.0 namespace */ + if((raptor_uri_equals(nspace_URI, + world->rss_namespaces_info_uris[RSS0_9_NS]) || + raptor_uri_equals(nspace_URI, + world->rss_namespaces_info_uris[RSS1_1_NS]))) { + nspace_URI = world->rss_namespaces_info_uris[RSS1_0_NS]; + } + + /* Atom 0.3 namespace => Atom 1.0 namespace */ + if(raptor_uri_equals(nspace_URI, + world->rss_namespaces_info_uris[ATOM0_3_NS])) { + nspace_URI = world->rss_namespaces_info_uris[ATOM1_0_NS]; + } + + return nspace_URI; +} + + + +static raptor_rss_item* +raptor_rss_get_current_item(raptor_rss_parser *rss_parser) +{ + raptor_rss_item* item; + + if(rss_parser->current_type == RAPTOR_RSS_ITEM) + item = rss_parser->model.last; + else + item = raptor_rss_model_get_common(&rss_parser->model, + rss_parser->current_type); + return item; +} + + +static int +raptor_rss_block_set_field(raptor_world *world, raptor_uri *base_uri, + raptor_rss_block *block, + const raptor_rss_block_field_info *bfi, + const char *string) +{ + int attribute_type = bfi->attribute_type; + int offset = bfi->offset; + if(attribute_type == RSS_BLOCK_FIELD_TYPE_URL) { + raptor_uri* uri; + uri = raptor_new_uri_relative_to_base(world, base_uri, + (const unsigned char*)string); + if(!uri) + return 1; + + block->urls[offset] = uri; + } else if(attribute_type == RSS_BLOCK_FIELD_TYPE_STRING) { + size_t len = strlen(string); + block->strings[offset] = RAPTOR_MALLOC(char*, len + 1); + if(!block->strings[offset]) + return 1; + + memcpy(block->strings[offset], string, len+1); + } else { +#ifdef RAPTOR_DEBUG + RAPTOR_FATAL2("Found unknown attribute_type %d\n", attribute_type); +#else + return 1; +#endif + } + + return 0; +} + + +static void +raptor_rss_start_element_handler(void *user_data, + raptor_xml_element* xml_element) +{ + raptor_parser *rdf_parser; + raptor_rss_parser *rss_parser; + raptor_rss_block *block = NULL; + raptor_uri* base_uri; + raptor_qname *el_qname; + const unsigned char *name; + int ns_attributes_count; + raptor_qname** named_attrs; + const raptor_namespace* el_nspace; + raptor_rss_element* rss_element; + int i; + + rdf_parser = (raptor_parser*)user_data; + rss_parser = (raptor_rss_parser*)rdf_parser->context; + + rss_element = RAPTOR_CALLOC(raptor_rss_element*, 1, sizeof(*rss_element)); + if(!rss_element) { + rdf_parser->failed = 1; + return; + } + + rss_element->world = rdf_parser->world; + rss_element->sb = raptor_new_stringbuffer(); + + xml_element->user_data = rss_element; + + if(xml_element->parent) { + raptor_rss_element* parent_rss_element; + parent_rss_element = (raptor_rss_element*)(xml_element->parent->user_data); + if(parent_rss_element->xml_writer) + rss_element->xml_writer = parent_rss_element->xml_writer; + } + + if(rss_element->xml_writer) { + raptor_xml_writer_start_element(rss_element->xml_writer, xml_element); + return; + } + + el_qname = raptor_xml_element_get_name(xml_element); + name = el_qname->local_name; + el_nspace = el_qname->nspace; + + named_attrs = raptor_xml_element_get_attributes(xml_element); + ns_attributes_count = raptor_xml_element_get_attributes_count(xml_element); + + base_uri = raptor_sax2_inscope_base_uri(rss_parser->sax2); + + + /* No container type - identify and record in rss_parser->current_type + * either as a top-level container or an inner-container */ + if(!raptor_rss_add_container(rss_parser, (const char*)name)) { +#ifdef RAPTOR_DEBUG + if(1) { + raptor_rss_type old_type = rss_parser->prev_type; + + if(old_type != rss_parser->current_type && old_type != RAPTOR_RSS_NONE) + RAPTOR_DEBUG5("FOUND inner container type %u - %s INSIDE current container type %u - %s\n", + rss_parser->current_type, + raptor_rss_items_info[rss_parser->current_type].name, + old_type, raptor_rss_items_info[old_type].name); + else + RAPTOR_DEBUG3("FOUND container type %u - %s\n", + rss_parser->current_type, + raptor_rss_items_info[rss_parser->current_type].name); + } +#endif + + /* check a few container attributes */ + if(named_attrs) { + raptor_rss_item* update_item = raptor_rss_get_current_item(rss_parser); + + for(i = 0; i < ns_attributes_count; i++) { + raptor_qname* attr = named_attrs[i]; + const char* attrName = (const char*)attr->local_name; + const unsigned char* attrValue = attr->value; + + RAPTOR_DEBUG3(" container attribute %s=%s\n", attrName, attrValue); + if(!strcmp(attrName, "about")) { + if(update_item) { + update_item->uri = raptor_new_uri(rdf_parser->world, attrValue); + update_item->term = raptor_new_term_from_uri(rdf_parser->world, + update_item->uri); + } + } + } + } + return; + } else if(rss_parser->current_type == RAPTOR_RSS_NONE) { + RAPTOR_DEBUG2("Unknown container element named %s\n", name); + /* Nothing more that can be done with unknown element - skip it */ + return; + } + + + /* have container (current_type) so this element is inside it is either: + * 1. a metadata block element (such as rss:enclosure) + * 2. a field (such as atom:title) + */ + + /* Find field ID */ + rss_parser->current_field = RAPTOR_RSS_FIELD_UNKNOWN; + for(i = 0; i < RAPTOR_RSS_FIELDS_SIZE; i++) { + raptor_uri* nspace_URI; + raptor_uri* field_nspace_URI; + rss_info_namespace nsid = raptor_rss_fields_info[i].nspace; + + if(strcmp((const char*)name, raptor_rss_fields_info[i].name)) + continue; + + if(!el_nspace) { + if(nsid != RSS_NO_NS && nsid != RSS1_0_NS && nsid != RSS0_91_NS && + nsid != RSS0_9_NS && nsid != RSS1_1_NS) + continue; + + /* Matches if the element has no namespace and field is not atom */ + rss_parser->current_field = (raptor_rss_fields_type)i; + break; + } + + /* Promote element namespaces */ + nspace_URI = raptor_rss_promote_namespace_uri(rdf_parser->world, + raptor_namespace_get_uri(el_nspace)); + field_nspace_URI = rdf_parser->world->rss_namespaces_info_uris[raptor_rss_fields_info[i].nspace]; + + if(raptor_uri_equals(nspace_URI, + field_nspace_URI)) { + rss_parser->current_field = (raptor_rss_fields_type)i; + break; + } + } + + if(rss_parser->current_field == RAPTOR_RSS_FIELD_UNKNOWN) { + RAPTOR_DEBUG3("Unknown field element named %s inside type %s\n", name, + raptor_rss_items_info[rss_parser->current_type].name); + return; + } + + + /* Found a block element to process */ + if(raptor_rss_fields_info[rss_parser->current_field].flags & + RAPTOR_RSS_INFO_FLAG_BLOCK_VALUE) { + raptor_rss_type block_type; + raptor_rss_item* update_item; + const unsigned char *id; + raptor_term* block_term; + + block_type = raptor_rss_fields_info[rss_parser->current_field].block_type; + + RAPTOR_DEBUG3("FOUND new block type %u - %s\n", block_type, + raptor_rss_items_info[block_type].name); + + update_item = raptor_rss_get_current_item(rss_parser); + + id = raptor_world_generate_bnodeid(rdf_parser->world); + block_term = raptor_new_term_from_blank(rdf_parser->world, id); + RAPTOR_FREE(char*, id); + + block = raptor_new_rss_block(rdf_parser->world, block_type, block_term); + raptor_free_term(block_term); + + raptor_rss_item_add_block(update_item, block); + rss_parser->current_block = block; + + rss_parser->nspaces_seen[raptor_rss_items_info[block_type].nspace] = 'Y'; + + /* Now check block attributes */ + if(named_attrs) { + for(i = 0; i < ns_attributes_count; i++) { + raptor_qname* attr = named_attrs[i]; + const char* attrName = (const char*)attr->local_name; + const unsigned char* attrValue = attr->value; + const raptor_rss_block_field_info *bfi; + int offset = -1; + + for(bfi = &raptor_rss_block_fields_info[0]; + bfi->type != RAPTOR_RSS_NONE; + bfi++) { + if(!bfi->attribute) + continue; + + if(bfi->type == block_type && !strcmp(attrName, bfi->attribute)) { + offset = bfi->offset; + break; + } + } + + if(offset < 0) + continue; + + /* Found attribute for this block type */ + RAPTOR_DEBUG3(" found block attribute %s=%s\n", attrName, attrValue); + if(raptor_rss_block_set_field(rdf_parser->world, base_uri, + block, bfi, (const char*)attrValue)) { + rdf_parser->failed = 1; + return; + } + + } + + } + + return; + } + + + /* Process field */ + RAPTOR_DEBUG4("FOUND field %u - %s inside type %s\n", + rss_parser->current_field, + raptor_rss_fields_info[rss_parser->current_field].name, + raptor_rss_items_info[rss_parser->current_type].name); + + /* Mark namespace seen in new field */ + if(1) { + rss_info_namespace ns_index; + ns_index = raptor_rss_fields_info[rss_parser->current_field].nspace; + rss_parser->nspaces_seen[ns_index] = 'Y'; + } + + + /* Now check for field attributes */ + if(named_attrs) { + for(i = 0; i < ns_attributes_count; i++) { + raptor_qname* attr = named_attrs[i]; + const unsigned char* attrName = attr->local_name; + const unsigned char* attrValue = attr->value; + + RAPTOR_DEBUG3(" attribute %s=%s\n", attrName, attrValue); + + /* Pick a few attributes to care about */ + if(!strcmp((const char*)attrName, "isPermaLink")) { + raptor_rss_item* update_item = rss_parser->model.last; + if(!strcmp((const char*)name, "guid")) { + /* */ + if(update_item) { + raptor_rss_field* field = raptor_rss_new_field(rdf_parser->world); + RAPTOR_DEBUG1("fa1 - "); + raptor_rss_item_add_field(update_item, RAPTOR_RSS_FIELD_GUID, field); + if(!strcmp((const char*)attrValue, "true")) { + RAPTOR_DEBUG2(" setting guid to URI '%s'\n", attrValue); + field->uri = raptor_new_uri_relative_to_base(rdf_parser->world, base_uri, + (const unsigned char*)attrValue); + } else { + size_t len = strlen((const char*)attrValue); + RAPTOR_DEBUG2(" setting guid to string '%s'\n", attrValue); + field->value = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!field->value) { + rdf_parser->failed = 1; + return; + } + memcpy(field->value, attrValue, len + 1); + } + } + } + } else if(!strcmp((const char*)attrName, "href")) { + if(rss_parser->current_field == RAPTOR_RSS_FIELD_LINK || + rss_parser->current_field == RAPTOR_RSS_FIELD_ATOM_LINK) { + RAPTOR_DEBUG2(" setting href as URI string for type %s\n", raptor_rss_items_info[rss_parser->current_type].name); + if(rss_element->uri) + raptor_free_uri(rss_element->uri); + rss_element->uri = raptor_new_uri_relative_to_base(rdf_parser->world, base_uri, + (const unsigned char*)attrValue); + } + } else if(!strcmp((const char*)attrName, "type")) { + if(rss_parser->current_field == RAPTOR_RSS_FIELD_ATOM_LINK) { + /* do nothing with atom link attribute type */ + } else if(rss_parser->is_atom) { + /* Atom only typing */ + if(!strcmp((const char*)attrValue, "xhtml") || + !strcmp((const char*)attrValue, "xml") || + strstr((const char*)attrValue, "+xml")) { + + RAPTOR_DEBUG2(" found type '%s', making an XML writer\n", + attrValue); + + rss_element->type = RAPTOR_RSS_CONTENT_TYPE_XML; + rss_element->iostream = raptor_new_iostream_to_string(rdf_parser->world, + &rss_element->xml_content, + &rss_element->xml_content_length, + raptor_alloc_memory); + rss_element->xml_writer = raptor_new_xml_writer(rdf_parser->world, + NULL, + rss_element->iostream); + raptor_xml_writer_set_option(rss_element->xml_writer, + RAPTOR_OPTION_WRITER_XML_DECLARATION, + NULL, 0); + + raptor_free_stringbuffer(rss_element->sb); + rss_element->sb = NULL; + + } + } + } else if(!strcmp((const char*)attrName, "version")) { + if(!raptor_strcasecmp((const char*)name, "feed")) { + if(!strcmp((const char*)attrValue, "0.3")) + rss_parser->is_atom = 1; + } + } + } + } /* if have field attributes */ + +} + + +static void +raptor_rss_end_element_handler(void *user_data, + raptor_xml_element* xml_element) +{ + raptor_parser* rdf_parser; + raptor_rss_parser* rss_parser; +#ifdef RAPTOR_DEBUG + const unsigned char* name = raptor_xml_element_get_name(xml_element)->local_name; +#endif + raptor_rss_element* rss_element; + size_t cdata_len = 0; + unsigned char* cdata = NULL; + + rss_element = (raptor_rss_element*)xml_element->user_data; + + rdf_parser = (raptor_parser*)user_data; + rss_parser = (raptor_rss_parser*)rdf_parser->context; + + if(rss_element->xml_writer) { + if(rss_element->type != RAPTOR_RSS_CONTENT_TYPE_XML) { + raptor_xml_writer_end_element(rss_element->xml_writer, xml_element); + goto tidy_end_element; + } + + /* otherwise we are done making XML */ + raptor_free_iostream(rss_element->iostream); + rss_element->iostream = NULL; + cdata = (unsigned char*)rss_element->xml_content; + cdata_len = rss_element->xml_content_length; + } + + if(rss_element->sb) { + cdata_len = raptor_stringbuffer_length(rss_element->sb); + cdata = raptor_stringbuffer_as_string(rss_element->sb); + } + + if(cdata) { + raptor_uri* base_uri = NULL; + + base_uri = raptor_sax2_inscope_base_uri(rss_parser->sax2); + + if(rss_parser->current_block) { + const raptor_rss_block_field_info *bfi; +#ifdef RAPTOR_DEBUG + int handled = 0; +#endif + /* in a block, maybe store the CDATA there */ + + for(bfi = &raptor_rss_block_fields_info[0]; + bfi->type != RAPTOR_RSS_NONE; + bfi++) { + + if(bfi->type != rss_parser->current_block->rss_type || + bfi->attribute != NULL) + continue; + + /* Set author name from element */ + if(raptor_rss_block_set_field(rdf_parser->world, base_uri, + rss_parser->current_block, + bfi, (const char*)cdata)) { + rdf_parser->failed = 1; + return; + } + +#ifdef RAPTOR_DEBUG + handled = 1; +#endif + break; + } + +#ifdef RAPTOR_DEBUG + if(!handled) { + raptor_rss_type block_type = rss_parser->current_block->rss_type; + RAPTOR_DEBUG3("Ignoring cdata for block %u - %s\n", + block_type, raptor_rss_items_info[block_type].name); + } +#endif + rss_parser->current_block = NULL; + goto do_end_element; + } + + if(rss_parser->current_type == RAPTOR_RSS_NONE || + (rss_parser->current_field == RAPTOR_RSS_FIELD_NONE || + rss_parser->current_field == RAPTOR_RSS_FIELD_UNKNOWN)) { + unsigned char *p = cdata; + size_t i; + for(i = cdata_len; i > 0 && *p; i--) { + if(!isspace(*p)) + break; + p++; + } + if(i > 0 && *p) { + RAPTOR_DEBUG4("IGNORING non-whitespace text '%s' inside type %s, field %s\n", cdata, + raptor_rss_items_info[rss_parser->current_type].name, + raptor_rss_fields_info[rss_parser->current_field].name); + } + + goto do_end_element; + } + + if(rss_parser->current_type >= RAPTOR_RSS_COMMON_IGNORED) { + /* skipHours, skipDays common but IGNORED */ + RAPTOR_DEBUG2("Ignoring fields for type %s\n", raptor_rss_items_info[rss_parser->current_type].name); + } else { + raptor_rss_item* update_item = raptor_rss_get_current_item(rss_parser); + raptor_rss_field* field = raptor_rss_new_field(rdf_parser->world); + + /* if value is always an uri, make it so */ + if(raptor_rss_fields_info[rss_parser->current_field].flags & + RAPTOR_RSS_INFO_FLAG_URI_VALUE) { + RAPTOR_DEBUG4("Added URI %s to field %s of type %s\n", cdata, raptor_rss_fields_info[rss_parser->current_field].name, raptor_rss_items_info[rss_parser->current_type].name); + field->uri = raptor_new_uri_relative_to_base(rdf_parser->world, base_uri, cdata); + } else { + RAPTOR_DEBUG4("Added text '%s' to field %s of type %s\n", cdata, raptor_rss_fields_info[rss_parser->current_field].name, raptor_rss_items_info[rss_parser->current_type].name); + field->uri = NULL; + field->value = RAPTOR_MALLOC(unsigned char*, cdata_len + 1); + if(!field->value) { + rdf_parser->failed = 1; + raptor_rss_field_free(field); + return; + } + + memcpy(field->value, cdata, cdata_len); + field->value[cdata_len] = '\0'; + } + + RAPTOR_DEBUG1("fa3 - "); + raptor_rss_item_add_field(update_item, rss_parser->current_field, field); + } + } /* end if contained cdata */ + + if(raptor_xml_element_is_empty(xml_element)) { + /* Empty element, so consider adding one of the attributes as + * literal or URI content + */ + if(rss_parser->current_type >= RAPTOR_RSS_COMMON_IGNORED) { + /* skipHours, skipDays common but IGNORED */ + RAPTOR_DEBUG3("Ignoring empty element %s for type %s\n", name, raptor_rss_items_info[rss_parser->current_type].name); + } else if(rss_element->uri) { + raptor_rss_item* update_item = raptor_rss_get_current_item(rss_parser); + raptor_rss_field* field = raptor_rss_new_field(rdf_parser->world); + + if(rss_parser->current_field == RAPTOR_RSS_FIELD_UNKNOWN) { + RAPTOR_DEBUG2("Cannot add URI from alternate attribute to type %s unknown field\n", raptor_rss_items_info[rss_parser->current_type].name); + raptor_rss_field_free(field); + } else { + RAPTOR_DEBUG3("Added URI to field %s of type %s\n", raptor_rss_fields_info[rss_parser->current_field].name, raptor_rss_items_info[rss_parser->current_type].name); + field->uri = rss_element->uri; + rss_element->uri = NULL; + RAPTOR_DEBUG1("fa2 - "); + raptor_rss_item_add_field(update_item, rss_parser->current_field, field); + } + } + + } + + do_end_element: + if(rss_parser->current_type != RAPTOR_RSS_NONE) { + if(rss_parser->current_field != RAPTOR_RSS_FIELD_NONE) { + RAPTOR_DEBUG3("Ending element %s field %s\n", name, raptor_rss_fields_info[rss_parser->current_field].name); + rss_parser->current_field = RAPTOR_RSS_FIELD_NONE; + } else { + RAPTOR_DEBUG3("Ending element %s type %s\n", name, raptor_rss_items_info[rss_parser->current_type].name); + if(rss_parser->prev_type != RAPTOR_RSS_NONE) { + rss_parser->current_type = rss_parser->prev_type; + rss_parser->prev_type = RAPTOR_RSS_NONE; + RAPTOR_DEBUG3("Returning to type %u - %s\n", rss_parser->current_type, raptor_rss_items_info[rss_parser->current_type].name); + } else + rss_parser->current_type = RAPTOR_RSS_NONE; + } + } + + if(rss_parser->current_block) { +#ifdef RAPTOR_DEBUG + raptor_rss_type block_type = rss_parser->current_block->rss_type; + RAPTOR_DEBUG3("Ending current block %u - %s\n", + block_type, raptor_rss_items_info[block_type].name); +#endif + rss_parser->current_block = NULL; + } + + + tidy_end_element: + + raptor_free_rss_element(rss_element); + +} + + + +static void +raptor_rss_cdata_handler(void *user_data, raptor_xml_element* xml_element, + const unsigned char *s, int len) +{ + raptor_rss_element* rss_element; + + rss_element = (raptor_rss_element*)xml_element->user_data; + + if(rss_element->xml_writer) { + raptor_xml_writer_cdata_counted(rss_element->xml_writer, s, len); + return; + } + + raptor_stringbuffer_append_counted_string(rss_element->sb, s, len, 1); +} + + +static void +raptor_rss_comment_handler(void *user_data, raptor_xml_element* xml_element, + const unsigned char *s) +{ + raptor_rss_element* rss_element; + + if(!xml_element) + return; + + rss_element = (raptor_rss_element*)xml_element->user_data; + + if(rss_element->xml_writer) { + raptor_xml_writer_comment(rss_element->xml_writer, s); + return; + } +} + + +static void +raptor_rss_sax2_new_namespace_handler(void *user_data, + raptor_namespace* nspace) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + raptor_rss_parser* rss_parser; + int n; + + rss_parser = (raptor_rss_parser*)rdf_parser->context; + for(n = 0; n < RAPTOR_RSS_NAMESPACES_SIZE; n++) { + raptor_uri* ns_uri = rdf_parser->world->rss_namespaces_info_uris[n]; + if(!ns_uri) + continue; + + if(!raptor_uri_equals(ns_uri, nspace->uri)) { + rss_parser->nspaces_seen[n] = 'Y'; + break; + } + } + +} + + +/* Add an rss:link from string contents of either: + * atom:id + * atom:link[@rel="self"]/@href + */ +static int +raptor_rss_insert_rss_link(raptor_parser* rdf_parser, + raptor_rss_item* item) +{ + raptor_rss_block *block; + raptor_rss_field* id_field; + raptor_rss_field* field = NULL; + + /* Try atom:id first */ + id_field = item->fields[RAPTOR_RSS_FIELD_ATOM_ID]; + if(id_field && id_field->value) { + const char *value = (const char*)id_field->value; + size_t len = strlen(value); + + field = raptor_rss_new_field(item->world); + if(!field) + return 1; + + field->value = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!field->value) { + raptor_rss_field_free(field); + return 1; + } + + memcpy(field->value, value, len + 1); + raptor_rss_item_add_field(item, RAPTOR_RSS_FIELD_LINK, field); + + return 0; + } + + + for(block = item->blocks; block; block = block->next) { + if(block->rss_type != RAPTOR_ATOM_LINK) + continue; + + /* is url at offset RAPTOR_RSS_LINK_HREF_URL_OFFSET + * is string at offset RAPTOR_RSS_LINK_REL_STRING_OFFSET + * The raptor_rss_block_fields_info structure records this + */ + if(!block->urls[RAPTOR_RSS_LINK_HREF_URL_OFFSET] || + (block->strings[RAPTOR_RSS_LINK_REL_STRING_OFFSET] && + strcmp(block->strings[RAPTOR_RSS_LINK_REL_STRING_OFFSET], "self")) + ) + continue; + + /* set the field rss:link to the string value of the @href */ + field = raptor_rss_new_field(item->world); + field->value = raptor_uri_to_string(block->urls[0]); + + raptor_rss_item_add_field(item, RAPTOR_RSS_FIELD_LINK, field); + return 0; + } + + return 0; +} + + +static int +raptor_rss_insert_identifiers(raptor_parser* rdf_parser) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + int i; + raptor_rss_item* item; + + for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) { + for(item = rss_parser->model.common[i]; item; item = item->next) { + if(!item->fields_count) + continue; + + RAPTOR_DEBUG3("Inserting identifiers in common type %d - %s\n", i, raptor_rss_items_info[i].name); + + if(item->uri) { + item->term = raptor_new_term_from_uri(rdf_parser->world, item->uri); + } else { + int url_fields[2]; + int url_fields_count = 1; + int f; + + url_fields[0] = (i== RAPTOR_RSS_IMAGE) ? RAPTOR_RSS_FIELD_URL : + RAPTOR_RSS_FIELD_LINK; + if(i == RAPTOR_RSS_CHANNEL) { + url_fields[1] = RAPTOR_RSS_FIELD_ATOM_ID; + url_fields_count++; + } + + for(f = 0; f < url_fields_count; f++) { + raptor_rss_field* field; + + for(field = item->fields[url_fields[f]]; field; field = field->next) { + raptor_uri *new_uri = NULL; + if(field->value) + new_uri = raptor_new_uri(rdf_parser->world, + (const unsigned char*)field->value); + else if(field->uri) + new_uri = raptor_uri_copy(field->uri); + + if(new_uri) { + item->term = raptor_new_term_from_uri(rdf_parser->world, new_uri); + raptor_free_uri(new_uri); + if(!item->term) + return 1; + break; + } + } + } + + if(!item->term) { + const unsigned char *id; + + /* need to make bnode */ + id = raptor_world_generate_bnodeid(rdf_parser->world); + item->term = raptor_new_term_from_blank(rdf_parser->world, id); + RAPTOR_FREE(char*, id); + } + } + + /* Try to add an rss:link if missing */ + if(i == RAPTOR_RSS_CHANNEL && !item->fields[RAPTOR_RSS_FIELD_LINK]) { + if(raptor_rss_insert_rss_link(rdf_parser, item)) + return 1; + } + + item->node_type = &raptor_rss_items_info[i]; + item->node_typei = i; + } + } + /* sequence of rss:item */ + for(item = rss_parser->model.items; item; item = item->next) { + raptor_rss_block *block; + raptor_uri* uri = NULL; + + if(!item->fields[RAPTOR_RSS_FIELD_LINK]) { + if(raptor_rss_insert_rss_link(rdf_parser, item)) + return 1; + } + + + if(item->uri) { + uri = raptor_uri_copy(item->uri); + } else { + if(item->fields[RAPTOR_RSS_FIELD_LINK]) { + if(item->fields[RAPTOR_RSS_FIELD_LINK]->value) + uri = raptor_new_uri(rdf_parser->world, + (const unsigned char*)item->fields[RAPTOR_RSS_FIELD_LINK]->value); + else if(item->fields[RAPTOR_RSS_FIELD_LINK]->uri) + uri = raptor_uri_copy(item->fields[RAPTOR_RSS_FIELD_LINK]->uri); + } else if(item->fields[RAPTOR_RSS_FIELD_ATOM_ID]) { + if(item->fields[RAPTOR_RSS_FIELD_ATOM_ID]->value) + uri = raptor_new_uri(rdf_parser->world, + (const unsigned char*)item->fields[RAPTOR_RSS_FIELD_ATOM_ID]->value); + else if(item->fields[RAPTOR_RSS_FIELD_ATOM_ID]->uri) + uri = raptor_uri_copy(item->fields[RAPTOR_RSS_FIELD_ATOM_ID]->uri); + } + } + + if(!uri) + continue; + + item->term = raptor_new_term_from_uri(rdf_parser->world, uri); + raptor_free_uri(uri); + uri = NULL; + + for(block = item->blocks; block; block = block->next) { + if(!block->identifier) { + const unsigned char *id; + /* need to make bnode */ + id = raptor_world_generate_bnodeid(rdf_parser->world); + item->term = raptor_new_term_from_blank(rdf_parser->world, id); + RAPTOR_FREE(char*, id); + } + } + + item->node_type = &raptor_rss_items_info[RAPTOR_RSS_ITEM]; + item->node_typei = RAPTOR_RSS_ITEM; + } + + return 0; +} + + +static int +raptor_rss_emit_type_triple(raptor_parser* rdf_parser, + raptor_term *resource, + raptor_uri *type_uri) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + raptor_term *predicate_term; + raptor_term *object_term; + + if(!resource) { + raptor_parser_error(rdf_parser, "RSS node has no identifier"); + return 1; + } + + rss_parser->statement.subject = resource; + + predicate_term = raptor_new_term_from_uri(rdf_parser->world, + RAPTOR_RDF_type_URI(rdf_parser->world)); + rss_parser->statement.predicate = predicate_term; + + object_term = raptor_new_term_from_uri(rdf_parser->world, type_uri); + rss_parser->statement.object = object_term; + + /* Generate the statement */ + (*rdf_parser->statement_handler)(rdf_parser->user_data, &rss_parser->statement); + + raptor_free_term(predicate_term); + raptor_free_term(object_term); + + return 0; +} + + +static int +raptor_rss_emit_block(raptor_parser* rdf_parser, + raptor_term *resource, + raptor_rss_block *block) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + raptor_rss_type block_type = block->rss_type; + raptor_uri *predicate_uri; + raptor_term *predicate_term = NULL; + const raptor_rss_block_field_info *bfi; + raptor_rss_fields_type predicate_field; + + if(!block->identifier) { + raptor_parser_error(rdf_parser, "Block has no identifier"); + return 1; + } + + predicate_field = raptor_rss_items_info[block_type].predicate; + predicate_uri = rdf_parser->world->rss_fields_info_uris[predicate_field]; + predicate_term = raptor_new_term_from_uri(rdf_parser->world, + predicate_uri); + + rss_parser->statement.subject = resource; + rss_parser->statement.predicate = predicate_term; + rss_parser->statement.object = block->identifier; + (*rdf_parser->statement_handler)(rdf_parser->user_data, + &rss_parser->statement); + + raptor_free_term(predicate_term); predicate_term = NULL; + + if(raptor_rss_emit_type_triple(rdf_parser, block->identifier, + block->node_type)) + return 1; + + + for(bfi = &raptor_rss_block_fields_info[0]; + bfi->type != RAPTOR_RSS_NONE; + bfi++) { + int attribute_type; + int offset; + + if(bfi->type != block_type || !bfi->attribute) + continue; + + attribute_type = bfi->attribute_type; + offset = bfi->offset; + predicate_uri = rdf_parser->world->rss_fields_info_uris[bfi->field]; + + predicate_term = raptor_new_term_from_uri(rdf_parser->world, + predicate_uri); + rss_parser->statement.predicate = predicate_term; + + if(attribute_type == RSS_BLOCK_FIELD_TYPE_URL) { + raptor_uri *uri = block->urls[offset]; + if(uri) { + raptor_term* object_term; + + object_term = raptor_new_term_from_uri(rdf_parser->world, uri); + rss_parser->statement.object = object_term; + (*rdf_parser->statement_handler)(rdf_parser->user_data, + &rss_parser->statement); + raptor_free_term(object_term); + } + } else if(attribute_type == RSS_BLOCK_FIELD_TYPE_STRING) { + const char *str = block->strings[offset]; + if(str) { + raptor_term* object_term; + + object_term = raptor_new_term_from_literal(rdf_parser->world, + (const unsigned char*)str, + NULL, NULL); + rss_parser->statement.object = object_term; + (*rdf_parser->statement_handler)(rdf_parser->user_data, + &rss_parser->statement); + raptor_free_term(object_term); + } + } else { +#ifdef RAPTOR_DEBUG + RAPTOR_FATAL2("Found unknown attribute_type %d\n", attribute_type); +#endif + } + + raptor_free_term(predicate_term); predicate_term = NULL; + } + + return 0; +} + + +static int +raptor_rss_emit_item(raptor_parser* rdf_parser, raptor_rss_item *item) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + int f; + raptor_rss_block *block; + raptor_uri *type_uri; + + if(!item->fields_count) + return 0; + + /* HACK - FIXME - set correct atom output class type */ + if(item->node_typei == RAPTOR_ATOM_AUTHOR) + type_uri = rdf_parser->world->rss_fields_info_uris[RAPTOR_RSS_RDF_ATOM_AUTHOR_CLASS]; + else + type_uri = rdf_parser->world->rss_types_info_uris[item->node_typei]; + + if(raptor_rss_emit_type_triple(rdf_parser, item->term, type_uri)) + return 1; + + for(f = 0; f< RAPTOR_RSS_FIELDS_SIZE; f++) { + raptor_rss_field* field; + raptor_uri* predicate_uri = NULL; + raptor_term* predicate_term = NULL; + + /* This is only made by a connection */ + if(f == RAPTOR_RSS_FIELD_ITEMS) + continue; + + /* skip predicates with no URI (no namespace e.g. RSS 2) */ + predicate_uri = rdf_parser->world->rss_fields_info_uris[f]; + if(!predicate_uri) + continue; + + predicate_term = raptor_new_term_from_uri(rdf_parser->world, + predicate_uri); + if(!predicate_term) + continue; + + rss_parser->statement.predicate = predicate_term; + + for(field = item->fields[f]; field; field = field->next) { + raptor_term* object_term; + + if(field->value) { + /* FIXME - should store and emit languages */ + object_term = raptor_new_term_from_literal(rdf_parser->world, + field->value, + NULL, NULL); + } else { + object_term = raptor_new_term_from_uri(rdf_parser->world, + field->uri); + } + rss_parser->statement.object = object_term; + + /* Generate the statement */ + (*rdf_parser->statement_handler)(rdf_parser->user_data, + &rss_parser->statement); + + raptor_free_term(object_term); + } + + raptor_free_term(predicate_term); + } + + for(block = item->blocks; block; block = block->next) { + raptor_rss_emit_block(rdf_parser, item->term, block); + } + + return 0; +} + + +static int +raptor_rss_emit_connection(raptor_parser* rdf_parser, + raptor_term *subject_identifier, + raptor_uri* predicate_uri, int predicate_ordinal, + raptor_term *object_identifier) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + raptor_uri *puri = NULL; + raptor_term *predicate_term = NULL; + + if(!subject_identifier) { + raptor_parser_error(rdf_parser, "Connection subject has no identifier"); + return 1; + } + + rss_parser->statement.subject = subject_identifier; + + if(!predicate_uri) { + /* new URI object */ + puri = raptor_new_uri_from_rdf_ordinal(rdf_parser->world, predicate_ordinal); + predicate_uri = puri; + } + predicate_term = raptor_new_term_from_uri(rdf_parser->world, + predicate_uri); + rss_parser->statement.predicate = predicate_term; + rss_parser->statement.object = object_identifier; + + /* Generate the statement */ + (*rdf_parser->statement_handler)(rdf_parser->user_data, + &rss_parser->statement); + + raptor_free_term(predicate_term); + + if(puri) + raptor_free_uri(puri); + + return 0; +} + + +static int +raptor_rss_emit(raptor_parser* rdf_parser) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + int i; + raptor_rss_item* item; + int rc = 0; + + if(!rss_parser->model.common[RAPTOR_RSS_CHANNEL]) { + raptor_parser_error(rdf_parser, "No RSS channel item present"); + return 1; + } + + if(!rss_parser->model.common[RAPTOR_RSS_CHANNEL]->term) { + raptor_parser_error(rdf_parser, "RSS channel has no identifier"); + return 1; + } + + /* Emit start default graph mark */ + raptor_parser_start_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph++; + + + /* Emit all the common type blocks (channel, author, ...) */ + for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) { + for(item = rss_parser->model.common[i]; item; item = item->next) { + if(!item->fields_count) + continue; + + RAPTOR_DEBUG3("Emitting type %i - %s\n", i, raptor_rss_items_info[i].name); + + if(!item->term) { + raptor_parser_error(rdf_parser, "RSS %s has no identifier", + raptor_rss_items_info[i].name); + rc = 1; + goto tidy; + } + + if(raptor_rss_emit_item(rdf_parser, item)) { + rc = 1; + goto tidy; + } + + /* Add connections to channel */ + if(i != RAPTOR_RSS_CHANNEL) { + if(raptor_rss_emit_connection(rdf_parser, + rss_parser->model.common[RAPTOR_RSS_CHANNEL]->term, + rdf_parser->world->rss_types_info_uris[i], 0, + item->term)) { + rc = 1; + goto tidy; + } + } + } + } + + + /* Emit the feed item blocks */ + if(rss_parser->model.items_count) { + const unsigned char* id; + raptor_term *items; + + id = raptor_world_generate_bnodeid(rdf_parser->world); + + /* make a new genid for the node */ + items = raptor_new_term_from_blank(rdf_parser->world, id); + RAPTOR_FREE(char*, id); + + /* _:genid1 rdf:type rdf:Seq . */ + if(raptor_rss_emit_type_triple(rdf_parser, items, + RAPTOR_RDF_Seq_URI(rdf_parser->world))) { + raptor_free_term(items); + rc = 1; + goto tidy; + } + + /* rss:items _:genid1 . */ + if(raptor_rss_emit_connection(rdf_parser, + rss_parser->model.common[RAPTOR_RSS_CHANNEL]->term, + rdf_parser->world->rss_fields_info_uris[RAPTOR_RSS_FIELD_ITEMS], 0, + items)) { + raptor_free_term(items); + rc= 1; + goto tidy; + } + + /* sequence of rss:item */ + for(i = 1, item = rss_parser->model.items; item; item = item->next, i++) { + + if(raptor_rss_emit_item(rdf_parser, item) || + raptor_rss_emit_connection(rdf_parser, items, NULL, i,item->term)) { + raptor_free_term(items); + rc = 1; + goto tidy; + } + } + + raptor_free_term(items); + } + + tidy: + if(rdf_parser->emitted_default_graph) { + raptor_parser_end_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph--; + } + + return rc; +} + + +static int +raptor_rss_copy_field(raptor_rss_parser* rss_parser, + raptor_rss_item* item, + const raptor_field_pair* pair) +{ + raptor_rss_fields_type from_field = pair->from; + raptor_rss_fields_type to_field = pair->to; + raptor_rss_field* field = NULL; + + if(!(item->fields[from_field] && item->fields[from_field]->value)) + return 1; + + if(from_field == to_field) { + field = item->fields[from_field]; + } else { + if(item->fields[to_field] && item->fields[to_field]->value) + return 1; + + field = raptor_rss_new_field(item->world); + field->is_mapped = 1; + raptor_rss_item_add_field(item, to_field, field); + } + + /* Ensure output namespace is declared */ + rss_parser->nspaces_seen[raptor_rss_fields_info[to_field].nspace] = 'Y'; + + if(!field->value) { + if(pair->conversion) + pair->conversion(item->fields[from_field], field); + else { + size_t len; + + /* Otherwise default action is to copy from_field value */ + len = strlen((const char*)item->fields[from_field]->value); + + field->value = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!field->value) + return 1; + + memcpy(field->value, item->fields[from_field]->value, len + 1); + } + } + + return 0; +} + + +static void +raptor_rss_uplift_fields(raptor_rss_parser* rss_parser, raptor_rss_item* item) +{ + int i; + + /* COPY some fields from atom to rss/dc */ + for(i = 0; raptor_atom_to_rss[i].from != RAPTOR_RSS_FIELD_UNKNOWN; i++) { +#ifdef RAPTOR_DEBUG + raptor_rss_fields_type from_field = raptor_atom_to_rss[i].from; + raptor_rss_fields_type to_field = raptor_atom_to_rss[i].to; +#endif + + if(raptor_rss_copy_field(rss_parser, item, &raptor_atom_to_rss[i])) + continue; + RAPTOR_DEBUG3("Copied field %s to rss field %s\n", + raptor_rss_fields_info[from_field].name, + raptor_rss_fields_info[to_field].name); + } +} + + +static void +raptor_rss_uplift_items(raptor_parser* rdf_parser) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + int i; + raptor_rss_item* item; + + for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) { + for(item = rss_parser->model.common[i]; item; item = item->next) { + raptor_rss_uplift_fields(rss_parser, item); + } + } + + for(item = rss_parser->model.items; item; item = item->next) { + raptor_rss_uplift_fields(rss_parser, item); + } + +} + + +static void +raptor_rss_start_namespaces(raptor_parser* rdf_parser) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + int i; + int n; + + /* for each item type (channel, item, ...) */ + for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) { + raptor_rss_item* item; + + /* for each item instance of a type */ + for(item = rss_parser->model.common[i]; item; item = item->next) { + int f; + if(!item->fields_count) + continue; + + /* for each field */ + for(f = 0; f< RAPTOR_RSS_FIELDS_SIZE; f++) { + raptor_rss_field* field = item->fields[f]; + if(field) { + /* knowing there is one value is enough */ + rss_info_namespace ns_index = raptor_rss_fields_info[f].nspace; + rss_parser->nspaces_seen[ns_index] = 'Y'; + } + } + } + } + + /* start the namespaces */ + for(n = 0; n < RAPTOR_RSS_NAMESPACES_SIZE; n++) { + if(rss_parser->nspaces[n] && rss_parser->nspaces_seen[n] == 'Y') + raptor_parser_start_namespace(rdf_parser, rss_parser->nspaces[n]); + } +} + + +static int +raptor_rss_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *s, size_t len, + int is_end) +{ + raptor_rss_parser* rss_parser = (raptor_rss_parser*)rdf_parser->context; + + if(rdf_parser->failed) + return 1; + + raptor_sax2_parse_chunk(rss_parser->sax2, s, len, is_end); + + if(!is_end) + return 0; + + if(rdf_parser->failed) + return 1; + + /* turn strings into URIs, move things around if needed */ + if(raptor_rss_insert_identifiers(rdf_parser)) { + rdf_parser->failed = 1; + return 1; + } + + /* add some new fields */ + raptor_rss_uplift_items(rdf_parser); + + /* find out what namespaces to declare and start them */ + raptor_rss_start_namespaces(rdf_parser); + + /* generate the triples */ + raptor_rss_emit(rdf_parser); + + return 0; +} + + +static int +raptor_rss_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score = 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "rss")) + score = 7; + if(!strcmp((const char*)suffix, "atom")) + score = 5; + if(!strcmp((const char*)suffix, "xml")) + score = 4; + } + + if(identifier) { + if(!strncmp((const char*)identifier, "http://feed", 11)) + score += 5; + else if(strstr((const char*)identifier, "feed")) + score += 3; + + if(strstr((const char*)identifier, "rss2")) + score += 5; + else if(!suffix && strstr((const char*)identifier, "rss")) + score += 4; + else if(!suffix && strstr((const char*)identifier, "atom")) + score += 4; + else if(strstr((const char*)identifier, "rss.xml")) + score += 4; + else if(strstr((const char*)identifier, "atom.xml")) + score += 4; + } + + if(mime_type) { + if(!strstr((const char*)mime_type, "html")) { + if(strstr((const char*)mime_type, "rss")) + score += 4; + else if(strstr((const char*)mime_type, "xml")) + score += 4; + else if(strstr((const char*)mime_type, "atom")) + score += 4; + } + } + + return score; +} + + +static const char* const rss_tag_soup_names[2] = { "rss-tag-soup", NULL }; + +#define RSS_TAG_SOUP_TYPES_COUNT 6 +static const raptor_type_q rss_tag_soup_types[RSS_TAG_SOUP_TYPES_COUNT + 1] = { + { "application/rss", 15, 8}, + { "application/rss+xml", 19, 8}, + { "text/rss", 8, 8}, + { "application/xml", 15, 3}, + { "text/xml", 8, 3}, + { "application/atom+xml", 20, 3}, + { NULL, 0, 0} +}; + +static int +raptor_rss_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = rss_tag_soup_names; + + factory->desc.mime_types = rss_tag_soup_types; + + factory->desc.label = "RSS Tag Soup"; + factory->desc.uri_strings = NULL; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_rss_parser); + + factory->init = raptor_rss_parse_init; + factory->terminate = raptor_rss_parse_terminate; + factory->start = raptor_rss_parse_start; + factory->chunk = raptor_rss_parse_chunk; + factory->recognise_syntax = raptor_rss_parse_recognise_syntax; + + return rc; +} + + +int +raptor_init_parser_rss(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_rss_parser_register_factory); +} diff --git a/src/raptor_rss.h b/src/raptor_rss.h new file mode 100644 index 0000000..0e53369 --- /dev/null +++ b/src/raptor_rss.h @@ -0,0 +1,448 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_rss.h - Redland Parser Toolkit Internal RSS Model and API + * + * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + + +#ifndef RAPTOR_RSS_H +#define RAPTOR_RSS_H + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef enum { +/* CONTAINERs */ + /* common */ + RAPTOR_RSS_CHANNEL, + RAPTOR_RSS_IMAGE, + RAPTOR_RSS_TEXTINPUT, + + /* list items */ + RAPTOR_RSS_ITEM, + + /* atom author */ + RAPTOR_ATOM_AUTHOR, + /* atom link */ + RAPTOR_ATOM_LINK, + + /* itunes owner */ + RAPTOR_ITUNES_OWNER, + + /* containers but IGNORED */ + RAPTOR_RSS_SKIPHOURS, + RAPTOR_RSS_SKIPDAYS, + +/* metadata BLOCKs */ + RAPTOR_RSS_ENCLOSURE, + RAPTOR_ATOM_CATEGORY, + RAPTOR_RSS_SOURCE, + +/* serializing containers */ + RAPTOR_ATOM_FEED, + RAPTOR_ATOM_ENTRY, + + /* nothing found yet */ + RAPTOR_RSS_NONE, + + /* deliberately not counting NONE */ + RAPTOR_RSS_COMMON_SIZE = RAPTOR_RSS_NONE - RAPTOR_RSS_CHANNEL, + RAPTOR_RSS_COMMON_IGNORED = RAPTOR_RSS_SKIPHOURS +} raptor_rss_type; + + +/* Namespaces used in RSS */ +#define RSS1_0_NAMESPACE_URI "http://purl.org/rss/1.0/" +#define RSS0_91_NAMESPACE_URI "http://purl.org/rss/1.0/modules/rss091#" +#define RSS2_0_ENC_NAMESPACE_URI "http://purl.oclc.org/net/rss_2.0/enc#" +#define ATOM0_3_NAMESPACE_URI "http://purl.org/atom/ns#" +#define DC_NAMESPACE_URI "http://purl.org/dc/elements/1.1/" +#define RSS1_1_NAMESPACE_URI "http://purl.org/net/rss1.1#" +#define CONTENT_NAMESPACE_URI "http://purl.org/rss/1.0/modules/content/" +#define ATOM1_0_NAMESPACE_URI "http://www.w3.org/2005/Atom" +#define RDF_NAMESPACE_URI "http://www.w3.org/1999/02/22-rdf-syntax-ns#" +#define ATOMTRIPLES_NAMESPACE_URI "http://purl.org/syndication/atomtriples/1" +#define ITUNES_NAMESPACE_URI "http://www.itunes.com/dtds/podcast-1.0.dtd" + +/* Old netscape namespace, turn into RSS 1.0 */ +#define RSS0_9_NAMESPACE_URI "http://my.netscape.com/rdf/simple/0.9/" + +typedef enum { + RSS_UNKNOWN_NS = 0, + RSS_NO_NS = 1, + RSS0_91_NS = 2, + RSS0_9_NS = 3, + RSS0_92_NS = RSS_NO_NS, + RSS2_0_NS = RSS_NO_NS, + RSS1_0_NS = 4, + ATOM0_3_NS = 5, + DC_NS = 6, + RSS2_0_ENC_NS = 7, + RSS1_1_NS = 8, + CONTENT_NS = 9, + ATOM1_0_NS = 10, + RDF_NS = 11, + ATOMTRIPLES_NS = 12, + ITUNES_NS = 13, + + RAPTOR_RSS_NAMESPACES_SIZE = ITUNES_NS + 1 +} rss_info_namespace; + + +typedef struct { + const char *uri_string; + const char *prefix; +} raptor_rss_namespace_info; + + +extern const raptor_rss_namespace_info raptor_rss_namespaces_info[RAPTOR_RSS_NAMESPACES_SIZE]; + +#define RAPTOR_RSS_INFO_FLAG_URI_VALUE 1 +#define RAPTOR_RSS_INFO_FLAG_BLOCK_VALUE 2 + +/* Namespaced elements used in feeds */ +typedef struct { + const char* name; + rss_info_namespace nspace; + int flags; + raptor_rss_type block_type; +} raptor_rss_field_info; + +/* Fields of typed nodes used in RSS */ +typedef enum { + RAPTOR_RSS_FIELD_TITLE, + RAPTOR_RSS_FIELD_LINK, + RAPTOR_RSS_FIELD_DESCRIPTION, + RAPTOR_RSS_FIELD_URL, /* image */ + RAPTOR_RSS_FIELD_NAME, /* textinput */ + RAPTOR_RSS_FIELD_LANGUAGE, /* channel 0.91 */ + RAPTOR_RSS_FIELD_RATING, /* channel 0.91 */ + RAPTOR_RSS_FIELD_COPYRIGHT, /* channel 0.91 */ + RAPTOR_RSS_FIELD_PUBDATE, /* channel 0.91, item 2.0 */ + RAPTOR_RSS_FIELD_LASTBUILDDATE, /* channel 0.91 */ + RAPTOR_RSS_FIELD_DOCS, /* channel 0.91 */ + RAPTOR_RSS_FIELD_MANAGINGEDITOR,/* channel 0.91 */ + RAPTOR_RSS_FIELD_WEBMASTER, /* channel 0.91 */ + RAPTOR_RSS_FIELD_CLOUD, /* channel 0.92, 2.0 */ + RAPTOR_RSS_FIELD_TTL, /* channel 2.0 */ + RAPTOR_RSS_FIELD_WIDTH, /* image 0.91 */ + RAPTOR_RSS_FIELD_HEIGHT, /* image 0.91 */ + RAPTOR_RSS_FIELD_HOUR, /* skipHours 0.91 */ + RAPTOR_RSS_FIELD_DAY, /* skipDays 0.91 */ + RAPTOR_RSS_FIELD_GENERATOR, /* channel 0.92, 2.0 */ + RAPTOR_RSS_FIELD_SOURCE, /* item 0.92, 2.0 */ + RAPTOR_RSS_FIELD_AUTHOR, /* item 2.0 */ + RAPTOR_RSS_FIELD_GUID, /* item 2.0 */ + RAPTOR_RSS_FIELD_ENCLOSURE, /* item 0.92, 2.0 */ + RAPTOR_RSS_RDF_ENCLOSURE, /* In RDF output, not an RSS field */ + RAPTOR_RSS_RDF_ENCLOSURE_CLASS, /* In RDF output, not an RSS field */ + RAPTOR_RSS_RDF_ENCLOSURE_URL, /* In RDF output, not an RSS field */ + RAPTOR_RSS_RDF_ENCLOSURE_LENGTH, /* In RDF output, not an RSS field */ + RAPTOR_RSS_RDF_ENCLOSURE_TYPE, /* In RDF output, not an RSS field */ + RAPTOR_RSS_FIELD_LENGTH, /* item 0.92, 2.0 */ + RAPTOR_RSS_FIELD_TYPE, /* item 0.92, 2.0 */ + RAPTOR_RSS_FIELD_CATEGORY, /* item 0.92, 2.0, channel 2.0 */ + RAPTOR_RSS_FIELD_COMMENTS, /* comments v? */ + RAPTOR_RSS_FIELD_ITEMS, /* rss 1.0 items */ + RAPTOR_RSS_FIELD_IMAGE, /* rss 1.0 property from channel->image) */ + RAPTOR_RSS_FIELD_TEXTINPUT, /* rss 1.0 property from channel->textinput */ + + RAPTOR_RSS_FIELD_ATOM_COPYRIGHT, /* atom 0.3 copyright */ + RAPTOR_RSS_FIELD_ATOM_CREATED, /* atom 0.3 created */ + RAPTOR_RSS_FIELD_ATOM_ISSUED, /* atom 0.3 issued */ + RAPTOR_RSS_FIELD_ATOM_MODIFIED, /* atom 0.3 modified */ + RAPTOR_RSS_FIELD_ATOM_TAGLINE, /* atom 0.3 tagline */ + + /* atom 1.0 required fields */ + RAPTOR_RSS_FIELD_ATOM_ID, /* atom 1.0 id */ + RAPTOR_RSS_FIELD_ATOM_TITLE, /* atom 1.0 title */ + RAPTOR_RSS_FIELD_ATOM_UPDATED, /* atom 1.0 updated */ + /* atom 1.0 optional fields */ + RAPTOR_RSS_FIELD_ATOM_AUTHOR, /* atom 1.0 author */ + RAPTOR_RSS_FIELD_ATOM_CATEGORY, /* atom 1.0 category */ + RAPTOR_RSS_FIELD_ATOM_CONTENT, /* atom 1.0 content */ + RAPTOR_RSS_FIELD_ATOM_CONTRIBUTOR, /* atom 1.0 contributor */ + RAPTOR_RSS_FIELD_ATOM_EMAIL, /* atom 1.0 email */ + RAPTOR_RSS_FIELD_ATOM_ENTRY, /* atom 1.0 entry */ + RAPTOR_RSS_FIELD_ATOM_FEED, /* atom 1.0 feed */ + RAPTOR_RSS_FIELD_ATOM_GENERATOR, /* atom 1.0 generator */ + RAPTOR_RSS_FIELD_ATOM_ICON, /* atom 1.0 icon */ + RAPTOR_RSS_FIELD_ATOM_LINK, /* atom 1.0 link */ + RAPTOR_RSS_FIELD_ATOM_LOGO, /* atom 1.0 logo */ + RAPTOR_RSS_FIELD_ATOM_NAME, /* atom 1.0 name */ + RAPTOR_RSS_FIELD_ATOM_PUBLISHED, /* atom 1.0 published */ + RAPTOR_RSS_FIELD_ATOM_RIGHTS, /* atom 1.0 rights */ + RAPTOR_RSS_FIELD_ATOM_SOURCE, /* atom 1.0 source */ + RAPTOR_RSS_FIELD_ATOM_SUBTITLE, /* atom 1.0 subtitle */ + RAPTOR_RSS_FIELD_ATOM_SUMMARY, /* atom 1.0 summary */ + RAPTOR_RSS_FIELD_ATOM_URI, /* atom 1.0 uri */ + + RAPTOR_RSS_RDF_ATOM_AUTHOR_CLASS, /* In RDF output, not atom field */ + RAPTOR_RSS_RDF_ATOM_CATEGORY_CLASS, /* In RDF output, not atom field */ + RAPTOR_RSS_RDF_ATOM_LINK_CLASS, /* In RDF output, not atom field */ + + RAPTOR_RSS_FIELD_ATOM_LABEL, /* atom 1.0 attribute label */ + RAPTOR_RSS_FIELD_ATOM_SCHEME, /* atom 1.0 attribute scheme */ + RAPTOR_RSS_FIELD_ATOM_TERM, /* atom 1.0 attribute term */ + RAPTOR_RSS_FIELD_ATOM_HREF, /* atom 1.0 attribute term */ + RAPTOR_RSS_FIELD_ATOM_REL, /* atom 1.0 attribute term */ + RAPTOR_RSS_FIELD_ATOM_TYPE, /* atom 1.0 attribute term */ + RAPTOR_RSS_FIELD_ATOM_HREFLANG, /* atom 1.0 attribute term */ + RAPTOR_RSS_FIELD_ATOM_LENGTH, /* atom 1.0 attribute term */ + + RAPTOR_RSS_FIELD_DC_TITLE, /* DC title */ + RAPTOR_RSS_FIELD_DC_CONTRIBUTOR, /* DC contributor */ + RAPTOR_RSS_FIELD_DC_CREATOR, /* DC creator */ + RAPTOR_RSS_FIELD_DC_PUBLISHER, /* DC publisher */ + RAPTOR_RSS_FIELD_DC_SUBJECT, /* DC subject */ + RAPTOR_RSS_FIELD_DC_DESCRIPTION, /* DC description */ + RAPTOR_RSS_FIELD_DC_DATE, /* DC date */ + RAPTOR_RSS_FIELD_DC_TYPE, /* DC type */ + RAPTOR_RSS_FIELD_DC_FORMAT, /* DC format */ + RAPTOR_RSS_FIELD_DC_IDENTIFIER, /* DC identifier */ + RAPTOR_RSS_FIELD_DC_LANGUAGE, /* DC language */ + RAPTOR_RSS_FIELD_DC_RELATION, /* DC relation */ + RAPTOR_RSS_FIELD_DC_SOURCE, /* DC source */ + RAPTOR_RSS_FIELD_DC_COVERAGE, /* DC coverage */ + RAPTOR_RSS_FIELD_DC_RIGHTS, /* DC rights */ + + + RAPTOR_RSS_FIELD_CONTENT_ENCODED, /* rss 1.0 module content:encoded */ + + RAPTOR_RSS_FIELD_AT_CONTENT_TYPE, /* at:contentType */ + + RAPTOR_RSS_FIELD_ITUNES_AUTHOR, + RAPTOR_RSS_FIELD_ITUNES_SUBTITLE, + RAPTOR_RSS_FIELD_ITUNES_SUMARY, + RAPTOR_RSS_FIELD_ITUNES_KEYWORDS, + RAPTOR_RSS_FIELD_ITUNES_EXPLICIT, + RAPTOR_RSS_FIELD_ITUNES_IMAGE, + RAPTOR_RSS_FIELD_ITUNES_NAME, + RAPTOR_RSS_FIELD_ITUNES_OWNER, + RAPTOR_RSS_FIELD_ITUNES_BLOCK, + RAPTOR_RSS_FIELD_ITUNES_CATEGORY, + RAPTOR_RSS_FIELD_ITUNES_EMAIL, + + RAPTOR_RSS_FIELD_UNKNOWN, + + RAPTOR_RSS_FIELD_NONE, + + RAPTOR_RSS_FIELDS_SIZE = RAPTOR_RSS_FIELD_UNKNOWN +} raptor_rss_fields_type; + +extern const raptor_rss_field_info raptor_rss_fields_info[RAPTOR_RSS_FIELDS_SIZE+2]; + +typedef struct raptor_rss_field_s raptor_rss_field; + +typedef int (*raptor_rss_field_conversion)(raptor_rss_field* from_field, raptor_rss_field* to_field); + +typedef struct { + raptor_rss_fields_type from; + raptor_rss_fields_type to; + raptor_rss_field_conversion conversion; +} raptor_field_pair; + +extern const raptor_field_pair raptor_atom_to_rss[]; + + +#define RAPTOR_RSS_LINK_HREF_URL_OFFSET 0 +#define RAPTOR_RSS_LINK_REL_STRING_OFFSET 0 + +#define RSS_BLOCK_FIELD_TYPE_URL 0 +#define RSS_BLOCK_FIELD_TYPE_STRING 1 + +#define RSS_BLOCK_MAX_URLS 1 +#define RSS_BLOCK_MAX_STRINGS 5 + +/* Feed metadata blocks support (was raptor_rss_enclosure) */ +struct raptor_rss_block_s +{ + raptor_rss_type rss_type; + + /* enclosure: subject node URI/blank node */ + raptor_term *identifier; + + /* enclosure: node RAPTOR_RSS_ENCLOSURE + category: node RAPTOR_ATOM_CATEGORY + person: node RAPTOR_ATOM_AUTHOR or RAPTOR_ATOM_CONTRIBUTOR + link: node RAPTOR_ATOM_LINK + */ + raptor_uri *node_type; + + /* enclosure: 0: where enclosure is located - @url attr (required) + atom category: 0: @scheme attr (optional) + rss category: 0: @domain attr (optional) + rss source: 0: @url attr (required) + person: 0: @atom:uri attr (optional) + link: 0: @href attr (required) + */ + raptor_uri *urls[RSS_BLOCK_MAX_URLS]; + + /* enclosure: 0: content length @length attr (required) + 1: content type @type attr (required) + atom category: 0: @term attr (required) + 1: @label attr (optional) + person: 0: @atom:name attr (required) + 1: @atom:email attr (optional) + link: 0: @length attr (optional) + 1: @type attr (optional) + 2: @rel attr (optional) + 3: @hreflang attr (optional) + 4: @title attr (optional) + */ + char *strings[RSS_BLOCK_MAX_STRINGS]; + + /* next in list */ + struct raptor_rss_block_s* next; +}; +typedef struct raptor_rss_block_s raptor_rss_block; + +#define RAPTOR_RSS_ITEM_CONTAINER 1 +#define RAPTOR_RSS_ITEM_BLOCK 2 +typedef struct { + const char* name; + rss_info_namespace nspace; + int flags; + /* RDF class URI */ + raptor_rss_fields_type cls; + /* RDF predicate URI to connect to the instance of this item */ + raptor_rss_fields_type predicate; +} raptor_rss_item_info; + + +extern const raptor_rss_item_info raptor_rss_items_info[RAPTOR_RSS_COMMON_SIZE+1]; + +#define RAPTOR_RSS_BLOCKS_SIZE 17 +/* Metadata blocks info */ +typedef struct { + /* metadata block type it applies to */ + raptor_rss_type type; + /* XML attribute (or NULL for field to use to store CDATA) */ + const char *attribute; + /* How that attribute should be interpreted: url or string */ + int attribute_type; + /* Index into urls/strings array to store it */ + int offset; + /* RDF predicate this maps to */ + raptor_rss_fields_type field; +} raptor_rss_block_field_info; + +extern const raptor_rss_block_field_info raptor_rss_block_fields_info[RAPTOR_RSS_BLOCKS_SIZE+1]; + + +struct raptor_rss_field_s +{ + raptor_world* world; + unsigned char* value; + raptor_uri* uri; + struct raptor_rss_field_s* next; + /* this field was mapped from another vocab */ + unsigned int is_mapped:1; + /* value is XML */ + unsigned int is_xml:1; +}; + +#define RAPTOR_RSS_FIELD_MAPPED + +/* RSS items (instances of typed nodes) containing fields */ +struct raptor_rss_item_s +{ + raptor_world* world; + raptor_uri *uri; + raptor_term* term; + const raptor_rss_item_info *node_type; + int node_typei; + raptor_rss_field* fields[RAPTOR_RSS_FIELDS_SIZE]; + raptor_rss_block* blocks; + int fields_count; + struct raptor_rss_item_s* next; + /* Triples with this item as subject and do not fit in @fields */ + raptor_sequence* triples; +}; +typedef struct raptor_rss_item_s raptor_rss_item; + + +/* raptor_rss_common.c */ +#define RAPTOR_RSS_N_CONCEPTS 1 + +#define RAPTOR_RSS_RSS_items_URI(rss_model) ((rss_model)->concepts[0]) + + +typedef struct { + raptor_world* world; + + /* RAPTOR_RSS_CHANNEL, RAPTOR_RSS_IMAGE, RAPTOR_RSS_TEXTINPUT */ + raptor_rss_item* common[RAPTOR_RSS_COMMON_SIZE]; + + /* list of items RAPTOR_RSS_ITEM */ + raptor_rss_item* items; + + /* this points to the last one added, so we can append easy */ + raptor_rss_item* last; + + /* item count */ + int items_count; + + raptor_uri* concepts[RAPTOR_RSS_N_CONCEPTS]; + + raptor_namespace_stack *nstack; + +} raptor_rss_model; + + +/* raptor_rss_common.c */ +int raptor_rss_common_init(raptor_world* world); +void raptor_rss_common_terminate(raptor_world* world); + +void raptor_rss_model_init(raptor_world* world, raptor_rss_model* rss_model); +void raptor_rss_model_clear(raptor_rss_model* rss_model); + +raptor_rss_item* raptor_new_rss_item(raptor_world* world); +int raptor_rss_model_add_item(raptor_rss_model* rss_model); +raptor_rss_item* raptor_rss_model_add_common(raptor_rss_model* rss_model, raptor_rss_type type); +raptor_rss_item* raptor_rss_model_get_common(raptor_rss_model* rss_model, raptor_rss_type type); + +void raptor_clear_rss_item(raptor_rss_item* item); +void raptor_free_rss_item(raptor_rss_item* item); +void raptor_rss_item_add_block(raptor_rss_item* item, raptor_rss_block *block); +void raptor_rss_item_add_field(raptor_rss_item* item, int type, raptor_rss_field* field); +int raptor_rss_item_equals_statement_subject(const raptor_rss_item *item, const raptor_statement *statement); +int raptor_rss_item_set_uri(raptor_rss_item *item, raptor_uri* uri); + +raptor_rss_block *raptor_new_rss_block(raptor_world *world, raptor_rss_type rss_type, raptor_term* block_term); +void raptor_free_rss_block(raptor_rss_block *block); + +raptor_rss_field* raptor_rss_new_field(raptor_world* world); +void raptor_rss_field_free(raptor_rss_field* field); + +#define RAPTOR_ISO_DATE_LEN 20 +int raptor_rss_format_iso_date(char* buffer, size_t len, time_t unix_time); +int raptor_rss_set_date_field(raptor_rss_field* field, time_t unix_time); +int raptor_rss_date_uplift(raptor_rss_field* to_field, const unsigned char *date_string); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/raptor_rss_common.c b/src/raptor_rss_common.c new file mode 100644 index 0000000..b6db424 --- /dev/null +++ b/src/raptor_rss_common.c @@ -0,0 +1,732 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_rss_common.c - Raptor Feeds (RSS and Atom) common code + * + * Copyright (C) 2003-2009, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif + + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" +#include "raptor_rss.h" + + +static int raptor_rss_field_conversion_date_uplift(raptor_rss_field* from_field, raptor_rss_field* to_field); + + +const raptor_rss_namespace_info raptor_rss_namespaces_info[RAPTOR_RSS_NAMESPACES_SIZE]={ + { NULL, NULL, }, + { NULL, NULL, }, + { RSS0_91_NAMESPACE_URI, "rss091", }, + { RSS0_9_NAMESPACE_URI, NULL, }, + { RSS1_0_NAMESPACE_URI, "rss", }, + { ATOM0_3_NAMESPACE_URI, NULL, }, + { DC_NAMESPACE_URI, "dc", }, + { RSS2_0_ENC_NAMESPACE_URI, "enc", }, + { RSS1_1_NAMESPACE_URI, NULL, }, + { CONTENT_NAMESPACE_URI, "content", }, + { ATOM1_0_NAMESPACE_URI, "atom", }, + { RDF_NAMESPACE_URI, "rdf", }, + { ATOMTRIPLES_NAMESPACE_URI, "at", }, + { ITUNES_NAMESPACE_URI, "itunes", }, +}; + + +const raptor_rss_item_info raptor_rss_items_info[RAPTOR_RSS_COMMON_SIZE+1]={ + { "channel", RSS1_0_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE }, + { "image", RSS1_0_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE }, + { "textinput", RSS1_0_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE }, + { "item", RSS1_0_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE }, + { "author", ATOM1_0_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_RDF_ATOM_AUTHOR_CLASS, RAPTOR_RSS_FIELD_ATOM_AUTHOR }, + { "Link", ATOM1_0_NS, RAPTOR_RSS_ITEM_BLOCK, RAPTOR_RSS_RDF_ATOM_LINK_CLASS, RAPTOR_RSS_FIELD_ATOM_LINK }, + { "owner" , ITUNES_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_ITUNES_OWNER, RAPTOR_RSS_FIELD_ITUNES_OWNER }, + { "skipHours", RSS0_91_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE }, + { "skipDays", RSS0_91_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE }, + { "Enclosure", RSS2_0_ENC_NS, RAPTOR_RSS_ITEM_BLOCK, RAPTOR_RSS_RDF_ENCLOSURE_CLASS, RAPTOR_RSS_RDF_ENCLOSURE }, + { "category", ATOM1_0_NS, RAPTOR_RSS_ITEM_BLOCK, RAPTOR_RSS_RDF_ATOM_CATEGORY_CLASS, RAPTOR_RSS_FIELD_ATOM_CATEGORY }, + { "source" , RSS2_0_NS, RAPTOR_RSS_ITEM_BLOCK, RAPTOR_RSS_FIELD_SOURCE, RAPTOR_RSS_FIELD_NONE }, + { "feed", ATOM1_0_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE }, + { "entry", ATOM1_0_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE }, + { "", RSS_UNKNOWN_NS, RAPTOR_RSS_ITEM_CONTAINER, RAPTOR_RSS_FIELD_NONE, RAPTOR_RSS_FIELD_NONE } +}; + + +const raptor_rss_field_info raptor_rss_fields_info[RAPTOR_RSS_FIELDS_SIZE+2]={ + { "title", RSS1_0_NS, 0 }, + { "link", RSS1_0_NS, 0 }, /* Actually a URI but RSS 1.0 spec wants this as an (XML & RDF) literal */ + { "description", RSS1_0_NS, 0 }, + { "url", RSS1_0_NS, 0 }, + { "name", RSS1_0_NS, 0 }, + { "language", RSS0_91_NS, 0 }, + { "rating", RSS0_91_NS, 0 }, + { "copyright", RSS0_91_NS, 0 }, + { "pubDate", RSS0_91_NS, 0 }, + { "lastBuildDate", RSS0_91_NS, 0 }, + { "docs", RSS0_91_NS, RAPTOR_RSS_INFO_FLAG_URI_VALUE }, + { "managingEditor", RSS0_91_NS, 0 }, + { "webMaster", RSS0_91_NS, 0 }, + { "cloud", RSS0_92_NS, 0 }, + { "ttl", RSS2_0_NS, 0 }, + { "width", RSS0_91_NS, 0 }, + { "height", RSS0_91_NS, 0 }, + { "hour", RSS0_91_NS, 0 }, + { "day", RSS0_91_NS, 0 }, + { "generator", RSS0_92_NS, 0 }, + { "source", RSS0_92_NS, 0 }, + { "author", RSS2_0_NS, 0 }, + { "guid", RSS2_0_NS, 0 }, + { "enclosure", RSS2_0_NS, RAPTOR_RSS_INFO_FLAG_BLOCK_VALUE, RAPTOR_RSS_ENCLOSURE }, /* enclosure in RSS */ + { "enclosure", RSS2_0_ENC_NS, 0 }, /* RDF output predicate, not an RSS field */ + { "Enclosure", RSS2_0_ENC_NS, 0 }, /* RDF output class, not an RSS field */ + { "url", RSS2_0_ENC_NS, 0 }, /* In RDF output, not an RSS field */ + { "length", RSS2_0_ENC_NS, 0 }, /* In RDF output, not an RSS field */ + { "type", RSS2_0_ENC_NS, 0 }, /* In RDF output, not an RSS field */ + { "length", RSS2_0_NS, 0 }, + { "type", RSS2_0_NS, 0 }, + { "category", RSS0_92_NS, 0 }, + { "comments", RSS0_92_NS, 0 }, + { "items", RSS1_0_NS, 0 }, + { "image", RSS1_0_NS, 0 }, + { "textinput", RSS1_0_NS, 0 }, + + { "copyright", ATOM0_3_NS, 0 }, + { "created", ATOM0_3_NS, 0 }, + { "issued", ATOM0_3_NS, 0 }, + { "modified", ATOM0_3_NS, 0 }, + { "tagline", ATOM0_3_NS, 0 }, + + /* atom 1.0 required fields */ + { "id", ATOM1_0_NS, RAPTOR_RSS_INFO_FLAG_URI_VALUE }, + { "title", ATOM1_0_NS, 0 }, + { "updated", ATOM1_0_NS, 0 }, + /* atom 1.0 optional fields */ + { "author", ATOM1_0_NS, 0, RAPTOR_ATOM_AUTHOR }, + { "category", ATOM1_0_NS, RAPTOR_RSS_INFO_FLAG_BLOCK_VALUE, RAPTOR_ATOM_CATEGORY }, + { "content", ATOM1_0_NS, 0 }, + { "contributor", ATOM1_0_NS, 0 }, + { "email", ATOM1_0_NS, 0 }, + { "entry", ATOM1_0_NS, 0 }, + { "feed", ATOM1_0_NS, 0 }, + { "generator", ATOM1_0_NS, 0 }, + { "icon", ATOM1_0_NS, RAPTOR_RSS_INFO_FLAG_URI_VALUE }, + { "link", ATOM1_0_NS, RAPTOR_RSS_INFO_FLAG_BLOCK_VALUE, RAPTOR_ATOM_LINK }, + { "logo", ATOM1_0_NS, RAPTOR_RSS_INFO_FLAG_URI_VALUE }, + { "name", ATOM1_0_NS, 0 }, + { "published", ATOM1_0_NS, 0 }, + { "rights", ATOM1_0_NS, 0 }, + { "source", ATOM1_0_NS, RAPTOR_RSS_INFO_FLAG_BLOCK_VALUE, RAPTOR_RSS_SOURCE }, + { "subtitle", ATOM1_0_NS, 0 }, + { "summary", ATOM1_0_NS, 0 }, + { "uri", ATOM1_0_NS, 0 }, + + { "Author", ATOM1_0_NS, 0 }, + { "Category", ATOM1_0_NS, 0 }, + { "Link", ATOM1_0_NS, 0 }, + + { "label", ATOM1_0_NS, 0 }, + { "scheme", ATOM1_0_NS, RAPTOR_RSS_INFO_FLAG_URI_VALUE }, + { "term", ATOM1_0_NS, 0 }, + { "href", ATOM1_0_NS, RAPTOR_RSS_INFO_FLAG_URI_VALUE }, + { "rel", ATOM1_0_NS, 0 }, + { "type", ATOM1_0_NS, 0 }, + { "hreflang", ATOM1_0_NS, 0 }, + { "length", ATOM1_0_NS, 0 }, + + { "title", DC_NS, 0 }, + { "contributor", DC_NS, 0 }, + { "creator", DC_NS, 0 }, + { "publisher", DC_NS, 0 }, + { "subject", DC_NS, 0 }, + { "description", DC_NS, 0 }, + { "date", DC_NS, 0 }, + { "type", DC_NS, 0 }, + { "format", DC_NS, 0 }, + { "identifier", DC_NS, 0 }, + { "language", DC_NS, 0 }, + { "relation", DC_NS, 0 }, + { "source", DC_NS, 0 }, + { "coverage", DC_NS, 0 }, + { "rights", DC_NS, 0 }, + + { "encoded", CONTENT_NS, 0 }, + + { "contentType", ATOMTRIPLES_NS, 0 }, + + { "author", ITUNES_NS, 0 }, + { "subtitle", ITUNES_NS, 0 }, + { "summary", ITUNES_NS, 0 }, + { "keywords", ITUNES_NS, 0 }, + { "explicit", ITUNES_NS, 0 }, + { "image", ITUNES_NS, 0 }, + { "name", ITUNES_NS, 0 }, + { "owner", ITUNES_NS, 0 }, + { "block", ITUNES_NS, 0 }, + { "category", ITUNES_NS, 0 }, + { "email", ITUNES_NS, 0 }, + + + { "", RSS_UNKNOWN_NS, 0 }, + { "", RSS_UNKNOWN_NS, 0 } +}; + + +/* FIeld mappings from atom fields to RSS/DC */ +const raptor_field_pair raptor_atom_to_rss[]={ + /* rss clone of atom fields */ + { RAPTOR_RSS_FIELD_ATOM_SUMMARY, RAPTOR_RSS_FIELD_DESCRIPTION }, + { RAPTOR_RSS_FIELD_ATOM_ID, RAPTOR_RSS_FIELD_LINK }, + { RAPTOR_RSS_FIELD_ATOM_UPDATED, RAPTOR_RSS_FIELD_DC_DATE }, + { RAPTOR_RSS_FIELD_ATOM_RIGHTS, RAPTOR_RSS_FIELD_DC_RIGHTS }, + { RAPTOR_RSS_FIELD_ATOM_TITLE, RAPTOR_RSS_FIELD_TITLE }, + { RAPTOR_RSS_FIELD_ATOM_SUMMARY, RAPTOR_RSS_FIELD_CONTENT_ENCODED }, + + /* atom 0.3 to atom 1.0 */ + { RAPTOR_RSS_FIELD_ATOM_COPYRIGHT, RAPTOR_RSS_FIELD_ATOM_RIGHTS }, + { RAPTOR_RSS_FIELD_ATOM_TAGLINE, RAPTOR_RSS_FIELD_ATOM_SUBTITLE }, + +#if 0 + /* other old atom 0.3 fields - IGNORED */ + { RAPTOR_RSS_FIELD_ATOM_CREATED, RAPTOR_RSS_FIELD_UNKNOWN }, + { RAPTOR_RSS_FIELD_ATOM_ISSUED, RAPTOR_RSS_FIELD_UNKNOWN }, + { RAPTOR_RSS_FIELD_ATOM_MODIFIED, RAPTOR_RSS_FIELD_UNKNOWN }, +#endif + +#ifdef RAPTOR_PARSEDATE_FUNCTION + /* convert to ISO date */ + { RAPTOR_RSS_FIELD_PUBDATE, RAPTOR_RSS_FIELD_DC_DATE, + &raptor_rss_field_conversion_date_uplift }, +#endif + + /* rss content encoded */ + { RAPTOR_RSS_FIELD_DESCRIPTION, RAPTOR_RSS_FIELD_CONTENT_ENCODED }, + + { RAPTOR_RSS_FIELD_UNKNOWN, RAPTOR_RSS_FIELD_UNKNOWN } +}; + + +const raptor_rss_block_field_info raptor_rss_block_fields_info[RAPTOR_RSS_BLOCKS_SIZE+1] = { + /* + RSS 2 - optional element inside + attributes: + url (required): where the enclosure is located. url + length (required): how big enclosure it is in bytes. integer + type (required): what enclosure type is as a standard MIME type. string + content: empty + */ + { RAPTOR_RSS_ENCLOSURE, "url", RSS_BLOCK_FIELD_TYPE_URL, 0, RAPTOR_RSS_RDF_ENCLOSURE_URL }, + { RAPTOR_RSS_ENCLOSURE, "length", RSS_BLOCK_FIELD_TYPE_STRING, 0, RAPTOR_RSS_RDF_ENCLOSURE_LENGTH }, + { RAPTOR_RSS_ENCLOSURE, "type", RSS_BLOCK_FIELD_TYPE_STRING, 1, RAPTOR_RSS_RDF_ENCLOSURE_TYPE }, + + /* + RSS 2 - optional element inside + attributes: + url (required): location of source. url + content: source name. string + */ + { RAPTOR_RSS_SOURCE, "url", RSS_BLOCK_FIELD_TYPE_URL, 0 }, + + /* + Atom - optional element inside + attributes: + term (required): the category. string + scheme (optional): categorization scheme. url + label (optional): human-readable label. string + content: empty + */ + { RAPTOR_ATOM_CATEGORY, "term", RSS_BLOCK_FIELD_TYPE_STRING, 0, RAPTOR_RSS_FIELD_ATOM_TERM }, + { RAPTOR_ATOM_CATEGORY, "scheme", RSS_BLOCK_FIELD_TYPE_URL, 0, RAPTOR_RSS_FIELD_ATOM_SCHEME }, + { RAPTOR_ATOM_CATEGORY, "label", RSS_BLOCK_FIELD_TYPE_STRING, 1, RAPTOR_RSS_FIELD_ATOM_LABEL }, + + /* + Atom - optional element inside + attributes: + href (required): . url + rel (optional): . string + type (optional): . string + hreflang (optional): . string + title (optional): . string + length (optional): . string + content: empty + */ + { RAPTOR_ATOM_LINK, "href", RSS_BLOCK_FIELD_TYPE_URL, RAPTOR_RSS_LINK_HREF_URL_OFFSET, RAPTOR_RSS_FIELD_ATOM_HREF }, + { RAPTOR_ATOM_LINK, "rel", RSS_BLOCK_FIELD_TYPE_STRING, RAPTOR_RSS_LINK_REL_STRING_OFFSET, RAPTOR_RSS_FIELD_ATOM_REL }, + { RAPTOR_ATOM_LINK, "type", RSS_BLOCK_FIELD_TYPE_STRING, 1, RAPTOR_RSS_FIELD_ATOM_TYPE }, + { RAPTOR_ATOM_LINK, "hreflang", RSS_BLOCK_FIELD_TYPE_STRING, 2, RAPTOR_RSS_FIELD_ATOM_HREFLANG }, + { RAPTOR_ATOM_LINK, "title", RSS_BLOCK_FIELD_TYPE_STRING, 3, RAPTOR_RSS_FIELD_ATOM_TITLE }, + { RAPTOR_ATOM_LINK, "length", RSS_BLOCK_FIELD_TYPE_STRING, 4, RAPTOR_RSS_FIELD_ATOM_LENGTH }, + { RAPTOR_ATOM_LINK, NULL, RSS_BLOCK_FIELD_TYPE_URL, 0, RAPTOR_RSS_FIELD_ATOM_HREF }, + + /* sentinel */ + { RAPTOR_RSS_NONE, NULL, 0, 0 } +}; + + +const unsigned char * const raptor_atom_namespace_uri = (const unsigned char *)"http://www.w3.org/2005/Atom"; + + + +int +raptor_rss_common_init(raptor_world* world) { + int i; + raptor_uri *namespace_uri; + + if(world->rss_common_initialised++) + return 0; + + world->rss_namespaces_info_uris = RAPTOR_CALLOC(raptor_uri**, + RAPTOR_RSS_NAMESPACES_SIZE, + sizeof(raptor_uri*)); + if(!world->rss_namespaces_info_uris) + return -1; + for(i = 0; i < RAPTOR_RSS_NAMESPACES_SIZE;i++) { + const char *uri_string = raptor_rss_namespaces_info[i].uri_string; + if(uri_string) { + world->rss_namespaces_info_uris[i] = raptor_new_uri(world, (const unsigned char*)uri_string); + if(!world->rss_namespaces_info_uris[i]) + return -1; + } + } + + world->rss_types_info_uris = RAPTOR_CALLOC(raptor_uri**, + RAPTOR_RSS_COMMON_SIZE, + sizeof(raptor_uri*)); + if(!world->rss_types_info_uris) + return -1; + for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) { + int n = raptor_rss_items_info[i].nspace; + namespace_uri = world->rss_namespaces_info_uris[n]; + if(namespace_uri) { + world->rss_types_info_uris[i] = raptor_new_uri_from_uri_local_name(world, namespace_uri, (const unsigned char*)raptor_rss_items_info[i].name); + if(!world->rss_types_info_uris[i]) + return -1; + } + } + + world->rss_fields_info_uris = RAPTOR_CALLOC(raptor_uri**, + RAPTOR_RSS_FIELDS_SIZE, + sizeof(raptor_uri*)); + if(!world->rss_fields_info_uris) + return -1; + for(i = 0; i< RAPTOR_RSS_FIELDS_SIZE; i++) { + namespace_uri = world->rss_namespaces_info_uris[raptor_rss_fields_info[i].nspace]; + if(namespace_uri) { + world->rss_fields_info_uris[i] = raptor_new_uri_from_uri_local_name(world, namespace_uri, + (const unsigned char*)raptor_rss_fields_info[i].name); + if(!world->rss_fields_info_uris[i]) + return -1; + } + } + + return 0; +} + + +void +raptor_rss_common_terminate(raptor_world* world) { + int i; + if(--world->rss_common_initialised) + return; + + if(world->rss_types_info_uris) { + for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) { + if(world->rss_types_info_uris[i]) + raptor_free_uri(world->rss_types_info_uris[i]); + } + RAPTOR_FREE(raptor_uri* array, world->rss_types_info_uris); + world->rss_types_info_uris = NULL; + } + + if(world->rss_fields_info_uris) { + for(i = 0; i< RAPTOR_RSS_FIELDS_SIZE; i++) { + if(world->rss_fields_info_uris[i]) + raptor_free_uri(world->rss_fields_info_uris[i]); + } + RAPTOR_FREE(raptor_uri* array, world->rss_fields_info_uris); + world->rss_fields_info_uris = NULL; + } + + if(world->rss_namespaces_info_uris) { + for(i = 0; i < RAPTOR_RSS_NAMESPACES_SIZE;i++) { + if(world->rss_namespaces_info_uris[i]) + raptor_free_uri(world->rss_namespaces_info_uris[i]); + } + RAPTOR_FREE(raptor_uri* array, world->rss_namespaces_info_uris); + world->rss_namespaces_info_uris = NULL; + } +} + + +void +raptor_rss_model_init(raptor_world* world, raptor_rss_model* rss_model) +{ + memset(rss_model->common, 0, + sizeof(raptor_rss_item*) * RAPTOR_RSS_COMMON_SIZE); + + rss_model->world = world; + + rss_model->last = rss_model->items = NULL; + rss_model->items_count = 0; + + RAPTOR_RSS_RSS_items_URI(rss_model) = raptor_new_uri_relative_to_base(world, world->rss_namespaces_info_uris[RSS1_0_NS], (const unsigned char*)"items"); +} + + +void +raptor_rss_model_clear(raptor_rss_model* rss_model) +{ + int i; + raptor_rss_item* item; + + for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) { + item = rss_model->common[i]; + while(item) { + raptor_rss_item *next = item->next; + raptor_free_rss_item(item); + item = next; + } + } + + item = rss_model->items; + while(item) { + raptor_rss_item *next = item->next; + + raptor_free_rss_item(item); + item = next; + } + rss_model->last = rss_model->items = NULL; + + for(i = 0; i< RAPTOR_RSS_N_CONCEPTS; i++) { + raptor_uri* concept_uri = rss_model->concepts[i]; + if(concept_uri) { + raptor_free_uri(concept_uri); + rss_model->concepts[i] = NULL; + } + } +} + + +raptor_rss_item* +raptor_new_rss_item(raptor_world* world) +{ + raptor_rss_item* item; + + item = RAPTOR_CALLOC(raptor_rss_item*, 1, sizeof(*item)); + if(!item) + return NULL; + + item->world = world; + item->triples = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, (raptor_data_print_handler)raptor_statement_print); + if(!item->triples) { + RAPTOR_FREE(raptor_rss_item, item); + return NULL; + } + return item; +} + + +int +raptor_rss_model_add_item(raptor_rss_model* rss_model) +{ + raptor_rss_item* item; + + item = raptor_new_rss_item(rss_model->world); + if(!item) + return 1; + + /* new list */ + if(!rss_model->items) + rss_model->items = item; + + /* join last item to this one */ + if(rss_model->last) + rss_model->last->next = item; + + /* this is now the last item */ + rss_model->last = item; + rss_model->items_count++; + + RAPTOR_DEBUG2("Added item %d\n", rss_model->items_count); + + return 0; +} + + +raptor_rss_item* +raptor_rss_model_add_common(raptor_rss_model* rss_model, + raptor_rss_type type) +{ + raptor_rss_item* item; + + item = raptor_new_rss_item(rss_model->world); + if(!item) + return NULL; + + if(rss_model->common[type] == NULL) { + RAPTOR_DEBUG3("Adding common type %u - %s\n", type, + raptor_rss_items_info[type].name); + rss_model->common[type] = item; + } else { + raptor_rss_item* next; + RAPTOR_DEBUG3("Appending common type %u - %s\n", type, + raptor_rss_items_info[type].name); + for(next = rss_model->common[type]; next->next; next = next->next) + ; + next->next = item; + } + return item; +} + + +raptor_rss_item* +raptor_rss_model_get_common(raptor_rss_model* rss_model, raptor_rss_type type) +{ + raptor_rss_item* item; + for(item = rss_model->common[type]; + item && item->next; + item = item->next) ; + return item; +} + + +void +raptor_free_rss_item(raptor_rss_item* item) +{ + int i; + for(i = 0; i< RAPTOR_RSS_FIELDS_SIZE; i++) { + if(item->fields[i]) + raptor_rss_field_free(item->fields[i]); + } + if(item->blocks) + raptor_free_rss_block(item->blocks); + if(item->uri) + raptor_free_uri(item->uri); + if(item->term) + raptor_free_term(item->term); + if(item->triples) + raptor_free_sequence(item->triples); + + RAPTOR_FREE(raptor_rss_item, item); +} + + +void +raptor_rss_item_add_block(raptor_rss_item* item, + raptor_rss_block *block) +{ + if(!item->blocks) { + RAPTOR_DEBUG1("Adding first block\n"); + item->blocks = block; + } else { + raptor_rss_block *cur; + + RAPTOR_DEBUG1("Adding subsequent block\n"); + for(cur = item->blocks; cur->next; cur = cur->next) + ; + cur->next = block; + } +} + + +void +raptor_rss_item_add_field(raptor_rss_item* item, int type, + raptor_rss_field* field) +{ + if(!item->fields[type]) { + RAPTOR_DEBUG3("Adding first type %d field %s\n", type, raptor_rss_fields_info[type].name); + item->fields_count++; + item->fields[type] = field; + } else { + raptor_rss_field* cur; + + RAPTOR_DEBUG1("Adding subsequent field\n"); + for(cur = item->fields[type]; cur->next; cur = cur->next) ; + cur->next = field; + } +} + + +int +raptor_rss_item_equals_statement_subject(const raptor_rss_item *item, + const raptor_statement *statement) +{ + return raptor_term_equals(statement->subject, item->term); +} + + +int +raptor_rss_item_set_uri(raptor_rss_item *item, raptor_uri* uri) +{ + RAPTOR_DEBUG3("Set node %p to URI <%s>\n", RAPTOR_VOIDP(item), + raptor_uri_as_string(uri)); + + item->uri = raptor_uri_copy(uri); + if(!item->uri) + return 1; + + item->term = raptor_new_term_from_uri(item->world, item->uri); + return 0; +} + + +/* + * raptor_new_rss_block: + * @world: world + * @type: RSS block type + * @block_term: Block subject term (shared) + * + * INTERNAL - Create a new RSS Block such as etc + * + * Return value: new RSS block or NULL on failure + */ +raptor_rss_block* +raptor_new_rss_block(raptor_world* world, raptor_rss_type type, + raptor_term* block_term) +{ + raptor_rss_block *block; + block = RAPTOR_CALLOC(raptor_rss_block*, 1, sizeof(*block)); + + if(block) { + block->rss_type = type; + block->node_type = world->rss_types_info_uris[type]; + block->identifier = raptor_term_copy(block_term); + } + + return block; +} + + +void +raptor_free_rss_block(raptor_rss_block *block) +{ + int i; + + for(i = 0; i < RSS_BLOCK_MAX_URLS; i++) { + if(block->urls[i]) + raptor_free_uri(block->urls[i]); + } + + for(i = 0; i < RSS_BLOCK_MAX_STRINGS; i++) { + if(block->strings[i]) + RAPTOR_FREE(char*, block->strings[i]); + } + + if(block->next) + raptor_free_rss_block(block->next); + + if(block->identifier) + raptor_free_term(block->identifier); + + RAPTOR_FREE(raptor_rss_block, block); +} + + +raptor_rss_field* +raptor_rss_new_field(raptor_world* world) +{ + raptor_rss_field* field = RAPTOR_CALLOC(raptor_rss_field*, 1, sizeof(*field)); + if(field) + field->world = world; + return field; +} + + +void +raptor_rss_field_free(raptor_rss_field* field) +{ + if(field->value) + RAPTOR_FREE(char*, field->value); + if(field->uri) + raptor_free_uri(field->uri); + if(field->next) + raptor_rss_field_free(field->next); + RAPTOR_FREE(raptor_rss_field, field); +} + + +#define RAPTOR_ISO_DATE_FORMAT "%Y-%m-%dT%H:%M:%SZ" + +int +raptor_rss_format_iso_date(char* buffer, size_t len, time_t unix_time) +{ + struct tm* structured_time; + + if(len < RAPTOR_ISO_DATE_LEN) + return 1; + + structured_time = gmtime(&unix_time); + strftime(buffer, len+1, RAPTOR_ISO_DATE_FORMAT, structured_time); + + return 0; +} + + +int +raptor_rss_set_date_field(raptor_rss_field* field, time_t unix_time) +{ + size_t len = RAPTOR_ISO_DATE_LEN; + + if(field->value) + RAPTOR_FREE(char*, field->value); + field->value = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!field->value) + return 1; + + if(raptor_rss_format_iso_date((char*)field->value, len, unix_time)) { + RAPTOR_FREE(char*, field->value); + return 1; + } + + return 0; +} + + +static int +raptor_rss_field_conversion_date_uplift(raptor_rss_field* from_field, + raptor_rss_field* to_field) +{ +#ifdef RAPTOR_PARSEDATE_FUNCTION + time_t unix_time; + char *date_string = (char*)from_field->value; + + if(!date_string) + return 1; + + unix_time = RAPTOR_PARSEDATE_FUNCTION(date_string, NULL); + if(unix_time < 0) + return 1; + + return raptor_rss_set_date_field(to_field, unix_time); +#else + return 1; +#endif +} diff --git a/src/raptor_sax2.c b/src/raptor_sax2.c new file mode 100644 index 0000000..450f7ac --- /dev/null +++ b/src/raptor_sax2.c @@ -0,0 +1,1026 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_sax2.c - Raptor SAX2 API + * + * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* Define this for far too much output */ +#undef RAPTOR_DEBUG_CDATA + + +int +raptor_sax2_init(raptor_world* world) +{ + return 0; +} + + +void +raptor_sax2_finish(raptor_world* world) +{ +} + + +/** + * raptor_new_sax2: + * @world: raptor world + * @locator: raptor locator to use for errors + * @user_data: pointer context information to pass to SAX handlers + * + * Constructor - Create a new SAX2 with error handlers + * + * Return value: new #raptor_sax2 object or NULL on failure + */ +raptor_sax2* +raptor_new_sax2(raptor_world *world, raptor_locator *locator, + void* user_data) +{ + raptor_sax2* sax2; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!locator) + return NULL; + + raptor_world_open(world); + + sax2 = RAPTOR_CALLOC(raptor_sax2*, 1, sizeof(*sax2)); + if(!sax2) + return NULL; + +#ifdef RAPTOR_XML_LIBXML + sax2->magic = RAPTOR_LIBXML_MAGIC; +#endif + + sax2->world = world; + sax2->locator = locator; + sax2->user_data = user_data; + + sax2->enabled = 1; + + raptor_object_options_init(&sax2->options, RAPTOR_OPTION_AREA_SAX2); + + return sax2; +} + + +/** + * raptor_free_sax2: + * @sax2: SAX2 object + * + * Destructor - destroy a SAX2 object + */ +void +raptor_free_sax2(raptor_sax2 *sax2) +{ + raptor_xml_element *xml_element; + + if(!sax2) + return; + +#ifdef RAPTOR_XML_LIBXML + if(sax2->xc) { + raptor_libxml_free(sax2->xc); + sax2->xc = NULL; + } +#endif + + while( (xml_element = raptor_xml_element_pop(sax2)) ) + raptor_free_xml_element(xml_element); + + raptor_namespaces_clear(&sax2->namespaces); + + if(sax2->base_uri) + raptor_free_uri(sax2->base_uri); + + raptor_object_options_clear(&sax2->options); + + RAPTOR_FREE(raptor_sax2, sax2); +} + + +/** + * raptor_sax2_set_start_element_handler: + * @sax2: SAX2 object + * @handler: start element handler + * + * Set SAX2 start element handler. + */ +void +raptor_sax2_set_start_element_handler(raptor_sax2* sax2, + raptor_sax2_start_element_handler handler) +{ + sax2->start_element_handler = handler; +} + + +/** + * raptor_sax2_set_end_element_handler: + * @sax2: SAX2 object + * @handler: end element handler + * + * Set SAX2 end element handler. + */ +void +raptor_sax2_set_end_element_handler(raptor_sax2* sax2, + raptor_sax2_end_element_handler handler) +{ + sax2->end_element_handler = handler; +} + + +/** + * raptor_sax2_set_characters_handler: + * @sax2: SAX2 object + * @handler: characters handler + * + * Set SAX2 characters handler. + */ +void +raptor_sax2_set_characters_handler(raptor_sax2* sax2, + raptor_sax2_characters_handler handler) +{ + sax2->characters_handler = handler; +} + + +/** + * raptor_sax2_set_cdata_handler: + * @sax2: SAX2 object + * @handler: CDATA handler + * + * Set SAX2 CDATA handler. + */ +void +raptor_sax2_set_cdata_handler(raptor_sax2* sax2, + raptor_sax2_cdata_handler handler) +{ + sax2->cdata_handler = handler; +} + + +/** + * raptor_sax2_set_comment_handler: + * @sax2: SAX2 object + * @handler: comment handler + * + * Set SAX2 XML comment handler. + */ +void +raptor_sax2_set_comment_handler(raptor_sax2* sax2, + raptor_sax2_comment_handler handler) +{ + sax2->comment_handler = handler; +} + + +/** + * raptor_sax2_set_unparsed_entity_decl_handler: + * @sax2: SAX2 object + * @handler: unparsed entity declaration handler + * + * Set SAX2 XML unparsed entity declaration handler. + */ +void +raptor_sax2_set_unparsed_entity_decl_handler(raptor_sax2* sax2, + raptor_sax2_unparsed_entity_decl_handler handler) +{ + sax2->unparsed_entity_decl_handler = handler; +} + + +/** + * raptor_sax2_set_external_entity_ref_handler: + * @sax2: SAX2 object + * @handler: entity reference handler + * + * Set SAX2 XML entity reference handler. + */ +void +raptor_sax2_set_external_entity_ref_handler(raptor_sax2* sax2, + raptor_sax2_external_entity_ref_handler handler) +{ + sax2->external_entity_ref_handler = handler; +} + + +/** + * raptor_sax2_set_namespace_handler: + * @sax2: #raptor_sax2 object + * @handler: new namespace callback function + * + * Set the XML namespace handler function. + * + * When a prefix/namespace is seen in an XML parser, call the given + * @handler with the prefix string and the #raptor_uri namespace URI. + * Either can be NULL for the default prefix or default namespace. + * + * The handler function does not deal with duplicates so any + * namespace may be declared multiple times when a namespace is seen + * in different parts of a document. + * + */ +void +raptor_sax2_set_namespace_handler(raptor_sax2* sax2, + raptor_namespace_handler handler) +{ + sax2->namespace_handler = handler; +} + + +raptor_xml_element* +raptor_xml_element_pop(raptor_sax2 *sax2) +{ + raptor_xml_element *element = sax2->current_element; + + if(!element) + return NULL; + + sax2->current_element = element->parent; + if(sax2->root_element == element) /* just deleted root */ + sax2->root_element = NULL; + + return element; +} + + +void +raptor_xml_element_push(raptor_sax2 *sax2, raptor_xml_element* element) +{ + element->parent = sax2->current_element; + sax2->current_element = element; + if(!sax2->root_element) + sax2->root_element = element; +} + + +/** + * raptor_xml_element_is_empty: + * @xml_element: XML Element + * + * Check if an XML Element is empty. + * + * Return value: non-0 if the element is empty. + */ +int +raptor_xml_element_is_empty(raptor_xml_element* xml_element) +{ + return !xml_element->content_cdata_seen && + !xml_element->content_element_seen; +} + + +/** + * raptor_sax2_inscope_xml_language: + * @sax2: SAX2 object + * + * Get the in-scope XML language + * + * The result is a language string which may be "" if xml:lang="" is + * given. NULL is returned only if there is no xml:lang in any outer + * scope. + * + * Return value: shared pointer to the XML language or NULL if none is in scope. + */ +const unsigned char* +raptor_sax2_inscope_xml_language(raptor_sax2 *sax2) +{ + raptor_xml_element* xml_element; + + for(xml_element = sax2->current_element; + xml_element; + xml_element = xml_element->parent) { + if(xml_element->xml_language) + return xml_element->xml_language; + } + + return NULL; +} + + +/** + * raptor_sax2_inscope_base_uri: + * @sax2: SAX2 object + * + * Get the in-scope base URI + * + * Return value: the in-scope base URI shared object or NULL if none is in scope. + */ +raptor_uri* +raptor_sax2_inscope_base_uri(raptor_sax2 *sax2) +{ + raptor_xml_element *xml_element; + + for(xml_element = sax2->current_element; + xml_element; + xml_element = xml_element->parent) + if(xml_element->base_uri) + return xml_element->base_uri; + + return sax2->base_uri; +} + + +/** + * raptor_sax2_set_uri_filter: + * @sax2: SAX2 object + * @filter: URI filter function + * @user_data: User data to pass to filter function + * + * Set URI filter function for SAX2 internal retrievals. + **/ +void +raptor_sax2_set_uri_filter(raptor_sax2* sax2, + raptor_uri_filter_func filter, + void *user_data) +{ + sax2->uri_filter = filter; + sax2->uri_filter_user_data = user_data; +} + + +int +raptor_sax2_get_depth(raptor_sax2 *sax2) +{ + return sax2->depth; +} + +void +raptor_sax2_inc_depth(raptor_sax2 *sax2) +{ + sax2->depth++; +} + +void +raptor_sax2_dec_depth(raptor_sax2 *sax2) +{ + sax2->depth--; +} + + +static void raptor_sax2_simple_error(void* user_data, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +/* + * raptor_sax2_simple_error - Error from a sax2 - Internal + * + * Matches the raptor_simple_message_handler API but calls + * the sax2 error_handler + */ +static void +raptor_sax2_simple_error(void* user_data, const char *message, ...) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + va_list arguments; + + va_start(arguments, message); + + if(sax2) { + raptor_log_error_varargs(sax2->world, + RAPTOR_LOG_LEVEL_ERROR, + sax2->locator, + message, arguments); + } + + va_end(arguments); +} + + + +/** + * raptor_sax2_parse_start: + * @sax2: sax2 object + * @base_uri: base URI + * + * Start an XML SAX2 parse. + */ +void +raptor_sax2_parse_start(raptor_sax2* sax2, raptor_uri *base_uri) +{ + sax2->depth = 0; + sax2->root_element = NULL; + sax2->current_element = NULL; + + if(sax2->base_uri) + raptor_free_uri(sax2->base_uri); + if(base_uri) + sax2->base_uri = raptor_uri_copy(base_uri); + else + sax2->base_uri = NULL; + +#ifdef RAPTOR_XML_LIBXML + raptor_libxml_sax_init(sax2); + +#if LIBXML_VERSION < 20425 + sax2->first_read = 1; +#endif + + if(sax2->xc) { + raptor_libxml_free(sax2->xc); + sax2->xc = NULL; + } +#endif + + raptor_namespaces_clear(&sax2->namespaces); + + if(raptor_namespaces_init(sax2->world, &sax2->namespaces, 1)) { + /* log a fatal error and set sax2 to failed state + since the function signature does not currently support returning an error */ + raptor_log_error(sax2->world, RAPTOR_LOG_LEVEL_FATAL, sax2->locator, + "raptor_namespaces_init() failed"); + sax2->failed = 1; + } +} + + +/** + * raptor_sax2_parse_chunk: + * @sax2: sax2 object + * @buffer: input buffer + * @len: input buffer lenght + * @is_end: non-0 if end of data + * + * Parse a chunk of XML data generating SAX2 events + * + * Return value: non-0 on failure + */ +int +raptor_sax2_parse_chunk(raptor_sax2* sax2, const unsigned char *buffer, + size_t len, int is_end) +{ +#ifdef RAPTOR_XML_LIBXML + /* parser context */ + xmlParserCtxtPtr xc = sax2->xc; + int rc; + + if(!xc) { + int libxml_options = 0; + + if(!len) { + /* no data given at all */ + raptor_sax2_update_document_locator(sax2, sax2->locator); + raptor_log_error(sax2->world, RAPTOR_LOG_LEVEL_ERROR, sax2->locator, + "XML Parsing failed - no element found"); + return 1; + } + + xc = xmlCreatePushParserCtxt(&sax2->sax, sax2, /* user data */ + (char*)buffer, RAPTOR_BAD_CAST(int, len), + NULL); + if(!xc) + goto handle_error; + +#ifdef RAPTOR_LIBXML_XML_PARSE_NONET + if(RAPTOR_OPTIONS_GET_NUMERIC(sax2, RAPTOR_OPTION_NO_NET)) + libxml_options |= XML_PARSE_NONET; +#endif +#ifdef HAVE_XMLCTXTUSEOPTIONS + xmlCtxtUseOptions(xc, libxml_options); +#endif + + xc->userData = sax2; /* user data */ + xc->vctxt.userData = sax2; /* user data */ + xc->vctxt.error = (xmlValidityErrorFunc)raptor_libxml_validation_error; + xc->vctxt.warning = (xmlValidityWarningFunc)raptor_libxml_validation_warning; + xc->replaceEntities = 1; + + sax2->xc = xc; + + if(is_end) + len = 0; + else + return 0; + } + + if(!len) { + rc = xmlParseChunk(xc, (char*)buffer, 0, 1); + return rc; + } + + + /* This works around some libxml versions that fail to work + * if the buffer size is larger than the entire file + * and thus the entire parsing is done in one operation. + * + * The code below: + * 2.4.19 (oldest tested) to 2.4.24 - required + * 2.4.25 - works with or without it + * 2.4.26 or later - fails with this code + */ + +#if LIBXML_VERSION < 20425 + if(sax2->first_read && is_end) { + /* parse all but the last character */ + rc = xmlParseChunk(xc, (char*)buffer, len-1, 0); + if(rc && rc != XML_WAR_UNDECLARED_ENTITY) + goto handle_error; + /* last character */ + rc = xmlParseChunk(xc, (char*)buffer + (len-1), 1, 0); + if(rc && rc != XML_WAR_UNDECLARED_ENTITY) + goto handle_error; + /* end */ + xmlParseChunk(xc, (char*)buffer, 0, 1); + return 0; + } +#endif + +#if LIBXML_VERSION < 20425 + sax2->first_read = 0; +#endif + + rc = xmlParseChunk(xc, (char*)buffer, RAPTOR_BAD_CAST(int, len), is_end); + if(rc && rc != XML_WAR_UNDECLARED_ENTITY) /* libxml: non 0 is failure */ + goto handle_error; + if(is_end) + return 0; + + return rc; + + handle_error: +#endif + + return 1; +} + + +/** + * raptor_sax2_set_option: + * @sax2: #raptor_sax2 SAX2 object + * @option: option to set from enumerated #raptor_option values + * @string: string option value (or NULL) + * @integer: integer option value + * + * Set SAX2 option. + * + * If @string is not NULL and the option type is numeric, the string + * value is converted to an integer and used in preference to @integer. + * + * If @string is NULL and the option type is not numeric, an error is + * returned. + * + * The @string values used are copied. + * + * The allowed options are available via + * raptor_world_get_option_description(). + * + * Return value: non 0 on failure or if the option is unknown + */ +int +raptor_sax2_set_option(raptor_sax2 *sax2, raptor_option option, + char* string, int integer) +{ + return raptor_object_options_set_option(&sax2->options, option, + string, integer); +} + + +void +raptor_sax2_update_document_locator(raptor_sax2* sax2, + raptor_locator* locator) +{ +#ifdef RAPTOR_XML_LIBXML + raptor_libxml_update_document_locator(sax2, locator); +#endif +} + + +/* start of an element */ +void +raptor_sax2_start_element(void* user_data, const unsigned char *name, + const unsigned char **atts) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + raptor_qname* el_name; + unsigned char **xml_atts_copy = NULL; + size_t xml_atts_size = 0; + int all_atts_count = 0; + int ns_attributes_count = 0; + raptor_qname** named_attrs = NULL; + raptor_xml_element* xml_element = NULL; + unsigned char *xml_language = NULL; + raptor_uri *xml_base = NULL; + + if(sax2->failed || !sax2->enabled) + return; + +#ifdef RAPTOR_XML_LIBXML + if(atts) { + int i; + + /* Do XML attribute value normalization */ + for(i = 0; atts[i]; i += 2) { + unsigned char *value = (unsigned char*)atts[i+1]; + unsigned char *src = value; + unsigned char *dst = xmlStrdup(value); + + if(!dst) { + raptor_log_error(sax2->world, RAPTOR_LOG_LEVEL_FATAL, + sax2->locator, "Out of memory"); + return; + } + + atts[i+1] = dst; + + while(*src == 0x20 || *src == 0x0d || *src == 0x0a || *src == 0x09) + src++; + while(*src) { + if(*src == 0x20 || *src == 0x0d || *src == 0x0a || *src == 0x09) { + while(*src == 0x20 || *src == 0x0d || *src == 0x0a || *src == 0x09) + src++; + if(*src) + *dst++ = 0x20; + } else { + *dst++ = *src++; + } + } + *dst = '\0'; + xmlFree(value); + } + } +#endif + + raptor_sax2_inc_depth(sax2); + + if(atts) { + int i; + + /* Save passed in XML attributes pointers so we can + * NULL the pointers when they get handled below (various atts[i]=NULL) + */ + for(i = 0; atts[i]; i++) ; + xml_atts_size = sizeof(unsigned char*) * i; + if(xml_atts_size) { + xml_atts_copy = RAPTOR_MALLOC(unsigned char**, xml_atts_size); + if(!xml_atts_copy) + goto fail; + memcpy(xml_atts_copy, atts, xml_atts_size); + } + + /* XML attributes processing: + * xmlns* - XML namespaces (Namespaces in XML REC) + * Deleted and used to synthesise namespaces declarations + * xml:lang - XML language (XML REC) + * Deleted and optionally normalised to lowercase + * xml:base - XML Base (XML Base REC) + * Deleted and used to set the in-scope base URI for this XML element + */ + for(i = 0; atts[i]; i+= 2) { + all_atts_count++; + + if(strncmp((char*)atts[i], "xml", 3)) { + /* count and skip non xml* attributes */ + ns_attributes_count++; + continue; + } + + /* synthesise the XML namespace events */ + if(!memcmp((const char*)atts[i], "xmlns", 5)) { + const unsigned char *prefix = atts[i][5] ? &atts[i][6] : NULL; + const unsigned char *namespace_name = atts[i+1]; + + raptor_namespace* nspace; + nspace = raptor_new_namespace(&sax2->namespaces, + prefix, namespace_name, + raptor_sax2_get_depth(sax2)); + + if(nspace) { + raptor_namespaces_start_namespace(&sax2->namespaces, nspace); + + if(sax2->namespace_handler) + (*sax2->namespace_handler)(sax2->user_data, nspace); + } + } else if(!strcmp((char*)atts[i], "xml:lang")) { + size_t lang_len = strlen((char*)atts[i+1]); + xml_language = RAPTOR_MALLOC(unsigned char*, lang_len + 1); + if(!xml_language) { + raptor_log_error(sax2->world, RAPTOR_LOG_LEVEL_FATAL, + sax2->locator, "Out of memory"); + goto fail; + } + + /* optionally normalize language to lowercase */ + if(RAPTOR_OPTIONS_GET_NUMERIC(sax2, RAPTOR_OPTION_NORMALIZE_LANGUAGE)) { + unsigned char *from = (unsigned char*)atts[i+1]; + unsigned char *to = xml_language; + + while(*from) { + if(isupper(*from)) + *to++ = RAPTOR_GOOD_CAST(unsigned char, tolower(*from++)); + else + *to++ = *from++; + } + *to = '\0'; + } else + memcpy(xml_language, atts[i+1], lang_len + 1); /* Copy NUL */ + } else if(!strcmp((char*)atts[i], "xml:base")) { + raptor_uri* base_uri; + raptor_uri* xuri; + base_uri = raptor_sax2_inscope_base_uri(sax2); + xuri = raptor_new_uri_relative_to_base(sax2->world, base_uri, atts[i+1]); + xml_base = raptor_new_uri_for_xmlbase(xuri); + raptor_free_uri(xuri); + } + + /* delete all xml attributes whether processed above or not */ + atts[i] = NULL; + } + } + + + /* Create new element structure */ + el_name = raptor_new_qname(&sax2->namespaces, name, NULL); + if(!el_name) + goto fail; + +#ifdef __clang_analyzer__ + /* clang --analyze does not know about ownership of next call */ + if(xml_language) { + free(xml_language); xml_language = NULL; + } + if(xml_base) { + raptor_free_uri(xml_base); xml_base = NULL; + } +#endif + xml_element = raptor_new_xml_element(el_name, xml_language, xml_base); + if(!xml_element) { + raptor_free_qname(el_name); + goto fail; + } + /* xml_language,xml_base now owned by xml_element */ + xml_language = NULL; + xml_base = NULL; + + /* Turn string attributes into namespaced-attributes */ + if(ns_attributes_count) { + int i; + int offset = 0; + + /* Allocate new array to hold namespaced-attributes */ + named_attrs = RAPTOR_CALLOC(raptor_qname**, ns_attributes_count, + sizeof(raptor_qname*)); + if(!named_attrs) { + raptor_log_error(sax2->world, RAPTOR_LOG_LEVEL_FATAL, + sax2->locator, "Out of memory"); + goto fail; + } + + for(i = 0; i < all_atts_count; i++) { + raptor_qname* attr; + + /* Skip previously processed attributes */ + if(!atts[i<<1]) + continue; + + /* namespace-name[i] stored in named_attrs[i] */ + attr = raptor_new_qname(&sax2->namespaces, atts[i<<1], atts[(i<<1)+1]); + if(!attr) { /* failed - tidy up and return */ + int j; + + for(j = 0; j < i; j++) + RAPTOR_FREE(raptor_qname, named_attrs[j]); + RAPTOR_FREE(raptor_qname_array, named_attrs); + goto fail; + } + + named_attrs[offset++] = attr; + } + } /* end if ns_attributes_count */ + + + if(named_attrs) + raptor_xml_element_set_attributes(xml_element, + named_attrs, ns_attributes_count); + + raptor_xml_element_push(sax2, xml_element); + + if(sax2->start_element_handler) + sax2->start_element_handler(sax2->user_data, xml_element); + + if(xml_atts_copy) { + /* Restore passed in XML attributes, free the copy */ + memcpy((void*)atts, xml_atts_copy, xml_atts_size); + RAPTOR_FREE(cstringpointer, xml_atts_copy); + } + + return; + + fail: + if(xml_atts_copy) + RAPTOR_FREE(cstringpointer, xml_atts_copy); + if(xml_base) + raptor_free_uri(xml_base); + if(xml_language) + RAPTOR_FREE(char*, xml_language); + if(xml_element) + raptor_free_xml_element(xml_element); +} + + +/* end of an element */ +void +raptor_sax2_end_element(void* user_data, const unsigned char *name) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + raptor_xml_element* xml_element; + + if(sax2->failed || !sax2->enabled) + return; + + xml_element = sax2->current_element; + if(xml_element) { +#ifdef RAPTOR_DEBUG_VERBOSE + fprintf(stderr, "\nraptor_rdfxml_end_element_handler: End ns-element: "); + raptor_qname_print(stderr, xml_element->name); + fputc('\n', stderr); +#endif + + if(sax2->end_element_handler) + sax2->end_element_handler(sax2->user_data, xml_element); + } + + raptor_namespaces_end_for_depth(&sax2->namespaces, + raptor_sax2_get_depth(sax2)); + xml_element = raptor_xml_element_pop(sax2); + if(xml_element) + raptor_free_xml_element(xml_element); + + raptor_sax2_dec_depth(sax2); +} + + + + +/* characters */ +void +raptor_sax2_characters(void* user_data, const unsigned char *s, int len) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + + if(sax2->failed || !sax2->enabled) + return; + + if(sax2->characters_handler) + sax2->characters_handler(sax2->user_data, sax2->current_element, s, len); +} + + +/* like */ +void +raptor_sax2_cdata(void* user_data, const unsigned char *s, int len) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + + if(sax2->failed || !sax2->enabled) + return; + + if(sax2->cdata_handler) + sax2->cdata_handler(sax2->user_data, sax2->current_element, s, len); +} + + +/* comment */ +void +raptor_sax2_comment(void* user_data, const unsigned char *s) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + + if(sax2->failed || !sax2->enabled) + return; + + if(sax2->comment_handler) + sax2->comment_handler(sax2->user_data, sax2->current_element, s); +} + + +/* unparsed (NDATA) entity */ +void +raptor_sax2_unparsed_entity_decl(void* user_data, + const unsigned char* entityName, + const unsigned char* base, + const unsigned char* systemId, + const unsigned char* publicId, + const unsigned char* notationName) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + + if(sax2->failed || !sax2->enabled) + return; + + if(sax2->unparsed_entity_decl_handler) + sax2->unparsed_entity_decl_handler(sax2->user_data, + entityName, base, systemId, + publicId, notationName); +} + + +/* external entity reference */ +int +raptor_sax2_external_entity_ref(void* user_data, + const unsigned char* context, + const unsigned char* base, + const unsigned char* systemId, + const unsigned char* publicId) +{ + raptor_sax2* sax2 = (raptor_sax2*)user_data; + + if(sax2->failed || !sax2->enabled) + return 0; + + if(sax2->external_entity_ref_handler) + return sax2->external_entity_ref_handler(sax2->user_data, + context, base, systemId, publicId); + + raptor_sax2_simple_error((void*)sax2, + "Failed to handle external entity reference with base %s systemId %s publicId %s", + (base ? (const char*)base : "(None)"), + systemId, + (publicId ? (const char*)publicId: "(None)")); + + /* Failed to handle external entity reference */ + return 0; +} + + +/** + * raptor_sax2_check_load_uri_string: + * @sax2: SAX2 object + * @uri_string: URI or file URI or file name string + * + * INTERNAL - Check URI loading policy + * + * Return value: > 0 if it is OK to load the URI, 0 if not, < 0 on failure +*/ +int +raptor_sax2_check_load_uri_string(raptor_sax2* sax2, + const unsigned char* uri_string) +{ + raptor_uri* abs_uri; + const unsigned char* abs_uri_string; + int abs_uri_is_file; + int load_uri = 0; + + abs_uri = raptor_new_uri_from_uri_or_file_string(sax2->world, sax2->base_uri, + uri_string); + if(!abs_uri) + return -1; + + abs_uri_string = raptor_uri_as_string(abs_uri); + + abs_uri_is_file = raptor_uri_uri_string_is_file_uri(abs_uri_string); + if(abs_uri_is_file) + load_uri = !RAPTOR_OPTIONS_GET_NUMERIC(sax2, RAPTOR_OPTION_NO_FILE); + else + load_uri = !RAPTOR_OPTIONS_GET_NUMERIC(sax2, RAPTOR_OPTION_NO_NET); + + if(sax2->uri_filter) { + int rc = sax2->uri_filter(sax2->uri_filter_user_data, abs_uri); + if(rc) + load_uri = 0; + } + + RAPTOR_DEBUG4("URI '%s' Is a file? %s Load URI? %s\n", abs_uri_string, + (abs_uri_is_file > 0) ? "YES" : "NO", + (load_uri > 0) ? "YES" : "NO"); + + raptor_free_uri(abs_uri); + + return load_uri; +} diff --git a/src/raptor_sequence.c b/src/raptor_sequence.c new file mode 100644 index 0000000..c64ad1d --- /dev/null +++ b/src/raptor_sequence.c @@ -0,0 +1,895 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_sequence.c - Raptor sequence support + * + * Copyright (C) 2003-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + + +#include "raptor2.h" +#include "raptor_internal.h" + + +/* POLICY - minimum size */ +#define RAPTOR_SEQUENCE_MIN_CAPACITY 8 + + +#ifndef STANDALONE + +/* + * Sequence of maximum capacity C containing N data items + * + * array: + * 0 <-- N consecutive items --> C - 1 + * ----------------------------------------------------------- + * | | | data1 | ..... data N | ... | | + * ----------------------------------------------------------- + * ------ O -----> offset of first data item + * + * start = O + * size = N + * capacity = C + * + */ +struct raptor_sequence_s { + /* how many items are in the sequence 0..capacity */ + int size; + + /* length of the 'sequence' array below */ + int capacity; + + /* offset of the first data item in the sequence: 0..capacity-1 */ + int start; + + /* array of size 'capacity' pointing to the data */ + void **sequence; + + + /* handler to call to free a data item (or NULL) */ + raptor_data_free_handler free_handler; + + /* handler to call to print a data item (or NULL) */ + raptor_data_print_handler print_handler; + + + /* context pointer for @context_free_handler and @context_print_handler */ + void *handler_context; + + /* handler to call to free a data item (or NULL) also passing in + * as first arg the @handler_context */ + raptor_data_context_free_handler context_free_handler; + + /* handler to call to print a data item (or NULL) also passing in + * as first arg the @handler_context + */ + raptor_data_context_print_handler context_print_handler; +}; + + +static int raptor_sequence_ensure(raptor_sequence *seq, int capacity, int grow_at_front); + + +/** + * raptor_new_sequence: + * @free_handler: handler to free a sequence item + * @print_handler: handler to print a sequence item to a FILE* + * + * Constructor - create a new sequence with the given handlers. + * + * This creates a sequence over objects that need only the item data + * pointers in order to print or free the objects. + * + * For example sequences of strings could use handlers (free, NULL) + * and sequences of #raptor_uri could use (raptor_free_uri, + * raptor_print_uri) + * + * Return value: a new #raptor_sequence or NULL on failure + **/ +raptor_sequence* +raptor_new_sequence(raptor_data_free_handler free_handler, + raptor_data_print_handler print_handler) +{ + raptor_sequence* seq = RAPTOR_CALLOC(raptor_sequence*, 1, sizeof(*seq)); + if(!seq) + return NULL; + + seq->free_handler = free_handler; + seq->print_handler = print_handler; + + return seq; +} + + +/** + * raptor_new_sequence_with_context: + * @free_handler: handler to free a sequence item + * @print_handler: handler to print a sequence item to a FILE* + * @handler_context: context information to pass to free/print handlers + * + * Constructor - create a new sequence with the given handlers and handler context. + * + * This creates a sequence over objects that need context + item data + * pointers in order to print or free the objects. + * + * Return value: a new #raptor_sequence or NULL on failure + **/ +raptor_sequence* +raptor_new_sequence_with_context(raptor_data_context_free_handler free_handler, + raptor_data_context_print_handler print_handler, + void *handler_context) +{ + raptor_sequence* seq = RAPTOR_CALLOC(raptor_sequence*, 1, sizeof(*seq)); + if(!seq) + return NULL; + + seq->context_free_handler = free_handler; + seq->context_print_handler = print_handler; + seq->handler_context = handler_context; + + return seq; +} + + +/** + * raptor_free_sequence: + * @seq: sequence to destroy + * + * Destructor - free a #raptor_sequence + **/ +void +raptor_free_sequence(raptor_sequence* seq) +{ + int i; + int j; + + if(!seq) + return; + + if(seq->free_handler) { + for(i = seq->start, j = seq->start + seq->size; i < j; i++) + if(seq->sequence[i]) + seq->free_handler(seq->sequence[i]); + } else if(seq->context_free_handler) { + for(i = seq->start, j = seq->start + seq->size; i < j; i++) + if(seq->sequence[i]) + seq->context_free_handler(seq->handler_context, seq->sequence[i]); + } + + if(seq->sequence) + RAPTOR_FREE(ptrarray, seq->sequence); + + RAPTOR_FREE(raptor_sequence, seq); +} + + +static int +raptor_sequence_ensure(raptor_sequence *seq, int capacity, int grow_at_front) +{ + void **new_sequence; + int offset; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, 1); + + if(capacity && seq->capacity >= capacity) + return 0; + + /* POLICY - minimum size */ + if(capacity < RAPTOR_SEQUENCE_MIN_CAPACITY) + capacity = RAPTOR_SEQUENCE_MIN_CAPACITY; + + new_sequence = RAPTOR_CALLOC(void**, capacity, sizeof(void*)); + if(!new_sequence) + return 1; + + offset = (grow_at_front ? (capacity - seq->capacity) : 0) + seq->start; + if(seq->size) { + memcpy(&new_sequence[offset], &seq->sequence[seq->start], + sizeof(void*) * seq->size); + RAPTOR_FREE(ptrarray, seq->sequence); + } + seq->start = offset; + + seq->sequence = new_sequence; + seq->capacity = capacity; + + return 0; +} + + +/** + * raptor_sequence_size: + * @seq: sequence object + * + * Get the number of items in a sequence. + * + * Return value: the sequence size (>=0) + **/ +int +raptor_sequence_size(raptor_sequence* seq) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, -1); + + return seq->size; +} + + +/* Store methods */ + +/** + * raptor_sequence_set_at: + * @seq: sequence object + * @idx: index into sequence to operate at + * @data: new data item. + * + * Replace/set an item in a sequence. + * + * The item at the offset @idx in the sequence is replaced with the + * new item @data (which may be NULL). Any existing item is freed + * with the sequence's free_handler. If necessary the sequence + * is extended (with NULLs) to handle a larger offset. + * + * The sequence takes ownership of the new data item. On failure, the + * item is freed immediately. + * + * Return value: non-0 on failure + **/ +int +raptor_sequence_set_at(raptor_sequence* seq, int idx, void *data) +{ + int need_capacity; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, 1); + + /* Cannot provide a negative index */ + if(idx < 0) { + if(data) { + if(seq->free_handler) + seq->free_handler(data); + else if(seq->context_free_handler) + seq->context_free_handler(seq->handler_context, data); + } + return 1; + } + + need_capacity = seq->start + idx + 1; + if(need_capacity > seq->capacity) { + if(seq->capacity * 2 > need_capacity) + need_capacity = seq->capacity * 2; + + if(raptor_sequence_ensure(seq, need_capacity, 0)) { + if(data) { + if(seq->free_handler) + seq->free_handler(data); + else if(seq->context_free_handler) + seq->context_free_handler(seq->handler_context, data); + } + return 1; + } + } + + if(idx < seq->size) { + /* if there is old data, delete it if there is a free handler */ + if(seq->sequence[seq->start + idx]) { + if(seq->free_handler) + seq->free_handler(seq->sequence[seq->start + idx]); + else if(seq->context_free_handler) + seq->context_free_handler(seq->handler_context, + seq->sequence[seq->start + idx]); + } + /* size remains the same */ + } else { + /* if there is no old data, size is increasing */ + /* make sure there are seq->size items starting from seq->start */ + seq->size = idx + 1; + } + + seq->sequence[seq->start + idx] = data; + + return 0; +} + + + +/** + * raptor_sequence_push: + * @seq: sequence to add to + * @data: item to add + * + * Add an item to the end of the sequence. + * + * The sequence takes ownership of the pushed item and frees it with the + * free_handler. On failure, the item is freed immediately. + * + * Return value: non-0 on failure + **/ +int +raptor_sequence_push(raptor_sequence* seq, void *data) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, 1); + + if(seq->start + seq->size == seq->capacity) { + if(raptor_sequence_ensure(seq, seq->capacity * 2, 0)) { + if(data) { + if(seq->free_handler) + seq->free_handler(data); + else if(seq->context_free_handler) + seq->context_free_handler(seq->handler_context, data); + } + return 1; + } + } + + seq->sequence[seq->start + seq->size] = data; + seq->size++; + + return 0; +} + + +/** + * raptor_sequence_shift: + * @seq: sequence to add to + * @data: item to add + * + * Add an item to the start of the sequence. + * + * The sequence takes ownership of the shifted item and frees it with the + * free_handler. On failure, the item is freed immediately. + * + * Return value: non-0 on failure + **/ +int +raptor_sequence_shift(raptor_sequence* seq, void *data) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, 1); + + if(!seq->start) { + if(raptor_sequence_ensure(seq, seq->capacity * 2, 1)) { + if(data) { + if(seq->free_handler) + seq->free_handler(data); + else if(seq->context_free_handler) + seq->context_free_handler(seq->handler_context, data); + } + return 1; + } + } + + seq->sequence[--seq->start] = data; + seq->size++; + + return 0; +} + + +/** + * raptor_sequence_get_at: + * @seq: sequence to use + * @idx: index of item to get + * + * Retrieve an item at offset @index in the sequence. + * + * This is efficient to perform. #raptor_sequence is optimised + * to append/remove from the end of the sequence. + * + * After this call the item is still owned by the sequence. + * + * Return value: the object or NULL if @index is out of range (0... sequence size - 1) + **/ +void* +raptor_sequence_get_at(raptor_sequence* seq, int idx) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, NULL); + + if(idx < 0 || idx > seq->size - 1) + return NULL; + + return seq->sequence[seq->start + idx]; +} + + +/** + * raptor_sequence_delete_at: + * @seq: sequence object + * @idx: index into sequence to operate at + * + * Remove an item from a position a sequence, returning it + * + * The item at the offset @idx in the sequence is replaced with a + * NULL pointer and any existing item is returned. The caller + * owns the resulting item. + * + * Return value: NULL on failure + **/ +void* +raptor_sequence_delete_at(raptor_sequence* seq, int idx) +{ + void* data; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, NULL); + + if(idx < 0 || idx > seq->size - 1) + return NULL; + + data = seq->sequence[seq->start + idx]; + seq->sequence[seq->start + idx] = NULL; + + return data; +} + + + +/** + * raptor_sequence_pop: + * @seq: sequence to use + * + * Retrieve the item at the end of the sequence. + * + * Ownership of the item is transferred to the caller, + * i.e. caller is responsible of freeing the item. + * + * Return value: the object or NULL if the sequence is empty + **/ +void* +raptor_sequence_pop(raptor_sequence* seq) +{ + void *data; + int i; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, NULL); + + if(!seq->size) + return NULL; + + seq->size--; + i = seq->start + seq->size; + data = seq->sequence[i]; + seq->sequence[i] = NULL; + + return data; +} + + +/** + * raptor_sequence_unshift: + * @seq: sequence to use + * + * Retrieve the item at the start of the sequence. + * + * Ownership of the item is transferred to the caller, + * i.e. caller is responsible of freeing the item. + * + * Return value: the object or NULL if the sequence is empty + **/ +void* +raptor_sequence_unshift(raptor_sequence* seq) +{ + void *data; + int i; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, NULL); + + if(!seq->size) + return NULL; + + i = seq->start++; + data = seq->sequence[i]; + seq->size--; + seq->sequence[i] = NULL; + + return data; +} + + +/** + * raptor_sequence_sort: + * @seq: sequence to sort + * @compare: comparison function with args (a, b) + * + * Sort a sequence inline + * + * The comparison function @compare is compatible with that used for + * qsort() and provides the addresses of pointers to the data that + * must be dereferenced to get to the stored sequence data. + * + **/ +RAPTOR_EXTERN_C +void +raptor_sequence_sort(raptor_sequence* seq, raptor_data_compare_handler compare) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(seq, raptor_sequence); + + if(seq->size > 1) + qsort(&seq->sequence[seq->start], seq->size, sizeof(void*), compare); +} + + +/** + * raptor_sequence_sort_r: + * @seq: sequence to sort + * @compare: comparison function with args (a, b, user data) + * @user_data: User data argument for @compare + * + * Sort a sequence inline with user data + * + * The comparison function @compare_r is compatible with that used + * for raptor_sort_r() and provides the addresses of pointers to the + * data that must be dereferenced to get to the stored sequence data. + * + **/ +RAPTOR_EXTERN_C +void +raptor_sequence_sort_r(raptor_sequence* seq, + raptor_data_compare_arg_handler compare, + void* user_data) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(seq, raptor_sequence); + + if(seq->size > 1) + raptor_sort_r(&seq->sequence[seq->start], seq->size, sizeof(void*), + compare, user_data); +} + + +/** + * raptor_sequence_print: + * @seq: sequence to sort + * @fh: file handle + * + * Print the sequence contents using the print_handler to print the data items. + * + * Return value: non-0 on failure + */ +int +raptor_sequence_print(raptor_sequence* seq, FILE* fh) +{ + int rc = 0; + int i; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, 1); + + fputc('[', fh); + for(i = 0; i < seq->size; i++) { + if(i) + fputs(", ", fh); + if(seq->sequence[seq->start + i]) { + if(seq->print_handler) + seq->print_handler(seq->sequence[seq->start + i], fh); + else if(seq->context_print_handler) + seq->context_print_handler(seq->handler_context, + seq->sequence[seq->start + i], fh); + } else + fputs("(empty)", fh); + } + fputc(']', fh); + + return rc; +} + + +/** + * raptor_sequence_join: + * @dest: #raptor_sequence destination sequence + * @src: #raptor_sequence source sequence + * + * Join two sequences moving all items from one sequence to the end of another. + * + * After this operation, sequence src will be empty (zero size) but + * will have the same item capacity as before. + * + * Return value: non-0 on failure + */ +int +raptor_sequence_join(raptor_sequence* dest, raptor_sequence *src) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(dest, raptor_sequence, 1); + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(src, raptor_sequence, 1); + + if(raptor_sequence_ensure(dest, dest->size + src->size, 0)) + return 1; + + memcpy(&dest->sequence[dest->start + dest->size], &src->sequence[src->start], + sizeof(void*) * src->size); + dest->size += src->size; + + src->size = 0; + + return 0; +} + + +/** + * raptor_sequence_swap: + * @seq: sequence + * @i: first data index + * @j: second data index + * + * Swap a pair of elements in a sequence + * + * Return value: non-0 if arguments are out of range + */ +int +raptor_sequence_swap(raptor_sequence* seq, int i, int j) +{ + if(i < 0 || i >= seq->size || j < 0 || j >= seq->size) + return 1; + + if(i != j) { + void* tmp = seq->sequence[i]; + seq->sequence[i] = seq->sequence[j]; + seq->sequence[j] = tmp; + } + + return 0; +} + + +/** + * raptor_sequence_reverse: + * @seq: sequence + * @start_index: starting index + * @length: number of elements to reverse + * + * Reverse a range of elements + * + * Return value: non-0 if arguments are out of range + */ +int +raptor_sequence_reverse(raptor_sequence* seq, int start_index, int length) +{ + int end_index = start_index + length - 1; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(seq, raptor_sequence, 1); + + if(end_index >= seq->size || start_index < 1 || length <= 1) + return 1; + + while( (start_index != end_index) && (start_index != end_index + 1) ) { + raptor_sequence_swap(seq, start_index, end_index); + start_index++; end_index--; + } + + return 0; +} + + +/** + * raptor_sequence_next_permutation: + * @seq: int seq + * @compare: comparison function + * + * Get the next permutation of a sequence in lexicographic order + * + * Assumes the initial order of the items is lexicographically + * increasing. This function alters the order of the items until the + * last permuatation is done at which point the contents is reset to + * the intial order. + * + * Algorithm used is described in http://en.wikipedia.org/wiki/Permutation + * + * The comparison function @compare is compatible with that used for + * qsort() and provides the addresses of pointers to the data that + * must be dereferenced to get to the stored sequence data. + * + * Return value: non-0 at the last permutation + */ +RAPTOR_EXTERN_C +int +raptor_sequence_next_permutation(raptor_sequence *seq, + raptor_data_compare_handler compare) +{ + int k; + int l; + void* temp; + + if(seq->size < 2) + return 1; + + /* 1. Find the largest index k such that a[k] < a[k + 1]. If no such + * index exists, the permutation is the last permutation. + */ + k = seq->size - 2; + while(k >= 0 && compare(seq->sequence[k], seq->sequence[k + 1]) >= 0) + k--; + + if(k == -1) { + /* done - reset to starting order */ + raptor_sequence_reverse(seq, 0, seq->size); + return 1; + } + + /* 2. Find the largest index l such that a[k] < a[l]. Since k + 1 + * is such an index, l is well defined and satisfies k < l. + */ + l = seq->size - 1; + while( compare(seq->sequence[k], seq->sequence[l]) >= 0) + l--; + + /* 3. Swap a[k] with a[l]. */ +#if 1 + temp = seq->sequence[k]; + seq->sequence[k] = seq->sequence[l]; + seq->sequence[l] = temp; +#else + raptor_sequence_swap(seq, k, l); +#endif + + /* 4. Reverse the sequence from a[k + 1] up to and including the + * final element a[n]. + */ + raptor_sequence_reverse(seq, k + 1, seq->size - (k + 1)); + + return 0; +} + + +#endif + + + +#ifdef STANDALONE +#include + +int main(int argc, char *argv[]); + +static int +raptor_compare_strings(const void *a, const void *b) +{ + return strcmp(*(char**)a, *(char**)b); +} + +static int +raptor_sequence_print_string(void *data, FILE *fh) +{ + fputs((char*)data, fh); + return 0; +} + +#define assert_match_string(function, expr, string) do { char *result = expr; if(strcmp(result, string)) { fprintf(stderr, "%s:" #function " failed - returned %s, expected %s\n", program, result, string); exit(1); } } while(0) +#define assert_match_int(function, expr, value) do { int result = expr; if(result != value) { fprintf(stderr, "%s:" #function " failed - returned %d, expected %d\n", program, result, value); exit(1); } } while(0) + +int +main(int argc, char *argv[]) +{ + const char *program = raptor_basename(argv[0]); + raptor_sequence* seq1 = raptor_new_sequence(NULL, raptor_sequence_print_string); + raptor_sequence* seq2 = raptor_new_sequence(NULL, raptor_sequence_print_string); + char *s; + int i; + + if(raptor_sequence_pop(seq1) || raptor_sequence_unshift(seq1)) { + fprintf(stderr, "%s: should not be able to pop/unshift from an empty sequence\n", program); + exit(1); + } + + raptor_sequence_set_at(seq1, 0, (void*)"first"); + + raptor_sequence_push(seq1, (void*)"third"); + + raptor_sequence_shift(seq1, (void*)"second"); + + s = (char*)raptor_sequence_get_at(seq1, 0); + assert_match_string(raptor_sequence_get_at, s, "second"); + + s = (char*)raptor_sequence_get_at(seq1, 1); + assert_match_string(raptor_sequence_get_at, s, "first"); + + s = (char*)raptor_sequence_get_at(seq1, 2); + assert_match_string(raptor_sequence_get_at, s, "third"); + + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq1), 3); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: sequence after additions: ", program); + raptor_sequence_print(seq1, stderr); + fputc('\n', stderr); +#endif + + /* now made alphabetical i.e. first, second, third */ + raptor_sequence_sort(seq1, raptor_compare_strings); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: sequence after sort: ", program); + raptor_sequence_print(seq1, stderr); + fputc('\n', stderr); +#endif + + s = (char*)raptor_sequence_pop(seq1); + assert_match_string(raptor_sequence_get_at, s, "third"); + + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq1), 2); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: sequence after pop: ", program); + raptor_sequence_print(seq1, stderr); + fputc('\n', stderr); +#endif + + s = (char*)raptor_sequence_unshift(seq1); + assert_match_string(raptor_sequence_get_at, s, "first"); + + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq1), 1); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: sequence after unshift: ", program); + raptor_sequence_print(seq1, stderr); + fputc('\n', stderr); +#endif + + s = (char*)raptor_sequence_get_at(seq1, 0); + assert_match_string(raptor_sequence_get_at, s, "second"); + + raptor_sequence_push(seq2, (void*)"first.2"); + if(raptor_sequence_join(seq2, seq1)) { + fprintf(stderr, "%s: raptor_sequence_join failed\n", program); + exit(1); + } + + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq1), 0); + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq2), 2); + + raptor_free_sequence(seq1); + raptor_free_sequence(seq2); + + /* test sequence growing */ + + seq1 = raptor_new_sequence(NULL, raptor_sequence_print_string); + for(i = 0; i < 100; i++) + if(raptor_sequence_shift(seq1, (void*)"foo")) { + fprintf(stderr, "%s: raptor_sequence_shift failed\n", program); + exit(1); + } + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq1), 100); + for(i = 0; i < 100; i++) + raptor_sequence_unshift(seq1); + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq1), 0); + raptor_free_sequence(seq1); + + seq1 = raptor_new_sequence(NULL, raptor_sequence_print_string); + for(i = 0; i < 100; i++) + if(raptor_sequence_push(seq1, (void*)"foo")) { + fprintf(stderr, "%s: raptor_sequence_push failed\n", program); + exit(1); + } + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq1), 100); + for(i = 0; i < 100; i++) + raptor_sequence_pop(seq1); + assert_match_int(raptor_sequence_size, raptor_sequence_size(seq1), 0); + raptor_free_sequence(seq1); + + return (0); +} +#endif diff --git a/src/raptor_serialize.c b/src/raptor_serialize.c new file mode 100644 index 0000000..bf9f81e --- /dev/null +++ b/src/raptor_serialize.c @@ -0,0 +1,791 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize.c - Raptor Serializer API + * + * Copyright (C) 2004-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* prototypes for helper functions */ +static raptor_serializer_factory* raptor_get_serializer_factory(raptor_world* world, const char *name); + + +/* helper methods */ + +static void +raptor_free_serializer_factory(raptor_serializer_factory* factory) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(factory, raptor_serializer_factory); + + if(factory->finish_factory) + factory->finish_factory(factory); + + RAPTOR_FREE(raptor_serializer_factory, factory); +} + + +/* class methods */ + +int +raptor_serializers_init(raptor_world* world) +{ + int rc = 0; + + world->serializers = raptor_new_sequence((raptor_data_free_handler)raptor_free_serializer_factory, NULL); + if(!world->serializers) + return 1; + +#ifdef RAPTOR_SERIALIZER_NTRIPLES + rc += raptor_init_serializer_ntriples(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_TURTLE + rc += raptor_init_serializer_turtle(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_MKR + rc += raptor_init_serializer_mkr(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_RDFXML_ABBREV + rc += raptor_init_serializer_rdfxmla(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_RDFXML + rc += raptor_init_serializer_rdfxml(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_RSS_1_0 + rc += raptor_init_serializer_rss10(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_ATOM + rc += raptor_init_serializer_atom(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_DOT + rc += raptor_init_serializer_dot(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_JSON + rc += raptor_init_serializer_json(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_HTML + rc += raptor_init_serializer_html(world) != 0; +#endif + +#ifdef RAPTOR_SERIALIZER_NQUADS + rc += raptor_init_serializer_nquads(world) != 0; +#endif + + return rc; +} + + +/* + * raptor_serializers_finish - delete all the registered serializers + */ +void +raptor_serializers_finish(raptor_world* world) +{ + if(world->serializers) { + raptor_free_sequence(world->serializers); + world->serializers = NULL; + } +} + + +/* + * raptor_serializer_register_factory: + * @world: raptor_world object + * @name: the short syntax name + * @label: readable label for syntax + * @mime_type: MIME type of the syntax generated by the serializer (or NULL) + * @uri_string: URI string of the syntax (or NULL) + * @factory: pointer to function to call to register the factory + * + * INTERNAL - Register a syntax that can be generated by a serializer factory + * + * Return value: non-0 on failure + **/ +RAPTOR_EXTERN_C +raptor_serializer_factory* +raptor_serializer_register_factory(raptor_world* world, + int (*factory) (raptor_serializer_factory*)) +{ + raptor_serializer_factory *serializer; + + serializer = RAPTOR_CALLOC(raptor_serializer_factory*, 1, sizeof(*serializer)); + if(!serializer) + return NULL; + + serializer->world = world; + + serializer->desc.mime_types = NULL; + + if(raptor_sequence_push(world->serializers, serializer)) + return NULL; /* on error, serializer is already freed by the sequence */ + + /* Call the serializer registration function on the new object */ + if(factory(serializer)) + return NULL; /* serializer is owned and freed by the serializers sequence */ + + if(raptor_syntax_description_validate(&serializer->desc)) { + raptor_log_error(world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Serializer description failed to validate\n"); + goto tidy; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Registered serializer %s\n", serializer->desc.names[0]); +#endif + + return serializer; + + /* Clean up on failure */ + tidy: + raptor_free_serializer_factory(serializer); + return NULL; +} + + +/** + * raptor_get_serializer_factory: + * @world: raptor_world object + * @name: the factory name or NULL for the default factory + * + * Get a serializer factory by name. + * + * Return value: the factory object or NULL if there is no such factory + **/ +static raptor_serializer_factory* +raptor_get_serializer_factory(raptor_world* world, const char *name) +{ + raptor_serializer_factory *factory = NULL; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL); + + raptor_world_open(world); + + /* return 1st serializer if no particular one wanted - why? */ + if(!name) { + factory = (raptor_serializer_factory *)raptor_sequence_get_at(world->serializers, 0); + if(!factory) { + RAPTOR_DEBUG1("No (default) serializers registered\n"); + return NULL; + } + } else { + int i; + + for(i = 0; + (factory = (raptor_serializer_factory*)raptor_sequence_get_at(world->serializers, i)); + i++) { + int namei; + const char* fname; + + for(namei = 0; (fname = factory->desc.names[namei]); namei++) { + if(!strcmp(fname, name)) + break; + } + if(fname) + break; + } + } + + return factory; +} + + +/** + * raptor_world_get_serializers_count: + * @world: world object + * + * Get number of serializers + * + * Return value: number of serializers or <0 on failure + **/ +int +raptor_world_get_serializers_count(raptor_world* world) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1); + + raptor_world_open(world); + + return raptor_sequence_size(world->serializers); +} + + +/** + * raptor_world_get_serializer_description: + * @world: world object + * @counter: index into the list of serializers + * + * Get serializer descriptive syntax information + * + * Return value: description or NULL if counter is out of range + **/ +const raptor_syntax_description* +raptor_world_get_serializer_description(raptor_world* world, + unsigned int counter) +{ + raptor_serializer_factory *factory; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL); + + raptor_world_open(world); + + factory = (raptor_serializer_factory*)raptor_sequence_get_at(world->serializers, + counter); + + if(!factory) + return NULL; + + return &factory->desc; +} + + +/** + * raptor_world_is_serializer_name: + * @world: raptor_world object + * @name: the syntax name + * + * Check name of a serializer. + * + * Return value: non 0 if name is a known syntax name + */ +int +raptor_world_is_serializer_name(raptor_world* world, const char *name) +{ + if(!name) + return 0; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, 0); + + raptor_world_open(world); + + return (raptor_get_serializer_factory(world, name) != NULL); +} + + +/** + * raptor_new_serializer: + * @world: raptor_world object + * @name: the serializer name or NULL for default syntax + * + * Constructor - create a new raptor_serializer object. + * + * Return value: a new #raptor_serializer object or NULL on failure + */ +raptor_serializer* +raptor_new_serializer(raptor_world* world, const char *name) +{ + raptor_serializer_factory* factory; + raptor_serializer* rdf_serializer; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + factory = raptor_get_serializer_factory(world, name); + if(!factory) + return NULL; + + rdf_serializer = RAPTOR_CALLOC(raptor_serializer*, 1, sizeof(*rdf_serializer)); + if(!rdf_serializer) + return NULL; + + rdf_serializer->world = world; + + rdf_serializer->context = RAPTOR_CALLOC(void*, 1, factory->context_length); + if(!rdf_serializer->context) { + raptor_free_serializer(rdf_serializer); + return NULL; + } + + rdf_serializer->factory = factory; + + raptor_object_options_init(&rdf_serializer->options, + RAPTOR_OPTION_AREA_SERIALIZER); + + if(factory->init(rdf_serializer, name)) { + raptor_free_serializer(rdf_serializer); + return NULL; + } + + return rdf_serializer; +} + + +/** + * raptor_serializer_start_to_iostream: + * @rdf_serializer: the #raptor_serializer + * @uri: base URI or NULL if no base URI is required + * @iostream: #raptor_iostream to write serialization to + * + * Start serialization to an iostream with given base URI + * + * The passed in @iostream does not become owned by the serializer + * and can be used by the caller after serializing is done. It + * must be destroyed by the caller. + * + * Return value: non-0 on failure. + **/ +int +raptor_serializer_start_to_iostream(raptor_serializer *rdf_serializer, + raptor_uri *uri, raptor_iostream *iostream) +{ + if(rdf_serializer->base_uri) + raptor_free_uri(rdf_serializer->base_uri); + + if(!iostream) + return 1; + + if(uri) + uri = raptor_uri_copy(uri); + + rdf_serializer->base_uri = uri; + rdf_serializer->locator.uri = uri; + rdf_serializer->locator.line = rdf_serializer->locator.column = 0; + + rdf_serializer->iostream = iostream; + + rdf_serializer->free_iostream_on_end = 0; + + if(rdf_serializer->factory->serialize_start) + return rdf_serializer->factory->serialize_start(rdf_serializer); + return 0; +} + + +/** + * raptor_serializer_start_to_filename: + * @rdf_serializer: the #raptor_serializer + * @filename: filename to serialize to + * + * Start serializing to a filename. + * + * Return value: non-0 on failure. + **/ +int +raptor_serializer_start_to_filename(raptor_serializer *rdf_serializer, + const char *filename) +{ + unsigned char *uri_string = raptor_uri_filename_to_uri_string(filename); + if(!uri_string) + return 1; + + if(rdf_serializer->base_uri) + raptor_free_uri(rdf_serializer->base_uri); + + rdf_serializer->base_uri = raptor_new_uri(rdf_serializer->world, uri_string); + rdf_serializer->locator.uri = rdf_serializer->base_uri; + rdf_serializer->locator.line = rdf_serializer->locator.column = 0; + + RAPTOR_FREE(char*, uri_string); + + rdf_serializer->iostream = raptor_new_iostream_to_filename(rdf_serializer->world, + filename); + if(!rdf_serializer->iostream) + return 1; + + rdf_serializer->free_iostream_on_end = 1; + + if(rdf_serializer->factory->serialize_start) + return rdf_serializer->factory->serialize_start(rdf_serializer); + return 0; +} + + + +/** + * raptor_serializer_start_to_string: + * @rdf_serializer: the #raptor_serializer + * @uri: base URI or NULL if no base URI is required + * @string_p: pointer to location to hold string + * @length_p: pointer to location to hold length of string (or NULL) + * + * Start serializing to a string. + * + * Return value: non-0 on failure. + **/ +int +raptor_serializer_start_to_string(raptor_serializer *rdf_serializer, + raptor_uri *uri, + void **string_p, size_t *length_p) +{ + if(rdf_serializer->base_uri) + raptor_free_uri(rdf_serializer->base_uri); + + if(uri) + rdf_serializer->base_uri = raptor_uri_copy(uri); + else + rdf_serializer->base_uri = NULL; + rdf_serializer->locator.uri = rdf_serializer->base_uri; + rdf_serializer->locator.line = rdf_serializer->locator.column = 0; + + + rdf_serializer->iostream = raptor_new_iostream_to_string(rdf_serializer->world, + string_p, length_p, + NULL); + if(!rdf_serializer->iostream) + return 1; + + rdf_serializer->free_iostream_on_end = 1; + + if(rdf_serializer->factory->serialize_start) + return rdf_serializer->factory->serialize_start(rdf_serializer); + return 0; +} + + +/** + * raptor_serializer_start_to_file_handle: + * @rdf_serializer: the #raptor_serializer + * @uri: base URI or NULL if no base URI is required + * @fh: FILE* to serialize to + * + * Start serializing to a FILE*. + * + * NOTE: This does not fclose the handle when it is finished. + * + * Return value: non-0 on failure. + **/ +int +raptor_serializer_start_to_file_handle(raptor_serializer *rdf_serializer, + raptor_uri *uri, FILE *fh) +{ + if(rdf_serializer->base_uri) + raptor_free_uri(rdf_serializer->base_uri); + + if(uri) + rdf_serializer->base_uri = raptor_uri_copy(uri); + else + rdf_serializer->base_uri = NULL; + rdf_serializer->locator.uri = rdf_serializer->base_uri; + rdf_serializer->locator.line = rdf_serializer->locator.column = 0; + + rdf_serializer->iostream = raptor_new_iostream_to_file_handle(rdf_serializer->world, fh); + if(!rdf_serializer->iostream) + return 1; + + rdf_serializer->free_iostream_on_end = 1; + + if(rdf_serializer->factory->serialize_start) + return rdf_serializer->factory->serialize_start(rdf_serializer); + return 0; +} + + +/** + * raptor_serializer_set_namespace: + * @rdf_serializer: the #raptor_serializer + * @uri: #raptor_uri of namespace or NULL + * @prefix: prefix to use or NULL + * + * set a namespace uri/prefix mapping for serializing. + * + * return value: non-0 on failure. + **/ +int +raptor_serializer_set_namespace(raptor_serializer* rdf_serializer, + raptor_uri *uri, const unsigned char *prefix) +{ + if(prefix && !*prefix) + prefix = NULL; + + if(rdf_serializer->factory->declare_namespace) + return rdf_serializer->factory->declare_namespace(rdf_serializer, + uri, prefix); + + return 1; +} + + +/** + * raptor_serializer_set_namespace_from_namespace: + * @rdf_serializer: the #raptor_serializer + * @nspace: #raptor_namespace to set + * + * Set a namespace uri/prefix mapping for serializing from an existing namespace. + * + * Return value: non-0 on failure. + **/ +int +raptor_serializer_set_namespace_from_namespace(raptor_serializer* rdf_serializer, + raptor_namespace *nspace) +{ + if(rdf_serializer->factory->declare_namespace_from_namespace) + return rdf_serializer->factory->declare_namespace_from_namespace(rdf_serializer, + nspace); + else if(rdf_serializer->factory->declare_namespace) + return rdf_serializer->factory->declare_namespace(rdf_serializer, + raptor_namespace_get_uri(nspace), + raptor_namespace_get_prefix(nspace)); + + return 1; +} + + +/** + * raptor_serializer_serialize_statement: + * @rdf_serializer: the #raptor_serializer + * @statement: #raptor_statement to serialize to a syntax + * + * Serialize a statement. + * + * Return value: non-0 on failure. + **/ +int +raptor_serializer_serialize_statement(raptor_serializer* rdf_serializer, + raptor_statement *statement) +{ + if(!rdf_serializer->iostream) + return 1; + + return rdf_serializer->factory->serialize_statement(rdf_serializer, + statement); +} + + +/** + * raptor_serializer_serialize_end: + * @rdf_serializer: the #raptor_serializer + * + * End a serialization. + * + * Return value: non-0 on failure. + **/ +int +raptor_serializer_serialize_end(raptor_serializer *rdf_serializer) +{ + int rc; + + if(!rdf_serializer->iostream) + return 1; + + if(rdf_serializer->factory->serialize_end) + rc = rdf_serializer->factory->serialize_end(rdf_serializer); + else + rc = 0; + + if(rdf_serializer->iostream) { + if(rdf_serializer->free_iostream_on_end) + raptor_free_iostream(rdf_serializer->iostream); + rdf_serializer->iostream = NULL; + } + return rc; +} + + + +/** + * raptor_free_serializer: + * @rdf_serializer: #raptor_serializer object + * + * Destructor - destroy a raptor_serializer object. + * + **/ +void +raptor_free_serializer(raptor_serializer* rdf_serializer) +{ + if(!rdf_serializer) + return; + + if(rdf_serializer->factory) + rdf_serializer->factory->terminate(rdf_serializer); + + if(rdf_serializer->context) + RAPTOR_FREE(raptor_serializer_context, rdf_serializer->context); + + if(rdf_serializer->base_uri) + raptor_free_uri(rdf_serializer->base_uri); + + raptor_object_options_clear(&rdf_serializer->options); + + RAPTOR_FREE(raptor_serializer, rdf_serializer); +} + + +/** + * raptor_serializer_get_iostream: + * @serializer: #raptor_serializer object + * + * Get the current serializer iostream. + * + * Return value: the serializer's current iostream or NULL if + **/ +raptor_iostream* +raptor_serializer_get_iostream(raptor_serializer *serializer) +{ + return serializer->iostream; +} + + +/** + * raptor_serializer_set_option: + * @serializer: #raptor_serializer serializer object + * @option: option to set from enumerated #raptor_option values + * @string: string option value (or NULL) + * @integer: integer option value + * + * Set serializer option. + * + * If @string is not NULL and the option type is numeric, the string + * value is converted to an integer and used in preference to @integer. + * + * If @string is NULL and the option type is not numeric, an error is + * returned. + * + * The @string values used are copied. + * + * The allowed options are available via + * raptor_world_get_option_description(). + * + * Return value: non 0 on failure or if the option is unknown + **/ +int +raptor_serializer_set_option(raptor_serializer *serializer, + raptor_option option, + const char* string, int integer) +{ + return raptor_object_options_set_option(&serializer->options, option, + string, integer); +} + + +/** + * raptor_serializer_get_option: + * @serializer: #raptor_serializer serializer object + * @option: option to get value + * @string_p: pointer to where to store string value + * @integer_p: pointer to where to store integer value + * + * Get serializer option. + * + * Any string value returned in *@string_p is shared and must + * be copied by the caller. + * + * The allowed options are available via + * raptor_world_get_option_description(). + * + * Return value: option value or < 0 for an illegal option + **/ +int +raptor_serializer_get_option(raptor_serializer *serializer, + raptor_option option, + char** string_p, int* integer_p) +{ + return raptor_object_options_get_option(&serializer->options, option, + string_p, integer_p); +} + + +/** + * raptor_serializer_get_locator: + * @rdf_serializer: raptor serializer + * + * Get the serializer raptor locator object. + * + * Return value: raptor locator + **/ +raptor_locator* +raptor_serializer_get_locator(raptor_serializer *rdf_serializer) +{ + return &rdf_serializer->locator; +} + + +/** + * raptor_serializer_get_world: + * @rdf_serializer: raptor serializer + * + * Get the #raptor_world object associated with a serializer. + * + * Return value: raptor_world* pointer + **/ +raptor_world * +raptor_serializer_get_world(raptor_serializer* rdf_serializer) +{ + return rdf_serializer->world; +} + + +/** + * raptor_serializer_get_description: + * @rdf_serializer: #raptor_serializer serializer object + * + * Get description of the syntaxes of the serializer. + * + * The returned description is static and lives as long as the raptor + * library (raptor world). + * + * Return value: description of syntax + **/ +const raptor_syntax_description* +raptor_serializer_get_description(raptor_serializer *rdf_serializer) +{ + return &rdf_serializer->factory->desc; +} + + +/** + * raptor_serializer_flush: + * @rdf_serializer: raptor serializer + * + * Flush the current serializer output and free any pending state + * + * In serializers that can generate blocks of content, this causes + * the writing of any current pending block. For example in Turtle + * this may write all pending triples. + * + * Return value: non-0 on failure + **/ +int +raptor_serializer_flush(raptor_serializer *rdf_serializer) +{ + int rc; + + if(rdf_serializer->factory->serialize_flush) + rc = rdf_serializer->factory->serialize_flush(rdf_serializer); + else + rc = 0; + + return rc; +} diff --git a/src/raptor_serialize_dot.c b/src/raptor_serialize_dot.c new file mode 100644 index 0000000..208d141 --- /dev/null +++ b/src/raptor_serialize_dot.c @@ -0,0 +1,584 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize_dot.c - Serialize RDF graph to GraphViz DOT format + * + * Copyright (C) 2004-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +/* + * Raptor dot serializer object + */ +typedef struct { + raptor_namespace_stack *nstack; + raptor_sequence *namespaces; + + raptor_sequence *resources; + raptor_sequence *literals; + raptor_sequence *bnodes; +} raptor_dot_context; + + +/* add a namespace */ +static int +raptor_dot_serializer_declare_namespace_from_namespace(raptor_serializer* serializer, + raptor_namespace *nspace) +{ + raptor_dot_context * context = (raptor_dot_context *)serializer->context; + int i; + + for(i = 0 ; i < raptor_sequence_size(context->namespaces) ; i++ ) { + raptor_namespace * ns; + ns = (raptor_namespace *)raptor_sequence_get_at(context->namespaces, i); + + /* If prefix is already declared, ignore it */ + if((!ns->prefix && !nspace->prefix) || + (ns->prefix && nspace->prefix && + !strcmp((const char*)ns->prefix, (const char*)nspace->prefix)) || + (ns->uri && nspace->uri && + raptor_uri_equals(ns->uri, nspace->uri)) ) + return 1; + } + + nspace = raptor_new_namespace_from_uri(context->nstack, nspace->prefix, + nspace->uri, 0); + + if(!nspace) + return 1; + + raptor_sequence_push(context->namespaces, nspace); + + return 0; +} + + +/* add a namespace */ +static int +raptor_dot_serializer_declare_namespace(raptor_serializer* serializer, + raptor_uri* uri, + const unsigned char *prefix) +{ + raptor_dot_context * context = (raptor_dot_context *)serializer->context; + raptor_namespace *ns; + int rc; + + ns = raptor_new_namespace_from_uri(context->nstack, prefix, uri, 0); + rc = raptor_dot_serializer_declare_namespace_from_namespace(serializer, ns); + + raptor_free_namespace(ns); + + return rc; +} + + +/* create a new serializer */ +static int +raptor_dot_serializer_init(raptor_serializer *serializer, const char *name) +{ + raptor_dot_context * context = (raptor_dot_context *)serializer->context; + + /* Setup namespace handling */ + context->nstack = raptor_new_namespaces(serializer->world, 1); + context->namespaces = raptor_new_sequence((raptor_data_free_handler)raptor_free_namespace, NULL); + + /* We keep a list of nodes to avoid duplication (which isn't + * critical in graphviz, but why bloat the file?) + */ + context->resources = + raptor_new_sequence((raptor_data_free_handler)raptor_free_term, NULL); + context->literals = + raptor_new_sequence((raptor_data_free_handler)raptor_free_term, NULL); + context->bnodes = + raptor_new_sequence((raptor_data_free_handler)raptor_free_term, NULL); + + return 0; +} + + +/** + * raptor_dot_iostream_write_string: + * @iostr: #raptor_iostream to write to + * @string: UTF-8 string to write + * @len: length of UTF-8 string + * or \0 for no escaping. + * + * Write an UTF-8 string, escaped for graphviz. + * + * Return value: non-0 on failure. + **/ +static int +raptor_dot_iostream_write_string(raptor_iostream *iostr, + const unsigned char *string) +{ + unsigned char c; + + for( ; (c = *string) ; string++ ) { + if( (c == '\\') || (c == '"') || (c == '|') || + (c == '{') || (c == '}') ) { + raptor_iostream_write_byte('\\', iostr); + raptor_iostream_write_byte(c, iostr); + } else if( c == '\n' ) { + raptor_iostream_write_byte('\\', iostr); + raptor_iostream_write_byte('n', iostr); + } else + raptor_iostream_write_byte(c, iostr); + } + + return 0; +} + + +static void +raptor_dot_serializer_write_term_type(raptor_serializer * serializer, + raptor_term_type type) +{ + switch(type) { + case RAPTOR_TERM_TYPE_LITERAL: + raptor_iostream_write_byte('L', serializer->iostream); + break; + + case RAPTOR_TERM_TYPE_BLANK: + raptor_iostream_write_byte('B', serializer->iostream); + break; + + case RAPTOR_TERM_TYPE_URI: + raptor_iostream_write_byte('R', serializer->iostream); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + raptor_iostream_write_byte('?', serializer->iostream); + break; + } +} + + +static void +raptor_dot_serializer_write_uri(raptor_serializer* serializer, + raptor_uri* uri) +{ + raptor_dot_context* context = (raptor_dot_context*)serializer->context; + unsigned char* full = raptor_uri_as_string(uri); + int i; + + for(i = 0 ; i < raptor_sequence_size(context->namespaces) ; i++ ) { + raptor_namespace* ns = + (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + const unsigned char* ns_uri_string; + size_t ns_uri_string_len; + ns_uri_string = raptor_uri_as_counted_string(ns->uri, &ns_uri_string_len); + + if(!strncmp((char*)full, (char*)ns_uri_string, ns_uri_string_len) ) { + const unsigned char* prefix = raptor_namespace_get_prefix(ns); + + if(prefix) { + raptor_iostream_string_write(prefix, serializer->iostream); + raptor_iostream_write_byte(':', serializer->iostream); + } + + raptor_iostream_string_write(full + ns_uri_string_len, + serializer->iostream); + + return; + } + } + + raptor_iostream_string_write(full, serializer->iostream); +} + + +static void +raptor_dot_serializer_write_term(raptor_serializer * serializer, + raptor_term* term) +{ + switch(term->type) { + case RAPTOR_TERM_TYPE_LITERAL: + raptor_dot_iostream_write_string(serializer->iostream, + term->value.literal.string); + if(term->value.literal.language) { + raptor_iostream_write_byte('|', serializer->iostream); + raptor_iostream_string_write("Language: ", serializer->iostream); + raptor_iostream_string_write(term->value.literal.language, + serializer->iostream); + } + if(term->value.literal.datatype) { + raptor_iostream_write_byte('|', serializer->iostream); + raptor_iostream_string_write("Datatype: ", serializer->iostream); + raptor_dot_serializer_write_uri(serializer, term->value.literal.datatype); + } + break; + + case RAPTOR_TERM_TYPE_BLANK: + raptor_iostream_counted_string_write("_:", 2, serializer->iostream); + raptor_iostream_string_write(term->value.blank.string, serializer->iostream); + break; + + case RAPTOR_TERM_TYPE_URI: + raptor_dot_serializer_write_uri(serializer, term->value.uri); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, "Triple has unsupported term type %u", + term->type); + } +} + + +/* Check the list to see if the node is a duplicate. If not, add it + * to the list. + */ +static void +raptor_dot_serializer_assert_node(raptor_serializer* serializer, + raptor_term* assert_node) +{ + raptor_dot_context* context = (raptor_dot_context*)serializer->context; + raptor_sequence* seq = NULL; + int i; + + /* Which list are we searching? */ + switch(assert_node->type) { + case RAPTOR_TERM_TYPE_URI: + seq = context->resources; + break; + + case RAPTOR_TERM_TYPE_BLANK: + seq = context->bnodes; + break; + + case RAPTOR_TERM_TYPE_LITERAL: + seq = context->literals; + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + break; + } + + for(i = 0 ; i < raptor_sequence_size(seq) ; i++ ) { + raptor_term* node = (raptor_term*)raptor_sequence_get_at(seq, i); + + if(raptor_term_equals(node, assert_node)) + return; + } + + raptor_sequence_push(seq, raptor_term_copy(assert_node)); +} + + +/* start a serialize */ +static int +raptor_dot_serializer_start(raptor_serializer* serializer) +{ + raptor_iostream_string_write((const unsigned char*)"digraph {\n\trankdir = LR;\n\tcharset=\"utf-8\";\n\n", + serializer->iostream); + + return 0; +} + + +static int +raptor_dot_serializer_write_colors(raptor_serializer* serializer, + raptor_term_type type) +{ + char* value; + + switch(type) { + case RAPTOR_TERM_TYPE_URI: + value = RAPTOR_OPTIONS_GET_STRING(serializer, + RAPTOR_OPTION_RESOURCE_BORDER); + if(value) { + raptor_iostream_string_write((const unsigned char*)", color=", + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)value, + serializer->iostream); + } + else + raptor_iostream_string_write((const unsigned char*)", color = blue", + serializer->iostream); + + value = RAPTOR_OPTIONS_GET_STRING(serializer, + RAPTOR_OPTION_RESOURCE_FILL); + if(value) { + raptor_iostream_string_write((const unsigned char*)", style = filled, fillcolor=", + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)value, + serializer->iostream); + } + + break; + + case RAPTOR_TERM_TYPE_BLANK: + value = RAPTOR_OPTIONS_GET_STRING(serializer, + RAPTOR_OPTION_BNODE_BORDER); + if(value) { + raptor_iostream_string_write((const unsigned char*)", color=", + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)value, + serializer->iostream); + } + else + raptor_iostream_string_write((const unsigned char*)", color = green", + serializer->iostream); + + value = RAPTOR_OPTIONS_GET_STRING(serializer, + RAPTOR_OPTION_BNODE_FILL); + if(value) { + raptor_iostream_string_write((const unsigned char*)", style = filled, fillcolor=", + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)value, + serializer->iostream); + } + + break; + + case RAPTOR_TERM_TYPE_LITERAL: + value = RAPTOR_OPTIONS_GET_STRING(serializer, + RAPTOR_OPTION_LITERAL_BORDER); + if(value) { + raptor_iostream_string_write((const unsigned char*)", color=", + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)value, + serializer->iostream); + } + + value = RAPTOR_OPTIONS_GET_STRING(serializer, + RAPTOR_OPTION_LITERAL_FILL); + if(value) { + raptor_iostream_string_write((const unsigned char*)", style = filled, fillcolor=", + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)value, + serializer->iostream); + } + + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + break; + } + + return 0; +} + + +/* end a serialize */ +static int +raptor_dot_serializer_end(raptor_serializer* serializer) +{ + raptor_dot_context* context = (raptor_dot_context*)serializer->context; + raptor_term* node; + int i; + + /* Print our nodes. */ + raptor_iostream_string_write((const unsigned char*)"\n\t// Resources\n", + serializer->iostream); + for(i = 0 ; i < raptor_sequence_size(context->resources) ; i++ ) { + node = (raptor_term*)raptor_sequence_get_at(context->resources, i); + raptor_iostream_string_write((const unsigned char*)"\t\"R", + serializer->iostream); + raptor_dot_serializer_write_term(serializer, node); + raptor_iostream_string_write((const unsigned char*)"\" [ label=\"", + serializer->iostream); + raptor_dot_serializer_write_term(serializer, node); + raptor_iostream_string_write((const unsigned char*)"\", shape = ellipse", + serializer->iostream); + raptor_dot_serializer_write_colors(serializer, RAPTOR_TERM_TYPE_URI); + raptor_iostream_string_write((const unsigned char*)" ];\n", + serializer->iostream); + + } + raptor_free_sequence(context->resources); + + raptor_iostream_string_write((const unsigned char*)"\n\t// Anonymous nodes\n", + serializer->iostream); + for(i = 0 ; i < raptor_sequence_size(context->bnodes) ; i++ ) { + node = (raptor_term *)raptor_sequence_get_at(context->bnodes, i); + raptor_iostream_string_write((const unsigned char*)"\t\"B", + serializer->iostream); + raptor_dot_serializer_write_term(serializer, node); + raptor_iostream_string_write((const unsigned char*)"\" [ label=\"", + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)"\", shape = circle", + serializer->iostream); + raptor_dot_serializer_write_colors(serializer, RAPTOR_TERM_TYPE_BLANK); + raptor_iostream_string_write((const unsigned char*)" ];\n", + serializer->iostream); + } + raptor_free_sequence(context->bnodes); + + raptor_iostream_string_write((const unsigned char*)"\n\t// Literals\n", + serializer->iostream); + for(i = 0 ; i < raptor_sequence_size(context->literals) ; i++ ) { + node = (raptor_term*)raptor_sequence_get_at(context->literals, i); + raptor_iostream_string_write((const unsigned char*)"\t\"L", + serializer->iostream); + raptor_dot_serializer_write_term(serializer, node); + raptor_iostream_string_write((const unsigned char*)"\" [ label=\"", + serializer->iostream); + raptor_dot_serializer_write_term(serializer, node); + raptor_iostream_string_write((const unsigned char*)"\", shape = record", + serializer->iostream); + raptor_dot_serializer_write_colors(serializer, RAPTOR_TERM_TYPE_LITERAL); + raptor_iostream_string_write((const unsigned char*)" ];\n", + serializer->iostream); + } + raptor_free_sequence(context->literals); + + raptor_iostream_string_write((const unsigned char*)"\n\tlabel=\"\\n\\nModel:\\n", + serializer->iostream); + if(serializer->base_uri) + raptor_iostream_string_write(raptor_uri_as_string(serializer->base_uri), + serializer->iostream); + else + raptor_iostream_string_write("(Unknown)", serializer->iostream); + + if(raptor_sequence_size(context->namespaces)) { + raptor_iostream_string_write((const unsigned char*)"\\n\\nNamespaces:\\n", + serializer->iostream); + + for(i = 0 ; i < raptor_sequence_size(context->namespaces) ; i++ ) { + raptor_namespace* ns; + const unsigned char* prefix; + + ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + + prefix = raptor_namespace_get_prefix(ns); + if(prefix) { + raptor_iostream_string_write((const unsigned char*)ns->prefix, + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)": ", + serializer->iostream); + } + raptor_iostream_string_write(raptor_uri_as_string(ns->uri), + serializer->iostream); + raptor_iostream_string_write((const unsigned char*)"\\n", + serializer->iostream); + } + + raptor_free_sequence(context->namespaces); + } + + raptor_iostream_string_write((const unsigned char*)"\";\n", + serializer->iostream); + + raptor_iostream_string_write((const unsigned char*) "}\n", + serializer->iostream); + + return 0; +} + + +/* destroy a serializer */ +static void +raptor_dot_serializer_terminate(raptor_serializer* serializer) +{ + /* raptor_dot_context* context = (raptor_dot_context*)serializer->context; */ + + /* Everything should have been freed in raptor_dot_serializer_end */ +} + +/* serialize a statement */ +static int +raptor_dot_serializer_statement(raptor_serializer* serializer, + raptor_statement *statement) +{ + /* Cache the nodes for later. */ + raptor_dot_serializer_assert_node(serializer, statement->subject); + raptor_dot_serializer_assert_node(serializer, statement->object); + + raptor_iostream_string_write((const unsigned char*)"\t\"", + serializer->iostream); + raptor_dot_serializer_write_term_type(serializer, statement->subject->type); + raptor_dot_serializer_write_term(serializer, statement->subject); + raptor_iostream_string_write((const unsigned char*)"\" -> \"", + serializer->iostream); + raptor_dot_serializer_write_term_type(serializer, statement->object->type); + raptor_dot_serializer_write_term(serializer, statement->object); + raptor_iostream_string_write((const unsigned char*)"\" [ label=\"", + serializer->iostream); + raptor_dot_serializer_write_term(serializer, statement->predicate); + raptor_iostream_string_write((const unsigned char*)"\" ];\n", + serializer->iostream); + + return 0; +} + + +static const char* const dot_names[2] = { "dot", NULL}; + +static const char* const dot_uri_strings[2] = { + "http://www.graphviz.org/doc/info/lang.html", + NULL +}; + +#define DOT_TYPES_COUNT 1 +static const raptor_type_q dot_types[DOT_TYPES_COUNT + 1] = { + { "text/x-graphviz", 15, 5}, + { NULL, 0, 0} +}; + +static int +raptor_dot_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = dot_names; + factory->desc.mime_types = dot_types; + + factory->desc.label = "GraphViz DOT format"; + factory->desc.uri_strings = dot_uri_strings;; + + factory->context_length = sizeof(raptor_dot_context); + + factory->init = raptor_dot_serializer_init; + factory->declare_namespace = raptor_dot_serializer_declare_namespace; + factory->declare_namespace_from_namespace = + raptor_dot_serializer_declare_namespace_from_namespace; + factory->serialize_start = raptor_dot_serializer_start; + factory->serialize_statement = raptor_dot_serializer_statement; + factory->serialize_end = raptor_dot_serializer_end; + factory->finish_factory = NULL; + factory->terminate = raptor_dot_serializer_terminate; + + return 0; +} + + +int +raptor_init_serializer_dot(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_dot_serializer_register_factory); +} diff --git a/src/raptor_serialize_html.c b/src/raptor_serialize_html.c new file mode 100644 index 0000000..92a0a53 --- /dev/null +++ b/src/raptor_serialize_html.c @@ -0,0 +1,273 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize_html.c - HTML Table serializer + * + * Copyright (C) 2010, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * Raptor html serializer object + */ +typedef struct { + int count; +} raptor_html_context; + + + +/* create a new serializer */ +static int +raptor_html_serialize_init(raptor_serializer* serializer, const char *name) +{ + return 0; +} + + +/* destroy a serializer */ +static void +raptor_html_serialize_terminate(raptor_serializer* serializer) +{ + +} + + +/* start a serialize */ +static int +raptor_html_serialize_start(raptor_serializer* serializer) +{ + raptor_html_context * context = (raptor_html_context *)serializer->context; + raptor_iostream *iostr = serializer->iostream; + + context->count = 0; + + /* XML and HTML declarations */ + raptor_iostream_counted_string_write( + "\n", 39, iostr); + raptor_iostream_counted_string_write( + "\n", 106, iostr); + raptor_iostream_counted_string_write( + "\n", 44, iostr); + + raptor_iostream_counted_string_write("\n", 7, iostr); + raptor_iostream_counted_string_write(" Raptor Graph Serialisation\n", 44, iostr); + raptor_iostream_counted_string_write("\n", 8, iostr); + raptor_iostream_counted_string_write("\n", 7, iostr); + + raptor_iostream_counted_string_write( + " \n", 34, iostr); + + raptor_iostream_counted_string_write(" \n", 9, iostr); + raptor_iostream_counted_string_write(" \n", 23, iostr); + raptor_iostream_counted_string_write(" \n", 25, iostr); + raptor_iostream_counted_string_write(" \n", 22, iostr); + raptor_iostream_counted_string_write(" \n", 10, iostr); + + return 0; +} + + +/* serialize a term */ +static int +raptor_term_html_write(const raptor_term *term, raptor_iostream* iostr) +{ + unsigned char *str; + size_t len; + + switch(term->type) { + case RAPTOR_TERM_TYPE_LITERAL: + raptor_iostream_counted_string_write("", 22, + iostr); + raptor_iostream_counted_string_write("value.literal.language) { + len = RAPTOR_LANG_LEN_TO_SIZE_T(term->value.literal.language_len); + raptor_iostream_counted_string_write(" xml:lang=\"", 11, iostr); + raptor_xml_escape_string_write(term->value.literal.language, len, '"', + iostr); + raptor_iostream_write_byte('"', iostr); + } + raptor_iostream_write_byte('>', iostr); + len = term->value.literal.string_len; + raptor_xml_escape_string_write(term->value.literal.string, len, 0, iostr); + raptor_iostream_counted_string_write("", 7, iostr); + + if(term->value.literal.datatype) { + str = raptor_uri_as_counted_string(term->value.literal.datatype, &len); + raptor_iostream_counted_string_write("^^<", 29, iostr); + raptor_xml_escape_string_write(str, len, 0, iostr); + raptor_iostream_counted_string_write(">", 11, iostr); + } + break; + + case RAPTOR_TERM_TYPE_BLANK: + len = term->value.blank.string_len; + raptor_iostream_counted_string_write("", 20, iostr); + raptor_iostream_counted_string_write("_:", 2, iostr); + raptor_xml_escape_string_write(term->value.blank.string, len, 0, iostr); + break; + + case RAPTOR_TERM_TYPE_URI: + str = raptor_uri_as_counted_string(term->value.uri, &len); + raptor_iostream_counted_string_write("", 18, iostr); + raptor_iostream_counted_string_write("", 2, iostr); + raptor_xml_escape_string_write(str, len, 0, iostr); + raptor_iostream_counted_string_write("", 4, iostr); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(term->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Triple has unsupported term type %u", + term->type); + return 1; + } + + raptor_iostream_counted_string_write("", 7, iostr); + + return 0; +} + + +/* serialize a statement */ +static int +raptor_html_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement) +{ + raptor_html_context * context = (raptor_html_context *)serializer->context; + raptor_iostream *iostr = serializer->iostream; + + raptor_iostream_counted_string_write(" \n", 24, + iostr); + + /* Subject */ + raptor_iostream_counted_string_write(" \n", 6, iostr); + + /* Predicate */ + raptor_iostream_counted_string_write(" \n", 6, iostr); + + /* Object */ + raptor_iostream_counted_string_write(" \n", 6, iostr); + + raptor_iostream_counted_string_write(" \n", 10, iostr); + + context->count++; + + return 0; +} + + +/* end a serialize */ +static int +raptor_html_serialize_end(raptor_serializer* serializer) +{ + raptor_html_context * context = (raptor_html_context *)serializer->context; + raptor_iostream *iostr = serializer->iostream; + + raptor_iostream_counted_string_write("
SubjectPredicateObject
", 10, iostr); + raptor_term_html_write(statement->subject, iostr); + raptor_iostream_counted_string_write("", 10, iostr); + raptor_term_html_write(statement->predicate, iostr); + raptor_iostream_counted_string_write("", 10, iostr); + raptor_term_html_write(statement->object, iostr); + raptor_iostream_counted_string_write("
\n", 11, iostr); + + raptor_iostream_counted_string_write( + "

Total number of triples: ", 50, iostr); + raptor_iostream_decimal_write(context->count, iostr); + raptor_iostream_counted_string_write(".

\n", 13, iostr); + + raptor_iostream_counted_string_write("\n", 8, iostr); + raptor_iostream_counted_string_write("\n", 8, iostr); + + return 0; +} + + +/* finish the serializer factory */ +static void +raptor_html_serialize_finish_factory(raptor_serializer_factory* factory) +{ + /* NOP */ +} + + +static const char* const html_names[2] = { "html", NULL}; + +static const char* const html_uri_strings[2] = { + "http://www.w3.org/1999/xhtml", + NULL +}; + +#define HTML_TYPES_COUNT 2 +static const raptor_type_q html_types[HTML_TYPES_COUNT + 1] = { + { "application/xhtml+xml", 21, 10}, + { "text/html", 9, 10}, + { NULL, 0, 0} +}; + +static int +raptor_html_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = html_names; + factory->desc.mime_types = html_types; + + factory->desc.label = "HTML Table"; + factory->desc.uri_strings = html_uri_strings; + + factory->context_length = sizeof(raptor_html_context); + + factory->init = raptor_html_serialize_init; + factory->terminate = raptor_html_serialize_terminate; + factory->declare_namespace = NULL; + factory->declare_namespace_from_namespace = NULL; + factory->serialize_start = raptor_html_serialize_start; + factory->serialize_statement = raptor_html_serialize_statement; + factory->serialize_end = raptor_html_serialize_end; + factory->finish_factory = raptor_html_serialize_finish_factory; + + return 0; +} + + +int +raptor_init_serializer_html(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_html_serializer_register_factory); +} diff --git a/src/raptor_serialize_json.c b/src/raptor_serialize_json.c new file mode 100644 index 0000000..4d9355d --- /dev/null +++ b/src/raptor_serialize_json.c @@ -0,0 +1,483 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize_json.c - JSON serializers + * + * Copyright (C) 2008-2009, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * Raptor JSON serializer object + */ +typedef struct { + /* non-0 if json-r otherwise json-t */ + int is_resource; + + int need_subject_comma; + + /* JSON writer object */ + raptor_json_writer* json_writer; + + /* Ordered sequence of triples if is_resource */ + raptor_avltree* avltree; + + /* Last statement generated if is_resource (shared pointer) */ + raptor_statement* last_statement; + + int need_object_comma; + +} raptor_json_context; + + +static int raptor_json_serialize_init(raptor_serializer* serializer, + const char *name); +static void raptor_json_serialize_terminate(raptor_serializer* serializer); +static int raptor_json_serialize_start(raptor_serializer* serializer); +static int raptor_json_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement); +static int raptor_json_serialize_end(raptor_serializer* serializer); +static void raptor_json_serialize_finish_factory(raptor_serializer_factory* factory); + + +/* + * raptor serializer JSON implementation + */ + + +/* create a new serializer */ +static int +raptor_json_serialize_init(raptor_serializer* serializer, const char *name) +{ + raptor_json_context* context = (raptor_json_context*)serializer->context; + + context->is_resource=!strcmp(name,"json"); + + /* Default for JSON serializer is absolute URIs */ + /* RAPTOR_OPTIONS_SET_NUMERIC(serializer, RAPTOR_OPTION_RELATIVE_URIS, 0); */ + + return 0; +} + + +/* destroy a serializer */ +static void +raptor_json_serialize_terminate(raptor_serializer* serializer) +{ + raptor_json_context* context = (raptor_json_context*)serializer->context; + + if(context->json_writer) { + raptor_free_json_writer(context->json_writer); + context->json_writer = NULL; + } + + if(context->avltree) { + raptor_free_avltree(context->avltree); + context->avltree = NULL; + } +} + + +static int +raptor_json_serialize_start(raptor_serializer* serializer) +{ + raptor_json_context* context = (raptor_json_context*)serializer->context; + raptor_uri* base_uri; + char* value; + + base_uri = RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_RELATIVE_URIS) + ? serializer->base_uri : NULL; + + context->json_writer = raptor_new_json_writer(serializer->world, + base_uri, + serializer->iostream); + if(!context->json_writer) + return 1; + + if(context->is_resource) { + context->avltree = raptor_new_avltree((raptor_data_compare_handler)raptor_statement_compare, + (raptor_data_free_handler)raptor_free_statement, + 0); + if(!context->avltree) { + raptor_free_json_writer(context->json_writer); + context->json_writer = NULL; + return 1; + } + } + + /* start callback */ + value = RAPTOR_OPTIONS_GET_STRING(serializer, RAPTOR_OPTION_JSON_CALLBACK); + if(value) { + raptor_iostream_string_write(value, serializer->iostream); + raptor_iostream_write_byte('(', serializer->iostream); + } + + if(!context->is_resource) { + /* start outer object */ + raptor_json_writer_start_block(context->json_writer, '{'); + raptor_json_writer_newline(context->json_writer); + + /* start triples array */ + raptor_iostream_counted_string_write((const unsigned char*)"\"triples\" : ", 12, + serializer->iostream); + raptor_json_writer_start_block(context->json_writer, '['); + raptor_json_writer_newline(context->json_writer); + } + + return 0; +} + + +static int +raptor_json_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement) +{ + raptor_json_context* context = (raptor_json_context*)serializer->context; + + if(context->is_resource) { + raptor_statement* s = raptor_statement_copy(statement); + if(!s) + return 1; + return raptor_avltree_add(context->avltree, s); + } + + if(context->need_subject_comma) { + raptor_iostream_write_byte(',', serializer->iostream); + raptor_json_writer_newline(context->json_writer); + } + + /* start triple */ + raptor_json_writer_start_block(context->json_writer, '{'); + raptor_json_writer_newline(context->json_writer); + + /* subject */ + raptor_iostream_string_write((const unsigned char*)"\"subject\" : ", + serializer->iostream); + raptor_json_writer_term(context->json_writer, statement->subject); + raptor_iostream_write_byte(',', serializer->iostream); + raptor_json_writer_newline(context->json_writer); + + /* predicate */ + raptor_iostream_string_write((const unsigned char*)"\"predicate\" : ", + serializer->iostream); + raptor_json_writer_term(context->json_writer, statement->predicate); + raptor_iostream_write_byte(',', serializer->iostream); + raptor_json_writer_newline(context->json_writer); + + /* object */ + raptor_iostream_string_write((const unsigned char*)"\"object\" : ", + serializer->iostream); + raptor_json_writer_term(context->json_writer, statement->object); + raptor_json_writer_newline(context->json_writer); + + /* end triple */ + raptor_json_writer_end_block(context->json_writer, '}'); + + context->need_subject_comma = 1; + return 0; +} + + +/* return 0 to abort visit */ +static int +raptor_json_serialize_avltree_visit(int depth, void* data, void *user_data) +{ + raptor_serializer* serializer = (raptor_serializer*)user_data; + raptor_json_context* context = (raptor_json_context*)serializer->context; + + raptor_statement* statement = (raptor_statement*)data; + raptor_statement* s1 = statement; + raptor_statement* s2 = context->last_statement; + int new_subject = 0; + int new_predicate = 0; + unsigned int flags = RAPTOR_ESCAPED_WRITE_JSON_LITERAL; + + if(s2) { + new_subject = !raptor_term_equals(s1->subject, s2->subject); + + if(new_subject) { + /* end last predicate */ + raptor_json_writer_newline(context->json_writer); + + raptor_json_writer_end_block(context->json_writer, ']'); + raptor_json_writer_newline(context->json_writer); + + /* end last statement */ + raptor_json_writer_end_block(context->json_writer, '}'); + raptor_json_writer_newline(context->json_writer); + + context->need_subject_comma = 1; + context->need_object_comma = 0; + } + } else + new_subject = 1; + + if(new_subject) { + if(context->need_subject_comma) { + raptor_iostream_write_byte(',', serializer->iostream); + raptor_json_writer_newline(context->json_writer); + } + + /* start triple */ + + /* subject */ + switch(s1->subject->type) { + case RAPTOR_TERM_TYPE_URI: + raptor_json_writer_key_uri_value(context->json_writer, + NULL, 0, + s1->subject->value.uri); + break; + + case RAPTOR_TERM_TYPE_BLANK: + raptor_iostream_counted_string_write("\"_:", 3, serializer->iostream); + raptor_string_escaped_write(s1->subject->value.blank.string, 0, + '"', flags, + serializer->iostream); + raptor_iostream_write_byte('"', serializer->iostream); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, + "Triple has unsupported subject term type %u", + s1->subject->type); + break; + } + + raptor_iostream_counted_string_write(" : ", 3, serializer->iostream); + raptor_json_writer_start_block(context->json_writer, '{'); + + raptor_json_writer_newline(context->json_writer); + } + + + /* predicate */ + if(context->last_statement) { + if(new_subject) + new_predicate = 1; + else { + new_predicate = !raptor_uri_equals(s1->predicate->value.uri, + s2->predicate->value.uri); + if(new_predicate) { + raptor_json_writer_newline(context->json_writer); + raptor_json_writer_end_block(context->json_writer, ']'); + raptor_iostream_write_byte(',', serializer->iostream); + raptor_json_writer_newline(context->json_writer); + } + } + } else + new_predicate = 1; + + if(new_predicate) { + /* start predicate */ + + raptor_json_writer_key_uri_value(context->json_writer, + NULL, 0, + s1->predicate->value.uri); + raptor_iostream_counted_string_write(" : ", 3, serializer->iostream); + raptor_json_writer_start_block(context->json_writer, '['); + raptor_iostream_write_byte(' ', serializer->iostream); + + context->need_object_comma = 0; + } + + if(context->need_object_comma) { + raptor_iostream_write_byte(',', serializer->iostream); + raptor_json_writer_newline(context->json_writer); + } + + /* object */ + raptor_json_writer_term(context->json_writer, s1->object); + if(s1->object->type != RAPTOR_TERM_TYPE_LITERAL) + raptor_json_writer_newline(context->json_writer); + + /* end triple */ + + context->need_object_comma = 1; + context->last_statement = statement; + + return 1; +} + + +static int +raptor_json_serialize_end(raptor_serializer* serializer) +{ + raptor_json_context* context = (raptor_json_context*)serializer->context; + char* value; + + raptor_json_writer_newline(context->json_writer); + + if(context->is_resource) { + /* start outer object */ + raptor_json_writer_start_block(context->json_writer, '{'); + raptor_json_writer_newline(context->json_writer); + + raptor_avltree_visit(context->avltree, + raptor_json_serialize_avltree_visit, + serializer); + + /* end last triples block */ + if(context->last_statement) { + raptor_json_writer_newline(context->json_writer); + raptor_json_writer_end_block(context->json_writer, ']'); + raptor_json_writer_newline(context->json_writer); + + raptor_json_writer_end_block(context->json_writer, '}'); + raptor_json_writer_newline(context->json_writer); + } + } else { + /* end triples array */ + raptor_json_writer_end_block(context->json_writer, ']'); + raptor_json_writer_newline(context->json_writer); + } + + + value = RAPTOR_OPTIONS_GET_STRING(serializer, RAPTOR_OPTION_JSON_EXTRA_DATA); + if(value) { + raptor_iostream_write_byte(',', serializer->iostream); + raptor_json_writer_newline(context->json_writer); + raptor_iostream_string_write(value, serializer->iostream); + raptor_json_writer_newline(context->json_writer); + } + + + /* end outer object */ + raptor_json_writer_end_block(context->json_writer, '}'); + raptor_json_writer_newline(context->json_writer); + + /* end callback */ + if(RAPTOR_OPTIONS_GET_STRING(serializer, RAPTOR_OPTION_JSON_CALLBACK)) + raptor_iostream_counted_string_write((const unsigned char*)");", 2, + serializer->iostream); + + return 0; +} + + +static void +raptor_json_serialize_finish_factory(raptor_serializer_factory* factory) +{ + /* NOP */ +} + + + +static const char* const json_triples_names[3] = { "json-triples", NULL}; + +#define JSON_TRIPLES_TYPES_COUNT 2 +static const raptor_type_q json_triples_types[JSON_TRIPLES_TYPES_COUNT + 1] = { + { "application/json", 16, 0}, + { "text/json", 9, 1}, + { NULL, 0, 0} +}; + +static int +raptor_json_triples_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = json_triples_names; + factory->desc.mime_types = json_triples_types; + + factory->desc.label = "RDF/JSON Triples"; + factory->desc.uri_strings = NULL; + + factory->context_length = sizeof(raptor_json_context); + + factory->init = raptor_json_serialize_init; + factory->terminate = raptor_json_serialize_terminate; + factory->declare_namespace = NULL; + factory->declare_namespace_from_namespace = NULL; + factory->serialize_start = raptor_json_serialize_start; + factory->serialize_statement = raptor_json_serialize_statement; + factory->serialize_end = raptor_json_serialize_end; + factory->finish_factory = raptor_json_serialize_finish_factory; + + return 0; +} + + +static const char* const json_resource_names[2] = { "json", NULL}; + +static const char* const json_resource_uri_strings[2] = { + "http://docs.api.talis.com/platform-api/output-types/rdf-json", + NULL +}; + +#define JSON_RESOURCE_TYPES_COUNT 2 +static const raptor_type_q json_resource_types[JSON_RESOURCE_TYPES_COUNT + 1] = { + { "application/json", 16, 10}, + { "text/json", 9, 1}, + { NULL, 0, 0} +}; + +static int +raptor_json_resource_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = json_resource_names; + factory->desc.mime_types = json_resource_types; + + factory->desc.label = "RDF/JSON Resource-Centric"; + factory->desc.uri_strings = json_resource_uri_strings; + + factory->context_length = sizeof(raptor_json_context); + + factory->init = raptor_json_serialize_init; + factory->terminate = raptor_json_serialize_terminate; + factory->declare_namespace = NULL; + factory->declare_namespace_from_namespace = NULL; + factory->serialize_start = raptor_json_serialize_start; + factory->serialize_statement = raptor_json_serialize_statement; + factory->serialize_end = raptor_json_serialize_end; + factory->finish_factory = raptor_json_serialize_finish_factory; + + return 0; +} + + +int +raptor_init_serializer_json(raptor_world* world) +{ + int rc; + + rc = !raptor_serializer_register_factory(world, + &raptor_json_triples_serializer_register_factory); + if(rc) + return rc; + + rc = !raptor_serializer_register_factory(world, + &raptor_json_resource_serializer_register_factory); + + return rc; +} diff --git a/src/raptor_serialize_ntriples.c b/src/raptor_serialize_ntriples.c new file mode 100644 index 0000000..6ccdee8 --- /dev/null +++ b/src/raptor_serialize_ntriples.c @@ -0,0 +1,342 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize_ntriples.c - N-Triples and Nquads serializer + * + * Copyright (C) 2004-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * Raptor N-Triples serializer object + */ +typedef struct { + int is_nquads; +} raptor_ntriples_serializer_context; + + + +/* create a new serializer */ +static int +raptor_ntriples_serialize_init(raptor_serializer* serializer, const char *name) +{ + raptor_ntriples_serializer_context* ntriples_serializer; + + ntriples_serializer = (raptor_ntriples_serializer_context*)serializer->context; + ntriples_serializer->is_nquads = !strcmp(name, "nquads"); + + return 0; +} + + +/* destroy a serializer */ +static void +raptor_ntriples_serialize_terminate(raptor_serializer* serializer) +{ + +} + + +/* add a namespace */ +static int +raptor_ntriples_serialize_declare_namespace(raptor_serializer* serializer, + raptor_uri *uri, + const unsigned char *prefix) +{ + /* NOP */ + return 0; +} + + +#if 0 +/* start a serialize */ +static int +raptor_ntriples_serialize_start(raptor_serializer* serializer) +{ + return 0; +} +#endif + + + +/** + * raptor_string_ntriples_write: + * @string: UTF-8 string to write + * @len: length of UTF-8 string + * @delim: Terminating delimiter character for string (such as " or >) + * or \0 for no escaping. + * @iostr: #raptor_iostream to write to + * + * Write an UTF-8 string using N-Triples escapes to an iostream. + * + * Return value: non-0 on failure such as bad UTF-8 encoding. + **/ +int +raptor_string_ntriples_write(const unsigned char *string, + size_t len, + const char delim, + raptor_iostream *iostr) +{ + return raptor_string_escaped_write(string, len, delim, + RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL, + iostr); +} + + +/** + * raptor_bnodeid_ntriples_write: + * @bnodeid: bnode ID to write + * @len: length of bnode ID + * @iostr: #raptor_iostream to write to + * + * Write a blank node ID in a form legal for N-Triples with _: prefix + * + * Return value: non-0 on failure + **/ +int +raptor_bnodeid_ntriples_write(const unsigned char *bnodeid, + size_t len, + raptor_iostream *iostr) +{ + unsigned int i; + + raptor_iostream_counted_string_write("_:", 2, iostr); + + for(i = 0; i < len; i++) { + unsigned char c = *bnodeid++; + if(!isalpha(c) && !isdigit(c)) { + /* Replace characters not in legal N-Triples bnode set */ + c = 'z'; + } + raptor_iostream_write_byte(c, iostr); + } + + return 0; +} + + +/** + * raptor_term_ntriples_write: + * @term: term to write + * @iostr: raptor iostream + * + * Write a #raptor_term formatted in N-Triples format to a #raptor_iostream + * + * @Deprecated: Use raptor_term_escaped_write() that allows + * configuring format detail flags. + * + * Return value: non-0 on failure + **/ +int +raptor_term_ntriples_write(const raptor_term *term, raptor_iostream* iostr) +{ + return raptor_term_escaped_write(term, + RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL, + iostr); +} + + +/** + * raptor_statement_ntriples_write: + * @statement: statement to write + * @iostr: raptor iostream + * @write_graph_term: flag to write graph term if present + * + * Write a #raptor_statement formatted in N-Triples or N-Quads format + * to a #raptor_iostream + * + * Return value: non-0 on failure + **/ +int +raptor_statement_ntriples_write(const raptor_statement *statement, + raptor_iostream* iostr, + int write_graph_term) +{ + unsigned int flags = RAPTOR_ESCAPED_WRITE_NTRIPLES_LITERAL; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, raptor_statement, 1); + + if(raptor_term_escaped_write(statement->subject, flags, iostr)) + return 1; + + raptor_iostream_write_byte(' ', iostr); + if(raptor_term_escaped_write(statement->predicate, flags, iostr)) + return 1; + + raptor_iostream_write_byte(' ', iostr); + if(raptor_term_escaped_write(statement->object, flags, iostr)) + return 1; + + if(statement->graph && write_graph_term) { + raptor_iostream_write_byte(' ', iostr); + if(raptor_term_escaped_write(statement->graph, flags, iostr)) + return 1; + } + + raptor_iostream_counted_string_write(" .\n", 3, iostr); + + return 0; +} + + +/* serialize a statement */ +static int +raptor_ntriples_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement) +{ + raptor_ntriples_serializer_context* ntriples_serializer; + + ntriples_serializer = (raptor_ntriples_serializer_context*)serializer->context; + + raptor_statement_ntriples_write(statement, + serializer->iostream, + ntriples_serializer->is_nquads); + return 0; +} + + +#if 0 +/* end a serialize */ +static int +raptor_ntriples_serialize_end(raptor_serializer* serializer) +{ + return 0; +} +#endif + +/* finish the serializer factory */ +static void +raptor_ntriples_serialize_finish_factory(raptor_serializer_factory* factory) +{ + +} + + +#ifdef RAPTOR_SERIALIZER_NTRIPLES +static const char* const ntriples_names[2] = { "ntriples", NULL}; + +static const char* const ntriples_uri_strings[3] = { + "http://www.w3.org/ns/formats/N-Triples", + "http://www.w3.org/TR/rdf-testcases/#ntriples", + NULL +}; + +#define NTRIPLES_TYPES_COUNT 2 +static const raptor_type_q ntriples_types[NTRIPLES_TYPES_COUNT + 1] = { + { "application/n-triples", 21, 10}, + { "text/plain", 10, 1}, + { NULL, 0, 0} +}; + +static int +raptor_ntriples_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = ntriples_names; + factory->desc.mime_types = ntriples_types; + + factory->desc.label = "N-Triples"; + factory->desc.uri_strings = ntriples_uri_strings; + + factory->context_length = sizeof(raptor_ntriples_serializer_context); + + factory->init = raptor_ntriples_serialize_init; + factory->terminate = raptor_ntriples_serialize_terminate; + factory->declare_namespace = raptor_ntriples_serialize_declare_namespace; + factory->serialize_start = NULL; + factory->serialize_statement = raptor_ntriples_serialize_statement; + factory->serialize_end = NULL; + factory->finish_factory = raptor_ntriples_serialize_finish_factory; + + return 0; +} +#endif + + +#ifdef RAPTOR_SERIALIZER_NQUADS +static const char* const nquads_names[2] = { "nquads", NULL}; + +static const char* const nquads_uri_strings[2] = { + "http://sw.deri.org/2008/07/n-quads/#n-quads", + NULL +}; + +#define NQUADS_TYPES_COUNT 1 +static const raptor_type_q nquads_types[NQUADS_TYPES_COUNT + 1] = { + { "text/x-nquads", 13, 10}, + { NULL, 0, 0} +}; + +static int +raptor_nquads_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = nquads_names; + factory->desc.mime_types = nquads_types; + + factory->desc.label = "N-Quads"; + factory->desc.uri_strings = nquads_uri_strings; + + factory->context_length = sizeof(raptor_ntriples_serializer_context); + + factory->init = raptor_ntriples_serialize_init; + factory->terminate = raptor_ntriples_serialize_terminate; + factory->declare_namespace = raptor_ntriples_serialize_declare_namespace; + factory->serialize_start = NULL; + factory->serialize_statement = raptor_ntriples_serialize_statement; + factory->serialize_end = NULL; + factory->finish_factory = raptor_ntriples_serialize_finish_factory; + + return 0; +} +#endif + +#ifdef RAPTOR_SERIALIZER_NTRIPLES +int +raptor_init_serializer_ntriples(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_ntriples_serializer_register_factory); +} +#endif + +#ifdef RAPTOR_SERIALIZER_NQUADS +int +raptor_init_serializer_nquads(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_nquads_serializer_register_factory); +} +#endif diff --git a/src/raptor_serialize_rdfxml.c b/src/raptor_serialize_rdfxml.c new file mode 100644 index 0000000..3e44a2e --- /dev/null +++ b/src/raptor_serialize_rdfxml.c @@ -0,0 +1,729 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize_rdfxml.c - RDF/XML serializer + * + * Copyright (C) 2004-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * Raptor RDF/XML serializer object + */ +typedef struct { + /* Namespace stack */ + raptor_namespace_stack *nstack; + + /* the xml: namespace - this is destroyed when nstack above is deleted */ + raptor_namespace *xml_nspace; + + /* the rdf: namespace - this is destroyed when nstack above is deleted */ + raptor_namespace *rdf_nspace; + + /* the rdf:RDF element */ + raptor_xml_element* rdf_RDF_element; + + /* where the xml is being written */ + raptor_xml_writer *xml_writer; + + /* User declared namespaces */ + raptor_sequence *namespaces; + + /* non zero if rdf:RDF has been written (and thus no new namespaces + * can be declared). + */ + int written_header; +} raptor_rdfxml_serializer_context; + + +/* local prototypes */ + +static void +raptor_rdfxml_serialize_terminate(raptor_serializer* serializer); + +/* create a new serializer */ +static int +raptor_rdfxml_serialize_init(raptor_serializer* serializer, const char *name) +{ + raptor_rdfxml_serializer_context* context = (raptor_rdfxml_serializer_context*)serializer->context; + + context->nstack = raptor_new_namespaces(serializer->world, 1); + if(!context->nstack) + return 1; + context->xml_nspace = raptor_new_namespace(context->nstack, + (const unsigned char*)"xml", + (const unsigned char*)raptor_xml_namespace_uri, + 0); + + context->rdf_nspace = raptor_new_namespace(context->nstack, + (const unsigned char*)"rdf", + (const unsigned char*)raptor_rdf_namespace_uri, + 0); + + context->namespaces = raptor_new_sequence(NULL, NULL); + + if(!context->xml_nspace || !context->rdf_nspace || !context->namespaces) { + raptor_rdfxml_serialize_terminate(serializer); + return 1; + } + + /* Note: item 0 in the list is rdf:RDF's namespace */ + if(raptor_sequence_push(context->namespaces, context->rdf_nspace)) { + raptor_rdfxml_serialize_terminate(serializer); + return 1; + } + + return 0; +} + + +/* destroy a serializer */ +static void +raptor_rdfxml_serialize_terminate(raptor_serializer* serializer) +{ + raptor_rdfxml_serializer_context* context = (raptor_rdfxml_serializer_context*)serializer->context; + + if(context->xml_writer) { + raptor_free_xml_writer(context->xml_writer); + context->xml_writer = NULL; + } + + if(context->rdf_RDF_element) { + raptor_free_xml_element(context->rdf_RDF_element); + context->rdf_RDF_element = NULL; + } + + if(context->rdf_nspace) { + raptor_free_namespace(context->rdf_nspace); + context->rdf_nspace = NULL; + } + + if(context->xml_nspace) { + raptor_free_namespace(context->xml_nspace); + context->xml_nspace = NULL; + } + + if(context->namespaces) { + int i; + + /* Note: item 0 in the list is rdf:RDF's namespace and freed above */ + for(i = 1; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + if(ns) + raptor_free_namespace(ns); + } + raptor_free_sequence(context->namespaces); + context->namespaces = NULL; + } + + if(context->nstack) { + raptor_free_namespaces(context->nstack); + context->nstack = NULL; + } +} + + +#define RDFXML_NAMESPACE_DEPTH 0 + +/* add a namespace */ +static int +raptor_rdfxml_serialize_declare_namespace_from_namespace(raptor_serializer* serializer, + raptor_namespace *nspace) +{ + raptor_rdfxml_serializer_context* context = (raptor_rdfxml_serializer_context*)serializer->context; + int i; + + if(context->written_header) + return 1; + + for(i = 0; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns; + ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + + /* If prefix is already declared, ignore it */ + if(!ns->prefix && !nspace->prefix) + return 1; + + if(ns->prefix && nspace->prefix && + !strcmp((const char*)ns->prefix, (const char*)nspace->prefix)) + return 1; + + if(ns->uri && nspace->uri && + raptor_uri_equals(ns->uri, nspace->uri)) + return 1; + } + + nspace = raptor_new_namespace_from_uri(context->nstack, + nspace->prefix, nspace->uri, + RDFXML_NAMESPACE_DEPTH); + if(!nspace) + return 1; + + raptor_sequence_push(context->namespaces, nspace); + return 0; +} + + +/* add a namespace */ +static int +raptor_rdfxml_serialize_declare_namespace(raptor_serializer* serializer, + raptor_uri *uri, + const unsigned char *prefix) +{ + raptor_rdfxml_serializer_context* context = (raptor_rdfxml_serializer_context*)serializer->context; + raptor_namespace *ns; + int rc; + + ns = raptor_new_namespace_from_uri(context->nstack, prefix, uri, + RDFXML_NAMESPACE_DEPTH); + + rc = raptor_rdfxml_serialize_declare_namespace_from_namespace(serializer, + ns); + raptor_free_namespace(ns); + + return rc; +} + + +/* start a serialize */ +static int +raptor_rdfxml_serialize_start(raptor_serializer* serializer) +{ + raptor_rdfxml_serializer_context* context = (raptor_rdfxml_serializer_context*)serializer->context; + raptor_xml_writer* xml_writer; + raptor_option option; + + if(context->xml_writer) { + raptor_free_xml_writer(context->xml_writer); + context->xml_writer = NULL; + } + + xml_writer = raptor_new_xml_writer(serializer->world, context->nstack, + serializer->iostream); + if(!xml_writer) + return 1; + + option = RAPTOR_OPTION_WRITER_XML_VERSION; + raptor_xml_writer_set_option(xml_writer, option, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(serializer, option)); + option = RAPTOR_OPTION_WRITER_XML_DECLARATION; + raptor_xml_writer_set_option(xml_writer, option, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(serializer, option)); + + context->xml_writer = xml_writer; + context->written_header = 0; + + return 0; +} + + +static int +raptor_rdfxml_ensure_writen_header(raptor_serializer* serializer, + raptor_rdfxml_serializer_context* context) +{ + raptor_xml_writer* xml_writer; + raptor_uri *base_uri; + int i; + raptor_qname **attrs = NULL; + int attrs_count = 0; + int rc = 1; + + if(context->written_header) + return 0; + + context->written_header = 1; + + xml_writer = context->xml_writer; + + base_uri = serializer->base_uri; + if(base_uri) + base_uri = raptor_uri_copy(base_uri); + + context->rdf_RDF_element = raptor_new_xml_element_from_namespace_local_name(context->rdf_nspace, (const unsigned char*)"RDF", NULL, base_uri); + if(!context->rdf_RDF_element) + goto tidy; + + /* NOTE: Starts it item 1 as item 0 is the element's namespace (rdf) + * and does not need to be declared + */ + for(i = 1; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + if(raptor_xml_element_declare_namespace(context->rdf_RDF_element, ns)) + goto tidy; + } + + if(base_uri && + RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_WRITE_BASE_URI)) { + const unsigned char* base_uri_string; + + attrs = RAPTOR_CALLOC(raptor_qname **, 1, sizeof(raptor_qname*)); + if(!attrs) + goto tidy; + + base_uri_string = raptor_uri_as_string(base_uri); + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, context->xml_nspace, (const unsigned char*)"base", base_uri_string); + if(!attrs[attrs_count]) { + RAPTOR_FREE(qnamearray, attrs); + goto tidy; + } + attrs_count++; + } + + if(attrs_count) + raptor_xml_element_set_attributes(context->rdf_RDF_element, attrs, + attrs_count); + else + raptor_xml_element_set_attributes(context->rdf_RDF_element, NULL, 0); + + + raptor_xml_writer_start_element(xml_writer, context->rdf_RDF_element); + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)"\n", 1); + + rc = 0; + + tidy: + if(base_uri) + raptor_free_uri(base_uri); + + return rc; +} + + +/* serialize a statement */ +static int +raptor_rdfxml_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement) +{ + raptor_rdfxml_serializer_context* context = (raptor_rdfxml_serializer_context*)serializer->context; + raptor_xml_writer* xml_writer = context->xml_writer; + unsigned char* uri_string = NULL; /* predicate URI */ + unsigned char* name = NULL; /* where to split predicate name */ + unsigned char* subject_uri_string = NULL; + unsigned char* object_uri_string = NULL; + const unsigned char* nsprefix = (const unsigned char*)"ns0"; + int rc = 1; + size_t len; + raptor_xml_element* rdf_Description_element = NULL; + raptor_uri* predicate_ns_uri = NULL; + raptor_namespace* predicate_ns = NULL; + int free_predicate_ns = 0; + raptor_xml_element* predicate_element = NULL; + raptor_qname **attrs = NULL; + int attrs_count = 0; + raptor_uri* base_uri = NULL; + raptor_term_type object_type; + int allocated = 1; + int object_is_parseTypeLiteral = 0; + + if(raptor_rdfxml_ensure_writen_header(serializer, context)) + return 1; + + if(statement->predicate->type == RAPTOR_TERM_TYPE_URI) { + unsigned char *p; + size_t uri_len; + size_t name_len = 1; + unsigned char c; + + /* Do not use raptor_uri_as_counted_string() - we want a modifiable copy */ + uri_string = raptor_uri_to_counted_string(statement->predicate->value.uri, + &uri_len); + if(!uri_string) + goto oom; + + p= uri_string; + name_len = uri_len; + /* FIXME: this loop could be made smarter */ + while(name_len >0) { + if(raptor_xml_name_check(p, name_len, 10)) { + name = p; + break; + } + p++; name_len--; + } + + if(!name || (name == uri_string)) { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot split predicate URI %s into an XML qname - skipping statement", uri_string); + rc = 0; /* skip but do not return an error */ + goto tidy; + } + + c = *name; *name = '\0'; + predicate_ns_uri = raptor_new_uri(serializer->world, uri_string); + *name = c; + if(!predicate_ns_uri) + goto oom; + + predicate_ns = raptor_namespaces_find_namespace_by_uri(context->nstack, + predicate_ns_uri); + if(!predicate_ns) { + predicate_ns = raptor_new_namespace_from_uri(context->nstack, + nsprefix, + predicate_ns_uri, 0); + if(!predicate_ns) { + raptor_free_uri(predicate_ns_uri); + goto oom; + } + free_predicate_ns = 1; + } + raptor_free_uri(predicate_ns_uri); + } else { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot serialize a triple with subject node type %u\n", + statement->predicate->type); + goto tidy; + } + + /* base uri */ + if(serializer->base_uri) + base_uri = raptor_uri_copy(serializer->base_uri); + + + rdf_Description_element = raptor_new_xml_element_from_namespace_local_name(context->rdf_nspace, + (unsigned const char*)"Description", + NULL, base_uri); + if(!rdf_Description_element) + goto oom; + + attrs = RAPTOR_CALLOC(raptor_qname**, 3, sizeof(raptor_qname*)); + if(!attrs) + goto oom; + attrs_count = 0; + + /* subject */ + switch(statement->subject->type) { + case RAPTOR_TERM_TYPE_BLANK: + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, context->rdf_nspace, (const unsigned char*)"nodeID", + statement->subject->value.blank.string); + if(!attrs[attrs_count]) + goto oom; + attrs_count++; + break; + + case RAPTOR_TERM_TYPE_URI: + allocated = 1; + if(RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_RELATIVE_URIS)) { + subject_uri_string = raptor_uri_to_relative_uri_string(serializer->base_uri, + statement->subject->value.uri); + if(!subject_uri_string) + goto oom; + } else { + subject_uri_string = raptor_uri_as_string(statement->subject->value.uri); + allocated = 0; + } + + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, context->rdf_nspace, (const unsigned char*)"about", subject_uri_string); + if(!attrs[attrs_count]) { + if(allocated) + RAPTOR_FREE(char*, subject_uri_string); + goto oom; + } + attrs_count++; + + if(allocated) + RAPTOR_FREE(char*, subject_uri_string); + + break; + + case RAPTOR_TERM_TYPE_LITERAL: + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, "Cannot serialize a triple with a literal subject\n"); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot serialize a triple with subject node type %u", + statement->subject->type); + } + + if(attrs_count) { + raptor_xml_element_set_attributes(rdf_Description_element, attrs, attrs_count); + attrs = NULL; /* attrs ownership transferred to element */ + } + + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)" ", 2); + raptor_xml_writer_start_element(xml_writer, rdf_Description_element); + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)"\n", 1); + + + /* predicate */ + predicate_element = raptor_new_xml_element_from_namespace_local_name(predicate_ns, name, NULL, base_uri); + if(!predicate_element) + goto oom; + + /* object */ + attrs = RAPTOR_CALLOC(raptor_qname**, 3, sizeof(raptor_qname*)); + if(!attrs) + goto oom; + attrs_count = 0; + + object_type = statement->object->type; + switch(object_type) { + case RAPTOR_TERM_TYPE_LITERAL: + object_is_parseTypeLiteral = 0; + if(statement->object->value.literal.datatype && + raptor_uri_equals(statement->object->value.literal.datatype, + RAPTOR_RDF_XMLLiteral_URI(serializer->world))) + object_is_parseTypeLiteral = 1; + + if(statement->object->value.literal.language) { + attrs[attrs_count] = raptor_new_qname(context->nstack, + (unsigned char*)"xml:lang", + statement->object->value.literal.language); + if(!attrs[attrs_count]) + goto oom; + attrs_count++; + } + len = statement->object->value.literal.string_len; + + if(object_is_parseTypeLiteral) { + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, context->rdf_nspace, (const unsigned char*)"parseType", (const unsigned char*)"Literal"); + if(!attrs[attrs_count]) + goto oom; + attrs_count++; + + raptor_xml_element_set_attributes(predicate_element, attrs, attrs_count); + attrs = NULL; /* attrs ownership transferred to element */ + + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)" ", 4); + raptor_xml_writer_start_element(xml_writer, predicate_element); + + /* Print without escaping XML */ + if(len) + raptor_xml_writer_raw_counted(xml_writer, + (const unsigned char*)statement->object->value.literal.string, + RAPTOR_BAD_CAST(unsigned int, len)); + } else { + if(statement->object->value.literal.datatype) { + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, context->rdf_nspace, (const unsigned char*)"datatype", raptor_uri_as_string(statement->object->value.literal.datatype)); + if(!attrs[attrs_count]) + goto oom; + attrs_count++; + } + raptor_xml_element_set_attributes(predicate_element, attrs, attrs_count); + attrs = NULL; /* attrs ownership transferred to element */ + + raptor_xml_writer_cdata_counted(xml_writer, + (const unsigned char*)" ", 4); + raptor_xml_writer_start_element(xml_writer, predicate_element); + + if(len) + raptor_xml_writer_cdata_counted(xml_writer, + statement->object->value.literal.string, + RAPTOR_BAD_CAST(unsigned int, len)); + } + + raptor_xml_writer_end_element(xml_writer, predicate_element); + raptor_free_xml_element(predicate_element); + predicate_element = NULL; + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)"\n", 1); + + break; + + case RAPTOR_TERM_TYPE_BLANK: + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, context->rdf_nspace, (const unsigned char*)"nodeID", statement->object->value.blank.string); + if(!attrs[attrs_count]) + goto oom; + attrs_count++; + + raptor_xml_element_set_attributes(predicate_element, attrs, attrs_count); + attrs = NULL; /* attrs ownership transferred to element */ + + raptor_xml_writer_cdata_counted(xml_writer, + (const unsigned char*)" ", 4); + raptor_xml_writer_empty_element(xml_writer, predicate_element); + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)"\n", 1); + break; + + case RAPTOR_TERM_TYPE_URI: + /* must be URI */ + if(RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_RELATIVE_URIS)) { + object_uri_string = raptor_uri_to_relative_uri_string(serializer->base_uri, + statement->object->value.uri); + } else { + object_uri_string = raptor_uri_to_string(statement->object->value.uri); + } + if(!object_uri_string) + goto oom; + + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, context->rdf_nspace, (const unsigned char*)"resource", object_uri_string); + RAPTOR_FREE(char*, object_uri_string); + + if(!attrs[attrs_count]) + goto oom; + + attrs_count++; + raptor_xml_element_set_attributes(predicate_element, attrs, attrs_count); + attrs = NULL; /* attrs ownership transferred to element */ + + raptor_xml_writer_cdata_counted(xml_writer, + (const unsigned char*)" ", 4); + raptor_xml_writer_empty_element(xml_writer, predicate_element); + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)"\n", 1); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot serialize a triple with object node type %u", + object_type); + } + + raptor_xml_writer_cdata_counted(xml_writer, + (const unsigned char*)" ", 2); + + rc = 0; /* success */ + goto tidy; + + oom: + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_FATAL, NULL, + "Out of memory"); + + tidy: + + if(attrs) + RAPTOR_FREE(qnamearray, attrs); + + if(predicate_element) + raptor_free_xml_element(predicate_element); + + if(rdf_Description_element) { + raptor_xml_writer_end_element(xml_writer, rdf_Description_element); + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)"\n", 1); + raptor_free_xml_element(rdf_Description_element); + } + + if(base_uri) + raptor_free_uri(base_uri); + + if(free_predicate_ns) + raptor_free_namespace(predicate_ns); + + if(uri_string) + RAPTOR_FREE(char*, uri_string); + + return rc; +} + + +/* end a serialize */ +static int +raptor_rdfxml_serialize_end(raptor_serializer* serializer) +{ + raptor_rdfxml_serializer_context* context = (raptor_rdfxml_serializer_context*)serializer->context; + raptor_xml_writer* xml_writer = context->xml_writer; + + if(xml_writer) { + /* Make sure an empty RDF/XML document is written when 0 triples + * were seen + */ + + /* ignore ret value */ + raptor_rdfxml_ensure_writen_header(serializer, context); + + if(context->rdf_RDF_element) { + raptor_xml_writer_end_element(xml_writer, context->rdf_RDF_element); + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)"\n", 1); + } + + raptor_xml_writer_flush(xml_writer); + } + + if(context->rdf_RDF_element) { + raptor_free_xml_element(context->rdf_RDF_element); + context->rdf_RDF_element = NULL; + } + + return 0; +} + + +/* finish the serializer factory */ +static void +raptor_rdfxml_serialize_finish_factory(raptor_serializer_factory* factory) +{ + +} + +static const char* const rdfxml_names[2] = { "rdfxml", NULL}; + +static const char* const rdfxml_uri_strings[3] = { + "http://www.w3.org/ns/formats/RDF_XML", + "http://www.w3.org/TR/rdf-syntax-grammar", + NULL +}; + +#define RDFXML_TYPES_COUNT 2 +static const raptor_type_q rdfxml_types[RDFXML_TYPES_COUNT + 1] = { + { "application/rdf+xml", 19, 10}, + { "text/rdf", 8, 6}, + { NULL, 0, 0} +}; + +static int +raptor_rdfxml_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = rdfxml_names; + factory->desc.mime_types = rdfxml_types; + + factory->desc.label = "RDF/XML"; + factory->desc.uri_strings = rdfxml_uri_strings, + + factory->context_length = sizeof(raptor_rdfxml_serializer_context); + + factory->init = raptor_rdfxml_serialize_init; + factory->terminate = raptor_rdfxml_serialize_terminate; + factory->declare_namespace = raptor_rdfxml_serialize_declare_namespace; + factory->declare_namespace_from_namespace = raptor_rdfxml_serialize_declare_namespace_from_namespace; + factory->serialize_start = raptor_rdfxml_serialize_start; + factory->serialize_statement = raptor_rdfxml_serialize_statement; + factory->serialize_end = raptor_rdfxml_serialize_end; + factory->finish_factory = raptor_rdfxml_serialize_finish_factory; + + return 0; +} + + + +int +raptor_init_serializer_rdfxml(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_rdfxml_serializer_register_factory); +} + + diff --git a/src/raptor_serialize_rdfxmla.c b/src/raptor_serialize_rdfxmla.c new file mode 100644 index 0000000..2341947 --- /dev/null +++ b/src/raptor_serialize_rdfxmla.c @@ -0,0 +1,1553 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize_rdfxmla.c - RDF/XML with abbreviations serializer + * + * Copyright (C) 2004-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * Copyright (C) 2005, Steve Shepard steveshep@gmail.com + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* + * Raptor rdfxml-abbrev serializer object + */ +typedef struct { + raptor_namespace_stack *nstack; /* Namespace stack */ + raptor_namespace *xml_nspace; /* the xml: namespace */ + raptor_namespace *rdf_nspace; /* the rdf: namespace */ + raptor_xml_element* rdf_RDF_element; /* the rdf:RDF element */ + raptor_xml_writer *xml_writer; /* where the xml is being written */ + raptor_sequence *namespaces; /* User declared namespaces */ + raptor_avltree *subjects; /* subject items */ + raptor_avltree *blanks; /* blank subject items */ + raptor_avltree *nodes; /* nodes */ + raptor_abbrev_node *rdf_type; /* rdf:type uri */ + + /* non-zero if is Adobe XMP abbreviated form */ + int is_xmp; + + /* non zero if rdf:RDF has been written (and thus no new namespaces + * can be declared). + */ + int written_header; + + /* for labeling namespaces */ + int namespace_count; + + /* xml_writer was passed in and not owned by us */ + int external_xml_writer; + + /* true if should write rdf:RDF */ + int write_rdf_RDF; + + /* starting namespace stack depth */ + int starting_depth; + + /* namespaces stack was passed in andn not owned by us */ + int external_nstack; + + /* If not NULL, the URI of the single node to serialize - starting + * from property elements */ + raptor_uri* single_node; + + /* If non-0, emit typed nodes */ + int write_typed_nodes; +} raptor_rdfxmla_context; + + +/* prototypes for functions */ + +static int raptor_rdfxmla_emit_resource(raptor_serializer *serializer, + raptor_xml_element *element, + raptor_abbrev_node *node, + int depth); + +static int raptor_rdfxmla_emit_literal(raptor_serializer *serializer, + raptor_xml_element *element, + raptor_abbrev_node *node, + int depth); +static int raptor_rdfxmla_emit_blank(raptor_serializer *serializer, + raptor_xml_element *element, + raptor_abbrev_node* node, + int depth); +static int raptor_rdfxmla_emit_subject_list_items(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth); +static int raptor_rdfxmla_emit_subject_properties(raptor_serializer *serializer, + raptor_abbrev_subject* subject, + int depth); +static int raptor_rdfxmla_emit_subject(raptor_serializer *serializer, + raptor_abbrev_subject* subject, + int depth); +static int raptor_rdfxmla_emit(raptor_serializer *serializer); + +static int raptor_rdfxmla_serialize_init(raptor_serializer* serializer, + const char *name); +static void raptor_rdfxmla_serialize_terminate(raptor_serializer* serializer); +static int raptor_rdfxmla_serialize_declare_namespace(raptor_serializer* serializer, + raptor_uri *uri, + const unsigned char *prefix); +static int raptor_rdfxmla_serialize_start(raptor_serializer* serializer); +static int raptor_rdfxmla_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement); + +static int raptor_rdfxmla_serialize_end(raptor_serializer* serializer); +static void raptor_rdfxmla_serialize_finish_factory(raptor_serializer_factory* factory); + + +/* helper functions */ + + +/* + * raptor_rdfxmla_emit_resource_uri: + * @serializer: #raptor_serializer object + * @element: XML Element + * @uri: URI object + * @depth: depth into tree + * + * Emit a description of a resource using an XML Element + * + * Return value: non-0 on failure + **/ +static int +raptor_rdfxmla_emit_resource_uri(raptor_serializer *serializer, + raptor_xml_element *element, + raptor_uri* uri, + int depth) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + raptor_xml_writer *xml_writer = context->xml_writer; + raptor_qname **attrs; + unsigned char *attr_name; + unsigned char *attr_value; + + RAPTOR_DEBUG2("Emitting resource predicate URI %s\n", + raptor_uri_as_string(uri)); + + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + if(!attrs) + return 1; + + attr_name = (unsigned char *)"resource"; + + if(RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_RELATIVE_URIS)) + /* newly allocated string */ + attr_value = raptor_uri_to_relative_uri_string(serializer->base_uri, uri); + else + attr_value = raptor_uri_as_string(uri); + + attrs[0] = raptor_new_qname_from_namespace_local_name(serializer->world, + context->rdf_nspace, + attr_name, + attr_value); + + if(RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_RELATIVE_URIS)) + RAPTOR_FREE(char*, attr_value); + + if(!attrs[0]) { + RAPTOR_FREE(qnamearray, attrs); + return 1; + } + + raptor_xml_element_set_attributes(element, attrs, 1); + + raptor_xml_writer_start_element(xml_writer, element); + raptor_xml_writer_end_element(context->xml_writer, element); + + RAPTOR_DEBUG2("Emitted resource predicate URI %s\n", + raptor_uri_as_string(uri)); + + return 0; +} + + +/* + * raptor_rdfxmla_emit_resource: + * @serializer: #raptor_serializer object + * @element: XML Element + * @node: resource node + * @depth: depth into tree + * + * Emit a description of a resource using an XML Element + * + * Return value: non-0 on failure + **/ +static int +raptor_rdfxmla_emit_resource(raptor_serializer *serializer, + raptor_xml_element *element, + raptor_abbrev_node* node, + int depth) +{ + int rc; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting resource node", node); + + if(node->term->type != RAPTOR_TERM_TYPE_URI) + return 1; + + rc = raptor_rdfxmla_emit_resource_uri(serializer, element, + node->term->value.uri, depth); + + RAPTOR_DEBUG_ABBREV_NODE("Emitted resource node", node); + + return rc; +} + + +/* + * raptor_rdfxmla_emit_literal: + * @serializer: #raptor_serializer object + * @element: XML Element + * @node: literal node + * @depth: depth into tree + * + * Emit a description of a literal using an XML Element + * + * Return value: non-0 on failure + **/ +static int +raptor_rdfxmla_emit_literal(raptor_serializer *serializer, + raptor_xml_element *element, + raptor_abbrev_node* node, + int depth) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + raptor_xml_writer *xml_writer = context->xml_writer; + raptor_qname **attrs; + int attrs_count; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting literal node", node); + + if(node->term->type != RAPTOR_TERM_TYPE_LITERAL) + return 1; + + if(node->term->value.literal.language || node->term->value.literal.datatype) { + + attrs_count = 0; + attrs = RAPTOR_CALLOC(raptor_qname**, 2, sizeof(raptor_qname*)); + if(!attrs) + return 1; + + if(node->term->value.literal.language) { + attrs[attrs_count] = raptor_new_qname(context->nstack, + (unsigned char*)"xml:lang", + node->term->value.literal.language); + if(!attrs[attrs_count]) + goto attrs_oom; + attrs_count++; + } + + if(node->term->value.literal.datatype) { + unsigned char *datatype_value; + datatype_value = raptor_uri_as_string(node->term->value.literal.datatype); + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, + context->rdf_nspace, + (const unsigned char*)"datatype", + datatype_value); + if(!attrs[attrs_count]) + goto attrs_oom; + attrs_count++; + + /* SJS Note: raptor_default_uri_as_string simply returns a + * pointer to the string. Hope this is also true of alternate + * uri implementations. */ + /* RAPTOR_FREE(char*, datatype_value); */ + + } + + raptor_xml_element_set_attributes(element, attrs, attrs_count); + + } + + raptor_xml_writer_start_element(xml_writer, element); + raptor_xml_writer_cdata(xml_writer, node->term->value.literal.string); + raptor_xml_writer_end_element(xml_writer, element); + + RAPTOR_DEBUG_ABBREV_NODE("Emitted literal node", node); + + return 0; + + attrs_oom: + + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_FATAL, NULL, + "Out of memory"); + + /* attrs_count has not been incremented yet + * and it points to the qname the allocation of which failed */ + attrs_count--; + while(attrs_count>=0) + raptor_free_qname(attrs[attrs_count--]); + + RAPTOR_FREE(qnamearray, attrs); + + return 1; +} + + +/* + * raptor_rdfxmla_emit_blank: + * @serializer: #raptor_serializer object + * @element: XML Element + * @node: blank node + * @depth: depth into tree + * + * Emit a description of a blank node using an XML Element + * + * Return value: non-0 on failure + **/ +static int +raptor_rdfxmla_emit_blank(raptor_serializer *serializer, + raptor_xml_element *element, raptor_abbrev_node* node, + int depth) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting blank node", node); + + if(node->term->type != RAPTOR_TERM_TYPE_BLANK) + return 1; + + if((node->count_as_subject == 1 && node->count_as_object == 1)) { + /* If this is only used as a 1 subject and object or never + * used as a subject or never used as an object, it never need + * be referenced with an explicit name */ + raptor_abbrev_subject* blank; + + raptor_xml_writer_start_element(context->xml_writer, element); + + blank = raptor_abbrev_subject_find(context->blanks, node->term); + + if(blank) { + raptor_rdfxmla_emit_subject(serializer, blank, depth + 1); + raptor_abbrev_subject_invalidate(blank); + } + + } else { + unsigned char *attr_name = (unsigned char*)"nodeID"; + unsigned char *attr_value = node->term->value.blank.string; + raptor_qname **attrs; + + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + if(!attrs) + return 1; + + attrs[0] = raptor_new_qname_from_namespace_local_name(serializer->world, + context->rdf_nspace, + attr_name, + attr_value); + + raptor_xml_element_set_attributes(element, attrs, 1); + raptor_xml_writer_start_element(context->xml_writer, element); + + } + + raptor_xml_writer_end_element(context->xml_writer, element); + + RAPTOR_DEBUG_ABBREV_NODE("Emitted blank node", node); + + return 0; +} + + +/* + * raptor_rdfxmla_emit_subject_list_items: + * @serializer: #raptor_serializer object + * @subject: subject node + * @depth: depth into tree + * + * Emit an rdf list of items (rdf:li) about a subject node. + * + * Return value: non-0 on failure + **/ +static int +raptor_rdfxmla_emit_subject_list_items(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + int rv = 0; + int i = 0; + raptor_uri* base_uri = NULL; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject list items", subject->node); + + while(!rv && i < raptor_sequence_size(subject->list_items)) { + + raptor_abbrev_node* object; + raptor_qname *qname; + raptor_xml_element *element; + + object = (raptor_abbrev_node*)raptor_sequence_get_at(subject->list_items, i++); + if(!object) + continue; + + qname = raptor_new_qname_from_namespace_local_name(serializer->world, + context->rdf_nspace, + (unsigned char *)"li", + NULL); + + if(serializer->base_uri) + base_uri = raptor_uri_copy(serializer->base_uri); + element = raptor_new_xml_element(qname, NULL, base_uri); + if(!element) { + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_FATAL, NULL, + "Out of memory"); + raptor_free_qname(qname); + rv = 1; /* error */ + break; + } + + switch (object->term->type) { + + case RAPTOR_TERM_TYPE_URI: + rv = raptor_rdfxmla_emit_resource(serializer, element, object, + depth + 1); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + rv = raptor_rdfxmla_emit_literal(serializer, element, object, + depth + 1); + break; + + case RAPTOR_TERM_TYPE_BLANK: + rv = raptor_rdfxmla_emit_blank(serializer, element, object, + depth + 1); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, "Triple has unsupported term type %u", + object->term->type); + break; + + } + + raptor_free_xml_element(element); + + } + + return rv; +} + + +/* + * raptor_rdfxmla_emit_subject_properties: + * @serializer: #raptor_serializer object + * @subject: subject node + * @depth: depth into tree + * + * Emit the properties about a subject node. + * + * Return value: non-0 on failure + **/ +static int +raptor_rdfxmla_emit_subject_properties(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + int rv = 0; + raptor_avltree_iterator* iter = NULL; + raptor_term* subject_term = subject->node->term; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject properties", subject->node); + + /* Emit any rdf:_n properties collected */ + if(raptor_sequence_size(subject->list_items) > 0) { + rv = raptor_rdfxmla_emit_subject_list_items(serializer, subject, depth + 1); + if(rv) + return rv; + } + + + if(subject->node_type && !context->write_typed_nodes) { + raptor_uri *base_uri = NULL; + raptor_qname *qname = NULL; + raptor_xml_element *element = NULL; + + /* if rdf:type was associated with this subject and do not want + * a typed node, emit it as a property element + */ + qname = raptor_new_qname_from_resource(context->namespaces, + context->nstack, + &context->namespace_count, + context->rdf_type); + if(!qname) + goto oom; + + if(serializer->base_uri) + base_uri = raptor_uri_copy(serializer->base_uri); + + element = raptor_new_xml_element(qname, NULL, base_uri); + if(!element) { + if(base_uri) + raptor_free_uri(base_uri); + raptor_free_qname(qname); + goto oom; + } + + rv = raptor_rdfxmla_emit_resource_uri(serializer, element, + subject_term->value.uri, + depth + 1); + raptor_free_xml_element(element); + } + + + for(iter = raptor_new_avltree_iterator(subject->properties, NULL, NULL, 1); + iter && !rv; + (rv = raptor_avltree_iterator_next(iter))) { + raptor_uri *base_uri = NULL; + raptor_qname *qname; + raptor_xml_element *element; + raptor_abbrev_node** nodes; + raptor_abbrev_node* predicate; + raptor_abbrev_node* object; + + nodes = (raptor_abbrev_node**)raptor_avltree_iterator_get(iter); + if(!nodes) + break; + predicate= nodes[0]; + object= nodes[1]; + + qname = raptor_new_qname_from_resource(context->namespaces, + context->nstack, + &context->namespace_count, + predicate); + if(!qname) { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot split URI '%s' into an XML qname", + raptor_uri_as_string(predicate->term->value.uri)); + continue; + } + + if(serializer->base_uri) + base_uri = raptor_uri_copy(serializer->base_uri); + element = raptor_new_xml_element(qname, NULL, base_uri); + if(!element) { + if(base_uri) + raptor_free_uri(base_uri); + raptor_free_qname(qname); + goto oom; + } + + switch (object->term->type) { + + case RAPTOR_TERM_TYPE_URI: + rv = raptor_rdfxmla_emit_resource(serializer, element, object, + depth + 1); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + rv = raptor_rdfxmla_emit_literal(serializer, element, object, + depth + 1); + break; + + case RAPTOR_TERM_TYPE_BLANK: + rv = raptor_rdfxmla_emit_blank(serializer, element, object, + depth + 1); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, "Triple has unsupported term type %u", + object->term->type); + break; + } + + /* Return error if emitting something failed above */ + if(rv) + break; + + raptor_free_xml_element(element); + + } + if(iter) + raptor_free_avltree_iterator(iter); + + return rv; + + oom: + if(iter) + raptor_free_avltree_iterator(iter); + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_FATAL, NULL, + "Out of memory"); + return 1; +} + + +/* + * raptor_rdfxmla_emit_subject: + * @serializer: #raptor_serializer object + * @subject: subject node + * @depth: depth into tree + * + * Emit a subject node + * + * Return value: non-0 on failure + **/ +static int +raptor_rdfxmla_emit_subject(raptor_serializer *serializer, + raptor_abbrev_subject* subject, + int depth) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + raptor_qname *qname = NULL; + raptor_xml_element *element = NULL; + raptor_qname **attrs; + unsigned char *attr_name; + unsigned char *attr_value; + raptor_uri *base_uri = NULL; + int subject_is_single_node; + raptor_term *subject_term = subject->node->term; + + if(!raptor_abbrev_subject_valid(subject)) + return 0; + + subject_is_single_node = (context->single_node && + subject_term->type == RAPTOR_TERM_TYPE_URI && + raptor_uri_equals(subject_term->value.uri, + context->single_node)); + + + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject node", subject->node); + + if(!depth && + subject_term->type == RAPTOR_TERM_TYPE_BLANK && + subject->node->count_as_subject == 1 && + subject->node->count_as_object == 1) { + RAPTOR_DEBUG_ABBREV_NODE("Skipping subject node", subject->node); + return 0; + } + + + if(subject->node_type && context->write_typed_nodes) { + /* if rdf:type was associated with this subject */ + qname = raptor_new_qname_from_resource(context->namespaces, + context->nstack, + &context->namespace_count, + subject->node_type); + + if(!qname) { + raptor_log_error_formatted(serializer->world, + RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot split URI '%s' into an XML qname", + raptor_uri_as_string(subject->node_type->term->value.uri)); + return 1; + } + + } else { + qname = raptor_new_qname_from_namespace_local_name(serializer->world, + context->rdf_nspace, + (unsigned const char*)"Description", + NULL); + if(!qname) + goto oom; + } + + if(serializer->base_uri) + base_uri = raptor_uri_copy(serializer->base_uri); + element = raptor_new_xml_element(qname, NULL, base_uri); + if(!element) { + if(base_uri) + raptor_free_uri(base_uri); + raptor_free_qname(qname); + goto oom; + } + + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + if(!attrs) + goto oom; + + attr_name = NULL; + attr_value = NULL; + + /* emit the subject node */ + if(subject_term->type == RAPTOR_TERM_TYPE_URI) { + attr_name = (unsigned char*)"about"; + if(context->is_xmp) { + /* XML rdf:about value is always "" */ + attr_value = RAPTOR_CALLOC(unsigned char*, 1, sizeof(unsigned char)); + } else if(RAPTOR_OPTIONS_GET_NUMERIC(serializer, + RAPTOR_OPTION_RELATIVE_URIS)) + attr_value = raptor_uri_to_relative_uri_string(serializer->base_uri, + subject_term->value.uri); + else + attr_value = raptor_uri_to_string(subject_term->value.uri); + + } else if(subject_term->type == RAPTOR_TERM_TYPE_BLANK) { + if(subject->node->count_as_subject && + subject->node->count_as_object && + !(subject->node->count_as_subject == 1 && + subject->node->count_as_object == 1)) { + /* No need for nodeID if this node is never used as a subject + * or object OR if it is used exactly once as subject and object. + */ + attr_name = (unsigned char*)"nodeID"; + attr_value = subject_term->value.blank.string; + } + } + + if(attr_name) { + attrs[0] = raptor_new_qname_from_namespace_local_name(serializer->world, + context->rdf_nspace, + attr_name, + attr_value); + + if(subject_term->type != RAPTOR_TERM_TYPE_BLANK) + RAPTOR_FREE(char*, attr_value); + + if(!attrs[0]) { + RAPTOR_FREE(qnamearray, attrs); + goto oom; + } + + /* Note: if we were willing to track the in-scope rdf:lang, we + * could do the "2.5 Property Attributes" abbreviation here */ + raptor_xml_element_set_attributes(element, attrs, 1); + } else { + RAPTOR_FREE(qnamearray, attrs); + } + + if(!subject_is_single_node) { + raptor_xml_writer_start_element(context->xml_writer, element); + raptor_rdfxmla_emit_subject_properties(serializer, subject, depth + 1); + raptor_xml_writer_end_element(context->xml_writer, element); + } else + raptor_rdfxmla_emit_subject_properties(serializer, subject, depth); + + raptor_free_xml_element(element); + + return 0; + + oom: + if(element) + raptor_free_xml_element(element); + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Out of memory"); + return 1; +} + + +/* + * raptor_rdfxmla_emit - + * @serializer: #raptor_serializer object + * + * Emit RDF/XML for all stored triples. + * + * Return value: non-0 on failure + **/ +static int +raptor_rdfxmla_emit(raptor_serializer *serializer) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + raptor_abbrev_subject* subject; + raptor_abbrev_subject* blank; + raptor_avltree_iterator* iter = NULL; + + iter = raptor_new_avltree_iterator(context->subjects, NULL, NULL, 1); + while(iter) { + subject = (raptor_abbrev_subject*)raptor_avltree_iterator_get(iter); + if(subject) { + raptor_rdfxmla_emit_subject(serializer, subject, context->starting_depth); + } + if(raptor_avltree_iterator_next(iter)) + break; + } + if(iter) + raptor_free_avltree_iterator(iter); + + if(!context->single_node) { + /* Emit any remaining blank nodes */ + iter = raptor_new_avltree_iterator(context->blanks, NULL, NULL, 1); + while(iter) { + blank = (raptor_abbrev_subject*)raptor_avltree_iterator_get(iter); + if(blank) { + raptor_rdfxmla_emit_subject(serializer, blank, context->starting_depth); + } + if(raptor_avltree_iterator_next(iter)) + break; + } + if(iter) + raptor_free_avltree_iterator(iter); + } + + return 0; +} + + +/* + * raptor serializer rdfxml-abbrev implementation + */ + + +static void +raptor_rdfxmla_serialize_init_nstack(raptor_serializer* serializer, + raptor_namespace_stack *nstack) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + + context->xml_nspace = raptor_new_namespace(context->nstack, + (const unsigned char*)"xml", + raptor_xml_namespace_uri, + context->starting_depth); + + context->rdf_nspace = raptor_new_namespace(context->nstack, + (const unsigned char*)"rdf", + raptor_rdf_namespace_uri, + context->starting_depth); +} + + + +/* create a new serializer */ +static int +raptor_rdfxmla_serialize_init(raptor_serializer* serializer, const char *name) +{ + raptor_rdfxmla_context* context; + raptor_term* type_term; + + context = (raptor_rdfxmla_context*)serializer->context; + + context->nstack = raptor_new_namespaces(serializer->world, 1); + if(!context->nstack) + return 1; + + raptor_rdfxmla_serialize_init_nstack(serializer, context->nstack); + + context->namespaces = raptor_new_sequence(NULL, NULL); + + context->subjects = + raptor_new_avltree((raptor_data_compare_handler)raptor_abbrev_subject_compare, + (raptor_data_free_handler)raptor_free_abbrev_subject, 0); + + context->blanks = + raptor_new_avltree((raptor_data_compare_handler)raptor_abbrev_subject_compare, + (raptor_data_free_handler)raptor_free_abbrev_subject, 0); + + context->nodes = + raptor_new_avltree((raptor_data_compare_handler)raptor_abbrev_node_compare, + (raptor_data_free_handler)raptor_free_abbrev_node, 0); + + type_term = RAPTOR_RDF_type_term(serializer->world); + context->rdf_type = raptor_new_abbrev_node(serializer->world, type_term); + + if(!context->xml_nspace || !context->rdf_nspace || !context->namespaces || + !context->subjects || !context->blanks || !context->nodes || + !context->rdf_type) { + raptor_rdfxmla_serialize_terminate(serializer); + return 1; + } + + context->is_xmp=!strncmp(name, "rdfxml-xmp", 10); + if(context->is_xmp) + RAPTOR_OPTIONS_SET_NUMERIC(serializer, + RAPTOR_OPTION_WRITER_XML_DECLARATION, 0); + + /* Note: item 0 in the list is rdf:RDF's namespace */ + if(raptor_sequence_push(context->namespaces, context->rdf_nspace)) { + raptor_rdfxmla_serialize_terminate(serializer); + return 1; + } + + context->write_rdf_RDF = 1; + context->starting_depth = 0; + context->single_node = NULL; + context->write_typed_nodes = 1; + + return 0; +} + + +/* destroy a serializer */ +static void +raptor_rdfxmla_serialize_terminate(raptor_serializer* serializer) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + + if(context->xml_writer) { + if(!context->external_xml_writer) + raptor_free_xml_writer(context->xml_writer); + context->xml_writer = NULL; + context->external_xml_writer = 0; + } + + if(context->rdf_RDF_element) { + raptor_free_xml_element(context->rdf_RDF_element); + context->rdf_RDF_element = NULL; + } + + if(context->rdf_nspace) { + raptor_free_namespace(context->rdf_nspace); + context->rdf_nspace = NULL; + } + + if(context->xml_nspace) { + raptor_free_namespace(context->xml_nspace); + context->xml_nspace = NULL; + } + + if(context->namespaces) { + int i; + + /* Note: item 0 in the list is rdf:RDF's namespace and freed above */ + for(i = 1; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns; + ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + if(ns) + raptor_free_namespace(ns); + } + raptor_free_sequence(context->namespaces); + context->namespaces = NULL; + } + + if(context->subjects) { + raptor_free_avltree(context->subjects); + context->subjects = NULL; + } + + if(context->blanks) { + raptor_free_avltree(context->blanks); + context->blanks = NULL; + } + + if(context->nodes) { + raptor_free_avltree(context->nodes); + context->nodes = NULL; + } + + /* always free raptor_namespace* before stack */ + if(context->nstack) { + if(!context->external_nstack) + raptor_free_namespaces(context->nstack); + context->nstack = NULL; + } + + if(context->rdf_type) { + raptor_free_abbrev_node(context->rdf_type); + context->rdf_type = NULL; + } +} + + +#define RDFXMLA_NAMESPACE_DEPTH 0 + +/* add a namespace */ +static int +raptor_rdfxmla_serialize_declare_namespace_from_namespace(raptor_serializer* serializer, + raptor_namespace *nspace) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + int i; + + if(context->written_header) + return 1; + + for(i = 0; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns; + ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + + /* If prefix is already declared, ignore it */ + if(!ns->prefix && !nspace->prefix) + return 1; + + if(ns->prefix && nspace->prefix && + !strcmp((const char*)ns->prefix, (const char*)nspace->prefix)) + return 1; + + if(ns->uri && nspace->uri && + raptor_uri_equals(ns->uri, nspace->uri)) + return 1; + } + + nspace = raptor_new_namespace_from_uri(context->nstack, + nspace->prefix, nspace->uri, + context->starting_depth + + RDFXMLA_NAMESPACE_DEPTH); + if(!nspace) + return 1; + + raptor_sequence_push(context->namespaces, nspace); + return 0; +} + + +/* add a namespace */ +static int +raptor_rdfxmla_serialize_declare_namespace(raptor_serializer* serializer, + raptor_uri *uri, + const unsigned char *prefix) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + raptor_namespace *ns; + int rc; + + ns = raptor_new_namespace_from_uri(context->nstack, prefix, uri, + context->starting_depth + + RDFXMLA_NAMESPACE_DEPTH); + + rc = raptor_rdfxmla_serialize_declare_namespace_from_namespace(serializer, + ns); + raptor_free_namespace(ns); + + return rc; +} + + +/* + * raptor_rdfxmla_serialize_set_write_rdf_RDF: + * @serializer: serializer object + * @value: value + * + * INTERNAL - Set flag to write rdf:RDF root element + * + * Return value: non-0 on failure + */ +int +raptor_rdfxmla_serialize_set_write_rdf_RDF(raptor_serializer* serializer, + int value) +{ + raptor_rdfxmla_context* context; + + if(strcmp(serializer->factory->desc.names[0], "rdfxml-abbrev")) + return 1; + + context = (raptor_rdfxmla_context*)serializer->context; + + context->write_rdf_RDF = value; + + return 0; +} + + +/* + * raptor_rdfxmla_serialize_set_xml_writer: + * @serializer: serializer object + * @xml_writer: XML writer + * @nstack: namespace stack + * + * INTERNAL - Set an existing created XML writer to write the serializing to + * + * Return value: non-0 on failure + */ +int +raptor_rdfxmla_serialize_set_xml_writer(raptor_serializer* serializer, + raptor_xml_writer* xml_writer, + raptor_namespace_stack *nstack) +{ + raptor_rdfxmla_context* context; + + if(strcmp(serializer->factory->desc.names[0], "rdfxml-abbrev")) + return 1; + + context = (raptor_rdfxmla_context*)serializer->context; + + context->xml_writer = xml_writer; + context->starting_depth = xml_writer ? (raptor_xml_writer_get_depth(xml_writer) + 1) : -1; + context->external_xml_writer = (xml_writer != NULL); + + if(context->xml_nspace) + raptor_free_namespace(context->xml_nspace); + if(context->rdf_nspace) + raptor_free_namespace(context->rdf_nspace); + /* always free raptor_namespace* before stack */ + if(context->nstack) + raptor_free_namespaces(context->nstack); + + context->nstack = nstack; + context->external_nstack = 1; + raptor_rdfxmla_serialize_init_nstack(serializer, context->nstack); + + return 0; +} + + +/* + * raptor_rdfxmla_serialize_set_single_node: + * @serializer: + * @uri: + * + * INTERNAL - Set a single node to serialize the contents + * + * The outer node element with this URI is not serialized, the inner + * property elements are written. @uri is copied + * + * Return value: non-0 on failure + */ +int +raptor_rdfxmla_serialize_set_single_node(raptor_serializer* serializer, + raptor_uri* uri) +{ + raptor_rdfxmla_context* context; + + if(strcmp(serializer->factory->desc.names[0], "rdfxml-abbrev")) + return 1; + + context = (raptor_rdfxmla_context*)serializer->context; + + if(context->single_node) + raptor_free_uri(context->single_node); + + context->single_node = raptor_uri_copy(uri); + + return 0; +} + + +/* + * raptor_rdfxmla_serialize_set_write_typed_nodes: + * @serializer: + * @value: + * + * INTERNAL - Set flag to write typed node elements + * + * Return value: non-0 on failure + */ +int +raptor_rdfxmla_serialize_set_write_typed_nodes(raptor_serializer* serializer, + int value) +{ + raptor_rdfxmla_context* context; + + if(strcmp(serializer->factory->desc.names[0], "rdfxml-abbrev")) + return 1; + + context = (raptor_rdfxmla_context*)serializer->context; + + context->write_typed_nodes = value; + + return 0; +} + + +/* start a serialize */ +static int +raptor_rdfxmla_serialize_start(raptor_serializer* serializer) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + + if(!context->external_xml_writer) { + raptor_xml_writer* xml_writer; + raptor_option option; + + if(context->xml_writer) + raptor_free_xml_writer(context->xml_writer); + + xml_writer = raptor_new_xml_writer(serializer->world, context->nstack, + serializer->iostream); + if(!xml_writer) + return 1; + + raptor_xml_writer_set_option(xml_writer, + RAPTOR_OPTION_WRITER_AUTO_INDENT, NULL,1); + raptor_xml_writer_set_option(xml_writer, + RAPTOR_OPTION_WRITER_AUTO_EMPTY, NULL, 1); + raptor_xml_writer_set_option(xml_writer, + RAPTOR_OPTION_WRITER_INDENT_WIDTH, NULL, 2); + option = RAPTOR_OPTION_WRITER_XML_VERSION; + raptor_xml_writer_set_option(xml_writer, option, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(serializer, option)); + option = RAPTOR_OPTION_WRITER_XML_DECLARATION; + raptor_xml_writer_set_option(xml_writer, option, NULL, + RAPTOR_OPTIONS_GET_NUMERIC(serializer, option)); + + context->xml_writer = xml_writer; + } + + return 0; +} + + +static int +raptor_rdfxmla_ensure_writen_header(raptor_serializer* serializer, + raptor_rdfxmla_context* context) +{ + raptor_xml_writer* xml_writer; + raptor_qname *qname; + raptor_uri *base_uri; + int i; + raptor_qname **attrs = NULL; + int attrs_count = 0; + + if(context->written_header) + return 0; /* already succeeded */ + + if(!context->write_rdf_RDF) { + context->written_header = 1; + return 0; + } + + xml_writer = context->xml_writer; + if(context->is_xmp) + raptor_xml_writer_raw(xml_writer, + (const unsigned char*)"\n\n"); + + qname = raptor_new_qname_from_namespace_local_name(serializer->world, + context->rdf_nspace, + (const unsigned char*)"RDF", + NULL); + if(!qname) + goto oom; + base_uri = serializer->base_uri; + if(base_uri) + base_uri = raptor_uri_copy(base_uri); + context->rdf_RDF_element = raptor_new_xml_element(qname, NULL, base_uri); + if(!context->rdf_RDF_element) { + if(base_uri) + raptor_free_uri(base_uri); + raptor_free_qname(qname); + goto oom; + } + + /* NOTE: Starts at item 1 as item 0 is the element's namespace (rdf) + * and does not need to be declared + */ + for(i = 1; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns; + ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + raptor_xml_element_declare_namespace(context->rdf_RDF_element, ns); + } + + if(base_uri && + RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_WRITE_BASE_URI)) { + const unsigned char* base_uri_string; + + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + if(!attrs) + goto oom; + + base_uri_string = raptor_uri_as_string(base_uri); + attrs[attrs_count] = raptor_new_qname_from_namespace_local_name(serializer->world, + context->xml_nspace, + (const unsigned char*)"base", + base_uri_string); + if(!attrs[attrs_count]) { + RAPTOR_FREE(qnamearray, attrs); + goto oom; + } + attrs_count++; + } + + if(attrs_count) + raptor_xml_element_set_attributes(context->rdf_RDF_element, attrs, + attrs_count); + else + raptor_xml_element_set_attributes(context->rdf_RDF_element, NULL, 0); + + + + raptor_xml_writer_start_element(xml_writer, context->rdf_RDF_element); + + context->written_header = 1; + + return 0; + + oom: + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Out of memory"); + return 1; +} + + +/* serialize a statement */ +static int +raptor_rdfxmla_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement) +{ + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + raptor_abbrev_subject* subject = NULL; + raptor_abbrev_node* predicate = NULL; + raptor_abbrev_node* object = NULL; + int rv = 0; + raptor_term_type object_type; + + if(!(statement->subject->type == RAPTOR_TERM_TYPE_URI || + statement->subject->type == RAPTOR_TERM_TYPE_BLANK)) { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot serialize a triple with subject node type %u", + statement->subject->type); + return 1; + } + + subject = raptor_abbrev_subject_lookup(context->nodes, context->subjects, + context->blanks, + statement->subject); + if(!subject) + return 1; + + object_type = statement->object->type; + + if(!(object_type == RAPTOR_TERM_TYPE_URI || + object_type == RAPTOR_TERM_TYPE_BLANK || + object_type == RAPTOR_TERM_TYPE_LITERAL)) { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot serialize a triple with object node type %u", + object_type); + return 1; + } + + object = raptor_abbrev_node_lookup(context->nodes, + statement->object); + if(!object) + return 1; + + + if(statement->predicate->type == RAPTOR_TERM_TYPE_URI) { + predicate = raptor_abbrev_node_lookup(context->nodes, statement->predicate); + if(!predicate) + return 1; + + if(!subject->node_type && + raptor_abbrev_node_equals(predicate, context->rdf_type) && + statement->object->type == RAPTOR_TERM_TYPE_URI) { + + /* Store the first one as the type for abbreviation 2.14 + * purposes. Note that it is perfectly legal to have + * multiple type definitions. All definitions after the + * first go in the property list */ + subject->node_type = raptor_abbrev_node_lookup(context->nodes, + statement->object); + if(!subject->node_type) + return 1; + subject->node_type->ref_count++; + return 0; + + } else { + int add_property = 1; + + if(context->is_xmp && predicate->ref_count > 1) { + raptor_avltree_iterator* iter = NULL; + for((iter = raptor_new_avltree_iterator(subject->properties, NULL, NULL, 1)); + iter && !rv; + (rv = raptor_avltree_iterator_next(iter))) { + raptor_abbrev_node** nodes; + raptor_abbrev_node* node; + + nodes = (raptor_abbrev_node**)raptor_avltree_iterator_get(iter); + if(!nodes) + break; + node= nodes[0]; + + if(node == predicate) { + add_property = 0; + if(object->term->type == RAPTOR_TERM_TYPE_BLANK) { + /* look for any generated blank node associated with this + * statement and free it + */ + raptor_abbrev_subject *blank = + raptor_abbrev_subject_find(context->blanks, + statement->object); + if(subject) raptor_avltree_delete(context->blanks, blank); + } + break; + } + } + if(iter) + raptor_free_avltree_iterator(iter); + } + + if(add_property) { + rv = raptor_abbrev_subject_add_property(subject, predicate, object); + if(rv < 0) { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Unable to add properties to subject %p", + RAPTOR_VOIDP(subject)); + return rv; + } + } + } + + } else { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot serialize a triple with predicate node type %u", + statement->predicate->type); + return 1; + } + + if(object_type == RAPTOR_TERM_TYPE_URI || + object_type == RAPTOR_TERM_TYPE_BLANK) + object->count_as_object++; + + + return 0; + +} + + +/* end a serialize */ +static int +raptor_rdfxmla_serialize_end(raptor_serializer* serializer) +{ + + raptor_rdfxmla_context* context = (raptor_rdfxmla_context*)serializer->context; + raptor_xml_writer* xml_writer = context->xml_writer; + + if(xml_writer) { + if(!raptor_rdfxmla_ensure_writen_header(serializer, context)) { + + raptor_rdfxmla_emit(serializer); + + if(context->write_rdf_RDF) { + /* ensure_writen_header() returned success, can assume context->rdf_RDF_element is non-NULL */ + raptor_xml_writer_end_element(xml_writer, context->rdf_RDF_element); + + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)"\n", 1); + } + } + } + + if(context->rdf_RDF_element) { + raptor_free_xml_element(context->rdf_RDF_element); + context->rdf_RDF_element = NULL; + } + + if(context->is_xmp && xml_writer) + raptor_xml_writer_raw(xml_writer, + (const unsigned char*)"\n\n"); + + if(xml_writer) + raptor_xml_writer_flush(xml_writer); + + if(context->single_node) + raptor_free_uri(context->single_node); + + context->written_header = 0; + + return 0; +} + + +/* finish the serializer factory */ +static void +raptor_rdfxmla_serialize_finish_factory(raptor_serializer_factory* factory) +{ + /* NOP */ +} + + +static const char* const rdfxml_xmp_names[2] = { "rdfxml-xmp", NULL}; + +static const char* const rdfxml_xmp_uri_strings[2] = { + "http://www.w3.org/TR/rdf-syntax-grammar", + NULL +}; + +#define RDFXML_XMP_TYPES_COUNT 1 +static const raptor_type_q rdfxml_xmp_types[RDFXML_XMP_TYPES_COUNT + 1] = { + { "application/rdf+xml", 19, 0}, + { NULL, 0, 0} +}; + +static int +raptor_rdfxml_xmp_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = rdfxml_xmp_names; + factory->desc.mime_types = rdfxml_xmp_types; + + factory->desc.label = "RDF/XML (XMP Profile)"; + factory->desc.uri_strings = rdfxml_xmp_uri_strings; + + factory->context_length = sizeof(raptor_rdfxmla_context); + + factory->init = raptor_rdfxmla_serialize_init; + factory->terminate = raptor_rdfxmla_serialize_terminate; + factory->declare_namespace = raptor_rdfxmla_serialize_declare_namespace; + factory->declare_namespace_from_namespace = raptor_rdfxmla_serialize_declare_namespace_from_namespace; + factory->serialize_start = raptor_rdfxmla_serialize_start; + factory->serialize_statement = raptor_rdfxmla_serialize_statement; + factory->serialize_end = raptor_rdfxmla_serialize_end; + factory->finish_factory = raptor_rdfxmla_serialize_finish_factory; + + return 0; +} + + +static const char* const rdfxmla_names[2] = { "rdfxml-abbrev", NULL}; + +static const char* const rdfxml_uri_strings[3] = { + "http://www.w3.org/ns/formats/RDF_XML", + "http://www.w3.org/TR/rdf-syntax-grammar", + NULL +}; + +#define RDFXMLA_TYPES_COUNT 1 +static const raptor_type_q rdfxmla_types[RDFXMLA_TYPES_COUNT + 1] = { + { "application/rdf+xml", 19, 0}, + { NULL, 0, 0} +}; + +static int +raptor_rdfxmla_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = rdfxmla_names; + factory->desc.mime_types = rdfxmla_types; + + factory->desc.label = "RDF/XML (Abbreviated)"; + factory->desc.uri_strings = rdfxml_uri_strings; + + factory->context_length = sizeof(raptor_rdfxmla_context); + + factory->init = raptor_rdfxmla_serialize_init; + factory->terminate = raptor_rdfxmla_serialize_terminate; + factory->declare_namespace = raptor_rdfxmla_serialize_declare_namespace; + factory->declare_namespace_from_namespace = raptor_rdfxmla_serialize_declare_namespace_from_namespace; + factory->serialize_start = raptor_rdfxmla_serialize_start; + factory->serialize_statement = raptor_rdfxmla_serialize_statement; + factory->serialize_end = raptor_rdfxmla_serialize_end; + factory->finish_factory = raptor_rdfxmla_serialize_finish_factory; + + return 0; +} + + +int +raptor_init_serializer_rdfxmla(raptor_world* world) +{ + int rc; + + rc = !raptor_serializer_register_factory(world, + &raptor_rdfxml_xmp_serializer_register_factory); + if(rc) + return rc; + + rc = !raptor_serializer_register_factory(world, + &raptor_rdfxmla_serializer_register_factory); + + return rc; +} + diff --git a/src/raptor_serialize_rss.c b/src/raptor_serialize_rss.c new file mode 100644 index 0000000..90f1f23 --- /dev/null +++ b/src/raptor_serialize_rss.c @@ -0,0 +1,2425 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize_rss.c - Raptor RSS 1.0 and Atom 1.0 serializers + * + * Copyright (C) 2003-2015, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" +#include "raptor_rss.h" + + +typedef struct { + raptor_world* world; + raptor_term* term; + /* shared pointer */ + raptor_rss_item* item; +} raptor_rss_group_map; + + + +/* + * Raptor 'RSS 1.0' serializer object + */ +typedef struct { + raptor_world* world; + + /* static rss model */ + raptor_rss_model model; + + /* Triples with no assigned type node */ + raptor_sequence *triples; + + /* Sequence of raptor_rss_item* : rdf:Seq items rdf:_ < n> at offset n */ + raptor_sequence *items; + + /* Sequence of raptor_rss_item* (?x rdf:type rss:Enclosure) */ + raptor_sequence *enclosures; + + /* Term of rdf:Seq node */ + raptor_term *seq_term; + + /* Namespace stack for serializing */ + raptor_namespace_stack *nstack; + + /* the default namespace (rdf: or atom:) - + * this is destroyed when nstack above is deleted + */ + raptor_namespace* default_nspace; + + /* rdf namespace in @nspaces array */ + raptor_namespace* rdf_nspace; + + /* the xml: namespace */ + raptor_namespace *xml_nspace; + + /* the root element (rdf:RDF or atom:feed) */ + raptor_xml_element* root_element; + + /* where the xml is being written */ + raptor_xml_writer *xml_writer; + + /* non-0 if this is an atom 1.0 serializer */ + int is_atom; + + /* 0 = none + * 1 = existing rss:item item containg rdf/xml encoding of any extra + * triples about URI (rss-1.0 serializer only) + * 2 = at:md element containing rdf/xml property elements encoding + * of any extra triples about URI (atom serializer only) + */ + int rss_triples_mode; + + /* namespaces declared here */ + raptor_namespace* nspaces[RAPTOR_RSS_NAMESPACES_SIZE]; + + /* Map of group URI (key, owned) : rss item object (value, shared) */ + raptor_avltree *group_map; + + /* User declared namespaces */ + raptor_sequence *user_namespaces; + + /* URI of XML Literal datatype */ + raptor_uri* xml_literal_dt; + + int free_default_nspace; +} raptor_rss10_serializer_context; + + +static void +raptor_free_group_map(raptor_rss_group_map* gm) +{ + if(gm->term) + raptor_free_term(gm->term); + + RAPTOR_FREE(raptor_rss_group_map, gm); +} + + +static int +raptor_rss_group_map_compare(raptor_rss_group_map* gm1, + raptor_rss_group_map* gm2) +{ + return raptor_term_compare(gm1->term, gm2->term); +} + + +static raptor_rss_item* +raptor_rss10_get_group_item(raptor_rss10_serializer_context *rss_serializer, + raptor_term* term) +{ + raptor_rss_group_map search_gm; + raptor_rss_group_map* gm; + + search_gm.world = rss_serializer->world; + search_gm.term = term; + gm = (raptor_rss_group_map*)raptor_avltree_search(rss_serializer->group_map, + (void*)&search_gm); + + return gm ? gm->item : NULL; +} + + +static int +raptor_rss10_set_item_group(raptor_rss10_serializer_context *rss_serializer, + raptor_term* term, raptor_rss_item *item) +{ + raptor_rss_group_map* gm; + + if(raptor_rss10_get_group_item(rss_serializer, term)) + return 0; + + gm = RAPTOR_CALLOC(raptor_rss_group_map*, 1, sizeof(*gm)); + gm->world = rss_serializer->world; + gm->term = raptor_term_copy(term); + gm->item = item; + + raptor_avltree_add(rss_serializer->group_map, gm); + return 0; +} + + +/** + * raptor_rss10_serialize_init: + * @serializer: serializer object + * @name: serializer name + * + * INTERNAL (raptor_serializer_factory API) - create a new serializer + * + * Return value: non-0 on failure + */ +static int +raptor_rss10_serialize_init(raptor_serializer* serializer, const char *name) +{ + raptor_rss10_serializer_context *rss_serializer; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + rss_serializer->world = serializer->world; + + raptor_rss_common_init(serializer->world); + raptor_rss_model_init(serializer->world, &rss_serializer->model); + + rss_serializer->triples = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, (raptor_data_print_handler)raptor_statement_print); + + rss_serializer->items = raptor_new_sequence((raptor_data_free_handler)raptor_free_rss_item, (raptor_data_print_handler)NULL); + + rss_serializer->enclosures = raptor_new_sequence((raptor_data_free_handler)raptor_free_rss_item, (raptor_data_print_handler)NULL); + + rss_serializer->group_map = raptor_new_avltree((raptor_data_compare_handler)raptor_rss_group_map_compare, + (raptor_data_free_handler)raptor_free_group_map, 0); + + rss_serializer->user_namespaces = raptor_new_sequence((raptor_data_free_handler)raptor_free_namespace, NULL); + + rss_serializer->is_atom = !(strcmp(name,"atom")); + + rss_serializer->nstack = raptor_new_namespaces(serializer->world, 1); + + rss_serializer->xml_literal_dt = raptor_new_uri(serializer->world, + raptor_xml_literal_datatype_uri_string); + + return 0; +} + + +/** + * raptor_rss10_serialize_terminate: + * @serializer: serializer object + * + * INTERNAL (raptor_serializer_factory API) - destroy a serializer + */ +static void +raptor_rss10_serialize_terminate(raptor_serializer* serializer) +{ + raptor_world* world = serializer->world; + raptor_rss10_serializer_context *rss_serializer; + int i; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + + raptor_rss_model_clear(&rss_serializer->model); + raptor_rss_common_terminate(world); + + if(rss_serializer->triples) + raptor_free_sequence(rss_serializer->triples); + + if(rss_serializer->items) + raptor_free_sequence(rss_serializer->items); + + if(rss_serializer->enclosures) + raptor_free_sequence(rss_serializer->enclosures); + + if(rss_serializer->seq_term) + raptor_free_term(rss_serializer->seq_term); + + if(rss_serializer->xml_writer) + raptor_free_xml_writer(rss_serializer->xml_writer); + + for(i = 0; i < RAPTOR_RSS_NAMESPACES_SIZE; i++) { + if(rss_serializer->nspaces[i]) + raptor_free_namespace(rss_serializer->nspaces[i]); + } + + if(rss_serializer->free_default_nspace && rss_serializer->default_nspace) + raptor_free_namespace(rss_serializer->default_nspace); + + if(rss_serializer->xml_nspace) + raptor_free_namespace(rss_serializer->xml_nspace); + + if(rss_serializer->user_namespaces) + raptor_free_sequence(rss_serializer->user_namespaces); + + /* all raptor_namespace* objects must be freed BEFORE the stack + * they are attached to here: */ + if(rss_serializer->nstack) + raptor_free_namespaces(rss_serializer->nstack); + + if(rss_serializer->group_map) + raptor_free_avltree(rss_serializer->group_map); + + if(world->rss_fields_info_qnames) { + for(i = 0; i < RAPTOR_RSS_FIELDS_SIZE; i++) { + if(world->rss_fields_info_qnames[i]) + raptor_free_qname(world->rss_fields_info_qnames[i]); + } + RAPTOR_FREE(raptor_qname* array, world->rss_fields_info_qnames); + world->rss_fields_info_qnames = NULL; + } + + if(world->rss_types_info_qnames) { + for(i = 0; i < RAPTOR_RSS_COMMON_SIZE; i++) { + if(world->rss_types_info_qnames[i]) + raptor_free_qname(world->rss_types_info_qnames[i]); + } + RAPTOR_FREE(raptor_wname* array, world->rss_types_info_qnames); + world->rss_types_info_qnames = NULL; + } + + if(rss_serializer->xml_literal_dt) + raptor_free_uri(rss_serializer->xml_literal_dt); +} + + +/** + * raptor_rss10_move_statements: + * @rss_serializer: serializer object + * @type: item type + * @item: item object + * + * INTERNAL - Move statements from the stored triples into item @item + * that match @item's URI as subject. + * + * Return value: count of number of triples moved + */ +static int +raptor_rss10_move_statements(raptor_rss10_serializer_context *rss_serializer, + raptor_rss_type type, + raptor_rss_item *item) +{ + int t; + int count = 0; + int is_atom = rss_serializer->is_atom; + int size = raptor_sequence_size(rss_serializer->triples); + + for(t = 0; t < size; t++) { + raptor_statement* s; + int f; + + s = (raptor_statement*)raptor_sequence_get_at(rss_serializer->triples, t); + if(!s) + continue; + + if(s->subject->type != RAPTOR_TERM_TYPE_URI || + !raptor_uri_equals(s->subject->value.uri, item->uri)) + continue; + + /* now we know this triple is associated with the item URI + * and can count the relevant triples */ + count++; + + /* add triples with anonymous object to the general triples sequence + * for this item, and to the group map (blank node closure) + */ + if(s->object->type == RAPTOR_TERM_TYPE_BLANK) { + raptor_rss10_set_item_group(rss_serializer, s->object, item); + + RAPTOR_DEBUG4("Moved anonymous value property URI <%s> for typed node %u - %s\n", + raptor_uri_as_string(s->predicate->value.uri), + type, raptor_rss_items_info[type].name); + s = (raptor_statement*)raptor_sequence_delete_at(rss_serializer->triples, + t); + raptor_sequence_push(item->triples, s); + continue; + } + + + /* otherwise process object value types resource or literal */ + for(f = 0; f < RAPTOR_RSS_FIELDS_SIZE; f++) { + if(!rss_serializer->world->rss_fields_info_uris[f]) + continue; + + if(s->predicate->type == RAPTOR_TERM_TYPE_URI && + s->object->type != RAPTOR_TERM_TYPE_BLANK && + raptor_uri_equals(s->predicate->value.uri, + rss_serializer->world->rss_fields_info_uris[f])) { + raptor_rss_field* field = raptor_rss_new_field(rss_serializer->world); + + /* found field this triple to go in 'item' so move the + * object value over + */ + if(s->object->type == RAPTOR_TERM_TYPE_URI) { + field->uri = s->object->value.uri; + s->object->value.uri = NULL; + } else { + field->value = s->object->value.literal.string; + if(s->object->value.literal.datatype && + raptor_uri_equals(s->object->value.literal.datatype, + rss_serializer->xml_literal_dt)) + field->is_xml = 1; + + if(f == RAPTOR_RSS_FIELD_CONTENT_ENCODED) + field->is_xml = 1; + + if(f == RAPTOR_RSS_FIELD_ATOM_SUMMARY && *field->value == '<') + field->is_xml = 1; + + s->object->value.literal.string = NULL; + } + + if(is_atom) { + int i; + + /* Rewrite item fields rss->atom */ + for(i = 0; + raptor_atom_to_rss[i].from != RAPTOR_RSS_FIELD_UNKNOWN; + i++) { + int from_f = raptor_atom_to_rss[i].to; + int to_f = raptor_atom_to_rss[i].from; + + /* Do not rewrite to atom0.3 terms */ + if(raptor_rss_fields_info[to_f].nspace == ATOM0_3_NS) + continue; + + if(f == from_f && + !(item->fields[to_f] && item->fields[to_f]->value)) { + f = to_f; + if(to_f == RAPTOR_RSS_FIELD_ATOM_SUMMARY && *field->value == '<') + field->is_xml = 1; + field->is_mapped = 1; + RAPTOR_DEBUG5("Moved field %d - %s to field %d - %s\n", + from_f, raptor_rss_fields_info[from_f].name, + to_f, raptor_rss_fields_info[to_f].name); + break; + } + } + } /* end is atom field to map */ + + RAPTOR_DEBUG1("Adding field\n"); + raptor_rss_item_add_field(item, f, field); + raptor_sequence_set_at(rss_serializer->triples, t, NULL); + break; + } + } /* end for field loop */ + + /* loop ended early so triple was assocated with a field - continue */ + if(f < RAPTOR_RSS_FIELDS_SIZE) + continue; + + + /* otherwise triple was not found as a field so store in triples + * sequence + */ + RAPTOR_DEBUG4("UNKNOWN property URI <%s> for typed node %u - %s\n", + raptor_uri_as_string(s->predicate->value.uri), + type, raptor_rss_items_info[type].name); + s = (raptor_statement*)raptor_sequence_delete_at(rss_serializer->triples, + t); + raptor_sequence_push(item->triples, s); + + } /* end for all triples */ + +#ifdef RAPTOR_DEBUG + if(count > 0) + RAPTOR_DEBUG5("Moved %d triples to typed node %u - %s with uri <%s>\n", + count, type, raptor_rss_items_info[type].name, + raptor_uri_as_string(item->uri)); +#endif + + return count; +} + + +/** + * raptor_rss10_move_anonymous_statements: + * @rss_serializer: serializer object + * + * INTERNAL - Move statements with a blank node subject to the appropriate item + * + */ +static int +raptor_rss10_move_anonymous_statements(raptor_rss10_serializer_context *rss_serializer) +{ + int t; + int handled = 1; + int round = 0; +#ifdef RAPTOR_DEBUG + int moved_count = 0; +#endif + + for(round = 0; handled; round++) { + int size = raptor_sequence_size(rss_serializer->triples); + + handled = 0; + for(t = 0; t < size; t++) { + raptor_statement* s; + raptor_rss_item* item; + + s = (raptor_statement*)raptor_sequence_get_at(rss_serializer->triples, t); + if(!s) + continue; + + if(s->subject->type != RAPTOR_TERM_TYPE_BLANK) + continue; + + item = raptor_rss10_get_group_item(rss_serializer, s->subject); + + if(item) { + /* triple matched an existing item */ + s = (raptor_statement*)raptor_sequence_delete_at(rss_serializer->triples, + t); + raptor_sequence_push(item->triples, s); +#ifdef RAPTOR_DEBUG + moved_count++; +#endif + + if(s->object->type == RAPTOR_TERM_TYPE_BLANK) + raptor_rss10_set_item_group(rss_serializer, s->object, item); + + + handled = 1; + } + } /* end for all triples */ + +#ifdef RAPTOR_DEBUG + if(moved_count > 0) + RAPTOR_DEBUG3("Round %d: Moved %d triples\n", round, moved_count); +#endif + } + + return 0; +} + + +/** + * raptor_rss10_move_leftover_statements: + * @rss_serializer: serializer object + * + * INTERNAL - Move any statements in the serializer pool to items or channel + * + */ +static int +raptor_rss10_move_leftover_statements(raptor_rss10_serializer_context *rss_serializer) +{ + raptor_rss_model* rss_model; + int i; + int type; + raptor_rss_item* item; + int size; + + rss_model = &rss_serializer->model; + + type = RAPTOR_RSS_ITEM; + size = raptor_sequence_size(rss_serializer->items); + for(i = 0; i < size; i++) { + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->items, i); + raptor_rss10_move_statements(rss_serializer, (raptor_rss_type)type, item); + } + + type = RAPTOR_RSS_CHANNEL; + if(rss_model->common[type]) { + item = rss_model->common[type]; + raptor_rss10_move_statements(rss_serializer, (raptor_rss_type)type, item); + } + + return 0; +} + + +/** + * raptor_rss10_remove_mapped_item_fields: + * @rss_serializer: serializer object + * @item: rss item + * @type: item type + * + * INTERNAL - Remove mapped fields for an item + * + */ +static int +raptor_rss10_remove_mapped_item_fields(raptor_rss10_serializer_context *rss_serializer, + raptor_rss_item* item, int type) +{ + int f; + + if(!item->fields_count) + return 0; + + for(f = 0; f < RAPTOR_RSS_FIELDS_SIZE; f++) { + raptor_rss_field* field; + int saw_mapped = 0; + int saw_non_mapped = 0; + + for(field = item->fields[f]; field; field = field->next) { + if(field->is_mapped) + saw_mapped++; + else + saw_non_mapped++; + } + + if(saw_mapped && saw_non_mapped) { + raptor_rss_field* last_field = NULL; + RAPTOR_DEBUG6("Item %p Field %d - %s: %d mapped %d non-mapped\n", + RAPTOR_VOIDP(item), + f, raptor_rss_fields_info[f].name, + saw_mapped, saw_non_mapped); + + field = item->fields[f]; + while(field) { + raptor_rss_field* next = field->next; + field->next = NULL; + if(field->is_mapped) + raptor_rss_field_free(field); + else { + if(!last_field) + item->fields[f] = field; + else + last_field->next = field; + last_field = field; + } + field = next; + } + } + + } + + return 0; +} + + +/** + * raptor_rss10_remove_mapped_fields: + * @rss_serializer: serializer object + * + * INTERNAL - Move statements with a blank node subject to the appropriate item + * + */ +static int +raptor_rss10_remove_mapped_fields(raptor_rss10_serializer_context *rss_serializer) +{ + raptor_rss_model* rss_model; + int is_atom; + int i; + + rss_model = &rss_serializer->model; + is_atom = rss_serializer->is_atom; + + if(!is_atom) + return 0; + + if(rss_model->items_count) { + int size = raptor_sequence_size(rss_serializer->items); + for(i = 0; i < size; i++) { + raptor_rss_item* item; + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->items, i); + raptor_rss10_remove_mapped_item_fields(rss_serializer, item, + RAPTOR_RSS_ITEM); + } + } + + for(i = RAPTOR_RSS_CHANNEL; i < RAPTOR_RSS_COMMON_SIZE; i++) { + raptor_rss_item* item; + for(item = rss_model->common[i]; item; item = item->next) { + raptor_rss10_remove_mapped_item_fields(rss_serializer, item, i); + } + } + + return 0; +} + + +/** + * raptor_rss10_store_statement: + * @rss_serializer: serializer object + * @s: statement (shared - do not become owner of this) + * + * INTERNAL - decide where to store a statement in an item or keep pending + * + * Return value: non-0 if handled (stored) + */ +static int +raptor_rss10_store_statement(raptor_rss10_serializer_context *rss_serializer, + raptor_statement *s) +{ + raptor_rss_item *item = NULL; + int handled = 0; + int is_atom = rss_serializer->is_atom; + + item = raptor_rss10_get_group_item(rss_serializer, s->subject); + + if(item && + s->predicate->type == RAPTOR_TERM_TYPE_URI && + (s->object->type == RAPTOR_TERM_TYPE_URI || + s->object->type == RAPTOR_TERM_TYPE_LITERAL)) { + int f; + raptor_uri* predicate_uri = s->predicate->value.uri; + + /* scan triples (? ) */ + + for(f = 0; f < RAPTOR_RSS_FIELDS_SIZE; f++) { + raptor_rss_field* field; + if(!rss_serializer->world->rss_fields_info_uris[f]) + continue; + + if(raptor_uri_equals(predicate_uri, + rss_serializer->world->rss_fields_info_uris[f])) { + /* found field this triple to go in 'item' so move the + * object value over + */ + field = raptor_rss_new_field(rss_serializer->world); + + if(s->object->type == RAPTOR_TERM_TYPE_URI) { + field->uri = s->object->value.uri; + s->object->value.uri = NULL; + } else { + /* must be literal - checked above */ + field->value = s->object->value.literal.string; + + if(s->object->value.literal.datatype && + raptor_uri_equals(s->object->value.literal.datatype, + rss_serializer->xml_literal_dt)) + field->is_xml = 1; + + if(f == RAPTOR_RSS_FIELD_CONTENT_ENCODED) + field->is_xml = 1; + + if(f == RAPTOR_RSS_FIELD_ATOM_SUMMARY && *field->value == '<') + field->is_xml = 1; + s->object->value.literal.string = NULL; + } + + if(is_atom) { + int i; + + /* Rewrite item fields rss->atom */ + for(i = 0; + raptor_atom_to_rss[i].from != RAPTOR_RSS_FIELD_UNKNOWN; i++) { + int from_f = raptor_atom_to_rss[i].to; + int to_f = raptor_atom_to_rss[i].from; + + /* Do not rewrite to atom0.3 terms */ + if(raptor_rss_fields_info[to_f].nspace == ATOM0_3_NS) + continue; + + if(f == from_f && + !(item->fields[to_f] && item->fields[to_f]->value)) { + f = to_f; + + if(to_f == RAPTOR_RSS_FIELD_ATOM_SUMMARY && *field->value == '<') + field->is_xml = 1; + + field->is_mapped = 1; + RAPTOR_DEBUG5("Moved field %d - %s to field %d - %s\n", + from_f, raptor_rss_fields_info[from_f].name, + to_f, raptor_rss_fields_info[to_f].name); + break; + } + } + } + + RAPTOR_DEBUG1("Adding field\n"); + raptor_rss_item_add_field(item, f, field); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Stored statement under typed node %p\n", + RAPTOR_VOIDP(item)); +#endif + + handled = 1; + break; + } + } + } + + if(!handled) { + raptor_statement *t; + + /* Need to handle this later so copy it */ + t = raptor_statement_copy(s); + if(t) { + raptor_sequence_push(rss_serializer->triples, t); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr,"Stored statement: "); + raptor_statement_print_as_ntriples(s, stderr); + fprintf(stderr,"\n"); +#endif + handled = 1; + } + } + + return handled; +} + + +static int +raptor_rss10_serialize_start(raptor_serializer* serializer) +{ + raptor_rss10_serializer_context *rss_serializer; + const char* rss_triples; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + + rss_triples = (const char*)RAPTOR_OPTIONS_GET_STRING(serializer, + RAPTOR_OPTION_RSS_TRIPLES); + if(rss_triples) { + if(!strcmp(rss_triples, "none")) + rss_serializer->rss_triples_mode = 0; + else if(!strcmp(rss_triples, "rdf-xml")) + rss_serializer->rss_triples_mode = 1; + else if(!strcmp(rss_triples, "atom-triples")) + rss_serializer->rss_triples_mode = 2; + else + rss_serializer->rss_triples_mode = 0; + } + + return 0; +} + + +/** + * raptor_rss10_serialize_statement: + * @serializer: serializer object + * @statement: statement (shared - am not owner of this) + * + * INTERNAL (raptor_serializer_factory API) - Serialize a statement + * + * Return value: non-0 on failure + */ +static int +raptor_rss10_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement) +{ + raptor_rss10_serializer_context *rss_serializer; + raptor_rss_model *rss_model; + int handled = 0; + int i; + raptor_rss_type type; + raptor_rss_item *item = NULL; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + rss_model = &rss_serializer->model; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + if(1) { + RAPTOR_DEBUG1("Processing statement\n "); + raptor_statement_print_as_ntriples(statement, stderr); + fputc('\n', stderr); + } +#endif + + if(raptor_uri_equals(statement->predicate->value.uri, + RAPTOR_RSS_RSS_items_URI(rss_model))) { + /* ignore any triple (? rss:items ?) - is infered */ + return 0; + } + + if(!raptor_uri_equals(statement->predicate->value.uri, + RAPTOR_RDF_type_URI(serializer->world))) + goto savetriple; + + + type = RAPTOR_RSS_NONE; + + if(statement->object->type == RAPTOR_TERM_TYPE_URI) { + raptor_uri* object_uri = statement->object->value.uri; + + /* look for triple: (? rdf:type ?class-uri) to find containers and blocks */ + + /* Look for triple (? rdf:type rdf:Seq) */ + if(raptor_uri_equals(object_uri, RAPTOR_RDF_Seq_URI(serializer->world))) { + + rss_serializer->seq_term = raptor_term_copy(statement->subject); + + handled = 1; + goto savetriple; + } + + /* look for triple: (? rdf:type ?class-uri) to find containers and blocks */ + for(i = 0; i < RAPTOR_RSS_COMMON_SIZE; i++) { + raptor_uri *item_uri = serializer->world->rss_types_info_uris[i]; + + if(item_uri && raptor_uri_equals(object_uri, item_uri)) { + type = (raptor_rss_type)i; + +#ifdef RAPTOR_DEBUG + if(1) { + unsigned char* ts; + ts = raptor_term_to_string(statement->subject); + RAPTOR_DEBUG4("Found typed node %u - %s with term %s\n", type, + raptor_rss_items_info[type].name, ts); + RAPTOR_FREE(char*, ts); + } +#endif + break; + } + } + } + + if(type == RAPTOR_RSS_NONE) { +#ifdef RAPTOR_DEBUG + if(1) { + unsigned char* ts; + ts = raptor_term_to_string(statement->object); + RAPTOR_DEBUG2("UNKNOWN typed node with type term %s\n", ts); + RAPTOR_FREE(char*, ts); + } +#endif + goto savetriple; + } + + + if(type == RAPTOR_RSS_ITEM) { + int size = raptor_sequence_size(rss_serializer->items); + for(i = 0; i < size; i++) { + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->items, i); + + if(raptor_rss_item_equals_statement_subject(item, statement)) + break; + + } + if(i < size) { + RAPTOR_DEBUG2("Found RSS item at entry %d in sequence of items\n", i); + } else { +#ifdef RAPTOR_DEBUG + if(1) { + unsigned char* ts; + ts = raptor_term_to_string(statement->subject); + + RAPTOR_DEBUG2("RSS item term %s is not in sequence of items\n", ts); + RAPTOR_FREE(char*, ts); + } +#endif + item = NULL; + } + } else if(type == RAPTOR_RSS_ENCLOSURE) { + int size = raptor_sequence_size(rss_serializer->enclosures); + for(i = 0; i < size; i++) { + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->enclosures, i); + + if(raptor_rss_item_equals_statement_subject(item, statement)) + break; + } + if(i < size) { + RAPTOR_DEBUG2("Found enclosure at entry %d in sequence of enclosures\n", i); + } else { +#ifdef RAPTOR_DEBUG + if(1) { + unsigned char* ts; + ts = raptor_term_to_string(statement->subject); + RAPTOR_DEBUG2("Add new enclosure to sequence with term %s\n", ts); + RAPTOR_FREE(char*, ts); + } +#endif + + item = raptor_new_rss_item(rss_serializer->world); + raptor_sequence_push(rss_serializer->enclosures, item); + } + } else { + item = raptor_rss_model_add_common(rss_model, type); + } + + + if(item && statement->subject->type == RAPTOR_TERM_TYPE_URI) { + raptor_rss_item_set_uri(item, statement->subject->value.uri); + + /* Move any existing statements to the newly discovered item */ + raptor_rss10_move_statements(rss_serializer, type, item); + + raptor_rss10_set_item_group(rss_serializer, item->term, item); + + handled = 1; + } + + + savetriple: + if(!handled) { + handled = raptor_rss10_store_statement(rss_serializer, statement); + + /* failed to store */ + if(!handled) + return 1; + } + + return 0; +} + + +static void +raptor_rss10_build_items(raptor_rss10_serializer_context *rss_serializer) +{ + raptor_rss_model* rss_model = &rss_serializer->model; + int i; + int size; + + if(!rss_serializer->seq_term) + return; + + size = raptor_sequence_size(rss_serializer->triples); + for(i = 0; i < size; i++) { + int ordinal = -1; + raptor_statement* s; + + s = (raptor_statement*)raptor_sequence_get_at(rss_serializer->triples, i); + if(!s) + continue; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG1("Processing statement\n "); + raptor_statement_print_as_ntriples(s, stderr); + fputc('\n', stderr); +#endif + + /* skip triples that are not ? ? */ + if(s->object->type != RAPTOR_TERM_TYPE_URI) { + RAPTOR_DEBUG1("Not ? ? - continuing\n"); + continue; + } + + + if(raptor_term_equals(s->subject, rss_serializer->seq_term)) { + const unsigned char* uri_str; + /* found triple */ + + /* predicate is a resource */ + uri_str = raptor_uri_as_string(s->predicate->value.uri); + + if(!strncmp((const char*)uri_str, + "http://www.w3.org/1999/02/22-rdf-syntax-ns#_", 44)) + ordinal= raptor_check_ordinal(uri_str + 44); + +#ifdef RAPTOR_DEBUG + if(1) { + unsigned char* ts; + ts = raptor_term_to_string(s->object); + RAPTOR_DEBUG3("Found RSS 1.0 item %d with term %s\n", ordinal, ts); + RAPTOR_FREE(char*, ts); + } +#endif + + if(ordinal >= 0) { + raptor_rss_item *item; + + item = raptor_new_rss_item(rss_serializer->world); + + raptor_rss_item_set_uri(item, s->object->value.uri); + + raptor_sequence_set_at(rss_serializer->items, ordinal - 1, item); + + raptor_sequence_set_at(rss_serializer->triples, i, NULL); + + /* Move any existing statements to the newly discovered item */ + raptor_rss10_move_statements(rss_serializer, RAPTOR_RSS_ITEM, item); + + raptor_rss10_set_item_group(rss_serializer, item->term, item); + } + } + } + + rss_model->items_count = raptor_sequence_size(rss_serializer->items); +} + + +static void +raptor_rss10_build_xml_names(raptor_serializer *serializer, int is_entry) +{ + raptor_world* world = serializer->world; + raptor_rss10_serializer_context *rss_serializer; + raptor_rss_model* rss_model; + raptor_uri *base_uri = serializer->base_uri; + raptor_xml_element *element; + raptor_qname *qname; + int root_ns_id; + const unsigned char *root_local_name; + int i; + int is_atom; + const raptor_rss_item_info *item_node_type; + int item_node_typei; + int default_ns_id; + int size; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + rss_model = &rss_serializer->model; + is_atom = rss_serializer->is_atom; + + if(is_atom) { + default_ns_id = ATOM1_0_NS; + root_ns_id = ATOM1_0_NS; + root_local_name = (is_entry ? (const unsigned char*)"entry" : + (const unsigned char*)"feed"); + item_node_typei = RAPTOR_ATOM_ENTRY; + } else { + default_ns_id = RSS1_0_NS; + root_ns_id = RDF_NS; + root_local_name = (const unsigned char*)"RDF"; + item_node_typei = RAPTOR_RSS_ITEM; + } + item_node_type = &raptor_rss_items_info[item_node_typei]; + + rss_serializer->xml_nspace = raptor_new_namespace(rss_serializer->nstack, + (const unsigned char*)"xml", + (const unsigned char*)raptor_xml_namespace_uri, + 0); + + + /* Now we have a namespace stack, declare the namespaces */ + for(i = 0; i < RAPTOR_RSS_NAMESPACES_SIZE; i++) { + raptor_uri* uri = serializer->world->rss_namespaces_info_uris[i]; + const unsigned char *prefix; + + prefix = (const unsigned char*)raptor_rss_namespaces_info[i].prefix; + if(!prefix) + continue; + + if(i == default_ns_id) { + if(!RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_PREFIX_ELEMENTS)) + prefix = NULL; + } + + if(uri) { + raptor_namespace* nspace; + nspace = raptor_new_namespace_from_uri(rss_serializer->nstack, prefix, + uri, 0); + rss_serializer->nspaces[i] = nspace; + + if(i == default_ns_id) { + rss_serializer->default_nspace = nspace; + rss_serializer->free_default_nspace = 0; + } + } + + if(i == RDF_NS) + rss_serializer->rdf_nspace = rss_serializer->nspaces[i]; + } + + + qname = raptor_new_qname_from_namespace_local_name(serializer->world, + rss_serializer->nspaces[root_ns_id], + root_local_name, + NULL); + if(base_uri) + base_uri = raptor_uri_copy(base_uri); + + element = raptor_new_xml_element(qname, NULL, base_uri); + rss_serializer->root_element = element; + + + /* Declare the namespaces on the root element */ + raptor_xml_element_declare_namespace(element, rss_serializer->default_nspace); + + for(i = 0; i < RAPTOR_RSS_NAMESPACES_SIZE; i++) { + const unsigned char *prefix; + + prefix = (const unsigned char*)raptor_rss_namespaces_info[i].prefix; + if(!prefix && i != default_ns_id) + continue; + + if(rss_serializer->nspaces[i]) + raptor_xml_element_declare_namespace(element, rss_serializer->nspaces[i]); + } + + size = raptor_sequence_size(rss_serializer->user_namespaces); + for(i = 0; i < size; i++) { + raptor_namespace* nspace; + nspace = (raptor_namespace*)raptor_sequence_get_at(rss_serializer->user_namespaces, i); + + /* Ignore user setting default namespace prefix */ + if(!nspace->prefix) + continue; + + raptor_xml_element_declare_namespace(element, nspace); + } + + + world->rss_fields_info_qnames = RAPTOR_CALLOC(raptor_qname**, + RAPTOR_RSS_FIELDS_SIZE, + sizeof(raptor_qname*)); + if(!world->rss_fields_info_qnames) + return; + + for(i = 0; i < RAPTOR_RSS_FIELDS_SIZE; i++) { + int n = raptor_rss_fields_info[i].nspace; + raptor_namespace* nspace = rss_serializer->nspaces[n]; + const unsigned char* lname; + lname = (const unsigned char*)raptor_rss_fields_info[i].name; + + world->rss_fields_info_qnames[i] = + raptor_new_qname_from_namespace_local_name(serializer->world, + nspace, lname, NULL); + if(!world->rss_fields_info_qnames[i]) + return; + } + + world->rss_types_info_qnames = RAPTOR_CALLOC(raptor_qname**, + RAPTOR_RSS_COMMON_SIZE, + sizeof(raptor_qname*)); + if(!world->rss_types_info_qnames) + return; + for(i = 0; i < RAPTOR_RSS_COMMON_SIZE; i++) { + int n = raptor_rss_items_info[i].nspace; + raptor_namespace* nspace = rss_serializer->nspaces[n]; + + if(nspace) { + const unsigned char* lname = + (const unsigned char*)raptor_rss_items_info[i].name; + + world->rss_types_info_qnames[i] = + raptor_new_qname_from_namespace_local_name(serializer->world, + nspace, lname, NULL); + if(!world->rss_types_info_qnames[i]) + return; + } + } + + for(i = 0; i < RAPTOR_RSS_COMMON_SIZE; i++) { + raptor_rss_item* item; + for(item = rss_model->common[i]; item; item = item->next) { + int typei = i; + + if(!item->fields_count) + continue; + + if(is_atom) { + if(typei == RAPTOR_RSS_CHANNEL) + typei = RAPTOR_ATOM_FEED; + else if(typei == RAPTOR_RSS_ITEM) + typei = RAPTOR_ATOM_ENTRY; + } + item->node_type = &raptor_rss_items_info[typei]; + item->node_typei = typei; + } + } + + size = raptor_sequence_size(rss_serializer->items); + for(i = 0; i < size; i++) { + raptor_rss_item* item; + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->items, i); + item->node_type = item_node_type; + item->node_typei = item_node_typei; + } + + size = raptor_sequence_size(rss_serializer->enclosures); + for(i = 0; i < size; i++) { + raptor_rss_item* item; + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->enclosures, i); + item->node_type = &raptor_rss_items_info[RAPTOR_RSS_ENCLOSURE]; + item->node_typei = RAPTOR_RSS_ENCLOSURE; + } + +} + + +static void +raptor_rss10_emit_atom_triples_map(raptor_serializer *serializer, int is_feed, + const unsigned char* map_element_name) +{ + raptor_rss10_serializer_context *rss_serializer; + raptor_xml_writer* xml_writer; + raptor_uri *base_uri = serializer->base_uri; + raptor_uri* base_uri_copy = NULL; + raptor_namespace* at_nspace; + raptor_xml_element* at_map_root_element; + raptor_qname *at_map_root_qname; + int i; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + xml_writer = rss_serializer->xml_writer; + at_nspace = rss_serializer->nspaces[ATOMTRIPLES_NS]; + + at_map_root_qname = raptor_new_qname_from_namespace_local_name(serializer->world, at_nspace, + (const unsigned char*)map_element_name, NULL); + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + at_map_root_element = raptor_new_xml_element(at_map_root_qname, NULL, + base_uri_copy); + + raptor_xml_writer_start_element(xml_writer, at_map_root_element); + + /* Walk list of fields mapped atom to rss */ + for(i = 0; raptor_atom_to_rss[i].from != RAPTOR_RSS_FIELD_UNKNOWN; i++) { + int from_f = raptor_atom_to_rss[i].from; + int to_f = raptor_atom_to_rss[i].to; + const raptor_rss_field_info* from_field_info = &raptor_rss_fields_info[from_f]; + const raptor_rss_field_info* to_field_info = &raptor_rss_fields_info[to_f]; + raptor_xml_element* at_map_element; + raptor_qname *at_map_qname; + raptor_qname** at_map_attrs; + const char* predicate_prefix; + unsigned char* ruri_string; + + /* Do not rewrite to atom0.3 terms */ + if(to_field_info->nspace == ATOM0_3_NS) + continue; + + /* atom:feed only contains some fields that are mapped */ + if(is_feed && !(from_f == RAPTOR_RSS_FIELD_ATOM_ID || + from_f == RAPTOR_RSS_FIELD_ATOM_UPDATED || + from_f == RAPTOR_RSS_FIELD_ATOM_RIGHTS || + from_f == RAPTOR_RSS_FIELD_ATOM_TITLE)) + continue; + + predicate_prefix = raptor_rss_namespaces_info[from_field_info->nspace].prefix; + if(!predicate_prefix) + continue; + + /* {atom element} */ + at_map_qname = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + at_nspace, + map_element_name, + NULL); + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + at_map_element = raptor_new_xml_element(at_map_qname, NULL, base_uri_copy); + + + at_map_attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + ruri_string = raptor_uri_to_relative_uri_string(base_uri, + serializer->world->rss_fields_info_uris[to_f]); + at_map_attrs[0] = raptor_new_qname(rss_serializer->nstack, + (const unsigned char*)"property", + ruri_string); + raptor_free_memory(ruri_string); + raptor_xml_element_set_attributes(at_map_element, at_map_attrs, 1); + + raptor_xml_writer_start_element(xml_writer, at_map_element); + raptor_xml_writer_cdata(xml_writer, (const unsigned char*)predicate_prefix); + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)":", 1); + raptor_xml_writer_cdata(xml_writer, + (const unsigned char*)from_field_info->name); + raptor_xml_writer_end_element(xml_writer, at_map_element); + + raptor_free_xml_element(at_map_element); + } + + raptor_xml_writer_end_element(xml_writer, at_map_root_element); + + raptor_free_xml_element(at_map_root_element); +} + + + +/* atom-specific feed XML elements */ +static void +raptor_rss10_emit_atom_feed(raptor_serializer *serializer, + raptor_rss_item *item) +{ + raptor_rss10_serializer_context *rss_serializer; + raptor_xml_writer* xml_writer; + raptor_uri *base_uri = serializer->base_uri; + raptor_uri* base_uri_copy = NULL; + raptor_xml_element* atom_link_element; + raptor_qname *atom_link_qname; + raptor_qname** atom_link_attrs; + raptor_namespace* atom_nspace; + unsigned char* ruri_string; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + atom_nspace = rss_serializer->nspaces[ATOM1_0_NS]; + xml_writer = rss_serializer->xml_writer; + + atom_link_qname = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + atom_nspace, + (const unsigned char*)"link", + NULL); + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + atom_link_element = raptor_new_xml_element(atom_link_qname, NULL, + base_uri_copy); + + atom_link_attrs = RAPTOR_CALLOC(raptor_qname**, 2, sizeof(raptor_qname*)); + ruri_string = raptor_uri_to_relative_uri_string(base_uri, item->uri); + + atom_link_attrs[0] = raptor_new_qname(rss_serializer->nstack, + (const unsigned char*)"href", + ruri_string); + raptor_free_memory(ruri_string); + atom_link_attrs[1] = raptor_new_qname(rss_serializer->nstack, + (const unsigned char*)"rel", + (const unsigned char*)"self"); + raptor_xml_element_set_attributes(atom_link_element, atom_link_attrs, 2); + + raptor_xml_writer_empty_element(xml_writer, atom_link_element); + + raptor_free_xml_element(atom_link_element); + + if(rss_serializer->rss_triples_mode == 2) { + raptor_rss10_emit_atom_triples_map(serializer, 1, + (const unsigned char*)"feedmap"); + raptor_rss10_emit_atom_triples_map(serializer, 0, + (const unsigned char*)"entrymap"); + } +} + + +/* emit the RSS 1.0-specific rdf:Seq and rss:item XML elements */ +static void +raptor_rss10_emit_rss_items(raptor_serializer *serializer) +{ + raptor_rss10_serializer_context *rss_serializer; + raptor_xml_writer* xml_writer; + raptor_uri *base_uri = serializer->base_uri; + raptor_uri* base_uri_copy = NULL; + raptor_xml_element* rss_items_predicate; + int i; + raptor_qname *rdf_Seq_qname; + raptor_xml_element *rdf_Seq_element; + int size; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + + if(!raptor_sequence_size(rss_serializer->items)) + return; + + xml_writer = rss_serializer->xml_writer; + + rdf_Seq_qname = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->rdf_nspace, + (const unsigned char*)"Seq", + NULL); + + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + rdf_Seq_element = raptor_new_xml_element(rdf_Seq_qname, NULL, base_uri_copy); + + /* make the .... */ + + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + rss_items_predicate = raptor_new_xml_element(raptor_qname_copy(serializer->world->rss_fields_info_qnames[RAPTOR_RSS_FIELD_ITEMS]), NULL, base_uri_copy); + + raptor_xml_writer_start_element(xml_writer, rss_items_predicate); + + raptor_xml_writer_start_element(xml_writer, rdf_Seq_element); + + size = raptor_sequence_size(rss_serializer->items); + for(i = 0; i < size; i++) { + raptor_rss_item* item_item; + raptor_qname *rdf_li_qname; + raptor_xml_element *rdf_li_element; + raptor_qname **attrs; + unsigned char* ruri_string; + + item_item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->items, i); + rdf_li_qname = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->rdf_nspace, + (const unsigned char*)"li", + NULL); + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + rdf_li_element = raptor_new_xml_element(rdf_li_qname, NULL, base_uri_copy); + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + ruri_string = raptor_uri_to_relative_uri_string(base_uri, item_item->uri); + attrs[0] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->rdf_nspace, + (const unsigned char*)"resource", + ruri_string); + raptor_free_memory(ruri_string); + raptor_xml_element_set_attributes(rdf_li_element, attrs, 1); + + raptor_xml_writer_empty_element(xml_writer, rdf_li_element); + + raptor_xml_writer_newline(xml_writer); + + raptor_free_xml_element(rdf_li_element); + } + + raptor_xml_writer_end_element(xml_writer, rdf_Seq_element); + + raptor_free_xml_element(rdf_Seq_element); + + raptor_xml_writer_end_element(xml_writer, rss_items_predicate); + + raptor_free_xml_element(rss_items_predicate); +} + + +/* emit a block of RDF/XML depending on the rssTriples option mode */ +static void +raptor_rss10_emit_rdfxml_item_triples(raptor_serializer *serializer, + raptor_rss_item *item) +{ + raptor_rss10_serializer_context *rss_serializer; + raptor_xml_writer* xml_writer; + raptor_xml_element* root_element = NULL; + raptor_serializer* ser = NULL; + raptor_uri* base_uri = NULL; + int t_max_count = raptor_sequence_size(item->triples); + int t_count; + int t; + int is_atom; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + + if(rss_serializer->rss_triples_mode == 0 || !item->triples) + return; + + xml_writer = rss_serializer->xml_writer; + is_atom = rss_serializer->is_atom; + + /* can only use atom-triples with atom serializer */ + if(rss_serializer->rss_triples_mode == 2 && !is_atom) + return; + + /* can only use rdf-xml with rss-1.0 serializer */ + if(rss_serializer->rss_triples_mode == 1 && is_atom) + return; + + t_count = 0; + for(t = 0; t < t_max_count; t++) { + if(raptor_sequence_get_at(item->triples, t)) + t_count++; + } + if(!t_count) + return; + + RAPTOR_DEBUG2("Serializing %d triples\n", t_count); + + if(is_atom) { + raptor_namespace* at_nspace = rss_serializer->nspaces[ATOMTRIPLES_NS]; + raptor_qname* root_qname; + + /* atom:md with no attribute */ + root_qname = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + at_nspace, + (const unsigned char*)"md", + NULL); + if(!root_qname) + goto oom; + + base_uri = serializer->base_uri; + if(base_uri) + base_uri = raptor_uri_copy(base_uri); + + /* after this root_element owns root_qname and (this copy of) base_uri */ + root_element = raptor_new_xml_element(root_qname, NULL, base_uri); + if(!root_element) { + if(base_uri) + raptor_free_uri(base_uri); + raptor_free_qname(root_qname); + } else + raptor_xml_writer_start_element(xml_writer, root_element); + } + + ser = raptor_new_serializer(rss_serializer->world, "rdfxml-abbrev"); + if(!ser) + goto oom; + + raptor_rdfxmla_serialize_set_xml_writer(ser, xml_writer, + rss_serializer->nstack); + raptor_rdfxmla_serialize_set_write_rdf_RDF(ser, 0); + raptor_rdfxmla_serialize_set_single_node(ser, item->uri); + if(rss_serializer->rss_triples_mode == 2) { + /* raptor_rdfxmla_serialize_set_write_typed_nodes(ser, 0); */ + } + + /* after this call, ser does + * NOT own serializer->iostream and will not destroy it + * when raptor_free_serializer(ser) is called. + */ + raptor_serializer_start_to_iostream(ser, base_uri, serializer->iostream); + + for(t = 0; t < t_max_count; t++) { + raptor_statement* s; + s = (raptor_statement*)raptor_sequence_get_at(item->triples, t); + if(s) + raptor_serializer_serialize_statement(ser, s); + } + + raptor_serializer_serialize_end(ser); + + if(is_atom) + raptor_xml_writer_end_element(xml_writer, root_element); + + oom: + if(ser) + raptor_free_serializer(ser); + + if(root_element) + raptor_free_xml_element(root_element); +} + + +/** + * raptor_rss10_ensure_atom_field_zero_one: + * @item: RSS item object + * @f: ATOM field type + * + * INTERNAL - Check that the given item @field appears 0 or 1 times + */ +static void +raptor_rss10_ensure_atom_field_zero_one(raptor_rss_item* item, + raptor_rss_fields_type f) +{ + raptor_rss_field* field = item->fields[f]; + if(!field) + return; + + if(field->next) { + /* more than 1 value so delete rest of values */ + raptor_rss_field* next = field->next; + field->next = NULL; + + do { + field = next; + + next = field->next; + field->next = NULL; + raptor_rss_field_free(field); + } while(next); + } + +} + + +/** + * raptor_rss10_ensure_atom_feed_valid: + * @rss_serializer: serializer object + * + * INTERNAL - Ensure the atom items have all the fields they need: + * & & <updated> + * plus: + * <link rel='alternate' ...> OR <content>.. + * + */ +static int +raptor_rss10_ensure_atom_feed_valid(raptor_rss10_serializer_context *rss_serializer) +{ + int is_atom; + int i; + raptor_rss_item* item; + raptor_rss_model* rss_model; + time_t now = 0; + int size; + +#ifdef HAVE_GETTIMEOFDAY + struct timeval tv; + if(!gettimeofday(&tv, NULL)) + now = tv.tv_sec; +#else + now = time(NULL); +#endif + + is_atom = rss_serializer->is_atom; + rss_model = &rss_serializer->model; + + if(!is_atom) + return 0; + + item = rss_model->common[RAPTOR_RSS_CHANNEL]; + if(item) { + int f; + + /* atom:id is required */ + f = RAPTOR_RSS_FIELD_ATOM_ID; + if(!item->fields[f]) { + raptor_rss_field* field = raptor_rss_new_field(rss_serializer->world); + field->uri = raptor_uri_copy(item->uri); + raptor_rss_item_add_field(item, f, field); + } + + /* atom:updated is required */ + f = RAPTOR_RSS_FIELD_ATOM_UPDATED; + if(!item->fields[f]) { + raptor_rss_field* field = raptor_rss_new_field(rss_serializer->world); + raptor_rss_set_date_field(field, now); + raptor_rss_item_add_field(item, f, field); + } + + /* atom:content is forbidden in feed */ + f = RAPTOR_RSS_FIELD_ATOM_CONTENT; + if(item->fields[f]) { + raptor_rss_field_free(item->fields[f]); + item->fields[f] = NULL; + } + + /* atom:summary is forbidden in feed */ + f = RAPTOR_RSS_FIELD_ATOM_SUMMARY; + if(item->fields[f]) { + raptor_rss_field_free(item->fields[f]); + item->fields[f] = NULL; + } + + /* These fields can appear 0 or 1 times on a feed */ + raptor_rss10_ensure_atom_field_zero_one(item, + RAPTOR_RSS_FIELD_ATOM_ICON); + raptor_rss10_ensure_atom_field_zero_one(item, + RAPTOR_RSS_FIELD_ATOM_LOGO); + raptor_rss10_ensure_atom_field_zero_one(item, + RAPTOR_RSS_FIELD_ATOM_RIGHTS); + raptor_rss10_ensure_atom_field_zero_one(item, + RAPTOR_RSS_FIELD_ATOM_SUBTITLE); + } + + + size = raptor_sequence_size(rss_serializer->items); + for(i = 0; i < size; i++) { + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->items, i); + + /* atom:id - defaults to item URI */ + if(!item->fields[RAPTOR_RSS_FIELD_ATOM_ID]) { + raptor_rss_field* field = raptor_rss_new_field(rss_serializer->world); + field->uri = raptor_uri_copy(item->uri); + raptor_rss_item_add_field(item, RAPTOR_RSS_FIELD_ATOM_ID, field); + } + + /* atom:title - defaults to "untitled" */ + if(!item->fields[RAPTOR_RSS_FIELD_ATOM_TITLE]) { + raptor_rss_field* field = raptor_rss_new_field(rss_serializer->world); + field->value = RAPTOR_MALLOC(unsigned char*, 9); + memcpy(field->value, "untitled", 9); + raptor_rss_item_add_field(item, RAPTOR_RSS_FIELD_ATOM_TITLE, field); + } + + /* atom:updated - defaults to now time */ + if(!item->fields[RAPTOR_RSS_FIELD_ATOM_UPDATED]) { + raptor_rss_field* field = raptor_rss_new_field(rss_serializer->world); + raptor_rss_set_date_field(field, now); + raptor_rss_item_add_field(item, RAPTOR_RSS_FIELD_ATOM_UPDATED, field); + } + + /* enforce there is either an atom:content OR atom:link (rel = alternate) + * by adding a link to {item URI} if missing + */ + if(!item->fields[RAPTOR_RSS_FIELD_ATOM_CONTENT] && + !item->fields[RAPTOR_RSS_FIELD_ATOM_LINK]) { + raptor_rss_field* field = raptor_rss_new_field(rss_serializer->world); + field->uri = raptor_uri_copy(item->uri); + raptor_rss_item_add_field(item, RAPTOR_RSS_FIELD_ATOM_LINK, field); + } + + /* These fields can appear 0 or 1 times on an entry */ + raptor_rss10_ensure_atom_field_zero_one(item, + RAPTOR_RSS_FIELD_ATOM_PUBLISHED); + raptor_rss10_ensure_atom_field_zero_one(item, + RAPTOR_RSS_FIELD_ATOM_RIGHTS); + raptor_rss10_ensure_atom_field_zero_one(item, + RAPTOR_RSS_FIELD_ATOM_SOURCE); + raptor_rss10_ensure_atom_field_zero_one(item, + RAPTOR_RSS_FIELD_ATOM_SUMMARY); + } + + return 0; +} + + +static void +raptor_rss10_emit_item(raptor_serializer* serializer, + raptor_rss_item *item, int item_type, + int emit_container) +{ + raptor_rss10_serializer_context *rss_serializer; + raptor_xml_writer* xml_writer; + raptor_rss_model* rss_model; + raptor_uri *base_uri = serializer->base_uri; + raptor_xml_element *element = NULL; + raptor_qname **attrs = NULL; + raptor_uri* base_uri_copy = NULL; + int fi; + int is_atom; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + +#ifdef RAPTOR_DEBUG + if(!item) { + RAPTOR_FATAL3("Tried to emit NULL item of type %d - %s\n", item_type, + raptor_rss_items_info[item_type].name); + } +#endif + + xml_writer = rss_serializer->xml_writer; + is_atom = rss_serializer->is_atom; + rss_model = &rss_serializer->model; + + if(!item->fields_count) { + int i; + int size = raptor_sequence_size(rss_serializer->enclosures); + + for(i = 0; i < size; i++) { + raptor_rss_item *enclosure_item; + enclosure_item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->enclosures, i); + /* If the item and enclosure item have the same URI, move the + * enclosure fields to the item. Assumed that they got conflated + * previously such as when the enclosure url = the guid + */ + if(enclosure_item->uri && + raptor_uri_equals(item->uri, enclosure_item->uri)) { + int j; + for(j = 0; j < RAPTOR_RSS_FIELDS_SIZE; j++) { + if(j != RAPTOR_RSS_RDF_ENCLOSURE_TYPE && + j != RAPTOR_RSS_RDF_ENCLOSURE_LENGTH && + j != RAPTOR_RSS_RDF_ENCLOSURE_URL) { + item->fields[j] = enclosure_item->fields[j]; + enclosure_item->fields[j] = NULL; + item->fields_count++; + enclosure_item->fields_count--; + } + } + break; + } + } + } + + if(!item->fields_count) + return; + + if(emit_container) { + raptor_qname* qname_copy; + + qname_copy = raptor_qname_copy(serializer->world->rss_types_info_qnames[item->node_typei]); + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + element = raptor_new_xml_element(qname_copy, NULL, base_uri_copy); + + if(!is_atom && item->uri) { + unsigned char* ruri_string; + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + ruri_string = raptor_uri_to_relative_uri_string(base_uri, item->uri); + attrs[0] = raptor_new_qname_from_namespace_local_name(serializer->world, + rss_serializer->rdf_nspace, + (const unsigned char*)"about", + ruri_string); + raptor_free_memory(ruri_string); + raptor_xml_element_set_attributes(element, attrs, 1); + } + + raptor_xml_writer_start_element(xml_writer, element); + } + + + for(fi = 0; fi < RAPTOR_RSS_FIELDS_SIZE; fi++) { + raptor_rss_fields_type f = (raptor_rss_fields_type)fi; + raptor_rss_field* field; + + if(f == RAPTOR_RSS_FIELD_ITEMS) + /* emitting the RSS items rdf:Seq block is done after this loop */ + continue; + + if(!serializer->world->rss_fields_info_uris[f]) + continue; + + if(f == RAPTOR_RSS_FIELD_ATOM_AUTHOR) { + int typei; + + if(!is_atom) + continue; + + if(item_type != RAPTOR_RSS_CHANNEL) + continue; + + typei = RAPTOR_ATOM_AUTHOR; + if(!rss_model->common[typei]) { + raptor_rss_item* author_item; + + /* No atom author was present so make a new atom:author item + * then either promote the string to an atom:name field OR + * use "unknown" + */ + author_item = raptor_rss_model_add_common(rss_model, + (raptor_rss_type)typei); + + author_item->node_type = &raptor_rss_items_info[typei]; + author_item->node_typei = typei; + + /* FIXME - uses _:author as bnode name - should make a new + * genid for each author node. This is OK because there + * is a check above that there is only 1 author per FEED. + */ + author_item->term = raptor_new_term_from_blank(serializer->world, + (unsigned char*)"author"); + + + /* Move atom:name author field, or create a dummy one */ + f = RAPTOR_RSS_FIELD_ATOM_NAME; + if(item->fields[f]) { + field = item->fields[f]; + item->fields[f] = NULL; + } else { + field = raptor_rss_new_field(serializer->world); + field->value = RAPTOR_MALLOC(unsigned char*, 8); + memcpy(field->value, "unknown", 8); + } + raptor_rss_item_add_field(author_item, RAPTOR_RSS_FIELD_ATOM_NAME, + field); + + /* Move atom author fields if found: atom:uri and atom:email + * are only used inside Person constructs + */ + f = RAPTOR_RSS_FIELD_ATOM_URI; + if(item->fields[f]) { + field = item->fields[f]; + raptor_rss_item_add_field(author_item, f, field); + item->fields[f] = NULL; + } + f = RAPTOR_RSS_FIELD_ATOM_EMAIL; + if(item->fields[f]) { + field = item->fields[f]; + raptor_rss_item_add_field(author_item, f, field); + item->fields[f] = NULL; + } + } + + RAPTOR_DEBUG3("Emitting type %i - %s\n", typei, + raptor_rss_items_info[typei].name); + raptor_rss10_emit_item(serializer, rss_model->common[typei], typei, 1); + continue; + } + + + for(field = item->fields[f]; field; field = field->next) { + raptor_xml_element* predicate; + + /* Use atom:summary in preference */ + if(is_atom && f == RAPTOR_RSS_FIELD_DESCRIPTION) + continue; + + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + predicate = raptor_new_xml_element(raptor_qname_copy(serializer->world->rss_fields_info_qnames[f]), NULL, base_uri_copy); + + if(is_atom && field->uri) { + unsigned char* ruri_string; + size_t len; + raptor_uri* my_base_uri = base_uri; + + if(f == RAPTOR_RSS_FIELD_ATOM_ID) + my_base_uri = NULL; + + ruri_string = raptor_uri_to_relative_counted_uri_string(my_base_uri, + field->uri, + &len); + + if(f == RAPTOR_RSS_FIELD_ATOM_LINK && + !item->fields[RAPTOR_RSS_FIELD_ATOM_CONTENT]) { + /* atom:link to URI and there is no atom:content */ + raptor_qname **predicate_attrs = NULL; + predicate_attrs = RAPTOR_CALLOC(raptor_qname**, 2, + sizeof(raptor_qname*)); + predicate_attrs[0] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + NULL, + (const unsigned char*)"href", + ruri_string); + predicate_attrs[1] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + NULL, + (const unsigned char*)"rel", + (const unsigned char*)"alternate"); + field->value = NULL; + raptor_xml_element_set_attributes(predicate, predicate_attrs, 2); + raptor_xml_writer_empty_element(xml_writer, predicate); + } else if(f == RAPTOR_RSS_FIELD_ATOM_CONTENT) { + /* <atom:content src="{uri value}" type="{type}" /> */ + raptor_qname **predicate_attrs = NULL; + const unsigned char* content_type; + raptor_rss_field* content_type_field; + + /* get the type */ + content_type_field = item->fields[RAPTOR_RSS_FIELD_AT_CONTENT_TYPE]; + if(content_type_field && content_type_field->value) + content_type = content_type_field->value; + else + content_type = (const unsigned char*)"text/html"; + + predicate_attrs = RAPTOR_CALLOC(raptor_qname**, 2, + sizeof(raptor_qname*)); + predicate_attrs[0] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + NULL, + (const unsigned char*)"src", + ruri_string); + predicate_attrs[1] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + NULL, + (const unsigned char*)"type", + (const unsigned char*)content_type); + /* free at:contentType field - no need to emit it */ + if(content_type_field) { + raptor_rss_field_free(content_type_field); + item->fields[RAPTOR_RSS_FIELD_AT_CONTENT_TYPE] = NULL; + } + + field->value = NULL; + raptor_xml_element_set_attributes(predicate, predicate_attrs, 2); + raptor_xml_writer_empty_element(xml_writer, predicate); + } else { + raptor_xml_writer_start_element(xml_writer, predicate); + raptor_xml_writer_cdata_counted(xml_writer, ruri_string, + (unsigned int)len); + raptor_xml_writer_end_element(xml_writer, predicate); + } + raptor_free_memory(ruri_string); + + } else if(field->uri) { + raptor_uri* enclosure_uri = field->uri; + raptor_rss_item *enclosure_item = NULL; + int i; + + if(f == RAPTOR_RSS_FIELD_ENCLOSURE && item_type == RAPTOR_RSS_ITEM) { + int size = raptor_sequence_size(rss_serializer->enclosures); + for(i = 0; i < size; i++) { + enclosure_item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->enclosures, i); + if(enclosure_item->uri && raptor_uri_equals(enclosure_uri, + enclosure_item->uri)) + break; + } + if(enclosure_item) { + int attr_count = 0; + unsigned char* ruri_string; + + attrs = RAPTOR_CALLOC(raptor_qname**, 3, sizeof(raptor_qname*)); + ruri_string = raptor_uri_to_relative_uri_string(base_uri, field->uri); + attrs[attr_count] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->rdf_nspace, + (const unsigned char*)"resource", + ruri_string); + raptor_free_memory(ruri_string); + attr_count++; + + if(enclosure_item->fields[RAPTOR_RSS_RDF_ENCLOSURE_TYPE] && enclosure_item->fields[RAPTOR_RSS_RDF_ENCLOSURE_TYPE]->value) { + attrs[attr_count] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->nspaces[RSS2_0_ENC_NS], + (const unsigned char*)raptor_rss_fields_info[RAPTOR_RSS_RDF_ENCLOSURE_TYPE].name, + (const unsigned char*)enclosure_item->fields[RAPTOR_RSS_RDF_ENCLOSURE_TYPE]->value); + attr_count++; + } + + if(enclosure_item->fields[RAPTOR_RSS_RDF_ENCLOSURE_LENGTH] && enclosure_item->fields[RAPTOR_RSS_RDF_ENCLOSURE_LENGTH]->value) { + attrs[attr_count] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->nspaces[RSS2_0_ENC_NS], + (const unsigned char*)raptor_rss_fields_info[RAPTOR_RSS_RDF_ENCLOSURE_LENGTH].name, + (const unsigned char*)enclosure_item->fields[RAPTOR_RSS_RDF_ENCLOSURE_LENGTH]->value); + attr_count++; + } + raptor_xml_element_set_attributes(predicate, attrs, attr_count); + } else { + RAPTOR_DEBUG2("Enclosure item with URI %s could not be found in list of enclosures\n", raptor_uri_as_string(enclosure_uri)); + } + } else { + unsigned char* ruri_string; + + /* not an rss:item with an rss:enclosure field */ + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + ruri_string = raptor_uri_to_relative_uri_string(base_uri, field->uri); + attrs[0] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->rdf_nspace, + (const unsigned char*)"resource", + ruri_string); + raptor_free_memory(ruri_string); + raptor_xml_element_set_attributes(predicate, attrs, 1); + } + raptor_xml_writer_empty_element(xml_writer, predicate); + } else if(field->value) { + /* not a URI, must be a literal */ + int is_xhtml_content = field->is_xml; + int prefer_cdata = (!is_atom && f == RAPTOR_RSS_FIELD_CONTENT_ENCODED); + + if(is_xhtml_content && !prefer_cdata) { + raptor_qname **predicate_attrs = NULL; + predicate_attrs = RAPTOR_CALLOC(raptor_qname**, 1, + sizeof(raptor_qname*)); + if(is_atom) + predicate_attrs[0] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + NULL, + (const unsigned char*)"type", + (const unsigned char*)"xhtml"); + else + predicate_attrs[0] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->rdf_nspace, + (const unsigned char*)"parseType", + (const unsigned char*)"Literal"); + raptor_xml_element_set_attributes(predicate, predicate_attrs, 1); + } + + raptor_xml_writer_start_element(xml_writer, predicate); + + if(is_xhtml_content) { + if(prefer_cdata) + raptor_xml_writer_raw_counted(xml_writer, + (const unsigned char*)"<![CDATA[", 9); + raptor_xml_writer_raw(xml_writer, (const unsigned char*)field->value); + if(prefer_cdata) + raptor_xml_writer_raw_counted(xml_writer, + (const unsigned char*)"]]>", 3); + } else + raptor_xml_writer_cdata(xml_writer, (const unsigned char*)field->value); + raptor_xml_writer_end_element(xml_writer, predicate); + } else { + RAPTOR_DEBUG3("Field %u - %s had no URI or literal value\n", + f, raptor_rss_fields_info[f].name); + } + raptor_free_xml_element(predicate); + } + } + + + if(item_type == RAPTOR_RSS_CHANNEL) { + if(is_atom) + raptor_rss10_emit_atom_feed(serializer, item); + + if(!is_atom) + raptor_rss10_emit_rss_items(serializer); + } + + /* Add an RDF/XML block with remaining triples if Atom */ + if(item->triples && raptor_sequence_size(item->triples)) + raptor_rss10_emit_rdfxml_item_triples(serializer, item); + + if(emit_container) { + raptor_xml_writer_end_element(xml_writer, element); + raptor_free_xml_element(element); + } + +} + + +/** + * raptor_rss10_serialize_end: + * @serializer: serializer object + * + * INTERNAL (raptor_serializer_factory API) - End a serializing + * + * Return value: non-0 on failure + */ +static int +raptor_rss10_serialize_end(raptor_serializer* serializer) +{ + raptor_rss10_serializer_context *rss_serializer; + raptor_rss_model* rss_model; + int i; + raptor_xml_writer* xml_writer; +#ifdef RAPTOR_DEBUG + int triple_count = 0; +#endif + int is_atom; + raptor_qname **attrs = NULL; + int attrs_count = 0; + raptor_uri* entry_uri = NULL; + raptor_rss_item* entry_item = NULL; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + rss_model = &rss_serializer->model; + is_atom = rss_serializer->is_atom; + + raptor_rss10_build_items(rss_serializer); + + raptor_rss10_move_leftover_statements(rss_serializer); + + raptor_rss10_move_anonymous_statements(rss_serializer); + + if(is_atom) { + char* entry_uri_string; + + raptor_rss10_ensure_atom_feed_valid(rss_serializer); + + raptor_rss10_remove_mapped_fields(rss_serializer); + + entry_uri_string = RAPTOR_OPTIONS_GET_STRING(serializer, + RAPTOR_OPTION_ATOM_ENTRY_URI); + if(entry_uri_string) { + int size = raptor_sequence_size(rss_serializer->items); + entry_uri = raptor_new_uri(rss_serializer->world, + (const unsigned char*)entry_uri_string); + for(i = 0; i < size; i++) { + raptor_rss_item* item; + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->items, i); + if(raptor_uri_equals(item->uri, entry_uri)) { + entry_item = item; + break; + } + } + if(!entry_item) { + RAPTOR_DEBUG2("Entry URI %s was not found in list of items\n", + raptor_uri_as_string(entry_uri)); + raptor_free_uri(entry_uri); + entry_uri = NULL; + } + } + + } + +#ifdef RAPTOR_DEBUG + if(1) { + int size = raptor_sequence_size(rss_serializer->triples); + for(i = 0; i < size; i++) { + raptor_statement* t; + t = (raptor_statement*)raptor_sequence_get_at(rss_serializer->triples, i); + if(t) { + fprintf(stderr, " %d: ", i); + raptor_statement_print(t, stderr); + fputc('\n', stderr); + triple_count++; + } + } + RAPTOR_DEBUG2("Starting with %d stored triples\n", triple_count); + } +#endif + + if(!rss_model->common[RAPTOR_RSS_CHANNEL]) { + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "No RSS channel found"); + if(entry_uri) + raptor_free_uri(entry_uri); + return 1; + } + + + if(rss_serializer->xml_writer) + raptor_free_xml_writer(rss_serializer->xml_writer); + + xml_writer = raptor_new_xml_writer(rss_serializer->world, + rss_serializer->nstack, + serializer->iostream); + rss_serializer->xml_writer = xml_writer; + raptor_xml_writer_set_option(xml_writer, + RAPTOR_OPTION_WRITER_AUTO_INDENT, NULL, 1); + raptor_xml_writer_set_option(xml_writer, + RAPTOR_OPTION_WRITER_AUTO_EMPTY, NULL, 1); + + raptor_rss10_build_xml_names(serializer, (is_atom && entry_uri)); + + if(serializer->base_uri && + RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_WRITE_BASE_URI)) { + const unsigned char* base_uri_string; + + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + + base_uri_string = raptor_uri_as_string(serializer->base_uri); + attrs[attrs_count++] = raptor_new_qname_from_namespace_local_name(rss_serializer->world, + rss_serializer->xml_nspace, + (const unsigned char*)"base", + base_uri_string); + } + + if(attrs_count) + raptor_xml_element_set_attributes(rss_serializer->root_element, attrs, + attrs_count); + else + raptor_xml_element_set_attributes(rss_serializer->root_element, NULL, 0); + + raptor_xml_writer_start_element(xml_writer, rss_serializer->root_element); + + + if(entry_item) { + RAPTOR_DEBUG1("Emitting entry\n"); + raptor_rss10_emit_item(serializer, entry_item, RAPTOR_RSS_ITEM, 0); + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)"\n", 1); + } else { + i = RAPTOR_RSS_CHANNEL; + RAPTOR_DEBUG3("Emitting type %i - %s\n", i, raptor_rss_items_info[i].name); + raptor_rss10_emit_item(serializer, rss_model->common[i], i, !is_atom); + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)"\n", 1); + + if(rss_model->items_count) { + int size = raptor_sequence_size(rss_serializer->items); + for(i = 0; i < size; i++) { + raptor_rss_item* item; + item = (raptor_rss_item*)raptor_sequence_get_at(rss_serializer->items, i); + raptor_rss10_emit_item(serializer, item, RAPTOR_RSS_ITEM, 1); + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)"\n", 1); + } + + } + + for(i = RAPTOR_RSS_CHANNEL + 1; i < RAPTOR_RSS_COMMON_SIZE; i++) { + raptor_rss_item* item; + + if(is_atom) { + /* atom 1.0 only serializes rss:item (channel is done above) */ + if(i != RAPTOR_RSS_ITEM) + continue; + } else { + /* rss 1.0 ignores atom:author for now - FIXME */ + if(i == RAPTOR_ATOM_AUTHOR) + continue; + } + + for(item = rss_model->common[i]; item; item = item->next) { + RAPTOR_DEBUG3("Emitting type %i - %s\n", i, + raptor_rss_items_info[i].name); + raptor_rss10_emit_item(serializer, item, i, 1); + } + } + } + + + if(entry_uri) + raptor_free_uri(entry_uri); + + raptor_xml_writer_end_element(xml_writer, rss_serializer->root_element); + + raptor_free_xml_element(rss_serializer->root_element); + + raptor_xml_writer_newline(xml_writer); + + raptor_xml_writer_flush(xml_writer); + + return 0; +} + + +/* add a namespace */ +static int +raptor_rss10_serialize_declare_namespace_from_namespace(raptor_serializer* serializer, + raptor_namespace *nspace) +{ + raptor_rss10_serializer_context* rss_serializer; + int i; + int size; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + + size = raptor_sequence_size(rss_serializer->user_namespaces); + for(i = 0; i < size; i++) { + raptor_namespace* ns; + ns = (raptor_namespace*)raptor_sequence_get_at(rss_serializer->user_namespaces, i); + + /* If prefix is already declared, ignore it */ + if(!ns->prefix && !nspace->prefix) + return 1; + + if(ns->prefix && nspace->prefix && + !strcmp((const char*)ns->prefix, (const char*)nspace->prefix)) + return 1; + + if(ns->uri && nspace->uri && + raptor_uri_equals(ns->uri, nspace->uri)) + return 1; + } + + nspace = raptor_new_namespace_from_uri(rss_serializer->nstack, + nspace->prefix, nspace->uri, + 0); + if(!nspace) + return 1; + + raptor_sequence_push(rss_serializer->user_namespaces, nspace); + return 0; +} + + +/* add a namespace */ +static int +raptor_rss10_serialize_declare_namespace(raptor_serializer* serializer, + raptor_uri *uri, + const unsigned char *prefix) +{ + raptor_rss10_serializer_context* rss_serializer; + raptor_namespace *ns; + int rc; + + rss_serializer = (raptor_rss10_serializer_context*)serializer->context; + + ns = raptor_new_namespace_from_uri(rss_serializer->nstack, prefix, uri, 0); + rc = raptor_rss10_serialize_declare_namespace_from_namespace(serializer, ns); + raptor_free_namespace(ns); + + return rc; +} + + + +/** + * raptor_rss10_serialize_finish_factory: + * @factory: serializer factory + * + * INTERNAL (raptor_serializer_factory API) - finish the serializer factory + */ +static void +raptor_rss10_serialize_finish_factory(raptor_serializer_factory* factory) +{ + +} + + +static const char* rss10_names[3] = { "rss-1.0", NULL}; + +static const char* const rss10_uri_strings[2] = { +"http://purl.org/rss/1.0/spec", + NULL +}; + +#define RSS10_TYPES_COUNT 5 +static const raptor_type_q rss10_types[RSS10_TYPES_COUNT + 1] = { + { "application/rss+xml", 19, 10}, + { "application/rss", 15, 3}, + { "text/rss", 8, 3}, + { "application/xml", 15, 3}, + { "text/xml", 8, 3}, + { NULL, 0, 0} +}; + +static int +raptor_rss10_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = rss10_names; + factory->desc.mime_types = rss10_types; + + factory->desc.label = "RSS 1.0"; + factory->desc.uri_strings = rss10_uri_strings; + + factory->context_length = sizeof(raptor_rss10_serializer_context); + + factory->init = raptor_rss10_serialize_init; + factory->terminate = raptor_rss10_serialize_terminate; + factory->declare_namespace = raptor_rss10_serialize_declare_namespace; + factory->declare_namespace_from_namespace = raptor_rss10_serialize_declare_namespace_from_namespace; + factory->serialize_start = raptor_rss10_serialize_start; + factory->serialize_statement = raptor_rss10_serialize_statement; + factory->serialize_end = raptor_rss10_serialize_end; + factory->finish_factory = raptor_rss10_serialize_finish_factory; + + return 0; +} + + + +static const char* atom_names[3] = { "atom", NULL}; + +static const char* const atom_uri_strings[2] = { + "http://www.ietf.org/rfc/rfc4287.txt", + NULL +}; + +#define ATOM_TYPES_COUNT 1 +static const raptor_type_q atom_types[ATOM_TYPES_COUNT + 1] = { + { "application/atom+xml", 20, 10}, + { NULL, 0, 0} +}; + +static int +raptor_atom_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = atom_names; + factory->desc.mime_types = atom_types; + + factory->desc.label = "Atom 1.0"; + factory->desc.uri_strings = atom_uri_strings; + + factory->context_length = sizeof(raptor_rss10_serializer_context); + + factory->init = raptor_rss10_serialize_init; + factory->terminate = raptor_rss10_serialize_terminate; + factory->declare_namespace = raptor_rss10_serialize_declare_namespace; + factory->declare_namespace_from_namespace = raptor_rss10_serialize_declare_namespace_from_namespace; + factory->serialize_start = raptor_rss10_serialize_start; + factory->serialize_statement = raptor_rss10_serialize_statement; + factory->serialize_end = raptor_rss10_serialize_end; + factory->finish_factory = raptor_rss10_serialize_finish_factory; + + return 0; +} + + + +int +raptor_init_serializer_rss10(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_rss10_serializer_register_factory); +} + +int +raptor_init_serializer_atom(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_atom_serializer_register_factory); +} + diff --git a/src/raptor_serialize_turtle.c b/src/raptor_serialize_turtle.c new file mode 100644 index 0000000..79fdbbd --- /dev/null +++ b/src/raptor_serialize_turtle.c @@ -0,0 +1,1819 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_serialize_turtle.c - Turtle serializer + * + * Copyright (C) 2006,2008 Dave Robillard + * Copyright (C) 2004-2013 David Beckett http://www.dajobe.org/ + * Copyright (C) 2004-2005 University of Bristol, UK http://www.bristol.ac.uk/ + * Copyright (C) 2005 Steve Shepard steveshep@gmail.com + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#define MAX_ASCII_INT_SIZE 13 + + +/* + * Raptor turtle serializer object + */ +typedef struct { + raptor_namespace_stack *nstack; /* Namespace stack */ + raptor_namespace *rdf_nspace; /* the rdf: namespace */ + raptor_turtle_writer *turtle_writer; /* where the xml is being written */ + raptor_sequence *namespaces; /* User declared namespaces */ + raptor_avltree *subjects; /* subject items */ + raptor_avltree *blanks; /* blank subject items */ + raptor_avltree *nodes; /* nodes */ + raptor_abbrev_node *rdf_type; /* rdf:type uri */ + + /* URI of rdf:XMLLiteral */ + raptor_uri* rdf_xml_literal_uri; + + /* URI of rdf:first */ + raptor_uri* rdf_first_uri; + + /* URI of rdf:rest */ + raptor_uri* rdf_rest_uri; + + /* URI of rdf:nil */ + raptor_uri* rdf_nil_uri; + + /* URI of rs:ResultSet */ + raptor_uri* rs_ResultSet_uri; + + /* URI of rs:resultVariable */ + raptor_uri* rs_resultVariable_uri; + + /* Non 0 for rs:ResultSet */ + int resultset; + + /* Non 0 for mKR serializer */ + int emit_mkr; + /* Flags for turtle writer */ + int turtle_writer_flags; + + /* Non 0 if "begin relation result ;" has been written */ + int written_begin; + + /* non zero if header is finished being written + * (and thus no new namespaces can be declared). + */ + int written_header; + + /* for labeling namespaces */ + int namespace_count; + + /* state for raptor_mkr_emit_subject_resultset() */ + int mkr_rs_size; + int mkr_rs_arity; + int mkr_rs_ntuple; + int mkr_rs_nvalue; + int mkr_rs_processing_value; +} raptor_turtle_context; + + +/* prototypes for functions */ + +static int raptor_turtle_emit_resource(raptor_serializer *serializer, + raptor_abbrev_node* node, + int depth); + +static int raptor_turtle_emit_literal(raptor_serializer *serializer, + raptor_abbrev_node* node, + int depth); +static int raptor_turtle_emit_blank(raptor_serializer *serializer, + raptor_abbrev_node* node, + int depth); +static int raptor_turtle_emit_subject_list_items(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth); +static int raptor_turtle_emit_subject_collection_items(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth); +static int raptor_turtle_emit_subject_properties(raptor_serializer *serializer, + raptor_abbrev_subject* subject, + int depth); +static int raptor_mkr_emit_subject_resultset(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth); +static int raptor_turtle_emit_subject(raptor_serializer *serializer, + raptor_abbrev_subject* subject, + int depth); +static int raptor_turtle_emit(raptor_serializer *serializer); + +static int raptor_turtle_serialize_init(raptor_serializer* serializer, + const char *name); +static void raptor_turtle_serialize_terminate(raptor_serializer* serializer); +static int raptor_turtle_serialize_declare_namespace(raptor_serializer* serializer, + raptor_uri *uri, + const unsigned char *prefix); +static int raptor_turtle_serialize_start(raptor_serializer* serializer); +static int raptor_turtle_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement); + +static int raptor_turtle_serialize_end(raptor_serializer* serializer); +static int raptor_turtle_serialize_flush(raptor_serializer* serializer); +static void raptor_turtle_serialize_finish_factory(raptor_serializer_factory* factory); + + +int +raptor_turtle_is_legal_turtle_qname(raptor_qname* qname) +{ + const char* prefix_name; + const char* local_name; + + if(!qname) + return 0; + + prefix_name = qname->nspace ? (const char*)qname->nspace->prefix : NULL; + if(prefix_name) { + /* prefixName: must have leading [A-Z][a-z][0-9] (nameStartChar - '_') */ + /* prefixName: no . anywhere */ + if(!(isalpha((int)*prefix_name) || isdigit((int)*prefix_name)) || + strchr(prefix_name, '.')) + return 0; + } + + local_name = (const char*)qname->local_name; + if(local_name) { + /* nameStartChar: must have leading [A-Z][a-z][0-9]_ */ + /* nameChar: no . anywhere */ + if(!(isalpha((int)*local_name) || isdigit((int)*local_name) || *local_name == '_') || + strchr(local_name, '.')) + return 0; + } + + return 1; +} + +/* + * raptor_turtle_emit_resource: + * @serializer: #raptor_serializer object + * @node: resource node + * @depth: depth into tree + * + * Emit a description of a resource using an XML Element + * + * Return value: non-0 on failure + **/ +static int +raptor_turtle_emit_resource(raptor_serializer *serializer, + raptor_abbrev_node* node, + int depth) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + int emit_mkr = context->emit_mkr; + raptor_turtle_writer *turtle_writer = context->turtle_writer; + + raptor_qname* qname = NULL; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting resource node", node); + + if(node->term->type != RAPTOR_TERM_TYPE_URI) + return 1; + + if(raptor_uri_equals(node->term->value.uri, context->rdf_nil_uri)) { + if(emit_mkr) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ", 1); + else + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"( )", 3); + return 0; + } + + qname = raptor_new_qname_from_namespace_uri(context->nstack, + node->term->value.uri, 10); + + /* XML Names allow leading '_' and '.' anywhere but Turtle does not */ + if(qname && !raptor_turtle_is_legal_turtle_qname(qname)) { + raptor_free_qname(qname); + qname = NULL; + } + + if(raptor_uri_equals(node->term->value.uri, context->rdf_nil_uri)) { + if(emit_mkr) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ", 1); + else + raptor_turtle_writer_raw_counted(turtle_writer ,(const unsigned char*)"( )", 3); + return 0; + } + + if(qname) { + raptor_turtle_writer_qname(turtle_writer, qname); + raptor_free_qname(qname); + } else { + raptor_turtle_writer_reference(turtle_writer, node->term->value.uri); + } + + RAPTOR_DEBUG_ABBREV_NODE("Emitted", node); + + return 0; +} + + +/* + * raptor_turtle_emit_literal: + * @serializer: #raptor_serializer object + * @node: literal node + * @depth: depth into tree + * + * Emit a description of a literal (object). + * + * Return value: non-0 on failure + **/ +static int +raptor_turtle_emit_literal(raptor_serializer *serializer, + raptor_abbrev_node* node, + int depth) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_turtle_writer *turtle_writer = context->turtle_writer; + int rc = 0; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting literal node", node); + + if(node->term->type != RAPTOR_TERM_TYPE_LITERAL) + return 1; + + rc = raptor_turtle_writer_literal(turtle_writer, context->nstack, + node->term->value.literal.string, + node->term->value.literal.language, + node->term->value.literal.datatype); + + RAPTOR_DEBUG_ABBREV_NODE("Emitted literal node", node); + + return rc; +} + + +/* + * raptor_turtle_emit_blank: + * @serializer: #raptor_serializer object + * @node: blank node + * @depth: depth into tree + * + * Emit a description of a blank node + * + * Return value: non-0 on failure + **/ +static int +raptor_turtle_emit_blank(raptor_serializer *serializer, + raptor_abbrev_node* node, + int depth) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_turtle_writer* turtle_writer = context->turtle_writer; + int emit_mkr = context->emit_mkr; + int rc = 0; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting blank node", node); + + if(node->term->type != RAPTOR_TERM_TYPE_BLANK) + return 1; + + if((node->count_as_subject == 1 && node->count_as_object == 1)) { + /* If this is only used as a 1 subject and object or never + * used as a subject or never used as an object, it never need + * be referenced with an explicit name */ + raptor_abbrev_subject* blank; + + blank = raptor_abbrev_subject_find(context->blanks, node->term); + if(blank) { + rc = raptor_turtle_emit_subject(serializer, blank, depth+1); + raptor_abbrev_subject_invalidate(blank); + } + + } else { + /* Blank node that needs an explicit name */ + raptor_turtle_writer_bnodeid(context->turtle_writer, + node->term->value.blank.string, + node->term->value.blank.string_len); + if(emit_mkr && !context->resultset) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" has", 4); + } + + RAPTOR_DEBUG_ABBREV_NODE("Emitted blank node", node); + + return rc; +} + + +/* + * raptor_turtle_emit_subject_list_items: + * @serializer: #raptor_serializer object + * @subject: subject node + * @depth: depth into tree + * + * Emit an rdf list of items (rdf:li) about a subject node. + * + * Return value: non-0 on failure + **/ +static int +raptor_turtle_emit_subject_list_items(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth) +{ + int rv = 0; + int i = 0; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject list items", subject->node); + + while(!rv && i < raptor_sequence_size(subject->list_items)) { + raptor_abbrev_node* object; + + object = (raptor_abbrev_node*)raptor_sequence_get_at(subject->list_items, + i++); + if(!object) + continue; + + switch(object->term->type) { + case RAPTOR_TERM_TYPE_URI: + rv = raptor_turtle_emit_resource(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + rv = raptor_turtle_emit_literal(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_BLANK: + rv = raptor_turtle_emit_blank(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, "Triple has unsupported term type %u", + object->term->type); + break; + + } + + } + + return rv; +} + + +/* + * raptor_turtle_emit_subject_collection_items: + * @serializer: #raptor_serializer object + * @subject: subject node + * @depth: depth into tree + * + * Emit an abbreviated rdf collection of items (rdf:first, rdf:rest) about a subject node. + * + * Return value: non-0 on failure + **/ +static int +raptor_turtle_emit_subject_collection_items(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + int emit_mkr = context->emit_mkr; + int rv = 0; + raptor_avltree_iterator* iter = NULL; + int i; + int is_new_subject = 0; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject collection items", subject->node); + + /* if just saw a new subject (is_new_subject is true) then there is no need + * to advance the iterator - it was just reset + */ + for(i = 0, (iter = raptor_new_avltree_iterator(subject->properties, NULL, NULL, 1)); + iter && !rv; + i++, (rv = is_new_subject ? 0 : raptor_avltree_iterator_next(iter))) { + raptor_abbrev_node** nodes; + raptor_abbrev_node* predicate; + raptor_abbrev_node* object; + + is_new_subject = 0; + + nodes = (raptor_abbrev_node**)raptor_avltree_iterator_get(iter); + if(!nodes) + break; + predicate = nodes[0]; + object = nodes[1]; + + if(!raptor_uri_equals(predicate->term->value.uri, + context->rdf_first_uri)) { + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Malformed collection - first predicate is not rdf:first"); + raptor_free_avltree_iterator(iter); + return 1; + } + + if(!object) + continue; + + if(i > 0) { + if(emit_mkr) + raptor_turtle_writer_raw_counted(context->turtle_writer, + (const unsigned char*)", ", 1); + else + raptor_turtle_writer_newline(context->turtle_writer); + } + + switch(object->term->type) { + case RAPTOR_TERM_TYPE_URI: + rv = raptor_turtle_emit_resource(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + rv = raptor_turtle_emit_literal(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_BLANK: + rv = raptor_turtle_emit_blank(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, "Triple has unsupported term type %u", + object->term->type); + break; + } + + /* Return error if emitting something failed above */ + if(rv) { + raptor_free_avltree_iterator(iter); + return rv; + } + + /* last item */ + rv = raptor_avltree_iterator_next(iter); + if(rv) + break; + + nodes = (raptor_abbrev_node**)raptor_avltree_iterator_get(iter); + predicate = nodes[0]; + object = nodes[1]; + + if(!raptor_uri_equals(predicate->term->value.uri, context->rdf_rest_uri)) { + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Malformed collection - second predicate is not rdf:rest"); + raptor_free_avltree_iterator(iter); + return 1; + } + + if(object->term->type == RAPTOR_TERM_TYPE_BLANK) { + subject = raptor_abbrev_subject_find(context->blanks, object->term); + + if(!subject) { + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Malformed collection - could not find subject for rdf:rest"); + raptor_free_avltree_iterator(iter); + return 1; + } + + /* got a <(old)subject> rdf:rest <(new)subject> triple so know + * subject has changed and should reset the properties iterator + */ + if(iter) + raptor_free_avltree_iterator(iter); + iter = raptor_new_avltree_iterator(subject->properties, NULL, NULL, 1); + is_new_subject = 1; + + } else { + if(object->term->type != RAPTOR_TERM_TYPE_URI || + !raptor_uri_equals(object->term->value.uri, context->rdf_nil_uri)) { + raptor_log_error(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Malformed collection - last rdf:rest resource is not rdf:nil"); + raptor_free_avltree_iterator(iter); + return 1; + } + break; + } + } + if(iter) + raptor_free_avltree_iterator(iter); + + return rv; +} + + + +/* + * raptor_turtle_emit_subject_properties: + * @serializer: #raptor_serializer object + * @subject: subject node + * @depth: depth into tree + * + * Emit the properties about a subject node. + * + * Return value: non-0 on failure + **/ +static int +raptor_turtle_emit_subject_properties(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_turtle_writer *turtle_writer = context->turtle_writer; + int emit_mkr = context->emit_mkr; + int numobj = 2; /* "[" "]" around all object lists (any size) */ + raptor_abbrev_node* last_predicate = NULL; + int rv = 0; + raptor_avltree_iterator* iter = NULL; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject properties", subject->node); + + /* Emit any rdf:_n properties collected */ + if(raptor_sequence_size(subject->list_items) > 0) + rv = raptor_turtle_emit_subject_list_items(serializer, subject, depth+1); + + for((iter = raptor_new_avltree_iterator(subject->properties, NULL, NULL, 1)); + iter && !rv; + (rv = raptor_avltree_iterator_next(iter))) { + raptor_abbrev_node** nodes; + raptor_abbrev_node* predicate; + raptor_abbrev_node* object; + raptor_qname *qname; + + nodes = (raptor_abbrev_node**)raptor_avltree_iterator_get(iter); + if(!nodes) + break; + predicate = nodes[0]; + object = nodes[1]; + numobj = 2; /* = raptor_sequence_size(xxx) if available */ + + if(!last_predicate || + !raptor_abbrev_node_equals(predicate, last_predicate)) { + /* no object list abbreviation possible, terminate last object */ + if(last_predicate) { + if(emit_mkr && !context->resultset) { + if(numobj > 1) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"]", 1); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)", ", 2); + } else { + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ;", 2); + } + raptor_turtle_writer_newline(turtle_writer); + } + + qname = raptor_new_qname_from_namespace_uri(context->nstack, + predicate->term->value.uri, + 10); + + if(raptor_abbrev_node_equals(predicate, context->rdf_type)) { + if(emit_mkr) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"rdf:type", 8); + else + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"a", 1); + } else if(qname) { + raptor_turtle_writer_qname(turtle_writer, qname); + } else { + raptor_turtle_writer_reference(turtle_writer, predicate->term->value.uri); + } + if(emit_mkr) { + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" = ", 3); + if(numobj > 1) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"[", 1); + } else { + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ", 1); + } + + + if(qname) + raptor_free_qname(qname); + } else { /* not last object for this predicate */ + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)", ", 2); + } + + + switch(object->term->type) { + case RAPTOR_TERM_TYPE_URI: + rv = raptor_turtle_emit_resource(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + rv = raptor_turtle_emit_literal(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_BLANK: + rv = raptor_turtle_emit_blank(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, "Triple has unsupported term type %u", + object->term->type); + break; + } + + /* Return error if emitting something failed above */ + if(rv) + return rv; + + last_predicate = predicate; + } + + if(iter) + raptor_free_avltree_iterator(iter); + + return rv; +} + + + +/* + * raptor_mkr_emit_subject_resultset: + * @serializer: #raptor_serializer object + * @subject: subject node + * @depth: depth into tree + * + * Emit rs:ResultSet as CSV relation. + * + * Return value: non-0 on failure + **/ +static int +raptor_mkr_emit_subject_resultset(raptor_serializer* serializer, + raptor_abbrev_subject* subject, + int depth) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_turtle_writer *turtle_writer = context->turtle_writer; + raptor_abbrev_node* last_predicate = NULL; + int rv = 0; + raptor_avltree_iterator* iter = NULL; + int skip_object; + + + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject resultset", subject->node); + + /* Emit any rdf:_n properties collected */ + if(raptor_sequence_size(subject->list_items) > 0) + rv = raptor_turtle_emit_subject_list_items(serializer, subject, depth+1); + + + for((iter = raptor_new_avltree_iterator(subject->properties, NULL, NULL, 1)); + iter && !rv; + (rv = raptor_avltree_iterator_next(iter))) { + raptor_abbrev_node** nodes; + raptor_abbrev_node* predicate; + raptor_abbrev_node* object; + raptor_qname *qname; + + nodes = (raptor_abbrev_node**)raptor_avltree_iterator_get(iter); + if(!nodes) + break; + + predicate = nodes[0]; + object = nodes[1]; + + if(!last_predicate || + !raptor_abbrev_node_equals(predicate, last_predicate)) { + /* first predicate or same predicate as last time */ + + /* no object list abbreviation possible, terminate last object */ + if(last_predicate) { + if(!context->mkr_rs_arity) { + /* last variable in first row */ + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ;", 2); + raptor_turtle_writer_newline(turtle_writer); + context->mkr_rs_ntuple++; /* start count after variables */ + } else if(!context->mkr_rs_nvalue) { + /* size not emitted */ + } else if(context->mkr_rs_processing_value && + (context->mkr_rs_nvalue == context->mkr_rs_arity)) { + /* previous value was last value of row */ + context->mkr_rs_processing_value = 0; + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ;", 2); + raptor_turtle_writer_newline(turtle_writer); + context->mkr_rs_nvalue = 0; + context->mkr_rs_ntuple++; + if(context->mkr_rs_ntuple > context->mkr_rs_size) { + /* previous row was last row of table */ + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"end relation result ;", 21); + raptor_turtle_writer_newline(turtle_writer); + break; + } + } + } + + qname = raptor_new_qname_from_namespace_uri(context->nstack, + predicate->term->value.uri, + 10); + if(raptor_abbrev_node_equals(predicate, context->rdf_type)) { + skip_object = 1; /* all values have been written */ + } else if(qname) { + /* check predicate name */ + if(!strcmp((const char*)qname->local_name, (const char*)"resultVariable")) { + /* emit mKR relation header */ + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"result is relation with format = csv ;", 38); + raptor_turtle_writer_newline(turtle_writer); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"begin relation result ;", 23); + raptor_turtle_writer_decrease_indent(turtle_writer); + raptor_turtle_writer_newline(turtle_writer); + skip_object = 0; + + } else if(!strcmp((const char*)qname->local_name, (const char*)"size")) { + context->mkr_rs_arity = context->mkr_rs_nvalue; + context->mkr_rs_nvalue = 0; + skip_object = 0; + } else if(!strcmp((const char*)qname->local_name, (const char*)"solution")) { + skip_object = 0; /* get values */ + } else if(!strcmp((const char*)qname->local_name, (const char*)"binding")) { + skip_object = 0; /* get values */ + } else if(!strcmp((const char*)qname->local_name, (const char*)"variable")) { + skip_object = 1; + } else if(!strcmp((const char*)qname->local_name, (const char*)"value")) { + context->mkr_rs_processing_value = 1; + context->mkr_rs_nvalue++; + skip_object = 0; + } else { + skip_object = 1; + } + + } else { + /* not qname */ + raptor_turtle_writer_reference(turtle_writer, predicate->term->value.uri); + skip_object = 0; + } /* end predicate */ + + if(qname) + raptor_free_qname(qname); + } else { /* predicate was skipped */ + if(!context->mkr_rs_arity) + /* not last variable */ + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)", ", 2); + } + + if(!skip_object) { + /* do not skip object */ + switch(object->term->type) { + case RAPTOR_TERM_TYPE_URI: + rv = raptor_turtle_emit_resource(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + if(!context->mkr_rs_arity) { + /* variables */ + context->mkr_rs_nvalue++; + raptor_turtle_writer_csv_string(turtle_writer, object->term->value.literal.string); + } else if(!context->mkr_rs_nvalue) { + /* size */ + context->mkr_rs_size = atoi((const char*)object->term->value.literal.string); + } else { + /* values */ + raptor_turtle_writer_csv_string(turtle_writer, object->term->value.literal.string); + if(context->mkr_rs_nvalue < context->mkr_rs_arity) + /* not last value */ + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)", ", 2); + } + break; + + case RAPTOR_TERM_TYPE_BLANK: + rv = raptor_turtle_emit_blank(serializer, object, depth+1); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, + NULL, "Triple has unsupported term type %u", + object->term->type); + break; + } + } /* end object */ + + /* Return error if emitting something failed above */ + if(rv) + return rv; + + last_predicate = predicate; + } /* end iteration i */ + + if(iter) + raptor_free_avltree_iterator(iter); + + return rv; +} + +/* + * raptor_turtle_emit_subject: + * @serializer: #raptor_serializer object + * @subject: subject node + * @depth: depth into tree + * + * Emit a subject node + * + * Return value: non-0 on failure + **/ +static int +raptor_turtle_emit_subject(raptor_serializer *serializer, + raptor_abbrev_subject* subject, + int depth) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_turtle_writer* turtle_writer = context->turtle_writer; + int emit_mkr = context->emit_mkr; + int numobj = 2; + int blank = 1; + int collection = 0; + int rc = 0; + + if(!raptor_abbrev_subject_valid(subject)) return 0; + + RAPTOR_DEBUG_ABBREV_NODE("Emitting subject node", subject->node); + + if(!depth && + subject->node->term->type == RAPTOR_TERM_TYPE_BLANK && + subject->node->count_as_subject == 1 && + subject->node->count_as_object == 1) { + RAPTOR_DEBUG_ABBREV_NODE("Skipping subject node - subj & obj count 1", subject->node); + return 0; + } + + if(raptor_avltree_size(subject->properties) == 0) { + RAPTOR_DEBUG_ABBREV_NODE("Skipping subject node - no props", subject->node); + return 0; + } + + /* check if we can do collection abbreviation */ + if(raptor_avltree_size(subject->properties) >= 2) { + raptor_avltree_iterator* iter = NULL; + raptor_abbrev_node* pred1; + raptor_abbrev_node* pred2; + + iter = raptor_new_avltree_iterator(subject->properties, NULL, NULL, 1); + if(!iter) + return 1; + pred1 = ((raptor_abbrev_node**)raptor_avltree_iterator_get(iter))[0]; + if(raptor_avltree_iterator_next(iter)) { + raptor_free_avltree_iterator(iter); + return 1; + } + pred2 = ((raptor_abbrev_node**)raptor_avltree_iterator_get(iter))[0]; + raptor_free_avltree_iterator(iter); + + if(pred1->term->type == RAPTOR_TERM_TYPE_URI && + pred2->term->type == RAPTOR_TERM_TYPE_URI && + ( + (raptor_uri_equals(pred1->term->value.uri, context->rdf_first_uri) && + raptor_uri_equals(pred2->term->value.uri, context->rdf_rest_uri)) + || + (raptor_uri_equals(pred2->term->value.uri, context->rdf_first_uri) && + raptor_uri_equals(pred1->term->value.uri, context->rdf_rest_uri)) + ) + ) { + collection = 1; + /* check for rs:ResultSet */ + } else if(pred1->term->type == RAPTOR_TERM_TYPE_URI && + raptor_uri_equals(pred1->term->value.uri, context->rs_resultVariable_uri)) { + context->resultset = 1; + } + } + + /* emit the subject node */ + if(subject->node->term->type == RAPTOR_TERM_TYPE_URI) { + if(emit_mkr) { + if(context->resultset && !context->written_begin) { + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"result is ", 10); + rc = raptor_turtle_emit_resource(serializer, subject->node, depth+1); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ;", 2); + raptor_turtle_writer_decrease_indent(turtle_writer); + raptor_turtle_writer_newline(turtle_writer); + } else { + rc = raptor_turtle_emit_resource(serializer, subject->node, depth+1); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" has", 4); + } + } else { + rc = raptor_turtle_emit_resource(serializer, subject->node, depth+1); + } + if(rc) + return rc; + blank = 0; + collection = 0; + + } else if(subject->node->term->type == RAPTOR_TERM_TYPE_BLANK) { + if((subject->node->count_as_subject == 1 && + subject->node->count_as_object == 0) && depth > 1) { + blank = 1; + } else if(subject->node->count_as_object == 0) { + if(emit_mkr) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"{}", 2); + else + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"[]", 2); + blank = 0; + } else if(!collection && subject->node->count_as_object > 1) { + /* Referred to (used as an object), so needs a nodeID */ + if(emit_mkr) { + if(!context->resultset) { + raptor_turtle_writer_bnodeid(turtle_writer, + subject->node->term->value.blank.string, + subject->node->term->value.blank.string_len); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" has", 4); + } + } else { + raptor_turtle_writer_bnodeid(turtle_writer, + subject->node->term->value.blank.string, + subject->node->term->value.blank.string_len); + } + } + } + + if(collection) { + if(!emit_mkr) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"(", 1); + raptor_turtle_writer_increase_indent(turtle_writer); + + rc = raptor_turtle_emit_subject_collection_items(serializer, subject, depth+1); + + raptor_turtle_writer_decrease_indent(turtle_writer); + + if(!emit_mkr) { + raptor_turtle_writer_newline(turtle_writer); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)")", 1); + } + + } else { + if(emit_mkr) { + if(context->resultset) { + /* mKR relation with format = csv */ + if(blank && depth > 1) { + /* skip */ + } + + raptor_mkr_emit_subject_resultset(serializer, subject, depth+1); + + raptor_turtle_writer_decrease_indent(turtle_writer); + + if(blank && depth > 1) { + /* skip */ + } + } else { + /* mKR not relation */ + if(blank && depth > 1) { + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"{ ", 2); + raptor_turtle_writer_newline(turtle_writer); + raptor_turtle_writer_bnodeid(turtle_writer, + subject->node->term->value.blank.string, + subject->node->term->value.blank.string_len); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" has", 4); + } + raptor_turtle_writer_increase_indent(turtle_writer); + raptor_turtle_writer_newline(turtle_writer); + + raptor_turtle_emit_subject_properties(serializer, subject, depth+1); + + raptor_turtle_writer_decrease_indent(turtle_writer); + + if(blank && depth > 1) { + if(numobj > 1) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"]", 1); + raptor_turtle_writer_newline(turtle_writer); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)";}", 2); + } + } + } else { + /* Turtle */ + if(blank && depth > 1) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"[", 1); + + raptor_turtle_writer_increase_indent(turtle_writer); + raptor_turtle_writer_newline(turtle_writer); + + raptor_turtle_emit_subject_properties(serializer, subject, depth+1); + + raptor_turtle_writer_decrease_indent(turtle_writer); + + if(blank && depth > 1) { + raptor_turtle_writer_newline(turtle_writer); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"]", 1); + } + } + } + + if(depth == 0) { + /* NOTE: the space before the . here MUST be there or statements + * that end in a numeric literal will be interpreted incorrectly + * (the "." will be parsed as part of the literal and statement + * left unterminated) + */ + if(emit_mkr) { + if(!context->resultset) { + if(numobj > 1) + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)"]", 1); + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ;", 2); + raptor_turtle_writer_newline(turtle_writer); + raptor_turtle_writer_newline(turtle_writer); + } + context->resultset = 0; + context->written_begin = 0; + } else { + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" .", 2); + raptor_turtle_writer_newline(turtle_writer); + raptor_turtle_writer_newline(turtle_writer); + } + } + + return rc; +} + + +/* + * raptor_turtle_emit: + * @serializer: #raptor_serializer object + * + * Emit Turtle for all stored triples. + * + * Return value: non-0 on failure + **/ +static int +raptor_turtle_emit(raptor_serializer *serializer) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_abbrev_subject* subject; + raptor_abbrev_subject* blank; + int rc; + raptor_avltree_iterator* iter = NULL; + + iter = raptor_new_avltree_iterator(context->subjects, NULL, NULL, 1); + while(iter) { + subject = (raptor_abbrev_subject *)raptor_avltree_iterator_get(iter); + if(subject) { + rc = raptor_turtle_emit_subject(serializer, subject, 0); + if(rc) { + raptor_free_avltree_iterator(iter); + return rc; + } + } + if(raptor_avltree_iterator_next(iter)) break; + } + if(iter) raptor_free_avltree_iterator(iter); + + /* Emit any remaining blank nodes. */ + iter = raptor_new_avltree_iterator(context->blanks, NULL, NULL, 1); + while(iter) { + blank = (raptor_abbrev_subject *)raptor_avltree_iterator_get(iter); + if(blank) { + rc = raptor_turtle_emit_subject(serializer, blank, 0); + if(rc) { + raptor_free_avltree_iterator(iter); + return rc; + } + } + if(raptor_avltree_iterator_next(iter)) break; + } + if(iter) raptor_free_avltree_iterator(iter); + + return 0; +} + + +/* + * raptor serializer Turtle implementation + */ + + +/* create a new serializer */ +static int +raptor_turtle_serialize_init(raptor_serializer* serializer, const char *name) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_uri *rdf_type_uri; + + context->turtle_writer_flags = 0; + if(!strcmp(name,(const char*)"mkr")) { + context->emit_mkr = 1; + context->turtle_writer_flags |= TURTLE_WRITER_FLAG_MKR; + } else + context->emit_mkr = 0; + context->resultset = 0; + context->written_begin = 0; + + context->nstack = raptor_new_namespaces(serializer->world, 1); + if(!context->nstack) + return 1; + context->rdf_nspace = raptor_new_namespace(context->nstack, + (const unsigned char*)"rdf", + (const unsigned char*)raptor_rdf_namespace_uri, + 0); + + context->namespaces = raptor_new_sequence(NULL, NULL); + + context->subjects = + raptor_new_avltree((raptor_data_compare_handler)raptor_abbrev_subject_compare, + (raptor_data_free_handler)raptor_free_abbrev_subject, 0); + + context->blanks = + raptor_new_avltree((raptor_data_compare_handler)raptor_abbrev_subject_compare, + (raptor_data_free_handler)raptor_free_abbrev_subject, 0); + + context->nodes = + raptor_new_avltree((raptor_data_compare_handler)raptor_abbrev_node_compare, + (raptor_data_free_handler)raptor_free_abbrev_node, 0); + + rdf_type_uri = raptor_new_uri_for_rdf_concept(serializer->world, + (const unsigned char*)"type"); + if(rdf_type_uri) { + raptor_term* uri_term; + uri_term = raptor_new_term_from_uri(serializer->world, + rdf_type_uri); + raptor_free_uri(rdf_type_uri); + context->rdf_type = raptor_new_abbrev_node(serializer->world, uri_term); + raptor_free_term(uri_term); + } else + context->rdf_type = NULL; + + context->rdf_xml_literal_uri = raptor_new_uri(serializer->world, raptor_xml_literal_datatype_uri_string); + context->rdf_first_uri = raptor_new_uri(serializer->world, (const unsigned char*)"http://www.w3.org/1999/02/22-rdf-syntax-ns#first"); + context->rdf_rest_uri = raptor_new_uri(serializer->world, (const unsigned char*)"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"); + context->rdf_nil_uri = raptor_new_uri(serializer->world, (const unsigned char*)"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"); + + context->rs_ResultSet_uri = raptor_new_uri(serializer->world, (const unsigned char*)"http://jena.hpl.hp.com/2003/03/result-set#ResultSet"); + context->rs_resultVariable_uri = raptor_new_uri(serializer->world, (const unsigned char*)"http://jena.hpl.hp.com/2003/03/result-set#resultVariable"); + + if(!context->rdf_nspace || !context->namespaces || + !context->subjects || !context->blanks || !context->nodes || + !context->rdf_xml_literal_uri || !context->rdf_first_uri || + !context->rdf_rest_uri || !context->rdf_nil_uri || !context->rdf_type || + !context->rs_ResultSet_uri || !context->rs_resultVariable_uri) + { + raptor_turtle_serialize_terminate(serializer); + return 1; + } + + /* Note: item 0 in the list is rdf:RDF's namespace */ + if(raptor_sequence_push(context->namespaces, context->rdf_nspace)) { + raptor_turtle_serialize_terminate(serializer); + return 1; + } + + return 0; +} + + +/* destroy a serializer */ +static void +raptor_turtle_serialize_terminate(raptor_serializer* serializer) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + + if(context->turtle_writer) { + raptor_free_turtle_writer(context->turtle_writer); + context->turtle_writer = NULL; + } + + if(context->rdf_nspace) { + raptor_free_namespace(context->rdf_nspace); + context->rdf_nspace = NULL; + } + + if(context->namespaces) { + int i; + + /* Note: item 0 in the list is rdf:RDF's namespace and freed above */ + for(i = 1; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns; + ns =(raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + if(ns) + raptor_free_namespace(ns); + } + raptor_free_sequence(context->namespaces); + context->namespaces = NULL; + } + + if(context->subjects) { + raptor_free_avltree(context->subjects); + context->subjects = NULL; + } + + if(context->blanks) { + raptor_free_avltree(context->blanks); + context->blanks = NULL; + } + + if(context->nodes) { + raptor_free_avltree(context->nodes); + context->nodes = NULL; + } + + if(context->nstack) { + raptor_free_namespaces(context->nstack); + context->nstack = NULL; + } + + if(context->rdf_type) { + raptor_free_abbrev_node(context->rdf_type); + context->rdf_type = NULL; + } + + if(context->rdf_xml_literal_uri) { + raptor_free_uri(context->rdf_xml_literal_uri); + context->rdf_xml_literal_uri = NULL; + } + + if(context->rdf_first_uri) { + raptor_free_uri(context->rdf_first_uri); + context->rdf_first_uri = NULL; + } + + if(context->rdf_rest_uri) { + raptor_free_uri(context->rdf_rest_uri); + context->rdf_rest_uri = NULL; + } + + if(context->rdf_nil_uri) { + raptor_free_uri(context->rdf_nil_uri); + context->rdf_nil_uri = NULL; + } + + if(context->rs_ResultSet_uri) { + raptor_free_uri(context->rs_ResultSet_uri); + context->rs_ResultSet_uri = NULL; + } + + if(context->rs_resultVariable_uri) { + raptor_free_uri(context->rs_resultVariable_uri); + context->rs_resultVariable_uri = NULL; + } +} + + +#define TURTLE_NAMESPACE_DEPTH 0 + +/* add a namespace */ +static int +raptor_turtle_serialize_declare_namespace_from_namespace(raptor_serializer* serializer, + raptor_namespace *nspace) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + int i; + + if(context->written_header) + return 1; + + for(i = 0; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns; + ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + + /* If prefix is already declared, ignore it */ + if(!ns->prefix && !nspace->prefix) + return 1; + + if(ns->prefix && nspace->prefix && + !strcmp((const char*)ns->prefix, (const char*)nspace->prefix)) + return 1; + + if(ns->uri && nspace->uri && + raptor_uri_equals(ns->uri, nspace->uri)) + return 1; + } + + nspace = raptor_new_namespace_from_uri(context->nstack, + nspace->prefix, nspace->uri, + TURTLE_NAMESPACE_DEPTH); + if(!nspace) + return 1; + + raptor_sequence_push(context->namespaces, nspace); + return 0; +} + + +/* add a namespace */ +static int +raptor_turtle_serialize_declare_namespace(raptor_serializer* serializer, + raptor_uri *uri, + const unsigned char *prefix) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_namespace *ns; + int rc; + + ns = raptor_new_namespace_from_uri(context->nstack, prefix, uri, + TURTLE_NAMESPACE_DEPTH); + + rc = raptor_turtle_serialize_declare_namespace_from_namespace(serializer, ns); + raptor_free_namespace(ns); + + return rc; +} + + +/* start a serialize */ +static int +raptor_turtle_serialize_start(raptor_serializer* serializer) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_turtle_writer* turtle_writer; + int flag; + + if(context->turtle_writer) + raptor_free_turtle_writer(context->turtle_writer); + + flag = RAPTOR_OPTIONS_GET_NUMERIC(serializer, RAPTOR_OPTION_WRITE_BASE_URI); + turtle_writer = raptor_new_turtle_writer(serializer->world, + serializer->base_uri, + flag, + context->nstack, + serializer->iostream, + context->turtle_writer_flags); + if(!turtle_writer) + return 1; + + raptor_turtle_writer_set_option(turtle_writer, + RAPTOR_OPTION_WRITER_AUTO_INDENT, 1); + raptor_turtle_writer_set_option(turtle_writer, + RAPTOR_OPTION_WRITER_INDENT_WIDTH, 2); + + context->turtle_writer = turtle_writer; + + return 0; +} + +static void +raptor_turtle_ensure_writen_header(raptor_serializer* serializer, + raptor_turtle_context* context) +{ + int i; + raptor_turtle_writer* turtle_writer = context->turtle_writer; + + if(context->written_header) + return; + + if(!context->turtle_writer) + return; + + for(i = 0; i< raptor_sequence_size(context->namespaces); i++) { + raptor_namespace* ns; + ns = (raptor_namespace*)raptor_sequence_get_at(context->namespaces, i); + raptor_turtle_writer_namespace_prefix(turtle_writer, ns); + raptor_namespace_stack_start_namespace(context->nstack, ns, 0); + } + + raptor_turtle_writer_newline(context->turtle_writer); + + context->written_header = 1; +} + +/* serialize a statement */ +static int +raptor_turtle_serialize_statement(raptor_serializer* serializer, + raptor_statement *statement) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + raptor_abbrev_subject* subject = NULL; + raptor_abbrev_node* predicate = NULL; + raptor_abbrev_node* object = NULL; + int rv; + raptor_term_type object_type; + + if(!(statement->subject->type == RAPTOR_TERM_TYPE_URI || + statement->subject->type == RAPTOR_TERM_TYPE_BLANK)) { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Do not know how to serialize node type %u", + statement->subject->type); + return 1; + } + + subject = raptor_abbrev_subject_lookup(context->nodes, context->subjects, + context->blanks, + statement->subject); + if(!subject) { + return 1; + } + + object_type = statement->object->type; + + if(!(object_type == RAPTOR_TERM_TYPE_URI || + object_type == RAPTOR_TERM_TYPE_BLANK || + object_type == RAPTOR_TERM_TYPE_LITERAL)) { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot serialize a triple with object node type %u", + object_type); + return 1; + } + + object = raptor_abbrev_node_lookup(context->nodes, statement->object); + if(!object) + return 1; + + + if(statement->predicate->type == RAPTOR_TERM_TYPE_URI) { + predicate = raptor_abbrev_node_lookup(context->nodes, statement->predicate); + if(!predicate) + return 1; + + rv = raptor_abbrev_subject_add_property(subject, predicate, object); + if(rv < 0) { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Unable to add properties to subject %p", + RAPTOR_VOIDP(subject)); + return rv; + } + + } else { + raptor_log_error_formatted(serializer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Do not know how to serialize node type %u", + statement->predicate->type); + return 1; + } + + if(object_type == RAPTOR_TERM_TYPE_URI || + object_type == RAPTOR_TERM_TYPE_BLANK) + object->count_as_object++; + + return 0; +} + + +/* end a serialize */ +static int +raptor_turtle_serialize_end(raptor_serializer* serializer) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + + raptor_turtle_ensure_writen_header(serializer, context); + + raptor_turtle_emit(serializer); + + /* reset serializer for reuse */ + context->written_header = 0; + + return 0; +} + +/* flush turtle */ +static int +raptor_turtle_serialize_flush(raptor_serializer* serializer) +{ + raptor_turtle_context* context = (raptor_turtle_context*)serializer->context; + + raptor_turtle_ensure_writen_header(serializer, context); + + raptor_turtle_emit(serializer); + + if(context->subjects) { + raptor_avltree_trim(context->subjects); + } + + if(context->blanks) { + raptor_avltree_trim(context->blanks); + } + + if(context->nodes) { + raptor_avltree_trim(context->nodes); + } + + return 0; +} + + +/* finish the serializer factory */ +static void +raptor_turtle_serialize_finish_factory(raptor_serializer_factory* factory) +{ + /* NOP */ +} + + +static const char* const turtle_names[2] = { "turtle", NULL}; +static const char* const mkr_names[2] = { "mkr", NULL}; + +static const char* const turtle_uri_strings[3] = { + "http://www.w3.org/ns/formats/Turtle", + "http://www.dajobe.org/2004/01/turtle/", + NULL +}; + +#define TURTLE_TYPES_COUNT 6 +static const raptor_type_q turtle_types[TURTLE_TYPES_COUNT + 1] = { + { "text/turtle", 11, 10}, + { "application/turtle", 18, 10}, + { "application/x-turtle", 20, 8}, + { "text/n3", 7, 3}, + { "text/rdf+n3", 11, 3}, + { "application/rdf+n3", 18, 3}, + { NULL, 0, 0} +}; +#define MKR_TYPES_COUNT 6 +static const raptor_type_q mkr_types[TURTLE_TYPES_COUNT + 1] = { + { "text/mkr", 8, 10}, + { "application/mkr", 15, 10}, + { "application/x-mkr", 17, 8}, + { "text/n3", 7, 3}, + { "text/rdf+n3", 11, 3}, + { "application/rdf+n3", 18, 3}, + { NULL, 0, 0} +}; + +static int +raptor_turtle_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = turtle_names; + factory->desc.mime_types = turtle_types; + + factory->desc.label = "Turtle Terse RDF Triple Language"; + factory->desc.uri_strings = turtle_uri_strings; + + factory->context_length = sizeof(raptor_turtle_context); + + factory->init = raptor_turtle_serialize_init; + factory->terminate = raptor_turtle_serialize_terminate; + factory->declare_namespace = raptor_turtle_serialize_declare_namespace; + factory->declare_namespace_from_namespace = raptor_turtle_serialize_declare_namespace_from_namespace; + factory->serialize_start = raptor_turtle_serialize_start; + factory->serialize_statement = raptor_turtle_serialize_statement; + factory->serialize_end = raptor_turtle_serialize_end; + factory->serialize_flush = raptor_turtle_serialize_flush; + factory->finish_factory = raptor_turtle_serialize_finish_factory; + + return 0; +} + +static int +raptor_mkr_serializer_register_factory(raptor_serializer_factory *factory) +{ + factory->desc.names = mkr_names; + factory->desc.mime_types = mkr_types; + + factory->desc.label = "mKR my Knowledge Representation Language"; + factory->desc.uri_strings = turtle_uri_strings; + + factory->context_length = sizeof(raptor_turtle_context); + + factory->init = raptor_turtle_serialize_init; + factory->terminate = raptor_turtle_serialize_terminate; + factory->declare_namespace = raptor_turtle_serialize_declare_namespace; + factory->declare_namespace_from_namespace = raptor_turtle_serialize_declare_namespace_from_namespace; + factory->serialize_start = raptor_turtle_serialize_start; + factory->serialize_statement = raptor_turtle_serialize_statement; + factory->serialize_end = raptor_turtle_serialize_end; + factory->finish_factory = raptor_turtle_serialize_finish_factory; + + return 0; +} + +int +raptor_init_serializer_turtle(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_turtle_serializer_register_factory); +} + +int +raptor_init_serializer_mkr(raptor_world* world) +{ + return !raptor_serializer_register_factory(world, + &raptor_mkr_serializer_register_factory); +} + + + +/** + * raptor_uri_turtle_write: + * @world: world + * @iostr: iostream for writing + * @uri: uri + * @nstack: namespace stack + * @base_uri: base URI + * + * Write #raptor_uri to a stream in turtle syntax (using QNames). + * + * Note: This creates and destroys several internal objects for each + * call so for more efficient writing, create a turtle serializer. + * + * Return value: non-0 on failure + */ +int +raptor_uri_turtle_write(raptor_world *world, + raptor_iostream* iostr, + raptor_uri* uri, + raptor_namespace_stack *nstack, + raptor_uri *base_uri) +{ + int rc; + raptor_turtle_writer* turtle_writer; + + turtle_writer = raptor_new_turtle_writer(world, base_uri, 0, nstack, iostr, 0); + if(!turtle_writer) + return 1; + + rc = raptor_turtle_writer_uri(turtle_writer, uri); + + raptor_free_turtle_writer(turtle_writer); + + return rc; +} + + + +/** + * raptor_term_turtle_write: + * @iostr: iostream for writing + * @term: term + * @nstack: namespace stack + * @base_uri: base URI + * + * Write #raptor_term to a stream in turtle syntax (using QNames). + * + * Note: This creates and destroys several internal objects for each + * call so for more efficient writing, create a turtle serializer. + * + * Return value: non-0 on failure + */ +int +raptor_term_turtle_write(raptor_iostream* iostr, + raptor_term* term, + raptor_namespace_stack *nstack, + raptor_uri *base_uri) +{ + int rc; + raptor_turtle_writer* turtle_writer; + + turtle_writer = raptor_new_turtle_writer(term->world, base_uri, 0, nstack, + iostr, 0); + if(!turtle_writer) + return 1; + + rc = raptor_turtle_writer_term(turtle_writer, term); + + raptor_free_turtle_writer(turtle_writer); + + return rc; +} + + + +/** + * raptor_uri_to_turtle_counted_string: + * @world: world + * @uri: uri + * @nstack: namespace stack + * @base_uri: base URI + * @len_p: Pointer to location to store length of new string (if not NULL) + * + * Convert #raptor_uri to a string. + * Caller has responsibility to free the string. + * + * Note: This creates and destroys several internal objects for each + * call so for more efficient writing, create a turtle serializer. + * + * Return value: the new string or NULL on failure. The length of + * the new string is returned in *@len_p if len_p is not NULL. + */ +unsigned char* +raptor_uri_to_turtle_counted_string(raptor_world *world, + raptor_uri* uri, + raptor_namespace_stack *nstack, + raptor_uri *base_uri, + size_t *len_p) +{ + int rc = 1; + raptor_iostream* iostr; + unsigned char *s = NULL; + raptor_turtle_writer* turtle_writer; + + iostr = raptor_new_iostream_to_string(world, + (void**)&s, len_p, malloc); + if(!iostr) + return NULL; + + turtle_writer = raptor_new_turtle_writer(world, base_uri, 0, nstack, iostr, 0); + if(!turtle_writer) + goto tidy; + + rc = raptor_turtle_writer_uri(turtle_writer, uri); + + raptor_free_turtle_writer(turtle_writer); + + tidy: + raptor_free_iostream(iostr); + + if(rc) { + free(s); + s = NULL; + } + + return s; +} + +/** + * raptor_uri_to_turtle_string: + * @world: world + * @uri: uri + * @nstack: namespace stack + * @base_uri: base URI + * + * Convert #raptor_uri to a string. + * Caller has responsibility to free the string. + * + * Note: This creates and destroys several internal objects for each + * call so for more efficient writing, create a turtle serializer. + * + * Return value: the new string or NULL on failure. + */ +unsigned char* +raptor_uri_to_turtle_string(raptor_world *world, + raptor_uri* uri, + raptor_namespace_stack *nstack, + raptor_uri *base_uri) +{ + return raptor_uri_to_turtle_counted_string(world, uri, nstack, base_uri, NULL); +} + + + +/** + * raptor_term_to_turtle_counted_string: + * @term: term + * @nstack: namespace stack + * @base_uri: base URI + * @len_p: Pointer to location to store length of new string (if not NULL) + * + * Convert #raptor_term to a string. + * Caller has responsibility to free the string. + * + * Note: This creates and destroys several internal objects for each + * call so for more efficient writing, create a turtle serializer. + * + * See also raptor_term_to_counted_string() which writes in simpler + * N-Triples with no Turtle abbreviated forms, and is quicker. + * + * Return value: the new string or NULL on failure. The length of + * the new string is returned in *@len_p if len_p is not NULL. + */ +unsigned char* +raptor_term_to_turtle_counted_string(raptor_term* term, + raptor_namespace_stack *nstack, + raptor_uri *base_uri, + size_t *len_p) +{ + int rc; + raptor_iostream* iostr; + unsigned char *s; + iostr = raptor_new_iostream_to_string(term->world, + (void**)&s, len_p, malloc); + if(!iostr) + return NULL; + + rc = raptor_term_turtle_write(iostr, term, nstack, base_uri); + + raptor_free_iostream(iostr); + if(rc) { + free(s); + s = NULL; + } + + return s; +} + +/** + * raptor_term_to_turtle_string: + * @term: term + * @nstack: namespace stack + * @base_uri: base URI + * + * Convert #raptor_term to a string. + * Caller has responsibility to free the string. + * + * See also raptor_term_to_counted_string() which writes in simpler + * N-Triples with no Turtle abbreviated forms, and is quicker. + * + * Return value: the new string or NULL on failure. + */ +unsigned char* +raptor_term_to_turtle_string(raptor_term* term, + raptor_namespace_stack *nstack, + raptor_uri *base_uri) +{ + return raptor_term_to_turtle_counted_string(term, nstack, base_uri, NULL); +} + diff --git a/src/raptor_set.c b/src/raptor_set.c new file mode 100644 index 0000000..334416c --- /dev/null +++ b/src/raptor_set.c @@ -0,0 +1,329 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_set.c - Sets for checking IDs + * + * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <stdarg.h> +#include <sys/types.h> + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> /* for abort() as used in errors */ +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifndef STANDALONE + +/* + * The only methods needed here are: + * Create Set + * Destroy Set + * Check a (base, ID) pair present add it if not, return if added/not + * + */ + +struct raptor_base_id_set_s +{ + raptor_world* world; + + /* The base URI of this set of IDs */ + raptor_uri *uri; + + /* neighbour ID sets */ + struct raptor_base_id_set_s* prev; + struct raptor_base_id_set_s* next; + + /* binary tree */ + raptor_avltree* tree; +}; +typedef struct raptor_base_id_set_s raptor_base_id_set; + + +struct raptor_id_set_s +{ + raptor_world* world; + + /* start of trees, 1 per base URI */ + struct raptor_base_id_set_s* first; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + int hits; + int misses; +#endif +}; + + +/* functions implementing the ID set api */ + +/** + * raptor_new_id_set: + * @world: raptor_world object + * + * INTERNAL - Constructor - create a new ID set. + * + * Return value: non 0 on failure + **/ +raptor_id_set* +raptor_new_id_set(raptor_world* world) +{ + raptor_id_set* set = RAPTOR_CALLOC(raptor_id_set*, 1, sizeof(*set)); + if(!set) + return NULL; + + set->world = world; + + return set; +} + + +/** + * raptor_free_base_id_set: + * @set: #raptor_base_id_set + * + * INTERNAL - Destructor - Free a Base ID Set. + * + **/ +static void +raptor_free_base_id_set(raptor_base_id_set *base) +{ + if(base->tree) + raptor_free_avltree(base->tree); + if(base->uri) + raptor_free_uri(base->uri); + RAPTOR_FREE(raptor_base_id_set, base); +} + + +/** + * raptor_free_id_set: + * @set: #raptor_id_set + * + * INTERNAL - Destructor - Free ID Set. + * + **/ +void +raptor_free_id_set(raptor_id_set *set) +{ + raptor_base_id_set *base; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(set, raptor_id_set); + + base = set->first; + while(base) { + raptor_base_id_set *next = base->next; + raptor_free_base_id_set(base); + base = next; + } + RAPTOR_FREE(raptor_id_set, set); +} + + + +/** + * raptor_id_set_add: + * @set: #raptor_id_set + * @base_uri: base #raptor_uri of identifier + * @id: identifier name + * @id_len: length of identifier + * + * INTERNAL - Add an item to the set. + * + * Return value: <0 on failure, 0 on success, 1 if already present + **/ +int +raptor_id_set_add(raptor_id_set* set, raptor_uri *base_uri, + const unsigned char *id, size_t id_len) +{ + raptor_base_id_set *base; + char* item; + + if(!base_uri || !id || !id_len) + return -1; + + base = set->first; + while(base) { + if(raptor_uri_equals(base->uri, base_uri)) + break; + base = base->next; + } + + if(!base) { + /* a set for this base_uri not found */ + base = RAPTOR_CALLOC(raptor_base_id_set*, 1, sizeof(*base)); + if(!base) + return -1; + + base->world = set->world; + + base->uri = raptor_uri_copy(base_uri); + + base->tree = raptor_new_avltree((raptor_data_compare_handler)strcmp, + free, 0); + + /* Add to the start of the list */ + if(set->first) + set->first->prev = base; + /* base->prev = NULL; */ + base->next = set->first; + + set->first = base; + } else { + /* If not at the start of the list, move there */ + if(base != set->first) { + /* remove from the list */ + base->prev->next = base->next; + if(base->next) + base->next->prev = base->prev; + /* add at the start of the list */ + set->first->prev = base; + base->prev = NULL; + base->next = set->first; + } + } + + item = (char*)raptor_avltree_search(base->tree, id); + + /* if already there, error */ + if(item) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + set->misses++; +#endif + return 1; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + set->hits++; +#endif + + item = RAPTOR_MALLOC(char*, id_len + 1); + if(!item) + return 1; + + memcpy(item, id, id_len + 1); + + return raptor_avltree_add(base->tree, item); +} + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 +void +raptor_id_set_stats_print(raptor_id_set* set, FILE *stream) { + fprintf(stream, "set hits: %d misses: %d\n", set->hits, set->misses); +} +#endif + +#endif + + +#ifdef STANDALONE + +/* one more prototype */ +int main(int argc, char *argv[]); + + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *program = raptor_basename(argv[0]); + const char *items[8] = { "ron", "amy", "jen", "bij", "jib", "daj", "jim", NULL }; + raptor_id_set *set; + raptor_uri *base_uri; + int i = 0; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + base_uri = raptor_new_uri(world, (const unsigned char*)"http://example.org/base#"); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Creating set\n", program); +#endif + + set = raptor_new_id_set(world); + if(!set) { + fprintf(stderr, "%s: Failed to create set\n", program); + exit(1); + } + + for(i = 0; items[i]; i++) { + size_t len = strlen(items[i]); + int rc; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Adding set item '%s'\n", program, items[i]); +#endif + + rc = raptor_id_set_add(set, base_uri, (const unsigned char*)items[i], len); +if(rc) { + fprintf(stderr, "%s: Adding set item %d '%s' failed, returning error %d\n", + program, i, items[i], rc); + exit(1); + } + } + + for(i = 0; items[i]; i++) { + size_t len = strlen(items[i]); + int rc; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Adding duplicate set item '%s'\n", program, items[i]); +#endif + + rc = raptor_id_set_add(set, base_uri, (const unsigned char*)items[i], len); + if(rc <= 0) { + fprintf(stderr, "%s: Adding duplicate set item %d '%s' succeeded, should have failed, returning error %d\n", + program, i, items[i], rc); + exit(1); + } + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + raptor_id_set_stats_print(set, stderr); +#endif + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Freeing set\n", program); +#endif + raptor_free_id_set(set); + + raptor_free_uri(base_uri); + + raptor_free_world(world); + + /* keep gcc -Wall happy */ + return(0); +} + +#endif diff --git a/src/raptor_statement.c b/src/raptor_statement.c new file mode 100644 index 0000000..52317bc --- /dev/null +++ b/src/raptor_statement.c @@ -0,0 +1,424 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_statement.c - Raptor statements + * + * Copyright (C) 2008-2010, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +/* for ptrdiff_t */ +#ifdef HAVE_STDDEF_H +#include <stddef.h> +#endif +#include <stdarg.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* prototypes for helper functions */ + + +/** + * raptor_new_statement: + * @world: raptor world + * + * Constructor - create a new #raptor_statement. + * + * Return value: new raptor statement or NULL on failure + */ +raptor_statement* +raptor_new_statement(raptor_world *world) +{ + raptor_statement* statement; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + statement = RAPTOR_CALLOC(raptor_statement*, 1, sizeof(*statement)); + if(!statement) + return NULL; + + statement->world = world; + /* dynamic - usage counted */ + statement->usage = 1; + + return statement; +} + + +/** + * raptor_new_statement_from_nodes: + * @world: raptor world + * @subject: subject term (or NULL) + * @predicate: predicate term (or NULL) + * @object: object term (or NULL) + * @graph: graph name term (or NULL) + * + * Constructor - create a new #raptor_statement from a set of terms + * + * The @subject, @predicate, @object and @graph become owned by the statement. + * + * Return value: new raptor statement or NULL on failure + */ +raptor_statement* +raptor_new_statement_from_nodes(raptor_world* world, raptor_term *subject, + raptor_term *predicate, raptor_term *object, + raptor_term *graph) +{ + raptor_statement* t; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + t = raptor_new_statement(world); + if(!t) { + if(subject) + raptor_free_term(subject); + if(predicate) + raptor_free_term(predicate); + if(object) + raptor_free_term(object); + if(graph) + raptor_free_term(graph); + return NULL; + } + + t->subject = subject; + t->predicate = predicate; + t->object = object; + t->graph = graph; + + return t; +} + + +/** + * raptor_statement_init: + * @statement: statement to initialize + * @world: raptor world + * + * Initialize a static #raptor_statement. + * + */ +void +raptor_statement_init(raptor_statement *statement, raptor_world *world) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(world, raptor_world); + RAPTOR_ASSERT_OBJECT_POINTER_RETURN(statement, raptor_statement); + + /* ensure all fields are set to NULL to start with */ + memset(statement, 0, sizeof(*statement)); + + statement->world = world; + + /* static - not usage counted */ + statement->usage = -1; +} + + +/** + * raptor_statement_copy: + * @statement: statement to copy + * + * Copy a #raptor_statement. + * + * Return value: a new #raptor_statement or NULL on error + */ +raptor_statement* +raptor_statement_copy(raptor_statement *statement) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, raptor_statement, NULL); + + /* static - not usage counted */ + if(statement->usage < 0) { + raptor_statement* s2; + /* s2 will be a dynamic, usage->counted statement */ + s2 = raptor_new_statement(statement->world); + if(!s2) + return NULL; + + s2->world = statement->world; + if(statement->subject) + s2->subject = raptor_term_copy(statement->subject); + if(statement->predicate) + s2->predicate = raptor_term_copy(statement->predicate); + if(statement->object) + s2->object = raptor_term_copy(statement->object); + if(statement->graph) + s2->graph = raptor_term_copy(statement->graph); + + return s2; + } + + statement->usage++; + + return statement; +} + + +/** + * raptor_statement_clear: + * @statement: #raptor_statement object + * + * Empty a raptor_statement of terms. + * + **/ +void +raptor_statement_clear(raptor_statement *statement) +{ + if(!statement) + return; + + /* raptor_free_term() does a NULL check */ + + raptor_free_term(statement->subject); + statement->subject = NULL; + + raptor_free_term(statement->predicate); + statement->predicate = NULL; + + raptor_free_term(statement->object); + statement->object = NULL; + + raptor_free_term(statement->graph); + statement->graph = NULL; +} + + +/** + * raptor_free_statement: + * @statement: statement + * + * Destructor + * + */ +void +raptor_free_statement(raptor_statement *statement) +{ + /* dynamically or statically allocated? */ + int is_dynamic; + + if(!statement) + return; + + is_dynamic = (statement->usage >= 0); + + /* dynamically allocated and still in use? */ + if(is_dynamic && --statement->usage) + return; + + raptor_statement_clear(statement); + + if(is_dynamic) + RAPTOR_FREE(raptor_statement, statement); +} + + +/** + * raptor_statement_print: + * @statement: #raptor_statement object to print + * @stream: FILE* stream + * + * Print a raptor_statement to a stream. + * + * Return value: non-0 on failure + **/ +int +raptor_statement_print(const raptor_statement * statement, FILE *stream) +{ + int rc = 0; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, raptor_statement, 1); + + fputc('[', stream); + + if(!statement->subject) { + fputs("NULL", stream); + } else { + if(statement->subject->type == RAPTOR_TERM_TYPE_BLANK) + fputs((const char*)statement->subject->value.blank.string, stream); + else + raptor_uri_print(statement->subject->value.uri, stream); + } + + fputs(", ", stream); + + if(statement->predicate) + raptor_uri_print(statement->predicate->value.uri, stream); + else + fputs("NULL", stream); + + fputs(", ", stream); + + if(!statement->object) { + fputs("NULL", stream); + } else { + if(statement->object->type == RAPTOR_TERM_TYPE_LITERAL) { + if(statement->object->value.literal.datatype) { + raptor_uri* dt_uri = statement->object->value.literal.datatype; + fputc('<', stream); + fputs((const char*)raptor_uri_as_string(dt_uri), stream); + fputc('>', stream); + } + fputc('"', stream); + fputs((const char*)statement->object->value.literal.string, stream); + fputc('"', stream); + } else if(statement->object->type == RAPTOR_TERM_TYPE_BLANK) + fputs((const char*)statement->object->value.blank.string, stream); + else { + raptor_uri_print(statement->object->value.uri, stream); + } + } + + if(statement->graph) { + if(statement->graph->type == RAPTOR_TERM_TYPE_BLANK && + statement->graph->value.blank.string) { + fputs(", ", stream); + + fputs((const char*)statement->graph->value.blank.string, stream); + } else if(statement->graph->type == RAPTOR_TERM_TYPE_URI && + statement->graph->value.uri) { + fputs(", ", stream); + raptor_uri_print(statement->graph->value.uri, stream); + } + } + + fputc(']', stream); + + return rc; +} + + +/** + * raptor_statement_print_as_ntriples: + * @statement: #raptor_statement to print + * @stream: FILE* stream + * + * Print a raptor_statement in N-Triples form. + * + * Return value: non-0 on failure + **/ +int +raptor_statement_print_as_ntriples(const raptor_statement * statement, + FILE *stream) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(statement, raptor_statement, 1); + + if(raptor_term_print_as_ntriples(statement->subject, stream)) + return 1; + + fputc(' ', stream); + if(raptor_term_print_as_ntriples(statement->predicate, stream)) + return 1; + + fputc(' ', stream); + if(raptor_term_print_as_ntriples(statement->object, stream)) + return 1; + + fputs(" .", stream); + + return 0; +} + + +/** + * raptor_statement_compare: + * @s1: first statement + * @s2: second statement + * + * Compare a pair of #raptor_statement + * + * Uses raptor_term_compare() to check ordering between subjects, + * predicates and objects of statements. + * + * Return value: <0 if s1 is before s2, 0 if equal, >0 if s1 is after s2 + */ +int +raptor_statement_compare(const raptor_statement *s1, + const raptor_statement *s2) +{ + int d = 0; + + if(!s1 || !s2) { + /* If one or both are NULL, return a stable comparison order */ + ptrdiff_t pd = (s2 - s1); + + /* copy the sign of the (unknown size) signed integer 'd' into an + * int result + */ + return (pd > 0) - (pd < 0); + } + + d = raptor_term_compare(s1->subject, s2->subject); + if(d) + return d; + + /* predicates are URIs */ + d = raptor_term_compare(s1->predicate, s2->predicate); + if(d) + return d; + + /* objects are URIs or blank nodes or literals */ + d = raptor_term_compare(s1->object, s2->object); + if(d) + return d; + + /* graphs are URIs or blank nodes */ + d = raptor_term_compare(s1->graph, s2->graph); + + return d; +} + + +/** + * raptor_statement_equals: + * @s1: first statement + * @s2: second statement + * + * Compare a pair of #raptor_statement for equality + * + * Return value: non-0 if statements are equal + */ +int +raptor_statement_equals(const raptor_statement* s1, const raptor_statement* s2) +{ + if(!s1 || !s2) + return 0; + + if(!raptor_term_equals(s1->subject, s2->subject)) + return 0; + + if(!raptor_term_equals(s1->predicate, s2->predicate)) + return 0; + + if(!raptor_term_equals(s1->object, s2->object)) + return 0; + + return 1; +} diff --git a/src/raptor_stringbuffer.c b/src/raptor_stringbuffer.c new file mode 100644 index 0000000..03223c3 --- /dev/null +++ b/src/raptor_stringbuffer.c @@ -0,0 +1,902 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_stringbuffer.c - Stringbuffer class for growing strings + * + * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <stdarg.h> +#include <sys/types.h> + +#ifdef HAVE_STDLIB_H +#include <stdlib.h> /* for abort() as used in errors */ +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifndef STANDALONE + +struct raptor_stringbuffer_node_s +{ + struct raptor_stringbuffer_node_s* next; + unsigned char *string; + size_t length; +}; +typedef struct raptor_stringbuffer_node_s raptor_stringbuffer_node; + + +struct raptor_stringbuffer_s +{ + /* Pointing to the first item in the list of nodes */ + raptor_stringbuffer_node* head; + /* and the last */ + raptor_stringbuffer_node* tail; + + /* total length of the string */ + size_t length; + + /* frozen string if already calculated, or NULL if not present */ + unsigned char *string; +}; + + +/* prototypes for local functions */ +static int raptor_stringbuffer_append_string_common(raptor_stringbuffer* stringbuffer, const unsigned char *string, size_t length, int do_copy); + + +/* functions implementing the stringbuffer api */ + +/** + * raptor_new_stringbuffer: + * + * Create a new stringbuffer. + * + * Return value: pointer to a raptor_stringbuffer object or NULL on failure + **/ +raptor_stringbuffer* +raptor_new_stringbuffer(void) +{ + raptor_stringbuffer* sb; + + sb = RAPTOR_CALLOC(raptor_stringbuffer*, 1, sizeof(*sb)); + return sb; +} + + +/** + * raptor_free_stringbuffer: + * @stringbuffer: stringbuffer object to destroy. + * + * Destroy a stringbuffer. + * + **/ +void +raptor_free_stringbuffer(raptor_stringbuffer *stringbuffer) +{ + if(!stringbuffer) + return; + + if(stringbuffer->head) { + raptor_stringbuffer_node *node = stringbuffer->head; + + while(node) { + raptor_stringbuffer_node *next = node->next; + + if(node->string) + RAPTOR_FREE(char*, node->string); + RAPTOR_FREE(raptor_stringbuffer_node, node); + node = next; + } + } + + if(stringbuffer->string) + RAPTOR_FREE(char*, stringbuffer->string); + + RAPTOR_FREE(raptor_stringbuffer, stringbuffer); +} + + + +/** + * raptor_stringbuffer_append_string_common: + * @stringbuffer: raptor stringbuffer + * @string: string + * @length: length of string + * @do_copy: non-0 to copy the string + * + * Add a string to the stringbuffer. + * + * INTERNAL + * + * If @string is NULL or @length is 0, no work is performed. + * + * If @do_copy is non-0, the passed-in string is copied into new memory + * otherwise the stringbuffer becomes the owner of the string pointer + * and will free it when the stringbuffer is destroyed. + * + * Return value: non-0 on failure + **/ +static int +raptor_stringbuffer_append_string_common(raptor_stringbuffer* stringbuffer, + const unsigned char *string, + size_t length, + int do_copy) +{ + raptor_stringbuffer_node *node; + + if(!string || !length) + return 0; + + node = RAPTOR_MALLOC(raptor_stringbuffer_node*, sizeof(*node)); + if(!node) { + if(!do_copy) + RAPTOR_FREE(char*, string); + return 1; + } + + if(do_copy) { + /* Note this copy does not include the \0 character - not needed */ + node->string = RAPTOR_MALLOC(unsigned char*, length); + if(!node->string) { + RAPTOR_FREE(raptor_stringbuffer_node, node); + return 1; + } + memcpy(node->string, string, length); + } else + node->string = (unsigned char*)string; + node->length = length; + + + if(stringbuffer->tail) { + stringbuffer->tail->next = node; + stringbuffer->tail = node; + } else + stringbuffer->head = stringbuffer->tail = node; + node->next = NULL; + + if(stringbuffer->string) { + RAPTOR_FREE(char*, stringbuffer->string); + stringbuffer->string = NULL; + } + stringbuffer->length += length; + + return 0; +} + + + + +/** + * raptor_stringbuffer_append_counted_string: + * @stringbuffer: raptor stringbuffer + * @string: string + * @length: length of string + * @do_copy: non-0 to copy the string + * + * Add a counted string to the stringbuffer. + * + * If @string is NULL or @length is 0, no work is performed. + * + * If @do_copy is non-0, the passed-in string is copied into new memory + * otherwise the stringbuffer becomes the owner of the string pointer + * and will free it when the stringbuffer is destroyed. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_append_counted_string(raptor_stringbuffer* stringbuffer, + const unsigned char *string, size_t length, + int do_copy) +{ + if(!string || !length) + return 0; + + return raptor_stringbuffer_append_string_common(stringbuffer, string, length, do_copy); +} + + +/** + * raptor_stringbuffer_append_string: + * @stringbuffer: raptor stringbuffer + * @string: string + * @do_copy: non-0 to copy the string + * + * Add a string to the stringbuffer. + * + * If @string is NULL, no work is performed. + * + * If @do_copy is non-0, the passed-in string is copied into new memory + * otherwise the stringbuffer becomes the owner of the string pointer + * and will free it when the stringbuffer is destroyed. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_append_string(raptor_stringbuffer* stringbuffer, + const unsigned char *string, int do_copy) +{ + if(!string) + return 0; + + return raptor_stringbuffer_append_string_common(stringbuffer, string, strlen((const char*)string), do_copy); +} + + +/** + * raptor_stringbuffer_append_decimal: + * @stringbuffer: raptor stringbuffer + * @integer: integer to format as decimal and add + * + * Add an integer in decimal to the stringbuffer. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_append_decimal(raptor_stringbuffer* stringbuffer, + int integer) +{ + /* enough for 64 bit signed integer + * INT64_MAX is 9223372036854775807 (19 digits) + 1 for sign + */ + unsigned char buf[20]; + unsigned char *p; + int i = integer; + size_t length = 1; + if(integer < 0) { + length++; + i= -integer; + } + while(i /= 10) + length++; + + p = buf+length-1; + i = integer; + if(i < 0) + i= -i; + do { + *p-- = RAPTOR_GOOD_CAST(unsigned char, '0'+(i %10)); + i /= 10; + } while(i); + if(integer < 0) + *p= '-'; + + return raptor_stringbuffer_append_counted_string(stringbuffer, buf, length, 1); +} + + +/** + * raptor_stringbuffer_append_stringbuffer: + * @stringbuffer: #raptor_stringbuffer + * @append: #raptor_stringbuffer to append + * + * Add a stringbuffer to the stringbuffer. + * + * This function removes the content from the appending stringbuffer, + * making it empty and appends it to the supplied stringbuffer. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_append_stringbuffer(raptor_stringbuffer* stringbuffer, + raptor_stringbuffer* append) +{ + raptor_stringbuffer_node *node = append->head; + + if(!node) + return 0; + + /* move all append nodes to stringbuffer */ + if(stringbuffer->tail) { + stringbuffer->tail->next = node; + } else + stringbuffer->head = node; + + stringbuffer->tail = append->tail; + + /* adjust our length */ + stringbuffer->length += append->length; + if(stringbuffer->string) { + RAPTOR_FREE(char*, stringbuffer->string); + stringbuffer->string = NULL; + } + + /* zap append content */ + append->head = append->tail = NULL; + append->length = 0; + if(append->string) { + RAPTOR_FREE(char*, append->string); + append->string = NULL; + } + + return 0; +} + + + + +/** + * raptor_stringbuffer_prepend_string_common: + * @stringbuffer: raptor stringbuffer + * @string: string + * @length: length of string + * @do_copy: non-0 to copy the string + * + * Add a string to the start of a stringbuffer. + * + * INTERNAL + * + * If do_copy is non-0, the passed-in string is copied into new memory + * otherwise the stringbuffer becomes the owner of the string pointer + * and will free it when the stringbuffer is destroyed. + * + * Return value: non-0 on failure + **/ +static int +raptor_stringbuffer_prepend_string_common(raptor_stringbuffer* stringbuffer, + const unsigned char *string, size_t length, + int do_copy) +{ + raptor_stringbuffer_node *node; + + node = RAPTOR_MALLOC(raptor_stringbuffer_node*, sizeof(*node)); + if(!node) + return 1; + + if(do_copy) { + /* Note this copy does not include the \0 character - not needed */ + node->string = RAPTOR_MALLOC(unsigned char*, length); + if(!node->string) { + RAPTOR_FREE(raptor_stringbuffer_node, node); + return 1; + } + memcpy(node->string, string, length); + } else + node->string = (unsigned char*)string; + node->length = length; + + + node->next = stringbuffer->head; + if(stringbuffer->head) + stringbuffer->head = node; + else + stringbuffer->head = stringbuffer->tail = node; + + if(stringbuffer->string) { + RAPTOR_FREE(char*, stringbuffer->string); + stringbuffer->string = NULL; + } + stringbuffer->length += length; + + return 0; +} + + + + +/** + * raptor_stringbuffer_prepend_counted_string: + * @stringbuffer: raptor stringbuffer + * @string: string + * @length: length of string + * @do_copy: non-0 to copy the string + + * If do_copy is non-0, the passed-in string is copied into new memory + * otherwise the stringbuffer becomes the owner of the string pointer + * and will free it when the stringbuffer is destroyed. + * + * Add a string to the start of the stringbuffer. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_prepend_counted_string(raptor_stringbuffer* stringbuffer, + const unsigned char *string, size_t length, + int do_copy) +{ + return raptor_stringbuffer_prepend_string_common(stringbuffer, string, length, do_copy); +} + + +/** + * raptor_stringbuffer_prepend_string: + * @stringbuffer: raptor stringbuffer + * @string: string + * @do_copy: non-0 to copy the string + * + * Add a string to the start of the stringbuffer. + * + * If do_copy is non-0, the passed-in string is copied into new memory + * otherwise the stringbuffer becomes the owner of the string pointer + * and will free it when the stringbuffer is destroyed. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_prepend_string(raptor_stringbuffer* stringbuffer, + const unsigned char *string, int do_copy) +{ + return raptor_stringbuffer_prepend_string_common(stringbuffer, string, strlen((const char*)string), do_copy); +} + + +/** + * raptor_stringbuffer_length: + * @stringbuffer: raptor stringbuffer + * + * Return the stringbuffer length. + * + * Return value: size of stringbuffer + **/ +size_t +raptor_stringbuffer_length(raptor_stringbuffer* stringbuffer) +{ + return stringbuffer->length; +} + + + +/** + * raptor_stringbuffer_as_string: + * @stringbuffer: raptor stringbuffer + * + * Return the stringbuffer as a C string. + * + * Note: the return value is a to a shared string that the stringbuffer + * allocates and manages. + * + * Return value: NULL on failure or stringbuffer is empty, otherwise + * a pointer to a shared copy of the string. + **/ +unsigned char * +raptor_stringbuffer_as_string(raptor_stringbuffer* stringbuffer) +{ + raptor_stringbuffer_node *node; + unsigned char *p; + + if(!stringbuffer->length) + return NULL; + if(stringbuffer->string) + return stringbuffer->string; + + stringbuffer->string = RAPTOR_MALLOC(unsigned char*, stringbuffer->length + 1); + if(!stringbuffer->string) + return NULL; + + node = stringbuffer->head; + p = stringbuffer->string; + while(node) { + memcpy(p, node->string, node->length); + p+= node->length; + node = node->next; + } + *p='\0'; + return stringbuffer->string; +} + + +/** + * raptor_stringbuffer_copy_to_string: + * @stringbuffer: raptor stringbuffer + * @string: output string + * @length: size of output string + * + * Copy the stringbuffer into a string. + * + * Copies the underlying string to a pre-allocated buffer. The + * output string is always '\0' terminated. + * + * Return value: non-0 on failure such as stringbuffer is empty, buffer is too small + **/ +int +raptor_stringbuffer_copy_to_string(raptor_stringbuffer* stringbuffer, + unsigned char *string, size_t length) +{ + raptor_stringbuffer_node *node; + unsigned char *p; + + if(!string || length < 1) + return 1; + + if(!stringbuffer->length) + return 0; + + p = string; + for(node = stringbuffer->head; node; node = node->next) { + if(node->length > length) { + p[-1]='\0'; + return 1; + } + memcpy(p, node->string, node->length); + p+= node->length; + length-= node->length; + } + *p='\0'; + return 0; +} + + + +/** + * raptor_stringbuffer_append_hexadecimal: + * @stringbuffer: raptor stringbuffer + * @hex: integer to format + * + * Add an integer formatted in hexdecimal (base 16) to the stringbuffer. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_append_hexadecimal(raptor_stringbuffer* stringbuffer, + int hex) +{ + unsigned char buf[2]; + + if(hex < 0 || hex > 0xF) + return 1; + + *buf = RAPTOR_GOOD_CAST(unsigned char, (hex < 10) ? ('0' + hex) : ('A' + hex - 10)); + buf[1] = '\0'; + + return raptor_stringbuffer_append_counted_string(stringbuffer, buf, 1, 1); +} + + +/* RFC3986 Unreserved */ +#define IS_URI_UNRESERVED(c) ( (c >= 'A' && c <= 'F') || \ + (c >= 'a' && c <= 'f') || \ + (c >= '0' && c <= '9') || \ + (c == '-' || c == '.' || c == '_' || c == '~') ) +#define IS_URI_SAFE(c) (IS_URI_UNRESERVED(c)) + + +/** + * raptor_stringbuffer_append_uri_escaped_counted_string: + * @sb: raptor stringbuffer + * @string: string + * @length: length of string + * @space_is_plus: if non-0, escape spaces as '+' otherwise percent-encode them + * + * Add a URI-escaped version of @string to the stringbuffer. + * + * If @string is NULL or @length is 0, no work is performed. + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_append_uri_escaped_counted_string(raptor_stringbuffer* sb, + const char* string, + size_t length, + int space_is_plus) +{ + unsigned int i; + unsigned char buf[2]; + buf[1] = '\0'; + + if(!string || !length) + return 0; + + for(i = 0; i < length; i++) { + char c = string[i]; + if(!c) + break; + + if(IS_URI_SAFE(c)) { + *buf = RAPTOR_GOOD_CAST(unsigned char, c); + + if(raptor_stringbuffer_append_counted_string(sb, buf, 1, 1)) + return 1; + } else if (c == ' ' && space_is_plus) { + *buf = '+'; + + if(raptor_stringbuffer_append_counted_string(sb, buf, 1, 1)) + return 1; + } else { + *buf = '%'; + if(raptor_stringbuffer_append_counted_string(sb, buf, 1, 1)) + return 1; + + if(raptor_stringbuffer_append_hexadecimal(sb, (c & 0xf0) >> 4)) + return 1; + + if(raptor_stringbuffer_append_hexadecimal(sb, (c & 0x0f))) + return 1; + } + } + + return 0; +} + + +#endif + + + +#ifdef STANDALONE + +/* one more prototype */ +int main(int argc, char *argv[]); + + +int +main(int argc, char *argv[]) +{ + const char *program = raptor_basename(argv[0]); +#define TEST_ITEMS_COUNT 9 + const char *items[TEST_ITEMS_COUNT] = { "the", "quick" ,"brown", "fox", "jumps", "over", "the", "lazy", "dog" }; + const char *items_string = "thequickbrownfoxjumpsoverthelazydog"; + const size_t items_len = 35; + const char *test_integer_string = "abcd"; +#define TEST_INTEGERS_COUNT 7 + const int test_integers[TEST_INTEGERS_COUNT]={ 0, 1, -1, 11, 1234, 12345, -12345 }; + const char *test_integer_results[TEST_INTEGERS_COUNT]={ "abcd0", "abcd1", "abcd-1", "abcd11", "abcd1234", "abcd12345", "abcd-12345" }; + raptor_stringbuffer *sb; + unsigned char *str; + size_t len; + int i = 0; + raptor_stringbuffer *sb1, *sb2; +#define TEST_APPEND_COUNT 2 + const char *test_append_results[TEST_APPEND_COUNT]={ "thebrownjumpsthedog", "quickfoxoverlazy" }; + const char *test_append_results_total="thebrownjumpsthedogquickfoxoverlazy"; +#define COPY_STRING_BUFFER_SIZE 100 + unsigned char *copy_string; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Creating string buffer\n", program); +#endif + + /* test appending */ + + sb = raptor_new_stringbuffer(); + if(!sb) { + fprintf(stderr, "%s: Failed to create string buffer\n", program); + exit(1); + } + + for(i = 0; i < TEST_ITEMS_COUNT; i++) { + int rc; + len = strlen(items[i]); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Adding string buffer item '%s'\n", program, items[i]); +#endif + + rc = raptor_stringbuffer_append_counted_string(sb, (unsigned char*)items[i], len, 1); + if(rc) { + fprintf(stderr, "%s: Adding string buffer item %d '%s' failed, returning error %d\n", + program, i, items[i], rc); + exit(1); + } + } + + len = raptor_stringbuffer_length(sb); + if(len != items_len) { + fprintf(stderr, "%s: string buffer len is %d, expected %d\n", program, + (int)len, (int)items_len); + exit(1); + } + + str = raptor_stringbuffer_as_string(sb); + if(strcmp((const char*)str, items_string)) { + fprintf(stderr, "%s: string buffer contains '%s', expected '%s'\n", + program, str, items_string); + exit(1); + } + + raptor_free_stringbuffer(sb); + + + /* test prepending */ + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Creating string buffer\n", program); +#endif + + sb = raptor_new_stringbuffer(); + if(!sb) { + fprintf(stderr, "%s: Failed to create string buffer\n", program); + exit(1); + } + + for(i = TEST_ITEMS_COUNT-1; i>=0 ; i--) { + int rc; + len = strlen(items[i]); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Prepending string buffer item '%s'\n", program, items[i]); +#endif + + rc = raptor_stringbuffer_prepend_counted_string(sb, (unsigned char*)items[i], len, 1); + if(rc) { + fprintf(stderr, "%s: Prepending string buffer item %d '%s' failed, returning error %d\n", + program, i, items[i], rc); + exit(1); + } + } + + len = raptor_stringbuffer_length(sb); + if(len != items_len) { + fprintf(stderr, "%s: string buffer len is %d, expected %d\n", program, + (int)len, (int)items_len); + exit(1); + } + + str = raptor_stringbuffer_as_string(sb); + if(strcmp((const char*)str, items_string)) { + fprintf(stderr, "%s: string buffer contains '%s', expected '%s'\n", + program, str, items_string); + exit(1); + } + + + /* test adding integers */ + + for(i = 0; i < TEST_INTEGERS_COUNT; i++) { + raptor_stringbuffer *isb = raptor_new_stringbuffer(); + if(!isb) { + fprintf(stderr, "%s: Failed to create string buffer\n", program); + exit(1); + } + + raptor_stringbuffer_append_string(isb, + (const unsigned char*)test_integer_string, 1); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Adding decimal integer %d to buffer\n", program, test_integers[i]); +#endif + + raptor_stringbuffer_append_decimal(isb, test_integers[i]); + + str = raptor_stringbuffer_as_string(isb); + if(strcmp((const char*)str, test_integer_results[i])) { + fprintf(stderr, "%s: string buffer contains '%s', expected '%s'\n", + program, str, test_integer_results[i]); + exit(1); + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Freeing string buffer\n", program); +#endif + raptor_free_stringbuffer(isb); + } + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Creating two stringbuffers to join\n", program); +#endif + + sb1 = raptor_new_stringbuffer(); + if(!sb1) { + fprintf(stderr, "%s: Failed to create string buffer\n", program); + exit(1); + } + sb2 = raptor_new_stringbuffer(); + if(!sb2) { + fprintf(stderr, "%s: Failed to create string buffer\n", program); + exit(1); + } + + for(i = 0; i < TEST_ITEMS_COUNT; i++) { + raptor_stringbuffer *sbx; + int rc; + len = strlen(items[i]); + + sbx = (i % 2) ? sb2 : sb1; + rc = raptor_stringbuffer_append_counted_string(sbx, (unsigned char*)items[i], len, 1); + if(rc) { + fprintf(stderr, "%s: Adding string buffer item %d '%s' failed, returning error %d\n", + program, i, items[i], rc); + exit(1); + } + } + + if(1) { + int rc; + + rc = raptor_stringbuffer_append_counted_string(sb1, (unsigned char*)"X", 0, 1); + if(rc) { + fprintf(stderr, "%s: Adding 0-length counted string failed, returning error %d\n", + program, rc); + exit(1); + } + rc = raptor_stringbuffer_append_string(sb1, NULL, 1); + if(rc) { + fprintf(stderr, "%s: Adding NULL string failed, returning error %d\n", + program, rc); + exit(1); + } + } + + str = raptor_stringbuffer_as_string(sb1); + if(strcmp((const char*)str, test_append_results[0])) { + fprintf(stderr, "%s: string buffer sb1 contains '%s', expected '%s'\n", + program, str, test_append_results[0]); + exit(1); + } + str = raptor_stringbuffer_as_string(sb2); + if(strcmp((const char*)str, test_append_results[1])) { + fprintf(stderr, "%s: string buffer sb2 contains '%s', expected '%s'\n", + program, str, test_append_results[1]); + exit(1); + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Appended two stringbuffers\n", program); +#endif + + if(raptor_stringbuffer_append_stringbuffer(sb1, sb2)) { + fprintf(stderr, "%s: Failed to append string buffer\n", program); + exit(1); + } + + str = raptor_stringbuffer_as_string(sb1); + if(strcmp((const char*)str, test_append_results_total)) { + fprintf(stderr, "%s: appended string buffer contains '%s', expected '%s'\n", + program, str, test_append_results_total); + exit(1); + } + + len = raptor_stringbuffer_length(sb2); + if(len) { + fprintf(stderr, "%s: appended string buffer is length %d, not empty'\n", + program, (int)len); + exit(1); + } + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Copying string buffer to string\n", program); +#endif + + copy_string = (unsigned char*)malloc(COPY_STRING_BUFFER_SIZE); + if(raptor_stringbuffer_copy_to_string(sb1, copy_string, COPY_STRING_BUFFER_SIZE)) { + fprintf(stderr, "%s: copying string buffer to string failed\n", + program); + exit(1); + } + if(strcmp((const char*)copy_string, test_append_results_total)) { + fprintf(stderr, "%s: copied string buffer contains '%s', expected '%s'\n", + program, copy_string, test_append_results_total); + exit(1); + } + free(copy_string); + + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Freeing string buffers\n", program); +#endif + raptor_free_stringbuffer(sb1); + raptor_free_stringbuffer(sb2); + raptor_free_stringbuffer(sb); + + /* keep gcc -Wall happy */ + return(0); +} + +#endif diff --git a/src/raptor_syntax_description.c b/src/raptor_syntax_description.c new file mode 100644 index 0000000..eb549b2 --- /dev/null +++ b/src/raptor_syntax_description.c @@ -0,0 +1,109 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_syntax_description.c - Raptor syntax description API + * + * Copyright (C) 2010, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +static unsigned int +count_strings_array(const char* const * array) +{ + unsigned int i; + + if(!array) + return 0; + + for(i = 0; (array[i]); i++) + ; + + return i; +} + + +static unsigned int +count_mime_types_array(const raptor_type_q* array) +{ + unsigned int i; + + if(!array) + return 0; + + for(i = 0; (array[i].mime_type); i++) + ; + + return i; +} + + +/** + * raptor_syntax_description_validate: + * @desc: description + * + * Validate a syntax description has the required fields (name, labels) and update counts + * + * Returns: non-0 on failure + **/ +int +raptor_syntax_description_validate(raptor_syntax_description* desc) +{ + if(!desc || !desc->names || !desc->names[0] || !desc->label) + return 1; + +#ifdef RAPTOR_DEBUG + /* Maintainer only check of static data */ + if(desc->mime_types) { + unsigned int i; + const raptor_type_q* type_q = NULL; + + for(i = 0; + (type_q = &desc->mime_types[i]) && type_q->mime_type; + i++) { + size_t len = strlen(type_q->mime_type); + if(len != type_q->mime_type_len) { + fprintf(stderr, + "Format %s mime type %s actual len %d static len %d\n", + desc->names[0], type_q->mime_type, + (int)len, (int)type_q->mime_type_len); + } + } + } +#endif + + desc->names_count = count_strings_array(desc->names); + if(!desc->names_count) + return 1; + + desc->mime_types_count = count_mime_types_array(desc->mime_types); + desc->uri_strings_count = count_strings_array(desc->uri_strings); + + return 0; +} diff --git a/src/raptor_term.c b/src/raptor_term.c new file mode 100644 index 0000000..d6fa52b --- /dev/null +++ b/src/raptor_term.c @@ -0,0 +1,1039 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_term.c - Raptor terms + * + * Copyright (C) 2010, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifndef STANDALONE + +/** + * raptor_new_term_from_uri: + * @world: raptor world + * @uri: uri + * + * Constructor - create a new URI statement term + * + * Takes a copy (reference) of the passed in @uri + * + * Return value: new term or NULL on failure +*/ +raptor_term* +raptor_new_term_from_uri(raptor_world* world, raptor_uri* uri) +{ + raptor_term *t; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!uri) + return NULL; + + raptor_world_open(world); + + t = RAPTOR_CALLOC(raptor_term*, 1, sizeof(*t)); + if(!t) + return NULL; + + t->usage = 1; + t->world = world; + t->type = RAPTOR_TERM_TYPE_URI; + t->value.uri = raptor_uri_copy(uri); + + return t; +} + + +/** + * raptor_new_term_from_counted_uri_string: + * @world: raptor world + * @uri_string: UTF-8 encoded URI string. + * @length: length of URI string + * + * Constructor - create a new URI statement term from a UTF-8 encoded Unicode string + * + * Note: The @uri_string need not be NULL terminated - a NULL will be + * added to the copied string used. + * + * Return value: new term or NULL on failure +*/ +raptor_term* +raptor_new_term_from_counted_uri_string(raptor_world* world, + const unsigned char *uri_string, + size_t length) +{ + raptor_term *t; + raptor_uri* uri; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + uri = raptor_new_uri_from_counted_string(world, uri_string, length); + if(!uri) + return NULL; + + t = raptor_new_term_from_uri(world, uri); + + raptor_free_uri(uri); + + return t; +} + + +/** + * raptor_new_term_from_uri_string: + * @world: raptor world + * @uri_string: UTF-8 encoded URI string. + * + * Constructor - create a new URI statement term from a UTF-8 encoded Unicode string + * + * Return value: new term or NULL on failure +*/ +raptor_term* +raptor_new_term_from_uri_string(raptor_world* world, + const unsigned char *uri_string) +{ + raptor_term *t; + raptor_uri* uri; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + uri = raptor_new_uri(world, uri_string); + if(!uri) + return NULL; + + t = raptor_new_term_from_uri(world, uri); + + raptor_free_uri(uri); + + return t; +} + + +/** + * raptor_new_term_from_counted_literal: + * @world: raptor world + * @literal: UTF-8 encoded literal string (or NULL for empty literal) + * @literal_len: length of literal + * @datatype: literal datatype URI (or NULL) + * @language: literal language (or NULL for no language) + * @language_len: literal language length + * + * Constructor - create a new literal statement term from a counted UTF-8 encoded literal string + * + * Takes copies of the passed in @literal, @datatype, @language + * + * Only one of @language or @datatype may be given. If both are + * given, NULL is returned. If @language is the empty string, it is + * the equivalent to NULL. + * + * Note: The @literal need not be NULL terminated - a NULL will be + * added to the copied string used. + * + * Return value: new term or NULL on failure + */ +raptor_term* +raptor_new_term_from_counted_literal(raptor_world* world, + const unsigned char* literal, + size_t literal_len, + raptor_uri* datatype, + const unsigned char* language, + unsigned char language_len) +{ + raptor_term *t; + unsigned char* new_literal = NULL; + unsigned char* new_language = NULL; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + if(language && !*language) + language = NULL; + + if(language && datatype) + return NULL; + + + new_literal = RAPTOR_MALLOC(unsigned char*, literal_len + 1); + if(!new_literal) + return NULL; + + if(!literal || !*literal) + literal_len = 0; + + if(literal_len) { + memcpy(new_literal, literal, literal_len); + new_literal[literal_len] = '\0'; + } else + *new_literal = '\0'; + + if(language) { + unsigned char c; + unsigned char* l; + + new_language = RAPTOR_MALLOC(unsigned char*, language_len + 1); + if(!new_language) { + RAPTOR_FREE(char*, new_literal); + return NULL; + } + + l = new_language; + while((c = *language++)) { + if(c == '_') + c = '-'; + *l++ = c; + } + *l = '\0'; + } else + language_len = 0; + + if(datatype) + datatype = raptor_uri_copy(datatype); + + + t = RAPTOR_CALLOC(raptor_term*, 1, sizeof(*t)); + if(!t) { + if(new_literal) + RAPTOR_FREE(char*, new_literal); + if(new_language) + RAPTOR_FREE(char*, new_language); + if(datatype) + raptor_free_uri(datatype); + return NULL; + } + t->usage = 1; + t->world = world; + t->type = RAPTOR_TERM_TYPE_LITERAL; + t->value.literal.string = new_literal; + t->value.literal.string_len = RAPTOR_LANG_LEN_FROM_INT(literal_len); + t->value.literal.language = new_language; + t->value.literal.language_len = language_len; + t->value.literal.datatype = datatype; + + return t; +} + + +/** + * raptor_new_term_from_literal: + * @world: raptor world + * @literal: UTF-8 encoded literal string (or NULL for empty literal) + * @datatype: literal datatype URI (or NULL) + * @language: literal language (or NULL) + * + * Constructor - create a new literal statement term + * + * Takes copies of the passed in @literal, @datatype, @language + * + * Only one of @language or @datatype may be given. If both are + * given, NULL is returned. If @language is the empty string, it is + * the equivalent to NULL. + * + * Return value: new term or NULL on failure +*/ +raptor_term* +raptor_new_term_from_literal(raptor_world* world, + const unsigned char* literal, + raptor_uri* datatype, + const unsigned char* language) +{ + size_t literal_len = 0; + size_t language_len = 0; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + if(literal) + literal_len = strlen(RAPTOR_GOOD_CAST(const char*, literal)); + + if(language) + language_len = strlen(RAPTOR_GOOD_CAST(const char*, language)); + + return raptor_new_term_from_counted_literal(world, literal, literal_len, + datatype, language, + RAPTOR_BAD_CAST(unsigned char, language_len)); +} + + +/** + * raptor_new_term_from_counted_blank: + * @world: raptor world + * @blank: UTF-8 encoded blank node identifier (or NULL) + * @length: length of identifier (or 0) + * + * Constructor - create a new blank node statement term from a counted UTF-8 encoded blank node ID + * + * Takes a copy of the passed in @blank + * + * If @blank is NULL, creates a new internal identifier and uses it. + * This will use the handler set with + * raptor_world_set_generate_bnodeid_parameters() + * + * Note: The @blank need not be NULL terminated - a NULL will be + * added to the copied string used. + * + * Return value: new term or NULL on failure +*/ +raptor_term* +raptor_new_term_from_counted_blank(raptor_world* world, + const unsigned char* blank, size_t length) +{ + raptor_term *t; + unsigned char* new_id; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + if (blank) { + new_id = RAPTOR_MALLOC(unsigned char*, length + 1); + if(!new_id) + return NULL; + memcpy(new_id, blank, length); + new_id[length] = '\0'; + } else { + new_id = raptor_world_generate_bnodeid(world); + length = strlen((const char*)new_id); + } + + t = RAPTOR_CALLOC(raptor_term*, 1, sizeof(*t)); + if(!t) { + RAPTOR_FREE(char*, new_id); + return NULL; + } + + t->usage = 1; + t->world = world; + t->type = RAPTOR_TERM_TYPE_BLANK; + t->value.blank.string = new_id; + t->value.blank.string_len = RAPTOR_BAD_CAST(int, length); + + return t; +} + + +/** + * raptor_new_term_from_blank: + * @world: raptor world + * @blank: UTF-8 encoded blank node identifier (or NULL) + * + * Constructor - create a new blank node statement term from a UTF-8 encoded blank node ID + * + * Takes a copy of the passed in @blank + * + * If @blank is NULL or an empty string, creates a new internal + * identifier and uses it. This will use the handler set with + * raptor_world_set_generate_bnodeid_parameters() + * + * Return value: new term or NULL on failure +*/ +raptor_term* +raptor_new_term_from_blank(raptor_world* world, const unsigned char* blank) +{ + size_t length = 0; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + if(blank) { + if(*blank) + length = strlen((const char*)blank); + else + blank = NULL; + } + + return raptor_new_term_from_counted_blank(world, blank, length); +} + + +/** + * raptor_new_term_from_counted_string: + * @world: raptor world + * @string: N-Triples format string (UTF-8) + * @length: length of @string (or 0) + * + * Constructor - create a new term from a Turtle / N-Triples format string in UTF-8 + * + * See also raptor_term_to_counted_string() and raptor_term_to_string() + * + * Return value: new term or NULL on failure +*/ +raptor_term* +raptor_new_term_from_counted_string(raptor_world* world, + unsigned char* string, size_t length) +{ + raptor_term* term = NULL; + size_t bytes_read; + raptor_locator locator; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!string) + return NULL; + + if(!length) + length = strlen(RAPTOR_GOOD_CAST(const char*, string)); + + raptor_world_open(world); + + memset(&locator, '\0', sizeof(locator)); + locator.line = -1; + + bytes_read = raptor_ntriples_parse_term(world, &locator, + string, &length, &term, 1); + + if(!bytes_read || length != 0) { + if(term) + raptor_free_term(term); + term = NULL; + } + + return term; +} + + +/** + * raptor_term_copy: + * @term: raptor term + * + * Copy constructor - get a copy of a statement term + * + * Return value: new term object or NULL on failure + */ +raptor_term* +raptor_term_copy(raptor_term* term) +{ + if(!term) + return NULL; + + term->usage++; + return term; +} + + +/** + * raptor_free_term: + * @term: #raptor_term object + * + * Destructor - destroy a raptor_term object. + * + **/ +void +raptor_free_term(raptor_term *term) +{ + if(!term) + return; + + if(--term->usage) + return; + + switch(term->type) { + case RAPTOR_TERM_TYPE_URI: + if(term->value.uri) { + raptor_free_uri(term->value.uri); + term->value.uri = NULL; + } + break; + + case RAPTOR_TERM_TYPE_BLANK: + if(term->value.blank.string) { + RAPTOR_FREE(char*, term->value.blank.string); + term->value.blank.string = NULL; + } + break; + + case RAPTOR_TERM_TYPE_LITERAL: + if(term->value.literal.string) { + RAPTOR_FREE(char*, term->value.literal.string); + term->value.literal.string = NULL; + } + + if(term->value.literal.datatype) { + raptor_free_uri(term->value.literal.datatype); + term->value.literal.datatype = NULL; + } + + if(term->value.literal.language) { + RAPTOR_FREE(char*, term->value.literal.language); + term->value.literal.language = NULL; + } + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + break; + } + + RAPTOR_FREE(term, term); +} + + +/** + * raptor_term_to_counted_string: + * @term: #raptor_term + * @len_p: Pointer to location to store length of new string (if not NULL) + * + * Turns a raptor term into a N-Triples format counted string. + * + * Turns the given @term into an N-Triples escaped string using all the + * escapes as defined in http://www.w3.org/TR/rdf-testcases/#ntriples + * + * This function uses raptor_term_ntriples_write() to write to an + * #raptor_iostream which is the prefered way to write formatted + * output. + * + * See also raptor_new_term_from_counted_string() to reverse this. + * + * See also raptor_term_to_turtle_string() to write as Turtle which + * will include Turtle syntax such as 'true' for booleans and """quoting""" + * + * Return value: the new string or NULL on failure. The length of + * the new string is returned in *@len_p if len_p is not NULL. + **/ +unsigned char* +raptor_term_to_counted_string(raptor_term *term, size_t* len_p) +{ + raptor_iostream *iostr; + void *string = NULL; + int rc; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(term, raptor_term, NULL); + + iostr = raptor_new_iostream_to_string(term->world, + &string, len_p, NULL); + if(!iostr) + return NULL; + + rc = raptor_term_escaped_write(term, 0, iostr); + raptor_free_iostream(iostr); + + if(rc) { + if(string) { + RAPTOR_FREE(char*, string); + string = NULL; + } + } + + return (unsigned char *)string; +} + + +/** + * raptor_term_to_string: + * @term: #raptor_term + * + * Turns a raptor term into a N-Triples format string. + * + * Turns the given @term into an N-Triples escaped string using all the + * escapes as defined in http://www.w3.org/TR/rdf-testcases/#ntriples + * + * See also raptor_new_term_from_counted_string() to reverse this. + * + * See also raptor_term_to_turtle_string() to write as Turtle which + * will include Turtle syntax such as 'true' for booleans and """quoting""" + * + * Return value: the new string or NULL on failure. + **/ +unsigned char* +raptor_term_to_string(raptor_term *term) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(term, raptor_term, NULL); + + return raptor_term_to_counted_string(term, NULL); +} + + +/* + * raptor_term_print_as_ntriples: + * @term: #raptor_term + * @stream: FILE stream + * + * INTERNAL - Print a term as N-Triples + */ +int +raptor_term_print_as_ntriples(const raptor_term *term, FILE* stream) +{ + int rc = 0; + raptor_iostream* iostr; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(term, raptor_term, 1); + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(stream, FILE*, 1); + + iostr = raptor_new_iostream_to_file_handle(term->world, stream); + if(!iostr) + return 1; + + rc = raptor_term_escaped_write(term, 0, iostr); + + raptor_free_iostream(iostr); + + return rc; +} + + +/** + * raptor_term_equals: + * @t1: first term + * @t2: second term + * + * Compare a pair of #raptor_term for equality + * + * Return value: non-0 if the terms are equal + */ +int +raptor_term_equals(raptor_term* t1, raptor_term* t2) +{ + int d = 0; + + if(!t1 || !t2) + return 0; + + if(t1->type != t2->type) + return 0; + + if(t1 == t2) + return 1; + + switch(t1->type) { + case RAPTOR_TERM_TYPE_URI: + d = raptor_uri_equals(t1->value.uri, t2->value.uri); + break; + + case RAPTOR_TERM_TYPE_BLANK: + if(t1->value.blank.string_len != t2->value.blank.string_len) + /* different lengths */ + break; + + d = !strcmp((const char*)t1->value.blank.string, + (const char*)t2->value.blank.string); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + if(t1->value.literal.string_len != t2->value.literal.string_len) + /* different lengths */ + break; + + d = !strcmp((const char*)t1->value.literal.string, + (const char*)t2->value.literal.string); + if(!d) + break; + + if(t1->value.literal.language && t2->value.literal.language) { + /* both have a language */ + d = !strcmp((const char*)t1->value.literal.language, + (const char*)t2->value.literal.language); + if(!d) + break; + } else if(t1->value.literal.language || t2->value.literal.language) { + /* only one has a language - different */ + d = 0; + break; + } + + if(t1->value.literal.datatype && t2->value.literal.datatype) { + /* both have a datatype */ + d = raptor_uri_equals(t1->value.literal.datatype, + t2->value.literal.datatype); + } else if(t1->value.literal.datatype || t2->value.literal.datatype) { + /* only one has a datatype - different */ + d = 0; + } + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + break; + } + + return d; +} + + +/** + * raptor_term_compare: + * @t1: first term + * @t2: second term + * + * Compare a pair of #raptor_term + * + * If types are different, the #raptor_term_type order is used. + * + * Resource and datatype URIs are compared with raptor_uri_compare(), + * blank nodes and literals with strcmp(). If one literal has no + * language, it is earlier than one with a language. If one literal + * has no datatype, it is earlier than one with a datatype. + * + * Return value: <0 if t1 is before t2, 0 if equal, >0 if t1 is after t2 + */ +int +raptor_term_compare(const raptor_term *t1, const raptor_term *t2) +{ + int d = 0; + + /* check for NULL terms */ + if(!t1 || !t2) { + if(!t1 && !t2) + return 0; /* both NULL */ + + /* place NULLs before any other term */ + return t1 ? 1 : -1; + } + + if(t1->type != t2->type) + return (t1->type - t2->type); + + switch(t1->type) { + case RAPTOR_TERM_TYPE_URI: + d = raptor_uri_compare(t1->value.uri, t2->value.uri); + break; + + case RAPTOR_TERM_TYPE_BLANK: + d = strcmp((const char*)t1->value.blank.string, + (const char*)t2->value.blank.string); + break; + + case RAPTOR_TERM_TYPE_LITERAL: + d = strcmp((const char*)t1->value.literal.string, + (const char*)t2->value.literal.string); + if(d) + break; + + if(t1->value.literal.language && t2->value.literal.language) { + /* both have a language */ + d = strcmp((const char*)t1->value.literal.language, + (const char*)t2->value.literal.language); + } else if(t1->value.literal.language || t2->value.literal.language) + /* only one has a language; the language-less one is earlier */ + d = (!t1->value.literal.language ? -1 : 1); + if(d) + break; + + if(t1->value.literal.datatype && t2->value.literal.datatype) { + /* both have a datatype */ + d = raptor_uri_compare(t1->value.literal.datatype, + t2->value.literal.datatype); + } else if(t1->value.literal.datatype || t2->value.literal.datatype) + /* only one has a datatype; the datatype-less one is earlier */ + d = (!t1->value.literal.datatype ? -1 : 1); + break; + + case RAPTOR_TERM_TYPE_UNKNOWN: + default: + break; + } + + return d; +} +#endif + + + +#ifdef STANDALONE + +/* one more prototype */ +int main(int argc, char *argv[]); + +static const unsigned char *uri_string1 = (const unsigned char *)"http://http://www.dajobe.org/"; +static unsigned int uri_string1_len = 29; /* strlen(uri_string1) */ +static raptor_term_type uri_string1_type = RAPTOR_TERM_TYPE_URI; +static const unsigned char *uri_string2 = (const unsigned char *)"http://www.example.org/"; +static unsigned int uri_string2_len = 23; /* strlen(uri_string2) */ +static raptor_term_type uri_string2_type = RAPTOR_TERM_TYPE_URI; +static const unsigned char *literal_string1 = (const unsigned char *)"Dave Beckett"; +static unsigned int literal_string1_len = 12; /* strlen(literal_string1) */ +static raptor_term_type literal_string1_type = RAPTOR_TERM_TYPE_LITERAL; +static const unsigned char *bnodeid1 = (const unsigned char *)"abc123"; +static unsigned int bnodeid1_len = 6; /* strlen(bnode_id1) */ +static raptor_term_type bnodeid1_type = RAPTOR_TERM_TYPE_BLANK; +static const unsigned char* language1 = (const unsigned char*)"en"; + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *program = raptor_basename(argv[0]); + int rc = 0; + raptor_term* term1 = NULL; /* URI string 1 */ + raptor_term* term2 = NULL; /* literal string1 */ + raptor_term* term3 = NULL; /* blank node 1 */ + raptor_term* term4 = NULL; /* URI string 2 */ + raptor_term* term5 = NULL; /* URI string 1 again */ + raptor_uri* uri1; + unsigned char* uri_str; + size_t uri_len; + + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + + /* check a term for NULL URI fails */ + term1 = raptor_new_term_from_uri(world, NULL); + if(term1) { + fprintf(stderr, "%s: raptor_new_uri(NULL) returned object rather than failing\n", program); + rc = 1; + goto tidy; + } + + /* check a term for non-NULL URI succeeds */ + uri1 = raptor_new_uri(world, uri_string1); + if(!uri1) { + fprintf(stderr, "%s: raptor_new_uri(%s) failed\n", program, uri_string1); + rc = 1; + goto tidy; + } + term1 = raptor_new_term_from_uri(world, uri1); + if(!term1) { + fprintf(stderr, "%s: raptor_new_term_from_uri_string(URI %s) failed\n", + program, uri_string1); + rc = 1; + goto tidy; + } + raptor_free_uri(uri1); uri1 = NULL; + if(term1->type != uri_string1_type) { + fprintf(stderr, "%s: raptor term 1 is of type %d expected %d\n", + program, term1->type, uri_string1_type); + rc = 1; + goto tidy; + } + + + /* returns a pointer to shared string */ + uri_str = raptor_uri_as_counted_string(term1->value.uri, &uri_len); + if(!uri_str) { + fprintf(stderr, "%s: raptor_uri_as_counted_string term 1 failed\n", + program); + rc = 1; + goto tidy; + } + + if(uri_len != uri_string1_len) { + fprintf(stderr, "%s: raptor term 1 URI is of length %d expected %d\n", + program, (int)uri_len, (int)uri_string1_len); + rc = 1; + goto tidy; + } + + + /* check an empty literal is created from a NULL literal pointer succeeds */ + term2 = raptor_new_term_from_counted_literal(world, NULL, 0, NULL, NULL, 0); + if(!term2) { + fprintf(stderr, "%s: raptor_new_term_from_counted_literal() with all NULLs failed\n", program); + rc = 1; + goto tidy; + } + raptor_free_term(term2); + + + /* check an empty literal from an empty language literal pointer succeeds */ + term2 = raptor_new_term_from_counted_literal(world, NULL, 0, NULL, + (const unsigned char*)"", 0); + if(!term2) { + fprintf(stderr, "%s: raptor_new_term_from_counted_literal() with empty language failed\n", program); + rc = 1; + goto tidy; + } + raptor_free_term(term2); + + /* check a literal with language and datatype fails */ + uri1 = raptor_new_uri(world, uri_string1); + if(!uri1) { + fprintf(stderr, "%s: raptor_new_uri(%s) failed\n", program, uri_string1); + rc = 1; + goto tidy; + } + term2 = raptor_new_term_from_counted_literal(world, literal_string1, + literal_string1_len, + uri1, language1, 0); + raptor_free_uri(uri1); uri1 = NULL; + if(term2) { + fprintf(stderr, "%s: raptor_new_term_from_counted_literal() with language and datatype returned object rather than failing\n", program); + rc = 1; + goto tidy; + } + + /* check a literal with no language and no datatype succeeds */ + term2 = raptor_new_term_from_counted_literal(world, literal_string1, + literal_string1_len, NULL, NULL, 0); + if(!term2) { + fprintf(stderr, "%s: raptor_new_term_from_counted_literal(%s) failed\n", + program, literal_string1); + rc = 1; + goto tidy; + } + if(term2->type != literal_string1_type) { + fprintf(stderr, "%s: raptor term 2 is of type %d expected %d\n", + program, term2->type, literal_string1_type); + rc = 1; + goto tidy; + } + + + /* check a blank node term with NULL id generates a new identifier */ + term3 = raptor_new_term_from_counted_blank(world, NULL, 0); + if(!term3) { + fprintf(stderr, "%s: raptor_new_term_from_counted_blank(NULL) failed\n", + program); + rc = 1; + goto tidy; + } + if(term3->type != bnodeid1_type) { + fprintf(stderr, "%s: raptor term 3 is of type %d expected %d\n", + program, term3->type, bnodeid1_type); + rc = 1; + goto tidy; + } + raptor_free_term(term3); + + /* check a blank node term with an identifier succeeds */ + term3 = raptor_new_term_from_counted_blank(world, bnodeid1, bnodeid1_len); + if(!term3) { + fprintf(stderr, "%s: raptor_new_term_from_counted_blank(%s) failed\n", + program, bnodeid1); + rc = 1; + goto tidy; + } + if(term3->type != bnodeid1_type) { + fprintf(stderr, "%s: raptor term 3 is of type %d expected %d\n", + program, term3->type, bnodeid1_type); + rc = 1; + goto tidy; + } + + + /* check a different URI term succeeds */ + term4 = raptor_new_term_from_counted_uri_string(world, uri_string2, + uri_string2_len); + if(!term4) { + fprintf(stderr, + "%s: raptor_new_term_from_counted_uri_string(URI %s) failed\n", + program, uri_string2); + rc = 1; + goto tidy; + } + if(term4->type != uri_string2_type) { + fprintf(stderr, "%s: raptor term 4 is of type %d expected %d\n", + program, term4->type, uri_string2_type); + rc = 1; + goto tidy; + } + /* returns a pointer to shared string */ + uri_str = raptor_uri_as_counted_string(term4->value.uri, &uri_len); + if(!uri_str) { + fprintf(stderr, "%s: raptor_uri_as_counted_string term 4 failed\n", + program); + rc = 1; + goto tidy; + } + + if(uri_len != uri_string2_len) { + fprintf(stderr, "%s: raptor term 4 URI is of length %d expected %d\n", + program, (int)uri_len, (int)uri_string2_len); + rc = 1; + goto tidy; + } + + + /* check the same URI term as term1 succeeds */ + term5 = raptor_new_term_from_uri_string(world, uri_string1); + if(!term5) { + fprintf(stderr, "%s: raptor_new_term_from_uri_string(URI %s) failed\n", + program, uri_string1); + rc = 1; + goto tidy; + } + + + if(raptor_term_equals(term1, term2)) { + fprintf(stderr, "%s: raptor_term_equals (URI %s, literal %s) returned equal, expected not-equal\n", + program, uri_string1, literal_string1); + rc = 1; + goto tidy; + } + + if(raptor_term_equals(term1, term3)) { + fprintf(stderr, "%s: raptor_term_equals (URI %s, bnode %s) returned equal, expected not-equal\n", + program, uri_string1, bnodeid1); + rc = 1; + goto tidy; + } + + if(raptor_term_equals(term1, term4)) { + fprintf(stderr, "%s: raptor_term_equals (URI %s, URI %s) returned equal, expected not-equal\n", + program, uri_string1, uri_string2); + rc = 1; + goto tidy; + } + + if(!raptor_term_equals(term1, term5)) { + fprintf(stderr, "%s: raptor_term_equals (URI %s, URI %s) returned not-equal, expected equal\n", + program, uri_string1, uri_string1); + rc = 1; + goto tidy; + } + + if(term1->value.uri != term5->value.uri) { + fprintf(stderr, "%s: term1 and term5 URI objects returned not-equal pointers, expected equal\n", + program); + /* This is not necessarily a failure if the raptor_uri module has had + * the URI interning disabled with + * raptor_world_set_flag(world, RAPTOR_WORLD_FLAG_URI_INTERNING, 0) + * however this test suite does not do that, so it is a failure here. + */ + rc = 1; + goto tidy; + } + + + tidy: + if(term1) + raptor_free_term(term1); + if(term2) + raptor_free_term(term2); + if(term3) + raptor_free_term(term3); + if(term4) + raptor_free_term(term4); + if(term5) + raptor_free_term(term5); + + raptor_free_world(world); + + return rc; +} + +#endif /* STANDALONE */ diff --git a/src/raptor_turtle_writer.c b/src/raptor_turtle_writer.c new file mode 100644 index 0000000..eb62a6e --- /dev/null +++ b/src/raptor_turtle_writer.c @@ -0,0 +1,1043 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_turtle_writer.c - Raptor Turtle Writer + * + * Copyright (C) 2006, Dave Robillard + * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif +#include <math.h> + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#ifndef STANDALONE + + +#define TURTLE_WRITER_AUTO_INDENT(turtle_writer) ((turtle_writer->flags & TURTLE_WRITER_FLAG_AUTO_INDENT) != 0) + +struct raptor_turtle_writer_s { + raptor_world* world; + + int depth; + + raptor_uri* base_uri; + + int my_nstack; + raptor_namespace_stack *nstack; + int nstack_depth; + + /* outputting to this iostream */ + raptor_iostream *iostr; + + /* Turtle Writer flags - bits defined in enum raptor_turtle_writer_flags */ + int flags; + + /* indentation per level if formatting */ + int indent; +}; + + +/* 16 spaces */ +#define SPACES_BUFFER_SIZE sizeof(spaces_buffer) +static const unsigned char spaces_buffer[] = { + ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ' +}; + + +void +raptor_turtle_writer_increase_indent(raptor_turtle_writer *turtle_writer) +{ + turtle_writer->depth += turtle_writer->indent; +} + + +void +raptor_turtle_writer_decrease_indent(raptor_turtle_writer *turtle_writer) +{ + turtle_writer->depth -= turtle_writer->indent; +} + + +void +raptor_turtle_writer_newline(raptor_turtle_writer *turtle_writer) +{ + int num_spaces; + + raptor_iostream_write_byte('\n', turtle_writer->iostr); + + if(!TURTLE_WRITER_AUTO_INDENT(turtle_writer)) + return; + + num_spaces = turtle_writer->depth * turtle_writer->indent; + + while(num_spaces > 0) { + int count; + count = (num_spaces > RAPTOR_GOOD_CAST(int, SPACES_BUFFER_SIZE)) ? + RAPTOR_GOOD_CAST(int, SPACES_BUFFER_SIZE) : num_spaces; + + raptor_iostream_counted_string_write(spaces_buffer, count, turtle_writer->iostr); + + num_spaces -= count; + } + + return; +} + + +void +raptor_turtle_writer_csv_string(raptor_turtle_writer *turtle_writer, + const unsigned char *string) +{ + raptor_iostream *iostr = turtle_writer->iostr; + size_t len = strlen((const char*)string); + const char delim = '\x22'; + int quoting_needed = 0; + size_t i; + + for(i = 0; i < len; i++) { + char c = string[i]; + /* Quoting needed for delim (double quote), comma, linefeed or return */ + if(c == delim || c == ',' || c == '\r' || c == '\n') { + quoting_needed++; + break; + } + } + if(!quoting_needed) { + raptor_iostream_counted_string_write(string, len, iostr); + return; + } + + raptor_iostream_write_byte(delim, iostr); + for(i = 0; i < len; i++) { + char c = string[i]; + if(c == delim) + raptor_iostream_write_byte(delim, iostr); + raptor_iostream_write_byte(c, iostr); + } + raptor_iostream_write_byte(delim, iostr); + + return; +} + +/** + * raptor_new_turtle_writer: + * @world: raptor_world object + * @base_uri: Base URI for the writer (or NULL) + * @write_base_uri: non-0 to write '@base' directive to output + * @nstack: Namespace stack for the writer to start with (or NULL) + * @iostr: I/O stream to write to + * @flags: bitflags from #raptor_turtle_writer_flags + * + * Constructor - Create a new Turtle Writer writing Turtle to a raptor_iostream + * + * Return value: a new #raptor_turtle_writer object or NULL on failure + **/ +raptor_turtle_writer* +raptor_new_turtle_writer(raptor_world* world, + raptor_uri* base_uri, int write_base_uri, + raptor_namespace_stack *nstack, + raptor_iostream* iostr, + int flags) +{ + raptor_turtle_writer* turtle_writer; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!nstack || !iostr) + return NULL; + + raptor_world_open(world); + + turtle_writer = RAPTOR_CALLOC(raptor_turtle_writer*, 1, + sizeof(*turtle_writer)); + + if(!turtle_writer) + return NULL; + + turtle_writer->world = world; + + turtle_writer->nstack_depth = 0; + + turtle_writer->nstack = nstack; + if(!turtle_writer->nstack) { + turtle_writer->nstack = raptor_new_namespaces(world, 1); + turtle_writer->my_nstack = 1; + } + + turtle_writer->iostr = iostr; + + turtle_writer->flags = flags; + turtle_writer->indent = 2; + + turtle_writer->base_uri = NULL; + /* Ensure any initial base URI is not written relative */ + if(base_uri && write_base_uri) + raptor_turtle_writer_base(turtle_writer, base_uri); + turtle_writer->base_uri = base_uri; + + return turtle_writer; +} + + +/** + * raptor_free_turtle_writer: + * @turtle_writer: Turtle writer object + * + * Destructor - Free Turtle Writer + * + **/ +void +raptor_free_turtle_writer(raptor_turtle_writer* turtle_writer) +{ + if(!turtle_writer) + return; + + if(turtle_writer->nstack && turtle_writer->my_nstack) + raptor_free_namespaces(turtle_writer->nstack); + + RAPTOR_FREE(raptor_turtle_writer, turtle_writer); +} + + +static int +raptor_turtle_writer_contains_newline(const unsigned char *s, size_t len) +{ + size_t i = 0; + + for( ; i < len; i++) + if(s[i] == '\n') + return 1; + + return 0; +} + + +/** + * raptor_turtle_writer_raw: + * @turtle_writer: Turtle writer object + * @s: raw string to write + * + * Write a raw string to the Turtle writer verbatim. + * + **/ +void +raptor_turtle_writer_raw(raptor_turtle_writer* turtle_writer, + const unsigned char *s) +{ + raptor_iostream_string_write(s, turtle_writer->iostr); +} + + +/** + * raptor_turtle_writer_raw_counted: + * @turtle_writer: Turtle writer object + * @s: raw string to write + * @len: length of string + * + * Write a counted string to the Turtle writer verbatim. + * + **/ +void +raptor_turtle_writer_raw_counted(raptor_turtle_writer* turtle_writer, + const unsigned char *s, unsigned int len) +{ + raptor_iostream_counted_string_write(s, len, turtle_writer->iostr); +} + + +/** + * raptor_turtle_writer_namespace_prefix: + * @turtle_writer: Turtle writer object + * @ns: Namespace to write prefix declaration for + * + * Write a namespace prefix declaration (@prefix) + * + * Must only be used at the beginning of a document. + */ +void +raptor_turtle_writer_namespace_prefix(raptor_turtle_writer* turtle_writer, + raptor_namespace* ns) +{ + int emit_mkr = (turtle_writer->flags & TURTLE_WRITER_FLAG_MKR); + + raptor_iostream_string_write("@prefix ", turtle_writer->iostr); + if(ns->prefix) + raptor_iostream_string_write(raptor_namespace_get_prefix(ns), + turtle_writer->iostr); + raptor_iostream_counted_string_write(": ", 2, turtle_writer->iostr); + raptor_turtle_writer_reference(turtle_writer, raptor_namespace_get_uri(ns)); + if(emit_mkr) + raptor_iostream_counted_string_write(" ;\n", 3, turtle_writer->iostr); + else + raptor_iostream_counted_string_write(" .\n", 3, turtle_writer->iostr); +} + + +/** + * raptor_turtle_writer_base: + * @turtle_writer: Turtle writer object + * @base_uri: New base URI or NULL + * + * Write a base URI directive (@base) to set the in-scope base URI + */ +void +raptor_turtle_writer_base(raptor_turtle_writer* turtle_writer, + raptor_uri* base_uri) +{ + int emit_mkr = (turtle_writer->flags & TURTLE_WRITER_FLAG_MKR); + + if(base_uri) { + raptor_iostream_counted_string_write("@base ", 6, turtle_writer->iostr); + raptor_turtle_writer_reference(turtle_writer, base_uri); + if(emit_mkr) + raptor_iostream_counted_string_write(" ;\n", 3, turtle_writer->iostr); + else + raptor_iostream_counted_string_write(" .\n", 3, turtle_writer->iostr); + } +} + + +/** + * raptor_turtle_writer_reference: + * @turtle_writer: Turtle writer object + * @uri: URI to write + * + * Write a Turtle-encoded URI to the Turtle writer. + * + * Return value: non-0 on failure + **/ +int +raptor_turtle_writer_reference(raptor_turtle_writer* turtle_writer, + raptor_uri* uri) +{ + return raptor_uri_escaped_write(uri, turtle_writer->base_uri, + RAPTOR_ESCAPED_WRITE_TURTLE_URI, + turtle_writer->iostr); +} + + +/** + * raptor_turtle_writer_qname: + * @turtle_writer: Turtle writer object + * @qname: qname to write + * + * Write a QName to the Turtle writer. + * + **/ +void +raptor_turtle_writer_qname(raptor_turtle_writer* turtle_writer, + raptor_qname* qname) +{ + raptor_iostream* iostr = turtle_writer->iostr; + + if(qname->nspace && qname->nspace->prefix_length > 0) + raptor_iostream_counted_string_write(qname->nspace->prefix, + qname->nspace->prefix_length, + iostr); + raptor_iostream_write_byte(':', iostr); + + raptor_iostream_counted_string_write(qname->local_name, + qname->local_name_length, + iostr); + return; +} + + +/** + * raptor_turtle_writer_quoted_counted_string: + * @turtle_writer: Turtle writer object + * @s: string to write + * @len: string length + * + * Write a Turtle escaped-string inside double quotes to the writer. + * + * Return value: non-0 on failure + **/ +int +raptor_turtle_writer_quoted_counted_string(raptor_turtle_writer* turtle_writer, + const unsigned char *s, size_t len) +{ + const unsigned char *quotes = (const unsigned char *)"\"\"\"\""; + const unsigned char *q = quotes + 2; + size_t q_len = 1; + int flags = RAPTOR_ESCAPED_WRITE_TURTLE_LITERAL; + int rc = 0; + + if(!s) + return 1; + + /* Turtle """longstring""" (2) or "string" (1) */ + if(raptor_turtle_writer_contains_newline(s, len)) { + /* long string */ + flags = RAPTOR_ESCAPED_WRITE_TURTLE_LONG_LITERAL; + q = quotes; + q_len = 3; + } + + raptor_iostream_counted_string_write(q, q_len, turtle_writer->iostr); + rc = raptor_string_escaped_write(s, len, '"', + flags, turtle_writer->iostr); + raptor_iostream_counted_string_write(q, q_len, turtle_writer->iostr); + + return rc; +} + + +/* + * raptor_turtle_writer_literal: + * @turtle_writer: Turtle writer object + * @nstack: Namespace stack for making a QName for datatype URI + * @s: literal string to write (SHARED) + * @lang: language tag (may be NULL) + * @datatype: datatype URI (may be NULL) + * + * INTERNAL - Write a literal (possibly with lang and datatype) to the Turtle writer. + * + * Return value: non-0 on failure + **/ +int +raptor_turtle_writer_literal(raptor_turtle_writer* turtle_writer, + raptor_namespace_stack *nstack, + const unsigned char* s, const unsigned char* lang, + raptor_uri* datatype) +{ + /* DBL_MAX = 309 decimal digits */ + #define INT_MAX_LEN 309 + + /* DBL_EPSILON = 52 digits */ + #define FRAC_MAX_LEN 52 + + char* endptr = (char *)s; + int written = 0; + + /* typed literal special cases */ + if(datatype) { + /* integer */ + if(raptor_uri_equals(datatype, turtle_writer->world->xsd_integer_uri)) { + /* FIXME. Work around that gcc < 4.5 cannot disable warn_unused_result */ + long gcc_is_stupid = strtol((const char*)s, &endptr, 10); + if(endptr != (char*)s && !*endptr) { + raptor_iostream_string_write(s, turtle_writer->iostr); + /* More gcc madness to 'use' the variable I didn't want */ + written = 1 + 0 * (int)gcc_is_stupid; + } else { + raptor_log_error(turtle_writer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Illegal value for xsd:integer literal."); + } + + /* double, decimal */ + } else if(raptor_uri_equals(datatype, turtle_writer->world->xsd_double_uri) || + raptor_uri_equals(datatype, turtle_writer->world->xsd_decimal_uri)) { + /* FIXME. Work around that gcc < 4.5 cannot disable warn_unused_result */ + double gcc_is_doubly_stupid = strtod((const char*)s, &endptr); + if(endptr != (char*)s && !*endptr) { + raptor_iostream_string_write(s, turtle_writer->iostr); + /* More gcc madness to 'use' the variable I didn't want */ + written = 1 + 0 * (int)gcc_is_doubly_stupid; + } else { + raptor_log_error(turtle_writer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Illegal value for xsd:double or xsd:decimal literal."); + } + + /* boolean */ + } else if(raptor_uri_equals(datatype, turtle_writer->world->xsd_boolean_uri)) { + if(!strcmp((const char*)s, "0") || !strcmp((const char*)s, "false")) { + raptor_iostream_string_write("false", turtle_writer->iostr); + written = 1; + } else if(!strcmp((const char*)s, "1") || !strcmp((const char*)s, "true")) { + raptor_iostream_string_write("true", turtle_writer->iostr); + written = 1; + } else { + raptor_log_error(turtle_writer->world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Illegal value for xsd:boolean literal."); + } + } + } + + if(written) + return 0; + + if(raptor_turtle_writer_quoted_counted_string(turtle_writer, s, + strlen((const char*)s))) + return 1; + + /* typed literal, not a special case */ + if(datatype) { + raptor_qname* qname; + + raptor_iostream_string_write("^^", turtle_writer->iostr); + qname = raptor_new_qname_from_namespace_uri(nstack, datatype, 10); + if(qname) { + raptor_turtle_writer_qname(turtle_writer, qname); + raptor_free_qname(qname); + } else + raptor_turtle_writer_reference(turtle_writer, datatype); + } else if(lang) { + /* literal with language tag */ + raptor_iostream_write_byte('@', turtle_writer->iostr); + raptor_iostream_string_write(lang, turtle_writer->iostr); + } + + return 0; +} + + +/** + * raptor_turtle_writer_comment: + * @turtle_writer: Turtle writer object + * @s: comment string to write + * + * Write a Turtle comment to the Turtle writer. + * + **/ +void +raptor_turtle_writer_comment(raptor_turtle_writer* turtle_writer, + const unsigned char *string) +{ + unsigned char c; + size_t len = strlen((const char*)string); + + raptor_iostream_counted_string_write((const unsigned char*)"# ", 2, + turtle_writer->iostr); + + for(; (c=*string); string++, len--) { + if(c == '\n') { + raptor_turtle_writer_newline(turtle_writer); + raptor_iostream_counted_string_write((const unsigned char*)"# ", 2, + turtle_writer->iostr); + } else if(c != '\r') { + /* skip carriage returns (windows... *sigh*) */ + raptor_iostream_write_byte(c, turtle_writer->iostr); + } + } + + raptor_turtle_writer_newline(turtle_writer); +} + + +/** + * raptor_turtle_writer_set_option: + * @turtle_writer: #raptor_turtle_writer turtle_writer object + * @option: option to set from enumerated #raptor_option values + * @value: integer option value (0 or larger) + * + * Set turtle_writer options with integer values. + * + * The allowed options are available via + * raptor_world_get_option_description() + * + * Return value: non 0 on failure or if the option is unknown + **/ +int +raptor_turtle_writer_set_option(raptor_turtle_writer *turtle_writer, + raptor_option option, int value) +{ + if(value < 0 || + !raptor_option_is_valid_for_area(option, RAPTOR_OPTION_AREA_TURTLE_WRITER)) + return 1; + + switch(option) { + case RAPTOR_OPTION_WRITER_AUTO_INDENT: + if(value) + turtle_writer->flags |= TURTLE_WRITER_FLAG_AUTO_INDENT; + else + turtle_writer->flags &= ~TURTLE_WRITER_FLAG_AUTO_INDENT; + break; + + case RAPTOR_OPTION_WRITER_INDENT_WIDTH: + turtle_writer->indent = value; + break; + + case RAPTOR_OPTION_WRITER_AUTO_EMPTY: + case RAPTOR_OPTION_WRITER_XML_VERSION: + case RAPTOR_OPTION_WRITER_XML_DECLARATION: + break; + + /* parser options */ + case RAPTOR_OPTION_SCANNING: + case RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES: + case RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES: + case RAPTOR_OPTION_ALLOW_BAGID: + case RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST: + case RAPTOR_OPTION_NORMALIZE_LANGUAGE: + case RAPTOR_OPTION_NON_NFC_FATAL: + case RAPTOR_OPTION_WARN_OTHER_PARSETYPES: + case RAPTOR_OPTION_CHECK_RDF_ID: + case RAPTOR_OPTION_HTML_TAG_SOUP: + case RAPTOR_OPTION_MICROFORMATS: + case RAPTOR_OPTION_HTML_LINK: + case RAPTOR_OPTION_WWW_TIMEOUT: + case RAPTOR_OPTION_STRICT: + + /* Shared */ + case RAPTOR_OPTION_NO_NET: + case RAPTOR_OPTION_NO_FILE: + case RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES: + + /* XML writer options */ + case RAPTOR_OPTION_RELATIVE_URIS: + + /* DOT serializer options */ + case RAPTOR_OPTION_RESOURCE_BORDER: + case RAPTOR_OPTION_LITERAL_BORDER: + case RAPTOR_OPTION_BNODE_BORDER: + case RAPTOR_OPTION_RESOURCE_FILL: + case RAPTOR_OPTION_LITERAL_FILL: + case RAPTOR_OPTION_BNODE_FILL: + + /* JSON serializer options */ + case RAPTOR_OPTION_JSON_CALLBACK: + case RAPTOR_OPTION_JSON_EXTRA_DATA: + case RAPTOR_OPTION_RSS_TRIPLES: + case RAPTOR_OPTION_ATOM_ENTRY_URI: + case RAPTOR_OPTION_PREFIX_ELEMENTS: + + /* Turtle serializer option */ + case RAPTOR_OPTION_WRITE_BASE_URI: + + /* WWW option */ + case RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL: + case RAPTOR_OPTION_WWW_HTTP_USER_AGENT: + case RAPTOR_OPTION_WWW_CERT_FILENAME: + case RAPTOR_OPTION_WWW_CERT_TYPE: + case RAPTOR_OPTION_WWW_CERT_PASSPHRASE: + case RAPTOR_OPTION_WWW_SSL_VERIFY_PEER: + case RAPTOR_OPTION_WWW_SSL_VERIFY_HOST: + + default: + return -1; + } + + return 0; +} + + +/** + * raptor_turtle_writer_set_option_string: + * @turtle_writer: #raptor_turtle_writer turtle_writer object + * @option: option to set from enumerated #raptor_option values + * @value: option value + * + * Set turtle_writer options with string values. + * + * The allowed options are available via + * raptor_world_get_option_description(). + * If the option type is integer, the value is interpreted as an + * integer. + * + * Return value: non 0 on failure or if the option is unknown + **/ +int +raptor_turtle_writer_set_option_string(raptor_turtle_writer *turtle_writer, + raptor_option option, + const unsigned char *value) +{ + if(!value || + !raptor_option_is_valid_for_area(option, RAPTOR_OPTION_AREA_TURTLE_WRITER)) + return 1; + + if(raptor_option_value_is_numeric(option)) + return raptor_turtle_writer_set_option(turtle_writer, option, + atoi((const char*)value)); + + return 1; +} + + +/** + * raptor_turtle_writer_get_option: + * @turtle_writer: #raptor_turtle_writer serializer object + * @option: option to get value + * + * Get various turtle_writer options. + * + * The allowed options are available via raptor_options_enumerate(). + * + * Note: no option value is negative + * + * Return value: option value or < 0 for an illegal option + **/ +int +raptor_turtle_writer_get_option(raptor_turtle_writer *turtle_writer, + raptor_option option) +{ + int result = -1; + + switch(option) { + case RAPTOR_OPTION_WRITER_AUTO_INDENT: + result = TURTLE_WRITER_AUTO_INDENT(turtle_writer); + break; + + case RAPTOR_OPTION_WRITER_INDENT_WIDTH: + result = turtle_writer->indent; + break; + + /* writer options */ + case RAPTOR_OPTION_WRITER_AUTO_EMPTY: + case RAPTOR_OPTION_WRITER_XML_VERSION: + case RAPTOR_OPTION_WRITER_XML_DECLARATION: + + /* parser options */ + case RAPTOR_OPTION_SCANNING: + case RAPTOR_OPTION_ALLOW_NON_NS_ATTRIBUTES: + case RAPTOR_OPTION_ALLOW_OTHER_PARSETYPES: + case RAPTOR_OPTION_ALLOW_BAGID: + case RAPTOR_OPTION_ALLOW_RDF_TYPE_RDF_LIST: + case RAPTOR_OPTION_NORMALIZE_LANGUAGE: + case RAPTOR_OPTION_NON_NFC_FATAL: + case RAPTOR_OPTION_WARN_OTHER_PARSETYPES: + case RAPTOR_OPTION_CHECK_RDF_ID: + case RAPTOR_OPTION_HTML_TAG_SOUP: + case RAPTOR_OPTION_MICROFORMATS: + case RAPTOR_OPTION_HTML_LINK: + case RAPTOR_OPTION_WWW_TIMEOUT: + case RAPTOR_OPTION_STRICT: + + /* Shared */ + case RAPTOR_OPTION_NO_NET: + case RAPTOR_OPTION_NO_FILE: + case RAPTOR_OPTION_LOAD_EXTERNAL_ENTITIES: + + /* XML writer options */ + case RAPTOR_OPTION_RELATIVE_URIS: + + /* DOT serializer options */ + case RAPTOR_OPTION_RESOURCE_BORDER: + case RAPTOR_OPTION_LITERAL_BORDER: + case RAPTOR_OPTION_BNODE_BORDER: + case RAPTOR_OPTION_RESOURCE_FILL: + case RAPTOR_OPTION_LITERAL_FILL: + case RAPTOR_OPTION_BNODE_FILL: + + /* JSON serializer options */ + case RAPTOR_OPTION_JSON_CALLBACK: + case RAPTOR_OPTION_JSON_EXTRA_DATA: + case RAPTOR_OPTION_RSS_TRIPLES: + case RAPTOR_OPTION_ATOM_ENTRY_URI: + case RAPTOR_OPTION_PREFIX_ELEMENTS: + + /* Turtle serializer option */ + case RAPTOR_OPTION_WRITE_BASE_URI: + + /* WWW option */ + case RAPTOR_OPTION_WWW_HTTP_CACHE_CONTROL: + case RAPTOR_OPTION_WWW_HTTP_USER_AGENT: + case RAPTOR_OPTION_WWW_CERT_FILENAME: + case RAPTOR_OPTION_WWW_CERT_TYPE: + case RAPTOR_OPTION_WWW_CERT_PASSPHRASE: + case RAPTOR_OPTION_WWW_SSL_VERIFY_PEER: + case RAPTOR_OPTION_WWW_SSL_VERIFY_HOST: + + default: + break; + } + + return result; +} + + +/** + * raptor_turtle_writer_get_option_string: + * @turtle_writer: #raptor_turtle_writer serializer object + * @option: option to get value + * + * Get turtle_writer options with string values. + * + * The allowed options are available via raptor_options_enumerate(). + * + * Return value: option value or NULL for an illegal option or no value + **/ +const unsigned char * +raptor_turtle_writer_get_option_string(raptor_turtle_writer *turtle_writer, + raptor_option option) +{ + return NULL; +} + + +/** + * raptor_turtle_writer_bnodeid: + * @turtle_writer: Turtle writer object + * @bnodeid: blank node ID to write + * @len: length of @bnodeid + * + * Write a blank node ID with leading _: to the Turtle writer. + * + **/ +void +raptor_turtle_writer_bnodeid(raptor_turtle_writer* turtle_writer, + const unsigned char *bnodeid, size_t len) +{ + raptor_bnodeid_ntriples_write(bnodeid, len, + turtle_writer->iostr); +} + + +/** + * raptor_turtle_writer_uri: + * @turtle_writer: Turtle writer object + * @uri: uri + * + * Write a #raptor_uri to a turtle writer in qname or URI form + * + * Return value: non-0 on failure + */ +int +raptor_turtle_writer_uri(raptor_turtle_writer* turtle_writer, + raptor_uri* uri) +{ + raptor_qname* qname; + int rc = 0; + + if(!uri) + return 1; + + qname = raptor_new_qname_from_namespace_uri(turtle_writer->nstack, uri, 10); + + /* XML Names allow leading '_' and '.' anywhere but Turtle does not */ + if(qname && !raptor_turtle_is_legal_turtle_qname(qname)) { + raptor_free_qname(qname); + qname = NULL; + } + + if(qname) { + raptor_turtle_writer_qname(turtle_writer, qname); + raptor_free_qname(qname); + } else { + rc = raptor_turtle_writer_reference(turtle_writer, uri); + } + + return rc; +} + + +/** + * raptor_turtle_writer_term: + * @turtle_writer: Turtle writer object + * @term: term + * + * Write a #raptor_term to a turtle write + * + * Return value: non-0 on failure + */ +int +raptor_turtle_writer_term(raptor_turtle_writer* turtle_writer, + raptor_term* term) +{ + int rc = 0; + + if(!term) + return 1; + + if(term->type == RAPTOR_TERM_TYPE_URI) { + rc = raptor_turtle_writer_uri(turtle_writer, term->value.uri); + } else if(term->type == RAPTOR_TERM_TYPE_LITERAL) { + rc = raptor_turtle_writer_literal(turtle_writer, + turtle_writer->nstack, + term->value.literal.string, + term->value.literal.language, + term->value.literal.datatype); + } else if(term->type == RAPTOR_TERM_TYPE_BLANK) { + rc = raptor_bnodeid_ntriples_write(term->value.blank.string, + term->value.blank.string_len, + turtle_writer->iostr); + } else { + rc = 2; + } + + return rc; +} + + + + +#endif + + + +#ifdef STANDALONE + +/* one more prototype */ +int main(int argc, char *argv[]); + + +const unsigned char *base_uri_string = (const unsigned char*)"http://example.org/base#"; + +const unsigned char* longstr = (const unsigned char*)"it's quoted\nand has newlines, \"s <> and\n\ttabbing"; + +#define OUT_BYTES_COUNT 149 + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *program = raptor_basename(argv[0]); + raptor_iostream *iostr; + raptor_namespace_stack *nstack; + raptor_namespace* ex_ns; + raptor_turtle_writer* turtle_writer; + raptor_uri* base_uri; + raptor_qname* el_name; + unsigned long count; + + /* for raptor_new_iostream_to_string */ + void *string = NULL; + size_t string_len = 0; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + iostr = raptor_new_iostream_to_string(world, &string, &string_len, NULL); + if(!iostr) { + fprintf(stderr, "%s: Failed to create iostream to string\n", program); + exit(1); + } + + nstack = raptor_new_namespaces(world, 1); + + base_uri = raptor_new_uri(world, base_uri_string); + + turtle_writer = raptor_new_turtle_writer(world, base_uri, 1, nstack, iostr, 0); + if(!turtle_writer) { + fprintf(stderr, "%s: Failed to create turtle_writer to iostream\n", program); + exit(1); + } + + raptor_turtle_writer_set_option(turtle_writer, + RAPTOR_OPTION_WRITER_AUTO_INDENT, 1); + + ex_ns = raptor_new_namespace(nstack, + (const unsigned char*)"ex", + (const unsigned char*)"http://example.org/ns#", + 0); + + + raptor_turtle_writer_namespace_prefix(turtle_writer, ex_ns); + + raptor_turtle_writer_reference(turtle_writer, base_uri); + + raptor_turtle_writer_increase_indent(turtle_writer); + raptor_turtle_writer_newline(turtle_writer); + + raptor_turtle_writer_raw(turtle_writer, (const unsigned char*)"ex:foo "); + + raptor_turtle_writer_quoted_counted_string(turtle_writer, longstr, + strlen((const char*)longstr)); + raptor_turtle_writer_raw_counted(turtle_writer, + (const unsigned char*)" ;", 2); + raptor_turtle_writer_newline(turtle_writer); + + el_name = raptor_new_qname_from_namespace_local_name(world, + ex_ns, + (const unsigned char*)"bar", + NULL); + + raptor_turtle_writer_qname(turtle_writer, el_name); + raptor_free_qname(el_name); + + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)" ", 1); + + raptor_turtle_writer_literal(turtle_writer, nstack, + (const unsigned char*)"10.0", NULL, + world->xsd_decimal_uri); + + raptor_turtle_writer_newline(turtle_writer); + + raptor_turtle_writer_decrease_indent(turtle_writer); + + raptor_turtle_writer_raw_counted(turtle_writer, (const unsigned char*)".", 1); + raptor_turtle_writer_newline(turtle_writer); + + + raptor_free_turtle_writer(turtle_writer); + + raptor_free_namespace(ex_ns); + + raptor_free_namespaces(nstack); + + raptor_free_uri(base_uri); + + + count = raptor_iostream_tell(iostr); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Freeing iostream\n", program); +#endif + raptor_free_iostream(iostr); + + if(count != OUT_BYTES_COUNT) { + fprintf(stderr, "%s: I/O stream wrote %d bytes, expected %d\n", program, + (int)count, (int)OUT_BYTES_COUNT); + fputs("[[", stderr); + (void)fwrite(string, 1, string_len, stderr); + fputs("]]\n", stderr); + return 1; + } + + if(!string) { + fprintf(stderr, "%s: I/O stream failed to create a string\n", program); + return 1; + } + string_len = strlen((const char*)string); + if(string_len != count) { + fprintf(stderr, "%s: I/O stream created a string length %d, expected %d\n", program, (int)string_len, (int)count); + return 1; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Made Turtle string of %d bytes\n", program, (int)string_len); + fputs("[[", stderr); + (void)fwrite(string, 1, string_len, stderr); + fputs("]]\n", stderr); +#endif + + raptor_free_memory(string); + + raptor_free_world(world); + + /* keep gcc -Wall happy */ + return(0); +} + +#endif diff --git a/src/raptor_unicode.c b/src/raptor_unicode.c new file mode 100644 index 0000000..c50d253 --- /dev/null +++ b/src/raptor_unicode.c @@ -0,0 +1,940 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_unicode.c - Raptor Unicode and UTF-8 support + * + * Copyright (C) 2002-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2002-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <stdarg.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* Unicode defines only the range U+0000 to U+10FFFF */ +const raptor_unichar raptor_unicode_max_codepoint = 0x10FFFF; + + +/** + * raptor_unicode_utf8_string_put_char: + * @c: Unicode character + * @output: UTF-8 string buffer or NULL + * @length: length of output buffer + * + * Encode a Unicode character to a UTF-8 string + * + * If @output is NULL, then will calculate the length rather than + * perform the encoding. This can be used by the called to allocate + * space and then re-call this function with the new buffer. + * + * Return value: number of bytes encoded to output buffer or <0 on failure + **/ +int +raptor_unicode_utf8_string_put_char(raptor_unichar c, + unsigned char *output, size_t length) +{ + size_t size = 0; + + /* check for illegal code positions: + * [ U+D800 to U+DFFF (UTF-16 surrogates) - now allowed ] + * U+FFFE and U+FFFF + */ + if(c == 0xFFFE || c == 0xFFFF) + return -1; + + if (c < 0x00000080) + size = 1; + else if(c < 0x00000800) + size = 2; + else if(c < 0x00010000) + size = 3; + else if(c < 0x00200000) + size = 4; + else if(c < 0x04000000) + size = 5; + else if(c < 0x80000000) + size = 6; + else + return -1; + + /* when no buffer given, return size */ + if(!output) + return RAPTOR_GOOD_CAST(int, size); /* ok since size is in range 1..6 */ + + if(size > length) + return -1; + + switch(size) { + case 6: + output[5] = RAPTOR_GOOD_CAST(unsigned char, 0x80 | (unsigned char)(c & 0x3F)); + c= c >> 6; + /* set bit 2 (bits 7,6,5,4,3,2 less 7,6,5,4,3 set below) on last byte */ + c |= 0x4000000; /* 0x10000 = 0x04 << 24 */ + /* FALLTHROUGH */ + case 5: + output[4] = RAPTOR_GOOD_CAST(unsigned char, 0x80 | (unsigned char)(c & 0x3F)); + c= c >> 6; + /* set bit 3 (bits 7,6,5,4,3 less 7,6,5,4 set below) on last byte */ + c |= 0x200000; /* 0x10000 = 0x08 << 18 */ + /* FALLTHROUGH */ + case 4: + output[3] = RAPTOR_GOOD_CAST(unsigned char, 0x80 | (unsigned char)(c & 0x3F)); + c= c >> 6; + /* set bit 4 (bits 7,6,5,4 less 7,6,5 set below) on last byte */ + c |= 0x10000; /* 0x10000 = 0x10 << 12 */ + /* FALLTHROUGH */ + case 3: + output[2] = RAPTOR_GOOD_CAST(unsigned char, 0x80 | (unsigned char)(c & 0x3F)); + c= c >> 6; + /* set bit 5 (bits 7,6,5 less 7,6 set below) on last byte */ + c |= 0x800; /* 0x800 = 0x20 << 6 */ + /* FALLTHROUGH */ + case 2: + output[1] = RAPTOR_GOOD_CAST(unsigned char, 0x80 | (unsigned char)(c & 0x3F)); + c= c >> 6; + /* set bits 7,6 on last byte */ + c |= 0xc0; + /* FALLTHROUGH */ + case 1: + output[0] = (unsigned char)c; + } + + return RAPTOR_GOOD_CAST(int, size); /* ok since size is in range 1..6 */ +} + + +/** + * raptor_unicode_utf8_string_get_char: + * @input: UTF-8 string buffer + * @length: buffer size + * @output: Pointer to the Unicode character or NULL + * + * Decode a UTF-8 encoded string to get a Unicode character. + * + * If output is NULL, then will calculate the number of bytes that + * will be used from the input buffer and not perform the conversion. + * + * Return value: bytes used from input buffer or <0 on failure: -1 input buffer too short or length error, -2 overlong UTF-8 sequence, -3 illegal code positions, -4 code out of range U+0000 to U+10FFFF. In cases -2, -3 and -4 the coded character is stored in the output. + */ +int +raptor_unicode_utf8_string_get_char(const unsigned char *input, size_t length, + raptor_unichar *output) +{ + unsigned char in; + size_t size; + raptor_unichar c = 0; + + if(length < 1) + return -1; + + in=*input++; + if((in & 0x80) == 0) { + size = 1; + c= in & 0x7f; + } else if((in & 0xe0) == 0xc0) { + size = 2; + c= in & 0x1f; + } else if((in & 0xf0) == 0xe0) { + size = 3; + c= in & 0x0f; + } else if((in & 0xf8) == 0xf0) { + size = 4; + c = in & 0x07; + } else if((in & 0xfc) == 0xf8) { + size = 5; + c = in & 0x03; + } else if((in & 0xfe) == 0xfc) { + size = 6; + c = in & 0x01; + } else + return -1; + + + if(!output) + return RAPTOR_GOOD_CAST(int, size); /* ok since size is in range 1..6 */ + + if(length < size) + return -1; + + switch(size) { + case 6: + in=*input++ & 0x3f; + c= c << 6; + c |= in; + /* FALLTHROUGH */ + case 5: + in=*input++ & 0x3f; + c= c << 6; + c |= in; + /* FALLTHROUGH */ + case 4: + in=*input++ & 0x3f; + c= c << 6; + c |= in; + /* FALLTHROUGH */ + case 3: + in=*input++ & 0x3f; + c= c << 6; + c |= in; + /* FALLTHROUGH */ + case 2: + /* '*input' used here since we never need to use new value of input [CLANG] */ + in = *input & 0x3f; + c= c << 6; + c |= in; + /* FALLTHROUGH */ + default: + break; + } + + *output=c; + + /* check for overlong UTF-8 sequences */ + switch(size) { + case 2: + if(c < 0x00000080) + return -2; + break; + case 3: + if(c < 0x00000800) + return -2; + break; + case 4: + if(c < 0x00010000) + return -2; + break; + + default: /* 1 */ + break; + } + + + /* check for illegal code positions: + * [ U+D800 to U+DFFF (UTF-16 surrogates) - now allowed ] + * U+FFFE and U+FFFF + */ + if(c == 0xFFFE || c == 0xFFFF) + return -3; + + if(c > raptor_unicode_max_codepoint) + return -4; + + return RAPTOR_GOOD_CAST(int, size); /* ok since size is in range 1..6 */ +} + + +static int raptor_unicode_is_letter(long c); +static int raptor_unicode_is_basechar(long c); +static int raptor_unicode_is_ideographic(long c); +static int raptor_unicode_is_combiningchar(long c); +static int raptor_unicode_is_digit(long c); +static int raptor_unicode_is_extender(long c); + + +/** + * raptor_unicode_is_xml11_namestartchar: + * @c: Unicode character to check + * + * Check if Unicode character is legal to start an XML 1.1 Name + * + * See <ulink url="http://www.w3.org/TR/2004/REC-xml11-20040204/#NT-NameStartChar">Namespaces in XML 1.1 REC 2004-02-04 NameStartChar</ulink> + * updating + * <ulink url="http://www.w3.org/TR/2004/REC-xml11-20040204/">Extensible Markup Language (XML) 1.1 REC 2004-02-04</ulink> sec 2.3, [4a] + * excluding the ':' + * + * Return value: non-0 if legal + **/ +int +raptor_unicode_is_xml11_namestartchar(raptor_unichar c) +{ + return (((c >= 0x0041) && (c <= 0x005A)) || /* [A-Z] */ + (c == 0x005F) || /* '_' */ + ((c >= 0x0061) && (c <= 0x007A)) || /* [a-z] */ + ((c >= 0x00C0) && (c <= 0x00D6)) || + ((c >= 0x00D8) && (c <= 0x00F6)) || + ((c >= 0x00F8) && (c <= 0x02FF)) || + ((c >= 0x0370) && (c <= 0x037D)) || + ((c >= 0x037F) && (c <= 0x1FFF)) || + ((c >= 0x200C) && (c <= 0x200D)) || + ((c >= 0x2070) && (c <= 0x218F)) || + ((c >= 0x2C00) && (c <= 0x2FEF)) || + ((c >= 0x3001) && (c <= 0xD7FF)) || + ((c >= 0xF900) && (c <= 0xFDCF)) || + ((c >= 0xFDF0) && (c <= 0xFFFD)) || + ((c >= 0x10000) && (c <= 0xEFFFF))); +} + + +/** + * raptor_unicode_is_xml10_namestartchar: + * @c: Unicode character to check + * + * Check if Unicode character is legal to start an XML 1.0 Name + * + * See <ulink url="http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName">Namespaces in XML REC 1999-01-14</ulink> + * updating + * <ulink url="http://www.w3.org/TR/2004/REC-xml-20040204/">Extensible Markup Language (XML) 1.0 (Third Edition) REC 2004-02-04</ulink> + * excluding the ':' + * + * Return value: non-0 if legal + **/ +int +raptor_unicode_is_xml10_namestartchar(raptor_unichar c) +{ + return (raptor_unicode_is_letter(c) || + (c == '_')); +} + + +/** + * raptor_unicode_is_namestartchar: + * @c: Unicode character to check + * + * Check if Unicode character is legal to start an XML Name + * + * Return value: non-0 if the character is legal + **/ +int +raptor_unicode_is_namestartchar(raptor_unichar c) { +#ifdef RAPTOR_XML_1_1 + return raptor_unicode_is_xml11_namestartchar(c); +#else + return raptor_unicode_is_xml10_namestartchar(c); +#endif +} + + +/** + * raptor_unicode_is_xml11_namechar: + * @c: Unicode character + * + * Check if a Unicode codepoint is a legal to continue an XML 1.1 Name + * + * See <ulink url="http://www.w3.org/TR/2004/REC-xml11-20040204/">Namespaces in XML 1.1 REC 2004-02-04</ulink> + * updating + * <ulink url="http://www.w3.org/TR/2004/REC-xml-20040204/">Extensible Markup Language (XML) 1.0 (Third Edition) REC 2004-02-04</ulink> sec 2.3, [4a] + * excluding the ':' + * + * Return value: non-0 if legal + **/ +int +raptor_unicode_is_xml11_namechar(raptor_unichar c) +{ + return (raptor_unicode_is_xml11_namestartchar(c) || + (c == 0x002D) || /* '-' */ + (c == 0x002E) || /* '.' */ + (c >= 0x0030 && c <= 0x0039) || /* 0-9 */ + (c == 0x00B7) || + (c >= 0x0300 && c <=0x036F) || + (c >= 0x203F && c <=0x2040)); +} + + +/** + * raptor_unicode_is_xml10_namechar: + * @c: Unicode character + * + * Check if a Unicode codepoint is a legal to continue an XML 1.0 Name + * + * See <ulink url="http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCNameChar">Namespaces in XML REC 1999-01-14 NCNameChar</ulink> + * updating + * <ulink url="http://www.w3.org/TR/2004/REC-xml-20040204/">Extensible Markup Language (XML) 1.0 (Third Edition) REC 2004-02-04</ulink> + * excluding the ':' + * + * Return value: non-0 if legal + **/ +int +raptor_unicode_is_xml10_namechar(raptor_unichar c) +{ + return (raptor_unicode_is_letter(c) || + raptor_unicode_is_digit(c) || + (c == 0x002E) || /* '.' */ + (c == 0x002D) || /* '-' */ + (c == 0x005F) || /* '_' */ + raptor_unicode_is_combiningchar(c) || + raptor_unicode_is_extender(c)); +} + + +/** + * raptor_unicode_is_namechar: + * @c: Unicode character to check + * + * Check if Unicode character is legal to continue an XML Name . + * + * Return value: non-0 if the character is legal + **/ +int +raptor_unicode_is_namechar(raptor_unichar c) +{ +#ifdef RAPTOR_XML_1_1 + return raptor_unicode_is_xml11_namechar(c); +#else + return raptor_unicode_is_xml10_namechar(c); +#endif +} + + +/* + * All this below was derived by machine-transforming the classes in Appendix B + * of http://www.w3.org/TR/2000/REC-xml-20001006 + */ + +static int +raptor_unicode_is_letter(long c) +{ + return(raptor_unicode_is_basechar(c) || + raptor_unicode_is_ideographic(c)); +} + + +static int +raptor_unicode_is_basechar(long c) +{ + /* http://www.w3.org/TR/2000/REC-xml-20001006#NT-BaseChar */ + return((c >= 0x0041 && c <= 0x005A ) || + (c >= 0x0061 && c <= 0x007A ) || + (c >= 0x00C0 && c <= 0x00D6 ) || + (c >= 0x00D8 && c <= 0x00F6 ) || + (c >= 0x00F8 && c <= 0x00FF ) || + (c >= 0x0100 && c <= 0x0131 ) || + (c >= 0x0134 && c <= 0x013E ) || + (c >= 0x0141 && c <= 0x0148 ) || + (c >= 0x014A && c <= 0x017E ) || + (c >= 0x0180 && c <= 0x01C3 ) || + (c >= 0x01CD && c <= 0x01F0 ) || + (c >= 0x01F4 && c <= 0x01F5 ) || + (c >= 0x01FA && c <= 0x0217 ) || + (c >= 0x0250 && c <= 0x02A8 ) || + (c >= 0x02BB && c <= 0x02C1 ) || + (c == 0x0386) || + (c >= 0x0388 && c <= 0x038A ) || + (c == 0x038C) || + (c >= 0x038E && c <= 0x03A1 ) || + (c >= 0x03A3 && c <= 0x03CE ) || + (c >= 0x03D0 && c <= 0x03D6 ) || + (c == 0x03DA) || + (c == 0x03DC) || + (c == 0x03DE) || + (c == 0x03E0) || + (c >= 0x03E2 && c <= 0x03F3 ) || + (c >= 0x0401 && c <= 0x040C ) || + (c >= 0x040E && c <= 0x044F ) || + (c >= 0x0451 && c <= 0x045C ) || + (c >= 0x045E && c <= 0x0481 ) || + (c >= 0x0490 && c <= 0x04C4 ) || + (c >= 0x04C7 && c <= 0x04C8 ) || + (c >= 0x04CB && c <= 0x04CC ) || + (c >= 0x04D0 && c <= 0x04EB ) || + (c >= 0x04EE && c <= 0x04F5 ) || + (c >= 0x04F8 && c <= 0x04F9 ) || + (c >= 0x0531 && c <= 0x0556 ) || + (c == 0x0559) || + (c >= 0x0561 && c <= 0x0586 ) || + (c >= 0x05D0 && c <= 0x05EA ) || + (c >= 0x05F0 && c <= 0x05F2 ) || + (c >= 0x0621 && c <= 0x063A ) || + (c >= 0x0641 && c <= 0x064A ) || + (c >= 0x0671 && c <= 0x06B7 ) || + (c >= 0x06BA && c <= 0x06BE ) || + (c >= 0x06C0 && c <= 0x06CE ) || + (c >= 0x06D0 && c <= 0x06D3 ) || + (c == 0x06D5) || + (c >= 0x06E5 && c <= 0x06E6 ) || + (c >= 0x0905 && c <= 0x0939 ) || + (c == 0x093D) || + (c >= 0x0958 && c <= 0x0961 ) || + (c >= 0x0985 && c <= 0x098C ) || + (c >= 0x098F && c <= 0x0990 ) || + (c >= 0x0993 && c <= 0x09A8 ) || + (c >= 0x09AA && c <= 0x09B0 ) || + (c == 0x09B2) || + (c >= 0x09B6 && c <= 0x09B9 ) || + (c >= 0x09DC && c <= 0x09DD ) || + (c >= 0x09DF && c <= 0x09E1 ) || + (c >= 0x09F0 && c <= 0x09F1 ) || + (c >= 0x0A05 && c <= 0x0A0A ) || + (c >= 0x0A0F && c <= 0x0A10 ) || + (c >= 0x0A13 && c <= 0x0A28 ) || + (c >= 0x0A2A && c <= 0x0A30 ) || + (c >= 0x0A32 && c <= 0x0A33 ) || + (c >= 0x0A35 && c <= 0x0A36 ) || + (c >= 0x0A38 && c <= 0x0A39 ) || + (c >= 0x0A59 && c <= 0x0A5C ) || + (c == 0x0A5E) || + (c >= 0x0A72 && c <= 0x0A74 ) || + (c >= 0x0A85 && c <= 0x0A8B ) || + (c == 0x0A8D) || + (c >= 0x0A8F && c <= 0x0A91 ) || + (c >= 0x0A93 && c <= 0x0AA8 ) || + (c >= 0x0AAA && c <= 0x0AB0 ) || + (c >= 0x0AB2 && c <= 0x0AB3 ) || + (c >= 0x0AB5 && c <= 0x0AB9 ) || + (c == 0x0ABD) || + (c == 0x0AE0) || + (c >= 0x0B05 && c <= 0x0B0C ) || + (c >= 0x0B0F && c <= 0x0B10 ) || + (c >= 0x0B13 && c <= 0x0B28 ) || + (c >= 0x0B2A && c <= 0x0B30 ) || + (c >= 0x0B32 && c <= 0x0B33 ) || + (c >= 0x0B36 && c <= 0x0B39 ) || + (c == 0x0B3D) || + (c >= 0x0B5C && c <= 0x0B5D ) || + (c >= 0x0B5F && c <= 0x0B61 ) || + (c >= 0x0B85 && c <= 0x0B8A ) || + (c >= 0x0B8E && c <= 0x0B90 ) || + (c >= 0x0B92 && c <= 0x0B95 ) || + (c >= 0x0B99 && c <= 0x0B9A ) || + (c == 0x0B9C) || + (c >= 0x0B9E && c <= 0x0B9F ) || + (c >= 0x0BA3 && c <= 0x0BA4 ) || + (c >= 0x0BA8 && c <= 0x0BAA ) || + (c >= 0x0BAE && c <= 0x0BB5 ) || + (c >= 0x0BB7 && c <= 0x0BB9 ) || + (c >= 0x0C05 && c <= 0x0C0C ) || + (c >= 0x0C0E && c <= 0x0C10 ) || + (c >= 0x0C12 && c <= 0x0C28 ) || + (c >= 0x0C2A && c <= 0x0C33 ) || + (c >= 0x0C35 && c <= 0x0C39 ) || + (c >= 0x0C60 && c <= 0x0C61 ) || + (c >= 0x0C85 && c <= 0x0C8C ) || + (c >= 0x0C8E && c <= 0x0C90 ) || + (c >= 0x0C92 && c <= 0x0CA8 ) || + (c >= 0x0CAA && c <= 0x0CB3 ) || + (c >= 0x0CB5 && c <= 0x0CB9 ) || + (c == 0x0CDE) || + (c >= 0x0CE0 && c <= 0x0CE1 ) || + (c >= 0x0D05 && c <= 0x0D0C ) || + (c >= 0x0D0E && c <= 0x0D10 ) || + (c >= 0x0D12 && c <= 0x0D28 ) || + (c >= 0x0D2A && c <= 0x0D39 ) || + (c >= 0x0D60 && c <= 0x0D61 ) || + (c >= 0x0E01 && c <= 0x0E2E ) || + (c == 0x0E30) || + (c >= 0x0E32 && c <= 0x0E33 ) || + (c >= 0x0E40 && c <= 0x0E45 ) || + (c >= 0x0E81 && c <= 0x0E82 ) || + (c == 0x0E84) || + (c >= 0x0E87 && c <= 0x0E88 ) || + (c == 0x0E8A) || + (c == 0x0E8D) || + (c >= 0x0E94 && c <= 0x0E97 ) || + (c >= 0x0E99 && c <= 0x0E9F ) || + (c >= 0x0EA1 && c <= 0x0EA3 ) || + (c == 0x0EA5) || + (c == 0x0EA7) || + (c >= 0x0EAA && c <= 0x0EAB ) || + (c >= 0x0EAD && c <= 0x0EAE ) || + (c == 0x0EB0) || + (c >= 0x0EB2 && c <= 0x0EB3 ) || + (c == 0x0EBD) || + (c >= 0x0EC0 && c <= 0x0EC4 ) || + (c >= 0x0F40 && c <= 0x0F47 ) || + (c >= 0x0F49 && c <= 0x0F69 ) || + (c >= 0x10A0 && c <= 0x10C5 ) || + (c >= 0x10D0 && c <= 0x10F6 ) || + (c == 0x1100) || + (c >= 0x1102 && c <= 0x1103 ) || + (c >= 0x1105 && c <= 0x1107 ) || + (c == 0x1109) || + (c >= 0x110B && c <= 0x110C ) || + (c >= 0x110E && c <= 0x1112 ) || + (c == 0x113C) || + (c == 0x113E) || + (c == 0x1140) || + (c == 0x114C) || + (c == 0x114E) || + (c == 0x1150) || + (c >= 0x1154 && c <= 0x1155 ) || + (c == 0x1159) || + (c >= 0x115F && c <= 0x1161 ) || + (c == 0x1163) || + (c == 0x1165) || + (c == 0x1167) || + (c == 0x1169) || + (c >= 0x116D && c <= 0x116E ) || + (c >= 0x1172 && c <= 0x1173 ) || + (c == 0x1175) || + (c == 0x119E) || + (c == 0x11A8) || + (c == 0x11AB) || + (c >= 0x11AE && c <= 0x11AF ) || + (c >= 0x11B7 && c <= 0x11B8 ) || + (c == 0x11BA) || + (c >= 0x11BC && c <= 0x11C2 ) || + (c == 0x11EB) || + (c == 0x11F0) || + (c == 0x11F9) || + (c >= 0x1E00 && c <= 0x1E9B ) || + (c >= 0x1EA0 && c <= 0x1EF9 ) || + (c >= 0x1F00 && c <= 0x1F15 ) || + (c >= 0x1F18 && c <= 0x1F1D ) || + (c >= 0x1F20 && c <= 0x1F45 ) || + (c >= 0x1F48 && c <= 0x1F4D ) || + (c >= 0x1F50 && c <= 0x1F57 ) || + (c == 0x1F59) || + (c == 0x1F5B) || + (c == 0x1F5D) || + (c >= 0x1F5F && c <= 0x1F7D ) || + (c >= 0x1F80 && c <= 0x1FB4 ) || + (c >= 0x1FB6 && c <= 0x1FBC ) || + (c == 0x1FBE) || + (c >= 0x1FC2 && c <= 0x1FC4 ) || + (c >= 0x1FC6 && c <= 0x1FCC ) || + (c >= 0x1FD0 && c <= 0x1FD3 ) || + (c >= 0x1FD6 && c <= 0x1FDB ) || + (c >= 0x1FE0 && c <= 0x1FEC ) || + (c >= 0x1FF2 && c <= 0x1FF4 ) || + (c >= 0x1FF6 && c <= 0x1FFC ) || + (c == 0x2126) || + (c >= 0x212A && c <= 0x212B ) || + (c == 0x212E) || + (c >= 0x2180 && c <= 0x2182 ) || + (c >= 0x3041 && c <= 0x3094 ) || + (c >= 0x30A1 && c <= 0x30FA ) || + (c >= 0x3105 && c <= 0x312C ) || + (c >= 0xAC00 && c <= 0xD7A3 ) + ); +} + + +static int +raptor_unicode_is_ideographic(long c) +{ + /* http://www.w3.org/TR/2000/REC-xml-20001006#NT-Ideographic */ + return((c >= 0x4E00 && c <= 0x9FA5 ) || + (c == 0x3007) || + (c >= 0x3021 && c <= 0x3029 )); +} + + +static int +raptor_unicode_is_combiningchar(long c) +{ + /* http://www.w3.org/TR/2000/REC-xml-20001006#NT-CombiningChar */ + return((c >= 0x0300 && c <= 0x0345 ) || + (c >= 0x0360 && c <= 0x0361 ) || + (c >= 0x0483 && c <= 0x0486 ) || + (c >= 0x0591 && c <= 0x05A1 ) || + (c >= 0x05A3 && c <= 0x05B9 ) || + (c >= 0x05BB && c <= 0x05BD ) || + (c == 0x05BF) || + (c >= 0x05C1 && c <= 0x05C2 ) || + (c == 0x05C4) || + (c >= 0x064B && c <= 0x0652 ) || + (c == 0x0670) || + (c >= 0x06D6 && c <= 0x06DC ) || + (c >= 0x06DD && c <= 0x06DF ) || + (c >= 0x06E0 && c <= 0x06E4 ) || + (c >= 0x06E7 && c <= 0x06E8 ) || + (c >= 0x06EA && c <= 0x06ED ) || + (c >= 0x0901 && c <= 0x0903 ) || + (c == 0x093C) || + (c >= 0x093E && c <= 0x094C ) || + (c == 0x094D) || + (c >= 0x0951 && c <= 0x0954 ) || + (c >= 0x0962 && c <= 0x0963 ) || + (c >= 0x0981 && c <= 0x0983 ) || + (c == 0x09BC) || + (c == 0x09BE) || + (c == 0x09BF) || + (c >= 0x09C0 && c <= 0x09C4 ) || + (c >= 0x09C7 && c <= 0x09C8 ) || + (c >= 0x09CB && c <= 0x09CD ) || + (c == 0x09D7) || + (c >= 0x09E2 && c <= 0x09E3 ) || + (c == 0x0A02) || + (c == 0x0A3C) || + (c == 0x0A3E) || + (c == 0x0A3F) || + (c >= 0x0A40 && c <= 0x0A42 ) || + (c >= 0x0A47 && c <= 0x0A48 ) || + (c >= 0x0A4B && c <= 0x0A4D ) || + (c >= 0x0A70 && c <= 0x0A71 ) || + (c >= 0x0A81 && c <= 0x0A83 ) || + (c == 0x0ABC) || + (c >= 0x0ABE && c <= 0x0AC5 ) || + (c >= 0x0AC7 && c <= 0x0AC9 ) || + (c >= 0x0ACB && c <= 0x0ACD ) || + (c >= 0x0B01 && c <= 0x0B03 ) || + (c == 0x0B3C) || + (c >= 0x0B3E && c <= 0x0B43 ) || + (c >= 0x0B47 && c <= 0x0B48 ) || + (c >= 0x0B4B && c <= 0x0B4D ) || + (c >= 0x0B56 && c <= 0x0B57 ) || + (c >= 0x0B82 && c <= 0x0B83 ) || + (c >= 0x0BBE && c <= 0x0BC2 ) || + (c >= 0x0BC6 && c <= 0x0BC8 ) || + (c >= 0x0BCA && c <= 0x0BCD ) || + (c == 0x0BD7) || + (c >= 0x0C01 && c <= 0x0C03 ) || + (c >= 0x0C3E && c <= 0x0C44 ) || + (c >= 0x0C46 && c <= 0x0C48 ) || + (c >= 0x0C4A && c <= 0x0C4D ) || + (c >= 0x0C55 && c <= 0x0C56 ) || + (c >= 0x0C82 && c <= 0x0C83 ) || + (c >= 0x0CBE && c <= 0x0CC4 ) || + (c >= 0x0CC6 && c <= 0x0CC8 ) || + (c >= 0x0CCA && c <= 0x0CCD ) || + (c >= 0x0CD5 && c <= 0x0CD6 ) || + (c >= 0x0D02 && c <= 0x0D03 ) || + (c >= 0x0D3E && c <= 0x0D43 ) || + (c >= 0x0D46 && c <= 0x0D48 ) || + (c >= 0x0D4A && c <= 0x0D4D ) || + (c == 0x0D57) || + (c == 0x0E31) || + (c >= 0x0E34 && c <= 0x0E3A ) || + (c >= 0x0E47 && c <= 0x0E4E ) || + (c == 0x0EB1) || + (c >= 0x0EB4 && c <= 0x0EB9 ) || + (c >= 0x0EBB && c <= 0x0EBC ) || + (c >= 0x0EC8 && c <= 0x0ECD ) || + (c >= 0x0F18 && c <= 0x0F19 ) || + (c == 0x0F35) || + (c == 0x0F37) || + (c == 0x0F39) || + (c == 0x0F3E) || + (c == 0x0F3F) || + (c >= 0x0F71 && c <= 0x0F84 ) || + (c >= 0x0F86 && c <= 0x0F8B ) || + (c >= 0x0F90 && c <= 0x0F95 ) || + (c == 0x0F97) || + (c >= 0x0F99 && c <= 0x0FAD ) || + (c >= 0x0FB1 && c <= 0x0FB7 ) || + (c == 0x0FB9) || + (c >= 0x20D0 && c <= 0x20DC ) || + (c == 0x20E1) || + (c >= 0x302A && c <= 0x302F ) || + (c == 0x3099) || + (c == 0x309A)); +} + + +static int +raptor_unicode_is_digit(long c) +{ + /* http://www.w3.org/TR/2000/REC-xml-20001006#NT-Digit */ + return((c >= 0x0030 && c <= 0x0039 ) || + (c >= 0x0660 && c <= 0x0669 ) || + (c >= 0x06F0 && c <= 0x06F9 ) || + (c >= 0x0966 && c <= 0x096F ) || + (c >= 0x09E6 && c <= 0x09EF ) || + (c >= 0x0A66 && c <= 0x0A6F ) || + (c >= 0x0AE6 && c <= 0x0AEF ) || + (c >= 0x0B66 && c <= 0x0B6F ) || + (c >= 0x0BE7 && c <= 0x0BEF ) || + (c >= 0x0C66 && c <= 0x0C6F ) || + (c >= 0x0CE6 && c <= 0x0CEF ) || + (c >= 0x0D66 && c <= 0x0D6F ) || + (c >= 0x0E50 && c <= 0x0E59 ) || + (c >= 0x0ED0 && c <= 0x0ED9 ) || + (c >= 0x0F20 && c <= 0x0F29 )); +} + + +static int +raptor_unicode_is_extender(long c) +{ + /* http://www.w3.org/TR/2000/REC-xml-20001006#NT-Extender */ + return((c == 0x00B7) || + (c == 0x02D0) || + (c == 0x02D1) || + (c == 0x0387) || + (c == 0x0640) || + (c == 0x0E46) || + (c == 0x0EC6) || + (c == 0x3005) || + (c >= 0x3031 && c <= 0x3035 ) || + (c >= 0x309D && c <= 0x309E ) || + (c >= 0x30FC && c <= 0x30FE )); +} + + +/* + * raptor_unicode_check_utf8_nfc_string: + * @input: UTF-8 string + * @length: length of string + * @error: pointer to error flag (or NULL) + * + * INTERNAL - Check if a Unicode UTF-8 encoded string is in Unicode Normal Form C. + * + * Return value: <0 on error, 0 if not NFC, >0 if is NFC + **/ +int +raptor_unicode_check_utf8_nfc_string(const unsigned char *input, size_t length) +{ + unsigned int i; + int plain = 1; + int rc; + + for(i = 0; i < length; i++) + if(input[i] > 0x7f) { + plain = 0; + break; + } + + if(plain) + return 1; + +#ifdef RAPTOR_NFC_ICU + rc = raptor_nfc_icu_check(input, length); +#else + rc = 1; +#endif + return rc; +} + + +/** + * raptor_unicode_check_utf8_string: + * @string: UTF-8 string + * @length: length of string + * + * Check a string is valid Unicode UTF-8. + * + * Return value: Non 0 if the string is UTF-8 + **/ +int +raptor_unicode_check_utf8_string(const unsigned char *string, size_t length) +{ + while(length > 0) { + raptor_unichar unichar = 0; + + int unichar_len; + unichar_len = raptor_unicode_utf8_string_get_char(string, length, &unichar); + if(unichar_len < 0 || RAPTOR_GOOD_CAST(size_t, unichar_len) > length) + return 0; + + if(unichar > raptor_unicode_max_codepoint) + return 0; + + string += unichar_len; + length -= unichar_len; + } + return 1; +} + + +/** + * raptor_unicode_utf8_strlen: + * @string: buffer + * @length: buffer length + * + * Calculate the number of Unicode characters in the given UTF-8 encoded buffer + * + * Return value: number of characters or <0 if sequence is invalid + */ +int +raptor_unicode_utf8_strlen(const unsigned char *string, size_t length) +{ + int unicode_length = 0; + + while(length > 0) { + int unichar_len; + unichar_len = raptor_unicode_utf8_string_get_char(string, length, NULL); + if(unichar_len < 0 || RAPTOR_GOOD_CAST(size_t, unichar_len) > length) { + unicode_length = -1; + break; + } + + string += unichar_len; + length -= unichar_len; + + unicode_length++; + } + + return unicode_length; +} + + +/** + * raptor_unicode_utf8_substr: + * @dest: destination string buffer to write to (or NULL) + * @dest_length_p: location to store actual destination length (or NULL) + * @src: source string + * @src_length: source length in bytes + * @startingLoc: starting location offset 0 for first Unicode character + * @length: number of Unicode characters to copy at offset @startingLoc (or < 0) + * + * Get a unicode (UTF-8) substring of an existing UTF-8 string + * + * If @dest is NULL, returns the number of bytes needed to write and + * does no work. + * + * Return value: number of bytes used in destination string or 0 on failure + */ +size_t +raptor_unicode_utf8_substr(unsigned char* dest, size_t* dest_length_p, + const unsigned char* src, size_t src_length, + int startingLoc, int length) +{ + size_t dest_length = 0; /* destination unicode characters count */ + size_t dest_bytes = 0; /* destination UTF-8 bytes count */ + int dest_offset = 0; /* destination string unicode characters index */ + unsigned char* p = dest; + + if(!src) + return 0; + + while(src_length > 0) { + int unichar_len; + + unichar_len = raptor_unicode_utf8_string_get_char(src, src_length, NULL); + if(unichar_len < 0 || RAPTOR_GOOD_CAST(size_t, unichar_len) > src_length) + break; + + if(dest_offset >= startingLoc) { + if(p) { + /* copy 1 Unicode character to dest */ + memcpy(p, src, RAPTOR_GOOD_CAST(size_t, unichar_len)); + p += unichar_len; + } + dest_bytes += unichar_len; + + dest_length++; + if(length >= 0 && dest_length == RAPTOR_GOOD_CAST(size_t, length)) + break; + } + + src += unichar_len; + src_length -= unichar_len; + + dest_offset++; + } + + if(p) + *p = '\0'; + + if(dest_length_p) + *dest_length_p = dest_length; + + return dest_bytes; +} diff --git a/src/raptor_uri.c b/src/raptor_uri.c new file mode 100644 index 0000000..53768e7 --- /dev/null +++ b/src/raptor_uri.c @@ -0,0 +1,2099 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_uri.c - Raptor URI class + * + * Copyright (C) 2002-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2002-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#if defined(STANDALONE) && defined(HAVE_UNISTD_H) && defined(HAVE_SYS_STAT_H) +/* for lstat() used in main() test which is in POSIX */ +#ifndef _POSIX_C_SOURCE +#define _POSIX_C_SOURCE 200809L +#endif +#endif + +#include <stdio.h> +#include <string.h> +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +/* for ptrdiff_t */ +#ifdef HAVE_STDDEF_H +#include <stddef.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +/* Symbian OS uses similar path mappings as Windows but does not necessarily have the WIN32 flag defined */ +#if defined(__SYMBIAN32__) && !defined(WIN32) +#define WIN32 +#endif + + +/* raptor_uri structure */ +struct raptor_uri_s { + /* raptor_world object */ + raptor_world *world; + /* the URI string */ + unsigned char *string; + /* length of string */ + unsigned int length; + /* usage count */ + int usage; +}; + + +#ifndef STANDALONE + +/** + * raptor_new_uri_from_counted_string: + * @world: raptor_world object + * @uri_string: URI string. + * @length: length of URI string + * + * Constructor - create a raptor URI from a UTF-8 encoded Unicode string. + * + * Note: The @uri_string need not be NULL terminated - a NULL will be + * added to the copied string used. + * + * Return value: a new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri_from_counted_string(raptor_world* world, + const unsigned char *uri_string, + size_t length) +{ + raptor_uri* new_uri; + unsigned char *new_string; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!uri_string || !*uri_string) + return NULL; + + raptor_world_open(world); + + if(world->uris_tree) { + raptor_uri key; /* on stack - not allocated */ + + /* just to be safe */ + memset(&key, 0, sizeof(key)); + + key.string = (unsigned char*)uri_string; + key.length = (unsigned int)length; + + /* if existing URI found in tree, return it */ + new_uri = (raptor_uri*)raptor_avltree_search(world->uris_tree, &key); + if(new_uri) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("Found existing URI %s with current usage %d\n", + uri_string, new_uri->usage); +#endif + + new_uri->usage++; + + goto unlock; + } + } + + + /* otherwise create a new one */ + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG1("Creating new URI '"); + fwrite(uri_string, sizeof(char), length, RAPTOR_DEBUG_FH); + fputs("' in hash\n", RAPTOR_DEBUG_FH); +#endif + + new_uri = RAPTOR_CALLOC(raptor_uri*, 1, sizeof(*new_uri)); + if(!new_uri) + goto unlock; + + new_uri->world = world; + new_uri->length = (unsigned int)length; + + new_string = RAPTOR_MALLOC(unsigned char*, length + 1); + if(!new_string) { + RAPTOR_FREE(raptor_uri, new_uri); + new_uri=NULL; + goto unlock; + } + + memcpy((char*)new_string, (const char*)uri_string, length); + new_string[length] = '\0'; + new_uri->string = new_string; + + new_uri->usage = 1; /* for user */ + + /* store in tree */ + if(world->uris_tree) { + if(raptor_avltree_add(world->uris_tree, new_uri)) { + RAPTOR_FREE(char*, new_string); + RAPTOR_FREE(raptor_uri, new_uri); + new_uri = NULL; + } + } + + unlock: + + return new_uri; +} + + +/** + * raptor_new_uri: + * @world: raptor_world object + * @uri_string: URI string. + * + * Constructor - create a raptor URI from a UTF-8 encoded Unicode string. + * + * Return value: a new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri(raptor_world* world, const unsigned char *uri_string) +{ + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!uri_string) + return NULL; + + raptor_world_open(world); + + return raptor_new_uri_from_counted_string(world, uri_string, + strlen((const char*)uri_string)); +} + + +/** + * raptor_new_uri_from_uri_local_name: + * @world: raptor_world object + * @uri: existing #raptor_uri + * @local_name: local name + * + * Constructor - create a raptor URI from an existing URI and a local name. + * + * Creates a new URI from the concatenation of the @local_name to the + * @uri. This is NOT relative URI resolution, which is done by the + * raptor_new_uri_relative_to_base() constructor. + * + * Return value: a new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri_from_uri_local_name(raptor_world* world, raptor_uri *uri, + const unsigned char *local_name) +{ + size_t len; + unsigned char *new_string; + raptor_uri* new_uri; + size_t local_name_length; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!uri) + return NULL; + + raptor_world_open(world); + + local_name_length = strlen((const char*)local_name); + + len = uri->length + local_name_length; + new_string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!new_string) + return NULL; + + memcpy((char*)new_string, (const char*)uri->string, uri->length); + memcpy((char*)(new_string + uri->length), (const char*)local_name, + local_name_length + 1); + + new_uri = raptor_new_uri_from_counted_string(world, new_string, len); + RAPTOR_FREE(char*, new_string); + + return new_uri; +} + + +/** + * raptor_new_uri_relative_to_base_counted: + * @world: raptor_world object + * @base_uri: existing base URI + * @uri_string: relative URI string + * @uri_len: length of URI string (or 0) + * + * Constructor - create a raptor URI from a base URI and a relative counted URI string. + * + * Return value: a new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri_relative_to_base_counted(raptor_world* world, + raptor_uri *base_uri, + const unsigned char *uri_string, + size_t uri_len) +{ + unsigned char *buffer; + size_t buffer_length; + raptor_uri* new_uri; + size_t actual_length; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!base_uri || !uri_string) + return NULL; + + if(!uri_len) + uri_len = strlen(RAPTOR_GOOD_CAST(const char*, uri_string)); + + raptor_world_open(world); + + /* If URI string is empty, just copy base URI */ + if(!*uri_string) + return raptor_uri_copy(base_uri); + + /* +1 for adding any missing URI path '/' */ + buffer_length = base_uri->length + uri_len + 1; + buffer = RAPTOR_MALLOC(unsigned char*, buffer_length + 1); + if(!buffer) + return NULL; + + actual_length = raptor_uri_resolve_uri_reference(base_uri->string, uri_string, + buffer, buffer_length); + + new_uri = raptor_new_uri_from_counted_string(world, buffer, actual_length); + RAPTOR_FREE(char*, buffer); + return new_uri; +} + + +/** + * raptor_new_uri_relative_to_base: + * @world: raptor_world object + * @base_uri: existing base URI + * @uri_string: relative URI string + * + * Constructor - create a raptor URI from a base URI and a relative URI string. + * + * Use raptor_new_uri_relative_to_base_counted() if the URI string length is known + * + * Return value: a new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri_relative_to_base(raptor_world* world, + raptor_uri *base_uri, + const unsigned char *uri_string) +{ + return raptor_new_uri_relative_to_base_counted(world, base_uri, + uri_string, 0); +} + + +/** + * raptor_new_uri_from_id: + * @world: raptor_world object + * @base_uri: existing base URI + * @id: RDF ID + * + * Constructor - create a new URI from a base URI and RDF ID. + * + * This creates a URI equivalent to concatenating @base_uri with + * ## and @id. + * + * Return value: a new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri_from_id(raptor_world *world, raptor_uri *base_uri, + const unsigned char *id) +{ + raptor_uri *new_uri; + unsigned char *local_name; + size_t len; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!base_uri || !id) + return NULL; + + raptor_world_open(world); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Using ID %s\n", id); +#endif + + len = strlen((char*)id); + /* "#id\0" */ + local_name = RAPTOR_MALLOC(unsigned char*, len + 1 + 1); + if(!local_name) + return NULL; + + *local_name = '#'; + memcpy(local_name + 1, id, len + 1); /* len+1 to copy NUL */ + + new_uri = raptor_new_uri_relative_to_base(world, base_uri, local_name); + RAPTOR_FREE(char*, local_name); + return new_uri; +} + + +/** + * raptor_new_uri_for_rdf_concept: + * @world: raptor_world object + * @name: RDF namespace concept + * + * Constructor - create a raptor URI for the RDF namespace concept name. + * + * Example: u=raptor_new_uri_for_rdf_concept("value") creates a new + * URI for the rdf:value term. + * + * Return value: a new #raptor_uri object or NULL on failure + **/ +raptor_uri* +raptor_new_uri_for_rdf_concept(raptor_world* world, const unsigned char *name) +{ + raptor_uri *new_uri; + unsigned char *new_uri_string; + const unsigned char *base_uri_string = raptor_rdf_namespace_uri; + size_t base_uri_string_len = raptor_rdf_namespace_uri_len; + size_t new_uri_string_len; + size_t name_len; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!name) + return NULL; + + raptor_world_open(world); + + name_len = strlen((const char*)name); + new_uri_string_len = base_uri_string_len + name_len; + new_uri_string = RAPTOR_MALLOC(unsigned char*, new_uri_string_len + 1); + if(!new_uri_string) + return NULL; + + memcpy(new_uri_string, base_uri_string, base_uri_string_len); + memcpy(new_uri_string + base_uri_string_len, name, name_len + 1); /* copy NUL */ + + new_uri = raptor_new_uri_from_counted_string(world, new_uri_string, + new_uri_string_len); + RAPTOR_FREE(char*, new_uri_string); + + return new_uri; +} + + +/** + * raptor_new_uri_from_uri_or_file_string: + * @world: raptor_world object + * @base_uri: existing base URI + * @uri_or_file_string: URI string or filename + * + * Constructor - create a raptor URI from a string that is a relative or absolute URI or a filename + * + * If the @uri_or_file_string is a filename PATH that exists, the + * result will be a URI file://PATH + * + * Return value: a new #raptor_uri object or NULL on failure + **/ +raptor_uri* +raptor_new_uri_from_uri_or_file_string(raptor_world* world, + raptor_uri* base_uri, + const unsigned char* uri_or_file_string) +{ + raptor_uri* new_uri = NULL; + const unsigned char* new_uri_string; + const char* path; + + if(raptor_uri_filename_exists(uri_or_file_string) > 0) { + /* uri_or_file_string is a file name, not a file: URI */ + path = RAPTOR_GOOD_CAST(const char*, uri_or_file_string); + } else { + new_uri = raptor_new_uri_relative_to_base(world, base_uri, + uri_or_file_string); + new_uri_string = raptor_uri_as_string(new_uri); + path = raptor_uri_uri_string_to_counted_filename_fragment(new_uri_string, + NULL, NULL, NULL); + } + + if(path) { + if(new_uri) { + raptor_free_uri(new_uri); + new_uri = NULL; + } + + /* new_uri_string is a string like "file://" + path */ + new_uri_string = raptor_uri_filename_to_uri_string(path); + if(path != RAPTOR_GOOD_CAST(const char*, uri_or_file_string)) + RAPTOR_FREE(const char*, path); + + new_uri = raptor_new_uri(world, new_uri_string); + RAPTOR_FREE(char*, new_uri_string); + } + + return new_uri; +} + + +/** + * raptor_free_uri: + * @uri: URI to destroy + * + * Destructor - destroy a #raptor_uri object + **/ +void +raptor_free_uri(raptor_uri *uri) +{ + if(!uri) + return; + + uri->usage--; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("URI %s usage count now %d\n", uri->string, uri->usage); +#endif + + /* decrement usage, don't free if not 0 yet*/ + if(uri->usage > 0) { + return; + } + + /* this does not free the uri */ + if(uri->world->uris_tree) + raptor_avltree_delete(uri->world->uris_tree, uri); + + if(uri->string) + RAPTOR_FREE(char*, uri->string); + RAPTOR_FREE(raptor_uri, uri); +} + + +/** + * raptor_uri_equals: + * @uri1: URI 1 (may be NULL) + * @uri2: URI 2 (may be NULL) + * + * Check if two URIs are equal. + * + * A NULL URI is not equal to a non-NULL URI. + * + * Return value: non-0 if the URIs are equal + **/ +int +raptor_uri_equals(raptor_uri* uri1, raptor_uri* uri2) +{ + if(uri1 && uri2) { + /* Both not-NULL - compare for equality */ + if(uri1 == uri2) + return 1; + else if (uri1->length != uri2->length) + /* Different if lengths are different */ + return 0; + else + /* Same length compare: do not need strncmp() NUL checking */ + return memcmp((const char*)uri1->string, (const char*)uri2->string, + uri1->length) == 0; + } else if(uri1 || uri2) + /* Only one is NULL - not equal */ + return 0; + else + /* both NULL - equal */ + return 1; +} + + +/** + * raptor_uri_compare: + * @uri1: URI 1 (may be NULL) + * @uri2: URI 2 (may be NULL) + * + * Compare two URIs, ala strcmp. + * + * A NULL URI is always less than (never equal to) a non-NULL URI. + * + * Return value: -1 if uri1 < uri2, 0 if equal, 1 if uri1 > uri2 + **/ +int +raptor_uri_compare(raptor_uri* uri1, raptor_uri* uri2) +{ + if(uri1 == uri2) + return 0; + + if(uri1 && uri2) { + /* compare common (shortest) prefix */ + unsigned int len = (uri1->length > uri2->length) ? + uri2->length : uri1->length; + + /* Same length compare: Do not need the strncmp() NUL checking */ + int result = memcmp((const char*)uri1->string, (const char*)uri2->string, + len); + if(!result) + /* if prefix is the same, the shorter is earlier */ + result = uri1->length - uri2->length; + return result; + } + + /* One arg is NULL - sort that first */ + return (!uri1) ? -1 : 1; +} + + +/** + * raptor_uri_copy: + * @uri: URI object + * + * Constructor - get a copy of a URI. + * + * Return value: a new #raptor_uri object or NULL on failure + **/ +raptor_uri* +raptor_uri_copy(raptor_uri *uri) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, raptor_uri, NULL); + + uri->usage++; + return uri; +} + + +/** + * raptor_uri_as_string: + * @uri: #raptor_uri object + * + * Get a string representation of a URI. + * + * Returns a shared pointer to a string representation of @uri. This + * string is shared and must not be freed, otherwise see use the + * raptor_uri_to_string() or raptor_uri_to_counted_string() methods. + * + * Return value: shared string representation of URI + **/ +unsigned char* +raptor_uri_as_string(raptor_uri *uri) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, raptor_uri, NULL); + + return uri->string; +} + + +/** + * raptor_uri_as_counted_string: + * @uri: URI object + * @len_p: address of length variable or NULL + * + * Get a string representation of a URI with count. + * + * Returns a shared pointer to a string representation of @uri along + * with the length of the string in @len_p, if not NULL. This + * string is shared and must not be freed, otherwise see use the + * raptor_uri_to_string() or raptor_uri_to_counted_string() methods. + * + * Return value: shared string representation of URI + **/ +unsigned char* +raptor_uri_as_counted_string(raptor_uri *uri, size_t* len_p) +{ + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, raptor_uri, NULL); + + if(len_p) + *len_p = uri->length; + return uri->string; +} + + +/** + * raptor_uri_counted_filename_to_uri_string: + * @filename: The filename to convert + * @filename_len: length of @filename or 0 to count it here + * + * Converts a counted filename to a file: URI. + * + * Handles the OS-specific escaping on turning filenames into URIs + * and returns a new buffer that the caller must free(). Turns a + * space in the filename into \%20 and '%' into \%25. + * + * Return value: A newly allocated string with the URI or NULL on failure + **/ +unsigned char* +raptor_uri_counted_filename_to_uri_string(const char *filename, + size_t filename_len) +{ + unsigned char *buffer = NULL; + const char *from; + char *to; +#ifndef WIN32 + char *path = NULL; +#endif + /* "file://" */ +#define RAPTOR_LEN_FILE_CSS 7 + size_t len = RAPTOR_LEN_FILE_CSS; + size_t fl; + + if(!filename) + return NULL; + + if(!filename_len) + filename_len = strlen(filename); + +#ifdef WIN32 +/* + * On WIN32, filenames turn into + * "file://" + translated filename + * where the translation is \\ turns into / and ' ' into %20, '%' into %25 + * and if the filename does not start with '\', it is relative + * in which case, a . is appended to the authority + * + * e.g + * FILENAME URI + * c:\windows\system file:///c:/windows/system + * \\server\dir\file.doc file://server/dir/file.doc + * a:foo file:///a:./foo + * C:\Documents and Settings\myapp\foo.bat + * file:///C:/Documents%20and%20Settings/myapp/foo.bat + * + * There are also UNC names \\server\share\blah + * that turn into file:///server/share/blah + * using the above algorithm. + */ + if(filename[1] == ':' && filename[2] != '\\') + len += 3; /* relative filename - add / and ./ */ + else if(*filename == '\\') + len -= 2; /* two // from not needed in filename */ + else + len++; /* / at start of path */ + +#else +/* others - unix: turn spaces into %20, '%' into %25 */ + + if(*filename != '/') { + size_t path_max; + size_t path_len; + size_t new_filename_len; + +#ifdef PATH_MAX + path_max = PATH_MAX; +#else + path_max = 1024; /* an initial guess at the length */ +#endif + path = (char*)malloc(path_max); + while(1) { + /* malloc() failed or getcwd() succeeded */ + errno = 0; + if(!path || getcwd(path, path_max)) + break; + + /* failed */ + if(errno != ERANGE) + break; + + /* try again with a bigger buffer */ + path_max *= 2; + path = (char*)realloc(path, path_max); + } + if(!path) + goto path_done; + path_len = strlen(path); + + /* path + '/' + filename */ + new_filename_len = path_len + 1 + filename_len; + if(path_max < new_filename_len + 1) { + path = (char*)realloc(path, new_filename_len + 1); + if(!path) + goto path_done; + } + + path[path_len] = '/'; + memcpy(path + path_len + 1, filename, filename_len); + path[new_filename_len] = '\0'; + filename_len = new_filename_len; + filename = (const char*)path; + } +#endif + + /* add URI-escaped filename length */ + for(from = filename, fl = filename_len; fl ; from++, fl--) { + len++; +#ifdef WIN32 + if(*from == ':') { + if(from[1] != '\\') + len += 2; + } +#endif + if(*from == ' ' || *from == '%') + len += 2; /* strlen(%xx)-1 */ + } + + buffer = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!buffer) + goto path_done; + + memcpy(buffer, "file://", RAPTOR_LEN_FILE_CSS + 1); /* copy NUL */ + from = filename; + to = (char*)(buffer + RAPTOR_LEN_FILE_CSS); + fl = filename_len; +#ifdef WIN32 + if(*from == '\\' && from[1] == '\\') { + from += 2; fl -= 2; + } else + *to++ ='/'; +#endif + for(; fl; fl--) { + char c = *from++; +#ifdef WIN32 + if(c == '\\') + *to++ ='/'; + else if(c == ':') { + *to++ = c; + if(*from != '\\') { + *to++ ='.'; + *to++ ='/'; + } + } else +#endif + if(c == ' ' || c == '%') { + *to++ = '%'; + *to++ = '2'; + *to++ = (c == ' ') ? '0' : '5'; + } else + *to++ = c; + } + *to = '\0'; + + path_done: +#ifndef WIN32 + /* Normalize the resulting URI path after the "file://" */ + if(buffer) + raptor_uri_normalize_path(buffer + RAPTOR_LEN_FILE_CSS, + len - RAPTOR_LEN_FILE_CSS); + + if(path) + free(path); +#endif + + return buffer; +} + + +/** + * raptor_uri_filename_to_uri_string: + * @filename: The filename to convert + * + * Converts a filename to a file: URI. + * + * Handles the OS-specific escaping on turning filenames into URIs + * and returns a new buffer that the caller must free(). Turns a + * space in the filename into \%20 and '%' into \%25. + * + * Return value: A newly allocated string with the URI or NULL on failure + **/ +unsigned char * +raptor_uri_filename_to_uri_string(const char *filename) + +{ + return raptor_uri_counted_filename_to_uri_string(filename, 0); +} + + +/** + * raptor_uri_uri_string_to_counted_filename_fragment: + * @uri_string: The file: URI to convert + * @len_p: address of filename length variable or NULL + * @fragment_p: Address of pointer to store any URI fragment or NULL + * @fragment_len_p: address of length variable or NULL + * + * Convert a file: URI to a counted filename and counted fragment. + * + * Handles the OS-specific file: URIs to filename mappings. Returns + * a new buffer containing the filename that the caller must free. + * + * If @len_p is present the length of the filename is returned + * + * If @fragment_p is given, a new string containing the URI fragment + * is returned, or NULL if none is present. If @fragment_len_p is present + * the length is returned in it. + * + * Return value: A newly allocated string with the filename or NULL on failure + **/ +char * +raptor_uri_uri_string_to_counted_filename_fragment(const unsigned char *uri_string, + size_t* len_p, + unsigned char **fragment_p, + size_t* fragment_len_p) +{ + char *filename; + size_t len = 0; + raptor_uri_detail *ud = NULL; + unsigned char *from; + char *to; +#ifdef WIN32 + unsigned char *p; +#endif + + if(!uri_string || !*uri_string) + return NULL; + + ud = raptor_new_uri_detail(uri_string); + if(!ud) + return NULL; + + + if(!ud->scheme || raptor_strcasecmp((const char*)ud->scheme, "file")) { + raptor_free_uri_detail(ud); + return NULL; + } + + if(ud->authority) { + if(!*ud->authority) + ud->authority = NULL; + else if(!raptor_strcasecmp((const char*)ud->authority, "localhost")) + ud->authority = NULL; + } + + /* Cannot do much if there is no path */ + if(!ud->path || (ud->path && !*ud->path)) { + raptor_free_uri_detail(ud); + return NULL; + } + + /* See raptor_uri_filename_to_uri_string for details of the mapping */ +#ifdef WIN32 + if(ud->authority) + len += ud->authority_len+3; + + p = ud->path; + /* remove leading slash from path if there is one */ + if(*p && p[0] == '/') { + p++; + len--; + } + /* handle case where path starts with drive letter */ + if(*p && (p[1] == '|' || p[1] == ':')) { + /* Either + * "a:" like in file://a|/... or file://a:/... + * or + * "a:." like in file://a:./foo + * giving device-relative path a:foo + */ + if(p[2] == '.') { + p[2] = *p; + p[3] = ':'; + p += 2; + len -= 2; /* remove 2 for ./ */ + } else + p[1] = ':'; + } +#endif + + + /* add URI-escaped filename length */ + for(from = ud->path; *from ; from++) { + len++; + if(*from == '%') + from += 2; + } + + + /* Something is wrong */ + if(!len) { + raptor_free_uri_detail(ud); + return NULL; + } + + filename = RAPTOR_MALLOC(char*, len + 1); + if(!filename) { + raptor_free_uri_detail(ud); + return NULL; + } + + to = filename; + +#ifdef WIN32 + if(ud->authority) { + *to++ = '\\'; + *to++ = '\\'; + from = ud->authority; + while( (*to++ = *from++) ) + ; + to--; + *to++ = '\\'; + } + + /* copy path after all /s */ + from = p; +#else + from = ud->path; +#endif + + while(*from) { + char c = *from++; +#ifdef WIN32 + if(c == '/') + *to++ = '\\'; + else +#endif + if(c == '%') { + if(*from && from[1]) { + char hexbuf[3]; + char *endptr = NULL; + hexbuf[0] = (char)*from; + hexbuf[1] = (char)from[1]; + hexbuf[2]='\0'; + c = (char)strtol((const char*)hexbuf, &endptr, 16); + if(endptr == &hexbuf[2]) + *to++ = c; + } + from += 2; + } else + *to++ = c; + } + *to = '\0'; + + if(len_p) + *len_p = len; + + if(fragment_p) { + size_t fragment_len = 0; + + if(ud->fragment) { + fragment_len = ud->fragment_len; + *fragment_p = RAPTOR_MALLOC(unsigned char*, fragment_len + 1); + if(*fragment_p) + memcpy(*fragment_p, ud->fragment, fragment_len + 1); + } else + *fragment_p = NULL; + if(fragment_len_p) + *fragment_len_p = fragment_len; + } + + raptor_free_uri_detail(ud); + + return filename; +} + + +/** + * raptor_uri_uri_string_to_filename_fragment: + * @uri_string: The file: URI to convert + * @fragment_p: Address of pointer to store any URI fragment or NULL + * + * Convert a file: URI to a filename and fragment. + * + * Handles the OS-specific file: URIs to filename mappings. Returns + * a new buffer containing the filename that the caller must free. + * + * If @fragment_p is given, a new string containing the URI fragment + * is returned, or NULL if none is present + * + * See also raptor_uri_uri_string_to_counted_filename_fragment() + * + * Return value: A newly allocated string with the filename or NULL on failure + **/ +char * +raptor_uri_uri_string_to_filename_fragment(const unsigned char *uri_string, + unsigned char **fragment_p) +{ + return raptor_uri_uri_string_to_counted_filename_fragment(uri_string, NULL, + fragment_p, NULL); +} + + +/** + * raptor_uri_uri_string_to_filename: + * @uri_string: The file: URI to convert + * + * Convert a file: URI to a filename. + * + * Handles the OS-specific file: URIs to filename mappings. Returns + * a new buffer containing the filename that the caller must free. + * + * See also raptor_uri_uri_string_to_counted_filename_fragment() + * + * Return value: A newly allocated string with the filename or NULL on failure + **/ +char * +raptor_uri_uri_string_to_filename(const unsigned char *uri_string) +{ + return raptor_uri_uri_string_to_counted_filename_fragment(uri_string, NULL, + NULL, NULL); +} + + + +/** + * raptor_uri_uri_string_is_file_uri: + * @uri_string: The URI string to check + * + * Check if a URI string is a file: URI. + * + * Return value: Non zero if URI string is a file: URI + **/ +int +raptor_uri_uri_string_is_file_uri(const unsigned char* uri_string) +{ + if(!uri_string || !*uri_string) + return 1; + + return raptor_strncasecmp((const char*)uri_string, "file:", 5) == 0; +} + + +/** + * raptor_new_uri_for_xmlbase: + * @old_uri: URI to transform + * + * Constructor - create a URI suitable for use as an XML Base. + * + * Takes an existing URI and ensures it has a path (default /) and has + * no fragment or query arguments - XML base does not use these. + * + * Return value: new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri_for_xmlbase(raptor_uri* old_uri) +{ + unsigned char *uri_string; + unsigned char *new_uri_string; + raptor_uri* new_uri; + raptor_uri_detail *ud; + + if(!old_uri) + return NULL; + + uri_string = raptor_uri_as_string(old_uri); + + ud = raptor_new_uri_detail(uri_string); + if(!ud) + return NULL; + + if(!ud->path) { + ud->path = (unsigned char*)"/"; + ud->path_len = 1; + } + + ud->query = NULL; ud->query_len = 0; + ud->fragment = NULL; ud->fragment_len = 0; + new_uri_string = raptor_uri_detail_to_string(ud, NULL); + raptor_free_uri_detail(ud); + if(!new_uri_string) + return NULL; + + new_uri = raptor_new_uri(old_uri->world, new_uri_string); + RAPTOR_FREE(char*, new_uri_string); + + return new_uri; +} + + +/** + * raptor_new_uri_for_retrieval: + * @old_uri: URI to transform + * + * Constructor - create a URI suitable for retrieval. + * + * Takes an existing URI and ensures it has a path (default /) and has + * no fragment - URI retrieval does not use the fragment part. + * + * Return value: new #raptor_uri object or NULL on failure. + **/ +raptor_uri* +raptor_new_uri_for_retrieval(raptor_uri* old_uri) +{ + unsigned char *uri_string; + unsigned char *new_uri_string; + raptor_uri* new_uri; + raptor_uri_detail *ud; + + if(!old_uri) + return NULL; + + uri_string = raptor_uri_as_string(old_uri); + + ud = raptor_new_uri_detail(uri_string); + if(!ud) + return NULL; + + if(!ud->path) { + ud->path = (unsigned char*)"/"; + ud->path_len = 1; + } + + ud->fragment = NULL; ud->fragment_len = 0; + new_uri_string = raptor_uri_detail_to_string(ud, NULL); + raptor_free_uri_detail(ud); + if(!new_uri_string) + return NULL; + + new_uri = raptor_new_uri(old_uri->world, new_uri_string); + RAPTOR_FREE(char*, new_uri_string); + + return new_uri; +} + + +int +raptor_uri_init(raptor_world* world) +{ + if(world->uri_interning && !world->uris_tree) { + world->uris_tree = raptor_new_avltree((raptor_data_compare_handler)raptor_uri_compare, + /* free */ NULL, 0); + if(!world->uris_tree) { +#ifdef RAPTOR_DEBUG + RAPTOR_FATAL1("Failed to create raptor URI avltree"); +#else + raptor_log_error(world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Failed to create raptor URI avltree"); +#endif + } + + } + + return 0; +} + + +void +raptor_uri_finish(raptor_world* world) +{ + if(world->uris_tree) { + raptor_free_avltree(world->uris_tree); + world->uris_tree = NULL; + } +} + + +/* + * raptor_uri_path_common_base_length: + * @first_path: The first path (path only, not a full URI) + * @first_path_len: Length of first_path + * @second_path: The second path (path only, not a full URI) + * @second_path_len: Length of second_path + * + * Find the common base length of two URI path components. + * + * Return value: Length of the common base path + **/ + +static size_t +raptor_uri_path_common_base_length(const unsigned char *first_path, + size_t first_path_len, + const unsigned char *second_path, + size_t second_path_len) +{ + ptrdiff_t common_len = 0; + const unsigned char *cur_ptr = first_path; + const unsigned char *prev_ptr = first_path; + + /* Compare each path component of first_path and second_path until + * there is a mismatch. Then return the length from the start of + * the path to the last successful match. + */ + while((cur_ptr = (const unsigned char*)memchr(cur_ptr, '/', first_path_len))) { + cur_ptr++; + if(strncmp((const char*)first_path + common_len, + (const char*)second_path + common_len, cur_ptr - prev_ptr)) + break; + + first_path_len -= cur_ptr - prev_ptr; + prev_ptr = cur_ptr; + common_len = prev_ptr - first_path; + } + + return prev_ptr - first_path; +} + + +/* + * raptor_uri_path_make_relative_path: + * @from_path: The base path (path only, not a full URI) + * @from_path_len: Length of the base path + * @to_path: The reference path (path only, not a full URI) + * @to_path_len: Length of the reference path + * @suffix: String to be appended to the final relative path + * @suffix_len: Length of the suffix + * @result_length_p: Location to store the length of the string or NULL + * + * Make a relative URI path. + * + * Return value: A newly allocated relative path string or NULL on failure. + **/ + +static unsigned char * +raptor_uri_path_make_relative_path(const unsigned char *from_path, size_t from_path_len, + const unsigned char *to_path, size_t to_path_len, + const unsigned char *suffix, size_t suffix_len, + size_t *result_length_p) +{ + size_t common_len, cur_len, final_len, to_dir_len; + int up_dirs = 0; + const unsigned char *cur_ptr, *prev_ptr; + unsigned char *final_path, *final_path_cur; + + common_len = raptor_uri_path_common_base_length(from_path, from_path_len, + to_path, to_path_len); + + if(result_length_p) + *result_length_p=0; + + /* Count how many directories we have to go up */ + cur_ptr = from_path + common_len; + prev_ptr = cur_ptr; + cur_len = from_path_len - common_len; + while((cur_ptr = (const unsigned char*)memchr(cur_ptr, '/', cur_len))) { + cur_ptr++; + up_dirs++; + cur_len -= cur_ptr - prev_ptr; + prev_ptr = cur_ptr; + } + + /* Calculate how many characters of to_path subdirs (counted from the + common base) we have to add. */ + cur_ptr = to_path + common_len; + prev_ptr = cur_ptr; + cur_len = to_path_len - common_len; + while((cur_ptr = (const unsigned char*)memchr(cur_ptr, '/', cur_len))) { + cur_ptr++; + cur_len -= cur_ptr - prev_ptr; + prev_ptr = cur_ptr; + } + to_dir_len = prev_ptr - (to_path + common_len); + + /* Create the final relative path */ + final_len = up_dirs*3 + to_dir_len + suffix_len; /* 3 for each "../" */ + final_path = RAPTOR_MALLOC(unsigned char*, final_len + 1); + if(!final_path) + return NULL; + *final_path=0; + + /* First, add the necessary "../" parts */ + final_path_cur = final_path; + while(up_dirs--) { + *final_path_cur++='.'; + *final_path_cur++='.'; + *final_path_cur++='/'; + } + + /* Then, add the path from the common base to the to_path */ + memcpy(final_path_cur, to_path + common_len, to_dir_len); + final_path_cur += to_dir_len; + + /* Finally, add the suffix */ + if(suffix && suffix_len) { + /* As a special case, if the suffix begins with a dot (".") and the final + output string so far is non-empty, skip the dot. */ + if(*suffix == '.' && final_path_cur != final_path) { + /* Make sure that the dot really represents a directory and it's not + just part of a file name like ".foo". In other words, the dot must + either be the only character or the next character must be the + fragment or the query character. */ + if((suffix_len == 1) || + (suffix_len > 1 && (suffix[1] == '#' || suffix[1] == '?'))) { + suffix++; + suffix_len--; + final_len--; + } + } + if(suffix_len) + memcpy(final_path_cur, suffix, suffix_len); + } + + final_path[final_len] = 0; + + if(result_length_p) + *result_length_p=final_len; + + return final_path; +} + + +/** + * raptor_uri_to_relative_counted_uri_string: + * @base_uri: The base absolute URI to resolve against (or NULL) + * @reference_uri: The reference absolute URI to use + * @length_p: Location to store the length of the relative URI string or NULL + * + * Get the counted relative URI string of a URI against a base URI. + * + * Return value: A newly allocated relative URI string or NULL on failure + **/ + +unsigned char* +raptor_uri_to_relative_counted_uri_string(raptor_uri *base_uri, + raptor_uri *reference_uri, + size_t *length_p) { + raptor_uri_detail *base_detail = NULL, *reference_detail; + const unsigned char *base, *reference_str, *base_file, *reference_file; + unsigned char *suffix, *cur_ptr; + size_t base_len, reference_len, reference_file_len, suffix_len; + unsigned char *result = NULL; + int suffix_is_result = 0; + + if(!reference_uri) + return NULL; + + if(length_p) + *length_p=0; + + reference_str = raptor_uri_as_counted_string(reference_uri, &reference_len); + reference_detail = raptor_new_uri_detail(reference_str); + if(!reference_detail) + goto err; + + if(!base_uri) + goto buildresult; + + base = raptor_uri_as_counted_string(base_uri, &base_len); + base_detail = raptor_new_uri_detail(base); + if(!base_detail) + goto err; + + /* Check if the whole URIs are equal */ + if(raptor_uri_equals(base_uri, reference_uri)) { + reference_len = 0; + goto buildresult; + } + + /* Check if scheme and authority of the URIs are equal */ + if(base_detail->scheme_len == reference_detail->scheme_len && + base_detail->authority_len == reference_detail->authority_len && + !strncmp((const char*)base_detail->scheme, + (const char*)reference_detail->scheme, + base_detail->scheme_len) && + (base_detail->authority_len == 0 || + !strncmp((const char*)base_detail->authority, + (const char*)reference_detail->authority, + base_detail->authority_len))) { + + if(!base_detail->path) { + if(reference_detail->path) { + /* if base has no path then the relative URI is relative + * to scheme+authority so assemble that in the suffix + * buffer (adding any query part or fragment needed) + */ + reference_file = reference_detail->path; + reference_file_len = reference_detail->path_len; + suffix_is_result = 1; + goto addqueryfragment; + } + goto buildresult; + } + + /* Find the file name components */ + base_file = (const unsigned char*)strrchr((const char*)base_detail->path, '/'); + if(!base_file) + goto buildresult; + base_file++; + + if(!reference_detail->path) + goto buildresult; + reference_file = (const unsigned char*)strrchr((const char*)reference_detail->path, '/'); + if(!reference_file) + goto buildresult; + reference_file++; + + reference_file_len = reference_detail->path_len - + (reference_file - reference_detail->path); + + if(!strcmp((const char*)base_detail->path, (const char*)reference_detail->path)) { + /* If the file names are equal, don't put them in the relative URI */ + reference_file = NULL; + reference_file_len = 0; + } else if(*base_file && !*reference_file) { + /* If the base file is non-empty, but the reference file is + * empty, use "." as the file name. + */ + reference_file = (const unsigned char*)"."; + reference_file_len = 1; + } + + addqueryfragment: + /* Calculate the length of the suffix (file name + query + fragment) */ + suffix_len = reference_file_len + reference_detail->query_len + + reference_detail->fragment_len; + + if(reference_detail->query) + suffix_len++; /* add one char for the '?' */ + if(reference_detail->fragment) + suffix_len++; /* add one char for the '#' */ + + /* Assemble the suffix */ + suffix = RAPTOR_MALLOC(unsigned char*, suffix_len + 1); + if(!suffix) + goto err; + cur_ptr = suffix; + if(reference_file) { + memcpy(suffix, reference_file, reference_file_len); + cur_ptr+= reference_file_len; + } + + if(reference_detail->query) { + *cur_ptr++='?'; + memcpy(cur_ptr, reference_detail->query, reference_detail->query_len); + cur_ptr+= reference_detail->query_len; + } + + if(reference_detail->fragment) { + *cur_ptr++='#'; + memcpy(cur_ptr, reference_detail->fragment, reference_detail->fragment_len); + cur_ptr+= reference_detail->fragment_len; + } + *cur_ptr=0; + + if(suffix_is_result) { + /* If suffix is what we need, just use that as the result */ + result = suffix; + if(length_p) + *length_p=suffix_len; + } else { + /* Otherwise create the full relative path */ + result = raptor_uri_path_make_relative_path(base_detail->path, + base_detail->path_len, + reference_detail->path, + reference_detail->path_len, + suffix, + suffix_len, + length_p); + RAPTOR_FREE(char*, suffix); + } + } + + + buildresult: + /* If result is NULL at this point, it means that we were unable to find a + relative URI, so we'll return a full absolute URI instead. */ + if(!result) { + result = RAPTOR_MALLOC(unsigned char*, reference_len + 1); + if(result) { + if(reference_len) + memcpy(result, reference_str, reference_len); + result[reference_len] = 0; + if(length_p) + *length_p=reference_len; + } + } + + err: + if(base_detail) + raptor_free_uri_detail(base_detail); + raptor_free_uri_detail(reference_detail); + + return result; +} + + +/** + * raptor_uri_to_relative_uri_string: + * @base_uri: The base absolute URI to resolve against + * @reference_uri: The reference absolute URI to use + * + * Get the relative URI string of a URI against a base URI. + * + * Return value: A newly allocated relative URI string or NULL on failure + **/ +unsigned char* +raptor_uri_to_relative_uri_string(raptor_uri *base_uri, + raptor_uri *reference_uri) +{ + return raptor_uri_to_relative_counted_uri_string(base_uri, reference_uri, + NULL); +} + + +/** + * raptor_uri_print: + * @uri: URI to print + * @stream: The file handle to print to + * + * Print a URI to a file handle. + * + * Return value: non-0 on failure + **/ +int +raptor_uri_print(const raptor_uri* uri, FILE *stream) +{ + size_t nwritten = 0; + size_t len = 10; + unsigned char *string = (unsigned char*)"(NULL URI)"; + raptor_world* world = NULL; + + if(uri) { + world = uri->world; + string = raptor_uri_as_counted_string((raptor_uri*)uri, &len); + } + + nwritten = fwrite(string, 1, len, stream); + if(nwritten != len) + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, + NULL, "fwrite failed - %s", strerror(errno)); + + return (nwritten == len); +} + + +/** + * raptor_uri_to_counted_string: + * @uri: #raptor_uri object + * @len_p: Pointer to length (or NULL) + * + * Get a new counted string for a URI. + * + * If @len_p is not NULL, the length of the string is stored in it. + * + * The memory allocated must be freed by the caller and + * raptor_free_memory() should be used for best portability. + * + * Return value: new string or NULL on failure + **/ +unsigned char* +raptor_uri_to_counted_string(raptor_uri *uri, size_t *len_p) +{ + size_t len; + unsigned char *string; + unsigned char *new_string; + + if(!uri) + return NULL; + + string = raptor_uri_as_counted_string(uri, &len); + if(!string) + return NULL; + + new_string = RAPTOR_MALLOC(unsigned char*, len + 1); /* +1 for NULL termination */ + if(!new_string) + return NULL; + + memcpy(new_string, string, len+1); + + if(len_p) + *len_p=len; + return new_string; +} + + +/** + * raptor_uri_to_string: + * @uri: #raptor_uri object + * + * Get a new string for a URI. + * + * The memory allocated must be freed by the caller and + * raptor_free_memory() should be used for best portability. + * + * Return value: new string or NULL on failure + **/ +unsigned char* +raptor_uri_to_string(raptor_uri *uri) +{ + return raptor_uri_to_counted_string(uri, NULL); +} + + +/** + * raptor_new_uri_from_rdf_ordinal: + * @world: raptor_world object + * @ordinal: integer rdf:_n + * + * Internal - convert an integer rdf:_n ordinal to the resource URI + * + * Return value: new URI object or NULL on failure + **/ +raptor_uri* +raptor_new_uri_from_rdf_ordinal(raptor_world* world, int ordinal) +{ + /* strlen(rdf namespace URI) + _ + decimal int number + \0 */ + unsigned char uri_string[43 + 1 + MAX_ASCII_INT_SIZE + 1]; + unsigned char *p = uri_string; + + memcpy(p, raptor_rdf_namespace_uri, raptor_rdf_namespace_uri_len); + p += raptor_rdf_namespace_uri_len; + *p++ = '_'; + (void)raptor_format_integer(RAPTOR_GOOD_CAST(char*, p), + MAX_ASCII_INT_SIZE + 1, ordinal, /* base */ 10, + -1, '\0'); + + return raptor_new_uri(world, uri_string); +} + + +/** + * raptor_uri_get_world: + * @uri: #raptor_uri object + * + * Get the raptor_world object associated with a raptor_uri. + * + * Return value: raptor_world object + **/ +raptor_world* +raptor_uri_get_world(raptor_uri *uri) +{ + return uri->world; +} + + +/** + * raptor_uri_filename_exists: + * @path: file path + * + * Check if @path points to a file that exists + * + * Return value: > 0 if file exists, 0 if does not exist, < 0 on error + **/ +int +raptor_uri_filename_exists(const unsigned char* path) +{ + int exists = -1; +#ifdef HAVE_STAT + struct stat stat_buffer; +#endif + + if(!path) + return -1; + +#ifdef HAVE_STAT + if(!stat((const char*)path, &stat_buffer)) + exists = S_ISREG(stat_buffer.st_mode); +#else + exists = (access(path, R_OK) < 0) ? -1 : 1; +#endif + + return exists; +} + + +/** + * raptor_uri_file_exists: + * @uri: URI string + * + * Check if a file: URI is a file that exists + * + * Return value: > 0 if file exists, 0 if does not exist, < 0 if not a file URI or error + **/ +int +raptor_uri_file_exists(raptor_uri* uri) +{ + const unsigned char* uri_string; + + if(!uri) + return -1; + + uri_string = raptor_uri_as_string(uri); + if(!raptor_uri_uri_string_is_file_uri(uri_string)) + return -1; + + return raptor_uri_filename_exists(uri_string + 6); +} + + + +/** + * raptor_uri_escaped_write: + * @uri: uri to write + * @base_uri: base uri to write relative to (or NULL) + * @flags: bit flags - see #raptor_escaped_write_bitflags + * @iostr: raptor iostream + * + * Write a #raptor_uri formatted with escapes to a #raptor_iostream + * + * Return value: non-0 on failure + **/ +int +raptor_uri_escaped_write(raptor_uri* uri, + raptor_uri* base_uri, + unsigned int flags, + raptor_iostream *iostr) +{ + unsigned char *uri_str; + int uri_str_owned = 0; + size_t len; + + if(!uri) + return 1; + + raptor_iostream_write_byte('<', iostr); + if(base_uri) { + uri_str = raptor_uri_to_relative_counted_uri_string(base_uri, uri, &len); + if(!uri_str) + return 1; + + uri_str_owned = 1; + } else { + uri_str = raptor_uri_as_counted_string(uri, &len); + } + if(uri_str) + raptor_string_escaped_write(uri_str, len, '>', flags, iostr); + raptor_iostream_write_byte('>', iostr); + + if(uri_str_owned && uri_str) + RAPTOR_FREE(char*, uri_str); + + return 0; +} + + +/** + * raptor_uri_uri_string_is_absolute: + * @uri_string: uri to check write + * + * Check if a uri string is an absolute URI + * + * Return value: >0 if absolute, 0 if not, < 0 on failure + **/ +int +raptor_uri_uri_string_is_absolute(const unsigned char* uri_string) +{ + const unsigned char* s = uri_string; + + /* + * scheme = alpha *( alpha | digit | "+" | "-" | "." ) + * RFC 2396 section 3.1 Scheme Component + */ + if(*s && isalpha((int)*s)) { + s++; + + while(*s && (isalnum((int)*s) || + (*s == '+') || (*s == '-') || (*s == '.'))) + s++; + + if(*s == ':') + return 1; + } + + + return 0; +} + + +#endif /* !STANDALONE */ + + +#ifdef STANDALONE + +#include <stdio.h> +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif + +/* one more prototype */ +int main(int argc, char *argv[]); + +static const char *program; + + +static int +assert_uri_is_valid(raptor_uri* uri) +{ + if(strlen((const char*)uri->string) != uri->length) { + fprintf(stderr, + "%s: URI with string '%s' is invalid. length is %d, recorded in object as %d\n", + program, uri->string, + (int)strlen((const char*)uri->string), + (int)uri->length); + return 0; + } + + return 1; +} + + +static int +assert_filename_to_uri (const char *filename, const char *reference_uri) +{ + unsigned char *uri; + + uri = raptor_uri_filename_to_uri_string(filename); + + if(!uri || strcmp((const char*)uri, (const char*)reference_uri)) { + fprintf(stderr, + "%s: raptor_uri_filename_to_uri_string(%s) FAILED gaving URI %s != %s\n", + program, filename, uri, reference_uri); + if(uri) + RAPTOR_FREE(char*, uri); + return 1; + } + + RAPTOR_FREE(char*, uri); + return 0; +} + + +static int +assert_uri_to_filename (const char *uri, const char *reference_filename) +{ + char *filename; + + filename = raptor_uri_uri_string_to_filename((const unsigned char*)uri); + + if(filename && !reference_filename) { + fprintf(stderr, + "%s: raptor_uri_uri_string_to_filename(%s) FAILED giving filename %s != NULL\n", + program, uri, filename); + if(filename) + RAPTOR_FREE(char*, filename); + return 1; + } else if(filename && strcmp(filename, reference_filename)) { + fprintf(stderr, + "%s: raptor_uri_uri_string_to_filename(%s) FAILED gaving filename %s != %s\n", + program, uri, filename, reference_filename); + if(filename) + RAPTOR_FREE(char*, filename); + return 1; + } + + RAPTOR_FREE(char*, filename); + return 0; +} + + +static int +assert_uri_to_relative(raptor_world *world, const char *base, const char *uri, const char *relative) +{ + unsigned char *output; + int result; + raptor_uri* base_uri = NULL; + raptor_uri* reference_uri = raptor_new_uri(world, (const unsigned char*)uri); + size_t length = 0; + + if(!assert_uri_is_valid(reference_uri)) + return 1; + + if(base) { + base_uri = raptor_new_uri(world, (const unsigned char*)base); + if(base_uri && !assert_uri_is_valid(base_uri)) { + raptor_free_uri(reference_uri); + raptor_free_uri(base_uri); + return 1; + } + } + + output = raptor_uri_to_relative_counted_uri_string(base_uri, reference_uri, + &length); + result = strcmp(relative, (const char*)output); + if(result) { + fprintf(stderr, + "%s: raptor_uri_string_to_relative_uri_string FAILED: base='%s', uri='%s', expected='%s', got='%s'\n", + program, base, uri, relative, output); + RAPTOR_FREE(char*, output); + return 1; + } + RAPTOR_FREE(char*, output); + if(base_uri) + raptor_free_uri(base_uri); + raptor_free_uri(reference_uri); + return 0; +} + + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *base_uri = "http://example.org/bpath/cpath/d;p?querystr#frag"; + const char *base_uri_xmlbase = "http://example.org/bpath/cpath/d;p"; + const char *base_uri_retrievable = "http://example.org/bpath/cpath/d;p?querystr"; +#ifndef WIN32 +#if defined(HAVE_UNISTD_H) && defined(HAVE_SYS_STAT_H) + const char* dirs[6] = { "/etc", "/bin", "/tmp", "/lib", "/var", NULL }; + #define URI_BUFFER_LEN 16 + unsigned char uri_buffer[URI_BUFFER_LEN]; /* strlen("file:///DIR/foo")+1 */ + int i; + const char *dir; +#endif +#endif + unsigned char *str; + raptor_uri *uri1, *uri2, *uri3; + + int failures = 0; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + if((program = strrchr(argv[0], '/'))) + program++; + else if((program = strrchr(argv[0], '\\'))) + program++; + else + program = argv[0]; + +#ifdef WIN32 + failures += assert_filename_to_uri ("c:\\windows\\system", "file:///c:/windows/system"); + failures += assert_filename_to_uri ("\\\\server\\share\\file.doc", "file://server/share/file.doc"); + failures += assert_filename_to_uri ("a:foo", "file:///a:./foo"); + + failures += assert_filename_to_uri ("C:\\Documents and Settings\\myapp\\foo.bat", "file:///C:/Documents%20and%20Settings/myapp/foo.bat"); + failures += assert_filename_to_uri ("C:\\My Documents\\%age.txt", "file:///C:/My%20Documents/%25age.txt"); + + failures += assert_uri_to_filename ("file:///c|/windows/system", "c:\\windows\\system"); + failures += assert_uri_to_filename ("file:///c:/windows/system", "c:\\windows\\system"); + failures += assert_uri_to_filename ("file://server/share/file.doc", "\\\\server\\share\\file.doc"); + failures += assert_uri_to_filename ("file:///a:./foo", "a:foo"); + failures += assert_uri_to_filename ("file:///C:/Documents%20and%20Settings/myapp/foo.bat", "C:\\Documents and Settings\\myapp\\foo.bat"); + failures += assert_uri_to_filename ("file:///C:/My%20Documents/%25age.txt", "C:\\My Documents\\%age.txt"); + + + failures += assert_uri_to_filename ("file:c:\\thing", "c:\\thing"); + failures += assert_uri_to_filename ("file:/c:\\thing", "c:\\thing"); + failures += assert_uri_to_filename ("file://c:\\thing", NULL); + failures += assert_uri_to_filename ("file:///c:\\thing", "c:\\thing"); + failures += assert_uri_to_filename ("file://localhost/", NULL); + failures += assert_uri_to_filename ("file://c:\\foo\\bar\\x.rdf", NULL); + +#else + + failures += assert_filename_to_uri ("/path/to/file", "file:///path/to/file"); + failures += assert_filename_to_uri ("/path/to/file with spaces", "file:///path/to/file%20with%20spaces"); + failures += assert_uri_to_filename ("file:///path/to/file", "/path/to/file"); + failures += assert_uri_to_filename ("file:///path/to/file%20with%20spaces", "/path/to/file with spaces"); + + /* Tests for Issue#0000268 http://bugs.librdf.org/mantis/view.php?id = 268 */ + failures += assert_uri_to_filename ("file:///path/to/http%253A%252F%252Fwww.example.org%252Fa%252Fb%252Fc", "/path/to/http%3A%2F%2Fwww.example.org%2Fa%2Fb%2Fc"); + failures += assert_filename_to_uri ("/path/to/http%3A%2F%2Fwww.example.org%2Fa%2Fb%2Fc", "file:///path/to/http%253A%252F%252Fwww.example.org%252Fa%252Fb%252Fc"); + +#if defined(HAVE_UNISTD_H) && defined(HAVE_SYS_STAT_H) + /* Need to test this with a real dir (preferably not /) + * This is just a test so pretty likely to work on all development systems + * that are not WIN32 + */ + + for(i = 0; (dir = dirs[i]); i++) { + struct stat buf; + if(!lstat(dir, &buf) && S_ISDIR(buf.st_mode) && !S_ISLNK(buf.st_mode)) { + if(!chdir(dir)) + break; + } + } + if(!dir) + fprintf(stderr, + "%s: WARNING: Found no convenient directory - not testing relative files\n", + program); + else { + snprintf((char*)uri_buffer, URI_BUFFER_LEN, "file://%s/foo", dir); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, + "%s: Checking relative file name 'foo' in dir %s expecting URI %s\n", + program, dir, uri_buffer); +#endif + failures += assert_filename_to_uri ("foo", (const char*)uri_buffer); + } +#endif + +#endif + + uri1 = raptor_new_uri(world, (const unsigned char*)base_uri); + + str = raptor_uri_as_string(uri1); + if(strcmp((const char*)str, base_uri)) { + fprintf(stderr, + "%s: raptor_uri_as_string(%s) FAILED gaving %s != %s\n", + program, base_uri, str, base_uri); + failures++; + } + + uri2 = raptor_new_uri_for_xmlbase(uri1); + str = raptor_uri_as_string(uri2); + if(strcmp((const char*)str, base_uri_xmlbase)) { + fprintf(stderr, + "%s: raptor_new_uri_for_xmlbase(URI %s) FAILED giving %s != %s\n", + program, base_uri, str, base_uri_xmlbase); + failures++; + } + + uri3 = raptor_new_uri_for_retrieval(uri1); + + str = raptor_uri_as_string(uri3); + if(strcmp((const char*)str, base_uri_retrievable)) { + fprintf(stderr, + "%s: raptor_new_uri_for_retrievable(%s) FAILED gaving %s != %s\n", + program, base_uri, str, base_uri_retrievable); + failures++; + } + + raptor_free_uri(uri3); + raptor_free_uri(uri2); + raptor_free_uri(uri1); + + failures += assert_uri_to_relative(world, NULL, "http://example.com/foo/bar", "http://example.com/foo/bar"); + failures += assert_uri_to_relative(world, "", "http://example.com/foo/bar", "http://example.com/foo/bar"); + failures += assert_uri_to_relative(world, "foo:", "http://example.com/foo/bar", "http://example.com/foo/bar"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo?foo#foo", "http://example.com/base/bar?bar#bar", "bar?bar#bar"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/base/foo/", "foo/"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/base/foo/.foo", "foo/.foo"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/base/foo/.foo#bar", "foo/.foo#bar"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/base/foo/bar", "foo/bar"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/base/foo#bar", "#bar"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/base/bar#foo", "bar#foo"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/otherbase/foo", "../otherbase/foo"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/otherbase/bar", "../otherbase/bar"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example.com/base/#foo", ".#foo"); + failures += assert_uri_to_relative(world, "http://example.com/base/foo", "http://example2.com/base/bar", "http://example2.com/base/bar"); + failures += assert_uri_to_relative(world, "http://example.com/base/one?path=/should/be/ignored", "http://example.com/base/two?path=/should/be/ignored", "two?path=/should/be/ignored"); + failures += assert_uri_to_relative(world, "http://example.org/base#", "http://www.foo.org", "http://www.foo.org"); + failures += assert_uri_to_relative(world, "http://example.org", "http://a.example.org/", "http://a.example.org/"); + failures += assert_uri_to_relative(world, "http://example.org", "http://a.example.org", "http://a.example.org"); + failures += assert_uri_to_relative(world, "http://abcdefgh.example.org/foo/bar/", "http://ijklmnop.example.org/", "http://ijklmnop.example.org/"); + failures += assert_uri_to_relative(world, "http://example.org", "http://example.org/a/b/c/d/efgh", "/a/b/c/d/efgh"); + + if(1) { + int ret; + raptor_uri* u1; + raptor_uri* u2; + + u1 = raptor_new_uri(world, (const unsigned char *)"http://example.org/abc"); + u2 = raptor_new_uri(world, (const unsigned char *)"http://example.org/def"); + + ret = raptor_uri_compare(u1, u2); + if(!(ret < 0)) { + fprintf(stderr, + "%s: raptor_uri_compare(%s, %s) FAILED gave %d expected <0\n", + program, raptor_uri_as_string(u1), raptor_uri_as_string(u2), + ret); + failures++; + } + + raptor_free_uri(u1); + raptor_free_uri(u2); + } + + raptor_free_world(world); + + return failures ; +} + +#endif /* STANDALONE */ diff --git a/src/raptor_win32.c b/src/raptor_win32.c new file mode 100644 index 0000000..d41eaf2 --- /dev/null +++ b/src/raptor_win32.c @@ -0,0 +1,44 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_win32.c - Raptor WIN32 support functions + * + * Copyright (C) 2002-2006, David Beckett http://www.dajobe.org/ + * Copyright (C) 2002-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#ifdef WIN32 + +/* Only on WIN32 systems */ + + +/* DLL entry point */ +BOOL APIENTRY +DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +{ + return TRUE; +} + + +/* end if WIN32 */ +#endif diff --git a/src/raptor_www.c b/src/raptor_www.c new file mode 100644 index 0000000..26c2fa2 --- /dev/null +++ b/src/raptor_www.c @@ -0,0 +1,896 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_www.c - Raptor WWW retrieval core + * + * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +static int raptor_www_file_fetch(raptor_www* www); + + + +/* + * raptor_www_init: + * @world: raptor_world object + * + * INTERNAL - Initialise the WWW class. + * + * Must be called before creating any #raptor_www object. + * + * Return value: non-0 on failure + **/ +int +raptor_www_init(raptor_world* world) +{ + int rc = 0; + + if(world->www_initialized) + return 0; + + if(!world->www_skip_www_init_finish) { +#ifdef RAPTOR_WWW_LIBCURL + rc = curl_global_init(CURL_GLOBAL_ALL); +#endif + } + + world->www_initialized = 1; + return rc; +} + + +/* + * raptor_www_finish: + * @world: raptor_world object + * + * INTERNAL - Terminate the WWW class. + * + * Must be called to clean any resources used by the WWW implementation. + * + **/ +void +raptor_www_finish(raptor_world* world) +{ + if(!world->www_skip_www_init_finish) { +#ifdef RAPTOR_WWW_LIBCURL + curl_global_cleanup(); +#endif + } +} + + +/** + * raptor_new_www_with_connection: + * @world: raptor_world object + * @connection: external WWW connection object. + * + * Constructor - create a new #raptor_www object over an existing WWW connection. + * + * At present this only works with a libcurl CURL handle object + * when raptor is compiled with libcurl suppport. Otherwise the + * @connection is ignored. This allows such things as setting + * up special flags on the curl handle before passing into the constructor. + * + * Return value: a new #raptor_www object or NULL on failure. + **/ +raptor_www* +raptor_new_www_with_connection(raptor_world* world, void *connection) +{ + raptor_www* www; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + www = RAPTOR_CALLOC(raptor_www*, 1, sizeof(*www)); + if(!www) + return NULL; + + www->world = world; + www->type = NULL; + www->free_type = 1; /* default is to free content type */ + www->total_bytes = 0; + www->failed = 0; + www->status_code = 0; + www->write_bytes = NULL; + www->content_type = NULL; + www->uri_filter = NULL; + www->connection_timeout = 10; + www->cache_control = NULL; + +#ifdef RAPTOR_WWW_LIBCURL + www->curl_handle = (CURL*)connection; + if(raptor_www_curl_init(www)) { + raptor_free_www(www); + www = NULL; + } +#endif +#ifdef RAPTOR_WWW_LIBXML + raptor_www_libxml_init(www); +#endif +#ifdef RAPTOR_WWW_LIBFETCH + raptor_www_libfetch_init(www); +#endif + + return www; +} + + +/** + * raptor_new_www: + * @world: raptor_world object + * + * Constructor - create a new #raptor_www object. + * + * Return value: a new #raptor_www or NULL on failure. + **/ +raptor_www* +raptor_new_www(raptor_world* world) +{ + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + raptor_world_open(world); + + return raptor_new_www_with_connection(world, NULL); +} + + +/** + * raptor_free_www: + * @www: WWW object. + * + * Destructor - destroy a #raptor_www object. + **/ +void +raptor_free_www(raptor_www* www) +{ + /* free context */ + if(www->type) { + if(www->free_type) + RAPTOR_FREE(char*, www->type); + www->type = NULL; + } + + if(www->user_agent) { + RAPTOR_FREE(char*, www->user_agent); + www->user_agent = NULL; + } + + if(www->cache_control) { + RAPTOR_FREE(char*, www->cache_control); + www->cache_control = NULL; + } + + if(www->proxy) { + RAPTOR_FREE(char*, www->proxy); + www->proxy = NULL; + } + + if(www->http_accept) { + RAPTOR_FREE(char*, www->http_accept); + www->http_accept = NULL; + } + +#ifdef RAPTOR_WWW_LIBCURL + raptor_www_curl_free(www); +#endif +#ifdef RAPTOR_WWW_LIBXML + raptor_www_libxml_free(www); +#endif +#ifdef RAPTOR_WWW_LIBFETCH + raptor_www_libfetch_free(www); +#endif + + if(www->uri) + raptor_free_uri(www->uri); + + if(www->final_uri) + raptor_free_uri(www->final_uri); + + RAPTOR_FREE(www, www); +} + + + +/** + * raptor_www_set_write_bytes_handler: + * @www: WWW object + * @handler: bytes handler function + * @user_data: bytes handler data + * + * Set the handler to receive bytes written by the #raptor_www implementation. + * + **/ +void +raptor_www_set_write_bytes_handler(raptor_www* www, + raptor_www_write_bytes_handler handler, + void *user_data) +{ + www->write_bytes = handler; + www->write_bytes_userdata = user_data; +} + + +/** + * raptor_www_set_content_type_handler: + * @www: WWW object + * @handler: content type handler function + * @user_data: content type handler data + * + * Set the handler to receive the HTTP Content-Type header value. + * + * This is called if or when the value is discovered during retrieval + * by the raptor_www implementation. Not all implementations provide + * access to this. + **/ +void +raptor_www_set_content_type_handler(raptor_www* www, + raptor_www_content_type_handler handler, + void *user_data) +{ + www->content_type = handler; + www->content_type_userdata = user_data; +} + + +/** + * raptor_www_set_user_agent2: + * @www: WWW object + * @user_agent: User-Agent string + * @user_agent_len: Length of @user_agent string or 0 to count it here. + * + * Set the user agent value, for HTTP requests typically. + * + * Return value: non-0 on failure + **/ +int +raptor_www_set_user_agent2(raptor_www* www, const char *user_agent, + size_t user_agent_len) +{ + char *ua_copy = NULL; + + if(!user_agent || !*user_agent) { + www->user_agent = NULL; + return 0; + } + + if(user_agent_len == 0) + user_agent_len = strlen(user_agent); + + ua_copy = RAPTOR_MALLOC(char*, user_agent_len + 1); + if(!ua_copy) + return 1; + + memcpy(ua_copy, user_agent, user_agent_len + 1); /* copy NUL */ + + www->user_agent = ua_copy; + + return 0; +} + + +/** + * raptor_www_set_user_agent: + * @www: WWW object + * @user_agent: User-Agent string + * + * Set the user agent value, for HTTP requests typically. + * + * @Deprecated: use raptor_www_set_user_agent2() which takes a length + * parameter and returns a value to singify failure. + * + **/ +void +raptor_www_set_user_agent(raptor_www* www, const char *user_agent) +{ + (void)raptor_www_set_user_agent2(www, user_agent, 0); +} + + +/** + * raptor_www_set_proxy2: + * @www: WWW object + * @proxy: proxy string. + * @proxy_len: Length of @proxy string or 0 to count it here. + * + * Set the proxy for the WWW object. + * + * The @proxy usually a string of the form http://server.domain:port. + * + * Return value: non-0 on failure + **/ +int +raptor_www_set_proxy2(raptor_www* www, const char *proxy, + size_t proxy_len) +{ + char *proxy_copy; + + if(!proxy) + return 1; + + if(proxy_len == 0) + proxy_len = strlen(proxy); + + proxy_copy = RAPTOR_MALLOC(char*, proxy_len + 1); + if(!proxy_copy) + return 1; + + memcpy(proxy_copy, proxy, proxy_len + 1); /* copy NUL */ + + www->proxy = proxy_copy; + + return 0; +} + + +/** + * raptor_www_set_proxy: + * @www: WWW object + * @proxy: proxy string. + * + * Set the proxy for the WWW object. + * + * The @proxy usually a string of the form http://server.domain:port. + * + * @Deprecated: use raptor_www_set_proxy2() which takes an length + * parameter and returns a value to singify failure. + * + **/ +void +raptor_www_set_proxy(raptor_www* www, const char *proxy) +{ + (void)raptor_www_set_proxy2(www, proxy, 0); +} + + +/** + * raptor_www_set_http_accept2: + * @www: #raptor_www class + * @value: Accept: header value or NULL to have an empty one. + * @value_len: Length of @value string or 0 to count it here. + * + * Set HTTP Accept header. + * + * Return value: non-0 on failure + **/ +int +raptor_www_set_http_accept2(raptor_www* www, const char *value, + size_t value_len) +{ + char *value_copy; + size_t len = 8; /* strlen("Accept:")+1 */ + + if(value) { + if (value_len == 0) + value_len = strlen(value); + len += 1 + value_len; /* " "+value */ + } + + value_copy = RAPTOR_MALLOC(char*, len); + if(!value_copy) + return 1; + www->http_accept = value_copy; + + /* copy header name */ + memcpy(value_copy, "Accept:", 7); /* Do not copy NUL */ + value_copy += 7; + + /* copy header value */ + if(value) { + *value_copy++ = ' '; + memcpy(value_copy, value, value_len + 1); /* Copy NUL */ + } else { + /* Ensure value is NUL terminated */ + *value_copy = '\0'; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Using Accept header: '%s'\n", www->http_accept); +#endif + + return 0; +} + + +/** + * raptor_www_set_http_accept: + * @www: #raptor_www class + * @value: Accept: header value or NULL to have an empty one. + * + * Set HTTP Accept header. + * + * @Deprecated: use raptor_www_set_http_accept2() which takes an + * length parameter and returns a value to singify failure. + * + **/ +void +raptor_www_set_http_accept(raptor_www* www, const char *value) +{ + (void)raptor_www_set_http_accept2(www, value, 0); +} + + +/** + * raptor_www_set_connection_timeout: + * @www: WWW object + * @timeout: Timeout in seconds + * + * Set WWW connection timeout + **/ +void +raptor_www_set_connection_timeout(raptor_www* www, int timeout) +{ + www->connection_timeout = timeout; +} + + +/** + * raptor_www_set_http_cache_control: + * @www: WWW object + * @cache_control: Cache-Control header value (or NULL to disable) + * + * Set HTTP Cache-Control:header (default none) + * + * The @cache_control value can be a string to set it, "" to send + * a blank header or NULL to not set the header at all. + * + * Return value: non-0 on failure + **/ +int +raptor_www_set_http_cache_control(raptor_www* www, const char* cache_control) +{ + char *cache_control_copy; + const char* const header="Cache-Control:"; + const size_t header_len = 14; /* strlen("Cache-Control:") */ + size_t len; + size_t cc_len; + + RAPTOR_ASSERT_RETURN((strlen(header) != header_len), "Cache-Control header length is wrong", 1); + + if(www->cache_control) { + RAPTOR_FREE(char*, www->cache_control); + www->cache_control = NULL; + } + + if(!cache_control) { + www->cache_control = NULL; + return 0; + } + + cc_len = strlen(cache_control); + len = header_len + 1 + cc_len + 1; /* header+" "+cache_control+"\0" */ + + cache_control_copy = RAPTOR_MALLOC(char*, len); + if(!cache_control_copy) + return 1; + + www->cache_control = cache_control_copy; + + /* copy header name */ + memcpy(cache_control_copy, header, header_len); /* Do not copy NUL */ + cache_control_copy += header_len; + + /* copy header value */ + if(*cache_control) { + *cache_control_copy ++= ' '; + memcpy(cache_control_copy, cache_control, cc_len + 1); /* Copy NUL */ + } else { + /* Ensure value is NUL terminated */ + *cache_control_copy = '\0'; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("Using Cache-Control header: '%s'\n", www->cache_control); +#endif + + return 0; +} + + +/** + * raptor_www_set_uri_filter: + * @www: WWW object + * @filter: URI filter function + * @user_data: User data to pass to filter function + * + * Set URI filter function for WWW retrieval. + **/ +void +raptor_www_set_uri_filter(raptor_www* www, + raptor_uri_filter_func filter, + void *user_data) +{ + www->uri_filter = filter; + www->uri_filter_user_data = user_data; +} + + +/** + * raptor_www_set_ssl_cert_options: + * @www: WWW object + * @cert_filename: SSL client certificate file + * @cert_type: SSL client certificate type (default is "PEM") + * @cert_passphrase: SSL client certificate password + * + * Set SSL client certificate options (where supported) + * + * Return value: non-0 when setting options is not supported + **/ +int +raptor_www_set_ssl_cert_options(raptor_www* www, + const char* cert_filename, + const char* cert_type, + const char* cert_passphrase) +{ +#ifdef RAPTOR_WWW_LIBCURL + return raptor_www_curl_set_ssl_cert_options(www, cert_filename, cert_type, + cert_passphrase); +#else + return 1; +#endif +} + + +/** + * raptor_www_set_ssl_verify_options: + * @www: WWW object + * @verify_peer: SSL verify peer - non-0 to verify peer SSL certificate (default) + * @verify_host: SSL verify host - 0 none, non-0 to require a CN match (default). + * + * Set whether SSL verifies the authenticity of the peer's certificate + * + * These options correspond to setting the curl + * CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options. + * + * Return value: non-0 on failure + **/ +int +raptor_www_set_ssl_verify_options(raptor_www* www, int verify_peer, + int verify_host) +{ +#ifdef RAPTOR_WWW_LIBCURL + return raptor_www_curl_set_ssl_verify_options(www, verify_peer, + verify_host); +#else + return 1; +#endif +} + + + +/** + * raptor_www_get_connection: + * @www: #raptor_www object + * + * Get WWW library connection object. + * + * Return the internal WWW connection handle. For libcurl, this + * returns the CURL handle and for libxml the context. Otherwise + * it returns NULL. + * + * Return value: connection pointer + **/ +void* +raptor_www_get_connection(raptor_www* www) +{ +#if defined(RAPTOR_WWW_LIBCURL) + return www->curl_handle; +#elif defined(RAPTOR_WWW_LIBXML) + return www->ctxt; +#else + return NULL; +#endif +} + + +/** + * raptor_www_abort: + * @www: WWW object + * @reason: abort reason message + * + * Abort an ongoing raptor WWW operation and pass back a reason. + * + * This is typically used within one of the raptor WWW handlers + * when retrieval need no longer continue due to another + * processing issue or error. + **/ +void +raptor_www_abort(raptor_www* www, const char *reason) +{ + www->failed = 1; +} + + +void +raptor_www_error(raptor_www* www, const char *message, ...) +{ + va_list arguments; + + va_start(arguments, message); + + raptor_log_error_varargs(www->world, + RAPTOR_LOG_LEVEL_ERROR, + &www->locator, + message, arguments); + + va_end(arguments); +} + + +static int +raptor_www_file_handle_fetch(raptor_www* www, FILE* fh) +{ + while(!feof(fh)) { + size_t len = fread(www->buffer, 1, RAPTOR_WWW_BUFFER_SIZE, fh); + if(len > 0) { + www->total_bytes += len; + www->buffer[len]='\0'; + + if(www->write_bytes) + www->write_bytes(www, www->write_bytes_userdata, www->buffer, len, 1); + } + + if(feof(fh) || www->failed) + break; + } + + if(!www->failed) + www->status_code = 200; + + return www->failed; +} + + +static int +raptor_www_file_fetch(raptor_www* www) +{ + char *filename; + FILE *fh; + unsigned char *uri_string = raptor_uri_as_string(www->uri); +#if defined(HAVE_UNISTD_H) && defined(HAVE_SYS_STAT_H) + struct stat buf; +#endif + + www->status_code = 200; + + filename = raptor_uri_uri_string_to_filename(uri_string); + if(!filename) { + raptor_www_error(www, "Not a file: URI"); + return 1; + } + +#if defined(HAVE_UNISTD_H) && defined(HAVE_SYS_STAT_H) + if(!stat(filename, &buf) && S_ISDIR(buf.st_mode)) { + raptor_www_error(www, "Cannot read from a directory '%s'", filename); + RAPTOR_FREE(char*, filename); + www->status_code = 404; + return 1; + } +#endif + + fh = fopen(filename, "rb"); + if(!fh) { + raptor_www_error(www, "file '%s' open failed - %s", + filename, strerror(errno)); + RAPTOR_FREE(char*, filename); + www->status_code = (errno == EACCES) ? 403: 404; + www->failed = 1; + + return www->failed; + } + + raptor_www_file_handle_fetch(www, fh); + fclose(fh); + + RAPTOR_FREE(char*, filename); + + return www->failed; +} + + +/** +* raptor_www_fetch: +* @www: WWW object +* @uri: URI to read from +* +* Start a WWW content retrieval for the given URI, returning data via the write_bytes handler. +* +* Return value: non-0 on failure. +**/ +int +raptor_www_fetch(raptor_www *www, raptor_uri *uri) +{ + int status = 1; + + www->uri = raptor_new_uri_for_retrieval(uri); + + www->locator.uri = uri; + www->locator.line= -1; + www->locator.column= -1; + + if(www->uri_filter) { + int rc = www->uri_filter(www->uri_filter_user_data, uri); + if(rc) + return rc; + } + +#ifdef RAPTOR_WWW_NONE + status = raptor_www_file_fetch(www); +#else + + if(raptor_uri_uri_string_is_file_uri(raptor_uri_as_string(www->uri))) + status = raptor_www_file_fetch(www); + else { +#ifdef RAPTOR_WWW_LIBCURL + status = raptor_www_curl_fetch(www); +#endif + +#ifdef RAPTOR_WWW_LIBXML + status = raptor_www_libxml_fetch(www); +#endif + +#ifdef RAPTOR_WWW_LIBFETCH + status = raptor_www_libfetch_fetch(www); +#endif + } + +#endif + if(!status && www->status_code && www->status_code != 200){ + raptor_www_error(www, "Resolving URI failed with HTTP status %d", + www->status_code); + status = 1; + } + + www->failed = status; + + return www->failed; +} + + +static void +raptor_www_fetch_to_string_write_bytes(raptor_www* www, void *userdata, + const void *ptr, size_t size, + size_t nmemb) +{ + raptor_stringbuffer* sb = (raptor_stringbuffer*)userdata; + size_t len = size * nmemb; + + raptor_stringbuffer_append_counted_string(sb, (unsigned char*)ptr, len, 1); +} + + +/** + * raptor_www_fetch_to_string: + * @www: raptor_www object + * @uri: raptor_uri to retrieve + * @string_p: pointer to location to hold string + * @length_p: pointer to location to hold length of string (or NULL) + * @malloc_handler: pointer to malloc() to use to make string (or NULL) + * + * Start a WWW content retrieval for the given URI, returning the data in a new string. + * + * If @malloc_handler is null, raptor will allocate it using it's + * own memory allocator. *string_p is set to NULL on failure (and + * *length_p to 0 if length_p is not NULL). + * + * Return value: non-0 on failure + **/ +RAPTOR_EXTERN_C +int +raptor_www_fetch_to_string(raptor_www *www, raptor_uri *uri, + void **string_p, size_t *length_p, + raptor_data_malloc_handler const malloc_handler) +{ + raptor_stringbuffer *sb = NULL; + void *str = NULL; + raptor_www_write_bytes_handler saved_write_bytes; + void *saved_write_bytes_userdata; + + sb = raptor_new_stringbuffer(); + if(!sb) + return 1; + + if(length_p) + *length_p=0; + + saved_write_bytes = www->write_bytes; + saved_write_bytes_userdata = www->write_bytes_userdata; + raptor_www_set_write_bytes_handler(www, raptor_www_fetch_to_string_write_bytes, sb); + + if(raptor_www_fetch(www, uri)) + str = NULL; + else { + size_t len = raptor_stringbuffer_length(sb); + if(len) { + str = (void*)malloc_handler(len+1); + if(str) { + raptor_stringbuffer_copy_to_string(sb, (unsigned char*)str, len+1); + *string_p=str; + if(length_p) + *length_p=len; + } + } + } + + if(sb) + raptor_free_stringbuffer(sb); + + raptor_www_set_write_bytes_handler(www, saved_write_bytes, saved_write_bytes_userdata); + + return (str == NULL); +} + + +/** + * raptor_www_get_final_uri: + * @www: #raptor_www object + * + * Get the WWW final resolved URI. + * + * This returns the URI used after any protocol redirection. + * + * Return value: a new URI or NULL if not known. + **/ +raptor_uri* +raptor_www_get_final_uri(raptor_www* www) +{ + return www->final_uri ? raptor_uri_copy(www->final_uri) : NULL; +} + + +/** + * raptor_www_set_final_uri_handler: + * @www: WWW object + * @handler: content type handler function + * @user_data: content type handler data + * + * Set the handler to receive the HTTP Content-Type header value. + * + * This is called if or when the value is discovered during retrieval + * by the raptor_www implementation. Not all implementations provide + * access to this. + **/ +void +raptor_www_set_final_uri_handler(raptor_www* www, + raptor_www_final_uri_handler handler, + void *user_data) +{ + www->final_uri_handler = handler; + www->final_uri_userdata = user_data; +} diff --git a/src/raptor_www_curl.c b/src/raptor_www_curl.c new file mode 100644 index 0000000..d689f2b --- /dev/null +++ b/src/raptor_www_curl.c @@ -0,0 +1,388 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_www_curl.c - Raptor WWW retrieval via libcurl + * + * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#ifdef RAPTOR_WWW_LIBCURL + +#include <stdio.h> +#include <string.h> +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif +#include <stdarg.h> + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +static void +raptor_www_curl_update_status(raptor_www* www) +{ + char* final_uri; + + if(www->failed) + return; + + if(www->checked_status++) + return; + + if(!www->final_uri) { + /* If not already found in headers by + * raptor_www_curl_header_callback() which overrides what libcurl + * found in HTTP status line (3xx) + */ + + if(curl_easy_getinfo(www->curl_handle, CURLINFO_EFFECTIVE_URL, + &final_uri) == CURLE_OK) { + www->final_uri = raptor_new_uri(www->world, (const unsigned char*)final_uri); + if(www->final_uri_handler) + www->final_uri_handler(www, www->final_uri_userdata, www->final_uri); + } + } + +} + + +static size_t +raptor_www_curl_write_callback(void *ptr, size_t size, size_t nmemb, void *userdata) +{ + raptor_www* www = (raptor_www*)userdata; + size_t bytes = size * nmemb; + + /* If WWW has been aborted, return nothing so that + * libcurl will abort the transfer + */ + if(www->failed) + return 0; + + raptor_www_curl_update_status(www); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + RAPTOR_DEBUG2("Got %d bytes\n", bytes); +#endif + + if(www->write_bytes) + www->write_bytes(www, www->write_bytes_userdata, ptr, size, nmemb); + www->total_bytes += bytes; + return bytes; +} + + +static size_t +raptor_www_curl_header_callback(void* ptr, size_t size, size_t nmemb, + void *userdata) +{ + raptor_www* www = (raptor_www*)userdata; + size_t bytes = size * nmemb; + int c; + + /* If WWW has been aborted, return nothing so that + * libcurl will abort the transfer + */ + if(www->failed) + return 0; + +#define CONTENT_TYPE_LEN 14 + if(!raptor_strncasecmp((char*)ptr, "Content-Type: ", CONTENT_TYPE_LEN)) { + size_t len = bytes - CONTENT_TYPE_LEN - 2; /* for \r\n */ + char *type_buffer = RAPTOR_MALLOC(char*, len + 1); + memcpy(type_buffer, (char*)ptr + 14, len); + type_buffer[len]='\0'; + if(www->type) + RAPTOR_FREE(char*, www->type); + www->type = type_buffer; + www->free_type = 1; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + RAPTOR_DEBUG3("Got content type header '%s' (%d bytes)\n", type_buffer, len); +#endif + if(www->content_type) + www->content_type(www, www->content_type_userdata, www->type); + } + + +#define CONTENT_LOCATION_LEN 18 + if(!raptor_strncasecmp((char*)ptr, "Content-Location: ", + CONTENT_LOCATION_LEN)) { + size_t uri_len = bytes - CONTENT_LOCATION_LEN - 2; /* for \r\n */ + unsigned char* uri_str = (unsigned char*)ptr + CONTENT_LOCATION_LEN; + + if(www->final_uri) + raptor_free_uri(www->final_uri); + + /* Ensure it is NUL terminated */ + c = uri_str[uri_len]; + uri_str[uri_len] = '\0'; + www->final_uri = raptor_new_uri_relative_to_base_counted(www->world, + www->uri, + uri_str, uri_len); + uri_str[uri_len] = RAPTOR_GOOD_CAST(unsigned char, c); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + if(www->final_uri) + RAPTOR_DEBUG2("Got content location header '%s'\n", + raptor_uri_as_string(www->final_uri)); +#endif + if(www->final_uri_handler) + www->final_uri_handler(www, www->final_uri_userdata, www->final_uri); + } + + return bytes; +} + + +/* Return non-0 on failure */ +int +raptor_www_curl_init(raptor_www *www) +{ + CURLcode res; + +#define curl_init_setopt_or_fail(h, k, v) do { \ + res = curl_easy_setopt(h, k, v); \ + if(res != CURLE_OK) \ + return 1; \ + } while(0) + + if(!www->curl_handle) { + www->curl_handle = curl_easy_init(); + www->curl_init_here = 1; + } + + +#ifndef CURLOPT_WRITEDATA +#define CURLOPT_WRITEDATA CURLOPT_FILE +#endif + + /* send all data to this function */ + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_WRITEFUNCTION, + raptor_www_curl_write_callback); + /* ... using this data pointer */ + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_WRITEDATA, www); + + + /* send all headers to this function */ + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_HEADERFUNCTION, + raptor_www_curl_header_callback); + /* ... using this data pointer */ + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_WRITEHEADER, www); + + /* Make it follow Location: headers */ + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_FOLLOWLOCATION, 1); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_VERBOSE, (void*)1); +#endif + + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_ERRORBUFFER, + www->error_buffer); + + /* Connection timeout in seconds */ + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_CONNECTTIMEOUT, + www->connection_timeout); + curl_init_setopt_or_fail(www->curl_handle, CURLOPT_NOSIGNAL, 1); + + return 0; +} + + +void +raptor_www_curl_free(raptor_www *www) +{ + /* only tidy up if we did all the work */ + if(www->curl_init_here && www->curl_handle) { + curl_easy_cleanup(www->curl_handle); + www->curl_handle = NULL; + } +} + + +int +raptor_www_curl_fetch(raptor_www *www) +{ + CURLcode res = CURLE_OK; + struct curl_slist *slist = NULL; + + if(www->proxy) { + res = curl_easy_setopt(www->curl_handle, CURLOPT_PROXY, www->proxy); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting proxy to %s failed", www->proxy); + return 1; + } + } + + if(www->user_agent) { + res = curl_easy_setopt(www->curl_handle, CURLOPT_USERAGENT, www->user_agent); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting user agent to %s failed", www->user_agent); + return 1; + } + } + + if(www->http_accept) + slist = curl_slist_append(slist, (const char*)www->http_accept); + + /* ALWAYS disable curl default "Pragma: no-cache" */ + slist = curl_slist_append(slist, "Pragma:"); + if(www->cache_control) + slist = curl_slist_append(slist, (const char*)www->cache_control); + + if(slist) { + res = curl_easy_setopt(www->curl_handle, CURLOPT_HTTPHEADER, slist); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting request http headers failed"); + return 1; + } + } + + /* specify URL to get */ + res = curl_easy_setopt(www->curl_handle, CURLOPT_URL, + raptor_uri_as_string(www->uri)); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting request URL failed"); + return 1; + } + + if(curl_easy_perform(www->curl_handle)) { + /* failed */ + www->failed = 1; + raptor_www_error(www, "Resolving URI failed: %s", www->error_buffer); + } else { + long lstatus; + +#ifndef CURLINFO_RESPONSE_CODE +#define CURLINFO_RESPONSE_CODE CURLINFO_HTTP_CODE +#endif + + /* Requires pointer to a long */ + if(curl_easy_getinfo(www->curl_handle, CURLINFO_RESPONSE_CODE, &lstatus) == CURLE_OK) + /* CURL status code will always fit in an int */ + www->status_code = RAPTOR_GOOD_CAST(int, lstatus); + + } + + if(slist) + curl_slist_free_all(slist); + + return www->failed; +} + + +int +raptor_www_curl_set_ssl_cert_options(raptor_www* www, + const char* cert_filename, + const char* cert_type, + const char* cert_passphrase) +{ + CURLcode res; + + /* client certificate file name */ + if(cert_filename) { + res = curl_easy_setopt(www->curl_handle, CURLOPT_SSLCERT, cert_filename); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting request SSL cert filename to %s failed", + cert_filename); + return 1; + } + } + + /* curl default is "PEM" */ + if(cert_type) { + res = curl_easy_setopt(www->curl_handle, CURLOPT_SSLCERTTYPE, cert_type); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting request SSL cert type to %s failed", + cert_type); + return 1; + } + } + + /* passphrase */ + /* Removed in 7.16.4 */ +#if LIBCURL_VERSION_NUM < 0x071004 +#define CURLOPT_KEYPASSWD CURLOPT_SSLKEYPASSWD +#endif + if(cert_passphrase) { + res = curl_easy_setopt(www->curl_handle, CURLOPT_KEYPASSWD, cert_passphrase); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting request SSL cert pass phrase failed"); + return 1; + } + } + + return 0; +} + + +int +raptor_www_curl_set_ssl_verify_options(raptor_www* www, int verify_peer, + int verify_host) +{ + CURLcode res; + + if(verify_peer) + verify_peer = 1; + res = curl_easy_setopt(www->curl_handle, CURLOPT_SSL_VERIFYPEER, verify_peer); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting request SSL verify peer flag %d failed", + verify_peer); + return 1; + } + + /* curl 7.28.1 removed the value 1 from being legal: + * http://daniel.haxx.se/blog/2012/10/25/libcurl-claimed-to-be-dangerous/ + * + * CURL GIT commit da82f59b697310229ccdf66104d5d65a44dfab98 + * Sat Oct 27 12:31:39 2012 +0200 + * + * Legal values are: + * 0 to disable host verifying + * 2 (default) to enable host verifyinging + */ + if(verify_host) + verify_host = 2; + res = curl_easy_setopt(www->curl_handle, CURLOPT_SSL_VERIFYHOST, verify_host); + if(res != CURLE_OK) { + www->failed = 1; + raptor_www_error(www, "Setting request SSL verify host flag %d failed", + verify_host); + return 1; + } + + return 0; +} + + +#endif /* RAPTOR_WWW_LIBCURL */ diff --git a/src/raptor_www_libfetch.c b/src/raptor_www_libfetch.c new file mode 100644 index 0000000..55f85a5 --- /dev/null +++ b/src/raptor_www_libfetch.c @@ -0,0 +1,97 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_www_libfetch.c - Raptor WWW retrieval via libfetch + * + * Copyright (C) 2003-2006, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#ifdef RAPTOR_WWW_LIBFETCH + +#include <stdio.h> +#include <string.h> +#include <stdarg.h> +#include <errno.h> + +#ifdef HAVE_SYS_PARAM_H +#include <sys/param.h> +#endif +#include <fetch.h> + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +void +raptor_www_libfetch_init(raptor_www *www) +{ +} + + +void +raptor_www_libfetch_free(raptor_www *www) +{ +} + + +int +raptor_www_libfetch_fetch(raptor_www *www) +{ + FILE *stream; + + if(www->proxy) { + setenv("HTTP_PROXY", www->proxy, 0); + setenv("FTP_PROXY", www->proxy, 0); + } + + if(www->user_agent) + setenv("HTTP_USER_AGENT", www->user_agent, 0); + + stream = fetchXGetURL((const char*)raptor_uri_as_string(www->uri), NULL, NULL); + if(!stream) { + www->failed = 1; + raptor_www_error(www, "%s", fetchLastErrString); + return 1; + } + + /* fetch does not give us access to this */ + www->status_code = 200; + + while(!feof(stream)) { + size_t len = fread(www->buffer, 1, RAPTOR_WWW_BUFFER_SIZE, stream); + + www->total_bytes += len; + + if(www->write_bytes) + www->write_bytes(www, www->write_bytes_userdata, www->buffer, len, 1); + + if(len < RAPTOR_WWW_BUFFER_SIZE) + break; + } + fclose(stream); + + return www->failed; +} + +#endif /* RAPTOR_WWW_LIBFETCH */ diff --git a/src/raptor_www_libxml.c b/src/raptor_www_libxml.c new file mode 100644 index 0000000..e2b9f3e --- /dev/null +++ b/src/raptor_www_libxml.c @@ -0,0 +1,159 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_www_libxml.c - Raptor WWW retrieval via libxml2 + * + * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <stdarg.h> + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#ifdef RAPTOR_WWW_LIBXML + +void +raptor_www_libxml_init(raptor_www *www) +{ + xmlNanoHTTPInit(); + www->ctxt = NULL; +} + + +void +raptor_www_libxml_free(raptor_www *www) +{ + xmlNanoHTTPCleanup(); +} + + +int +raptor_www_libxml_fetch(raptor_www *www) +{ + char* headers = NULL; + + if(www->proxy) + xmlNanoHTTPScanProxy(www->proxy); + + if(www->http_accept || www->user_agent) { + size_t accept_len = 0; + size_t ua_len = 0; + size_t cc_len = 0; + size_t len = 0; + char *p; + + if(www->http_accept) { + accept_len = strlen(www->http_accept); + len += accept_len+2; /* \r\n */ + } + + if(www->user_agent) { + ua_len = strlen(www->user_agent); + len += 12+ua_len+2; /* strlen("User-Agent: ") + \r\n */ + } + + if(www->cache_control) { + cc_len = strlen(www->cache_control); + len += cc_len+2; /* \r\n */ + } + + headers = RAPTOR_MALLOC(char*, len + 1); + if(!headers) + return 1; + + p = headers; + if(www->http_accept) { + memcpy(p, www->http_accept, accept_len); + p+= accept_len; + *p++='\r'; + *p++='\n'; + } + if(www->user_agent) { + memcpy(p, "User-Agent: ", 12); + p += 12; + memcpy(p, www->user_agent, ua_len); + p+= ua_len; + *p++='\r'; + *p++='\n'; + } + if(www->cache_control) { + memcpy(p, www->cache_control, cc_len); + p+= cc_len; + *p++='\r'; + *p++='\n'; + } + *p='\0'; + } + + www->ctxt = xmlNanoHTTPMethod((const char*)raptor_uri_as_string(www->uri), + NULL, /* HTTP method (default GET) */ + NULL, /* input string */ + &www->type, + headers, + 0); /* input length - ilen */ + + if(headers) + RAPTOR_FREE(char*, headers); + + if(!www->ctxt) + return 1; + + if(www->type) { + if(www->content_type) { + www->content_type(www, www->content_type_userdata, www->type); + if(www->failed) { + xmlNanoHTTPClose(www->ctxt); + return 1; + } + } + xmlFree(www->type); + www->type = NULL; + } + + www->status_code = xmlNanoHTTPReturnCode(www->ctxt); + + while(1) { + int len = xmlNanoHTTPRead(www->ctxt, www->buffer, RAPTOR_WWW_BUFFER_SIZE); + if(len < 0) + break; + + www->total_bytes += len; + + if(www->write_bytes) + www->write_bytes(www, www->write_bytes_userdata, www->buffer, len, 1); + + if(len < RAPTOR_WWW_BUFFER_SIZE || www->failed) + break; + } + + xmlNanoHTTPClose(www->ctxt); + + return www->failed; +} + +#endif /* #ifdef RAPTOR_WWW_LIBXML*/ diff --git a/src/raptor_www_test.c b/src/raptor_www_test.c new file mode 100644 index 0000000..060626f --- /dev/null +++ b/src/raptor_www_test.c @@ -0,0 +1,105 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_www_test.c - Raptor WWW retrieval test code + * + * Copyright (C) 2003-2006, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <stdarg.h> + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +static void +write_content_type(raptor_www* www, + void *userdata, const char *content_type) +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf((FILE*)userdata, "Content Type: %s\n", content_type); +#endif +} + + +int main (int argc, char *argv[]) +{ + const char *program = raptor_basename(argv[0]); + raptor_world *world; + const char *uri_string; + raptor_www *www; + const char *user_agent = "raptor_www_test/0.1"; + raptor_uri *uri; + void *string = NULL; + size_t string_length = 0; + + if(argc > 1) + uri_string = argv[1]; + else + uri_string = "http://librdf.org/"; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + uri = raptor_new_uri(world, (const unsigned char*)uri_string); + if(!uri) { + fprintf(stderr, "%s: Failed to create Raptor URI for %s\n", + program, uri_string); + exit(1); + } + + www = raptor_new_www(world); + + raptor_www_set_content_type_handler(www, write_content_type, (void*)stderr); + raptor_www_set_user_agent2(www, user_agent, 0); + + /* start retrieval (always a GET) */ + + if(raptor_www_fetch_to_string(www, uri, + &string, &string_length, malloc)) { + fprintf(stderr, "%s: WWW fetch failed\n", program); + } else { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: HTTP response status %d\n", + program, www->status_code); + + fprintf(stderr, "%s: Returned %d bytes of content\n", + program, (int)string_length); +#endif + } + if(string) + free(string); + + raptor_free_www(www); + + raptor_free_uri(uri); + + raptor_free_world(world); + + return 0; +} diff --git a/src/raptor_xml.c b/src/raptor_xml.c new file mode 100644 index 0000000..d89030c --- /dev/null +++ b/src/raptor_xml.c @@ -0,0 +1,1100 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_xml.c - Raptor XML routines + * + * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifndef STANDALONE + +/** + * raptor_new_xml_element: + * @name: The XML element name + * @xml_language: the in-scope XML language (or NULL) + * @xml_base: the in-scope XML base URI (or NULL) + * + * Constructor - create a new XML element from a QName + * + * The @xml_language and @xml_base become owned by the new object. + * + * Return value: a new #raptor_xml_element or NULL on failure + **/ +raptor_xml_element* +raptor_new_xml_element(raptor_qname *name, + const unsigned char *xml_language, + raptor_uri *xml_base) +{ + raptor_xml_element* xml_element; + + xml_element = RAPTOR_CALLOC(raptor_xml_element*, 1, sizeof(*xml_element)); + if(!xml_element) + return NULL; + + /* Element name */ + xml_element->name = name; + xml_element->xml_language = xml_language; + xml_element->base_uri = xml_base; + + xml_element->declared_nspaces = NULL; + + xml_element->content_cdata_sb = raptor_new_stringbuffer(); + if(!xml_element->content_cdata_sb) { + RAPTOR_FREE(raptor_xml_element, xml_element); + xml_element = NULL; + } + + return xml_element; +} + + +/** + * raptor_new_xml_element_from_namespace_local_name: + * @ns: namespace + * @name: the XML element local name + * @xml_language: the in-scope XML language (or NULL) + * @xml_base: base uri (or NULL) + * + * Constructor - create a new XML element from an XML namespace and a local name + * + * Added in 1.4.16. + * + * Return value: a new #raptor_xml_element or NULL on failure + */ +raptor_xml_element* +raptor_new_xml_element_from_namespace_local_name(raptor_namespace *ns, + const unsigned char *name, + const unsigned char *xml_language, + raptor_uri *xml_base) +{ + raptor_uri *base_uri_copy; + raptor_qname *qname; + raptor_xml_element *element = NULL; + + qname = raptor_new_qname_from_namespace_local_name(ns->nstack->world, ns, + name, NULL); + if(qname) { + base_uri_copy = xml_base ? raptor_uri_copy(xml_base) : NULL; + element = raptor_new_xml_element(qname, xml_language, base_uri_copy); + if(!element) { + raptor_free_qname(qname); + if(base_uri_copy) + raptor_free_uri(base_uri_copy); + } + } + return element; +} + + +/** + * raptor_free_xml_element: + * @element: XML Element + * + * Destructor - destroy a raptor_xml_element object. + **/ +void +raptor_free_xml_element(raptor_xml_element *element) +{ + unsigned int i; + + if(!element) + return; + + for(i = 0; i < element->attribute_count; i++) + if(element->attributes[i]) + raptor_free_qname(element->attributes[i]); + + if(element->attributes) + RAPTOR_FREE(raptor_qname_array, element->attributes); + + if(element->content_cdata_sb) + raptor_free_stringbuffer(element->content_cdata_sb); + + if(element->base_uri) + raptor_free_uri(element->base_uri); + + if(element->xml_language) + RAPTOR_FREE(char*, element->xml_language); + + raptor_free_qname(element->name); + + if(element->declared_nspaces) + raptor_free_sequence(element->declared_nspaces); + + RAPTOR_FREE(raptor_element, element); +} + + +/** + * raptor_xml_element_get_name: + * @xml_element: XML Element + * + * Get the XML Name of an XML element + * + * Return value: The Name. + **/ +raptor_qname* +raptor_xml_element_get_name(raptor_xml_element *xml_element) +{ + return xml_element->name; +} + + +/** + * raptor_xml_element_set_attributes: + * @xml_element: XML Element + * @attributes: Array of XML Qname attributes with values + * @count: Length of array + * + * Set the attributes on an XML element. + * + * The @attributes array becomes owned by the element after this function. + **/ +void +raptor_xml_element_set_attributes(raptor_xml_element* xml_element, + raptor_qname **attributes, int count) +{ + xml_element->attributes = attributes; + xml_element->attribute_count = count; +} + + +/** + * raptor_xml_element_get_attributes: + * @xml_element: XML Element + * + * Get the array of attributes on the XML element. + * + * Use raptor_xml_element_get_attributes_count() to get the count + * of the array size. + * + * Return value: the array of qnames or NULL if none are present. + **/ +raptor_qname** +raptor_xml_element_get_attributes(raptor_xml_element* xml_element) +{ + return xml_element->attributes; +} + + +/** + * raptor_xml_element_get_attributes_count: + * @xml_element: XML Element + * + * Get the number of attributes on the XML element. + * + * Return value: Integer number of attributes - 0 or more. + **/ +int +raptor_xml_element_get_attributes_count(raptor_xml_element* xml_element) +{ + return xml_element->attribute_count; +} + + +/** + * raptor_xml_element_declare_namespace: + * @xml_element: XML Element + * @nspace: raptor_namespace to declare + * + * Declare a namespace on the XML Element. + * + * Return value: non-0 if namespace cannot be declared + **/ +int +raptor_xml_element_declare_namespace(raptor_xml_element* xml_element, + raptor_namespace *nspace) +{ + int i; + const raptor_namespace *ns; + + if(!xml_element->declared_nspaces) + xml_element->declared_nspaces = raptor_new_sequence(NULL, NULL); + + if((ns = xml_element->name->nspace)) { + /* Cannot have same namespace already seen */ + if(ns == nspace || + /* ... or two default nspaces */ + (!ns->prefix && !nspace->prefix) || + /* ... or two same prefixes */ + (ns->prefix && nspace->prefix && + !strcmp((const char*)ns->prefix, (const char*)nspace->prefix)) + ) + return 1; + } + + + for(i = 0; + (ns = (const raptor_namespace*)raptor_sequence_get_at(xml_element->declared_nspaces, i)); + i++) { + /* Cannot have same namespace already seen */ + if(ns == nspace || + /* ... or two default nspaces */ + (!ns->prefix && !nspace->prefix) || + /* ... or two same prefixes */ + (ns->prefix && nspace->prefix && + !strcmp((const char*)ns->prefix, (const char*)nspace->prefix)) + ) + return 1; + } + + raptor_sequence_push(xml_element->declared_nspaces, nspace); + + return 0; +} + + +#ifdef RAPTOR_DEBUG +void +raptor_print_xml_element(raptor_xml_element *element, FILE* stream) +{ + raptor_qname_print(stream, element->name); + fputc('\n', stream); + + if(element->attribute_count) { + unsigned int i; + int printed = 0; + + fputs(" attributes: ", stream); + for(i = 0; i < element->attribute_count; i++) { + if(element->attributes[i]) { + if(printed) + fputc(' ', stream); + raptor_qname_print(stream, element->attributes[i]); + fprintf(stream, "='%s'", element->attributes[i]->value); + printed = 1; + } + } + fputc('\n', stream); + } +} +#endif + + +struct nsd +{ + const raptor_namespace *nspace; + unsigned char *declaration; + size_t length; +}; + + +static int +raptor_nsd_compare(const void *a, const void *b) +{ + struct nsd* nsd_a = (struct nsd*)a; + struct nsd* nsd_b = (struct nsd*)b; + + /* Sort NULLs earlier */ + if(!nsd_a->declaration) + return -1; + else if(!nsd_b->declaration) + return 1; + return strcmp((const char*)nsd_a->declaration, (const char*)nsd_b->declaration); +} + + +/** + * raptor_xml_element_write: + * @element: XML element to format + * @nstack: Namespace stack context to use in formatting + * @is_empty: non-0 if element is empty + * @is_end: non-0 if this is an end element (else is a start element) + * @depth: XML element depth + * @iostr: iostream object + * + * Write a formatted XML element to a #raptor_iostream + * + * Return value: non-0 on failure +*/ +int +raptor_xml_element_write(raptor_xml_element *element, + raptor_namespace_stack *nstack, + int is_empty, + int is_end, + int depth, + raptor_iostream* iostr) +{ + struct nsd *nspace_declarations = NULL; + size_t nspace_declarations_count = 0; + unsigned int i; + + /* max is 1 per element and 1 for each attribute + size of declared */ + if(nstack) { + int nspace_max_count = element->attribute_count+1; + if(element->declared_nspaces) + nspace_max_count += raptor_sequence_size(element->declared_nspaces); + + nspace_declarations = RAPTOR_CALLOC(struct nsd*, nspace_max_count, + sizeof(struct nsd)); + } + + if(element->name->nspace) { + if(!is_end && nstack && + !raptor_namespaces_namespace_in_scope(nstack, element->name->nspace)) { + nspace_declarations[0].declaration= + raptor_namespace_format_as_xml(element->name->nspace, + &nspace_declarations[0].length); + nspace_declarations[0].nspace = element->name->nspace; + nspace_declarations_count++; + } + } + + if(!is_end && element->attributes) { + for(i = 0; i < element->attribute_count; i++) { + /* qname */ + if(element->attributes[i]->nspace) { + if(nstack && + !raptor_namespaces_namespace_in_scope(nstack, element->attributes[i]->nspace) && element->attributes[i]->nspace != element->name->nspace) { + /* not in scope and not same as element (so already going to be declared)*/ + unsigned int j; + int declare_me = 1; + + /* check it wasn't an earlier declaration too */ + for(j = 0; j < nspace_declarations_count; j++) + if(nspace_declarations[j].nspace == element->attributes[j]->nspace) { + declare_me = 0; + break; + } + + if(declare_me) { + nspace_declarations[nspace_declarations_count].declaration= + raptor_namespace_format_as_xml(element->attributes[i]->nspace, + &nspace_declarations[nspace_declarations_count].length); + nspace_declarations[nspace_declarations_count].nspace = element->attributes[i]->nspace; + nspace_declarations_count++; + } + } + + } + } + } + + + if(!is_end && nstack && element->declared_nspaces && + raptor_sequence_size(element->declared_nspaces) > 0) { + for(i = 0; i< (unsigned int)raptor_sequence_size(element->declared_nspaces); i++) { + raptor_namespace* nspace = (raptor_namespace*)raptor_sequence_get_at(element->declared_nspaces, i); + unsigned int j; + int declare_me = 1; + + /* check it wasn't an earlier declaration too */ + for(j = 0; j < nspace_declarations_count; j++) + if(nspace_declarations[j].nspace == nspace) { + declare_me = 0; + break; + } + + if(declare_me) { + nspace_declarations[nspace_declarations_count].declaration= + raptor_namespace_format_as_xml(nspace, + &nspace_declarations[nspace_declarations_count].length); + nspace_declarations[nspace_declarations_count].nspace = nspace; + nspace_declarations_count++; + } + + } + } + + + + raptor_iostream_write_byte('<', iostr); + if(is_end) + raptor_iostream_write_byte('/', iostr); + + if(element->name->nspace && element->name->nspace->prefix_length > 0) { + raptor_iostream_counted_string_write((const char*)element->name->nspace->prefix, + element->name->nspace->prefix_length, + iostr); + raptor_iostream_write_byte(':', iostr); + } + raptor_iostream_counted_string_write((const char*)element->name->local_name, + element->name->local_name_length, + iostr); + + /* declare namespaces */ + if(nspace_declarations_count) { + /* sort them into the canonical order */ + qsort((void*)nspace_declarations, + nspace_declarations_count, sizeof(struct nsd), + raptor_nsd_compare); + /* add them */ + for(i = 0; i < nspace_declarations_count; i++) { + raptor_iostream_write_byte(' ', iostr); + raptor_iostream_counted_string_write((const char*)nspace_declarations[i].declaration, + nspace_declarations[i].length, + iostr); + RAPTOR_FREE(char*, nspace_declarations[i].declaration); + nspace_declarations[i].declaration = NULL; + + raptor_namespace_stack_start_namespace(nstack, + (raptor_namespace*)nspace_declarations[i].nspace, + depth); + } + } + + + if(!is_end && element->attributes) { + for(i = 0; i < element->attribute_count; i++) { + raptor_iostream_write_byte(' ', iostr); + + if(element->attributes[i]->nspace && + element->attributes[i]->nspace->prefix_length > 0) { + raptor_iostream_counted_string_write((char*)element->attributes[i]->nspace->prefix, + element->attributes[i]->nspace->prefix_length, + iostr); + raptor_iostream_write_byte(':', iostr); + } + + raptor_iostream_counted_string_write((const char*)element->attributes[i]->local_name, + element->attributes[i]->local_name_length, + iostr); + + raptor_iostream_counted_string_write("=\"", 2, iostr); + + raptor_xml_escape_string_write(element->attributes[i]->value, + element->attributes[i]->value_length, + '"', + iostr); + raptor_iostream_write_byte('"', iostr); + } + } + + if(is_empty) + raptor_iostream_write_byte('/', iostr); + + raptor_iostream_write_byte('>', iostr); + + if(nstack) + RAPTOR_FREE(stringarray, nspace_declarations); + + return 0; +} + + +/** + * raptor_xml_element_get_language: + * @xml_element: XML Element + * + * Get the XML language of the element. + * + * Return value: XML language or NULL if none in scope + **/ +const unsigned char* +raptor_xml_element_get_language(raptor_xml_element* xml_element) +{ + return xml_element->xml_language; +} + + +/** + * raptor_valid_xml_ID: + * @rdf_parser: RDF parser + * @string: The string to check. + * + * Check the string matches the xml:ID value constraints. + * + * This checks the syntax part of the xml:ID validity constraint, + * that it matches [ VC: Name Token ] as amended by XML Namespaces: + * + * See <ulink url="http://www.w3.org/TR/REC-xml-names/#NT-NCName">Namespaces in XML NCName<ulink> + * + * Return value: non-zero if the ID string is valid + **/ +int +raptor_valid_xml_ID(raptor_parser *rdf_parser, const unsigned char *string) +{ + size_t len = strlen((const char*)string); +#ifdef RAPTOR_XML_1_1 + #define XML_ID_XML_VERSION 11 +#else + #define XML_ID_XML_VERSION 10 +#endif + + return raptor_xml_name_check(string, len, XML_ID_XML_VERSION); +} + + +/** + * raptor_xml_escape_string_any: + * @world: raptor world + * @string: string to XML escape (UTF-8) + * @len: length of string + * @buffer: the buffer to use for new string (UTF-8) or NULL to just calculate expected length + * @length: buffer size + * @quote: optional quote character to escape for attribute content, or 0 + * @xml_version: XML 1.0 (10) or XML 1.1 (11) + * + * Return an XML-escaped version a string. + * + * Follows + * <ulink url="http://www.w3.org/TR/xml-c14n#ProcessingModel">Canonical XML rules on Text Nodes and Attribute Nodes</ulink> + * + * Both: + * Replaces <literal>&</literal> and <literal><</literal> + * with <literal>&amp;</literal> and <literal>&lt;</literal> + * respectively, preserving other characters. + * + * Text Nodes: + * <literal>></literal> is turned into <literal>&gt;</literal> + * ##xD is turned into <literal>&##xD;</literal> + * + * Attribute Nodes: + * <literal>></literal> is generated not <literal>&gt</literal>. + * ##x9, ##xA and ##xD are turned into + * <literal>&##x9;</literal>, + * <literal>&##xA;</literal> and + * <literal>&##xD;</literal> + * entities. + * + * If @quote is given it can be either of '\'' or '\"' + * which will be turned into <literal>&apos;</literal> or + * <literal>&quot;</literal> respectively. + * ASCII NUL ('\0') or any other character will not be escaped. + * + * If @buffer is NULL, no work is done but the size of buffer + * required is returned. The output in buffer remains in UTF-8. + * + * If the input @string is empty, a single NUL will be written to the + * buffer. + * + * Return value: the number of bytes required / used or <0 on failure. + **/ +int +raptor_xml_escape_string_any(raptor_world *world, + const unsigned char *string, size_t len, + unsigned char *buffer, size_t length, + char quote, + int xml_version) +{ + size_t l; + size_t new_len = 0; + const unsigned char *p; + unsigned char *q; + int unichar_len; + raptor_unichar unichar; + + if(!string) + return -1; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1); + + raptor_world_open(world); + + if(quote != '\"' && quote != '\'') + quote='\0'; + + for(l = len, p = string; l; p++, l--) { + if(*p > 0x7f) { + unichar_len = raptor_unicode_utf8_string_get_char(p, l, &unichar); + if(unichar_len < 0 || RAPTOR_GOOD_CAST(size_t, unichar_len) > l) { + raptor_log_error(world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Bad UTF-8 encoding."); + return -1; + } + } else { + unichar=*p; + unichar_len = 1; + } + + if(unichar == '&') + /* & */ + new_len+= 5; + else if(unichar == '<' || (!quote && unichar == '>')) + /* < or > */ + new_len+= 4; + else if(quote && unichar == (unsigned long)quote) + /* ' or " */ + new_len+= 6; + else if(unichar == 0x0d || + (quote && (unichar == 0x09 || unichar == 0x0a))) + /* or or &xA; */ + new_len+= 5; + else if(unichar == 0x7f || + (unichar < 0x20 && unichar != 0x09 && unichar != 0x0a)) { + if(!unichar || xml_version < 11) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot write illegal XML 1.0 character U+%6lX.", + unichar); + } else { + /* &#xX; */ + new_len+= 5; + if(unichar > 0x0f) + new_len++; + } + } else + new_len+= unichar_len; + + unichar_len--; /* since loop does len-- */ + p += unichar_len; l -= unichar_len; + } + + if(length && new_len > length) + return 0; + + if(!buffer) + return RAPTOR_BAD_CAST(int, new_len); + + for(l = len, p = string, q = buffer; l; p++, l--) { + if(*p > 0x7f) { + unichar_len = raptor_unicode_utf8_string_get_char(p, l, &unichar); + /* if the UTF-8 encoding is bad, we already did return -1 above */ + } else { + unichar=*p; + unichar_len = 1; + } + + if(unichar == '&') { + memcpy(q, "&", 5); + q+= 5; + } else if(unichar == '<') { + memcpy(q, "<", 4); + q+= 4; + } else if(!quote && unichar == '>') { + memcpy(q, ">", 4); + q+= 4; + } else if(quote && unichar == RAPTOR_GOOD_CAST(unsigned long, quote)) { + if(quote == '\'') + memcpy(q, "'", 6); + else + memcpy(q, """, 6); + q+= 6; + } else if(unichar == 0x0d || + (quote && (unichar == 0x09 || unichar == 0x0a))) { + /* &#xX; */ + *q++='&'; + *q++='#'; + *q++='x'; + if(unichar == 0x09) + *q++ = '9'; + else + *q++ = RAPTOR_GOOD_CAST(unsigned char, 'A' + (RAPTOR_GOOD_CAST(char, unichar) - 0x0a)); + *q++= ';'; + } else if(unichar == 0x7f || + (unichar < 0x20 && unichar != 0x09 && unichar != 0x0a)) { + if(!unichar || xml_version < 11) { + raptor_log_error_formatted(world, RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot write illegal XML 1.0 character U+%6lX.", + unichar); + } else { + /* &#xX; */ + *q++ = '&'; + *q++ = '#'; + *q++ = 'x'; + q += raptor_format_integer((char*)q, 3, + RAPTOR_GOOD_CAST(unsigned int, unichar), + /* base */ 16, -1, '\0'); + *q++ = ';'; + } + } else { + /* coverity[negative_returns] + * negative unichar_len values are checked and cause return -1 above */ + memcpy(q, p, unichar_len); + q+= unichar_len; + } + + unichar_len--; /* since loop does len-- */ + p += unichar_len; l -= unichar_len; + } + + /* Terminate new string */ + *q = '\0'; + + return RAPTOR_BAD_CAST(int, new_len); +} + + +/** + * raptor_xml_escape_string: + * @world: raptor world + * @string: string to XML 1.0 escape (UTF-8) + * @len: length of string + * @buffer: the buffer to use for new string (UTF-8) or NULL to just calculate expected length. + * @length: buffer size + * @quote: optional quote character to escape for attribute content, or 0 + * + * Return an XML 1.0-escaped version a string. + * + * See raptor_xml_escape_string_any() for the conditions on parameters. + * + * Return value: the number of bytes required / used or <0 on failure. + **/ +int +raptor_xml_escape_string(raptor_world *world, + const unsigned char *string, size_t len, + unsigned char *buffer, size_t length, + char quote) +{ + if(!string) + return -1; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1); + + raptor_world_open(world); + + return raptor_xml_escape_string_any(world, string, len, + buffer, length, + quote, + 10); +} + + +/** + * raptor_xml_escape_string_any_write: + * @string: string to XML escape (UTF-8) + * @len: length of string + * @quote: optional quote character to escape for attribute content, or 0 + * @xml_version: XML version - 10 (XML 1.0) or 11 (XML 1.1) + * @iostr: the #raptor_iostream to write to + * + * Write an XML-escaped version of a string to an iostream. + * + * See raptor_xml_escape_string() for the escapes performed and + * the conditions on @quote and @string. XML 1.1 allows additional + * characters in XML such as U+0001 to U+001F inclusive. + * + * Return value: non 0 on failure + **/ +int +raptor_xml_escape_string_any_write(const unsigned char *string, + size_t len, + char quote, + int xml_version, + raptor_iostream* iostr) +{ + size_t l; + const unsigned char *p; + + if(xml_version != 10) + xml_version = 11; + + if(quote != '\"' && quote != '\'') + quote='\0'; + + for(l = len, p = string; l; p++, l--) { + int unichar_len = 1; + raptor_unichar unichar=*p; + + if(*p > 0x7f) { + unichar_len = raptor_unicode_utf8_string_get_char(p, l, &unichar); + if(unichar_len < 0 || RAPTOR_GOOD_CAST(size_t, unichar_len) > l) { + raptor_log_error(raptor_iostream_get_world(iostr), + RAPTOR_LOG_LEVEL_ERROR, NULL, + "Bad UTF-8 encoding."); + return 1; + } + } + + if(unichar == '&') + raptor_iostream_counted_string_write("&", 5, iostr); + else if(unichar == '<') + raptor_iostream_counted_string_write("<", 4, iostr); + else if(!quote && unichar == '>') + raptor_iostream_counted_string_write(">", 4, iostr); + else if(quote && unichar == (unsigned long)quote) { + if(quote == '\'') + raptor_iostream_counted_string_write("'", 6, iostr); + else + raptor_iostream_counted_string_write(""", 6, iostr); + } else if(unichar == 0x0d || + (quote && (unichar == 0x09 || unichar == 0x0a))) { + /* &#xX; */ + raptor_iostream_counted_string_write("&#x", 3, iostr); + if(unichar == 0x09) + raptor_iostream_write_byte('9', iostr); + else + raptor_iostream_write_byte('A'+ ((char)unichar-0x0a), iostr); + raptor_iostream_write_byte(';', iostr); + } else if(unichar == 0x7f || + (unichar < 0x20 && unichar != 0x09 && unichar != 0x0a)) { + if(!unichar || xml_version < 11) { + raptor_log_error_formatted(raptor_iostream_get_world(iostr), + RAPTOR_LOG_LEVEL_ERROR, NULL, + "Cannot write illegal XML 1.0 character U+%6lX.", + unichar); + } else { + int width = (unichar < 0x10) ? 1 : 2; + + /* &#xX; */ + raptor_iostream_counted_string_write("&#x", 3, iostr); + raptor_iostream_hexadecimal_write(RAPTOR_GOOD_CAST(unsigned int, unichar), width, iostr); + raptor_iostream_write_byte(';', iostr); + } + } else + raptor_iostream_counted_string_write((const char*)p, unichar_len, iostr); + + unichar_len--; /* since loop does len-- */ + p += unichar_len; l -= unichar_len; + } + + return 0; +} + + +/** + * raptor_xml_escape_string_write: + * @string: string to XML 1.0 escape (UTF-8) + * @len: length of string + * @quote: optional quote character to escape for attribute content, or 0 + * @iostr: the #raptor_iostream to write to + * + * Write an XML 1.0-escaped version of a string to an iostream. + * + * See raptor_xml_escape_string_any_write() for the escapes + * performed and the conditions on @quote and @string. + * + * Return value: non 0 on failure + **/ +int +raptor_xml_escape_string_write(const unsigned char *string, + size_t len, + char quote, + raptor_iostream* iostr) +{ + return raptor_xml_escape_string_any_write(string, len, quote, 10, + iostr); +} + + +/** + * raptor_xml_name_check: + * @string: UTF-8 name string + * @length: length of string + * @xml_version: XML version + * + * Check a string is a legal XML name (and legal UTF8). + * + * xml_version is either 10 (for XML 1.0) or 11 for (XML 1.1). Any + * other version fails. + * + * Return value: Non 0 if the string is a legal XML name + **/ +int +raptor_xml_name_check(const unsigned char *string, size_t length, + int xml_version) +{ + int pos; + + if(xml_version != 10 && xml_version != 11) + return 0; + + for(pos = 0; length > 0; pos++) { + raptor_unichar unichar = 0; + + int unichar_len; + unichar_len = raptor_unicode_utf8_string_get_char(string, length, &unichar); + if(unichar_len < 0 || RAPTOR_GOOD_CAST(size_t, unichar_len) > length) + return 0; + + if(unichar > raptor_unicode_max_codepoint) + return 0; + + if(!pos) { + /* start of name */ + if(xml_version == 10) { + if(!raptor_unicode_is_xml10_namestartchar(unichar)) + return 0; + } else { + if(!raptor_unicode_is_xml11_namestartchar(unichar)) + return 0; + } + } else { + /* rest of name */ + if(xml_version == 10) { + if(!raptor_unicode_is_xml10_namechar(unichar)) + return 0; + } else { + if(!raptor_unicode_is_xml11_namechar(unichar)) + return 0; + } + } + + string += unichar_len; + length -= unichar_len; + } + return 1; +} + + +#endif + + + + +#ifdef STANDALONE + +/* static prototypes */ +void raptor_bad_string_print(const unsigned char *input, FILE *stream); +int main(int argc, char *argv[]); + +void +raptor_bad_string_print(const unsigned char *input, FILE *stream) +{ + while(*input) { + char c=(char)*input; + if(isprint(c)) + fputc(c, stream); + else + fprintf(stream, "\\x%02X", (c & 0xff)); + input++; + } +} + + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *program = raptor_basename(argv[0]); + struct tv { + const char *string; + const char quote; + const char *result; + }; + struct tv *t; + struct tv test_values[]={ + {"", 0, ""}, + + {"&", 0, "&"}, + {"<", 0, "<"}, + {">", 0, ">"}, + {"\x09", 0, "\x09"}, + {"\x0a", 0, "\x0a"}, + {"\x0d", 0, " "}, + + {"'&'", '\'', "'&'"}, + {"'<'", '\'', "'<'"}, + {"'>'", '\'', "'>'"}, + {"\x09", '\'', " "}, + {"\x0a", '\'', " "}, + {"\x0d", '\'', " "}, + + {"\"&\"", '\"', ""&""}, + {"\"<\"", '\"', ""<""}, + {"\">\"", '\"', "">""}, + {"\x09", '\"', " "}, + {"\x0a", '\"', " "}, + {"\x0d", '\"', " "}, + + {"&", 0, "&amp;"}, + {"<foo>", 0, "<foo>"}, +#if 0 + {"\x1f", 0, ""}, + {"\xc2\x80", 0, "€"}, + {"\xe0\xa0\x80", 0, "ࠀ"}, + {"\xf0\x90\x80\x80", 0, "𐀀"}, + + {"\x7f", 0, ""}, + {"\xdf\xbf", 0, "߿"}, + {"\xef\xbf\xbd", 0, "�"}, + {"\xf4\x8f\xbf\xbf", 0, "􏿿"}, + + {"\xc3\xbf", 0, "ÿ"}, + {"\xf0\x8f\xbf\xbf", 0, "￿"}, +#endif + {NULL, 0, 0} + }; + int i; + int failures = 0; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + for(i = 0; (t=&test_values[i]) && t->string; i++) { + const unsigned char *utf8_string = (const unsigned char*)t->string; + char quote = t->quote; + size_t utf8_string_len = strlen((const char*)utf8_string); + unsigned char *xml_string; + int xml_string_len = 0; + + xml_string_len = raptor_xml_escape_string(world, + utf8_string, utf8_string_len, + NULL, 0, quote); + if(xml_string_len < 0) { + fprintf(stderr, "%s: raptor_xml_escape_string FAILED to escape string '", + program); + raptor_bad_string_print(utf8_string, stderr); + fputs("'\n", stderr); + failures++; + continue; + } + + xml_string = RAPTOR_MALLOC(unsigned char*, xml_string_len + 1); + + xml_string_len = raptor_xml_escape_string(world, + utf8_string, utf8_string_len, + xml_string, xml_string_len, quote); + if(xml_string_len < 0) { + fprintf(stderr, "%s: raptor_xml_escape_string FAILED to escape string '", + program); + raptor_bad_string_print(utf8_string, stderr); + fputs("'\n", stderr); + failures++; + continue; + } + if(strcmp((const char*)xml_string, t->result)) { + fprintf(stderr, "%s: raptor_xml_escape_string FAILED to escape string '", + program); + raptor_bad_string_print(utf8_string, stderr); + fprintf(stderr, "', expected '%s', result was '%s'\n", + t->result, xml_string); + failures++; + continue; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: raptor_xml_escape_string escaped string to '%s' ok\n", + program, xml_string); +#endif + RAPTOR_FREE(char*, xml_string); + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + if(!failures) + fprintf(stderr, "%s: raptor_xml_escape_string all tests OK\n", program); +#endif + + raptor_free_world(world); + + return failures; +} + +#endif diff --git a/src/raptor_xml_writer.c b/src/raptor_xml_writer.c new file mode 100644 index 0000000..4426d38 --- /dev/null +++ b/src/raptor_xml_writer.c @@ -0,0 +1,1046 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * raptor_xml_writer.c - Raptor XML Writer for SAX2 events API + * + * Copyright (C) 2003-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#ifndef STANDALONE + + +#define XML_WRITER_AUTO_INDENT(xml_writer) RAPTOR_OPTIONS_GET_NUMERIC(xml_writer, RAPTOR_OPTION_WRITER_AUTO_INDENT) +#define XML_WRITER_AUTO_EMPTY(xml_writer) RAPTOR_OPTIONS_GET_NUMERIC(xml_writer, RAPTOR_OPTION_WRITER_AUTO_EMPTY) +#define XML_WRITER_INDENT(xml_writer) RAPTOR_OPTIONS_GET_NUMERIC(xml_writer, RAPTOR_OPTION_WRITER_INDENT_WIDTH) +#define XML_WRITER_XML_VERSION(xml_writer) RAPTOR_OPTIONS_GET_NUMERIC(xml_writer, RAPTOR_OPTION_WRITER_XML_VERSION) + + +#define XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer) \ + if((XML_WRITER_AUTO_EMPTY(xml_writer)) && \ + xml_writer->current_element && \ + !(xml_writer->current_element->content_cdata_seen || \ + xml_writer->current_element->content_element_seen)) { \ + raptor_iostream_write_byte('>', xml_writer->iostr); \ +} + + +/* Define this for far too much output */ +#undef RAPTOR_DEBUG_CDATA + + +struct raptor_xml_writer_s { + raptor_world *world; + + int canonicalize; + + int depth; + + int my_nstack; + raptor_namespace_stack *nstack; + int nstack_depth; + + raptor_xml_element* current_element; + + /* outputting to this iostream */ + raptor_iostream *iostr; + + /* Has writing the XML declaration writing been checked? */ + int xml_declaration_checked; + + /* An extra newline is wanted */ + int pending_newline; + + /* Options (per-object) */ + raptor_object_options options; +}; + + +/* 16 spaces */ +#define SPACES_BUFFER_SIZE sizeof(spaces_buffer) +static const unsigned char spaces_buffer[] = { + ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ', + ' ', ' ', ' ', ' ' +}; + + + +/* helper functions */ + +/* Handle printing a pending newline OR newline with indenting */ +static int +raptor_xml_writer_indent(raptor_xml_writer *xml_writer) +{ + int num_spaces; + + if(!XML_WRITER_AUTO_INDENT(xml_writer)) { + if(xml_writer->pending_newline) { + raptor_iostream_write_byte('\n', xml_writer->iostr); + xml_writer->pending_newline = 0; + + if(xml_writer->current_element) + xml_writer->current_element->content_cdata_seen = 1; + } + return 0; + } + + num_spaces = xml_writer->depth * XML_WRITER_INDENT(xml_writer); + + /* Do not write an extra newline at the start of the document + * (after the XML declaration or XMP processing instruction has + * been writtten) + */ + if(xml_writer->xml_declaration_checked == 1) + xml_writer->xml_declaration_checked++; + else { + raptor_iostream_write_byte('\n', xml_writer->iostr); + xml_writer->pending_newline = 0; + } + + while(num_spaces > 0) { + + int count = (num_spaces > RAPTOR_GOOD_CAST(int, SPACES_BUFFER_SIZE)) ? + RAPTOR_GOOD_CAST(int, SPACES_BUFFER_SIZE) : num_spaces; + + raptor_iostream_counted_string_write(spaces_buffer, count, + xml_writer->iostr); + + num_spaces -= count; + } + + if(xml_writer->current_element) + xml_writer->current_element->content_cdata_seen = 1; + + return 0; +} + + +struct nsd { + const raptor_namespace *nspace; + unsigned char *declaration; + size_t length; +}; + + +static int +raptor_xml_writer_nsd_compare(const void *a, const void *b) +{ + struct nsd* nsd_a = (struct nsd*)a; + struct nsd* nsd_b = (struct nsd*)b; + + /* Sort NULLs earlier */ + if(!nsd_a->declaration) + return -1; + else if(!nsd_b->declaration) + return 1; + return strcmp((const char*)nsd_a->declaration, (const char*)nsd_b->declaration); +} + + +static int +raptor_xml_writer_start_element_common(raptor_xml_writer* xml_writer, + raptor_xml_element* element, + int auto_empty) +{ + raptor_iostream* iostr = xml_writer->iostr; + raptor_namespace_stack *nstack = xml_writer->nstack; + int depth = xml_writer->depth; + int auto_indent = XML_WRITER_AUTO_INDENT(xml_writer); + struct nsd *nspace_declarations = NULL; + size_t nspace_declarations_count = 0; + unsigned int i; + + if(nstack) { + int nspace_max_count = element->attribute_count * 2; /* attr and value */ + if(element->name->nspace) + nspace_max_count++; + if(element->declared_nspaces) + nspace_max_count += raptor_sequence_size(element->declared_nspaces); + if(element->xml_language) + nspace_max_count++; + + nspace_declarations = RAPTOR_CALLOC(struct nsd*, nspace_max_count, + sizeof(struct nsd)); + if(!nspace_declarations) + return 1; + } + + if(element->name->nspace) { + if(nstack && !raptor_namespaces_namespace_in_scope(nstack, element->name->nspace)) { + nspace_declarations[0].declaration= + raptor_namespace_format_as_xml(element->name->nspace, + &nspace_declarations[0].length); + if(!nspace_declarations[0].declaration) + goto error; + nspace_declarations[0].nspace = element->name->nspace; + nspace_declarations_count++; + } + } + + if(nstack && element->attributes) { + for(i = 0; i < element->attribute_count; i++) { + /* qname */ + if(element->attributes[i]->nspace) { + /* Check if we need a namespace declaration attribute */ + if(nstack && + !raptor_namespaces_namespace_in_scope(nstack, element->attributes[i]->nspace) && element->attributes[i]->nspace != element->name->nspace) { + /* not in scope and not same as element (so already going to be declared)*/ + unsigned int j; + int declare_me = 1; + + /* check it wasn't an earlier declaration too */ + for(j = 0; j < nspace_declarations_count; j++) + if(nspace_declarations[j].nspace == element->attributes[i]->nspace) { + declare_me = 0; + break; + } + + if(declare_me) { + nspace_declarations[nspace_declarations_count].declaration= + raptor_namespace_format_as_xml(element->attributes[i]->nspace, + &nspace_declarations[nspace_declarations_count].length); + if(!nspace_declarations[nspace_declarations_count].declaration) + goto error; + nspace_declarations[nspace_declarations_count].nspace = element->attributes[i]->nspace; + nspace_declarations_count++; + } + } + } + + /* Add the attribute's value */ + nspace_declarations[nspace_declarations_count].declaration= + raptor_qname_format_as_xml(element->attributes[i], + &nspace_declarations[nspace_declarations_count].length); + if(!nspace_declarations[nspace_declarations_count].declaration) + goto error; + nspace_declarations[nspace_declarations_count].nspace = NULL; + nspace_declarations_count++; + + } + } + + if(nstack && element->declared_nspaces && + raptor_sequence_size(element->declared_nspaces) > 0) { + for(i = 0; i< (unsigned int)raptor_sequence_size(element->declared_nspaces); i++) { + raptor_namespace* nspace = (raptor_namespace*)raptor_sequence_get_at(element->declared_nspaces, i); + unsigned int j; + int declare_me = 1; + + /* check it wasn't an earlier declaration too */ + for(j = 0; j < nspace_declarations_count; j++) + if(nspace_declarations[j].nspace == nspace) { + declare_me = 0; + break; + } + + if(declare_me) { + nspace_declarations[nspace_declarations_count].declaration= + raptor_namespace_format_as_xml(nspace, + &nspace_declarations[nspace_declarations_count].length); + if(!nspace_declarations[nspace_declarations_count].declaration) + goto error; + nspace_declarations[nspace_declarations_count].nspace = nspace; + nspace_declarations_count++; + } + + } + } + + if(nstack && element->xml_language) { + size_t lang_len = strlen(RAPTOR_GOOD_CAST(char*, element->xml_language)); +#define XML_LANG_PREFIX "xml:lang=\"" +#define XML_LANG_PREFIX_LEN 10 + size_t buf_length = XML_LANG_PREFIX_LEN + lang_len + 1; + unsigned char* buffer = RAPTOR_MALLOC(unsigned char*, buf_length + 1); + const char quote = '\"'; + unsigned char* p; + + memcpy(buffer, XML_LANG_PREFIX, XML_LANG_PREFIX_LEN); + p = buffer + XML_LANG_PREFIX_LEN; + p += raptor_xml_escape_string(xml_writer->world, + element->xml_language, lang_len, + p, buf_length, quote); + *p++ = quote; + *p = '\0'; + + nspace_declarations[nspace_declarations_count].declaration = buffer; + nspace_declarations[nspace_declarations_count].length = buf_length; + nspace_declarations[nspace_declarations_count].nspace = NULL; + nspace_declarations_count++; + } + + + raptor_iostream_write_byte('<', iostr); + + if(element->name->nspace && element->name->nspace->prefix_length > 0) { + raptor_iostream_counted_string_write((const char*)element->name->nspace->prefix, + element->name->nspace->prefix_length, + iostr); + raptor_iostream_write_byte(':', iostr); + } + raptor_iostream_counted_string_write((const char*)element->name->local_name, + element->name->local_name_length, + iostr); + + /* declare namespaces and attributes */ + if(nspace_declarations_count) { + int need_indent = 0; + + /* sort them into the canonical order */ + qsort((void*)nspace_declarations, + nspace_declarations_count, sizeof(struct nsd), + raptor_xml_writer_nsd_compare); + + /* declare namespaces first */ + for(i = 0; i < nspace_declarations_count; i++) { + if(!nspace_declarations[i].nspace) + continue; + + if(auto_indent && need_indent) { + /* indent attributes */ + raptor_xml_writer_newline(xml_writer); + xml_writer->depth++; + raptor_xml_writer_indent(xml_writer); + xml_writer->depth--; + } + raptor_iostream_write_byte(' ', iostr); + raptor_iostream_counted_string_write((const char*)nspace_declarations[i].declaration, + nspace_declarations[i].length, + iostr); + RAPTOR_FREE(char*, nspace_declarations[i].declaration); + nspace_declarations[i].declaration = NULL; + need_indent = 1; + + if(raptor_namespace_stack_start_namespace(nstack, + (raptor_namespace*)nspace_declarations[i].nspace, + depth)) + goto error; + } + + /* declare attributes */ + for(i = 0; i < nspace_declarations_count; i++) { + if(nspace_declarations[i].nspace) + continue; + + if(auto_indent && need_indent) { + /* indent attributes */ + raptor_xml_writer_newline(xml_writer); + xml_writer->depth++; + raptor_xml_writer_indent(xml_writer); + xml_writer->depth--; + } + raptor_iostream_write_byte(' ', iostr); + raptor_iostream_counted_string_write((const char*)nspace_declarations[i].declaration, + nspace_declarations[i].length, + iostr); + need_indent = 1; + + RAPTOR_FREE(char*, nspace_declarations[i].declaration); + nspace_declarations[i].declaration = NULL; + } + } + + if(!auto_empty) + raptor_iostream_write_byte('>', iostr); + + if(nstack) + RAPTOR_FREE(stringarray, nspace_declarations); + + return 0; + + /* Clean up nspace_declarations on error */ + error: + + for(i = 0; i < nspace_declarations_count; i++) { + if(nspace_declarations[i].declaration) + RAPTOR_FREE(char*, nspace_declarations[i].declaration); + } + + RAPTOR_FREE(stringarray, nspace_declarations); + + return 1; +} + + +static int +raptor_xml_writer_end_element_common(raptor_xml_writer* xml_writer, + raptor_xml_element *element, + int is_empty) +{ + raptor_iostream* iostr = xml_writer->iostr; + + if(is_empty) + raptor_iostream_write_byte('/', iostr); + else { + + raptor_iostream_write_byte('<', iostr); + + raptor_iostream_write_byte('/', iostr); + + if(element->name->nspace && element->name->nspace->prefix_length > 0) { + raptor_iostream_counted_string_write((const char*)element->name->nspace->prefix, + element->name->nspace->prefix_length, + iostr); + raptor_iostream_write_byte(':', iostr); + } + raptor_iostream_counted_string_write((const char*)element->name->local_name, + element->name->local_name_length, + iostr); + } + + raptor_iostream_write_byte('>', iostr); + + return 0; + +} + + +/** + * raptor_new_xml_writer: + * @world: raptor_world object + * @nstack: Namespace stack for the writer to start with (or NULL) + * @iostr: I/O stream to write to + * + * Constructor - Create a new XML Writer writing XML to a raptor_iostream + * + * Return value: a new #raptor_xml_writer object or NULL on failure + **/ +raptor_xml_writer* +raptor_new_xml_writer(raptor_world* world, + raptor_namespace_stack *nstack, + raptor_iostream* iostr) +{ + raptor_xml_writer* xml_writer; + + RAPTOR_CHECK_CONSTRUCTOR_WORLD(world); + + if(!iostr) + return NULL; + + raptor_world_open(world); + + xml_writer = RAPTOR_CALLOC(raptor_xml_writer*, 1, sizeof(*xml_writer)); + if(!xml_writer) + return NULL; + + xml_writer->world = world; + + xml_writer->nstack_depth = 0; + + xml_writer->nstack = nstack; + if(!xml_writer->nstack) { + xml_writer->nstack = raptor_new_namespaces(world, 1); + xml_writer->my_nstack = 1; + } + + xml_writer->iostr = iostr; + + raptor_object_options_init(&xml_writer->options, + RAPTOR_OPTION_AREA_XML_WRITER); + + return xml_writer; +} + + +/** + * raptor_free_xml_writer: + * @xml_writer: XML writer object + * + * Destructor - Free XML Writer + * + **/ +void +raptor_free_xml_writer(raptor_xml_writer* xml_writer) +{ + if(!xml_writer) + return; + + if(xml_writer->nstack && xml_writer->my_nstack) + raptor_free_namespaces(xml_writer->nstack); + + raptor_object_options_clear(&xml_writer->options); + + RAPTOR_FREE(raptor_xml_writer, xml_writer); +} + + +static void +raptor_xml_writer_write_xml_declaration(raptor_xml_writer* xml_writer) +{ + if(!xml_writer->xml_declaration_checked) { + /* check that it should be written once only */ + xml_writer->xml_declaration_checked = 1; + + if(RAPTOR_OPTIONS_GET_NUMERIC(xml_writer, + RAPTOR_OPTION_WRITER_XML_DECLARATION)) { + raptor_iostream_string_write((const unsigned char*)"<?xml version=\"", + xml_writer->iostr); + raptor_iostream_counted_string_write((XML_WRITER_XML_VERSION(xml_writer) == 10) ? + (const unsigned char*)"1.0" : + (const unsigned char*)"1.1", + 3, xml_writer->iostr); + raptor_iostream_string_write((const unsigned char*)"\" encoding=\"utf-8\"?>\n", + xml_writer->iostr); + } + } + +} + + +/** + * raptor_xml_writer_empty_element: + * @xml_writer: XML writer object + * @element: XML element object + * + * Write an empty XML element to the XML writer. + * + * Closes any previous empty element if XML writer option AUTO_EMPTY + * is enabled. + **/ +void +raptor_xml_writer_empty_element(raptor_xml_writer* xml_writer, + raptor_xml_element *element) +{ + raptor_xml_writer_write_xml_declaration(xml_writer); + + XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer); + + if(xml_writer->pending_newline || XML_WRITER_AUTO_INDENT(xml_writer)) + raptor_xml_writer_indent(xml_writer); + + raptor_xml_writer_start_element_common(xml_writer, element, 1); + + raptor_xml_writer_end_element_common(xml_writer, element, 1); + + raptor_namespaces_end_for_depth(xml_writer->nstack, xml_writer->depth); +} + + +/** + * raptor_xml_writer_start_element: + * @xml_writer: XML writer object + * @element: XML element object + * + * Write a start XML element to the XML writer. + * + * Closes any previous empty element if XML writer option AUTO_EMPTY + * is enabled. + * + * Indents the start element if XML writer option AUTO_INDENT is enabled. + **/ +void +raptor_xml_writer_start_element(raptor_xml_writer* xml_writer, + raptor_xml_element *element) +{ + raptor_xml_writer_write_xml_declaration(xml_writer); + + XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer); + + if(xml_writer->pending_newline || XML_WRITER_AUTO_INDENT(xml_writer)) + raptor_xml_writer_indent(xml_writer); + + raptor_xml_writer_start_element_common(xml_writer, element, + XML_WRITER_AUTO_EMPTY(xml_writer)); + + xml_writer->depth++; + + /* SJS Note: This "if" clause is necessary because raptor_rdfxml.c + * uses xml_writer for parseType="literal" and passes in elements + * whose parent field is already set. The first time this function + * is called, it sets element->parent to 0, causing the warn-07.rdf + * test to fail. Subsequent calls to this function set + * element->parent to its existing value. + */ + if(xml_writer->current_element) + element->parent = xml_writer->current_element; + + xml_writer->current_element = element; + if(element->parent) + element->parent->content_element_seen = 1; +} + + +/** + * raptor_xml_writer_end_element: + * @xml_writer: XML writer object + * @element: XML element object + * + * Write an end XML element to the XML writer. + * + * Indents the end element if XML writer option AUTO_INDENT is enabled. + **/ +void +raptor_xml_writer_end_element(raptor_xml_writer* xml_writer, + raptor_xml_element* element) +{ + int is_empty; + + xml_writer->depth--; + + if(xml_writer->pending_newline || + (XML_WRITER_AUTO_INDENT(xml_writer) && element->content_element_seen)) + raptor_xml_writer_indent(xml_writer); + + is_empty = XML_WRITER_AUTO_EMPTY(xml_writer) ? + !(element->content_cdata_seen || element->content_element_seen) : 0; + + raptor_xml_writer_end_element_common(xml_writer, element, is_empty); + + raptor_namespaces_end_for_depth(xml_writer->nstack, xml_writer->depth); + + if(xml_writer->current_element) + xml_writer->current_element = xml_writer->current_element->parent; +} + + +/** + * raptor_xml_writer_newline: + * @xml_writer: XML writer object + * + * Write a newline to the XML writer. + * + * Indents the next line if XML writer option AUTO_INDENT is enabled. + **/ +void +raptor_xml_writer_newline(raptor_xml_writer* xml_writer) +{ + xml_writer->pending_newline = 1; +} + + +/** + * raptor_xml_writer_cdata: + * @xml_writer: XML writer object + * @s: string to XML escape and write + * + * Write CDATA XML-escaped to the XML writer. + * + * Closes any previous empty element if XML writer option AUTO_EMPTY + * is enabled. + * + **/ +void +raptor_xml_writer_cdata(raptor_xml_writer* xml_writer, + const unsigned char *s) +{ + raptor_xml_writer_write_xml_declaration(xml_writer); + + XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer); + + raptor_xml_escape_string_any_write(s, strlen((const char*)s), + '\0', + XML_WRITER_XML_VERSION(xml_writer), + xml_writer->iostr); + + if(xml_writer->current_element) + xml_writer->current_element->content_cdata_seen = 1; +} + + +/** + * raptor_xml_writer_cdata_counted: + * @xml_writer: XML writer object + * @s: string to XML escape and write + * @len: length of string + * + * Write counted CDATA XML-escaped to the XML writer. + * + * Closes any previous empty element if XML writer option AUTO_EMPTY + * is enabled. + * + **/ +void +raptor_xml_writer_cdata_counted(raptor_xml_writer* xml_writer, + const unsigned char *s, unsigned int len) +{ + raptor_xml_writer_write_xml_declaration(xml_writer); + + XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer); + + raptor_xml_escape_string_any_write(s, len, + '\0', + XML_WRITER_XML_VERSION(xml_writer), + xml_writer->iostr); + + if(xml_writer->current_element) + xml_writer->current_element->content_cdata_seen = 1; +} + + +/** + * raptor_xml_writer_raw: + * @xml_writer: XML writer object + * @s: string to write + * + * Write a string raw to the XML writer. + * + * Closes any previous empty element if XML writer option AUTO_EMPTY + * is enabled. + * + **/ +void +raptor_xml_writer_raw(raptor_xml_writer* xml_writer, + const unsigned char *s) +{ + raptor_xml_writer_write_xml_declaration(xml_writer); + + XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer); + + raptor_iostream_string_write(s, xml_writer->iostr); + + if(xml_writer->current_element) + xml_writer->current_element->content_cdata_seen = 1; +} + + +/** + * raptor_xml_writer_raw_counted: + * @xml_writer: XML writer object + * @s: string to write + * @len: length of string + * + * Write a counted string raw to the XML writer. + * + * Closes any previous empty element if XML writer option AUTO_EMPTY + * is enabled. + * + **/ +void +raptor_xml_writer_raw_counted(raptor_xml_writer* xml_writer, + const unsigned char *s, unsigned int len) +{ + raptor_xml_writer_write_xml_declaration(xml_writer); + + XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer); + + raptor_iostream_counted_string_write(s, len, xml_writer->iostr); + + if(xml_writer->current_element) + xml_writer->current_element->content_cdata_seen = 1; +} + + +/** + * raptor_xml_writer_comment: + * @xml_writer: XML writer object + * @s: comment string to write + * + * Write an XML comment to the XML writer. + * + * Closes any previous empty element if XML writer option AUTO_EMPTY + * is enabled. + * + **/ +void +raptor_xml_writer_comment(raptor_xml_writer* xml_writer, + const unsigned char *s) +{ + XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer); + + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)"<!-- ", 5); + raptor_xml_writer_cdata(xml_writer, s); + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)" -->", 4); +} + + +/** + * raptor_xml_writer_comment_counted: + * @xml_writer: XML writer object + * @s: comment string to write + * @len: length of string + * + * Write a counted XML comment to the XML writer. + * + * Closes any previous empty element if XML writer option AUTO_EMPTY + * is enabled. + * + **/ +void +raptor_xml_writer_comment_counted(raptor_xml_writer* xml_writer, + const unsigned char *s, unsigned int len) +{ + XML_WRITER_FLUSH_CLOSE_BRACKET(xml_writer); + + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)"<!-- ", 5); + raptor_xml_writer_cdata_counted(xml_writer, s, len); + raptor_xml_writer_raw_counted(xml_writer, (const unsigned char*)" -->", 4); +} + + +/** + * raptor_xml_writer_flush: + * @xml_writer: XML writer object + * + * Finish the XML writer. + * + **/ +void +raptor_xml_writer_flush(raptor_xml_writer* xml_writer) +{ + if(xml_writer->pending_newline) { + raptor_iostream_write_byte('\n', xml_writer->iostr); + xml_writer->pending_newline = 0; + } +} + + +/** + * raptor_xml_writer_set_option: + * @xml_writer: #raptor_xml_writer xml_writer object + * @option: option to set from enumerated #raptor_option values + * @string: string option value (or NULL) + * @integer: integer option value + * + * Set xml_writer option. + * + * If @string is not NULL and the option type is numeric, the string + * value is converted to an integer and used in preference to @integer. + * + * If @string is NULL and the option type is not numeric, an error is + * returned. + * + * The @string values used are copied. + * + * The allowed options are available via + * raptor_world_get_option_description(). + * + * Return value: non 0 on failure or if the option is unknown + **/ +int +raptor_xml_writer_set_option(raptor_xml_writer *xml_writer, + raptor_option option, char* string, int integer) +{ + return raptor_object_options_set_option(&xml_writer->options, option, + string, integer); +} + + +/** + * raptor_xml_writer_get_option: + * @xml_writer: #raptor_xml_writer xml_writer object + * @option: option to get value + * @string_p: pointer to where to store string value + * @integer_p: pointer to where to store integer value + * + * Get xml_writer option. + * + * Any string value returned in *@string_p is shared and must + * be copied by the caller. + * + * The allowed options are available via + * raptor_world_get_option_description(). + * + * Return value: option value or < 0 for an illegal option + **/ +int +raptor_xml_writer_get_option(raptor_xml_writer *xml_writer, + raptor_option option, + char** string_p, int* integer_p) +{ + return raptor_object_options_get_option(&xml_writer->options, option, + string_p, integer_p); +} + + +/** + * raptor_xml_writer_get_depth: + * @xml_writer: #raptor_xml_writer xml writer object + * + * Get the current XML Writer element depth + * + * Return value: element stack depth + */ +int +raptor_xml_writer_get_depth(raptor_xml_writer *xml_writer) +{ + return xml_writer->depth; +} + + +#endif + + + +#ifdef STANDALONE + +/* one more prototype */ +int main(int argc, char *argv[]); + + +const unsigned char *base_uri_string = (const unsigned char*)"http://example.org/base#"; + +#define OUT_BYTES_COUNT 135 + +int +main(int argc, char *argv[]) +{ + raptor_world *world; + const char *program = raptor_basename(argv[0]); + raptor_iostream *iostr; + raptor_namespace_stack *nstack; + raptor_namespace* foo_ns; + raptor_xml_writer* xml_writer; + raptor_uri* base_uri; + raptor_qname* el_name; + raptor_xml_element *element; + unsigned long offset; + raptor_qname **attrs; + raptor_uri* base_uri_copy = NULL; + + /* for raptor_new_iostream_to_string */ + void *string = NULL; + size_t string_len = 0; + + world = raptor_new_world(); + if(!world || raptor_world_open(world)) + exit(1); + + iostr = raptor_new_iostream_to_string(world, &string, &string_len, NULL); + if(!iostr) { + fprintf(stderr, "%s: Failed to create iostream to string\n", program); + exit(1); + } + + nstack = raptor_new_namespaces(world, 1); + + xml_writer = raptor_new_xml_writer(world, nstack, iostr); + if(!xml_writer) { + fprintf(stderr, "%s: Failed to create xml_writer to iostream\n", program); + exit(1); + } + + base_uri = raptor_new_uri(world, base_uri_string); + + foo_ns = raptor_new_namespace(nstack, + (const unsigned char*)"foo", + (const unsigned char*)"http://example.org/foo-ns#", + 0); + + + el_name = raptor_new_qname_from_namespace_local_name(world, + foo_ns, + (const unsigned char*)"bar", + NULL); + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + element = raptor_new_xml_element(el_name, + NULL, /* language */ + base_uri_copy); + + raptor_xml_writer_start_element(xml_writer, element); + raptor_xml_writer_cdata_counted(xml_writer, (const unsigned char*)"hello\n", 6); + raptor_xml_writer_comment_counted(xml_writer, (const unsigned char*)"comment", 7); + raptor_xml_writer_cdata(xml_writer, (const unsigned char*)"\n"); + raptor_xml_writer_end_element(xml_writer, element); + + raptor_free_xml_element(element); + + raptor_xml_writer_cdata(xml_writer, (const unsigned char*)"\n"); + + el_name = raptor_new_qname(nstack, + (const unsigned char*)"blah", + NULL /* no attribute value - element */); + base_uri_copy = base_uri ? raptor_uri_copy(base_uri) : NULL; + element = raptor_new_xml_element(el_name, + NULL, /* language */ + base_uri_copy); + + attrs = RAPTOR_CALLOC(raptor_qname**, 1, sizeof(raptor_qname*)); + attrs[0] = raptor_new_qname(nstack, + (const unsigned char*)"a", + (const unsigned char*)"b" /* attribute value */); + raptor_xml_element_set_attributes(element, attrs, 1); + + raptor_xml_writer_empty_element(xml_writer, element); + + raptor_xml_writer_cdata(xml_writer, (const unsigned char*)"\n"); + + raptor_free_xml_writer(xml_writer); + + raptor_free_xml_element(element); + + raptor_free_namespace(foo_ns); + + raptor_free_namespaces(nstack); + + raptor_free_uri(base_uri); + + + offset = raptor_iostream_tell(iostr); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Freeing iostream\n", program); +#endif + raptor_free_iostream(iostr); + + if(offset != OUT_BYTES_COUNT) { + fprintf(stderr, "%s: I/O stream wrote %d bytes, expected %d\n", program, + (int)offset, (int)OUT_BYTES_COUNT); + fputs("[[", stderr); + (void)fwrite(string, 1, string_len, stderr); + fputs("]]\n", stderr); + return 1; + } + + if(!string) { + fprintf(stderr, "%s: I/O stream failed to create a string\n", program); + return 1; + } + string_len = strlen((const char*)string); + if(string_len != offset) { + fprintf(stderr, "%s: I/O stream created a string length %d, expected %d\n", program, (int)string_len, (int)offset); + return 1; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "%s: Made XML string of %d bytes\n", program, (int)string_len); + fputs("[[", stderr); + (void)fwrite(string, 1, string_len, stderr); + fputs("]]\n", stderr); +#endif + + raptor_free_memory(string); + + raptor_free_world(world); + + /* keep gcc -Wall happy */ + return(0); +} + +#endif diff --git a/src/snprintf.c b/src/snprintf.c new file mode 100644 index 0000000..9d79d0c --- /dev/null +++ b/src/snprintf.c @@ -0,0 +1,449 @@ +/* + * This file is in the Public Domain + * + * Based on code from Public Domain snprintf.c from mutt + * http://dev.mutt.org/hg/mutt/file/55cd4cb611d9/snprintf.c + * Tue Aug 08 22:49:12 2006 +0000 + * + */ + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#ifdef HAVE_VASPRINTF +#ifndef _GNU_SOURCE +#define _GNU_SOURCE /* to get vasprintf() available */ +#endif +#endif +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#include "raptor2.h" +#include "raptor_internal.h" + + + +/* + * Thanks to the patch in this Debian bug for the solution + * to the crash inside vsnprintf on some architectures. + * + * "reuse of args inside the while(1) loop is in violation of the + * specs and only happens to work by accident on other systems." + * + * http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=104325 + */ + +#ifndef va_copy +#ifdef __va_copy +#define va_copy(dest, src) __va_copy(dest,src) +#else +#define va_copy(dest, src) (dest) = (src) +#endif +#endif + + +#ifdef CHECK_VSNPRINTF_RUNTIME +static int vsnprintf_checked = -1; + +static int +vsnprintf_check_is_c99(char *buf, const char *s, ...) +{ + va_list args; + int r; + va_start(args, s); + r = vsnprintf(buf, buf ? 5 : 0, s, args); + va_end(args); + + return (r == 7); +} + +static int +vsnprintf_is_c99(void) +{ + if(vsnprintf_checked < 0) { + char buffer[32]; + vsnprintf_checked = (vsnprintf_check_is_c99(NULL, "1234567") && + vsnprintf_check_is_c99(buffer, "1234567")) + ? 1 : 0; + } + + return vsnprintf_checked; +} +#endif /* CHECK_VSNPRINTF_RUNTIME */ + + +#define VSNPRINTF_C99_BLOCK(len, buffer, size, format, arguments) \ + do { \ + len = vsnprintf(buffer, size, format, arguments); \ + } while(0) + +#define VSNPRINTF_NOT_C99_BLOCK(len, buffer, size, format, arguments) \ + do { \ + if((buffer == NULL) || !size) { \ + /* This vsnprintf doesn't return number of bytes required */ \ + size = 2 + strlen(format); \ + while(1) { \ + va_list args_copy; \ + char* tmp_buffer = RAPTOR_MALLOC(char*, size + 1); \ + \ + if(!tmp_buffer) \ + break; \ + \ + /* copy for re-use */ \ + va_copy(args_copy, arguments); \ + len = vsnprintf(tmp_buffer, size, format, args_copy); \ + va_end(args_copy); \ + \ + /* On windows, vsnprintf() returns -1 if the buffer does not \ + * fit. If the buffer exactly fits the string without a NULL \ + * terminator, it returns the string length and it ends up \ + * with an unterminated string. The added check makes sure \ + * the string returned is terminated - otherwise more buffer \ + * space is allocated and the while() loop retries. \ + * \ + * On tru64, vsnprintf() returns the buffer size minus 1 if \ + * the buffer is too small, leaving room for the terminator. \ + */ \ + if((len >= 0) && \ + (RAPTOR_GOOD_CAST(size_t, len) + 1 < size) && \ + (tmp_buffer[len] == '\0')) { \ + len = RAPTOR_BAD_CAST(int, strlen(tmp_buffer)); \ + RAPTOR_FREE(char*, tmp_buffer); \ + break; \ + } \ + RAPTOR_FREE(char*, tmp_buffer); \ + size += (size >> 1); \ + } \ + } \ + \ + if(buffer != NULL) \ + len = vsnprintf(buffer, size, format, arguments); \ + } while(0) + +#ifndef STANDALONE + +/** + * raptor_vsnprintf2: + * @buffer: buffer (or NULL) + * @size: size of buffer (or 0) + * @format: printf-style format string + * @arguments: variable arguments list + * + * Format output for a variable arguments list into an allocated sized buffer. + * + * This is a wrapper around system versions of vsnprintf with + * different call and return conventions. + * + * If @buffer is NULL or size is 0 or the buffer size is too small, + * returns the number of bytes that would be needed for buffer + * + * Return value: number of bytes allocated (excluding NUL) or <0 on failure + **/ +int +raptor_vsnprintf2(char *buffer, size_t size, + const char *format, va_list arguments) +{ + int len = -1; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(format, char*, -1); + +#ifdef CHECK_VSNPRINTF_RUNTIME + + if(vsnprintf_is_c99()) + VSNPRINTF_C99_BLOCK(len, buffer, size, format, arguments) ; + else + VSNPRINTF_NOT_C99_BLOCK(len, buffer, size, format, arguments) ; + +#else + +#ifdef HAVE_C99_VSNPRINTF + VSNPRINTF_C99_BLOCK(len, buffer, size, format, arguments) ; +#else + VSNPRINTF_NOT_C99_BLOCK(len, buffer, size, format, arguments) ; +#endif + +#endif + + return len; +} + + +/** + * raptor_vsnprintf: + * @format: printf-style format string + * @arguments: variable arguments list + * + * Format output for a variable arguments list into a newly allocated buffer + * + * @Deprecated: This does not actually conform to vsnprintf's calling + * convention and does not return the allocated buffer length. Use + * raptor_vsnprintf2() or raptor_vasprintf() instead. + * + * Return value: a newly allocated string as the formatted result or NULL on failure + **/ +char* +raptor_vsnprintf(const char *format, va_list arguments) +{ + int len; + char *buffer = NULL; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(format, char*, NULL); + + len = raptor_vasprintf(&buffer, format, arguments); + if(len < 0) + return NULL; + + return buffer; +} + + +/** + * raptor_snprintf: + * @buffer: buffer (or NULL) + * @size: bufer size (or 0) + * @format: printf-style format string + * @...: format arguments + * + * Format output into an allocated sized buffer + * + * This provides a portable version snprintf() over variants on + * different systems. + * + * If @buffer is NULL, calculates the number of bytes needed to + * allocate for buffer and do no formatting. + * + * Return value: number of bytes allocated (excluding NUL) or 0 on failure + **/ +int +raptor_snprintf(char *buffer, size_t size, const char *format, ...) +{ + va_list arguments; + int length; + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(format, char*, 0); + + va_start(arguments, format); + length = raptor_vsnprintf2(buffer, size, format, arguments); + va_end(arguments); + + return length; +} + + +/** + * raptor_vasprintf: + * @ret: pointer to store buffer + * @format: printf-style format string + * @arguments: format arguments list + * + * Format output into a new buffer and return it + * + * This is a wrapper around the (GNU) vasprintf function that is not + * always avaiable. + * + * Return value: number of bytes allocated (excluding NUL) or < 0 on failure + **/ +int +raptor_vasprintf(char **ret, const char *format, va_list arguments) +{ + int length; +#ifndef HAVE_VASPRINTF + va_list args_copy; +#endif + + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(ret, char**, -1); + RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(format, char*, -1); + +#ifdef HAVE_VASPRINTF + length = vasprintf(ret, format, arguments); +#else + va_copy(args_copy, arguments); + length = raptor_vsnprintf2(NULL, 0, format, args_copy); + va_end(args_copy); + if(length < 0) { + *ret = NULL; + return length; + } + *ret = RAPTOR_MALLOC(char*, length + 1); + if(!*ret) + return -1; + + va_copy(args_copy, arguments); + length = raptor_vsnprintf2(*ret, length + 1, format, args_copy); + va_end(args_copy); +#endif + + return length; +} + + +static const char digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + +/** + * raptor_format_integer: + * @buffer: buffer (or NULL) + * @bufsize: size of above (or 0) + * @integer: integer value to format + * @base: numeric base up to 36 + * @width: field width (or -1) + * @padding: padding char (or \0) + * + * INTERNAL - Format an integer as a decimal into a buffer or + * calculate the size needed. + * + * Works Like the C99 snprintf() but just for integers. + * + * If @buffer is NULL or the @bufsize is too small, the number of + * bytes needed (excluding NUL) is returned and no formatting is done. + * + * NOTE: Does NOT add a '\0' at end of string. + * + * Return value: number of bytes needed or written (excluding NUL) or 0 on failure + */ +size_t +raptor_format_integer(char* buffer, size_t bufsize, int integer, + unsigned int base, int width, char padding) +{ + size_t len = 1; + char *p; + unsigned int value; + + if(integer < 0) { + value = (unsigned int)-integer; + len++; + width++; + } else + value = (unsigned int)integer; + while(value /= base) + len++; + + if(width > 0 && RAPTOR_GOOD_CAST(size_t, width) > len) + len = width; + + if(!buffer || bufsize < RAPTOR_GOOD_CAST(size_t, (len + 1))) /* +1 for NUL */ + return len; + + if(!padding) + padding = ' '; + + if(integer < 0) + value = (unsigned int)-integer; + else + value = (unsigned int)integer; + + p = &buffer[len]; + *p-- = '\0'; + while(value > 0 && p >= buffer) { + *p-- = digits[value % base]; + value /= base; + } + while(p >= buffer) + *p-- = padding; + if(integer < 0) + *buffer = '-'; + + return len; +} + + +#else /* STANDALONE */ + + +int main(int argc, char *argv[]); +static int test_snprintf_real(int len_ref, const char *format, va_list arguments) RAPTOR_PRINTF_FORMAT(2, 0); +static int test_snprintf(size_t len_ref, const char *format, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +static const char* program; + + +static int +test_snprintf_real(int len_ref, const char *format, va_list arguments) +{ + int len = -2; + size_t size = 0; + + VSNPRINTF_NOT_C99_BLOCK(len, NULL, size, format, arguments); + + if(len != len_ref) { + fprintf(stderr, + "%s: VSNPRINTF_NOT_C99_BLOCK(len=%d, size=%d, format=\"%s\") failed : expected %d, got %d\n", + program, len, (int)size, format, (int)len_ref, (int)len); + return 1; + } + + return 0; +} + + +static int +test_snprintf(size_t len_ref, const char *format, ...) +{ + va_list arguments; + int rc; + + va_start(arguments, format); + rc = test_snprintf_real(RAPTOR_BAD_CAST(int, len_ref), format, arguments); + va_end(arguments); + + return rc; +} + + +#define FMT_LEN_MAX 128 +#define ARG_LEN_MAX 128 + +int +main(int argc, char *argv[]) +{ + char fmt[FMT_LEN_MAX + 1]; + char arg[ARG_LEN_MAX + 1]; + size_t x, y; + int errors = 0; + + program = raptor_basename(argv[0]); + + for(x = 2; x < FMT_LEN_MAX; x++) { + for(y = 0; y < ARG_LEN_MAX; y++) { + size_t len_ref = x + y - 2; + + /* fmt = "xxxxxxxx%s" + * (number of 'x' characters varies) + */ + memset(fmt, 'x', x - 2); + fmt[x - 2] = '%'; + fmt[x - 1] = 's'; + fmt[x] = '\0'; + + /* arg = "yyyyyyyy" + * (number of 'y' characters varies) + */ + memset(arg, 'y', y); + arg[y] = '\0'; + + /* assert(strlen(fmt) == x); */ + /* assert(strlen(arg) == y); */ + + /* len_ref = sprintf(buf_ref, fmt, arg); + assert((size_t)len_ref == x + y - 2); */ + + PRAGMA_IGNORE_WARNING_FORMAT_NONLITERAL_START + if(test_snprintf(len_ref, fmt, arg)) + errors++; + PRAGMA_IGNORE_WARNING_END + } + } + + return errors; +} + + +#endif /* STANDALONE */ diff --git a/src/sort_r.c b/src/sort_r.c new file mode 100644 index 0000000..b1c8c84 --- /dev/null +++ b/src/sort_r.c @@ -0,0 +1,135 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * sort_r.c - Portable sort_r + * + * Copyright (C) 2014, David Beckett http://www.dajobe.org/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + */ + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + + +#include <stdio.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + + +#ifndef STANDALONE + +#if defined(HAVE_QSORT_R) || defined(HAVE_QSORT_S) +/* Include inline code */ +#include "sort_r.h" +#else +#include "ssort.h" +#endif + + +/** + * raptor_sort_r: + * @base: the array to be sorted + * @nel: the number of elements in the array + * @width: the size in bytes of each element of the array + * @compar: comparison function + * @user_data: a pointer to be passed to the comparison function + * + * Sort an array with an extra user data arg for the comparison funciton. + * + * Sorts data at @base of @nel elememnts of width @width using + * comparison function @comp that takes args (void* data1, void* + * data2, @user_data) and returns <0, 0, or >0 for object comparison. + * + */ +void +raptor_sort_r(void *base, size_t nel, size_t width, + raptor_data_compare_arg_handler compar, void *user_data) +{ +#if defined(HAVE_QSORT_R) || defined(HAVE_QSORT_S) + sort_r(base, nel, width, compar, user_data); +#else + ssort_r(base, nel, width, compar, user_data); +#endif +} + + +#endif + + + +#ifdef STANDALONE + +/* one more prototype */ +int main(int argc, char *argv[]); + + +/* Public Domain licensed example code by Isaac Turner from + * https://github.com/noporpoise/sort_r + */ + +/* Isaac Turner 18 Nov 2013 Public Domain */ + +/* +Comparison function to sort an array of int, inverting a given region. +`arg` should be of type int[2], with the elements representing the start and end +of the region to invert (inclusive). +*/ +static int sort_r_cmp(const void *aa, const void *bb, void *arg) +{ + const int *a = (const int*)aa; + const int *b = (const int*)bb; + const int *interval = (const int*)arg; + int cmp = *a - *b; + int inv_start = interval[0], inv_end = interval[1]; + char norm = (*a < inv_start || *a > inv_end || *b < inv_start || *b > inv_end); + return norm ? cmp : -cmp; +} + +int +main(int argc, char *argv[]) +{ + const char *program = raptor_basename(argv[0]); + + int i; + /* sort 1..19, 30..20, 30..100 */ + int arr[18] = {1, 5, 28, 4, 3, 2, 10, 20, 18, 25, 21, 29, 34, 35, 14, 100, 27, 19}; + int tru[18] = {1, 2, 3, 4, 5, 10, 14, 18, 19, 29, 28, 27, 25, 21, 20, 34, 35, 100}; + + /* Region to invert: 20-30 (inclusive) */ + int interval[2] = {20, 30}; + int failures = 0; + + raptor_sort_r(arr, 18, sizeof(int), sort_r_cmp, interval); + + /* Check PASS/FAIL */ + for(i = 0; i < 18; i++) { + if(arr[i] != tru[i]) { + printf("%s: sort_r() result %i: got %d expected %d", program, + i, arr[i], tru[i]); + failures++; + } + } + + return failures; +} + +#endif diff --git a/src/sort_r.h b/src/sort_r.h new file mode 100644 index 0000000..8d8b580 --- /dev/null +++ b/src/sort_r.h @@ -0,0 +1,125 @@ +/* Isaac Turner 29 April 2014 Public Domain */ +#ifndef SORT_R_H_ +#define SORT_R_H_ + +#include <stdlib.h> + +/* +sort_r function to be exported. + +Parameters: + base is the array to be sorted + nel is the number of elements in the array + width is the size in bytes of each element of the array + compar is the comparison function + arg is a pointer to be passed to the comparison function + +void sort_r(void *base, size_t nel, size_t width, + int (*compar)(const void *_a, const void *_b, void *_arg), + void *arg); +*/ + +#if (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || \ + defined __FreeBSD__ || defined __BSD__ || defined __bsdi__ || \ + defined OpenBSD3_1 || defined OpenBSD3_9 || defined __OpenBSD__ || \ + defined __NetBSD__ || \ + defined __DragonFly__ || \ + defined AMIGA) +# define _SORT_R_BSD +#elif (defined _GNU_SOURCE || defined __gnu_hurd__ || defined __GNU__ || \ + defined __linux__ || defined __MINGW32__ || defined __GLIBC__ || \ + defined __CYGWIN__) +# define _SORT_R_LINUX +#elif (defined _WIN32 || defined _WIN64 || defined __WINDOWS__) +# define _SORT_R_WINDOWS +#else +# error Cannot detect operating system +#endif + +#if (defined NESTED_QSORT && NESTED_QSORT == 0) +# undef NESTED_QSORT +#elif (!defined NESTED_QSORT && \ + defined __GLIBC__ && __GLIBC__ == 2 && __GLIBC_MINOR__ < 8) +/* no qsort_r in glibc before 2.8 */ +# define NESTED_QSORT +#endif + + +#if defined NESTED_QSORT + + static inline void sort_r(void *base, size_t nel, size_t width, + int (*compar)(const void *_a, const void *_b, void *aarg), + void *arg) + { + int nested_cmp(const void *a, const void *b) + { + return compar(a, b, arg); + } + + qsort(base, nel, width, nested_cmp); + } + +#else /* !NESTED_QSORT */ + + /* Declare structs and functions */ + #if defined _SORT_R_BSD + + /* BSD requires argument swap */ + extern void qsort_r(void *base, size_t nel, size_t width, void *thunk, + int (*compar)(void *_thunk, const void *_a, const void *_b)); + + struct sort_r_data + { + void *arg; + int (*compar)(const void *_a, const void *_b, void *_arg); + }; + + static inline int sort_r_arg_swap(void *s, const void *a, const void *b) + { + struct sort_r_data *ss = (struct sort_r_data*)s; + return (ss->compar)(a, b, ss->arg); + } + + #elif defined _SORT_R_LINUX + + typedef int(* __compar_d_fn_t)(const void *, const void *, void *); + extern void qsort_r(void *base, size_t nel, size_t width, + __compar_d_fn_t __compar, void *arg) + __attribute__((nonnull (1, 4))); + + #endif + + /* implementation */ + + static inline void sort_r(void *base, size_t nel, size_t width, + int (*compar)(const void *_a, const void *_b, void *_arg), + void *arg) + { + #if defined _SORT_R_LINUX + + qsort_r(base, nel, width, compar, arg); + + #elif defined _SORT_R_BSD + + struct sort_r_data tmp; + tmp.arg = arg; + tmp.compar = compar; + qsort_r(base, nel, width, &tmp, sort_r_arg_swap); + + #else /* defined _SORT_R_WINDOWS */ + + struct sort_r_data tmp; + tmp.arg = arg; + tmp.compar = compar; + qsort_s(base, nel, width, sort_r_arg_swap, &tmp); + + #endif + } + +#endif /* !NESTED_QSORT */ + +#undef _SORT_R_WINDOWS +#undef _SORT_R_LINUX +#undef _SORT_R_BSD + +#endif /* SORT_R_H_ */ diff --git a/src/ssort.h b/src/ssort.h new file mode 100644 index 0000000..7cc1572 --- /dev/null +++ b/src/ssort.h @@ -0,0 +1,73 @@ +/* +** ssort() -- Fast, small, qsort()-compatible Shell sort +** +** by Ray Gardner, public domain 5/90 +*/ + +#include <stddef.h> + +/** + * ssort_r: + * @base: base data + * @nel: number of elements at @base + * @width: width of an element + * @comp: comparison function taking args (a, b, @arg) + * @arg: user data (thunk) for the comparison function @comp + * + * Fast, small shell sort compatible to qsort_r() taking an extra thunk / user data arg. + * + * Sorts data at @base of @nel elements of width @width using + * comparison function @comp that takes args (a, b, @arg). + * + * Return value: non-0 on failure + * +*/ +static int +ssort_r(void* base, size_t nel, size_t width, + raptor_data_compare_arg_handler comp, + void* arg) +{ + size_t wnel, gap, k; + + /* bad args */ + if(!base || !width || !comp) + return -1; + + /* nothing to do */ + if(nel < 2) + return 0; + + wnel = width * nel; + for(gap = 0; ++gap < nel;) + gap *= 3; + + while((gap /= 3) != 0) { + size_t wgap = width * gap; + size_t i; + + for(i = wgap; i < wnel; i += width) { + size_t j = i; + do { + char* a; + char* b; + + j -= wgap; + a = j + (char *)base; + b = a + wgap; + + if ((*comp)(a, b, arg) <= 0) + break; + + k = width; + do { + char tmp = *a; + *a++ = *b; + *b++ = tmp; + } while (--k); + + } while(j >= wgap); + } + } + + return 0; +} diff --git a/src/strcasecmp.c b/src/strcasecmp.c new file mode 100644 index 0000000..a1a3605 --- /dev/null +++ b/src/strcasecmp.c @@ -0,0 +1,108 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * strcasecmp.c - strcasecmp compatibility + * + * This file is in the public domain. + * + */ + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> + +int raptor_strcasecmp(const char* s1, const char* s2); +int raptor_strncasecmp(const char* s1, const char* s2, size_t n); + + +int +raptor_strcasecmp(const char* s1, const char* s2) +{ + register int c1, c2; + + while(*s1 && *s2) { + c1 = tolower((int)*s1); + c2 = tolower((int)*s2); + if(c1 != c2) + return (c1 - c2); + s1++; + s2++; + } + return (int) (*s1 - *s2); +} + + +int +raptor_strncasecmp(const char* s1, const char* s2, size_t n) +{ + register int c1, c2; + + while(*s1 && *s2 && n) { + c1 = tolower((int)*s1); + c2 = tolower((int)*s2); + if(c1 != c2) + return (c1 - c2); + s1++; + s2++; + n--; + } + return 0; +} + + + +#ifdef STANDALONE + + +static int +assert_strcasecmp (const char *s1, const char *s2, int expected) +{ + int result = raptor_strcasecmp(s1, s2); + result = (result > 0) ? 1 : ((result <0) ? -1 : 0); + + if(result != expected) + { + fprintf(stderr, "FAIL strcasecmp (%s, %s) gave %d != %d\n", + s1, s2, result, expected); + return 1; + } + return 0; +} + + +static int +assert_strncasecmp (const char *s1, const char *s2, size_t size, int expected) +{ + int result = raptor_strncasecmp(s1, s2, size); + result = (result > 0) ? 1 : ((result <0) ? -1 : 0); + + if(result != expected) + { + fprintf(stderr, "FAIL strncasecmp (%s, %s, %d) gave %d != %d\n", + s1, s2, (unsigned int)size, result, expected); + return 1; + } + return 0; +} + + +int +main(int argc, char *argv[]) +{ + int failures = 0; + + failures += assert_strcasecmp("foo", "foo", 0); + failures += assert_strcasecmp("foo", "FOO", 0); + failures += assert_strcasecmp("foo", "BaR", 1); + + failures += assert_strncasecmp("foo", "foobar", 3, 0); + failures += assert_strncasecmp("foo", "FOOxyz", 3, 0); + failures += assert_strncasecmp("foo", "BaRfoo", 3, 1); + + return failures; +} + +#endif diff --git a/src/turtle_common.c b/src/turtle_common.c new file mode 100644 index 0000000..c822b34 --- /dev/null +++ b/src/turtle_common.c @@ -0,0 +1,336 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * turtle_common.c - Raptor Turtle common code + * + * Copyright (C) 2003-2007, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +/* Raptor includes */ +#include "raptor2.h" +#include "raptor_internal.h" + +#include <turtle_parser.h> +#define YY_NO_UNISTD_H 1 +#define YYSTYPE TURTLE_PARSER_STYPE +#include <turtle_lexer.h> +#include <turtle_common.h> + +/** + * raptor_stringbuffer_append_turtle_string: + * @stringbuffer: String buffer to add to + * @text: turtle string to decode + * @len: length of string + * @delim: terminating delimiter for string - only ', " or > are allowed + * @error_handler: error handling function + * @error_data: error handler data + * + * Append to a stringbuffer a Turtle-escaped string. + * + * The passed in string is handled according to the Turtle string + * escape rules giving a UTF-8 encoded output of the Unicode codepoints. + * + * The Turtle escapes are \b \f \n \r \t \\ + * \uXXXX \UXXXXXXXX where X is [A-F0-9] + * + * Turtle 2013 allows \ with -_~.!$&\'()*+,;=/?#@% + * + * URIs may not have \t \b \n \r \f or raw ' ' or \u0020 or \u003C or \u003E + * + * Return value: non-0 on failure + **/ +int +raptor_stringbuffer_append_turtle_string(raptor_stringbuffer* stringbuffer, + const unsigned char *text, + size_t len, int delim, + raptor_simple_message_handler error_handler, + void *error_data, + int is_uri) +{ + size_t i; + const unsigned char *s; + unsigned char *d; + unsigned char *string = RAPTOR_MALLOC(unsigned char*, len + 1); + const char* label = (is_uri ? "URI" : "string"); + + if(!string) + return -1; + + for(s = text, d = string, i = 0; i < len; s++, i++) { + unsigned char c=*s; + + if(c == ' ' && is_uri) { + error_handler(error_data, + "Turtle %s error - character '%c'", label, c); + RAPTOR_FREE(char*, string); + return 1; + } + + if(c == '\\' ) { + s++; i++; + c = *s; + if(c == 'n' || c == 'r' || c == 't' || c == 'b' || c == 'f') { + if(is_uri) { + error_handler(error_data, + "Turtle %s error - illegal URI escape '\\%c'", label, c); + RAPTOR_FREE(char*, string); + return 1; + } + if(c == 'n') + *d++ = '\n'; + else if(c == 'r') + *d++ = '\r'; + else if(c == 't') + *d++ = '\t'; + else if(c == 'b') + *d++ = '\b'; + else /* 'f' */ + *d++ = '\f'; + } else if(c == '\\' || c == delim || + c == '-' || c == '_' || c == '~' || c == '.' || c == '!' || + c == '$' || c == '&' || c == '\'' || c == '(' || c == ')' || + c == '*' || c == '+' || c == ',' || c == ';' ||c == '=' || + c == '/' || c == '?' || c == '#' || c == '@' ||c == '%') + *d++ = c; + else if(c == 'u' || c == 'U') { + size_t ulen = (c == 'u') ? 4 : 8; + unsigned long unichar = 0; + int n; + int unichar_width; + size_t ii; + + s++; i++; + if(i+ulen > len) { + error_handler(error_data, + "Turtle %s error - \\%c over end of line", label, c); + RAPTOR_FREE(char*, string); + return 1; + } + + for(ii = 0; ii < ulen; ii++) { + char cc = s[ii]; + if(!isxdigit(RAPTOR_GOOD_CAST(char, cc))) { + error_handler(error_data, + "Turtle %s error - illegal hex digit %c in Unicode escape '%c%s...'", + label, cc, c, s); + RAPTOR_FREE(char*, string); + return 1; + } + } + + n = sscanf((const char*)s, ((ulen == 4) ? "%04lx" : "%08lx"), &unichar); + if(n != 1) { + error_handler(error_data, + "Turtle %s error - illegal Unicode escape '%c%s...'", + label, c, s); + RAPTOR_FREE(char*, string); + return 1; + } + + s+= ulen-1; + i+= ulen-1; + + if(is_uri && (unichar == 0x0020 || unichar == 0x003C || unichar == 0x003E)) { + error_handler(error_data, + "Turtle %s error - illegal Unicode escape \\u%04lX in URI.", label, unichar); + break; + } + + if(unichar > raptor_unicode_max_codepoint) { + error_handler(error_data, + "Turtle %s error - illegal Unicode character with code point #x%lX (max #x%lX).", + label, unichar, raptor_unicode_max_codepoint); + RAPTOR_FREE(char*, string); + return 1; + } + + unichar_width = raptor_unicode_utf8_string_put_char(unichar, d, + len-(d-string)); + if(unichar_width < 0) { + error_handler(error_data, + "Turtle %s error - illegal Unicode character with code point #x%lX.", + label, unichar); + RAPTOR_FREE(char*, string); + return 1; + } + d += (size_t)unichar_width; + + } else { + /* don't handle \x where x isn't one of: \t \n \r \\ (delim) */ + error_handler(error_data, + "Turtle %s error - illegal escape \\%c (#x%02X) in \"%s\"", + label, c, c, text); + } + } else + *d++=c; + } + *d='\0'; + + /* calculate output string size */ + len = d-string; + +#ifdef __clang_analyzer__ + /* clang --analyze does not know about ownership of next call */ + free(string); string = NULL; +#endif + /* string gets owned by the stringbuffer after this */ + return raptor_stringbuffer_append_counted_string(stringbuffer, + string, len, 0); + +} + + +/** + * raptor_turtle_expand_qname_escapes: + * @name: turtle qname string to decode + * @len: length of name + * @error_handler: error handling function + * @error_data: error handler data + * + * Expands Turtle escapes for the given turtle qname string + * + * The passed in string is handled according to the Turtle string + * escape rules giving a UTF-8 encoded output of the Unicode codepoints. + * + * The Turtle escapes are \b \f \n \r \t \\ + * \uXXXX \UXXXXXXXX where X is [A-F0-9] + * + * Turtle 2013 allows \ with -_~.!$&\'()*+,;=/?#@% + * + * Return value: new length or 0 on failure + **/ +size_t +raptor_turtle_expand_qname_escapes(unsigned char *name, + size_t len, + raptor_simple_message_handler error_handler, + void *error_data) +{ + size_t i; + const unsigned char *s; + unsigned char *d; + + if(!name) + return 0; + + for(s = name, d = name, i = 0; i < len; s++, i++) { + unsigned char c=*s; + + if(c == '\\' ) { + s++; i++; + c = *s; + if(c == 'n') + *d++ = '\n'; + else if(c == 'r') + *d++ = '\r'; + else if(c == 't') + *d++ = '\t'; + else if(c == 'b') + *d++ = '\b'; + else if(c == 'f') + *d++ = '\f'; + else if(c == '\\' || + c == '-' || c == '_' || c == '~' || c == '.' || c == '!' || + c == '$' || c == '&' || c == '\'' || c == '(' || c == ')' || + c == '*' || c == '+' || c == ',' || c == ';' ||c == '=' || + c == '/' || c == '?' || c == '#' || c == '@' ||c == '%') + *d++ = c; + else if(c == 'u' || c == 'U') { + size_t ulen = (c == 'u') ? 4 : 8; + unsigned long unichar = 0; + int n; + int unichar_width; + size_t ii; + + s++; i++; + if(i+ulen > len) { + error_handler(error_data, + "Turtle name error - \\%c over end of line", c); + return 0; + } + + for(ii = 0; ii < ulen; ii++) { + char cc = s[ii]; + if(!isxdigit(RAPTOR_GOOD_CAST(char, cc))) { + error_handler(error_data, + "Turtle name error - illegal hex digit %c in Unicode escape '%c%s...'", + cc, c, s); + return 0; + } + } + + n = sscanf((const char*)s, ((ulen == 4) ? "%04lx" : "%08lx"), &unichar); + if(n != 1) { + error_handler(error_data, + "Turtle name error - illegal Uncode escape '%c%s...'", + c, s); + return 0; + } + + s+= ulen-1; + i+= ulen-1; + + if(unichar > raptor_unicode_max_codepoint) { + error_handler(error_data, + "Turtle name error - illegal Unicode character with code point #x%lX (max #x%lX).", + unichar, raptor_unicode_max_codepoint); + return 0; + } + + unichar_width = raptor_unicode_utf8_string_put_char(unichar, d, + len - (d-name)); + if(unichar_width < 0) { + error_handler(error_data, + "Turtle name error - illegal Unicode character with code point #x%lX.", + unichar); + return 0; + } + d += (size_t)unichar_width; + + } else { + /* don't handle \x where x isn't one of: \t \n \r \\ (delim) */ + error_handler(error_data, + "Turtle name error - illegal escape \\%c (#x%02X) in \"%s\"", + c, c, name); + } + } else + *d++ = c; + } + *d='\0'; + + /* calculate output string size */ + len = d - name; + + /* string gets owned by the stringbuffer after this */ + return len; +} diff --git a/src/turtle_common.h b/src/turtle_common.h new file mode 100644 index 0000000..b869eba --- /dev/null +++ b/src/turtle_common.h @@ -0,0 +1,98 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * turtle_common.h - Turtle lexer/parser shared internals + * + * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + +#ifndef TURTLE_COMMON_H +#define TURTLE_COMMON_H + +#ifdef __cplusplus +extern "C" { +#endif + + +/* turtle_parser.y */ +RAPTOR_INTERNAL_API int turtle_syntax_error(raptor_parser *rdf_parser, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); +RAPTOR_INTERNAL_API raptor_uri* turtle_qname_to_uri(raptor_parser *rdf_parser, unsigned char *name, size_t name_len); +RAPTOR_INTERNAL_API size_t raptor_turtle_expand_qname_escapes(unsigned char *name, size_t len, raptor_simple_message_handler error_handler, void *error_data); + +/* turtle_lexer.l */ +extern void turtle_token_free(raptor_world* world, int token, TURTLE_PARSER_STYPE *lval); + + +/* + * Turtle parser object + */ +struct raptor_turtle_parser_s { + /* buffer */ + char *buffer; + + /* buffer length */ + size_t buffer_length; + + raptor_namespace_stack namespaces; /* static */ + + /* for lexer to store result in */ + TURTLE_PARSER_STYPE lval; + + /* STATIC lexer */ + yyscan_t scanner; + + int scanner_set; + + int lineno; + int lineno_last_good; + + /* for the chunk parser, how much of the input has been consumed */ + size_t consumed; + /* likewise, how much of the input has been successfully processed */ + size_t processed; + /* indicates what can be processed at most */ + size_t consumable; + /* real end-of-buffer indicator, as we kill the last line */ + size_t end_of_buffer; + + /* a sequence holding deferred statements */ + raptor_sequence *deferred; + + /* for creating long literals */ + raptor_stringbuffer* sb; + + /* count of errors in current parse */ + int error_count; + + /* TRIG graph name */ + raptor_term* graph_name; + + /* Allow TRIG extensions */ + int trig; + + /* Last run of many */ + int is_end; +}; + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/turtle_lexer.c b/src/turtle_lexer.c new file mode 100644 index 0000000..ee28f5e --- /dev/null +++ b/src/turtle_lexer.c @@ -0,0 +1,3532 @@ +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#line 6 "turtle_lexer.c" + +#line 8 "turtle_lexer.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define turtle_lexer__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer turtle_lexer__create_buffer +#endif + +#ifdef yy_delete_buffer +#define turtle_lexer__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer turtle_lexer__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define turtle_lexer__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer turtle_lexer__scan_buffer +#endif + +#ifdef yy_scan_string +#define turtle_lexer__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string turtle_lexer__scan_string +#endif + +#ifdef yy_scan_bytes +#define turtle_lexer__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes turtle_lexer__scan_bytes +#endif + +#ifdef yy_init_buffer +#define turtle_lexer__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer turtle_lexer__init_buffer +#endif + +#ifdef yy_flush_buffer +#define turtle_lexer__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer turtle_lexer__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define turtle_lexer__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state turtle_lexer__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define turtle_lexer__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer turtle_lexer__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define turtle_lexer_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state turtle_lexer_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define turtle_lexer_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state turtle_lexer_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define turtle_lexer_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack turtle_lexer_ensure_buffer_stack +#endif + +#ifdef yylex +#define turtle_lexer_lex_ALREADY_DEFINED +#else +#define yylex turtle_lexer_lex +#endif + +#ifdef yyrestart +#define turtle_lexer_restart_ALREADY_DEFINED +#else +#define yyrestart turtle_lexer_restart +#endif + +#ifdef yylex_init +#define turtle_lexer_lex_init_ALREADY_DEFINED +#else +#define yylex_init turtle_lexer_lex_init +#endif + +#ifdef yylex_init_extra +#define turtle_lexer_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra turtle_lexer_lex_init_extra +#endif + +#ifdef yylex_destroy +#define turtle_lexer_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy turtle_lexer_lex_destroy +#endif + +#ifdef yyget_debug +#define turtle_lexer_get_debug_ALREADY_DEFINED +#else +#define yyget_debug turtle_lexer_get_debug +#endif + +#ifdef yyset_debug +#define turtle_lexer_set_debug_ALREADY_DEFINED +#else +#define yyset_debug turtle_lexer_set_debug +#endif + +#ifdef yyget_extra +#define turtle_lexer_get_extra_ALREADY_DEFINED +#else +#define yyget_extra turtle_lexer_get_extra +#endif + +#ifdef yyset_extra +#define turtle_lexer_set_extra_ALREADY_DEFINED +#else +#define yyset_extra turtle_lexer_set_extra +#endif + +#ifdef yyget_in +#define turtle_lexer_get_in_ALREADY_DEFINED +#else +#define yyget_in turtle_lexer_get_in +#endif + +#ifdef yyset_in +#define turtle_lexer_set_in_ALREADY_DEFINED +#else +#define yyset_in turtle_lexer_set_in +#endif + +#ifdef yyget_out +#define turtle_lexer_get_out_ALREADY_DEFINED +#else +#define yyget_out turtle_lexer_get_out +#endif + +#ifdef yyset_out +#define turtle_lexer_set_out_ALREADY_DEFINED +#else +#define yyset_out turtle_lexer_set_out +#endif + +#ifdef yyget_leng +#define turtle_lexer_get_leng_ALREADY_DEFINED +#else +#define yyget_leng turtle_lexer_get_leng +#endif + +#ifdef yyget_text +#define turtle_lexer_get_text_ALREADY_DEFINED +#else +#define yyget_text turtle_lexer_get_text +#endif + +#ifdef yyget_lineno +#define turtle_lexer_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno turtle_lexer_get_lineno +#endif + +#ifdef yyset_lineno +#define turtle_lexer_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno turtle_lexer_set_lineno +#endif + +#ifdef yyget_column +#define turtle_lexer_get_column_ALREADY_DEFINED +#else +#define yyget_column turtle_lexer_get_column +#endif + +#ifdef yyset_column +#define turtle_lexer_set_column_ALREADY_DEFINED +#else +#define yyset_column turtle_lexer_set_column +#endif + +#ifdef yywrap +#define turtle_lexer_wrap_ALREADY_DEFINED +#else +#define yywrap turtle_lexer_wrap +#endif + +#ifdef yyget_lval +#define turtle_lexer_get_lval_ALREADY_DEFINED +#else +#define yyget_lval turtle_lexer_get_lval +#endif + +#ifdef yyset_lval +#define turtle_lexer_set_lval_ALREADY_DEFINED +#else +#define yyset_lval turtle_lexer_set_lval +#endif + +#ifdef yyalloc +#define turtle_lexer_alloc_ALREADY_DEFINED +#else +#define yyalloc turtle_lexer_alloc +#endif + +#ifdef yyrealloc +#define turtle_lexer_realloc_ALREADY_DEFINED +#else +#define yyrealloc turtle_lexer_realloc +#endif + +#ifdef yyfree +#define turtle_lexer_free_ALREADY_DEFINED +#else +#define yyfree turtle_lexer_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include <inttypes.h> +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an + * integer in range [0..255] for use as an array index. + */ +#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yyg->yy_start = 1 + 2 * +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yyg->yy_start - 1) / 2) +#define YYSTATE YY_START +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin , yyscanner ) +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) + +/* Return all but the first "n" matched characters back to the input stream. */ +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) +#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + * + * Returns the top of the stack, or NULL. + */ +#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +static void yyensure_buffer_stack ( yyscan_t yyscanner ); +static void yy_load_buffer_state ( yyscan_t yyscanner ); +static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner ); +#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner) + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) + +/* Begin user sect3 */ +typedef flex_uint8_t YY_CHAR; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state ( yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner); +static int yy_get_next_buffer ( yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; +#define YY_NUM_RULES 46 +#define YY_END_OF_BUFFER 47 +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static const flex_int16_t yy_accept[162] = + { 0, + 0, 0, 0, 0, 24, 24, 28, 28, 47, 45, + 2, 1, 1, 45, 44, 45, 14, 15, 45, 5, + 4, 34, 31, 6, 45, 45, 45, 45, 45, 7, + 8, 45, 45, 3, 45, 45, 16, 17, 38, 35, + 37, 38, 24, 24, 24, 25, 28, 28, 28, 29, + 2, 1, 0, 20, 0, 44, 43, 43, 0, 21, + 0, 0, 34, 32, 0, 0, 0, 0, 31, 0, + 0, 40, 0, 41, 0, 42, 42, 42, 0, 0, + 31, 0, 0, 13, 0, 0, 0, 35, 0, 0, + 36, 24, 24, 0, 0, 28, 28, 0, 0, 20, + + 22, 21, 26, 0, 32, 0, 0, 33, 0, 0, + 31, 0, 0, 0, 0, 0, 39, 0, 0, 42, + 42, 42, 0, 0, 30, 0, 0, 23, 27, 0, + 33, 0, 33, 0, 0, 0, 0, 42, 42, 12, + 0, 30, 0, 0, 18, 0, 0, 11, 42, 0, + 19, 0, 0, 42, 10, 0, 9, 0, 0, 0, + 0 + } ; + +static const YY_CHAR yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 2, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 5, 6, 7, 5, 8, 5, 9, 10, + 11, 5, 12, 13, 14, 15, 5, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 17, 18, 19, + 20, 21, 5, 22, 23, 24, 25, 25, 26, 27, + 28, 28, 29, 28, 28, 28, 28, 28, 28, 30, + 28, 31, 32, 28, 33, 28, 28, 34, 28, 28, + 35, 36, 37, 38, 39, 1, 40, 41, 25, 25, + + 42, 43, 28, 28, 44, 28, 28, 45, 28, 28, + 28, 46, 28, 47, 48, 49, 50, 28, 28, 51, + 28, 28, 52, 1, 53, 5, 54, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, + 55, 55, 55, 55, 55 + } ; + +static const YY_CHAR yy_meta[56] = + { 0, + 1, 2, 3, 3, 4, 5, 4, 6, 7, 4, + 4, 4, 4, 8, 9, 10, 11, 4, 1, 6, + 12, 4, 13, 13, 13, 13, 13, 14, 14, 14, + 14, 14, 14, 14, 12, 15, 12, 1, 16, 13, + 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, + 14, 2, 1, 12, 17 + } ; + +static const flex_int16_t yy_base[195] = + { 0, + 0, 0, 55, 0, 108, 109, 110, 113, 568, 620, + 559, 620, 553, 111, 117, 114, 620, 620, 109, 620, + 538, 111, 128, 620, 97, 88, 123, 137, 124, 620, + 620, 515, 523, 141, 142, 146, 620, 620, 620, 519, + 620, 150, 132, 139, 508, 163, 140, 148, 502, 169, + 502, 620, 156, 495, 0, 170, 620, 481, 161, 443, + 0, 402, 170, 163, 165, 186, 206, 0, 212, 215, + 0, 620, 167, 219, 154, 0, 339, 314, 184, 196, + 226, 218, 221, 620, 0, 225, 226, 353, 234, 237, + 620, 221, 241, 250, 343, 252, 256, 222, 325, 620, + + 620, 620, 620, 267, 249, 268, 302, 297, 0, 0, + 291, 270, 0, 283, 294, 298, 620, 0, 0, 0, + 256, 261, 290, 293, 274, 300, 309, 620, 620, 253, + 252, 245, 244, 0, 326, 0, 0, 203, 194, 304, + 308, 191, 175, 316, 323, 0, 0, 0, 139, 330, + 324, 0, 0, 77, 327, 0, 0, 0, 0, 0, + 620, 381, 398, 415, 432, 449, 465, 479, 181, 489, + 499, 516, 533, 299, 549, 563, 572, 579, 343, 344, + 593, 349, 350, 602, 355, 356, 357, 361, 362, 363, + 367, 459, 460, 464 + + } ; + +static const flex_int16_t yy_def[195] = + { 0, + 161, 1, 161, 3, 162, 162, 163, 163, 161, 161, + 161, 161, 161, 164, 165, 166, 161, 161, 161, 161, + 161, 161, 167, 161, 168, 169, 170, 170, 170, 161, + 161, 161, 161, 170, 170, 170, 161, 161, 161, 161, + 161, 171, 172, 172, 161, 172, 173, 173, 161, 173, + 161, 161, 164, 161, 164, 165, 161, 161, 166, 161, + 166, 161, 161, 161, 161, 161, 161, 174, 175, 161, + 176, 161, 168, 161, 161, 177, 177, 177, 170, 170, + 167, 170, 170, 161, 178, 170, 170, 161, 171, 171, + 161, 172, 172, 172, 161, 173, 173, 173, 161, 161, + + 161, 161, 161, 161, 161, 161, 161, 161, 179, 180, + 175, 111, 181, 161, 161, 161, 161, 182, 183, 177, + 177, 177, 170, 170, 184, 170, 170, 161, 161, 161, + 161, 161, 161, 185, 161, 186, 187, 177, 177, 170, + 170, 184, 184, 170, 170, 188, 189, 177, 177, 170, + 170, 190, 191, 177, 170, 192, 177, 193, 194, 191, + 0, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161 + + } ; + +static const flex_int16_t yy_nxt[676] = + { 0, + 10, 11, 12, 13, 10, 14, 15, 10, 16, 17, + 18, 19, 20, 19, 21, 22, 23, 24, 25, 10, + 10, 26, 27, 28, 27, 27, 27, 27, 27, 29, + 27, 27, 27, 27, 30, 10, 31, 32, 33, 34, + 28, 27, 35, 27, 27, 29, 27, 27, 36, 27, + 27, 37, 38, 10, 27, 39, 40, 39, 39, 39, + 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, + 39, 41, 39, 39, 39, 39, 39, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 39, + 39, 39, 39, 39, 42, 42, 42, 42, 42, 42, + + 42, 42, 42, 42, 42, 42, 39, 39, 39, 42, + 44, 44, 48, 45, 45, 48, 54, 74, 49, 57, + 58, 49, 60, 62, 63, 65, 63, 157, 77, 67, + 67, 67, 75, 78, 93, 68, 66, 80, 80, 81, + 81, 93, 97, 46, 46, 50, 55, 70, 50, 61, + 97, 80, 66, 81, 83, 80, 80, 81, 81, 82, + 80, 100, 81, 71, 90, 161, 91, 94, 92, 102, + 83, 161, 57, 58, 94, 98, 82, 96, 64, 72, + 105, 86, 154, 98, 65, 63, 118, 74, 104, 143, + 106, 55, 87, 76, 76, 66, 61, 107, 80, 107, + + 81, 108, 75, 119, 104, 143, 106, 67, 67, 67, + 80, 66, 161, 67, 67, 67, 114, 114, 114, 110, + 115, 115, 115, 93, 161, 70, 112, 67, 67, 67, + 96, 70, 80, 68, 81, 80, 149, 81, 116, 80, + 80, 81, 81, 93, 148, 70, 124, 113, 90, 123, + 91, 90, 161, 161, 97, 92, 94, 72, 97, 133, + 133, 71, 124, 72, 105, 123, 72, 131, 131, 126, + 117, 161, 161, 161, 106, 127, 94, 72, 130, 132, + 130, 132, 131, 133, 114, 114, 114, 98, 143, 161, + 106, 98, 67, 67, 67, 115, 115, 115, 110, 135, + + 135, 135, 139, 138, 80, 112, 81, 80, 109, 81, + 70, 109, 108, 116, 80, 140, 81, 108, 80, 141, + 81, 161, 80, 80, 81, 81, 113, 135, 135, 135, + 80, 140, 81, 129, 72, 141, 150, 80, 80, 81, + 81, 80, 72, 81, 80, 117, 81, 144, 128, 117, + 145, 150, 69, 134, 88, 69, 134, 151, 136, 137, + 122, 136, 137, 155, 111, 146, 147, 111, 146, 147, + 152, 153, 156, 152, 153, 156, 73, 117, 121, 73, + 155, 43, 43, 43, 43, 43, 43, 43, 43, 43, + 43, 43, 43, 43, 43, 43, 43, 43, 47, 47, + + 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 47, 47, 47, 47, 47, 53, 53, 64, 53, 53, + 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 56, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 59, + 59, 103, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 69, 69, 158, 159, + 69, 158, 159, 160, 69, 69, 160, 69, 69, 69, + 69, 69, 73, 57, 73, 73, 73, 73, 73, 73, + 73, 73, 73, 73, 73, 73, 79, 79, 79, 79, + + 101, 79, 79, 51, 79, 79, 89, 89, 89, 89, + 99, 89, 89, 95, 89, 89, 92, 92, 92, 92, + 88, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 92, 92, 92, 96, 96, 96, 96, 96, 96, 85, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 111, 111, 84, 64, 111, 52, 111, 111, 111, 111, + 51, 111, 111, 111, 111, 111, 69, 161, 69, 69, + 69, 69, 161, 161, 161, 161, 161, 161, 69, 120, + 161, 120, 161, 161, 120, 120, 161, 120, 125, 161, + 161, 125, 125, 161, 125, 125, 111, 161, 111, 111, + + 111, 111, 161, 161, 161, 161, 161, 161, 111, 142, + 142, 142, 161, 161, 142, 142, 161, 142, 142, 9, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161 + } ; + +static const flex_int16_t yy_chk[676] = + { 0, + 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, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 5, 6, 7, 5, 6, 8, 14, 25, 7, 15, + 15, 8, 16, 19, 19, 22, 22, 154, 26, 23, + 23, 23, 25, 26, 43, 23, 22, 27, 29, 27, + 29, 44, 47, 5, 6, 7, 14, 23, 8, 16, + 48, 28, 22, 28, 29, 34, 35, 34, 35, 28, + 36, 53, 36, 23, 42, 46, 42, 43, 46, 59, + 29, 50, 56, 56, 44, 47, 28, 50, 64, 23, + 65, 35, 149, 48, 63, 63, 75, 73, 64, 143, + 65, 53, 36, 169, 169, 63, 59, 66, 79, 66, + + 79, 66, 73, 75, 64, 142, 65, 67, 67, 67, + 80, 63, 80, 69, 69, 69, 70, 70, 70, 69, + 74, 74, 74, 92, 98, 67, 69, 81, 81, 81, + 98, 69, 82, 81, 82, 83, 139, 83, 74, 86, + 87, 86, 87, 93, 138, 81, 83, 69, 89, 82, + 89, 90, 94, 90, 96, 94, 92, 67, 97, 133, + 132, 81, 83, 69, 105, 82, 70, 131, 130, 86, + 74, 112, 112, 112, 105, 87, 93, 81, 104, 106, + 104, 106, 104, 106, 114, 114, 114, 96, 125, 112, + 105, 97, 111, 111, 111, 115, 115, 115, 111, 116, + + 116, 116, 122, 121, 123, 111, 123, 124, 174, 124, + 111, 174, 108, 115, 126, 123, 126, 107, 140, 124, + 140, 112, 141, 127, 141, 127, 111, 135, 135, 135, + 144, 123, 144, 99, 114, 124, 141, 145, 151, 145, + 151, 155, 111, 155, 150, 115, 150, 126, 95, 116, + 127, 141, 179, 180, 88, 179, 180, 144, 182, 183, + 78, 182, 183, 150, 185, 186, 187, 185, 186, 187, + 188, 189, 190, 188, 189, 190, 191, 135, 77, 191, + 150, 162, 162, 162, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 162, 163, 163, + + 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, + 163, 163, 163, 163, 163, 164, 164, 62, 164, 164, + 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, + 164, 164, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 166, + 166, 60, 166, 166, 166, 166, 166, 166, 166, 166, + 166, 166, 166, 166, 166, 166, 167, 167, 192, 193, + 167, 192, 193, 194, 167, 167, 194, 167, 167, 167, + 167, 167, 168, 58, 168, 168, 168, 168, 168, 168, + 168, 168, 168, 168, 168, 168, 170, 170, 170, 170, + + 54, 170, 170, 51, 170, 170, 171, 171, 171, 171, + 49, 171, 171, 45, 171, 171, 172, 172, 172, 172, + 40, 172, 172, 172, 172, 172, 172, 172, 172, 172, + 172, 172, 172, 173, 173, 173, 173, 173, 173, 33, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 175, 175, 32, 21, 175, 13, 175, 175, 175, 175, + 11, 175, 175, 175, 175, 175, 176, 9, 176, 176, + 176, 176, 0, 0, 0, 0, 0, 0, 176, 177, + 0, 177, 0, 0, 177, 177, 0, 177, 178, 0, + 0, 178, 178, 0, 178, 178, 181, 0, 181, 181, + + 181, 181, 0, 0, 0, 0, 0, 0, 181, 184, + 184, 184, 0, 0, 184, 184, 0, 184, 184, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161 + } ; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +#line 1 "./turtle_lexer.l" +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * turtle_lexer.l - Raptor Turtle lexer - making tokens for turtle grammar generator + * + * Copyright (C) 2003-2013, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + * Turtle is defined in http://www.dajobe.org/2004/01/turtle/ + * + * To generate the C files from this source, rather than use the + * shipped turtle_lexer.c/.h needs a patched version of flex 2.5.31 such + * as the one available in Debian GNU/Linux. Details below + * near the %option descriptions. + * + */ +/* recognise 8-bits */ +/* all symbols prefixed by this */ +/* This is not needed, flex is invoked -oturtle_lexer.c */ +/* %option outfile="turtle_lexer.c" */ +/* Emit a C header file for prototypes + * Only available in flex 2.5.13 or newer. + * It was renamed to header-file in flex 2.5.19 + */ +/* Do not emit #include <unistd.h> + * Only available in flex 2.5.7 or newer. + * Broken in flex 2.5.31 without patches. + */ +#define YY_NO_UNISTD_H 1 +/* Never interactive */ +/* No isatty() check */ +/* Batch scanner */ +/* Never use yyunput */ +/* Supply our own alloc/realloc/free functions */ +/* Re-entrant scanner */ +/* Makes yyget_lval() yyset_lval() and yylval appear */ +/* Makes yyget_lloc() yyset_lloc() and yylloc appear */ +/* %option bison-locations */ +#line 79 "./turtle_lexer.l" + /* definitions */ + +/* NOTE: These headers are NOT included here but are inserted by + * fix-flex since otherwise it appears far too late in the generated C + */ + +/* +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif +*/ + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_SETJMP_H +#include <setjmp.h> +#endif + +#include "raptor2.h" +#include "raptor_internal.h" + +#include <turtle_parser.h> +#include <turtle_common.h> + +#define YYSTYPE TURTLE_PARSER_STYPE + +/* Prototypes */ +static unsigned char *turtle_copy_token(unsigned char *text, size_t len); +static unsigned char *turtle_copy_string_token(raptor_parser* rdf_parser, unsigned char *text, size_t len, int delim); +void turtle_lexer_syntax_error(void* ctx, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +#ifdef RAPTOR_DEBUG +const char * turtle_token_print(raptor_world* world, int token, YYSTYPE *lval); +#endif + +#ifdef __cplusplus +#define INPUT_FN yyinput +#else +#define INPUT_FN input +#endif + + +#if FLEX_VERSION_DECIMAL < 20536 +/* debian flex 2.5.35-10.1 added these column header prototypes in + * re-entrant mode. standard flex omits them + */ +void turtle_lexer_set_column(int column_no, yyscan_t yyscanner); +int turtle_lexer_get_column(yyscan_t yyscanner); +#endif + +static void turtle_lexer_cleanup(yyscan_t yyscanner); +#undef yycleanup +#define yycleanup turtle_lexer_cleanup + +#ifdef HAVE_SETJMP +static jmp_buf turtle_lexer_fatal_error_longjmp_env; + +/* fatal error handler declaration */ +#define YY_FATAL_ERROR(msg) do { \ + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_FATAL, msg); \ + longjmp(turtle_lexer_fatal_error_longjmp_env, 1); \ +} while(0) +#else +#define YY_FATAL_ERROR(msg) do { \ + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_FATAL, msg); \ + abort(); \ +} while(0) +#endif + +/* Remove the re-fill function since it should never be called */ +#define YY_INPUT(buf,result,max_size) { return YY_NULL; } + +static void turtle_lexer_error(yyscan_t yyscanner, raptor_log_level level, yyconst char *message, ...) RAPTOR_PRINTF_FORMAT(3, 4); + +/* Fatal error handler that returns EOF instead of abort()/longjmp() + * so that parser can clean up properly */ +#define YY_FATAL_ERROR_EOF(msg) do { \ + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_FATAL, "%s", msg); \ + yyterminate(); \ +} while(0) + +/* Out-of-memory reporting macro */ +#define TURTLE_LEXER_OOM() YY_FATAL_ERROR_EOF(turtle_lexer_oom_text) +static char turtle_lexer_oom_text[]="turtle_lexer: Out of memory"; + +/* Do not need input() to to read from stdin */ +#define YY_NO_INPUT 1 + +#define YY_USER_ACTION \ + turtle_parser->consumed += yyleng; + +#line 1006 "turtle_lexer.c" +/* Tokens from Turtle 2013 spec - lex-ifyed to remove unicode ranges */ +/* flex: only 1 level of definition expansion so have to expand PLX */ + +#line 1010 "turtle_lexer.c" + +#define INITIAL 0 +#define PREF 1 +#define LONG_DLITERAL 2 +#define LONG_SLITERAL 3 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#ifndef YY_NO_UNISTD_H +#include <unistd.h> +#endif +#endif + +#define YY_EXTRA_TYPE raptor_parser* + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + YYSTYPE * yylval_r; + + }; /* end struct yyguts_t */ + +static int yy_init_globals ( yyscan_t yyscanner ); + + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); + +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput ( yyscan_t yyscanner ); +#else +static int input ( yyscan_t yyscanner ); +#endif + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Copy whatever the last rule matched to the standard output. */ +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + int n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) +#endif + +/* end tables serialization structures and prototypes */ + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex \ + (YYSTYPE * yylval_param , yyscan_t yyscanner); + +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param , yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK /*LINTED*/break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +/** The main scanner function which does all the work. + */ +YY_DECL +{ + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yylval = yylval_param; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_load_buffer_state( yyscanner ); + } + + { +#line 209 "./turtle_lexer.l" + +#line 211 "./turtle_lexer.l" + /* rules */ + + + raptor_parser *rdf_parser = yyextra; + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + +#ifdef HAVE_SETJMP + if(setjmp(turtle_lexer_fatal_error_longjmp_env)) + return 1; +#endif + + + +#line 1301 "turtle_lexer.c" + + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yyg->yy_start; +yy_match: + do + { + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + 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 >= 162 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + ++yy_cp; + } + while ( yy_current_state != 161 ); + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + + YY_DO_BEFORE_ACTION; + +do_action: /* This label is used only to access EOF actions. */ + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +/* rule 1 can match eol */ +YY_RULE_SETUP +#line 224 "./turtle_lexer.l" +{ turtle_parser->lineno++; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 226 "./turtle_lexer.l" +{ /* empty */ } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 229 "./turtle_lexer.l" +{ return A; } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 231 "./turtle_lexer.l" +{ return DOT; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 232 "./turtle_lexer.l" +{ return COMMA; } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 233 "./turtle_lexer.l" +{ return SEMICOLON; } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 234 "./turtle_lexer.l" +{ return LEFT_SQUARE; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 235 "./turtle_lexer.l" +{ return RIGHT_SQUARE; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 236 "./turtle_lexer.l" +{ BEGIN(PREF); return PREFIX; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 237 "./turtle_lexer.l" +{ BEGIN(PREF); + return SPARQL_PREFIX; } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 239 "./turtle_lexer.l" +{ return BASE; } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 240 "./turtle_lexer.l" +{ return SPARQL_BASE; } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 241 "./turtle_lexer.l" +{ return HAT; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 242 "./turtle_lexer.l" +{ return LEFT_ROUND; } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 243 "./turtle_lexer.l" +{ return RIGHT_ROUND; } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 244 "./turtle_lexer.l" +{ return LEFT_CURLY; } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 245 "./turtle_lexer.l" +{ return RIGHT_CURLY; } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 246 "./turtle_lexer.l" +{ return TRUE_TOKEN; } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 247 "./turtle_lexer.l" +{ return FALSE_TOKEN; } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 250 "./turtle_lexer.l" +{ yylval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ + if(!yylval->string) + yyterminate(); + + return STRING_LITERAL; } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 256 "./turtle_lexer.l" +{ yylval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ + if(!yylval->string) + yyterminate(); + + return STRING_LITERAL; } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 262 "./turtle_lexer.l" +{ BEGIN(LONG_DLITERAL); + turtle_parser->sb = raptor_new_stringbuffer(); + if(!turtle_parser->sb) + TURTLE_LEXER_OOM(); + } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 268 "./turtle_lexer.l" +{ + size_t len; + + BEGIN(INITIAL); + len = raptor_stringbuffer_length(turtle_parser->sb); + yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!yylval->string) + TURTLE_LEXER_OOM(); + raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)yylval->string, len); + yylval->string[len]='\0'; + + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + return STRING_LITERAL; } + YY_BREAK +case 24: +/* rule 24 can match eol */ +YY_RULE_SETUP +#line 283 "./turtle_lexer.l" +{ + char *p; + + if(*yytext == EOF) { + BEGIN(INITIAL); + turtle_syntax_error(rdf_parser, "End of file in middle of literal"); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + return EOF; + } + + for(p = yytext; *p; p++) { + if(*p == '\n') + turtle_parser->lineno++; + } + + if(raptor_stringbuffer_append_turtle_string(turtle_parser->sb, (unsigned char*)yytext, yyleng, '"', (raptor_simple_message_handler)turtle_lexer_syntax_error, rdf_parser, 0)) { /* " */ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + YY_FATAL_ERROR_EOF("raptor_stringbuffer_append_turtle_string failed"); + } + + } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 308 "./turtle_lexer.l" +{ + /* this should only happen if \ is at the end of the file so the Turtle doc is illegal anyway */ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + turtle_syntax_error(rdf_parser, "End of file in middle of \"\"\"literal\"\"\""); + yyterminate(); +} + YY_BREAK +case YY_STATE_EOF(LONG_DLITERAL): +#line 317 "./turtle_lexer.l" +{ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + if(!turtle_parser->is_end) { + /* next run will fix things, hopefully */ + return EOF; + } + /* otherwise abort */ + turtle_syntax_error(rdf_parser, "End of file in middle of \"\"\"literal\"\"\""); + yyterminate(); +} + YY_BREAK +case 26: +YY_RULE_SETUP +#line 330 "./turtle_lexer.l" +{ BEGIN(LONG_SLITERAL); + turtle_parser->sb = raptor_new_stringbuffer(); + if(!turtle_parser->sb) + TURTLE_LEXER_OOM(); + } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 336 "./turtle_lexer.l" +{ + size_t len; + + BEGIN(INITIAL); + len = raptor_stringbuffer_length(turtle_parser->sb); + yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!yylval->string) + TURTLE_LEXER_OOM(); + raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)yylval->string, len); + yylval->string[len]='\0'; + + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + return STRING_LITERAL; } + YY_BREAK +case 28: +/* rule 28 can match eol */ +YY_RULE_SETUP +#line 351 "./turtle_lexer.l" +{ + char *p; + + if(*yytext == EOF) { + BEGIN(INITIAL); + turtle_syntax_error(rdf_parser, "End of file in middle of \'\'\'literal\'\'\'"); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + return EOF; + } + + for(p = yytext; *p; p++) { + if(*p == '\n') + turtle_parser->lineno++; + } + + if(raptor_stringbuffer_append_turtle_string(turtle_parser->sb, (unsigned char*)yytext, yyleng, '"', (raptor_simple_message_handler)turtle_lexer_syntax_error, rdf_parser, 0)) { /* " */ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + YY_FATAL_ERROR_EOF("raptor_stringbuffer_append_turtle_string failed"); + } + + } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 376 "./turtle_lexer.l" +{ + /* this should only happen if \ is at the end of the file so the Turtle doc is illegal anyway */ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + turtle_syntax_error(rdf_parser, "End of file in middle of '''literal'''"); + yyterminate(); +} + YY_BREAK +case YY_STATE_EOF(LONG_SLITERAL): +#line 385 "./turtle_lexer.l" +{ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + if(!turtle_parser->is_end) { + /* next run will fix things, hopefully */ + return EOF; + } + /* otherwise abort */ + turtle_syntax_error(rdf_parser, "End of file in middle of '''literal'''"); + yyterminate(); +} + YY_BREAK +case 30: +YY_RULE_SETUP +#line 398 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext+2, yyleng-2); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return BLANK_LITERAL; } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 403 "./turtle_lexer.l" +{ yylval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); + if(!yylval->uri) { + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_ERROR, "Failed to convert qname %s to URI", yytext); + yyterminate(); + } + + return QNAME_LITERAL; } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 411 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return DECIMAL_LITERAL; +} + YY_BREAK +case 33: +YY_RULE_SETUP +#line 417 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return FLOATING_LITERAL; +} + YY_BREAK +case 34: +YY_RULE_SETUP +#line 423 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return INTEGER_LITERAL; } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 428 "./turtle_lexer.l" +{ /* eat up leading whitespace */ } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 429 "./turtle_lexer.l" +{ yylval->string=turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + BEGIN(INITIAL); + return IDENTIFIER; } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 434 "./turtle_lexer.l" +{ BEGIN(INITIAL); + yylval->string = turtle_copy_token((unsigned char*)yytext, 0); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return IDENTIFIER; } + YY_BREAK +case 38: +/* rule 38 can match eol */ +YY_RULE_SETUP +#line 440 "./turtle_lexer.l" +{ BEGIN(INITIAL); + if(*yytext == EOF) + return EOF; + + turtle_syntax_error(rdf_parser, "syntax error at '%c'", *yytext); + yyterminate(); } + YY_BREAK +case 39: +/* rule 39 can match eol */ +YY_RULE_SETUP +#line 448 "./turtle_lexer.l" +{ + raptor_stringbuffer* sb; + unsigned char* uri_string; + + /* make length just the IRI */ + while(yytext[yyleng - 1] != '>') + yyleng--; + + sb = raptor_new_stringbuffer(); + if(!sb) + TURTLE_LEXER_OOM(); + + /* start at yytext + 1 to skip '<' and operate over + * length-2 bytes to skip '<' and '>' + */ + if(raptor_stringbuffer_append_turtle_string(sb, (unsigned char*)yytext+1, yyleng-2, '>', (raptor_simple_message_handler)turtle_lexer_syntax_error, rdf_parser, 1)) { + raptor_free_stringbuffer(sb); + YY_FATAL_ERROR_EOF("raptor_stringbuffer_append_turtle_string failed"); + } + uri_string = raptor_stringbuffer_as_string(sb); + + if(!*uri_string) + yylval->uri = raptor_uri_copy(rdf_parser->base_uri); + else + yylval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); + + raptor_free_stringbuffer(sb); + + if(!yylval->uri) + TURTLE_LEXER_OOM(); + return GRAPH_NAME_LEFT_CURLY; } + YY_BREAK +case 40: +/* rule 40 can match eol */ +YY_RULE_SETUP +#line 480 "./turtle_lexer.l" +{ + while(1) { + int c = yytext[yyleng - 1]; + if(c == '{' || c == ' ' || c=='\t' || c == '\v' || c == '\n' || + c == '=') { + yyleng--; + } else + break; + } + yytext[yyleng] = '\0'; + + yylval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); + if(!yylval->uri) { + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_ERROR, "Failed to convert qname %s to URI", yytext); + yyterminate(); + } + + return GRAPH_NAME_LEFT_CURLY; } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 499 "./turtle_lexer.l" +{ if(yyleng == 2) + yylval->uri = raptor_uri_copy(rdf_parser->base_uri); + else { + raptor_stringbuffer* sb; + unsigned char* uri_string; + + yytext[yyleng-1]='\0'; + sb = raptor_new_stringbuffer(); + if(!sb) + TURTLE_LEXER_OOM(); + if(raptor_stringbuffer_append_turtle_string(sb, (unsigned char*)yytext+1, yyleng-1, '>', (raptor_simple_message_handler)turtle_lexer_syntax_error, rdf_parser, 1)) { + raptor_free_stringbuffer(sb); + YY_FATAL_ERROR_EOF("raptor_stringbuffer_append_turtle_string failed"); + } + uri_string = raptor_stringbuffer_as_string(sb); + yylval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); + if(!yylval->uri) { + raptor_free_stringbuffer(sb); + TURTLE_LEXER_OOM(); + } + raptor_free_stringbuffer(sb); + } + return URI_LITERAL; } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 523 "./turtle_lexer.l" +{ yylval->string = turtle_copy_token((unsigned char*)yytext+1, yyleng-1); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return LANGTAG; } + YY_BREAK +case 43: +/* rule 43 can match eol */ +YY_RULE_SETUP +#line 528 "./turtle_lexer.l" +{ /* # comment */ + turtle_parser->lineno++; + } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 532 "./turtle_lexer.l" +{ /* # comment on the last line with no terminating newline */ + } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 535 "./turtle_lexer.l" +{ if(*yytext == EOF) + return EOF; + + turtle_syntax_error(rdf_parser, "syntax error at '%c'", *yytext); + yyterminate(); + } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 542 "./turtle_lexer.l" +YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK +#line 1837 "turtle_lexer.c" +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(PREF): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap( yyscanner ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of user's declarations */ +} /* end of yylex */ + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ +static int yy_get_next_buffer (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1); + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; + + else + { + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; + + int yy_c_buf_p_offset = + (int) (yyg->yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc( (void *) b->yy_ch_buf, + (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = NULL; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; + + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + yyg->yy_n_chars, num_to_read ); + + + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin , yyscanner); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( + (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + /* "- 2" to take care of EOB's */ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + + return ret_val; +} + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + + static yy_state_type yy_get_previous_state (yyscan_t yyscanner) +{ + yy_state_type yy_current_state; + char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + 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 >= 162 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + } + + return yy_current_state; +} + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) +{ + int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + char *yy_cp = yyg->yy_c_buf_p; + + YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->yy_last_accepting_cpos = yy_cp; + } + 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 >= 162 ) + yy_c = yy_meta[yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; + yy_is_jam = (yy_current_state == 161); + + (void)yyg; + return yy_is_jam ? 0 : yy_current_state; +} + +#ifndef YY_NO_UNPUT + +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr); + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin , yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( yyscanner ) ) + return 0; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! yyg->yy_buffer_stack ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); + } + + yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner); + yy_load_buffer_state( yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER_LVALUE == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER_LVALUE ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( yyscanner ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->yy_c_buf_p; +} + +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file , yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yyfree( (void *) b->yy_ch_buf , yyscanner ); + + yyfree( (void *) b , yyscanner ); +} + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer( b , yyscanner); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = 0; + + errno = oerrno; +} + +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( yyscanner ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER_LVALUE ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER_LVALUE) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER_LVALUE) { + yy_load_buffer_state( yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; + } +} + +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (yyscan_t yyscanner) +{ + yy_size_t num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->yy_buffer_stack) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + yy_size_t grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->yy_buffer_stack_max = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return NULL; + + b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = NULL; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b , yyscanner ); + + return b; +} + +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param yystr a NUL-terminated string to scan + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner) +{ + + return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner); +} + +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + yy_size_t i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = (yy_size_t) (_yybytes_len + 2); + buf = (char *) yyalloc( n , yyscanner ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n , yyscanner); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; +} + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param _line_number line number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int _line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_lineno called with no buffer" ); + + yylineno = _line_number; +} + +/** Set the current column. + * @param _column_no column number + * @param yyscanner The scanner object. + */ +void yyset_column (int _column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + YY_FATAL_ERROR( "yyset_column called with no buffer" ); + + yycolumn = _column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param _in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * _in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = _in_str ; +} + +void yyset_out (FILE * _out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = _out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int _bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = _bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +YYSTYPE * yyget_lval (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylval; +} + +void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylval = yylval_param; +} + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ +int yylex_init(yyscan_t* ptr_yy_globals) +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ +int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals ) +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = NULL; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = NULL; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; +#else + yyin = NULL; + yyout = NULL; +#endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} + +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack , yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree( yyg->yy_start_stack , yyscanner ); + yyg->yy_start_stack = NULL; + + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( yyscanner); + + /* Destroy the main struct (reentrant only). */ + /* clean up leaks if any before freeing yyscanner */ + yycleanup(yyscanner); + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; +} +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (const char * s , yyscan_t yyscanner) +{ + int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +#define YYTABLES_NAME "yytables" + +#line 542 "./turtle_lexer.l" + + /* user code */ + +int +yywrap (yyscan_t yyscanner) { + return 1; +} + + +static unsigned char * +turtle_copy_token(unsigned char *text, size_t len) +{ + unsigned char *s; + if(!len) + len = strlen((const char*)text); + s = RAPTOR_MALLOC(unsigned char*, len + 1); + if(s) { + memcpy(s, text, len); + s[len] = '\0'; + } + return s; +} + + +static unsigned char * +turtle_copy_string_token(raptor_parser* rdf_parser, + unsigned char *string, size_t len, int delim) +{ + raptor_stringbuffer* sb = NULL; + int rc; + + if(len) { + sb = raptor_new_stringbuffer(); + if(!sb) + return NULL; + + rc = raptor_stringbuffer_append_turtle_string(sb, string, len, delim, + (raptor_simple_message_handler)turtle_lexer_syntax_error, + rdf_parser, 0); + if(rc) { + raptor_free_stringbuffer(sb); + return NULL; + } + + len = raptor_stringbuffer_length(sb); + } + + string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(string) { + if(sb) + raptor_stringbuffer_copy_to_string(sb, string, len+1); + string[len]='\0'; + } + + if(sb) + raptor_free_stringbuffer(sb); + + return string; +} + + +void +turtle_lexer_syntax_error(void* ctx, const char *message, ...) +{ + raptor_parser* rdf_parser = (raptor_parser *)ctx; + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + va_list arguments; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + va_start(arguments, message); + raptor_parser_log_error_varargs(((raptor_parser*)rdf_parser), + RAPTOR_LOG_LEVEL_ERROR, message, arguments); + + va_end(arguments); +} + + +/* + * turtle_lexer_error: + * @yyscanner: scanner object + * @level: log level RAPTOR_LOG_LEVEL_FATAL otherwise error + * @message: erro message + * + * INTERNAL - replacement for the generated error handler. + */ +static void turtle_lexer_error(yyscan_t yyscanner, + raptor_log_level level, + yyconst char *message, ...) +{ + raptor_parser *rdf_parser = NULL; + va_list arguments; + + va_start(arguments, message); + + if(yyscanner) + rdf_parser = (raptor_parser*)turtle_lexer_get_extra(yyscanner); + + /* This handles NULL rdf_parser properly */ + raptor_parser_log_error_varargs(rdf_parser, level, message, arguments); + + va_end(arguments); +} + + +/* Define LEXER_ALLOC_TRACKING to enable allocated memory tracking + * - fixes lexer memory leak when ensure_buffer_stack fails + */ + +#ifdef LEXER_ALLOC_TRACKING +typedef struct { + /* Number of void* slots allocated */ + int lexer_allocs_size; + /* Allocted void* slots follow in memory after this header */ +} lexer_alloc_tracker_header; + +/* Initial alloc tracker slot array size - 2 seems to be enough for almost all cases */ +static const int initial_lexer_allocs_size = 2; +#endif + +/* + * turtle_lexer_cleanup: + * @yyscanner: + * + * INTERNAL - Clean up unfreed lexer allocs if LEXER_ALLOC_TRACKING is enabled. + */ +static void turtle_lexer_cleanup(yyscan_t yyscanner) +{ +#ifdef LEXER_ALLOC_TRACKING + raptor_parser *rdf_parser; + lexer_alloc_tracker_header *tracker; + void **lexer_allocs; + int i; + + if(!yyscanner) + return; + + rdf_parser = (raptor_parser *)turtle_lexer_get_extra(yyscanner); + if(!rdf_parser) + return; + + tracker = (lexer_alloc_tracker_header *)rdf_parser->lexer_user_data; + if(!tracker) + return; + lexer_allocs = (void**)&tracker[1]; + + for(i = 0; i < tracker->lexer_allocs_size; ++i) { + if(lexer_allocs[i]) + free(lexer_allocs[i]); + lexer_allocs[i] = NULL; + } + free(rdf_parser->lexer_user_data); + rdf_parser->lexer_user_data = NULL; +#endif +} + + +/* + * turtle_lexer_alloc: + * @size + * @yyscanner + * + * INTERNAL - alloc replacement. + * Tracks allocated cells if LEXER_ALLOC_TRACKING is enabled. + */ +void *turtle_lexer_alloc(yy_size_t size, yyscan_t yyscanner) +{ +#ifdef LEXER_ALLOC_TRACKING + raptor_parser *rdf_parser; + lexer_alloc_tracker_header *tracker; + void **lexer_allocs; + int i; + void *ptr; + + /* yyscanner not initialized -> probably initializing yyscanner itself + * -> just malloc without tracking + */ + if(!yyscanner) + return malloc(size); + + rdf_parser = (raptor_parser *)turtle_lexer_get_extra(yyscanner); + if(!rdf_parser) + YY_FATAL_ERROR("lexer_alloc: yyscanner extra not initialized"); + + /* try to allocate tracker if it does not exist */ + tracker = (lexer_alloc_tracker_header *)rdf_parser->lexer_user_data; + if(!tracker) { + /* allocate tracker header + array of void* slots */ + tracker = (lexer_alloc_tracker_header*)calloc(1, sizeof(lexer_alloc_tracker_header)+initial_lexer_allocs_size*sizeof(void*)); + if(!tracker) + YY_FATAL_ERROR("lexer_alloc: cannot allocate tracker"); + tracker->lexer_allocs_size = initial_lexer_allocs_size; + rdf_parser->lexer_user_data = (void *)tracker; + } + lexer_allocs = (void**)&tracker[1]; + + /* allocate memory */ + ptr = malloc(size); + + /* find a free slot for ptr */ + for(i = 0; i < tracker->lexer_allocs_size; ++i) { + if(!lexer_allocs[i]) { + lexer_allocs[i] = ptr; + break; + } + } + + /* no free slots -> grow tracker slot array */ + if(i>=tracker->lexer_allocs_size) { + int j; + void **dest; + tracker = (lexer_alloc_tracker_header*)calloc(1, sizeof(lexer_alloc_tracker_header)+i*2*sizeof(void*)); + if(!tracker) { + if(ptr) + free(ptr); + YY_FATAL_ERROR("lexer_alloc: cannot grow tracker"); + } + tracker->lexer_allocs_size = i*2; + + /* copy data from old tracker */ + dest = (void**)&tracker[1]; + for(j = 0; j < i; ++j) { + dest[j] = lexer_allocs[j]; + } + + /* set new item to first free slot */ + dest[j] = ptr; + + /* free old tracker and replace with new one */ + free(rdf_parser->lexer_user_data); + rdf_parser->lexer_user_data = tracker; + } + + return ptr; +#else + return malloc(size); +#endif +} + + +/* + * turtle_lexer_realloc: + * + * INTERNAL - realloc replacement + * Tracks allocated cells if LEXER_ALLOC_TRACKING is enabled. + */ +void *turtle_lexer_realloc(void *ptr, yy_size_t size, yyscan_t yyscanner) +{ +#ifdef LEXER_ALLOC_TRACKING + raptor_parser *rdf_parser; + lexer_alloc_tracker_header *tracker; + void **lexer_allocs; + int i; + void *newptr; + + if(!yyscanner) + YY_FATAL_ERROR("lexer_realloc: yyscanner not initialized"); + + rdf_parser = (raptor_parser *)turtle_lexer_get_extra(yyscanner); + if(!rdf_parser) + YY_FATAL_ERROR("lexer_realloc: yyscanner extra not initialized"); + + tracker = (lexer_alloc_tracker_header *)rdf_parser->lexer_user_data; + if(!tracker) + YY_FATAL_ERROR("lexer_realloc: no alloc tracker"); + lexer_allocs = (void**)&tracker[1]; + + /* find the old slot for ptr */ + for(i = 0; i < tracker->lexer_allocs_size; ++i) { + if(lexer_allocs[i] == ptr) + break; + } + + /* no old slot -> error */ + if(i>=tracker->lexer_allocs_size) + YY_FATAL_ERROR("lexer_realloc: cell not in tracker"); + + /* realloc */ + newptr = realloc((char*)ptr, size); + + /* replace entry in tracker */ + lexer_allocs[i] = newptr; + + return newptr; +#else + return realloc((char*)ptr, size); +#endif +} + + +/* + * turtle_lexer_free: + * + * INTERNAL - free replacement. + * Checks for NULL pointer to be freed unlike the default lexer free function. + * Tracks allocated cells if LEXER_ALLOC_TRACKING is enabled. + */ +void turtle_lexer_free(void *ptr, yyscan_t yyscanner) +{ +#ifdef LEXER_ALLOC_TRACKING + raptor_parser *rdf_parser; + lexer_alloc_tracker_header *tracker; + void **lexer_allocs; + int i; + + /* do not free NULL */ + if(!ptr) + return; + + /* free ptr even if we would encounter an error */ + free(ptr); + + /* yyscanner is allocated with turtle_lexer_alloc() but it's never stored in the tracker + * - we need yyscanner to access the tracker */ + if(!yyscanner || ptr == yyscanner) + return; + + rdf_parser = (raptor_parser *)turtle_lexer_get_extra(yyscanner); + if(!rdf_parser) + return; + + tracker = (lexer_alloc_tracker_header *)rdf_parser->lexer_user_data; + if(!tracker) + return; + lexer_allocs = (void**)&tracker[1]; + + /* find the slot for ptr */ + for(i = 0; i < tracker->lexer_allocs_size; ++i) { + if(lexer_allocs[i] == ptr) + break; + } + + /* no slot -> error */ + if(i>=tracker->lexer_allocs_size) + YY_FATAL_ERROR("lexer_free: cell not in tracker"); + + /* remove entry from tracker */ + lexer_allocs[i] = NULL; +#else + if(ptr) + free(ptr); +#endif +} + + +#ifdef RAPTOR_DEBUG + +const char * +turtle_token_print(raptor_world* world, int token, YYSTYPE *lval) +{ + #define TTP_DEBUG_BUFFER_SIZE 2048 + static char buffer[TTP_DEBUG_BUFFER_SIZE]; + + if(!token) + return "<<EOF>>"; + + switch(token) { + case PREFIX: + return "PREFIX"; + + case BASE: + return "BASE"; + + case A: + return "A"; + + case DOT: + return "DOT"; + + case COMMA: + return "COMMA"; + + case SEMICOLON: + return "SEMICOLON"; + + case LEFT_SQUARE: + return "LEFT_SQUARE"; + + case RIGHT_SQUARE: + return "RIGHT_SQUARE"; + + case HAT: + return "HAT"; + + case STRING_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "STRING_LITERAL(%s)", + lval->string); + return buffer; + + case URI_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "URI_LITERAL(%s)", + (lval->uri ? (char*)raptor_uri_as_string(lval->uri) : "")); + return buffer; + + case BLANK_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "BLANK_LITERAL(%s)", + lval->string); + return buffer; + + case QNAME_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "QNAME_LITERAL(%s)", + (lval->uri ? (char*)raptor_uri_as_string(lval->uri) : "")); + return buffer; + + case INTEGER_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "INTEGER_LITERAL(%s)", + lval->string); + return buffer; + + case FLOATING_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "FLOATING_LITERAL(%s)", + lval->string); + return buffer; + + case IDENTIFIER: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "IDENTIFIER(%s)", + (lval->string ? (char*)lval->string : "")); + return buffer; + + case LANGTAG: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "LANGTAG(%s)", + (lval->string ? (char*)lval->string : "")); + return buffer; + + case DECIMAL_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "DECIMAL_LITERAL(%s)", + lval->string); + return buffer; + + case ERROR_TOKEN: + return "ERROR"; + + case LEFT_CURLY: + return "{"; + + case RIGHT_CURLY: + return "}"; + + case GRAPH_NAME_LEFT_CURLY: + return "GRAPH_NAME {"; + + default: + RAPTOR_DEBUG2("UNKNOWN token %d - add a new case\n", token); + return "(UNKNOWN)"; + } +} +#endif + + + +void +turtle_token_free(raptor_world* world, int token, YYSTYPE *lval) +{ + if(!token) + return; + + switch(token) { + case STRING_LITERAL: + case BLANK_LITERAL: + case IDENTIFIER: + if(lval->string) + RAPTOR_FREE(char*, lval->string); + break; + + case URI_LITERAL: + case QNAME_LITERAL: + if(lval->uri) + raptor_free_uri(lval->uri); + break; + default: + break; + } +} + + +#ifdef STANDALONE + +#define FILE_READ_BUF_SIZE 4096 + +int +main(int argc, char *argv[]) +{ + char *turtle_string = NULL; + raptor_parser rdf_parser; + raptor_turtle_parser turtle_parser; + yyscan_t scanner; + int token = EOF; + YYSTYPE lval; + const unsigned char *uri_string; + const char *filename = NULL; + char *buf = NULL; + size_t len; + raptor_world* world; + FILE *fh; + + world = raptor_new_world(); + + if(argc > 1) { + filename = argv[1]; + fh = fopen(filename, "r"); + if(!fh) { + fprintf(stderr, "%s: Cannot open file %s - %s\n", argv[0], filename, + strerror(errno)); + exit(1); + } + } else { + filename="<stdin>"; + fh = (FILE*)stdin; + } + + turtle_string = RAPTOR_CALLOC(char*, FILE_READ_BUF_SIZE, 1); + fread(turtle_string, FILE_READ_BUF_SIZE, 1, fh); + fclose(fh); + + memset(&rdf_parser, 0, sizeof(rdf_parser)); + memset(&turtle_parser, 0, sizeof(turtle_parser)); + + rdf_parser.world = world; + + /* discard namespace errors - caused by not interpreting @prefix + * and hence causing failed qname construction + */ + raptor_namespaces_init(rdf_parser.world, &turtle_parser.namespaces, 0); + + yylex_init(&turtle_parser.scanner); + scanner = turtle_parser.scanner; + + len = strlen(RAPTOR_GOOD_CAST(const char*, turtle_string)); + buf = RAPTOR_MALLOC(char*, len + 3); + memcpy(buf, turtle_string, len); + buf[len] = ' '; + buf[len + 1] = buf[len + 2] = '\0'; /* YY_END_OF_BUFFER_CHAR; */ + (void)turtle_lexer__scan_buffer(buf, len + 3, scanner); + + turtle_lexer_set_extra(&rdf_parser, scanner); + + /* Initialise enough of the parser and locator to get error messages */ + rdf_parser.context = &turtle_parser; + turtle_parser.lineno = 1; + rdf_parser.locator.file = filename; + rdf_parser.locator.column = -1; + + uri_string = raptor_uri_filename_to_uri_string(filename); + rdf_parser.base_uri = raptor_new_uri(world, uri_string); + RAPTOR_FREE(char*, uri_string); + + while(1) { + memset(&lval, 0, sizeof(YYSTYPE)); + if(turtle_lexer_get_text(scanner) != NULL) + printf("yyinput '%s'\n", turtle_lexer_get_text(scanner)); + token = yylex(&lval, scanner); +#ifdef RAPTOR_DEBUG + printf("token %s\n", turtle_token_print(world, token, &lval)); +#else + printf("token %d\n", token); +#endif + turtle_token_free(world, token, &lval); + if(!token || token == EOF || token == ERROR_TOKEN) + break; + } + + if(buf) + RAPTOR_FREE(char*, buf); + + yylex_destroy(scanner); + + raptor_namespaces_clear(&turtle_parser.namespaces); + + raptor_free_uri(rdf_parser.base_uri); + + RAPTOR_FREE(char*, turtle_string); + + raptor_free_world(world); + + + if(token == ERROR_TOKEN) + return 1; + + return 0; +} +#endif + diff --git a/src/turtle_lexer.h b/src/turtle_lexer.h new file mode 100644 index 0000000..85a3a9e --- /dev/null +++ b/src/turtle_lexer.h @@ -0,0 +1,724 @@ +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#ifndef turtle_lexer_HEADER_H +#define turtle_lexer_HEADER_H 1 +#define turtle_lexer_IN_HEADER 1 + +#line 10 "turtle_lexer.h" + +#line 12 "turtle_lexer.h" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 4 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif + +#ifdef yy_create_buffer +#define turtle_lexer__create_buffer_ALREADY_DEFINED +#else +#define yy_create_buffer turtle_lexer__create_buffer +#endif + +#ifdef yy_delete_buffer +#define turtle_lexer__delete_buffer_ALREADY_DEFINED +#else +#define yy_delete_buffer turtle_lexer__delete_buffer +#endif + +#ifdef yy_scan_buffer +#define turtle_lexer__scan_buffer_ALREADY_DEFINED +#else +#define yy_scan_buffer turtle_lexer__scan_buffer +#endif + +#ifdef yy_scan_string +#define turtle_lexer__scan_string_ALREADY_DEFINED +#else +#define yy_scan_string turtle_lexer__scan_string +#endif + +#ifdef yy_scan_bytes +#define turtle_lexer__scan_bytes_ALREADY_DEFINED +#else +#define yy_scan_bytes turtle_lexer__scan_bytes +#endif + +#ifdef yy_init_buffer +#define turtle_lexer__init_buffer_ALREADY_DEFINED +#else +#define yy_init_buffer turtle_lexer__init_buffer +#endif + +#ifdef yy_flush_buffer +#define turtle_lexer__flush_buffer_ALREADY_DEFINED +#else +#define yy_flush_buffer turtle_lexer__flush_buffer +#endif + +#ifdef yy_load_buffer_state +#define turtle_lexer__load_buffer_state_ALREADY_DEFINED +#else +#define yy_load_buffer_state turtle_lexer__load_buffer_state +#endif + +#ifdef yy_switch_to_buffer +#define turtle_lexer__switch_to_buffer_ALREADY_DEFINED +#else +#define yy_switch_to_buffer turtle_lexer__switch_to_buffer +#endif + +#ifdef yypush_buffer_state +#define turtle_lexer_push_buffer_state_ALREADY_DEFINED +#else +#define yypush_buffer_state turtle_lexer_push_buffer_state +#endif + +#ifdef yypop_buffer_state +#define turtle_lexer_pop_buffer_state_ALREADY_DEFINED +#else +#define yypop_buffer_state turtle_lexer_pop_buffer_state +#endif + +#ifdef yyensure_buffer_stack +#define turtle_lexer_ensure_buffer_stack_ALREADY_DEFINED +#else +#define yyensure_buffer_stack turtle_lexer_ensure_buffer_stack +#endif + +#ifdef yylex +#define turtle_lexer_lex_ALREADY_DEFINED +#else +#define yylex turtle_lexer_lex +#endif + +#ifdef yyrestart +#define turtle_lexer_restart_ALREADY_DEFINED +#else +#define yyrestart turtle_lexer_restart +#endif + +#ifdef yylex_init +#define turtle_lexer_lex_init_ALREADY_DEFINED +#else +#define yylex_init turtle_lexer_lex_init +#endif + +#ifdef yylex_init_extra +#define turtle_lexer_lex_init_extra_ALREADY_DEFINED +#else +#define yylex_init_extra turtle_lexer_lex_init_extra +#endif + +#ifdef yylex_destroy +#define turtle_lexer_lex_destroy_ALREADY_DEFINED +#else +#define yylex_destroy turtle_lexer_lex_destroy +#endif + +#ifdef yyget_debug +#define turtle_lexer_get_debug_ALREADY_DEFINED +#else +#define yyget_debug turtle_lexer_get_debug +#endif + +#ifdef yyset_debug +#define turtle_lexer_set_debug_ALREADY_DEFINED +#else +#define yyset_debug turtle_lexer_set_debug +#endif + +#ifdef yyget_extra +#define turtle_lexer_get_extra_ALREADY_DEFINED +#else +#define yyget_extra turtle_lexer_get_extra +#endif + +#ifdef yyset_extra +#define turtle_lexer_set_extra_ALREADY_DEFINED +#else +#define yyset_extra turtle_lexer_set_extra +#endif + +#ifdef yyget_in +#define turtle_lexer_get_in_ALREADY_DEFINED +#else +#define yyget_in turtle_lexer_get_in +#endif + +#ifdef yyset_in +#define turtle_lexer_set_in_ALREADY_DEFINED +#else +#define yyset_in turtle_lexer_set_in +#endif + +#ifdef yyget_out +#define turtle_lexer_get_out_ALREADY_DEFINED +#else +#define yyget_out turtle_lexer_get_out +#endif + +#ifdef yyset_out +#define turtle_lexer_set_out_ALREADY_DEFINED +#else +#define yyset_out turtle_lexer_set_out +#endif + +#ifdef yyget_leng +#define turtle_lexer_get_leng_ALREADY_DEFINED +#else +#define yyget_leng turtle_lexer_get_leng +#endif + +#ifdef yyget_text +#define turtle_lexer_get_text_ALREADY_DEFINED +#else +#define yyget_text turtle_lexer_get_text +#endif + +#ifdef yyget_lineno +#define turtle_lexer_get_lineno_ALREADY_DEFINED +#else +#define yyget_lineno turtle_lexer_get_lineno +#endif + +#ifdef yyset_lineno +#define turtle_lexer_set_lineno_ALREADY_DEFINED +#else +#define yyset_lineno turtle_lexer_set_lineno +#endif + +#ifdef yyget_column +#define turtle_lexer_get_column_ALREADY_DEFINED +#else +#define yyget_column turtle_lexer_get_column +#endif + +#ifdef yyset_column +#define turtle_lexer_set_column_ALREADY_DEFINED +#else +#define yyset_column turtle_lexer_set_column +#endif + +#ifdef yywrap +#define turtle_lexer_wrap_ALREADY_DEFINED +#else +#define yywrap turtle_lexer_wrap +#endif + +#ifdef yyget_lval +#define turtle_lexer_get_lval_ALREADY_DEFINED +#else +#define yyget_lval turtle_lexer_get_lval +#endif + +#ifdef yyset_lval +#define turtle_lexer_set_lval_ALREADY_DEFINED +#else +#define yyset_lval turtle_lexer_set_lval +#endif + +#ifdef yyalloc +#define turtle_lexer_alloc_ALREADY_DEFINED +#else +#define yyalloc turtle_lexer_alloc +#endif + +#ifdef yyrealloc +#define turtle_lexer_realloc_ALREADY_DEFINED +#else +#define yyrealloc turtle_lexer_realloc +#endif + +#ifdef yyfree +#define turtle_lexer_free_ALREADY_DEFINED +#else +#define yyfree turtle_lexer_free +#endif + +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ +#include <stdio.h> +#include <string.h> +#include <errno.h> +#include <stdlib.h> + +/* end standard C headers. */ + +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */ + +#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 +#endif + +#include <inttypes.h> +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; + +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif + +#ifndef SIZE_MAX +#define SIZE_MAX (~(size_t)0) +#endif + +#endif /* ! C99 */ + +#endif /* ! FLEXINT_H */ + +/* begin standard C++ headers. */ + +/* TODO: this is always defined, so inline it */ +#define yyconst const + +#if defined(__GNUC__) && __GNUC__ >= 3 +#define yynoreturn __attribute__((__noreturn__)) +#else +#define yynoreturn +#endif + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* Size of default input buffer. */ +#ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else +#define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ +#endif + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE +typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + int yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; + + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ + +void yyrestart ( FILE *input_file , yyscan_t yyscanner ); +void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner ); +void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner ); +void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner ); +void yypop_buffer_state ( yyscan_t yyscanner ); + +YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, yy_size_t len , yyscan_t yyscanner ); + +void *yyalloc ( yy_size_t , yyscan_t yyscanner ); +void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner ); +void yyfree ( void * , yyscan_t yyscanner ); + +/* Begin user sect3 */ + +#define yytext_ptr yytext_r + +#ifdef YY_HEADER_EXPORT_START_CONDITIONS +#define INITIAL 0 +#define PREF 1 +#define LONG_DLITERAL 2 +#define LONG_SLITERAL 3 + +#endif + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#ifndef YY_NO_UNISTD_H +#include <unistd.h> +#endif +#endif + +#define YY_EXTRA_TYPE raptor_parser* + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy ( yyscan_t yyscanner ); + +int yyget_debug ( yyscan_t yyscanner ); + +void yyset_debug ( int debug_flag , yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner ); + +void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner ); + +FILE *yyget_in ( yyscan_t yyscanner ); + +void yyset_in ( FILE * _in_str , yyscan_t yyscanner ); + +FILE *yyget_out ( yyscan_t yyscanner ); + +void yyset_out ( FILE * _out_str , yyscan_t yyscanner ); + + int yyget_leng ( yyscan_t yyscanner ); + +char *yyget_text ( yyscan_t yyscanner ); + +int yyget_lineno ( yyscan_t yyscanner ); + +void yyset_lineno ( int _line_number , yyscan_t yyscanner ); + +int yyget_column ( yyscan_t yyscanner ); + +void yyset_column ( int _column_no , yyscan_t yyscanner ); + +YYSTYPE * yyget_lval ( yyscan_t yyscanner ); + +void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap ( yyscan_t yyscanner ); +#else +extern int yywrap ( yyscan_t yyscanner ); +#endif +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen ( const char * , yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else +#define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL_IS_OURS 1 + +extern int yylex \ + (YYSTYPE * yylval_param , yyscan_t yyscanner); + +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param , yyscan_t yyscanner) +#endif /* !YY_DECL */ + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +#undef YY_NEW_FILE +#undef YY_FLUSH_BUFFER +#undef yy_set_bol +#undef yy_new_buffer +#undef yy_set_interactive +#undef YY_DO_BEFORE_ACTION + +#ifdef YY_DECL_IS_OURS +#undef YY_DECL_IS_OURS +#undef YY_DECL +#endif + +#ifndef turtle_lexer__create_buffer_ALREADY_DEFINED +#undef yy_create_buffer +#endif +#ifndef turtle_lexer__delete_buffer_ALREADY_DEFINED +#undef yy_delete_buffer +#endif +#ifndef turtle_lexer__scan_buffer_ALREADY_DEFINED +#undef yy_scan_buffer +#endif +#ifndef turtle_lexer__scan_string_ALREADY_DEFINED +#undef yy_scan_string +#endif +#ifndef turtle_lexer__scan_bytes_ALREADY_DEFINED +#undef yy_scan_bytes +#endif +#ifndef turtle_lexer__init_buffer_ALREADY_DEFINED +#undef yy_init_buffer +#endif +#ifndef turtle_lexer__flush_buffer_ALREADY_DEFINED +#undef yy_flush_buffer +#endif +#ifndef turtle_lexer__load_buffer_state_ALREADY_DEFINED +#undef yy_load_buffer_state +#endif +#ifndef turtle_lexer__switch_to_buffer_ALREADY_DEFINED +#undef yy_switch_to_buffer +#endif +#ifndef turtle_lexer_push_buffer_state_ALREADY_DEFINED +#undef yypush_buffer_state +#endif +#ifndef turtle_lexer_pop_buffer_state_ALREADY_DEFINED +#undef yypop_buffer_state +#endif +#ifndef turtle_lexer_ensure_buffer_stack_ALREADY_DEFINED +#undef yyensure_buffer_stack +#endif +#ifndef turtle_lexer_lex_ALREADY_DEFINED +#undef yylex +#endif +#ifndef turtle_lexer_restart_ALREADY_DEFINED +#undef yyrestart +#endif +#ifndef turtle_lexer_lex_init_ALREADY_DEFINED +#undef yylex_init +#endif +#ifndef turtle_lexer_lex_init_extra_ALREADY_DEFINED +#undef yylex_init_extra +#endif +#ifndef turtle_lexer_lex_destroy_ALREADY_DEFINED +#undef yylex_destroy +#endif +#ifndef turtle_lexer_get_debug_ALREADY_DEFINED +#undef yyget_debug +#endif +#ifndef turtle_lexer_set_debug_ALREADY_DEFINED +#undef yyset_debug +#endif +#ifndef turtle_lexer_get_extra_ALREADY_DEFINED +#undef yyget_extra +#endif +#ifndef turtle_lexer_set_extra_ALREADY_DEFINED +#undef yyset_extra +#endif +#ifndef turtle_lexer_get_in_ALREADY_DEFINED +#undef yyget_in +#endif +#ifndef turtle_lexer_set_in_ALREADY_DEFINED +#undef yyset_in +#endif +#ifndef turtle_lexer_get_out_ALREADY_DEFINED +#undef yyget_out +#endif +#ifndef turtle_lexer_set_out_ALREADY_DEFINED +#undef yyset_out +#endif +#ifndef turtle_lexer_get_leng_ALREADY_DEFINED +#undef yyget_leng +#endif +#ifndef turtle_lexer_get_text_ALREADY_DEFINED +#undef yyget_text +#endif +#ifndef turtle_lexer_get_lineno_ALREADY_DEFINED +#undef yyget_lineno +#endif +#ifndef turtle_lexer_set_lineno_ALREADY_DEFINED +#undef yyset_lineno +#endif +#ifndef turtle_lexer_get_column_ALREADY_DEFINED +#undef yyget_column +#endif +#ifndef turtle_lexer_set_column_ALREADY_DEFINED +#undef yyset_column +#endif +#ifndef turtle_lexer_wrap_ALREADY_DEFINED +#undef yywrap +#endif +#ifndef turtle_lexer_get_lval_ALREADY_DEFINED +#undef yyget_lval +#endif +#ifndef turtle_lexer_set_lval_ALREADY_DEFINED +#undef yyset_lval +#endif +#ifndef turtle_lexer_get_lloc_ALREADY_DEFINED +#undef yyget_lloc +#endif +#ifndef turtle_lexer_set_lloc_ALREADY_DEFINED +#undef yyset_lloc +#endif +#ifndef turtle_lexer_alloc_ALREADY_DEFINED +#undef yyalloc +#endif +#ifndef turtle_lexer_realloc_ALREADY_DEFINED +#undef yyrealloc +#endif +#ifndef turtle_lexer_free_ALREADY_DEFINED +#undef yyfree +#endif +#ifndef turtle_lexer_text_ALREADY_DEFINED +#undef yytext +#endif +#ifndef turtle_lexer_leng_ALREADY_DEFINED +#undef yyleng +#endif +#ifndef turtle_lexer_in_ALREADY_DEFINED +#undef yyin +#endif +#ifndef turtle_lexer_out_ALREADY_DEFINED +#undef yyout +#endif +#ifndef turtle_lexer__flex_debug_ALREADY_DEFINED +#undef yy_flex_debug +#endif +#ifndef turtle_lexer_lineno_ALREADY_DEFINED +#undef yylineno +#endif +#ifndef turtle_lexer_tables_fload_ALREADY_DEFINED +#undef yytables_fload +#endif +#ifndef turtle_lexer_tables_destroy_ALREADY_DEFINED +#undef yytables_destroy +#endif +#ifndef turtle_lexer_TABLES_NAME_ALREADY_DEFINED +#undef yyTABLES_NAME +#endif + +#line 542 "./turtle_lexer.l" + + +#line 723 "turtle_lexer.h" +#undef turtle_lexer_IN_HEADER +#endif /* turtle_lexer_HEADER_H */ diff --git a/src/turtle_lexer.l b/src/turtle_lexer.l new file mode 100644 index 0000000..8d0c53e --- /dev/null +++ b/src/turtle_lexer.l @@ -0,0 +1,1124 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * turtle_lexer.l - Raptor Turtle lexer - making tokens for turtle grammar generator + * + * Copyright (C) 2003-2013, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + * Turtle is defined in http://www.dajobe.org/2004/01/turtle/ + * + * To generate the C files from this source, rather than use the + * shipped turtle_lexer.c/.h needs a patched version of flex 2.5.31 such + * as the one available in Debian GNU/Linux. Details below + * near the %option descriptions. + * + */ + + +/* recognise 8-bits */ +%option 8bit +%option warn nodefault + +/* all symbols prefixed by this */ +%option prefix="turtle_lexer_" + +/* This is not needed, flex is invoked -oturtle_lexer.c */ +/* %option outfile="turtle_lexer.c" */ + +/* Emit a C header file for prototypes + * Only available in flex 2.5.13 or newer. + * It was renamed to header-file in flex 2.5.19 + */ +%option header-file="turtle_lexer.h" + +/* Do not emit #include <unistd.h> + * Only available in flex 2.5.7 or newer. + * Broken in flex 2.5.31 without patches. + */ +%option nounistd + +/* Never interactive */ +/* No isatty() check */ +%option never-interactive + +/* Batch scanner */ +%option batch + +/* Never use yyunput */ +%option nounput + +/* Supply our own alloc/realloc/free functions */ +%option noyyalloc noyyrealloc noyyfree + +/* Re-entrant scanner */ +%option reentrant + +%option extra-type="raptor_parser*" + +/* Makes yyget_lval() yyset_lval() and yylval appear */ +%option bison-bridge +/* Makes yyget_lloc() yyset_lloc() and yylloc appear */ +/* %option bison-locations */ + + /* definitions */ + +%{ + +/* NOTE: These headers are NOT included here but are inserted by + * fix-flex since otherwise it appears far too late in the generated C + */ + +/* +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif +*/ + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_SETJMP_H +#include <setjmp.h> +#endif + +#include "raptor2.h" +#include "raptor_internal.h" + +#include <turtle_parser.h> +#include <turtle_common.h> + +#define YYSTYPE TURTLE_PARSER_STYPE + +/* Prototypes */ +static unsigned char *turtle_copy_token(unsigned char *text, size_t len); +static unsigned char *turtle_copy_string_token(raptor_parser* rdf_parser, unsigned char *text, size_t len, int delim); +void turtle_lexer_syntax_error(void* ctx, const char *message, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +#ifdef RAPTOR_DEBUG +const char * turtle_token_print(raptor_world* world, int token, YYSTYPE *lval); +#endif + +#ifdef __cplusplus +#define INPUT_FN yyinput +#else +#define INPUT_FN input +#endif + + +#if FLEX_VERSION_DECIMAL < 20536 +/* debian flex 2.5.35-10.1 added these column header prototypes in + * re-entrant mode. standard flex omits them + */ +void turtle_lexer_set_column(int column_no, yyscan_t yyscanner); +int turtle_lexer_get_column(yyscan_t yyscanner); +#endif + +static void turtle_lexer_cleanup(yyscan_t yyscanner); +#undef yycleanup +#define yycleanup turtle_lexer_cleanup + +#ifdef HAVE_SETJMP +static jmp_buf turtle_lexer_fatal_error_longjmp_env; + +/* fatal error handler declaration */ +#define YY_FATAL_ERROR(msg) do { \ + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_FATAL, msg); \ + longjmp(turtle_lexer_fatal_error_longjmp_env, 1); \ +} while(0) +#else +#define YY_FATAL_ERROR(msg) do { \ + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_FATAL, msg); \ + abort(); \ +} while(0) +#endif + +/* Remove the re-fill function since it should never be called */ +#define YY_INPUT(buf,result,max_size) { return YY_NULL; } + +static void turtle_lexer_error(yyscan_t yyscanner, raptor_log_level level, yyconst char *message, ...) RAPTOR_PRINTF_FORMAT(3, 4); + +/* Fatal error handler that returns EOF instead of abort()/longjmp() + * so that parser can clean up properly */ +#define YY_FATAL_ERROR_EOF(msg) do { \ + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_FATAL, "%s", msg); \ + yyterminate(); \ +} while(0) + +/* Out-of-memory reporting macro */ +#define TURTLE_LEXER_OOM() YY_FATAL_ERROR_EOF(turtle_lexer_oom_text) +static char turtle_lexer_oom_text[]="turtle_lexer: Out of memory"; + +/* Do not need input() to to read from stdin */ +#define YY_NO_INPUT 1 + +#define YY_USER_ACTION \ + turtle_parser->consumed += yyleng; + +%} + +/* Tokens from Turtle 2013 spec - lex-ifyed to remove unicode ranges */ +PN_CHARS_BASE [A-Za-z\x80-\xff] +PN_CHARS {PN_CHARS_BASE}|"_"|"-"|[0-9] +BS_ESCAPES [-_~\.!$&\'()*+,;=/?#@%] +HEX [0-9A-Fa-f] +PLX "%"{HEX}{HEX})|("\\"{BS_ESCAPES} + +LANGTAG "@"[A-Za-z][-A-Z_a-z0-9]* + +/* flex: only 1 level of definition expansion so have to expand PLX */ +BN_LABEL ({PN_CHARS_BASE}|"_"|[0-9])(({PN_CHARS}|".")*({PN_CHARS}))* +PN_PREFIX ({PN_CHARS_BASE})(({PN_CHARS}|".")*({PN_CHARS}))* +PN_LOCAL ({PN_CHARS_BASE}|"_"|[0-9]|":"|{PLX})(({PN_CHARS}|"."|":"|{PLX})*({PN_CHARS}|":"|{PLX}))* + +QNAME {PN_PREFIX}?":"{PN_LOCAL}? + +UCHAR "\\u"{HEX}{HEX}{HEX}{HEX}|"\\U"{HEX}{HEX}{HEX}{HEX}{HEX}{HEX}{HEX}{HEX} +IRI "<"([^\x00-\x20<>\"{}\|^`\\]|{UCHAR})*">" + +INTEGER [-+]?[0-9]+ +DECIMAL [-+]?[0-9]*"."[0-9]+ +DOUBLE [-+]?([0-9]+"."[0-9]*{EXPONENT}|"."[0-9]+{EXPONENT}|[0-9]+{EXPONENT}) +EXPONENT [eE][+-]?[0-9]+ + + +%x PREF LONG_DLITERAL LONG_SLITERAL + + +%% + /* rules */ + +%{ + raptor_parser *rdf_parser = yyextra; + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + +#ifdef HAVE_SETJMP + if(setjmp(turtle_lexer_fatal_error_longjmp_env)) + return 1; +#endif +%} + + +\r\n|\r|\n { turtle_parser->lineno++; } + +[\ \t\v]+ { /* empty */ } + + +"a" { return A; } + +"." { return DOT; } +"," { return COMMA; } +";" { return SEMICOLON; } +"[" { return LEFT_SQUARE; } +"]" { return RIGHT_SQUARE; } +"@prefix" { BEGIN(PREF); return PREFIX; } +[Pp][Rr][Ee][Ff][Ii][Xx] { BEGIN(PREF); + return SPARQL_PREFIX; } +"@base" { return BASE; } +[Bb][Aa][Ss][Ee] { return SPARQL_BASE; } +"^^" { return HAT; } +"(" { return LEFT_ROUND; } +")" { return RIGHT_ROUND; } +"{" { return LEFT_CURLY; } +"}" { return RIGHT_CURLY; } +"true" { return TRUE_TOKEN; } +"false" { return FALSE_TOKEN; } + + +\"([^\"\\\n\r]|\\[^\n\r])*\" { yylval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ + if(!yylval->string) + yyterminate(); + + return STRING_LITERAL; } + +\'([^\'\\\n\r]|\\[^\n\r])*\' { yylval->string = turtle_copy_string_token(rdf_parser, (unsigned char*)yytext+1, yyleng-2, '"'); /* ' */ + if(!yylval->string) + yyterminate(); + + return STRING_LITERAL; } + +\"\"\" { BEGIN(LONG_DLITERAL); + turtle_parser->sb = raptor_new_stringbuffer(); + if(!turtle_parser->sb) + TURTLE_LEXER_OOM(); + } + +<LONG_DLITERAL>\"\"\" { + size_t len; + + BEGIN(INITIAL); + len = raptor_stringbuffer_length(turtle_parser->sb); + yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!yylval->string) + TURTLE_LEXER_OOM(); + raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)yylval->string, len); + yylval->string[len]='\0'; + + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + return STRING_LITERAL; } + +<LONG_DLITERAL>\"|(\\.|[^\"\\]|\n)* { + char *p; + + if(*yytext == EOF) { + BEGIN(INITIAL); + turtle_syntax_error(rdf_parser, "End of file in middle of literal"); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + return EOF; + } + + for(p = yytext; *p; p++) { + if(*p == '\n') + turtle_parser->lineno++; + } + + if(raptor_stringbuffer_append_turtle_string(turtle_parser->sb, (unsigned char*)yytext, yyleng, '"', (raptor_simple_message_handler)turtle_lexer_syntax_error, rdf_parser, 0)) { /* " */ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + YY_FATAL_ERROR_EOF("raptor_stringbuffer_append_turtle_string failed"); + } + + } + +<LONG_DLITERAL>\\ { + /* this should only happen if \ is at the end of the file so the Turtle doc is illegal anyway */ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + turtle_syntax_error(rdf_parser, "End of file in middle of \"\"\"literal\"\"\""); + yyterminate(); +} + +<LONG_DLITERAL><<EOF>> { + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + if(!turtle_parser->is_end) { + /* next run will fix things, hopefully */ + return EOF; + } + /* otherwise abort */ + turtle_syntax_error(rdf_parser, "End of file in middle of \"\"\"literal\"\"\""); + yyterminate(); +} + +\'\'\' { BEGIN(LONG_SLITERAL); + turtle_parser->sb = raptor_new_stringbuffer(); + if(!turtle_parser->sb) + TURTLE_LEXER_OOM(); + } + +<LONG_SLITERAL>\'\'\' { + size_t len; + + BEGIN(INITIAL); + len = raptor_stringbuffer_length(turtle_parser->sb); + yylval->string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(!yylval->string) + TURTLE_LEXER_OOM(); + raptor_stringbuffer_copy_to_string(turtle_parser->sb, (unsigned char*)yylval->string, len); + yylval->string[len]='\0'; + + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + return STRING_LITERAL; } + +<LONG_SLITERAL>\'|(\\.|[^\'\\]|\n)* { + char *p; + + if(*yytext == EOF) { + BEGIN(INITIAL); + turtle_syntax_error(rdf_parser, "End of file in middle of \'\'\'literal\'\'\'"); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + return EOF; + } + + for(p = yytext; *p; p++) { + if(*p == '\n') + turtle_parser->lineno++; + } + + if(raptor_stringbuffer_append_turtle_string(turtle_parser->sb, (unsigned char*)yytext, yyleng, '"', (raptor_simple_message_handler)turtle_lexer_syntax_error, rdf_parser, 0)) { /* " */ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + YY_FATAL_ERROR_EOF("raptor_stringbuffer_append_turtle_string failed"); + } + + } + +<LONG_SLITERAL>\\ { + /* this should only happen if \ is at the end of the file so the Turtle doc is illegal anyway */ + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + turtle_syntax_error(rdf_parser, "End of file in middle of '''literal'''"); + yyterminate(); +} + +<LONG_SLITERAL><<EOF>> { + BEGIN(INITIAL); + raptor_free_stringbuffer(turtle_parser->sb); + turtle_parser->sb = NULL; + if(!turtle_parser->is_end) { + /* next run will fix things, hopefully */ + return EOF; + } + /* otherwise abort */ + turtle_syntax_error(rdf_parser, "End of file in middle of '''literal'''"); + yyterminate(); +} + +"_:"{BN_LABEL} { yylval->string = turtle_copy_token((unsigned char*)yytext+2, yyleng-2); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return BLANK_LITERAL; } + +{QNAME} { yylval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); + if(!yylval->uri) { + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_ERROR, "Failed to convert qname %s to URI", yytext); + yyterminate(); + } + + return QNAME_LITERAL; } + +{DECIMAL} { yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return DECIMAL_LITERAL; +} + +{DOUBLE} { yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return FLOATING_LITERAL; +} + +{INTEGER} { yylval->string = turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return INTEGER_LITERAL; } + +<PREF>[\ \t\v]+ { /* eat up leading whitespace */ } +<PREF>{PN_PREFIX}":" { yylval->string=turtle_copy_token((unsigned char*)yytext, yyleng); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + BEGIN(INITIAL); + return IDENTIFIER; } +<PREF>":" { BEGIN(INITIAL); + yylval->string = turtle_copy_token((unsigned char*)yytext, 0); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return IDENTIFIER; } + +<PREF>(.|\n) { BEGIN(INITIAL); + if(*yytext == EOF) + return EOF; + + turtle_syntax_error(rdf_parser, "syntax error at '%c'", *yytext); + yyterminate(); } + + +{IRI}[\ \t\v\r\n]*("=")?[\ \t\v\r\n]*"{" { + raptor_stringbuffer* sb; + unsigned char* uri_string; + + /* make length just the IRI */ + while(yytext[yyleng - 1] != '>') + yyleng--; + + sb = raptor_new_stringbuffer(); + if(!sb) + TURTLE_LEXER_OOM(); + + /* start at yytext + 1 to skip '<' and operate over + * length-2 bytes to skip '<' and '>' + */ + if(raptor_stringbuffer_append_turtle_string(sb, (unsigned char*)yytext+1, yyleng-2, '>', (raptor_simple_message_handler)turtle_lexer_syntax_error, rdf_parser, 1)) { + raptor_free_stringbuffer(sb); + YY_FATAL_ERROR_EOF("raptor_stringbuffer_append_turtle_string failed"); + } + uri_string = raptor_stringbuffer_as_string(sb); + + if(!*uri_string) + yylval->uri = raptor_uri_copy(rdf_parser->base_uri); + else + yylval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); + + raptor_free_stringbuffer(sb); + + if(!yylval->uri) + TURTLE_LEXER_OOM(); + return GRAPH_NAME_LEFT_CURLY; } + +{QNAME}[\ \t\v\r\n]*("=")?[\ \t\v\r\n]*"{" { + while(1) { + int c = yytext[yyleng - 1]; + if(c == '{' || c == ' ' || c=='\t' || c == '\v' || c == '\n' || + c == '=') { + yyleng--; + } else + break; + } + yytext[yyleng] = '\0'; + + yylval->uri = turtle_qname_to_uri(rdf_parser, (unsigned char*)yytext, yyleng); + if(!yylval->uri) { + turtle_lexer_error(yyscanner, RAPTOR_LOG_LEVEL_ERROR, "Failed to convert qname %s to URI", yytext); + yyterminate(); + } + + return GRAPH_NAME_LEFT_CURLY; } + +{IRI} { if(yyleng == 2) + yylval->uri = raptor_uri_copy(rdf_parser->base_uri); + else { + raptor_stringbuffer* sb; + unsigned char* uri_string; + + yytext[yyleng-1]='\0'; + sb = raptor_new_stringbuffer(); + if(!sb) + TURTLE_LEXER_OOM(); + if(raptor_stringbuffer_append_turtle_string(sb, (unsigned char*)yytext+1, yyleng-1, '>', (raptor_simple_message_handler)turtle_lexer_syntax_error, rdf_parser, 1)) { + raptor_free_stringbuffer(sb); + YY_FATAL_ERROR_EOF("raptor_stringbuffer_append_turtle_string failed"); + } + uri_string = raptor_stringbuffer_as_string(sb); + yylval->uri = raptor_new_uri_relative_to_base(rdf_parser->world, rdf_parser->base_uri, uri_string); + if(!yylval->uri) { + raptor_free_stringbuffer(sb); + TURTLE_LEXER_OOM(); + } + raptor_free_stringbuffer(sb); + } + return URI_LITERAL; } + +{LANGTAG} { yylval->string = turtle_copy_token((unsigned char*)yytext+1, yyleng-1); + if(!yylval->string) + YY_FATAL_ERROR_EOF("turtle_copy_token failed"); + return LANGTAG; } + +\#[^\r\n]*(\r\n|\r|\n) { /* # comment */ + turtle_parser->lineno++; + } + +\#[^\r\n]* { /* # comment on the last line with no terminating newline */ + } + +. { if(*yytext == EOF) + return EOF; + + turtle_syntax_error(rdf_parser, "syntax error at '%c'", *yytext); + yyterminate(); + } + +%% + /* user code */ + +int +yywrap (yyscan_t yyscanner) { + return 1; +} + + +static unsigned char * +turtle_copy_token(unsigned char *text, size_t len) +{ + unsigned char *s; + if(!len) + len = strlen((const char*)text); + s = RAPTOR_MALLOC(unsigned char*, len + 1); + if(s) { + memcpy(s, text, len); + s[len] = '\0'; + } + return s; +} + + +static unsigned char * +turtle_copy_string_token(raptor_parser* rdf_parser, + unsigned char *string, size_t len, int delim) +{ + raptor_stringbuffer* sb = NULL; + int rc; + + if(len) { + sb = raptor_new_stringbuffer(); + if(!sb) + return NULL; + + rc = raptor_stringbuffer_append_turtle_string(sb, string, len, delim, + (raptor_simple_message_handler)turtle_lexer_syntax_error, + rdf_parser, 0); + if(rc) { + raptor_free_stringbuffer(sb); + return NULL; + } + + len = raptor_stringbuffer_length(sb); + } + + string = RAPTOR_MALLOC(unsigned char*, len + 1); + if(string) { + if(sb) + raptor_stringbuffer_copy_to_string(sb, string, len+1); + string[len]='\0'; + } + + if(sb) + raptor_free_stringbuffer(sb); + + return string; +} + + +void +turtle_lexer_syntax_error(void* ctx, const char *message, ...) +{ + raptor_parser* rdf_parser = (raptor_parser *)ctx; + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + va_list arguments; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + va_start(arguments, message); + raptor_parser_log_error_varargs(((raptor_parser*)rdf_parser), + RAPTOR_LOG_LEVEL_ERROR, message, arguments); + + va_end(arguments); +} + + +/* + * turtle_lexer_error: + * @yyscanner: scanner object + * @level: log level RAPTOR_LOG_LEVEL_FATAL otherwise error + * @message: erro message + * + * INTERNAL - replacement for the generated error handler. + */ +static void turtle_lexer_error(yyscan_t yyscanner, + raptor_log_level level, + yyconst char *message, ...) +{ + raptor_parser *rdf_parser = NULL; + va_list arguments; + + va_start(arguments, message); + + if(yyscanner) + rdf_parser = (raptor_parser*)turtle_lexer_get_extra(yyscanner); + + /* This handles NULL rdf_parser properly */ + raptor_parser_log_error_varargs(rdf_parser, level, message, arguments); + + va_end(arguments); +} + + +/* Define LEXER_ALLOC_TRACKING to enable allocated memory tracking + * - fixes lexer memory leak when ensure_buffer_stack fails + */ + +#ifdef LEXER_ALLOC_TRACKING +typedef struct { + /* Number of void* slots allocated */ + int lexer_allocs_size; + /* Allocted void* slots follow in memory after this header */ +} lexer_alloc_tracker_header; + +/* Initial alloc tracker slot array size - 2 seems to be enough for almost all cases */ +static const int initial_lexer_allocs_size = 2; +#endif + +/* + * turtle_lexer_cleanup: + * @yyscanner: + * + * INTERNAL - Clean up unfreed lexer allocs if LEXER_ALLOC_TRACKING is enabled. + */ +static void turtle_lexer_cleanup(yyscan_t yyscanner) +{ +#ifdef LEXER_ALLOC_TRACKING + raptor_parser *rdf_parser; + lexer_alloc_tracker_header *tracker; + void **lexer_allocs; + int i; + + if(!yyscanner) + return; + + rdf_parser = (raptor_parser *)turtle_lexer_get_extra(yyscanner); + if(!rdf_parser) + return; + + tracker = (lexer_alloc_tracker_header *)rdf_parser->lexer_user_data; + if(!tracker) + return; + lexer_allocs = (void**)&tracker[1]; + + for(i = 0; i < tracker->lexer_allocs_size; ++i) { + if(lexer_allocs[i]) + free(lexer_allocs[i]); + lexer_allocs[i] = NULL; + } + free(rdf_parser->lexer_user_data); + rdf_parser->lexer_user_data = NULL; +#endif +} + + +/* + * turtle_lexer_alloc: + * @size + * @yyscanner + * + * INTERNAL - alloc replacement. + * Tracks allocated cells if LEXER_ALLOC_TRACKING is enabled. + */ +void *turtle_lexer_alloc(yy_size_t size, yyscan_t yyscanner) +{ +#ifdef LEXER_ALLOC_TRACKING + raptor_parser *rdf_parser; + lexer_alloc_tracker_header *tracker; + void **lexer_allocs; + int i; + void *ptr; + + /* yyscanner not initialized -> probably initializing yyscanner itself + * -> just malloc without tracking + */ + if(!yyscanner) + return malloc(size); + + rdf_parser = (raptor_parser *)turtle_lexer_get_extra(yyscanner); + if(!rdf_parser) + YY_FATAL_ERROR("lexer_alloc: yyscanner extra not initialized"); + + /* try to allocate tracker if it does not exist */ + tracker = (lexer_alloc_tracker_header *)rdf_parser->lexer_user_data; + if(!tracker) { + /* allocate tracker header + array of void* slots */ + tracker = (lexer_alloc_tracker_header*)calloc(1, sizeof(lexer_alloc_tracker_header)+initial_lexer_allocs_size*sizeof(void*)); + if(!tracker) + YY_FATAL_ERROR("lexer_alloc: cannot allocate tracker"); + tracker->lexer_allocs_size = initial_lexer_allocs_size; + rdf_parser->lexer_user_data = (void *)tracker; + } + lexer_allocs = (void**)&tracker[1]; + + /* allocate memory */ + ptr = malloc(size); + + /* find a free slot for ptr */ + for(i = 0; i < tracker->lexer_allocs_size; ++i) { + if(!lexer_allocs[i]) { + lexer_allocs[i] = ptr; + break; + } + } + + /* no free slots -> grow tracker slot array */ + if(i>=tracker->lexer_allocs_size) { + int j; + void **dest; + tracker = (lexer_alloc_tracker_header*)calloc(1, sizeof(lexer_alloc_tracker_header)+i*2*sizeof(void*)); + if(!tracker) { + if(ptr) + free(ptr); + YY_FATAL_ERROR("lexer_alloc: cannot grow tracker"); + } + tracker->lexer_allocs_size = i*2; + + /* copy data from old tracker */ + dest = (void**)&tracker[1]; + for(j = 0; j < i; ++j) { + dest[j] = lexer_allocs[j]; + } + + /* set new item to first free slot */ + dest[j] = ptr; + + /* free old tracker and replace with new one */ + free(rdf_parser->lexer_user_data); + rdf_parser->lexer_user_data = tracker; + } + + return ptr; +#else + return malloc(size); +#endif +} + + +/* + * turtle_lexer_realloc: + * + * INTERNAL - realloc replacement + * Tracks allocated cells if LEXER_ALLOC_TRACKING is enabled. + */ +void *turtle_lexer_realloc(void *ptr, yy_size_t size, yyscan_t yyscanner) +{ +#ifdef LEXER_ALLOC_TRACKING + raptor_parser *rdf_parser; + lexer_alloc_tracker_header *tracker; + void **lexer_allocs; + int i; + void *newptr; + + if(!yyscanner) + YY_FATAL_ERROR("lexer_realloc: yyscanner not initialized"); + + rdf_parser = (raptor_parser *)turtle_lexer_get_extra(yyscanner); + if(!rdf_parser) + YY_FATAL_ERROR("lexer_realloc: yyscanner extra not initialized"); + + tracker = (lexer_alloc_tracker_header *)rdf_parser->lexer_user_data; + if(!tracker) + YY_FATAL_ERROR("lexer_realloc: no alloc tracker"); + lexer_allocs = (void**)&tracker[1]; + + /* find the old slot for ptr */ + for(i = 0; i < tracker->lexer_allocs_size; ++i) { + if(lexer_allocs[i] == ptr) + break; + } + + /* no old slot -> error */ + if(i>=tracker->lexer_allocs_size) + YY_FATAL_ERROR("lexer_realloc: cell not in tracker"); + + /* realloc */ + newptr = realloc((char*)ptr, size); + + /* replace entry in tracker */ + lexer_allocs[i] = newptr; + + return newptr; +#else + return realloc((char*)ptr, size); +#endif +} + + +/* + * turtle_lexer_free: + * + * INTERNAL - free replacement. + * Checks for NULL pointer to be freed unlike the default lexer free function. + * Tracks allocated cells if LEXER_ALLOC_TRACKING is enabled. + */ +void turtle_lexer_free(void *ptr, yyscan_t yyscanner) +{ +#ifdef LEXER_ALLOC_TRACKING + raptor_parser *rdf_parser; + lexer_alloc_tracker_header *tracker; + void **lexer_allocs; + int i; + + /* do not free NULL */ + if(!ptr) + return; + + /* free ptr even if we would encounter an error */ + free(ptr); + + /* yyscanner is allocated with turtle_lexer_alloc() but it's never stored in the tracker + * - we need yyscanner to access the tracker */ + if(!yyscanner || ptr == yyscanner) + return; + + rdf_parser = (raptor_parser *)turtle_lexer_get_extra(yyscanner); + if(!rdf_parser) + return; + + tracker = (lexer_alloc_tracker_header *)rdf_parser->lexer_user_data; + if(!tracker) + return; + lexer_allocs = (void**)&tracker[1]; + + /* find the slot for ptr */ + for(i = 0; i < tracker->lexer_allocs_size; ++i) { + if(lexer_allocs[i] == ptr) + break; + } + + /* no slot -> error */ + if(i>=tracker->lexer_allocs_size) + YY_FATAL_ERROR("lexer_free: cell not in tracker"); + + /* remove entry from tracker */ + lexer_allocs[i] = NULL; +#else + if(ptr) + free(ptr); +#endif +} + + +#ifdef RAPTOR_DEBUG + +const char * +turtle_token_print(raptor_world* world, int token, YYSTYPE *lval) +{ + #define TTP_DEBUG_BUFFER_SIZE 2048 + static char buffer[TTP_DEBUG_BUFFER_SIZE]; + + if(!token) + return "<<EOF>>"; + + switch(token) { + case PREFIX: + return "PREFIX"; + + case BASE: + return "BASE"; + + case A: + return "A"; + + case DOT: + return "DOT"; + + case COMMA: + return "COMMA"; + + case SEMICOLON: + return "SEMICOLON"; + + case LEFT_SQUARE: + return "LEFT_SQUARE"; + + case RIGHT_SQUARE: + return "RIGHT_SQUARE"; + + case HAT: + return "HAT"; + + case STRING_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "STRING_LITERAL(%s)", + lval->string); + return buffer; + + case URI_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "URI_LITERAL(%s)", + (lval->uri ? (char*)raptor_uri_as_string(lval->uri) : "")); + return buffer; + + case BLANK_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "BLANK_LITERAL(%s)", + lval->string); + return buffer; + + case QNAME_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "QNAME_LITERAL(%s)", + (lval->uri ? (char*)raptor_uri_as_string(lval->uri) : "")); + return buffer; + + case INTEGER_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "INTEGER_LITERAL(%s)", + lval->string); + return buffer; + + case FLOATING_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "FLOATING_LITERAL(%s)", + lval->string); + return buffer; + + case IDENTIFIER: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "IDENTIFIER(%s)", + (lval->string ? (char*)lval->string : "")); + return buffer; + + case LANGTAG: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "LANGTAG(%s)", + (lval->string ? (char*)lval->string : "")); + return buffer; + + case DECIMAL_LITERAL: + snprintf(buffer, TTP_DEBUG_BUFFER_SIZE, "DECIMAL_LITERAL(%s)", + lval->string); + return buffer; + + case ERROR_TOKEN: + return "ERROR"; + + case LEFT_CURLY: + return "{"; + + case RIGHT_CURLY: + return "}"; + + case GRAPH_NAME_LEFT_CURLY: + return "GRAPH_NAME {"; + + default: + RAPTOR_DEBUG2("UNKNOWN token %d - add a new case\n", token); + return "(UNKNOWN)"; + } +} +#endif + + + +void +turtle_token_free(raptor_world* world, int token, YYSTYPE *lval) +{ + if(!token) + return; + + switch(token) { + case STRING_LITERAL: + case BLANK_LITERAL: + case IDENTIFIER: + if(lval->string) + RAPTOR_FREE(char*, lval->string); + break; + + case URI_LITERAL: + case QNAME_LITERAL: + if(lval->uri) + raptor_free_uri(lval->uri); + break; + default: + break; + } +} + + +#ifdef STANDALONE + +#define FILE_READ_BUF_SIZE 4096 + +int +main(int argc, char *argv[]) +{ + char *turtle_string = NULL; + raptor_parser rdf_parser; + raptor_turtle_parser turtle_parser; + yyscan_t scanner; + int token = EOF; + YYSTYPE lval; + const unsigned char *uri_string; + const char *filename = NULL; + char *buf = NULL; + size_t len; + raptor_world* world; + FILE *fh; + + world = raptor_new_world(); + + if(argc > 1) { + filename = argv[1]; + fh = fopen(filename, "r"); + if(!fh) { + fprintf(stderr, "%s: Cannot open file %s - %s\n", argv[0], filename, + strerror(errno)); + exit(1); + } + } else { + filename="<stdin>"; + fh = (FILE*)stdin; + } + + turtle_string = RAPTOR_CALLOC(char*, FILE_READ_BUF_SIZE, 1); + fread(turtle_string, FILE_READ_BUF_SIZE, 1, fh); + fclose(fh); + + memset(&rdf_parser, 0, sizeof(rdf_parser)); + memset(&turtle_parser, 0, sizeof(turtle_parser)); + + rdf_parser.world = world; + + /* discard namespace errors - caused by not interpreting @prefix + * and hence causing failed qname construction + */ + raptor_namespaces_init(rdf_parser.world, &turtle_parser.namespaces, 0); + + yylex_init(&turtle_parser.scanner); + scanner = turtle_parser.scanner; + + len = strlen(RAPTOR_GOOD_CAST(const char*, turtle_string)); + buf = RAPTOR_MALLOC(char*, len + 3); + memcpy(buf, turtle_string, len); + buf[len] = ' '; + buf[len + 1] = buf[len + 2] = '\0'; /* YY_END_OF_BUFFER_CHAR; */ + (void)turtle_lexer__scan_buffer(buf, len + 3, scanner); + + turtle_lexer_set_extra(&rdf_parser, scanner); + + /* Initialise enough of the parser and locator to get error messages */ + rdf_parser.context = &turtle_parser; + turtle_parser.lineno = 1; + rdf_parser.locator.file = filename; + rdf_parser.locator.column = -1; + + uri_string = raptor_uri_filename_to_uri_string(filename); + rdf_parser.base_uri = raptor_new_uri(world, uri_string); + RAPTOR_FREE(char*, uri_string); + + while(1) { + memset(&lval, 0, sizeof(YYSTYPE)); + if(turtle_lexer_get_text(scanner) != NULL) + printf("yyinput '%s'\n", turtle_lexer_get_text(scanner)); + token = yylex(&lval, scanner); +#ifdef RAPTOR_DEBUG + printf("token %s\n", turtle_token_print(world, token, &lval)); +#else + printf("token %d\n", token); +#endif + turtle_token_free(world, token, &lval); + if(!token || token == EOF || token == ERROR_TOKEN) + break; + } + + if(buf) + RAPTOR_FREE(char*, buf); + + yylex_destroy(scanner); + + raptor_namespaces_clear(&turtle_parser.namespaces); + + raptor_free_uri(rdf_parser.base_uri); + + RAPTOR_FREE(char*, turtle_string); + + raptor_free_world(world); + + + if(token == ERROR_TOKEN) + return 1; + + return 0; +} +#endif diff --git a/src/turtle_parser.c b/src/turtle_parser.c new file mode 100644 index 0000000..bb2fbba --- /dev/null +++ b/src/turtle_parser.c @@ -0,0 +1,4037 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 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, see <https://www.gnu.org/licenses/>. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output, and Bison version. */ +#define YYBISON 30802 + +/* Bison version string. */ +#define YYBISON_VERSION "3.8.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 2 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + +/* Substitute the type names. */ +#define YYSTYPE TURTLE_PARSER_STYPE +/* Substitute the variable and function names. */ +#define yyparse turtle_parser_parse +#define yylex turtle_parser_lex +#define yyerror turtle_parser_error +#define yydebug turtle_parser_debug +#define yynerrs turtle_parser_nerrs + +/* First part of user prologue. */ +#line 31 "./turtle_parser.y" + +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#include "raptor2.h" +#include "raptor_internal.h" + +#include <turtle_parser.h> + +#define YY_NO_UNISTD_H 1 +#undef yylex +#include <turtle_lexer.h> + +#include <turtle_common.h> + + +/* Set RAPTOR_DEBUG to 3 for super verbose parsing - watching the shift/reduces */ +#if 0 +#undef RAPTOR_DEBUG +#define RAPTOR_DEBUG 3 +#endif + + +/* Fail with an debug error message if RAPTOR_DEBUG > 1 */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 +#define YYERROR_MSG(msg) do { fputs("** YYERROR ", RAPTOR_DEBUG_FH); fputs(msg, RAPTOR_DEBUG_FH); fputc('\n', RAPTOR_DEBUG_FH); YYERROR; } while(0) +#else +#define YYERROR_MSG(ignore) YYERROR +#endif +#define YYERR_MSG_GOTO(label,msg) do { errmsg = msg; goto label; } while(0) + +/* Slow down the grammar operation and watch it work */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 +#undef YYDEBUG +#define YYDEBUG 1 +#endif + +#ifdef RAPTOR_DEBUG +const char * turtle_token_print(raptor_world* world, int token, + TURTLE_PARSER_STYPE *lval); +#endif + + +/* the lexer does not seem to track this */ +#undef RAPTOR_TURTLE_USE_ERROR_COLUMNS + +/* set api.push-pull to "push" if this is defined */ +#undef TURTLE_PUSH_PARSE + +/* Prototypes */ +int turtle_parser_error(raptor_parser* rdf_parser, void* scanner, const char *msg); +static void turtle_parser_error_simple(void* user_data, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +/* Make lex/yacc interface as small as possible */ +#undef yylex +#define yylex turtle_lexer_lex + +/* Prototypes for local functions */ +static void raptor_turtle_generate_statement(raptor_parser *parser, raptor_statement *triple); + +static void raptor_turtle_defer_statement(raptor_parser *parser, raptor_statement *triple); + +static void raptor_turtle_handle_statement(raptor_parser *parser, raptor_statement *triple); + + +#line 155 "turtle_parser.c" + +# ifndef YY_CAST +# ifdef __cplusplus +# define YY_CAST(Type, Val) static_cast<Type> (Val) +# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val) +# else +# define YY_CAST(Type, Val) ((Type) (Val)) +# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) +# endif +# endif +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +#include <turtle_parser.h> +/* Symbol kind. */ +enum yysymbol_kind_t +{ + YYSYMBOL_YYEMPTY = -2, + YYSYMBOL_YYEOF = 0, /* "end of file" */ + YYSYMBOL_YYerror = 1, /* error */ + YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ + YYSYMBOL_A = 3, /* "a" */ + YYSYMBOL_HAT = 4, /* "^" */ + YYSYMBOL_DOT = 5, /* "." */ + YYSYMBOL_COMMA = 6, /* "," */ + YYSYMBOL_SEMICOLON = 7, /* ";" */ + YYSYMBOL_LEFT_SQUARE = 8, /* "[" */ + YYSYMBOL_RIGHT_SQUARE = 9, /* "]" */ + YYSYMBOL_LEFT_ROUND = 10, /* "(" */ + YYSYMBOL_RIGHT_ROUND = 11, /* ")" */ + YYSYMBOL_LEFT_CURLY = 12, /* "{" */ + YYSYMBOL_RIGHT_CURLY = 13, /* "}" */ + YYSYMBOL_TRUE_TOKEN = 14, /* "true" */ + YYSYMBOL_FALSE_TOKEN = 15, /* "false" */ + YYSYMBOL_PREFIX = 16, /* "@prefix" */ + YYSYMBOL_BASE = 17, /* "@base" */ + YYSYMBOL_SPARQL_PREFIX = 18, /* "PREFIX" */ + YYSYMBOL_SPARQL_BASE = 19, /* "BASE" */ + YYSYMBOL_STRING_LITERAL = 20, /* "string literal" */ + YYSYMBOL_IDENTIFIER = 21, /* "identifier" */ + YYSYMBOL_LANGTAG = 22, /* "langtag" */ + YYSYMBOL_INTEGER_LITERAL = 23, /* "integer literal" */ + YYSYMBOL_FLOATING_LITERAL = 24, /* "floating point literal" */ + YYSYMBOL_DECIMAL_LITERAL = 25, /* "decimal literal" */ + YYSYMBOL_BLANK_LITERAL = 26, /* "blank node" */ + YYSYMBOL_URI_LITERAL = 27, /* "URI literal" */ + YYSYMBOL_GRAPH_NAME_LEFT_CURLY = 28, /* "Graph URI literal {" */ + YYSYMBOL_QNAME_LITERAL = 29, /* "QName" */ + YYSYMBOL_ERROR_TOKEN = 30, /* ERROR_TOKEN */ + YYSYMBOL_YYACCEPT = 31, /* $accept */ + YYSYMBOL_Document = 32, /* Document */ + YYSYMBOL_graph = 33, /* graph */ + YYSYMBOL_34_1 = 34, /* $@1 */ + YYSYMBOL_35_2 = 35, /* $@2 */ + YYSYMBOL_graphBody = 36, /* graphBody */ + YYSYMBOL_triplesList = 37, /* triplesList */ + YYSYMBOL_dotTriplesList = 38, /* dotTriplesList */ + YYSYMBOL_statementList = 39, /* statementList */ + YYSYMBOL_statement = 40, /* statement */ + YYSYMBOL_triples = 41, /* triples */ + YYSYMBOL_objectList = 42, /* objectList */ + YYSYMBOL_itemList = 43, /* itemList */ + YYSYMBOL_verb = 44, /* verb */ + YYSYMBOL_predicateObjectList = 45, /* predicateObjectList */ + YYSYMBOL_directive = 46, /* directive */ + YYSYMBOL_prefix = 47, /* prefix */ + YYSYMBOL_base = 48, /* base */ + YYSYMBOL_subject = 49, /* subject */ + YYSYMBOL_predicate = 50, /* predicate */ + YYSYMBOL_object = 51, /* object */ + YYSYMBOL_literal = 52, /* literal */ + YYSYMBOL_resource = 53, /* resource */ + YYSYMBOL_predicateObjectListOpt = 54, /* predicateObjectListOpt */ + YYSYMBOL_blankNode = 55, /* blankNode */ + YYSYMBOL_blankNodePropertyList = 56, /* blankNodePropertyList */ + YYSYMBOL_collection = 57 /* collection */ +}; +typedef enum yysymbol_kind_t yysymbol_kind_t; + + + + +#ifdef short +# undef short +#endif + +/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure + <limits.h> and (if available) <stdint.h> are included + so that the code can choose integer types of a good width. */ + +#ifndef __PTRDIFF_MAX__ +# include <limits.h> /* INFRINGES ON USER NAME SPACE */ +# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include <stdint.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_STDINT_H +# endif +#endif + +/* Narrow types that promote to a signed type and that can represent a + signed or unsigned integer of at least N bits. In tables they can + save space and decrease cache pressure. Promoting to a signed type + helps avoid bugs in integer arithmetic. */ + +#ifdef __INT_LEAST8_MAX__ +typedef __INT_LEAST8_TYPE__ yytype_int8; +#elif defined YY_STDINT_H +typedef int_least8_t yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef __INT_LEAST16_MAX__ +typedef __INT_LEAST16_TYPE__ yytype_int16; +#elif defined YY_STDINT_H +typedef int_least16_t yytype_int16; +#else +typedef short yytype_int16; +#endif + +/* Work around bug in HP-UX 11.23, which defines these macros + incorrectly for preprocessor constants. This workaround can likely + be removed in 2023, as HPE has promised support for HP-UX 11.23 + (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of + <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ +#ifdef __hpux +# undef UINT_LEAST8_MAX +# undef UINT_LEAST16_MAX +# define UINT_LEAST8_MAX 255 +# define UINT_LEAST16_MAX 65535 +#endif + +#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST8_TYPE__ yytype_uint8; +#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST8_MAX <= INT_MAX) +typedef uint_least8_t yytype_uint8; +#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX +typedef unsigned char yytype_uint8; +#else +typedef short yytype_uint8; +#endif + +#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ +typedef __UINT_LEAST16_TYPE__ yytype_uint16; +#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ + && UINT_LEAST16_MAX <= INT_MAX) +typedef uint_least16_t yytype_uint16; +#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX +typedef unsigned short yytype_uint16; +#else +typedef int yytype_uint16; +#endif + +#ifndef YYPTRDIFF_T +# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ +# define YYPTRDIFF_T __PTRDIFF_TYPE__ +# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ +# elif defined PTRDIFF_MAX +# ifndef ptrdiff_t +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# endif +# define YYPTRDIFF_T ptrdiff_t +# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX +# else +# define YYPTRDIFF_T long +# define YYPTRDIFF_MAXIMUM LONG_MAX +# endif +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ +# include <stddef.h> /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM \ + YY_CAST (YYPTRDIFF_T, \ + (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ + ? YYPTRDIFF_MAXIMUM \ + : YY_CAST (YYSIZE_T, -1))) + +#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) + + +/* Stored state numbers (used for stacks). */ +typedef yytype_int8 yy_state_t; + +/* State numbers in computations. */ +typedef int yy_state_fast_t; + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include <libintl.h> /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + + +#ifndef YY_ATTRIBUTE_PURE +# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) +# else +# define YY_ATTRIBUTE_PURE +# endif +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +# else +# define YY_ATTRIBUTE_UNUSED +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YY_USE(E) ((void) (E)) +#else +# define YY_USE(E) /* empty */ +#endif + +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ +# if __GNUC__ * 100 + __GNUC_MINOR__ < 407 +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") +# else +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# endif +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + +#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ +# define YY_IGNORE_USELESS_CAST_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") +# define YY_IGNORE_USELESS_CAST_END \ + _Pragma ("GCC diagnostic pop") +#endif +#ifndef YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_BEGIN +# define YY_IGNORE_USELESS_CAST_END +#endif + + +#define YY_ASSERT(E) ((void) (0 && (E))) + +#if 1 + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include <alloca.h> /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include <malloc.h> /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +# endif +# endif +# endif +#endif /* 1 */ + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined TURTLE_PARSER_STYPE_IS_TRIVIAL && TURTLE_PARSER_STYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yy_state_t yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYPTRDIFF_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / YYSIZEOF (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYPTRDIFF_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 147 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 31 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 27 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 64 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 88 + +/* YYMAXUTOK -- Last valid token kind. */ +#define YYMAXUTOK 285 + + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + (0 <= (YYX) && (YYX) <= YYMAXUTOK \ + ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ + : YYSYMBOL_YYUNDEF) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_int8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30 +}; + +#if TURTLE_PARSER_DEBUG +/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_int16 yyrline[] = +{ + 0, 218, 218, 223, 222, 255, 254, 280, 281, 284, + 285, 288, 300, 314, 324, 325, 328, 329, 330, 363, + 399, 435, 442, 482, 526, 566, 610, 620, 633, 694, + 726, 737, 737, 740, 774, 811, 819, 829, 833, 837, + 844, 851, 855, 859, 863, 867, 880, 892, 915, 938, + 954, 969, 980, 993, 1006, 1023, 1036, 1052, 1066, 1083, + 1087, 1094, 1112, 1166, 1268 +}; +#endif + +/** Accessing symbol of state STATE. */ +#define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) + +#if 1 +/* The user-facing name of the symbol whose (internal) number is + YYSYMBOL. No bounds checking. */ +static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; + +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "\"end of file\"", "error", "\"invalid token\"", "\"a\"", "\"^\"", + "\".\"", "\",\"", "\";\"", "\"[\"", "\"]\"", "\"(\"", "\")\"", "\"{\"", + "\"}\"", "\"true\"", "\"false\"", "\"@prefix\"", "\"@base\"", + "\"PREFIX\"", "\"BASE\"", "\"string literal\"", "\"identifier\"", + "\"langtag\"", "\"integer literal\"", "\"floating point literal\"", + "\"decimal literal\"", "\"blank node\"", "\"URI literal\"", + "\"Graph URI literal {\"", "\"QName\"", "ERROR_TOKEN", "$accept", + "Document", "graph", "$@1", "$@2", "graphBody", "triplesList", + "dotTriplesList", "statementList", "statement", "triples", "objectList", + "itemList", "verb", "predicateObjectList", "directive", "prefix", "base", + "subject", "predicate", "object", "literal", "resource", + "predicateObjectListOpt", "blankNode", "blankNodePropertyList", + "collection", YY_NULLPTR +}; + +static const char * +yysymbol_name (yysymbol_kind_t yysymbol) +{ + return yytname[yysymbol]; +} +#endif + +#define YYPACT_NINF (-16) + +#define yypact_value_is_default(Yyn) \ + ((Yyn) == YYPACT_NINF) + +#define YYTABLE_NINF (-11) + +#define yytable_value_is_error(Yyn) \ + 0 + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int8 yypact[] = +{ + -16, 8, 9, -16, 11, 27, 78, -16, 12, 13, + 18, 14, -16, -16, -16, -16, -16, -16, 38, -16, + -16, -16, 27, -16, -16, 27, -16, -16, -16, 118, + 37, -16, -16, 36, -16, -16, -16, 7, -16, -16, + -16, 98, -16, -16, -16, -16, -16, -16, 5, 22, + 53, 33, -16, 5, -16, 37, -16, 55, -16, 27, + -16, -15, 59, -16, -16, 11, 49, -16, 60, -16, + 62, -16, -16, 51, 118, 118, -16, -16, -5, -16, + 58, -16, -16, -16, 55, -16, -16, -16 +}; + +/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_int8 yydefact[] = +{ + 15, 0, 0, 1, 14, 60, 0, 5, 0, 0, + 0, 0, 61, 57, 3, 58, 17, 13, 0, 16, + 31, 32, 0, 37, 38, 60, 39, 21, 27, 0, + 59, 26, 40, 0, 64, 55, 56, 51, 52, 53, + 54, 0, 25, 45, 41, 42, 44, 43, 0, 0, + 0, 0, 36, 0, 18, 19, 20, 29, 23, 30, + 62, 0, 46, 63, 24, 0, 0, 7, 9, 11, + 0, 35, 34, 0, 0, 0, 49, 50, 0, 6, + 0, 33, 4, 22, 28, 47, 48, 12 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int8 yypgoto[] = +{ + -16, -16, -16, -16, -16, 16, -16, -16, -16, -16, + 3, -3, -16, 15, 48, -16, -16, -16, -16, -16, + 1, -16, -2, 52, -1, 0, 2 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + 0, 1, 16, 53, 48, 66, 67, 68, 2, 17, + 69, 57, 41, 29, 30, 19, 20, 21, 22, 31, + 58, 43, 44, 33, 45, 46, 47 +}; + +/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int8 yytable[] = +{ + 23, 24, 25, 32, 26, 18, 65, 42, 3, -2, + 4, 61, 76, 5, 77, 6, 27, 5, -8, 6, + 32, 7, 85, 32, 86, 8, 9, 10, 11, 62, + 28, 12, 13, 49, 15, 12, 13, 14, 15, 51, + 50, 52, 64, 54, 59, 60, 23, 24, 25, 70, + 26, 23, 24, 25, 13, 26, 15, 32, 71, 65, + 72, 74, 79, 78, 82, 80, 5, 81, 6, 73, + 55, -10, 84, 0, 75, 83, 0, 56, 23, 24, + 25, 0, 26, 87, 12, 13, 5, 15, 6, 34, + 0, 0, 35, 36, 0, 0, 0, 0, 37, 0, + 0, 38, 39, 40, 12, 13, 5, 15, 6, 63, + 0, 0, 35, 36, 0, 0, 0, 0, 37, 0, + 0, 38, 39, 40, 12, 13, 5, 15, 6, 0, + 0, 0, 35, 36, 0, 0, 0, 0, 37, 0, + 0, 38, 39, 40, 12, 13, 0, 15 +}; + +static const yytype_int8 yycheck[] = +{ + 2, 2, 2, 5, 2, 2, 1, 6, 0, 0, + 1, 4, 27, 8, 29, 10, 5, 8, 13, 10, + 22, 12, 27, 25, 29, 16, 17, 18, 19, 22, + 3, 26, 27, 21, 29, 26, 27, 28, 29, 21, + 27, 27, 41, 5, 7, 9, 48, 48, 48, 27, + 48, 53, 53, 53, 27, 53, 29, 59, 5, 1, + 27, 6, 13, 4, 13, 5, 8, 5, 10, 53, + 22, 13, 75, -1, 59, 74, -1, 25, 80, 80, + 80, -1, 80, 80, 26, 27, 8, 29, 10, 11, + -1, -1, 14, 15, -1, -1, -1, -1, 20, -1, + -1, 23, 24, 25, 26, 27, 8, 29, 10, 11, + -1, -1, 14, 15, -1, -1, -1, -1, 20, -1, + -1, 23, 24, 25, 26, 27, 8, 29, 10, -1, + -1, -1, 14, 15, -1, -1, -1, -1, 20, -1, + -1, 23, 24, 25, 26, 27, -1, 29 +}; + +/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of + state STATE-NUM. */ +static const yytype_int8 yystos[] = +{ + 0, 32, 39, 0, 1, 8, 10, 12, 16, 17, + 18, 19, 26, 27, 28, 29, 33, 40, 41, 46, + 47, 48, 49, 53, 55, 56, 57, 5, 3, 44, + 45, 50, 53, 54, 11, 14, 15, 20, 23, 24, + 25, 43, 51, 52, 53, 55, 56, 57, 35, 21, + 27, 21, 27, 34, 5, 45, 54, 42, 51, 7, + 9, 4, 22, 11, 51, 1, 36, 37, 38, 41, + 27, 5, 27, 36, 6, 44, 27, 29, 4, 13, + 5, 5, 13, 51, 42, 27, 29, 41 +}; + +/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr1[] = +{ + 0, 31, 32, 34, 33, 35, 33, 36, 36, 37, + 37, 38, 38, 39, 39, 39, 40, 40, 40, 41, + 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, + 45, 46, 46, 47, 47, 48, 48, 49, 49, 49, + 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 53, 53, 54, + 54, 55, 56, 57, 57 +}; + +/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ +static const yytype_int8 yyr2[] = +{ + 0, 2, 1, 0, 4, 0, 4, 1, 0, 1, + 2, 1, 3, 2, 2, 0, 1, 1, 2, 2, + 2, 2, 3, 1, 2, 1, 1, 1, 4, 2, + 2, 1, 1, 4, 3, 3, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 2, 4, 4, 3, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 1, 3, 3, 2 +}; + + +enum { YYENOMEM = -2 }; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = TURTLE_PARSER_EMPTY) + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab +#define YYNOMEM goto yyexhaustedlab + + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == TURTLE_PARSER_EMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (rdf_parser, yyscanner, YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) + +/* Backward compatibility with an undocumented macro. + Use TURTLE_PARSER_error or TURTLE_PARSER_UNDEF. */ +#define YYERRCODE TURTLE_PARSER_UNDEF + + +/* Enable debugging if requested. */ +#if TURTLE_PARSER_DEBUG + +# ifndef YYFPRINTF +# include <stdio.h> /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + + + + +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Kind, Value, rdf_parser, yyscanner); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, raptor_parser* rdf_parser, void* yyscanner) +{ + FILE *yyoutput = yyo; + YY_USE (yyoutput); + YY_USE (rdf_parser); + YY_USE (yyscanner); + if (!yyvaluep) + return; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YY_USE (yykind); + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, + yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, raptor_parser* rdf_parser, void* yyscanner) +{ + YYFPRINTF (yyo, "%s %s (", + yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); + + yy_symbol_value_print (yyo, yykind, yyvaluep, rdf_parser, yyscanner); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, + int yyrule, raptor_parser* rdf_parser, void* yyscanner) +{ + int yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), + &yyvsp[(yyi + 1) - (yynrhs)], rdf_parser, yyscanner); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, rdf_parser, yyscanner); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !TURTLE_PARSER_DEBUG */ +# define YYDPRINTF(Args) ((void) 0) +# define YY_SYMBOL_PRINT(Title, Kind, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !TURTLE_PARSER_DEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + +/* Context of a parse error. */ +typedef struct +{ + yy_state_t *yyssp; + yysymbol_kind_t yytoken; +} yypcontext_t; + +/* Put in YYARG at most YYARGN of the expected tokens given the + current YYCTX, and return the number of tokens stored in YYARG. If + YYARG is null, return the number of expected tokens (guaranteed to + be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. + Return 0 if there are more than YYARGN expected tokens, yet fill + YYARG up to YYARGN. */ +static int +yypcontext_expected_tokens (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + int yyn = yypact[+*yyctx->yyssp]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (!yyarg) + ++yycount; + else if (yycount == yyargn) + return 0; + else + yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); + } + } + if (yyarg && yycount == 0 && 0 < yyargn) + yyarg[0] = YYSYMBOL_YYEMPTY; + return yycount; +} + + + + +#ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) +# else +/* Return the length of YYSTR. */ +static YYPTRDIFF_T +yystrlen (const char *yystr) +{ + YYPTRDIFF_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +#endif + +#ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +#endif + +#ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYPTRDIFF_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYPTRDIFF_T yyn = 0; + char const *yyp = yystr; + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (yyres) + return yystpcpy (yyres, yystr) - yyres; + else + return yystrlen (yystr); +} +#endif + + +static int +yy_syntax_error_arguments (const yypcontext_t *yyctx, + yysymbol_kind_t yyarg[], int yyargn) +{ + /* Actual size of YYARG. */ + int yycount = 0; + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yyctx->yytoken != YYSYMBOL_YYEMPTY) + { + int yyn; + if (yyarg) + yyarg[yycount] = yyctx->yytoken; + ++yycount; + yyn = yypcontext_expected_tokens (yyctx, + yyarg ? yyarg + 1 : yyarg, yyargn - 1); + if (yyn == YYENOMEM) + return YYENOMEM; + else + yycount += yyn; + } + return yycount; +} + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, + const yypcontext_t *yyctx) +{ + enum { YYARGS_MAX = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat: reported tokens (one for the "unexpected", + one per "expected"). */ + yysymbol_kind_t yyarg[YYARGS_MAX]; + /* Cumulated lengths of YYARG. */ + YYPTRDIFF_T yysize = 0; + + /* Actual size of YYARG. */ + int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); + if (yycount == YYENOMEM) + return YYENOMEM; + + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: /* Avoid compiler warnings. */ + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + /* Compute error message size. Don't count the "%s"s, but reserve + room for the terminator. */ + yysize = yystrlen (yyformat) - 2 * yycount + 1; + { + int yyi; + for (yyi = 0; yyi < yycount; ++yyi) + { + YYPTRDIFF_T yysize1 + = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return YYENOMEM; + } + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return -1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); + yyformat += 2; + } + else + { + ++yyp; + ++yyformat; + } + } + return 0; +} + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, + yysymbol_kind_t yykind, YYSTYPE *yyvaluep, raptor_parser* rdf_parser, void* yyscanner) +{ + YY_USE (yyvaluep); + YY_USE (rdf_parser); + YY_USE (yyscanner); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + switch (yykind) + { + case YYSYMBOL_STRING_LITERAL: /* "string literal" */ +#line 196 "./turtle_parser.y" + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1285 "turtle_parser.c" + break; + + case YYSYMBOL_IDENTIFIER: /* "identifier" */ +#line 196 "./turtle_parser.y" + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1294 "turtle_parser.c" + break; + + case YYSYMBOL_LANGTAG: /* "langtag" */ +#line 196 "./turtle_parser.y" + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1303 "turtle_parser.c" + break; + + case YYSYMBOL_INTEGER_LITERAL: /* "integer literal" */ +#line 196 "./turtle_parser.y" + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1312 "turtle_parser.c" + break; + + case YYSYMBOL_FLOATING_LITERAL: /* "floating point literal" */ +#line 196 "./turtle_parser.y" + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1321 "turtle_parser.c" + break; + + case YYSYMBOL_DECIMAL_LITERAL: /* "decimal literal" */ +#line 196 "./turtle_parser.y" + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1330 "turtle_parser.c" + break; + + case YYSYMBOL_BLANK_LITERAL: /* "blank node" */ +#line 196 "./turtle_parser.y" + { + if(((*yyvaluep).string)) + RAPTOR_FREE(char*, ((*yyvaluep).string)); +} +#line 1339 "turtle_parser.c" + break; + + case YYSYMBOL_URI_LITERAL: /* "URI literal" */ +#line 201 "./turtle_parser.y" + { + if(((*yyvaluep).uri)) + raptor_free_uri(((*yyvaluep).uri)); +} +#line 1348 "turtle_parser.c" + break; + + case YYSYMBOL_GRAPH_NAME_LEFT_CURLY: /* "Graph URI literal {" */ +#line 201 "./turtle_parser.y" + { + if(((*yyvaluep).uri)) + raptor_free_uri(((*yyvaluep).uri)); +} +#line 1357 "turtle_parser.c" + break; + + case YYSYMBOL_QNAME_LITERAL: /* "QName" */ +#line 201 "./turtle_parser.y" + { + if(((*yyvaluep).uri)) + raptor_free_uri(((*yyvaluep).uri)); +} +#line 1366 "turtle_parser.c" + break; + + case YYSYMBOL_triples: /* triples */ +#line 211 "./turtle_parser.y" + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1375 "turtle_parser.c" + break; + + case YYSYMBOL_objectList: /* objectList */ +#line 211 "./turtle_parser.y" + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1384 "turtle_parser.c" + break; + + case YYSYMBOL_itemList: /* itemList */ +#line 211 "./turtle_parser.y" + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1393 "turtle_parser.c" + break; + + case YYSYMBOL_verb: /* verb */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1402 "turtle_parser.c" + break; + + case YYSYMBOL_predicateObjectList: /* predicateObjectList */ +#line 211 "./turtle_parser.y" + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1411 "turtle_parser.c" + break; + + case YYSYMBOL_subject: /* subject */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1420 "turtle_parser.c" + break; + + case YYSYMBOL_predicate: /* predicate */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1429 "turtle_parser.c" + break; + + case YYSYMBOL_object: /* object */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1438 "turtle_parser.c" + break; + + case YYSYMBOL_literal: /* literal */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1447 "turtle_parser.c" + break; + + case YYSYMBOL_resource: /* resource */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1456 "turtle_parser.c" + break; + + case YYSYMBOL_predicateObjectListOpt: /* predicateObjectListOpt */ +#line 211 "./turtle_parser.y" + { + if(((*yyvaluep).sequence)) + raptor_free_sequence(((*yyvaluep).sequence)); +} +#line 1465 "turtle_parser.c" + break; + + case YYSYMBOL_blankNode: /* blankNode */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1474 "turtle_parser.c" + break; + + case YYSYMBOL_blankNodePropertyList: /* blankNodePropertyList */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1483 "turtle_parser.c" + break; + + case YYSYMBOL_collection: /* collection */ +#line 206 "./turtle_parser.y" + { + if(((*yyvaluep).identifier)) + raptor_free_term(((*yyvaluep).identifier)); +} +#line 1492 "turtle_parser.c" + break; + + default: + break; + } + YY_IGNORE_MAYBE_UNINITIALIZED_END +} + + + + + + +/*----------. +| yyparse. | +`----------*/ + +int +yyparse (raptor_parser* rdf_parser, void* yyscanner) +{ +/* Lookahead token kind. */ +int yychar; + + +/* The semantic value of the lookahead symbol. */ +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); + + /* Number of syntax errors so far. */ + int yynerrs = 0; + + yy_state_fast_t yystate = 0; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus = 0; + + /* Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* Their size. */ + YYPTRDIFF_T yystacksize = YYINITDEPTH; + + /* The state stack: array, bottom, top. */ + yy_state_t yyssa[YYINITDEPTH]; + yy_state_t *yyss = yyssa; + yy_state_t *yyssp = yyss; + + /* The semantic value stack: array, bottom, top. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp = yyvs; + + int yyn; + /* The return value of yyparse. */ + int yyresult; + /* Lookahead symbol kind. */ + yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yychar = TURTLE_PARSER_EMPTY; /* Cause a token to be read. */ + + goto yysetstate; + + +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ +yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + +/*--------------------------------------------------------------------. +| yysetstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + YY_ASSERT (0 <= yystate && yystate < YYNSTATES); + YY_IGNORE_USELESS_CAST_BEGIN + *yyssp = YY_CAST (yy_state_t, yystate); + YY_IGNORE_USELESS_CAST_END + YY_STACK_PRINT (yyss, yyssp); + + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + YYNOMEM; +#else + { + /* Get the current used size of the three stacks, in elements. */ + YYPTRDIFF_T yysize = yyssp - yyss + 1; + +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + yy_state_t *yyss1 = yyss; + YYSTYPE *yyvs1 = yyvs; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * YYSIZEOF (*yyssp), + &yyvs1, yysize * YYSIZEOF (*yyvsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + } +# else /* defined YYSTACK_RELOCATE */ + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + YYNOMEM; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yy_state_t *yyss1 = yyss; + union yyalloc *yyptr = + YY_CAST (union yyalloc *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); + if (! yyptr) + YYNOMEM; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YY_IGNORE_USELESS_CAST_BEGIN + YYDPRINTF ((stderr, "Stack size increased to %ld\n", + YY_CAST (long, yystacksize))); + YY_IGNORE_USELESS_CAST_END + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ + + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yypact_value_is_default (yyn)) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ + if (yychar == TURTLE_PARSER_EMPTY) + { + YYDPRINTF ((stderr, "Reading a token\n")); + yychar = yylex (&yylval, yyscanner); + } + + if (yychar <= TURTLE_PARSER_EOF) + { + yychar = TURTLE_PARSER_EOF; + yytoken = YYSYMBOL_YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else if (yychar == TURTLE_PARSER_error) + { + /* The scanner already issued an error message, process directly + to error recovery. But do not keep the error token as + lookahead, it is too special and may lead us to an endless + loop in error recovery. */ + yychar = TURTLE_PARSER_UNDEF; + yytoken = YYSYMBOL_YYerror; + goto yyerrlab1; + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + /* Discard the shifted token. */ + yychar = TURTLE_PARSER_EMPTY; + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 3: /* $@1: %empty */ +#line 223 "./turtle_parser.y" + { + /* action in mid-rule so this is run BEFORE the triples in graphBody */ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(!turtle_parser->trig) + turtle_parser_error(rdf_parser, yyscanner, "{ ... } is not allowed in Turtle"); + else { + if(turtle_parser->graph_name) + raptor_free_term(turtle_parser->graph_name); + turtle_parser->graph_name = raptor_new_term_from_uri(rdf_parser->world, (yyvsp[0].uri)); + raptor_free_uri((yyvsp[0].uri)); + raptor_parser_start_graph(rdf_parser, + turtle_parser->graph_name->value.uri, 1); + } + } +#line 1784 "turtle_parser.c" + break; + + case 4: /* graph: "Graph URI literal {" $@1 graphBody "}" */ +#line 240 "./turtle_parser.y" +{ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(turtle_parser->trig) { + raptor_parser_end_graph(rdf_parser, + turtle_parser->graph_name->value.uri, 1); + raptor_free_term(turtle_parser->graph_name); + turtle_parser->graph_name = NULL; + rdf_parser->emitted_default_graph = 0; + } +} +#line 1802 "turtle_parser.c" + break; + + case 5: /* $@2: %empty */ +#line 255 "./turtle_parser.y" + { + /* action in mid-rule so this is run BEFORE the triples in graphBody */ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(!turtle_parser->trig) + turtle_parser_error(rdf_parser, yyscanner, "{ ... } is not allowed in Turtle"); + else { + raptor_parser_start_graph(rdf_parser, NULL, 1); + rdf_parser->emitted_default_graph++; + } + } +#line 1819 "turtle_parser.c" + break; + + case 6: /* graph: "{" $@2 graphBody "}" */ +#line 268 "./turtle_parser.y" +{ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(turtle_parser->trig) { + raptor_parser_end_graph(rdf_parser, NULL, 1); + rdf_parser->emitted_default_graph = 0; + } +} +#line 1833 "turtle_parser.c" + break; + + case 11: /* dotTriplesList: triples */ +#line 289 "./turtle_parser.y" +{ + int i; + + if((yyvsp[0].sequence)) { + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + raptor_turtle_generate_statement(rdf_parser, t2); + } + raptor_free_sequence((yyvsp[0].sequence)); + } +} +#line 1849 "turtle_parser.c" + break; + + case 12: /* dotTriplesList: dotTriplesList "." triples */ +#line 301 "./turtle_parser.y" +{ + int i; + + if((yyvsp[0].sequence)) { + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + raptor_turtle_generate_statement(rdf_parser, t2); + } + raptor_free_sequence((yyvsp[0].sequence)); + } +} +#line 1865 "turtle_parser.c" + break; + + case 13: /* statementList: statementList statement */ +#line 315 "./turtle_parser.y" +{ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + /* sync up consumed/processed so we know what to unwind */ + turtle_parser->processed = turtle_parser->consumed; + turtle_parser->lineno_last_good = turtle_parser->lineno; +} +#line 1879 "turtle_parser.c" + break; + + case 18: /* statement: triples "." */ +#line 331 "./turtle_parser.y" +{ + raptor_turtle_parser* turtle_parser; + int i; + + /* yield deferred statements, if any */ + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(turtle_parser->deferred) { + raptor_sequence* def = turtle_parser->deferred; + + for(i = 0; i < raptor_sequence_size(def); i++) { + raptor_statement *t2 = (raptor_statement*)raptor_sequence_get_at(def, i); + + raptor_turtle_handle_statement(rdf_parser, t2); + } + } + + if((yyvsp[-1].sequence)) { + for(i = 0; i < raptor_sequence_size((yyvsp[-1].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[-1].sequence), i); + raptor_turtle_generate_statement(rdf_parser, t2); + } + raptor_free_sequence((yyvsp[-1].sequence)); + } + + if(turtle_parser->deferred) { + /* debrief resources */ + raptor_free_sequence(turtle_parser->deferred); + turtle_parser->deferred = NULL; + } +} +#line 1914 "turtle_parser.c" + break; + + case 19: /* triples: subject predicateObjectList */ +#line 364 "./turtle_parser.y" +{ + int i; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("triples 1\n subject="); + if((yyvsp[-1].identifier)) + raptor_term_print_as_ntriples((yyvsp[-1].identifier), stdout); + else + fputs("NULL", stdout); + if((yyvsp[0].sequence)) { + printf("\n predicateObjectList (reverse order to syntax)="); + raptor_sequence_print((yyvsp[0].sequence), stdout); + printf("\n"); + } else + printf("\n and empty predicateObjectList\n"); +#endif + + if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) { + /* have subject and non-empty property list, handle it */ + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + t2->subject = raptor_term_copy((yyvsp[-1].identifier)); + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution predicateObjectList="); + raptor_sequence_print((yyvsp[0].sequence), stdout); + printf("\n\n"); +#endif + } + + if((yyvsp[-1].identifier)) + raptor_free_term((yyvsp[-1].identifier)); + + (yyval.sequence) = (yyvsp[0].sequence); +} +#line 1954 "turtle_parser.c" + break; + + case 20: /* triples: blankNodePropertyList predicateObjectListOpt */ +#line 400 "./turtle_parser.y" +{ + int i; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("triples 2\n blankNodePropertyList="); + if((yyvsp[-1].identifier)) + raptor_term_print_as_ntriples((yyvsp[-1].identifier), stdout); + else + fputs("NULL", stdout); + if((yyvsp[0].sequence)) { + printf("\n predicateObjectListOpt (reverse order to syntax)="); + raptor_sequence_print((yyvsp[0].sequence), stdout); + printf("\n"); + } else + printf("\n and empty predicateObjectListOpt\n"); +#endif + + if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) { + /* have subject and non-empty predicate object list, handle it */ + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + t2->subject = raptor_term_copy((yyvsp[-1].identifier)); + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution predicateObjectListOpt="); + raptor_sequence_print((yyvsp[0].sequence), stdout); + printf("\n\n"); +#endif + } + + if((yyvsp[-1].identifier)) + raptor_free_term((yyvsp[-1].identifier)); + + (yyval.sequence) = (yyvsp[0].sequence); +} +#line 1994 "turtle_parser.c" + break; + + case 21: /* triples: error "." */ +#line 436 "./turtle_parser.y" +{ + (yyval.sequence) = NULL; +} +#line 2002 "turtle_parser.c" + break; + + case 22: /* objectList: objectList "," object */ +#line 443 "./turtle_parser.y" +{ + raptor_statement *triple; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("objectList 1\n"); + if((yyvsp[0].identifier)) { + printf(" object=\n"); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); + printf("\n"); + } else + printf(" and empty object\n"); + if((yyvsp[-2].sequence)) { + printf(" objectList="); + raptor_sequence_print((yyvsp[-2].sequence), stdout); + printf("\n"); + } else + printf(" and empty objectList\n"); +#endif + + if(!(yyvsp[0].identifier)) + (yyval.sequence) = NULL; + else { + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, (yyvsp[0].identifier), NULL); + if(!triple) { + raptor_free_sequence((yyvsp[-2].sequence)); + YYERROR; + } + if(raptor_sequence_push((yyvsp[-2].sequence), triple)) { + raptor_free_sequence((yyvsp[-2].sequence)); + YYERROR; + } + (yyval.sequence) = (yyvsp[-2].sequence); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" objectList is now "); + raptor_sequence_print((yyval.sequence), stdout); + printf("\n\n"); +#endif + } +} +#line 2046 "turtle_parser.c" + break; + + case 23: /* objectList: object */ +#line 483 "./turtle_parser.y" +{ + raptor_statement *triple; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("objectList 2\n"); + if((yyvsp[0].identifier)) { + printf(" object=\n"); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); + printf("\n"); + } else + printf(" and empty object\n"); +#endif + + if(!(yyvsp[0].identifier)) + (yyval.sequence) = NULL; + else { + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, (yyvsp[0].identifier), NULL); + if(!triple) + YYERROR; +#ifdef RAPTOR_DEBUG + (yyval.sequence) = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, + (raptor_data_print_handler)raptor_statement_print); +#else + (yyval.sequence) = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, NULL); +#endif + if(!(yyval.sequence)) { + raptor_free_statement(triple); + YYERROR; + } + if(raptor_sequence_push((yyval.sequence), triple)) { + raptor_free_sequence((yyval.sequence)); + (yyval.sequence) = NULL; + YYERROR; + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" objectList is now "); + raptor_sequence_print((yyval.sequence), stdout); + printf("\n\n"); +#endif + } +} +#line 2092 "turtle_parser.c" + break; + + case 24: /* itemList: itemList object */ +#line 527 "./turtle_parser.y" +{ + raptor_statement *triple; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("objectList 1\n"); + if((yyvsp[0].identifier)) { + printf(" object=\n"); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); + printf("\n"); + } else + printf(" and empty object\n"); + if((yyvsp[-1].sequence)) { + printf(" objectList="); + raptor_sequence_print((yyvsp[-1].sequence), stdout); + printf("\n"); + } else + printf(" and empty objectList\n"); +#endif + + if(!(yyvsp[0].identifier)) + (yyval.sequence) = NULL; + else { + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, (yyvsp[0].identifier), NULL); + if(!triple) { + raptor_free_sequence((yyvsp[-1].sequence)); + YYERROR; + } + if(raptor_sequence_push((yyvsp[-1].sequence), triple)) { + raptor_free_sequence((yyvsp[-1].sequence)); + YYERROR; + } + (yyval.sequence) = (yyvsp[-1].sequence); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" objectList is now "); + raptor_sequence_print((yyval.sequence), stdout); + printf("\n\n"); +#endif + } +} +#line 2136 "turtle_parser.c" + break; + + case 25: /* itemList: object */ +#line 567 "./turtle_parser.y" +{ + raptor_statement *triple; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("objectList 2\n"); + if((yyvsp[0].identifier)) { + printf(" object=\n"); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); + printf("\n"); + } else + printf(" and empty object\n"); +#endif + + if(!(yyvsp[0].identifier)) + (yyval.sequence) = NULL; + else { + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, (yyvsp[0].identifier), NULL); + if(!triple) + YYERROR; +#ifdef RAPTOR_DEBUG + (yyval.sequence) = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, + (raptor_data_print_handler)raptor_statement_print); +#else + (yyval.sequence) = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, NULL); +#endif + if(!(yyval.sequence)) { + raptor_free_statement(triple); + YYERROR; + } + if(raptor_sequence_push((yyval.sequence), triple)) { + raptor_free_sequence((yyval.sequence)); + (yyval.sequence) = NULL; + YYERROR; + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" objectList is now "); + raptor_sequence_print((yyval.sequence), stdout); + printf("\n\n"); +#endif + } +} +#line 2182 "turtle_parser.c" + break; + + case 26: /* verb: predicate */ +#line 611 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("verb predicate="); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); + printf("\n"); +#endif + + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2196 "turtle_parser.c" + break; + + case 27: /* verb: "a" */ +#line 621 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("verb predicate = rdf:type (a)\n"); +#endif + + (yyval.identifier) = raptor_term_copy(RAPTOR_RDF_type_term(rdf_parser->world)); + if(!(yyval.identifier)) + YYERROR; +} +#line 2210 "turtle_parser.c" + break; + + case 28: /* predicateObjectList: predicateObjectList ";" verb objectList */ +#line 634 "./turtle_parser.y" +{ + int i; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("predicateObjectList 1\n verb="); + raptor_term_print_as_ntriples((yyvsp[-1].identifier), stdout); + printf("\n objectList="); + raptor_sequence_print((yyvsp[0].sequence), stdout); + printf("\n predicateObjectList="); + raptor_sequence_print((yyvsp[-3].sequence), stdout); + printf("\n\n"); +#endif + + if((yyvsp[0].sequence) == NULL) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" empty objectList not processed\n"); +#endif + } else if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) { + /* non-empty property list, handle it */ + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + t2->predicate = raptor_term_copy((yyvsp[-1].identifier)); + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution objectList="); + raptor_sequence_print((yyvsp[0].sequence), stdout); + printf("\n"); +#endif + } + + if((yyvsp[-3].sequence) == NULL) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" empty predicateObjectList not copied\n\n"); +#endif + } else if((yyvsp[-1].identifier) && (yyvsp[0].sequence) && (yyvsp[-3].sequence)) { + while(raptor_sequence_size((yyvsp[0].sequence))) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_unshift((yyvsp[0].sequence)); + if(raptor_sequence_push((yyvsp[-3].sequence), t2)) { + raptor_free_sequence((yyvsp[-3].sequence)); + raptor_free_term((yyvsp[-1].identifier)); + raptor_free_sequence((yyvsp[0].sequence)); + YYERROR; + } + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after appending objectList (reverse order)="); + raptor_sequence_print((yyvsp[-3].sequence), stdout); + printf("\n\n"); +#endif + + raptor_free_sequence((yyvsp[0].sequence)); + } + + if((yyvsp[-1].identifier)) + raptor_free_term((yyvsp[-1].identifier)); + + (yyval.sequence) = (yyvsp[-3].sequence); +} +#line 2275 "turtle_parser.c" + break; + + case 29: /* predicateObjectList: verb objectList */ +#line 695 "./turtle_parser.y" +{ + int i; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("predicateObjectList 2\n verb="); + raptor_term_print_as_ntriples((yyvsp[-1].identifier), stdout); + if((yyvsp[0].sequence)) { + printf("\n objectList="); + raptor_sequence_print((yyvsp[0].sequence), stdout); + printf("\n"); + } else + printf("\n and empty objectList\n"); +#endif + + if((yyvsp[-1].identifier) && (yyvsp[0].sequence)) { + for(i = 0; i < raptor_sequence_size((yyvsp[0].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[0].sequence), i); + t2->predicate = raptor_term_copy((yyvsp[-1].identifier)); + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution objectList="); + raptor_sequence_print((yyvsp[0].sequence), stdout); + printf("\n\n"); +#endif + } + + if((yyvsp[-1].identifier)) + raptor_free_term((yyvsp[-1].identifier)); + + (yyval.sequence) = (yyvsp[0].sequence); +} +#line 2311 "turtle_parser.c" + break; + + case 30: /* predicateObjectList: predicateObjectList ";" */ +#line 727 "./turtle_parser.y" +{ + (yyval.sequence) = (yyvsp[-1].sequence); +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("predicateObjectList 5\n trailing semicolon returning existing list "); + raptor_sequence_print((yyval.sequence), stdout); + printf("\n\n"); +#endif +} +#line 2324 "turtle_parser.c" + break; + + case 33: /* prefix: "@prefix" "identifier" "URI literal" "." */ +#line 741 "./turtle_parser.y" +{ + unsigned char *prefix = (yyvsp[-2].string); + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(rdf_parser->context); + raptor_namespace *ns; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("directive PREFIX %s %s\n",((yyvsp[-2].string) ? (char*)(yyvsp[-2].string) : "(default)"), raptor_uri_as_string((yyvsp[-1].uri))); +#endif + + if(prefix) { + size_t len = strlen((const char*)prefix); + if(prefix[len-1] == ':') { + if(len == 1) + /* declaring default namespace prefix PREFIX : ... */ + prefix = NULL; + else + prefix[len-1]='\0'; + } + } + + ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, (yyvsp[-1].uri), 0); + if(ns) { + raptor_namespaces_start_namespace(&turtle_parser->namespaces, ns); + raptor_parser_start_namespace(rdf_parser, ns); + } + + if((yyvsp[-2].string)) + RAPTOR_FREE(char*, (yyvsp[-2].string)); + raptor_free_uri((yyvsp[-1].uri)); + + if(!ns) + YYERROR; +} +#line 2362 "turtle_parser.c" + break; + + case 34: /* prefix: "PREFIX" "identifier" "URI literal" */ +#line 775 "./turtle_parser.y" +{ + unsigned char *prefix = (yyvsp[-1].string); + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(rdf_parser->context); + raptor_namespace *ns; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("directive @prefix %s %s.\n",((yyvsp[-1].string) ? (char*)(yyvsp[-1].string) : "(default)"), raptor_uri_as_string((yyvsp[0].uri))); +#endif + + if(prefix) { + size_t len = strlen((const char*)prefix); + if(prefix[len-1] == ':') { + if(len == 1) + /* declaring default namespace prefix @prefix : ... */ + prefix = NULL; + else + prefix[len-1]='\0'; + } + } + + ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, (yyvsp[0].uri), 0); + if(ns) { + raptor_namespaces_start_namespace(&turtle_parser->namespaces, ns); + raptor_parser_start_namespace(rdf_parser, ns); + } + + if((yyvsp[-1].string)) + RAPTOR_FREE(char*, (yyvsp[-1].string)); + raptor_free_uri((yyvsp[0].uri)); + + if(!ns) + YYERROR; +} +#line 2400 "turtle_parser.c" + break; + + case 35: /* base: "@base" "URI literal" "." */ +#line 812 "./turtle_parser.y" +{ + raptor_uri *uri=(yyvsp[-1].uri); + + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; +} +#line 2412 "turtle_parser.c" + break; + + case 36: /* base: "BASE" "URI literal" */ +#line 820 "./turtle_parser.y" +{ + raptor_uri *uri=(yyvsp[0].uri); + + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; +} +#line 2424 "turtle_parser.c" + break; + + case 37: /* subject: resource */ +#line 830 "./turtle_parser.y" +{ + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2432 "turtle_parser.c" + break; + + case 38: /* subject: blankNode */ +#line 834 "./turtle_parser.y" +{ + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2440 "turtle_parser.c" + break; + + case 39: /* subject: collection */ +#line 838 "./turtle_parser.y" +{ + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2448 "turtle_parser.c" + break; + + case 40: /* predicate: resource */ +#line 845 "./turtle_parser.y" +{ + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2456 "turtle_parser.c" + break; + + case 41: /* object: resource */ +#line 852 "./turtle_parser.y" +{ + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2464 "turtle_parser.c" + break; + + case 42: /* object: blankNode */ +#line 856 "./turtle_parser.y" +{ + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2472 "turtle_parser.c" + break; + + case 43: /* object: collection */ +#line 860 "./turtle_parser.y" +{ + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2480 "turtle_parser.c" + break; + + case 44: /* object: blankNodePropertyList */ +#line 864 "./turtle_parser.y" +{ + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2488 "turtle_parser.c" + break; + + case 45: /* object: literal */ +#line 868 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("object literal="); + raptor_term_print_as_ntriples((yyvsp[0].identifier), stdout); + printf("\n"); +#endif + + (yyval.identifier) = (yyvsp[0].identifier); +} +#line 2502 "turtle_parser.c" + break; + + case 46: /* literal: "string literal" "langtag" */ +#line 881 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + language string=\"%s\"\n", (yyvsp[-1].string)); +#endif + + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-1].string), NULL, (yyvsp[0].string)); + RAPTOR_FREE(char*, (yyvsp[-1].string)); + RAPTOR_FREE(char*, (yyvsp[0].string)); + if(!(yyval.identifier)) + YYERROR; +} +#line 2518 "turtle_parser.c" + break; + + case 47: /* literal: "string literal" "langtag" "^" "URI literal" */ +#line 893 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + language=\"%s\" datatype string=\"%s\" uri=\"%s\"\n", (yyvsp[-3].string), (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri))); +#endif + + if((yyvsp[0].uri)) { + if((yyvsp[-2].string)) { + raptor_parser_error(rdf_parser, + "Language not allowed with datatyped literal"); + RAPTOR_FREE(char*, (yyvsp[-2].string)); + (yyvsp[-2].string) = NULL; + } + + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-3].string), (yyvsp[0].uri), NULL); + RAPTOR_FREE(char*, (yyvsp[-3].string)); + raptor_free_uri((yyvsp[0].uri)); + if(!(yyval.identifier)) + YYERROR; + } else + (yyval.identifier) = NULL; + +} +#line 2545 "turtle_parser.c" + break; + + case 48: /* literal: "string literal" "langtag" "^" "QName" */ +#line 916 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + language=\"%s\" datatype string=\"%s\" qname URI=<%s>\n", (yyvsp[-3].string), (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri))); +#endif + + if((yyvsp[0].uri)) { + if((yyvsp[-2].string)) { + raptor_parser_error(rdf_parser, + "Language not allowed with datatyped literal"); + RAPTOR_FREE(char*, (yyvsp[-2].string)); + (yyvsp[-2].string) = NULL; + } + + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-3].string), (yyvsp[0].uri), NULL); + RAPTOR_FREE(char*, (yyvsp[-3].string)); + raptor_free_uri((yyvsp[0].uri)); + if(!(yyval.identifier)) + YYERROR; + } else + (yyval.identifier) = NULL; + +} +#line 2572 "turtle_parser.c" + break; + + case 49: /* literal: "string literal" "^" "URI literal" */ +#line 939 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + datatype string=\"%s\" uri=\"%s\"\n", (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri))); +#endif + + if((yyvsp[0].uri)) { + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-2].string), (yyvsp[0].uri), NULL); + RAPTOR_FREE(char*, (yyvsp[-2].string)); + raptor_free_uri((yyvsp[0].uri)); + if(!(yyval.identifier)) + YYERROR; + } else + (yyval.identifier) = NULL; + +} +#line 2592 "turtle_parser.c" + break; + + case 50: /* literal: "string literal" "^" "QName" */ +#line 955 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + datatype string=\"%s\" qname URI=<%s>\n", (yyvsp[-2].string), raptor_uri_as_string((yyvsp[0].uri))); +#endif + + if((yyvsp[0].uri)) { + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[-2].string), (yyvsp[0].uri), NULL); + RAPTOR_FREE(char*, (yyvsp[-2].string)); + raptor_free_uri((yyvsp[0].uri)); + if(!(yyval.identifier)) + YYERROR; + } else + (yyval.identifier) = NULL; +} +#line 2611 "turtle_parser.c" + break; + + case 51: /* literal: "string literal" */ +#line 970 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal string=\"%s\"\n", (yyvsp[0].string)); +#endif + + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[0].string), NULL, NULL); + RAPTOR_FREE(char*, (yyvsp[0].string)); + if(!(yyval.identifier)) + YYERROR; +} +#line 2626 "turtle_parser.c" + break; + + case 52: /* literal: "integer literal" */ +#line 981 "./turtle_parser.y" +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource integer=%s\n", (yyvsp[0].string)); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_integer_uri); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[0].string), uri, NULL); + RAPTOR_FREE(char*, (yyvsp[0].string)); + raptor_free_uri(uri); + if(!(yyval.identifier)) + YYERROR; +} +#line 2643 "turtle_parser.c" + break; + + case 53: /* literal: "floating point literal" */ +#line 994 "./turtle_parser.y" +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource double=%s\n", (yyvsp[0].string)); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_double_uri); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[0].string), uri, NULL); + RAPTOR_FREE(char*, (yyvsp[0].string)); + raptor_free_uri(uri); + if(!(yyval.identifier)) + YYERROR; +} +#line 2660 "turtle_parser.c" + break; + + case 54: /* literal: "decimal literal" */ +#line 1007 "./turtle_parser.y" +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource decimal=%s\n", (yyvsp[0].string)); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_decimal_uri); + if(!uri) { + RAPTOR_FREE(char*, (yyvsp[0].string)); + YYERROR; + } + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, (yyvsp[0].string), uri, NULL); + RAPTOR_FREE(char*, (yyvsp[0].string)); + raptor_free_uri(uri); + if(!(yyval.identifier)) + YYERROR; +} +#line 2681 "turtle_parser.c" + break; + + case 55: /* literal: "true" */ +#line 1024 "./turtle_parser.y" +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fputs("resource boolean true\n", stderr); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_boolean_uri); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, + (const unsigned char*)"true", uri, NULL); + raptor_free_uri(uri); + if(!(yyval.identifier)) + YYERROR; +} +#line 2698 "turtle_parser.c" + break; + + case 56: /* literal: "false" */ +#line 1037 "./turtle_parser.y" +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fputs("resource boolean false\n", stderr); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_boolean_uri); + (yyval.identifier) = raptor_new_term_from_literal(rdf_parser->world, + (const unsigned char*)"false", uri, NULL); + raptor_free_uri(uri); + if(!(yyval.identifier)) + YYERROR; +} +#line 2715 "turtle_parser.c" + break; + + case 57: /* resource: "URI literal" */ +#line 1053 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource URI=<%s>\n", raptor_uri_as_string((yyvsp[0].uri))); +#endif + + if((yyvsp[0].uri)) { + (yyval.identifier) = raptor_new_term_from_uri(rdf_parser->world, (yyvsp[0].uri)); + raptor_free_uri((yyvsp[0].uri)); + if(!(yyval.identifier)) + YYERROR; + } else + (yyval.identifier) = NULL; +} +#line 2733 "turtle_parser.c" + break; + + case 58: /* resource: "QName" */ +#line 1067 "./turtle_parser.y" +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource qname URI=<%s>\n", raptor_uri_as_string((yyvsp[0].uri))); +#endif + + if((yyvsp[0].uri)) { + (yyval.identifier) = raptor_new_term_from_uri(rdf_parser->world, (yyvsp[0].uri)); + raptor_free_uri((yyvsp[0].uri)); + if(!(yyval.identifier)) + YYERROR; + } else + (yyval.identifier) = NULL; +} +#line 2751 "turtle_parser.c" + break; + + case 59: /* predicateObjectListOpt: predicateObjectList */ +#line 1084 "./turtle_parser.y" +{ + (yyval.sequence) = (yyvsp[0].sequence); +} +#line 2759 "turtle_parser.c" + break; + + case 60: /* predicateObjectListOpt: %empty */ +#line 1088 "./turtle_parser.y" +{ + (yyval.sequence) = NULL; +} +#line 2767 "turtle_parser.c" + break; + + case 61: /* blankNode: "blank node" */ +#line 1095 "./turtle_parser.y" +{ + const unsigned char *id; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("subject blank=\"%s\"\n", (yyvsp[0].string)); +#endif + id = raptor_world_internal_generate_id(rdf_parser->world, (yyvsp[0].string)); + if(!id) + YYERROR; + + (yyval.identifier) = raptor_new_term_from_blank(rdf_parser->world, id); + RAPTOR_FREE(char*, id); + + if(!(yyval.identifier)) + YYERROR; +} +#line 2787 "turtle_parser.c" + break; + + case 62: /* blankNodePropertyList: "[" predicateObjectListOpt "]" */ +#line 1113 "./turtle_parser.y" +{ + int i; + const unsigned char *id; + + id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!id) { + if((yyvsp[-1].sequence)) + raptor_free_sequence((yyvsp[-1].sequence)); + YYERROR; + } + + (yyval.identifier) = raptor_new_term_from_blank(rdf_parser->world, id); + RAPTOR_FREE(char*, id); + if(!(yyval.identifier)) { + if((yyvsp[-1].sequence)) + raptor_free_sequence((yyvsp[-1].sequence)); + YYERROR; + } + + if((yyvsp[-1].sequence) == NULL) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource\n predicateObjectList="); + raptor_term_print_as_ntriples((yyval.identifier), stdout); + printf("\n"); +#endif + } else { + /* non-empty property list, handle it */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource\n predicateObjectList="); + raptor_sequence_print((yyvsp[-1].sequence), stdout); + printf("\n"); +#endif + + for(i = 0; i < raptor_sequence_size((yyvsp[-1].sequence)); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[-1].sequence), i); + t2->subject = raptor_term_copy((yyval.identifier)); + raptor_turtle_defer_statement(rdf_parser, t2); + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution objectList="); + raptor_sequence_print((yyvsp[-1].sequence), stdout); + printf("\n\n"); +#endif + + raptor_free_sequence((yyvsp[-1].sequence)); + + } + +} +#line 2842 "turtle_parser.c" + break; + + case 63: /* collection: "(" itemList ")" */ +#line 1167 "./turtle_parser.y" +{ + int i; + raptor_world* world = rdf_parser->world; + raptor_term* first_identifier = NULL; + raptor_term* rest_identifier = NULL; + raptor_term* object = NULL; + raptor_term* blank = NULL; + char const *errmsg = NULL; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("collection\n objectList="); + raptor_sequence_print((yyvsp[-1].sequence), stdout); + printf("\n"); +#endif + + first_identifier = raptor_new_term_from_uri(world, RAPTOR_RDF_first_URI(world)); + if(!first_identifier) + YYERR_MSG_GOTO(err_collection, "Cannot create rdf:first term"); + rest_identifier = raptor_new_term_from_uri(world, RAPTOR_RDF_rest_URI(world)); + if(!rest_identifier) + YYERR_MSG_GOTO(err_collection, "Cannot create rdf:rest term"); + + /* non-empty property list, handle it */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource\n predicateObjectList="); + raptor_sequence_print((yyvsp[-1].sequence), stdout); + printf("\n"); +#endif + + object = raptor_new_term_from_uri(world, RAPTOR_RDF_nil_URI(world)); + if(!object) + YYERR_MSG_GOTO(err_collection, "Cannot create rdf:nil term"); + + for(i = raptor_sequence_size((yyvsp[-1].sequence))-1; i>=0; i--) { + raptor_term* temp; + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at((yyvsp[-1].sequence), i); + const unsigned char *blank_id; + + blank_id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!blank_id) + YYERR_MSG_GOTO(err_collection, "Cannot create bnodeid"); + + blank = raptor_new_term_from_blank(rdf_parser->world, + blank_id); + RAPTOR_FREE(char*, blank_id); + if(!blank) + YYERR_MSG_GOTO(err_collection, "Cannot create bnode"); + + t2->subject = blank; + t2->predicate = first_identifier; + /* t2->object already set to the value we want */ + raptor_turtle_defer_statement((raptor_parser*)rdf_parser, t2); + + temp = t2->object; + + t2->subject = blank; + t2->predicate = rest_identifier; + t2->object = object; + raptor_turtle_defer_statement((raptor_parser*)rdf_parser, t2); + + t2->subject = NULL; + t2->predicate = NULL; + t2->object = temp; + + raptor_free_term(object); + object = blank; + blank = NULL; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution objectList="); + raptor_sequence_print((yyvsp[-1].sequence), stdout); + printf("\n\n"); +#endif + + raptor_free_sequence((yyvsp[-1].sequence)); + + raptor_free_term(first_identifier); + raptor_free_term(rest_identifier); + + (yyval.identifier)=object; + + err_collection: + if(errmsg) { + if(blank) + raptor_free_term(blank); + + if(object) + raptor_free_term(object); + + if(rest_identifier) + raptor_free_term(rest_identifier); + + if(first_identifier) + raptor_free_term(first_identifier); + + raptor_free_sequence((yyvsp[-1].sequence)); + + YYERROR_MSG(errmsg); + } +} +#line 2948 "turtle_parser.c" + break; + + case 64: /* collection: "(" ")" */ +#line 1269 "./turtle_parser.y" +{ + raptor_world* world = rdf_parser->world; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("collection\n empty\n"); +#endif + + (yyval.identifier) = raptor_new_term_from_uri(world, RAPTOR_RDF_nil_URI(world)); + if(!(yyval.identifier)) + YYERROR; +} +#line 2964 "turtle_parser.c" + break; + + +#line 2968 "turtle_parser.c" + + default: break; + } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + + *++yyvsp = yyval; + + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } + + goto yynewstate; + + +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == TURTLE_PARSER_EMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; + { + yypcontext_t yyctx + = {yyssp, yytoken}; + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == -1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = YY_CAST (char *, + YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); + if (yymsg) + { + yysyntax_error_status + = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); + yymsgp = yymsg; + } + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = YYENOMEM; + } + } + yyerror (rdf_parser, yyscanner, yymsgp); + if (yysyntax_error_status == YYENOMEM) + YYNOMEM; + } + } + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= TURTLE_PARSER_EOF) + { + /* Return failure if at end of input. */ + if (yychar == TURTLE_PARSER_EOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval, rdf_parser, yyscanner); + yychar = TURTLE_PARSER_EMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; + ++yynerrs; + + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + /* Pop stack until we find a state that shifts the error token. */ + for (;;) + { + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYSYMBOL_YYerror; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + YY_ACCESSING_SYMBOL (yystate), yyvsp, rdf_parser, yyscanner); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturnlab; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturnlab; + + +/*-----------------------------------------------------------. +| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | +`-----------------------------------------------------------*/ +yyexhaustedlab: + yyerror (rdf_parser, yyscanner, YY_("memory exhausted")); + yyresult = 2; + goto yyreturnlab; + + +/*----------------------------------------------------------. +| yyreturnlab -- parsing is finished, clean up and return. | +`----------------------------------------------------------*/ +yyreturnlab: + if (yychar != TURTLE_PARSER_EMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, rdf_parser, yyscanner); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + YY_ACCESSING_SYMBOL (+*yyssp), yyvsp, rdf_parser, yyscanner); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + return yyresult; +} + +#line 1283 "./turtle_parser.y" + + + +/* Support functions */ + +/* Error handler with scanner context, during parsing */ +int +turtle_parser_error(raptor_parser* rdf_parser, void* scanner, + const char *msg) +{ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(turtle_parser->consumed == turtle_parser->consumable && + turtle_parser->processed < turtle_parser->consumed && + !turtle_parser->is_end) { + /* we encountered an error on or around the last byte of the buffer + * sorting it in the next run aye? */ + return 0; + } + + if(turtle_parser->error_count++) + return 0; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + raptor_log_error(rdf_parser->world, RAPTOR_LOG_LEVEL_ERROR, + &rdf_parser->locator, msg); + + return 0; +} + + +/* Error handler within raptor functions and callbacks */ +static void +turtle_parser_error_simple(void* user_data, const char *msg, ...) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + raptor_turtle_parser* turtle_parser; + va_list args; + + va_start(args, msg); + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(turtle_parser->consumed == turtle_parser->consumable && + turtle_parser->processed < turtle_parser->consumed && + !turtle_parser->is_end) { + /* we encountered an error on or around the last byte of the buffer + * sorting it in the next run aye? */ + goto tidy; + } + + if(turtle_parser->error_count++) + goto tidy; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + raptor_log_error_varargs(rdf_parser->world, RAPTOR_LOG_LEVEL_ERROR, + &rdf_parser->locator, msg, + args); + +tidy: + va_end(args); +} + + +int +turtle_syntax_error(raptor_parser *rdf_parser, const char *message, ...) +{ + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + va_list arguments; + + if(!turtle_parser) + return 1; + + if(turtle_parser->error_count++) + return 0; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + va_start(arguments, message); + + raptor_parser_log_error_varargs(((raptor_parser*)rdf_parser), + RAPTOR_LOG_LEVEL_ERROR, message, arguments); + + va_end(arguments); + + return 0; +} + + +raptor_uri* +turtle_qname_to_uri(raptor_parser *rdf_parser, unsigned char *name, size_t name_len) +{ + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(!turtle_parser) + return NULL; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + name_len = raptor_turtle_expand_qname_escapes(name, name_len, + (raptor_simple_message_handler)turtle_parser_error_simple, rdf_parser); + if(!name_len) + return NULL; + + return raptor_qname_string_to_uri(&turtle_parser->namespaces, name, name_len); +} + + + +#ifndef TURTLE_PUSH_PARSE +static int +turtle_parse(raptor_parser *rdf_parser, const char *string, size_t length) +{ + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + int rc; + + if(!string || !*string) + return 0; + + if(turtle_lexer_lex_init(&turtle_parser->scanner)) + return 1; + turtle_parser->scanner_set = 1; + +#if defined(YYDEBUG) && YYDEBUG > 0 + turtle_lexer_set_debug(1 ,&turtle_parser->scanner); + turtle_parser_debug = 1; +#endif + + turtle_lexer_set_extra(rdf_parser, turtle_parser->scanner); + (void)turtle_lexer__scan_bytes((char *)string, (yy_size_t)length, turtle_parser->scanner); + + rc = turtle_parser_parse(rdf_parser, turtle_parser->scanner); + + turtle_lexer_lex_destroy(turtle_parser->scanner); + turtle_parser->scanner_set = 0; + + return rc; +} +#endif + + +#ifdef TURTLE_PUSH_PARSE +static int +turtle_push_parse(raptor_parser *rdf_parser, + const char *string, size_t length) +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + raptor_world* world = rdf_parser->world; +#endif + raptor_turtle_parser* turtle_parser; + void *buffer; + int status; + yypstate *ps; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(!string || !*string) + return 0; + + if(turtle_lexer_lex_init(&turtle_parser->scanner)) + return 1; + turtle_parser->scanner_set = 1; + +#if defined(YYDEBUG) && YYDEBUG > 0 + turtle_lexer_set_debug(1 ,&turtle_parser->scanner); + turtle_parser_debug = 1; +#endif + + turtle_lexer_set_extra(rdf_parser, turtle_parser->scanner); + buffer = turtle_lexer__scan_bytes(string, (yy_size_t)length, turtle_parser->scanner); + + /* returns a parser instance or 0 on out of memory */ + ps = yypstate_new(); + if(!ps) + return 1; + + do { + TURTLE_PARSER_YYSTYPE lval; + int token; + + memset(&lval, 0, sizeof(TURTLE_PARSER_YYSTYPE)); + + token = turtle_lexer_lex(&lval, turtle_parser->scanner); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("token %s\n", turtle_token_print(world, token, &lval)); +#endif + + status = yypush_parse(ps, token, &lval, rdf_parser, turtle_parser->scanner); + + /* turtle_token_free(world, token, &lval); */ + + if(!token || token == EOF || token == ERROR_TOKEN) + break; + } while (status == YYPUSH_MORE); + yypstate_delete(ps); + + turtle_lexer_lex_destroy(turtle_parser->scanner); + turtle_parser->scanner_set = 0; + + return 0; +} +#endif + + +/** + * raptor_turtle_parse_init - Initialise the Raptor Turtle parser + * + * Return value: non 0 on failure + **/ + +static int +raptor_turtle_parse_init(raptor_parser* rdf_parser, const char *name) { + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(raptor_namespaces_init(rdf_parser->world, &turtle_parser->namespaces, 0)) + return 1; + + turtle_parser->trig = !strcmp(name, "trig"); + + return 0; +} + + +/* PUBLIC FUNCTIONS */ + + +/* + * raptor_turtle_parse_terminate - Free the Raptor Turtle parser + * @rdf_parser: parser object + * + **/ +static void +raptor_turtle_parse_terminate(raptor_parser *rdf_parser) { + raptor_turtle_parser *turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + raptor_namespaces_clear(&turtle_parser->namespaces); + + if(turtle_parser->scanner_set) { + turtle_lexer_lex_destroy(turtle_parser->scanner); + turtle_parser->scanner_set = 0; + } + + if(turtle_parser->buffer) + RAPTOR_FREE(cdata, turtle_parser->buffer); + + if(turtle_parser->graph_name) { + raptor_free_term(turtle_parser->graph_name); + turtle_parser->graph_name = NULL; + } +} + + +static void +raptor_turtle_clone_statement(raptor_parser *parser, raptor_statement *t) +{ + raptor_turtle_parser *turtle_parser = (raptor_turtle_parser*)parser->context; + raptor_statement *statement = &parser->statement; + + if(!t->subject || !t->predicate || !t->object) + return; + + if(turtle_parser->trig && turtle_parser->graph_name) + statement->graph = raptor_term_copy(turtle_parser->graph_name); + + if(!parser->emitted_default_graph && !turtle_parser->graph_name) { + /* for non-TRIG - start default graph at first triple */ + raptor_parser_start_graph(parser, NULL, 0); + parser->emitted_default_graph++; + } + + /* Two choices for subject for Turtle */ + if(t->subject->type == RAPTOR_TERM_TYPE_BLANK) { + statement->subject = raptor_new_term_from_blank(parser->world, + t->subject->value.blank.string); + } else { + /* RAPTOR_TERM_TYPE_URI */ + RAPTOR_ASSERT(t->subject->type != RAPTOR_TERM_TYPE_URI, + "subject type is not resource"); + statement->subject = raptor_new_term_from_uri(parser->world, + t->subject->value.uri); + } + + /* Predicates are URIs but check for bad ordinals */ + if(!strncmp((const char*)raptor_uri_as_string(t->predicate->value.uri), + "http://www.w3.org/1999/02/22-rdf-syntax-ns#_", 44)) { + unsigned char* predicate_uri_string = raptor_uri_as_string(t->predicate->value.uri); + int predicate_ordinal = raptor_check_ordinal(predicate_uri_string+44); + if(predicate_ordinal <= 0) + raptor_parser_error(parser, "Illegal ordinal value %d in property '%s'.", predicate_ordinal, predicate_uri_string); + } + + statement->predicate = raptor_new_term_from_uri(parser->world, + t->predicate->value.uri); + + + /* Three choices for object for Turtle */ + if(t->object->type == RAPTOR_TERM_TYPE_URI) { + statement->object = raptor_new_term_from_uri(parser->world, + t->object->value.uri); + } else if(t->object->type == RAPTOR_TERM_TYPE_BLANK) { + statement->object = raptor_new_term_from_blank(parser->world, + t->object->value.blank.string); + } else { + /* RAPTOR_TERM_TYPE_LITERAL */ + RAPTOR_ASSERT(t->object->type != RAPTOR_TERM_TYPE_LITERAL, + "object type is not literal"); + statement->object = raptor_new_term_from_literal(parser->world, + t->object->value.literal.string, + t->object->value.literal.datatype, + t->object->value.literal.language); + } +} + +static void +raptor_turtle_handle_statement(raptor_parser *parser, raptor_statement *t) +{ + if(!t->subject || !t->predicate || !t->object) + return; + + if(!parser->statement_handler) + return; + + /* Generate the statement */ + (*parser->statement_handler)(parser->user_data, t); +} + +static void +raptor_turtle_generate_statement(raptor_parser *parser, raptor_statement *t) +{ + raptor_turtle_clone_statement(parser, t); + raptor_turtle_handle_statement(parser, &parser->statement); + /* clear resources */ + raptor_statement_clear(&parser->statement); +} + +static void +raptor_turtle_defer_statement(raptor_parser *parser, raptor_statement *t) +{ + raptor_statement* st; + raptor_turtle_parser* turtle_parser; + + raptor_turtle_clone_statement(parser, t); + st = raptor_new_statement(parser->world); + if(!st) { + return; + } + /* copy static to dynamic statement, it's a move really */ + st->subject = parser->statement.subject, parser->statement.subject = NULL; + st->predicate = parser->statement.predicate, parser->statement.predicate = NULL; + st->object = parser->statement.object, parser->statement.object = NULL; + st->graph = parser->statement.graph, parser->statement.graph = NULL; + + /* prep deferred list */ + turtle_parser = (raptor_turtle_parser*)parser->context; + if(!turtle_parser->deferred) { + turtle_parser->deferred = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, NULL); + if(!turtle_parser->deferred) { + goto free_seq; + } + } + /* append to deferred list */ + if(raptor_sequence_push(turtle_parser->deferred, st)) { + free_seq: + raptor_free_statement(st); + } +} + + + +static int +raptor_turtle_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *s, size_t len, + int is_end) +{ + raptor_turtle_parser *turtle_parser; + char *ptr; + int rc; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("adding %d bytes to line buffer\n", (int)len); +#endif + + if(!len && !is_end) { + /* nothing to do */ + return 0; + } + + /* the actual buffer will contained unprocessed characters from + * the last run plus the chunk passed here */ + turtle_parser->end_of_buffer = turtle_parser->consumed + len; + if(turtle_parser->end_of_buffer > turtle_parser->buffer_length) { + /* resize */ + size_t new_buffer_length = turtle_parser->end_of_buffer; + + turtle_parser->buffer = RAPTOR_REALLOC(char*, turtle_parser->buffer, + new_buffer_length + 1); + + /* adjust stored length */ + turtle_parser->buffer_length = new_buffer_length; + } + if(!turtle_parser->buffer && turtle_parser->buffer_length) { + /* we tried to alloc a buffer but we failed */ + raptor_parser_fatal_error(rdf_parser, "Out of memory"); + return 1; + } + if(is_end && !turtle_parser->end_of_buffer) { + /* Nothing to do */ + return 0; + } + + /* move pointer to end of cdata buffer */ + ptr = turtle_parser->buffer + turtle_parser->consumed; + + /* now write new stuff at end of cdata buffer */ + memcpy(ptr, s, len); + ptr += len; + *ptr = '\0'; + + /* reset processed counter */ + turtle_parser->processed = 0U; + /* unconsume */ + turtle_parser->consumed = 0U; + /* reset line numbers */ + turtle_parser->lineno = turtle_parser->lineno_last_good; + + /* let everyone know if this is the last chunk */ + turtle_parser->is_end = is_end; + if(!is_end) { + /* it's safer not to pass the very last line to the lexer + * just in case we end up with EOB-in-the-middle-of-X situations */ + size_t i = turtle_parser->end_of_buffer; + while(i > 0U && turtle_parser->buffer[--i] != '\n'); + /* either i == 0U or i points to the last \n before the end-of-buffer */ + turtle_parser->consumable = i; + } else { + /* otherwise the consumable number of bytes coincides with the EOB */ + turtle_parser->consumable = turtle_parser->end_of_buffer; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("buffer buffer now '%s' (%ld bytes)\n", + turtle_parser->buffer, turtle_parser->buffer_length); +#endif + +#ifdef TURTLE_PUSH_PARSE + rc = turtle_push_parse(rdf_parser, + turtle_parser->buffer, turtle_parser->consumable); +#else + rc = turtle_parse(rdf_parser, turtle_parser->buffer, turtle_parser->consumable); +#endif + + if(turtle_parser->error_count) { + rc = 1; + } else if(!is_end) { + /* move stuff to the beginning of the buffer */ + turtle_parser->consumed = turtle_parser->end_of_buffer - turtle_parser->processed; + if(turtle_parser->consumed && turtle_parser->processed) { + memmove(turtle_parser->buffer, + turtle_parser->buffer + turtle_parser->processed, + turtle_parser->consumed); + /* cancel all deferred eval's */ + if(turtle_parser->deferred) { + raptor_free_sequence(turtle_parser->deferred); + turtle_parser->deferred = NULL; + } + } + } else { + /* this was the last chunk, finalise */ + if(turtle_parser->deferred) { + raptor_sequence* def = turtle_parser->deferred; + int i; + for(i = 0; i < raptor_sequence_size(def); i++) { + raptor_statement *t2 = (raptor_statement*)raptor_sequence_get_at(def, i); + + raptor_turtle_handle_statement(rdf_parser, t2); + } + } + if(rdf_parser->emitted_default_graph) { + /* for non-TRIG - end default graph after last triple */ + raptor_parser_end_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph--; + } + if(turtle_parser->deferred) { + /* clear resources */ + raptor_free_sequence(turtle_parser->deferred); + turtle_parser->deferred = NULL; + } + } + return rc; +} + + +static int +raptor_turtle_parse_start(raptor_parser *rdf_parser) +{ + raptor_locator *locator=&rdf_parser->locator; + raptor_turtle_parser *turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + /* base URI required for Turtle */ + if(!rdf_parser->base_uri) + return 1; + + locator->line = 1; + locator->column= -1; /* No column info */ + locator->byte= -1; /* No bytes info */ + + if(turtle_parser->buffer_length) { + RAPTOR_FREE(cdata, turtle_parser->buffer); + turtle_parser->buffer = NULL; + turtle_parser->buffer_length = 0; + } + + turtle_parser->lineno = 1; + + return 0; +} + + +static int +raptor_turtle_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score= 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "ttl")) + score = 8; + if(!strcmp((const char*)suffix, "n3")) + score = 3; + } + + if(mime_type) { + if(strstr((const char*)mime_type, "turtle")) + score += 6; + if(strstr((const char*)mime_type, "n3")) + score += 3; + } + + /* Do this as long as N3 is not supported since it shares the same syntax */ + if(buffer && len) { +#define HAS_TURTLE_PREFIX (raptor_memstr((const char*)buffer, len, "@prefix ") != NULL) +/* The following could also be found with N-Triples but not with @prefix */ +#define HAS_TURTLE_RDF_URI (raptor_memstr((const char*)buffer, len, ": <http://www.w3.org/1999/02/22-rdf-syntax-ns#>") != NULL) + + if(HAS_TURTLE_PREFIX) { + score = 6; + if(HAS_TURTLE_RDF_URI) + score += 2; + } + } + + return score; +} + + +static raptor_uri* +raptor_turtle_get_graph(raptor_parser* rdf_parser) +{ + raptor_turtle_parser *turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(turtle_parser->graph_name) + return raptor_uri_copy(turtle_parser->graph_name->value.uri); + + return NULL; +} + + +#ifdef RAPTOR_PARSER_TRIG +static int +raptor_trig_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score= 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "trig")) + score = 9; +#ifndef RAPTOR_PARSER_TURTLE + if(!strcmp((const char*)suffix, "ttl")) + score = 8; + if(!strcmp((const char*)suffix, "n3")) + score = 3; +#endif + } + + if(mime_type) { + if(strstr((const char*)mime_type, "trig")) + score = 6; +#ifndef RAPTOR_PARSER_TURTLE + if(strstr((const char*)mime_type, "turtle")) + score += 6; + if(strstr((const char*)mime_type, "n3")) + score += 3; +#endif + } + +#ifndef RAPTOR_PARSER_TURTLE + /* Do this as long as N3 is not supported since it shares the same syntax */ + if(buffer && len) { +#define HAS_TRIG_PREFIX (raptor_memstr((const char*)buffer, len, "@prefix ") != NULL) +/* The following could also be found with N-Triples but not with @prefix */ +#define HAS_TRIG_RDF_URI (raptor_memstr((const char*)buffer, len, ": <http://www.w3.org/1999/02/22-rdf-syntax-ns#>") != NULL) + + if(HAS_TRIG_PREFIX) { + score = 6; + if(HAS_TRIG_RDF_URI) + score += 2; + } + } +#endif + + return score; +} +#endif + + +#ifdef RAPTOR_PARSER_TURTLE +static const char* const turtle_names[4] = { "turtle", "ntriples-plus", "n3", NULL }; + +static const char* const turtle_uri_strings[3] = { + "http://www.w3.org/ns/formats/Turtle", + "http://www.dajobe.org/2004/01/turtle/", + NULL +}; + +#define TURTLE_TYPES_COUNT 6 +static const raptor_type_q turtle_types[TURTLE_TYPES_COUNT + 1] = { + /* first one is the default */ + { "text/turtle", 11, 10}, + { "application/x-turtle", 20, 10}, + { "application/turtle", 18, 10}, + { "text/n3", 7, 3}, + { "text/rdf+n3", 11, 3}, + { "application/rdf+n3", 18, 3}, + { NULL, 0} +}; + +static int +raptor_turtle_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = turtle_names; + + factory->desc.mime_types = turtle_types; + + factory->desc.label = "Turtle Terse RDF Triple Language"; + factory->desc.uri_strings = turtle_uri_strings; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_turtle_parser); + + factory->init = raptor_turtle_parse_init; + factory->terminate = raptor_turtle_parse_terminate; + factory->start = raptor_turtle_parse_start; + factory->chunk = raptor_turtle_parse_chunk; + factory->recognise_syntax = raptor_turtle_parse_recognise_syntax; + factory->get_graph = raptor_turtle_get_graph; + + return rc; +} +#endif + + +#ifdef RAPTOR_PARSER_TRIG +static const char* const trig_names[2] = { "trig", NULL }; + +static const char* const trig_uri_strings[2] = { + "http://www.wiwiss.fu-berlin.de/suhl/bizer/TriG/Spec/", + NULL +}; + +#define TRIG_TYPES_COUNT 1 +static const raptor_type_q trig_types[TRIG_TYPES_COUNT + 1] = { + /* first one is the default */ + { "application/x-trig", 18, 10}, + { NULL, 0, 0} +}; + +static int +raptor_trig_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = trig_names; + + factory->desc.mime_types = trig_types; + + factory->desc.label = "TriG - Turtle with Named Graphs"; + factory->desc.uri_strings = trig_uri_strings; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_turtle_parser); + + factory->init = raptor_turtle_parse_init; + factory->terminate = raptor_turtle_parse_terminate; + factory->start = raptor_turtle_parse_start; + factory->chunk = raptor_turtle_parse_chunk; + factory->recognise_syntax = raptor_trig_parse_recognise_syntax; + factory->get_graph = raptor_turtle_get_graph; + + return rc; +} +#endif + + +#ifdef RAPTOR_PARSER_TURTLE +int +raptor_init_parser_turtle(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_turtle_parser_register_factory); +} +#endif + +#ifdef RAPTOR_PARSER_TRIG +int +raptor_init_parser_trig(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_trig_parser_register_factory); +} +#endif + + +#ifdef STANDALONE +#include <stdio.h> +#include <locale.h> + +#define TURTLE_FILE_BUF_SIZE 2048 + +static void +turtle_parser_print_statement(void *user, + raptor_statement *statement) +{ + FILE* stream = (FILE*)user; + raptor_statement_print(statement, stream); + putc('\n', stream); +} + + + +int +main(int argc, char *argv[]) +{ + char string[TURTLE_FILE_BUF_SIZE]; + raptor_parser rdf_parser; /* static */ + raptor_turtle_parser turtle_parser; /* static */ + raptor_locator *locator = &rdf_parser.locator; + FILE *fh; + const char *filename; + size_t nobj; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + turtle_parser_debug = 1; +#endif + + if(argc > 1) { + filename = argv[1]; + fh = fopen(filename, "r"); + if(!fh) { + fprintf(stderr, "%s: Cannot open file %s - %s\n", argv[0], filename, + strerror(errno)); + exit(1); + } + } else { + filename="<stdin>"; + fh = stdin; + } + + memset(string, 0, TURTLE_FILE_BUF_SIZE); + nobj = fread(string, TURTLE_FILE_BUF_SIZE, 1, fh); + if(nobj < TURTLE_FILE_BUF_SIZE) { + if(ferror(fh)) { + fprintf(stderr, "%s: file '%s' read failed - %s\n", + argv[0], filename, strerror(errno)); + fclose(fh); + return(1); + } + } + + if(argc > 1) + fclose(fh); + + memset(&rdf_parser, 0, sizeof(rdf_parser)); + memset(&turtle_parser, 0, sizeof(turtle_parser)); + + locator->line= locator->column = -1; + locator->file= filename; + + turtle_parser.lineno= 1; + + rdf_parser.world = raptor_new_world(); + rdf_parser.context = &turtle_parser; + rdf_parser.base_uri = raptor_new_uri(rdf_parser.world, + (const unsigned char*)"http://example.org/fake-base-uri/"); + + raptor_parser_set_statement_handler(&rdf_parser, stdout, + turtle_parser_print_statement); + raptor_turtle_parse_init(&rdf_parser, "turtle"); + + turtle_parser.error_count = 0; + +#ifdef TURTLE_PUSH_PARSE + turtle_push_parse(&rdf_parser, string, strlen(string)); +#else + turtle_parse(&rdf_parser, string, strlen(string)); +#endif + + raptor_turtle_parse_terminate(&rdf_parser); + + raptor_free_uri(rdf_parser.base_uri); + + raptor_free_world(rdf_parser.world); + + return (0); +} +#endif diff --git a/src/turtle_parser.h b/src/turtle_parser.h new file mode 100644 index 0000000..ca83eea --- /dev/null +++ b/src/turtle_parser.h @@ -0,0 +1,122 @@ +/* A Bison parser, made by GNU Bison 3.8.2. */ + +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, + Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 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, see <https://www.gnu.org/licenses/>. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, + especially those whose name start with YY_ or yy_. They are + private implementation details that can be changed or removed. */ + +#ifndef YY_TURTLE_PARSER_TURTLE_PARSER_H_INCLUDED +# define YY_TURTLE_PARSER_TURTLE_PARSER_H_INCLUDED +/* Debug traces. */ +#ifndef TURTLE_PARSER_DEBUG +# if defined YYDEBUG +#if YYDEBUG +# define TURTLE_PARSER_DEBUG 1 +# else +# define TURTLE_PARSER_DEBUG 0 +# endif +# else /* ! defined YYDEBUG */ +# define TURTLE_PARSER_DEBUG 0 +# endif /* ! defined YYDEBUG */ +#endif /* ! defined TURTLE_PARSER_DEBUG */ +#if TURTLE_PARSER_DEBUG +extern int turtle_parser_debug; +#endif + +/* Token kinds. */ +#ifndef TURTLE_PARSER_TOKENTYPE +# define TURTLE_PARSER_TOKENTYPE + enum turtle_parser_tokentype + { + TURTLE_PARSER_EMPTY = -2, + TURTLE_PARSER_EOF = 0, /* "end of file" */ + TURTLE_PARSER_error = 256, /* error */ + TURTLE_PARSER_UNDEF = 257, /* "invalid token" */ + A = 258, /* "a" */ + HAT = 259, /* "^" */ + DOT = 260, /* "." */ + COMMA = 261, /* "," */ + SEMICOLON = 262, /* ";" */ + LEFT_SQUARE = 263, /* "[" */ + RIGHT_SQUARE = 264, /* "]" */ + LEFT_ROUND = 265, /* "(" */ + RIGHT_ROUND = 266, /* ")" */ + LEFT_CURLY = 267, /* "{" */ + RIGHT_CURLY = 268, /* "}" */ + TRUE_TOKEN = 269, /* "true" */ + FALSE_TOKEN = 270, /* "false" */ + PREFIX = 271, /* "@prefix" */ + BASE = 272, /* "@base" */ + SPARQL_PREFIX = 273, /* "PREFIX" */ + SPARQL_BASE = 274, /* "BASE" */ + STRING_LITERAL = 275, /* "string literal" */ + IDENTIFIER = 276, /* "identifier" */ + LANGTAG = 277, /* "langtag" */ + INTEGER_LITERAL = 278, /* "integer literal" */ + FLOATING_LITERAL = 279, /* "floating point literal" */ + DECIMAL_LITERAL = 280, /* "decimal literal" */ + BLANK_LITERAL = 281, /* "blank node" */ + URI_LITERAL = 282, /* "URI literal" */ + GRAPH_NAME_LEFT_CURLY = 283, /* "Graph URI literal {" */ + QNAME_LITERAL = 284, /* "QName" */ + ERROR_TOKEN = 285 /* ERROR_TOKEN */ + }; + typedef enum turtle_parser_tokentype turtle_parser_token_kind_t; +#endif + +/* Value type. */ +#if ! defined TURTLE_PARSER_STYPE && ! defined TURTLE_PARSER_STYPE_IS_DECLARED +union TURTLE_PARSER_STYPE +{ +#line 145 "./turtle_parser.y" + + unsigned char *string; + raptor_term *identifier; + raptor_sequence *sequence; + raptor_uri *uri; + +#line 109 "turtle_parser.h" + +}; +typedef union TURTLE_PARSER_STYPE TURTLE_PARSER_STYPE; +# define TURTLE_PARSER_STYPE_IS_TRIVIAL 1 +# define TURTLE_PARSER_STYPE_IS_DECLARED 1 +#endif + + + + +int turtle_parser_parse (raptor_parser* rdf_parser, void* yyscanner); + + +#endif /* !YY_TURTLE_PARSER_TURTLE_PARSER_H_INCLUDED */ diff --git a/src/turtle_parser.y b/src/turtle_parser.y new file mode 100644 index 0000000..1474a3d --- /dev/null +++ b/src/turtle_parser.y @@ -0,0 +1,2128 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * turtle_parser.y - Raptor Turtle / TRIG / N3 parsers - over tokens from turtle grammar lexer + * + * Copyright (C) 2003-2013, David Beckett http://www.dajobe.org/ + * Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + * Turtle is defined in http://www.dajobe.org/2004/01/turtle/ + * + * Made from a subset of the terms in + * http://www.w3.org/DesignIssues/Notation3.html + * + * TRIG is defined in http://www.wiwiss.fu-berlin.de/suhl/bizer/TriG/Spec/ + */ + +%{ +#ifdef HAVE_CONFIG_H +#include <raptor_config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include <ctype.h> +#include <stdarg.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#include "raptor2.h" +#include "raptor_internal.h" + +#include <turtle_parser.h> + +#define YY_NO_UNISTD_H 1 +#undef yylex +#include <turtle_lexer.h> + +#include <turtle_common.h> + + +/* Set RAPTOR_DEBUG to 3 for super verbose parsing - watching the shift/reduces */ +#if 0 +#undef RAPTOR_DEBUG +#define RAPTOR_DEBUG 3 +#endif + + +/* Fail with an debug error message if RAPTOR_DEBUG > 1 */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 +#define YYERROR_MSG(msg) do { fputs("** YYERROR ", RAPTOR_DEBUG_FH); fputs(msg, RAPTOR_DEBUG_FH); fputc('\n', RAPTOR_DEBUG_FH); YYERROR; } while(0) +#else +#define YYERROR_MSG(ignore) YYERROR +#endif +#define YYERR_MSG_GOTO(label,msg) do { errmsg = msg; goto label; } while(0) + +/* Slow down the grammar operation and watch it work */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 +#undef YYDEBUG +#define YYDEBUG 1 +#endif + +#ifdef RAPTOR_DEBUG +const char * turtle_token_print(raptor_world* world, int token, + TURTLE_PARSER_STYPE *lval); +#endif + + +/* the lexer does not seem to track this */ +#undef RAPTOR_TURTLE_USE_ERROR_COLUMNS + +/* set api.push-pull to "push" if this is defined */ +#undef TURTLE_PUSH_PARSE + +/* Prototypes */ +int turtle_parser_error(raptor_parser* rdf_parser, void* scanner, const char *msg); +static void turtle_parser_error_simple(void* user_data, const char *msg, ...) RAPTOR_PRINTF_FORMAT(2, 3); + +/* Make lex/yacc interface as small as possible */ +#undef yylex +#define yylex turtle_lexer_lex + +/* Prototypes for local functions */ +static void raptor_turtle_generate_statement(raptor_parser *parser, raptor_statement *triple); + +static void raptor_turtle_defer_statement(raptor_parser *parser, raptor_statement *triple); + +static void raptor_turtle_handle_statement(raptor_parser *parser, raptor_statement *triple); + +%} + + +/* directives */ + +%require "3.0" + +/* File prefix (-b) */ +%file-prefix "turtle_parser" + +/* Bison 2.6+ : Symbol prefix */ +%define api.prefix {turtle_parser_} +/* Bison 3.4+ : Generated header file */ +%define api.header.include {<turtle_parser.h>} + +/* Write parser header file with macros (bison -d) */ +%defines + +/* Make verbose error messages for syntax errors */ +%define parse.error verbose + +/* Write output file with verbose descriptions of parser states */ +%verbose + +/* Generate code processing locations */ + /* %locations */ + +/* Pure parser - want a reentrant parser */ +%define api.pure full + +/* Push or pull parser? */ +%define api.push-pull pull + +/* Pure parser argument: lexer - yylex() and parser - yyparse() */ +%lex-param { yyscan_t yyscanner } +%parse-param { raptor_parser* rdf_parser } { void* yyscanner } + +/* Interface between lexer and parser */ +%union { + unsigned char *string; + raptor_term *identifier; + raptor_sequence *sequence; + raptor_uri *uri; +} + + +/* others */ + +%token A "a" +%token HAT "^" +%token DOT "." +%token COMMA "," +%token SEMICOLON ";" +%token LEFT_SQUARE "[" +%token RIGHT_SQUARE "]" +%token LEFT_ROUND "(" +%token RIGHT_ROUND ")" +%token LEFT_CURLY "{" +%token RIGHT_CURLY "}" +%token TRUE_TOKEN "true" +%token FALSE_TOKEN "false" +%token PREFIX "@prefix" +%token BASE "@base" +%token SPARQL_PREFIX "PREFIX" +%token SPARQL_BASE "BASE" + +/* literals */ +%token + <string> + STRING_LITERAL "string literal" + IDENTIFIER "identifier" + LANGTAG "langtag" + INTEGER_LITERAL "integer literal" + FLOATING_LITERAL "floating point literal" + DECIMAL_LITERAL "decimal literal" + BLANK_LITERAL "blank node" + <uri> + URI_LITERAL "URI literal" + GRAPH_NAME_LEFT_CURLY "Graph URI literal {" + QNAME_LITERAL "QName" + +/* syntax error */ +%token ERROR_TOKEN + +%type <identifier> subject predicate object verb literal resource blankNode collection blankNodePropertyList +%type <sequence> triples objectList itemList predicateObjectList predicateObjectListOpt + +/* tidy up tokens after errors */ + +%destructor { + if($$) + RAPTOR_FREE(char*, $$); +} <string> + +%destructor { + if($$) + raptor_free_uri($$); +} <uri> + +%destructor { + if($$) + raptor_free_term($$); +} <identifier> + +%destructor { + if($$) + raptor_free_sequence($$); +} <sequence> + +%% + +Document : statementList +;; + + +graph: GRAPH_NAME_LEFT_CURLY + { + /* action in mid-rule so this is run BEFORE the triples in graphBody */ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(!turtle_parser->trig) + turtle_parser_error(rdf_parser, yyscanner, "{ ... } is not allowed in Turtle"); + else { + if(turtle_parser->graph_name) + raptor_free_term(turtle_parser->graph_name); + turtle_parser->graph_name = raptor_new_term_from_uri(rdf_parser->world, $1); + raptor_free_uri($1); + raptor_parser_start_graph(rdf_parser, + turtle_parser->graph_name->value.uri, 1); + } + } + graphBody RIGHT_CURLY +{ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(turtle_parser->trig) { + raptor_parser_end_graph(rdf_parser, + turtle_parser->graph_name->value.uri, 1); + raptor_free_term(turtle_parser->graph_name); + turtle_parser->graph_name = NULL; + rdf_parser->emitted_default_graph = 0; + } +} +| +LEFT_CURLY + { + /* action in mid-rule so this is run BEFORE the triples in graphBody */ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(!turtle_parser->trig) + turtle_parser_error(rdf_parser, yyscanner, "{ ... } is not allowed in Turtle"); + else { + raptor_parser_start_graph(rdf_parser, NULL, 1); + rdf_parser->emitted_default_graph++; + } + } + graphBody RIGHT_CURLY +{ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(turtle_parser->trig) { + raptor_parser_end_graph(rdf_parser, NULL, 1); + rdf_parser->emitted_default_graph = 0; + } +} +; + + +graphBody: triplesList +| %empty +; + +triplesList: dotTriplesList +| dotTriplesList DOT +; + +dotTriplesList: triples +{ + int i; + + if($1) { + for(i = 0; i < raptor_sequence_size($1); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($1, i); + raptor_turtle_generate_statement(rdf_parser, t2); + } + raptor_free_sequence($1); + } +} +| dotTriplesList DOT triples +{ + int i; + + if($3) { + for(i = 0; i < raptor_sequence_size($3); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($3, i); + raptor_turtle_generate_statement(rdf_parser, t2); + } + raptor_free_sequence($3); + } +} +; + +statementList: statementList statement +{ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + /* sync up consumed/processed so we know what to unwind */ + turtle_parser->processed = turtle_parser->consumed; + turtle_parser->lineno_last_good = turtle_parser->lineno; +} +| statementList error +| %empty +; + +statement: directive +| graph +| triples DOT +{ + raptor_turtle_parser* turtle_parser; + int i; + + /* yield deferred statements, if any */ + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(turtle_parser->deferred) { + raptor_sequence* def = turtle_parser->deferred; + + for(i = 0; i < raptor_sequence_size(def); i++) { + raptor_statement *t2 = (raptor_statement*)raptor_sequence_get_at(def, i); + + raptor_turtle_handle_statement(rdf_parser, t2); + } + } + + if($1) { + for(i = 0; i < raptor_sequence_size($1); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($1, i); + raptor_turtle_generate_statement(rdf_parser, t2); + } + raptor_free_sequence($1); + } + + if(turtle_parser->deferred) { + /* debrief resources */ + raptor_free_sequence(turtle_parser->deferred); + turtle_parser->deferred = NULL; + } +} +; + +triples: subject predicateObjectList +{ + int i; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("triples 1\n subject="); + if($1) + raptor_term_print_as_ntriples($1, stdout); + else + fputs("NULL", stdout); + if($2) { + printf("\n predicateObjectList (reverse order to syntax)="); + raptor_sequence_print($2, stdout); + printf("\n"); + } else + printf("\n and empty predicateObjectList\n"); +#endif + + if($1 && $2) { + /* have subject and non-empty property list, handle it */ + for(i = 0; i < raptor_sequence_size($2); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); + t2->subject = raptor_term_copy($1); + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution predicateObjectList="); + raptor_sequence_print($2, stdout); + printf("\n\n"); +#endif + } + + if($1) + raptor_free_term($1); + + $$ = $2; +} +| blankNodePropertyList predicateObjectListOpt +{ + int i; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("triples 2\n blankNodePropertyList="); + if($1) + raptor_term_print_as_ntriples($1, stdout); + else + fputs("NULL", stdout); + if($2) { + printf("\n predicateObjectListOpt (reverse order to syntax)="); + raptor_sequence_print($2, stdout); + printf("\n"); + } else + printf("\n and empty predicateObjectListOpt\n"); +#endif + + if($1 && $2) { + /* have subject and non-empty predicate object list, handle it */ + for(i = 0; i < raptor_sequence_size($2); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); + t2->subject = raptor_term_copy($1); + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution predicateObjectListOpt="); + raptor_sequence_print($2, stdout); + printf("\n\n"); +#endif + } + + if($1) + raptor_free_term($1); + + $$ = $2; +} +| error DOT +{ + $$ = NULL; +} +; + + +objectList: objectList COMMA object +{ + raptor_statement *triple; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("objectList 1\n"); + if($3) { + printf(" object=\n"); + raptor_term_print_as_ntriples($3, stdout); + printf("\n"); + } else + printf(" and empty object\n"); + if($1) { + printf(" objectList="); + raptor_sequence_print($1, stdout); + printf("\n"); + } else + printf(" and empty objectList\n"); +#endif + + if(!$3) + $$ = NULL; + else { + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, $3, NULL); + if(!triple) { + raptor_free_sequence($1); + YYERROR; + } + if(raptor_sequence_push($1, triple)) { + raptor_free_sequence($1); + YYERROR; + } + $$ = $1; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" objectList is now "); + raptor_sequence_print($$, stdout); + printf("\n\n"); +#endif + } +} +| object +{ + raptor_statement *triple; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("objectList 2\n"); + if($1) { + printf(" object=\n"); + raptor_term_print_as_ntriples($1, stdout); + printf("\n"); + } else + printf(" and empty object\n"); +#endif + + if(!$1) + $$ = NULL; + else { + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, $1, NULL); + if(!triple) + YYERROR; +#ifdef RAPTOR_DEBUG + $$ = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, + (raptor_data_print_handler)raptor_statement_print); +#else + $$ = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, NULL); +#endif + if(!$$) { + raptor_free_statement(triple); + YYERROR; + } + if(raptor_sequence_push($$, triple)) { + raptor_free_sequence($$); + $$ = NULL; + YYERROR; + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" objectList is now "); + raptor_sequence_print($$, stdout); + printf("\n\n"); +#endif + } +} +; + +itemList: itemList object +{ + raptor_statement *triple; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("objectList 1\n"); + if($2) { + printf(" object=\n"); + raptor_term_print_as_ntriples($2, stdout); + printf("\n"); + } else + printf(" and empty object\n"); + if($1) { + printf(" objectList="); + raptor_sequence_print($1, stdout); + printf("\n"); + } else + printf(" and empty objectList\n"); +#endif + + if(!$2) + $$ = NULL; + else { + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, $2, NULL); + if(!triple) { + raptor_free_sequence($1); + YYERROR; + } + if(raptor_sequence_push($1, triple)) { + raptor_free_sequence($1); + YYERROR; + } + $$ = $1; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" objectList is now "); + raptor_sequence_print($$, stdout); + printf("\n\n"); +#endif + } +} +| object +{ + raptor_statement *triple; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("objectList 2\n"); + if($1) { + printf(" object=\n"); + raptor_term_print_as_ntriples($1, stdout); + printf("\n"); + } else + printf(" and empty object\n"); +#endif + + if(!$1) + $$ = NULL; + else { + triple = raptor_new_statement_from_nodes(rdf_parser->world, NULL, NULL, $1, NULL); + if(!triple) + YYERROR; +#ifdef RAPTOR_DEBUG + $$ = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, + (raptor_data_print_handler)raptor_statement_print); +#else + $$ = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, NULL); +#endif + if(!$$) { + raptor_free_statement(triple); + YYERROR; + } + if(raptor_sequence_push($$, triple)) { + raptor_free_sequence($$); + $$ = NULL; + YYERROR; + } +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" objectList is now "); + raptor_sequence_print($$, stdout); + printf("\n\n"); +#endif + } +} +; + +verb: predicate +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("verb predicate="); + raptor_term_print_as_ntriples($1, stdout); + printf("\n"); +#endif + + $$ = $1; +} +| A +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("verb predicate = rdf:type (a)\n"); +#endif + + $$ = raptor_term_copy(RAPTOR_RDF_type_term(rdf_parser->world)); + if(!$$) + YYERROR; +} +; + + +predicateObjectList: predicateObjectList SEMICOLON verb objectList +{ + int i; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("predicateObjectList 1\n verb="); + raptor_term_print_as_ntriples($3, stdout); + printf("\n objectList="); + raptor_sequence_print($4, stdout); + printf("\n predicateObjectList="); + raptor_sequence_print($1, stdout); + printf("\n\n"); +#endif + + if($4 == NULL) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" empty objectList not processed\n"); +#endif + } else if($3 && $4) { + /* non-empty property list, handle it */ + for(i = 0; i < raptor_sequence_size($4); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($4, i); + t2->predicate = raptor_term_copy($3); + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution objectList="); + raptor_sequence_print($4, stdout); + printf("\n"); +#endif + } + + if($1 == NULL) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" empty predicateObjectList not copied\n\n"); +#endif + } else if($3 && $4 && $1) { + while(raptor_sequence_size($4)) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_unshift($4); + if(raptor_sequence_push($1, t2)) { + raptor_free_sequence($1); + raptor_free_term($3); + raptor_free_sequence($4); + YYERROR; + } + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after appending objectList (reverse order)="); + raptor_sequence_print($1, stdout); + printf("\n\n"); +#endif + + raptor_free_sequence($4); + } + + if($3) + raptor_free_term($3); + + $$ = $1; +} +| verb objectList +{ + int i; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("predicateObjectList 2\n verb="); + raptor_term_print_as_ntriples($1, stdout); + if($2) { + printf("\n objectList="); + raptor_sequence_print($2, stdout); + printf("\n"); + } else + printf("\n and empty objectList\n"); +#endif + + if($1 && $2) { + for(i = 0; i < raptor_sequence_size($2); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); + t2->predicate = raptor_term_copy($1); + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution objectList="); + raptor_sequence_print($2, stdout); + printf("\n\n"); +#endif + } + + if($1) + raptor_free_term($1); + + $$ = $2; +} +| predicateObjectList SEMICOLON +{ + $$ = $1; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("predicateObjectList 5\n trailing semicolon returning existing list "); + raptor_sequence_print($$, stdout); + printf("\n\n"); +#endif +} +; + +directive : prefix | base +; + +prefix: PREFIX IDENTIFIER URI_LITERAL DOT +{ + unsigned char *prefix = $2; + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(rdf_parser->context); + raptor_namespace *ns; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("directive PREFIX %s %s\n",($2 ? (char*)$2 : "(default)"), raptor_uri_as_string($3)); +#endif + + if(prefix) { + size_t len = strlen((const char*)prefix); + if(prefix[len-1] == ':') { + if(len == 1) + /* declaring default namespace prefix PREFIX : ... */ + prefix = NULL; + else + prefix[len-1]='\0'; + } + } + + ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, $3, 0); + if(ns) { + raptor_namespaces_start_namespace(&turtle_parser->namespaces, ns); + raptor_parser_start_namespace(rdf_parser, ns); + } + + if($2) + RAPTOR_FREE(char*, $2); + raptor_free_uri($3); + + if(!ns) + YYERROR; +} +| SPARQL_PREFIX IDENTIFIER URI_LITERAL +{ + unsigned char *prefix = $2; + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)(rdf_parser->context); + raptor_namespace *ns; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("directive @prefix %s %s.\n",($2 ? (char*)$2 : "(default)"), raptor_uri_as_string($3)); +#endif + + if(prefix) { + size_t len = strlen((const char*)prefix); + if(prefix[len-1] == ':') { + if(len == 1) + /* declaring default namespace prefix @prefix : ... */ + prefix = NULL; + else + prefix[len-1]='\0'; + } + } + + ns = raptor_new_namespace_from_uri(&turtle_parser->namespaces, prefix, $3, 0); + if(ns) { + raptor_namespaces_start_namespace(&turtle_parser->namespaces, ns); + raptor_parser_start_namespace(rdf_parser, ns); + } + + if($2) + RAPTOR_FREE(char*, $2); + raptor_free_uri($3); + + if(!ns) + YYERROR; +} +; + + +base: BASE URI_LITERAL DOT +{ + raptor_uri *uri=$2; + + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; +} +| SPARQL_BASE URI_LITERAL +{ + raptor_uri *uri=$2; + + if(rdf_parser->base_uri) + raptor_free_uri(rdf_parser->base_uri); + rdf_parser->base_uri = uri; +} +; + +subject: resource +{ + $$ = $1; +} +| blankNode +{ + $$ = $1; +} +| collection +{ + $$ = $1; +} +; + + +predicate: resource +{ + $$ = $1; +} +; + + +object: resource +{ + $$ = $1; +} +| blankNode +{ + $$ = $1; +} +| collection +{ + $$ = $1; +} +| blankNodePropertyList +{ + $$ = $1; +} +| literal +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("object literal="); + raptor_term_print_as_ntriples($1, stdout); + printf("\n"); +#endif + + $$ = $1; +} +; + + +literal: STRING_LITERAL LANGTAG +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + language string=\"%s\"\n", $1); +#endif + + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, NULL, $2); + RAPTOR_FREE(char*, $1); + RAPTOR_FREE(char*, $2); + if(!$$) + YYERROR; +} +| STRING_LITERAL LANGTAG HAT URI_LITERAL +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + language=\"%s\" datatype string=\"%s\" uri=\"%s\"\n", $1, $2, raptor_uri_as_string($4)); +#endif + + if($4) { + if($2) { + raptor_parser_error(rdf_parser, + "Language not allowed with datatyped literal"); + RAPTOR_FREE(char*, $2); + $2 = NULL; + } + + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, $4, NULL); + RAPTOR_FREE(char*, $1); + raptor_free_uri($4); + if(!$$) + YYERROR; + } else + $$ = NULL; + +} +| STRING_LITERAL LANGTAG HAT QNAME_LITERAL +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + language=\"%s\" datatype string=\"%s\" qname URI=<%s>\n", $1, $2, raptor_uri_as_string($4)); +#endif + + if($4) { + if($2) { + raptor_parser_error(rdf_parser, + "Language not allowed with datatyped literal"); + RAPTOR_FREE(char*, $2); + $2 = NULL; + } + + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, $4, NULL); + RAPTOR_FREE(char*, $1); + raptor_free_uri($4); + if(!$$) + YYERROR; + } else + $$ = NULL; + +} +| STRING_LITERAL HAT URI_LITERAL +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + datatype string=\"%s\" uri=\"%s\"\n", $1, raptor_uri_as_string($3)); +#endif + + if($3) { + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, $3, NULL); + RAPTOR_FREE(char*, $1); + raptor_free_uri($3); + if(!$$) + YYERROR; + } else + $$ = NULL; + +} +| STRING_LITERAL HAT QNAME_LITERAL +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal + datatype string=\"%s\" qname URI=<%s>\n", $1, raptor_uri_as_string($3)); +#endif + + if($3) { + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, $3, NULL); + RAPTOR_FREE(char*, $1); + raptor_free_uri($3); + if(!$$) + YYERROR; + } else + $$ = NULL; +} +| STRING_LITERAL +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("literal string=\"%s\"\n", $1); +#endif + + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, NULL, NULL); + RAPTOR_FREE(char*, $1); + if(!$$) + YYERROR; +} +| INTEGER_LITERAL +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource integer=%s\n", $1); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_integer_uri); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, uri, NULL); + RAPTOR_FREE(char*, $1); + raptor_free_uri(uri); + if(!$$) + YYERROR; +} +| FLOATING_LITERAL +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource double=%s\n", $1); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_double_uri); + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, uri, NULL); + RAPTOR_FREE(char*, $1); + raptor_free_uri(uri); + if(!$$) + YYERROR; +} +| DECIMAL_LITERAL +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource decimal=%s\n", $1); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_decimal_uri); + if(!uri) { + RAPTOR_FREE(char*, $1); + YYERROR; + } + $$ = raptor_new_term_from_literal(rdf_parser->world, $1, uri, NULL); + RAPTOR_FREE(char*, $1); + raptor_free_uri(uri); + if(!$$) + YYERROR; +} +| TRUE_TOKEN +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fputs("resource boolean true\n", stderr); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_boolean_uri); + $$ = raptor_new_term_from_literal(rdf_parser->world, + (const unsigned char*)"true", uri, NULL); + raptor_free_uri(uri); + if(!$$) + YYERROR; +} +| FALSE_TOKEN +{ + raptor_uri *uri; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fputs("resource boolean false\n", stderr); +#endif + uri = raptor_uri_copy(rdf_parser->world->xsd_boolean_uri); + $$ = raptor_new_term_from_literal(rdf_parser->world, + (const unsigned char*)"false", uri, NULL); + raptor_free_uri(uri); + if(!$$) + YYERROR; +} +; + + +resource: URI_LITERAL +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource URI=<%s>\n", raptor_uri_as_string($1)); +#endif + + if($1) { + $$ = raptor_new_term_from_uri(rdf_parser->world, $1); + raptor_free_uri($1); + if(!$$) + YYERROR; + } else + $$ = NULL; +} +| QNAME_LITERAL +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource qname URI=<%s>\n", raptor_uri_as_string($1)); +#endif + + if($1) { + $$ = raptor_new_term_from_uri(rdf_parser->world, $1); + raptor_free_uri($1); + if(!$$) + YYERROR; + } else + $$ = NULL; +} +; + + +predicateObjectListOpt: predicateObjectList +{ + $$ = $1; +} +| %empty +{ + $$ = NULL; +} +; + + +blankNode: BLANK_LITERAL +{ + const unsigned char *id; +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("subject blank=\"%s\"\n", $1); +#endif + id = raptor_world_internal_generate_id(rdf_parser->world, $1); + if(!id) + YYERROR; + + $$ = raptor_new_term_from_blank(rdf_parser->world, id); + RAPTOR_FREE(char*, id); + + if(!$$) + YYERROR; +} +; + +blankNodePropertyList: LEFT_SQUARE predicateObjectListOpt RIGHT_SQUARE +{ + int i; + const unsigned char *id; + + id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!id) { + if($2) + raptor_free_sequence($2); + YYERROR; + } + + $$ = raptor_new_term_from_blank(rdf_parser->world, id); + RAPTOR_FREE(char*, id); + if(!$$) { + if($2) + raptor_free_sequence($2); + YYERROR; + } + + if($2 == NULL) { +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource\n predicateObjectList="); + raptor_term_print_as_ntriples($$, stdout); + printf("\n"); +#endif + } else { + /* non-empty property list, handle it */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource\n predicateObjectList="); + raptor_sequence_print($2, stdout); + printf("\n"); +#endif + + for(i = 0; i < raptor_sequence_size($2); i++) { + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); + t2->subject = raptor_term_copy($$); + raptor_turtle_defer_statement(rdf_parser, t2); + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution objectList="); + raptor_sequence_print($2, stdout); + printf("\n\n"); +#endif + + raptor_free_sequence($2); + + } + +} +; + + +collection: LEFT_ROUND itemList RIGHT_ROUND +{ + int i; + raptor_world* world = rdf_parser->world; + raptor_term* first_identifier = NULL; + raptor_term* rest_identifier = NULL; + raptor_term* object = NULL; + raptor_term* blank = NULL; + char const *errmsg = NULL; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("collection\n objectList="); + raptor_sequence_print($2, stdout); + printf("\n"); +#endif + + first_identifier = raptor_new_term_from_uri(world, RAPTOR_RDF_first_URI(world)); + if(!first_identifier) + YYERR_MSG_GOTO(err_collection, "Cannot create rdf:first term"); + rest_identifier = raptor_new_term_from_uri(world, RAPTOR_RDF_rest_URI(world)); + if(!rest_identifier) + YYERR_MSG_GOTO(err_collection, "Cannot create rdf:rest term"); + + /* non-empty property list, handle it */ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("resource\n predicateObjectList="); + raptor_sequence_print($2, stdout); + printf("\n"); +#endif + + object = raptor_new_term_from_uri(world, RAPTOR_RDF_nil_URI(world)); + if(!object) + YYERR_MSG_GOTO(err_collection, "Cannot create rdf:nil term"); + + for(i = raptor_sequence_size($2)-1; i>=0; i--) { + raptor_term* temp; + raptor_statement* t2 = (raptor_statement*)raptor_sequence_get_at($2, i); + const unsigned char *blank_id; + + blank_id = raptor_world_generate_bnodeid(rdf_parser->world); + if(!blank_id) + YYERR_MSG_GOTO(err_collection, "Cannot create bnodeid"); + + blank = raptor_new_term_from_blank(rdf_parser->world, + blank_id); + RAPTOR_FREE(char*, blank_id); + if(!blank) + YYERR_MSG_GOTO(err_collection, "Cannot create bnode"); + + t2->subject = blank; + t2->predicate = first_identifier; + /* t2->object already set to the value we want */ + raptor_turtle_defer_statement((raptor_parser*)rdf_parser, t2); + + temp = t2->object; + + t2->subject = blank; + t2->predicate = rest_identifier; + t2->object = object; + raptor_turtle_defer_statement((raptor_parser*)rdf_parser, t2); + + t2->subject = NULL; + t2->predicate = NULL; + t2->object = temp; + + raptor_free_term(object); + object = blank; + blank = NULL; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf(" after substitution objectList="); + raptor_sequence_print($2, stdout); + printf("\n\n"); +#endif + + raptor_free_sequence($2); + + raptor_free_term(first_identifier); + raptor_free_term(rest_identifier); + + $$=object; + + err_collection: + if(errmsg) { + if(blank) + raptor_free_term(blank); + + if(object) + raptor_free_term(object); + + if(rest_identifier) + raptor_free_term(rest_identifier); + + if(first_identifier) + raptor_free_term(first_identifier); + + raptor_free_sequence($2); + + YYERROR_MSG(errmsg); + } +} +| LEFT_ROUND RIGHT_ROUND +{ + raptor_world* world = rdf_parser->world; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("collection\n empty\n"); +#endif + + $$ = raptor_new_term_from_uri(world, RAPTOR_RDF_nil_URI(world)); + if(!$$) + YYERROR; +} +; + + +%% + + +/* Support functions */ + +/* Error handler with scanner context, during parsing */ +int +turtle_parser_error(raptor_parser* rdf_parser, void* scanner, + const char *msg) +{ + raptor_turtle_parser* turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(turtle_parser->consumed == turtle_parser->consumable && + turtle_parser->processed < turtle_parser->consumed && + !turtle_parser->is_end) { + /* we encountered an error on or around the last byte of the buffer + * sorting it in the next run aye? */ + return 0; + } + + if(turtle_parser->error_count++) + return 0; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + raptor_log_error(rdf_parser->world, RAPTOR_LOG_LEVEL_ERROR, + &rdf_parser->locator, msg); + + return 0; +} + + +/* Error handler within raptor functions and callbacks */ +static void +turtle_parser_error_simple(void* user_data, const char *msg, ...) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + raptor_turtle_parser* turtle_parser; + va_list args; + + va_start(args, msg); + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(turtle_parser->consumed == turtle_parser->consumable && + turtle_parser->processed < turtle_parser->consumed && + !turtle_parser->is_end) { + /* we encountered an error on or around the last byte of the buffer + * sorting it in the next run aye? */ + goto tidy; + } + + if(turtle_parser->error_count++) + goto tidy; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + raptor_log_error_varargs(rdf_parser->world, RAPTOR_LOG_LEVEL_ERROR, + &rdf_parser->locator, msg, + args); + +tidy: + va_end(args); +} + + +int +turtle_syntax_error(raptor_parser *rdf_parser, const char *message, ...) +{ + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + va_list arguments; + + if(!turtle_parser) + return 1; + + if(turtle_parser->error_count++) + return 0; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + va_start(arguments, message); + + raptor_parser_log_error_varargs(((raptor_parser*)rdf_parser), + RAPTOR_LOG_LEVEL_ERROR, message, arguments); + + va_end(arguments); + + return 0; +} + + +raptor_uri* +turtle_qname_to_uri(raptor_parser *rdf_parser, unsigned char *name, size_t name_len) +{ + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(!turtle_parser) + return NULL; + + rdf_parser->locator.line = turtle_parser->lineno; +#ifdef RAPTOR_TURTLE_USE_ERROR_COLUMNS + rdf_parser->locator.column = turtle_lexer_get_column(yyscanner); +#endif + + name_len = raptor_turtle_expand_qname_escapes(name, name_len, + (raptor_simple_message_handler)turtle_parser_error_simple, rdf_parser); + if(!name_len) + return NULL; + + return raptor_qname_string_to_uri(&turtle_parser->namespaces, name, name_len); +} + + + +#ifndef TURTLE_PUSH_PARSE +static int +turtle_parse(raptor_parser *rdf_parser, const char *string, size_t length) +{ + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + int rc; + + if(!string || !*string) + return 0; + + if(turtle_lexer_lex_init(&turtle_parser->scanner)) + return 1; + turtle_parser->scanner_set = 1; + +#if defined(YYDEBUG) && YYDEBUG > 0 + turtle_lexer_set_debug(1 ,&turtle_parser->scanner); + turtle_parser_debug = 1; +#endif + + turtle_lexer_set_extra(rdf_parser, turtle_parser->scanner); + (void)turtle_lexer__scan_bytes((char *)string, (yy_size_t)length, turtle_parser->scanner); + + rc = turtle_parser_parse(rdf_parser, turtle_parser->scanner); + + turtle_lexer_lex_destroy(turtle_parser->scanner); + turtle_parser->scanner_set = 0; + + return rc; +} +#endif + + +#ifdef TURTLE_PUSH_PARSE +static int +turtle_push_parse(raptor_parser *rdf_parser, + const char *string, size_t length) +{ +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + raptor_world* world = rdf_parser->world; +#endif + raptor_turtle_parser* turtle_parser; + void *buffer; + int status; + yypstate *ps; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(!string || !*string) + return 0; + + if(turtle_lexer_lex_init(&turtle_parser->scanner)) + return 1; + turtle_parser->scanner_set = 1; + +#if defined(YYDEBUG) && YYDEBUG > 0 + turtle_lexer_set_debug(1 ,&turtle_parser->scanner); + turtle_parser_debug = 1; +#endif + + turtle_lexer_set_extra(rdf_parser, turtle_parser->scanner); + buffer = turtle_lexer__scan_bytes(string, (yy_size_t)length, turtle_parser->scanner); + + /* returns a parser instance or 0 on out of memory */ + ps = yypstate_new(); + if(!ps) + return 1; + + do { + TURTLE_PARSER_YYSTYPE lval; + int token; + + memset(&lval, 0, sizeof(TURTLE_PARSER_YYSTYPE)); + + token = turtle_lexer_lex(&lval, turtle_parser->scanner); + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + printf("token %s\n", turtle_token_print(world, token, &lval)); +#endif + + status = yypush_parse(ps, token, &lval, rdf_parser, turtle_parser->scanner); + + /* turtle_token_free(world, token, &lval); */ + + if(!token || token == EOF || token == ERROR_TOKEN) + break; + } while (status == YYPUSH_MORE); + yypstate_delete(ps); + + turtle_lexer_lex_destroy(turtle_parser->scanner); + turtle_parser->scanner_set = 0; + + return 0; +} +#endif + + +/** + * raptor_turtle_parse_init - Initialise the Raptor Turtle parser + * + * Return value: non 0 on failure + **/ + +static int +raptor_turtle_parse_init(raptor_parser* rdf_parser, const char *name) { + raptor_turtle_parser* turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + if(raptor_namespaces_init(rdf_parser->world, &turtle_parser->namespaces, 0)) + return 1; + + turtle_parser->trig = !strcmp(name, "trig"); + + return 0; +} + + +/* PUBLIC FUNCTIONS */ + + +/* + * raptor_turtle_parse_terminate - Free the Raptor Turtle parser + * @rdf_parser: parser object + * + **/ +static void +raptor_turtle_parse_terminate(raptor_parser *rdf_parser) { + raptor_turtle_parser *turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + raptor_namespaces_clear(&turtle_parser->namespaces); + + if(turtle_parser->scanner_set) { + turtle_lexer_lex_destroy(turtle_parser->scanner); + turtle_parser->scanner_set = 0; + } + + if(turtle_parser->buffer) + RAPTOR_FREE(cdata, turtle_parser->buffer); + + if(turtle_parser->graph_name) { + raptor_free_term(turtle_parser->graph_name); + turtle_parser->graph_name = NULL; + } +} + + +static void +raptor_turtle_clone_statement(raptor_parser *parser, raptor_statement *t) +{ + raptor_turtle_parser *turtle_parser = (raptor_turtle_parser*)parser->context; + raptor_statement *statement = &parser->statement; + + if(!t->subject || !t->predicate || !t->object) + return; + + if(turtle_parser->trig && turtle_parser->graph_name) + statement->graph = raptor_term_copy(turtle_parser->graph_name); + + if(!parser->emitted_default_graph && !turtle_parser->graph_name) { + /* for non-TRIG - start default graph at first triple */ + raptor_parser_start_graph(parser, NULL, 0); + parser->emitted_default_graph++; + } + + /* Two choices for subject for Turtle */ + if(t->subject->type == RAPTOR_TERM_TYPE_BLANK) { + statement->subject = raptor_new_term_from_blank(parser->world, + t->subject->value.blank.string); + } else { + /* RAPTOR_TERM_TYPE_URI */ + RAPTOR_ASSERT(t->subject->type != RAPTOR_TERM_TYPE_URI, + "subject type is not resource"); + statement->subject = raptor_new_term_from_uri(parser->world, + t->subject->value.uri); + } + + /* Predicates are URIs but check for bad ordinals */ + if(!strncmp((const char*)raptor_uri_as_string(t->predicate->value.uri), + "http://www.w3.org/1999/02/22-rdf-syntax-ns#_", 44)) { + unsigned char* predicate_uri_string = raptor_uri_as_string(t->predicate->value.uri); + int predicate_ordinal = raptor_check_ordinal(predicate_uri_string+44); + if(predicate_ordinal <= 0) + raptor_parser_error(parser, "Illegal ordinal value %d in property '%s'.", predicate_ordinal, predicate_uri_string); + } + + statement->predicate = raptor_new_term_from_uri(parser->world, + t->predicate->value.uri); + + + /* Three choices for object for Turtle */ + if(t->object->type == RAPTOR_TERM_TYPE_URI) { + statement->object = raptor_new_term_from_uri(parser->world, + t->object->value.uri); + } else if(t->object->type == RAPTOR_TERM_TYPE_BLANK) { + statement->object = raptor_new_term_from_blank(parser->world, + t->object->value.blank.string); + } else { + /* RAPTOR_TERM_TYPE_LITERAL */ + RAPTOR_ASSERT(t->object->type != RAPTOR_TERM_TYPE_LITERAL, + "object type is not literal"); + statement->object = raptor_new_term_from_literal(parser->world, + t->object->value.literal.string, + t->object->value.literal.datatype, + t->object->value.literal.language); + } +} + +static void +raptor_turtle_handle_statement(raptor_parser *parser, raptor_statement *t) +{ + if(!t->subject || !t->predicate || !t->object) + return; + + if(!parser->statement_handler) + return; + + /* Generate the statement */ + (*parser->statement_handler)(parser->user_data, t); +} + +static void +raptor_turtle_generate_statement(raptor_parser *parser, raptor_statement *t) +{ + raptor_turtle_clone_statement(parser, t); + raptor_turtle_handle_statement(parser, &parser->statement); + /* clear resources */ + raptor_statement_clear(&parser->statement); +} + +static void +raptor_turtle_defer_statement(raptor_parser *parser, raptor_statement *t) +{ + raptor_statement* st; + raptor_turtle_parser* turtle_parser; + + raptor_turtle_clone_statement(parser, t); + st = raptor_new_statement(parser->world); + if(!st) { + return; + } + /* copy static to dynamic statement, it's a move really */ + st->subject = parser->statement.subject, parser->statement.subject = NULL; + st->predicate = parser->statement.predicate, parser->statement.predicate = NULL; + st->object = parser->statement.object, parser->statement.object = NULL; + st->graph = parser->statement.graph, parser->statement.graph = NULL; + + /* prep deferred list */ + turtle_parser = (raptor_turtle_parser*)parser->context; + if(!turtle_parser->deferred) { + turtle_parser->deferred = raptor_new_sequence((raptor_data_free_handler)raptor_free_statement, NULL); + if(!turtle_parser->deferred) { + goto free_seq; + } + } + /* append to deferred list */ + if(raptor_sequence_push(turtle_parser->deferred, st)) { + free_seq: + raptor_free_statement(st); + } +} + + + +static int +raptor_turtle_parse_chunk(raptor_parser* rdf_parser, + const unsigned char *s, size_t len, + int is_end) +{ + raptor_turtle_parser *turtle_parser; + char *ptr; + int rc; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG2("adding %d bytes to line buffer\n", (int)len); +#endif + + if(!len && !is_end) { + /* nothing to do */ + return 0; + } + + /* the actual buffer will contained unprocessed characters from + * the last run plus the chunk passed here */ + turtle_parser->end_of_buffer = turtle_parser->consumed + len; + if(turtle_parser->end_of_buffer > turtle_parser->buffer_length) { + /* resize */ + size_t new_buffer_length = turtle_parser->end_of_buffer; + + turtle_parser->buffer = RAPTOR_REALLOC(char*, turtle_parser->buffer, + new_buffer_length + 1); + + /* adjust stored length */ + turtle_parser->buffer_length = new_buffer_length; + } + if(!turtle_parser->buffer && turtle_parser->buffer_length) { + /* we tried to alloc a buffer but we failed */ + raptor_parser_fatal_error(rdf_parser, "Out of memory"); + return 1; + } + if(is_end && !turtle_parser->end_of_buffer) { + /* Nothing to do */ + return 0; + } + + /* move pointer to end of cdata buffer */ + ptr = turtle_parser->buffer + turtle_parser->consumed; + + /* now write new stuff at end of cdata buffer */ + memcpy(ptr, s, len); + ptr += len; + *ptr = '\0'; + + /* reset processed counter */ + turtle_parser->processed = 0U; + /* unconsume */ + turtle_parser->consumed = 0U; + /* reset line numbers */ + turtle_parser->lineno = turtle_parser->lineno_last_good; + + /* let everyone know if this is the last chunk */ + turtle_parser->is_end = is_end; + if(!is_end) { + /* it's safer not to pass the very last line to the lexer + * just in case we end up with EOB-in-the-middle-of-X situations */ + size_t i = turtle_parser->end_of_buffer; + while(i > 0U && turtle_parser->buffer[--i] != '\n'); + /* either i == 0U or i points to the last \n before the end-of-buffer */ + turtle_parser->consumable = i; + } else { + /* otherwise the consumable number of bytes coincides with the EOB */ + turtle_parser->consumable = turtle_parser->end_of_buffer; + } + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + RAPTOR_DEBUG3("buffer buffer now '%s' (%ld bytes)\n", + turtle_parser->buffer, turtle_parser->buffer_length); +#endif + +#ifdef TURTLE_PUSH_PARSE + rc = turtle_push_parse(rdf_parser, + turtle_parser->buffer, turtle_parser->consumable); +#else + rc = turtle_parse(rdf_parser, turtle_parser->buffer, turtle_parser->consumable); +#endif + + if(turtle_parser->error_count) { + rc = 1; + } else if(!is_end) { + /* move stuff to the beginning of the buffer */ + turtle_parser->consumed = turtle_parser->end_of_buffer - turtle_parser->processed; + if(turtle_parser->consumed && turtle_parser->processed) { + memmove(turtle_parser->buffer, + turtle_parser->buffer + turtle_parser->processed, + turtle_parser->consumed); + /* cancel all deferred eval's */ + if(turtle_parser->deferred) { + raptor_free_sequence(turtle_parser->deferred); + turtle_parser->deferred = NULL; + } + } + } else { + /* this was the last chunk, finalise */ + if(turtle_parser->deferred) { + raptor_sequence* def = turtle_parser->deferred; + int i; + for(i = 0; i < raptor_sequence_size(def); i++) { + raptor_statement *t2 = (raptor_statement*)raptor_sequence_get_at(def, i); + + raptor_turtle_handle_statement(rdf_parser, t2); + } + } + if(rdf_parser->emitted_default_graph) { + /* for non-TRIG - end default graph after last triple */ + raptor_parser_end_graph(rdf_parser, NULL, 0); + rdf_parser->emitted_default_graph--; + } + if(turtle_parser->deferred) { + /* clear resources */ + raptor_free_sequence(turtle_parser->deferred); + turtle_parser->deferred = NULL; + } + } + return rc; +} + + +static int +raptor_turtle_parse_start(raptor_parser *rdf_parser) +{ + raptor_locator *locator=&rdf_parser->locator; + raptor_turtle_parser *turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + + /* base URI required for Turtle */ + if(!rdf_parser->base_uri) + return 1; + + locator->line = 1; + locator->column= -1; /* No column info */ + locator->byte= -1; /* No bytes info */ + + if(turtle_parser->buffer_length) { + RAPTOR_FREE(cdata, turtle_parser->buffer); + turtle_parser->buffer = NULL; + turtle_parser->buffer_length = 0; + } + + turtle_parser->lineno = 1; + + return 0; +} + + +static int +raptor_turtle_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score= 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "ttl")) + score = 8; + if(!strcmp((const char*)suffix, "n3")) + score = 3; + } + + if(mime_type) { + if(strstr((const char*)mime_type, "turtle")) + score += 6; + if(strstr((const char*)mime_type, "n3")) + score += 3; + } + + /* Do this as long as N3 is not supported since it shares the same syntax */ + if(buffer && len) { +#define HAS_TURTLE_PREFIX (raptor_memstr((const char*)buffer, len, "@prefix ") != NULL) +/* The following could also be found with N-Triples but not with @prefix */ +#define HAS_TURTLE_RDF_URI (raptor_memstr((const char*)buffer, len, ": <http://www.w3.org/1999/02/22-rdf-syntax-ns#>") != NULL) + + if(HAS_TURTLE_PREFIX) { + score = 6; + if(HAS_TURTLE_RDF_URI) + score += 2; + } + } + + return score; +} + + +static raptor_uri* +raptor_turtle_get_graph(raptor_parser* rdf_parser) +{ + raptor_turtle_parser *turtle_parser; + + turtle_parser = (raptor_turtle_parser*)rdf_parser->context; + if(turtle_parser->graph_name) + return raptor_uri_copy(turtle_parser->graph_name->value.uri); + + return NULL; +} + + +#ifdef RAPTOR_PARSER_TRIG +static int +raptor_trig_parse_recognise_syntax(raptor_parser_factory* factory, + const unsigned char *buffer, size_t len, + const unsigned char *identifier, + const unsigned char *suffix, + const char *mime_type) +{ + int score= 0; + + if(suffix) { + if(!strcmp((const char*)suffix, "trig")) + score = 9; +#ifndef RAPTOR_PARSER_TURTLE + if(!strcmp((const char*)suffix, "ttl")) + score = 8; + if(!strcmp((const char*)suffix, "n3")) + score = 3; +#endif + } + + if(mime_type) { + if(strstr((const char*)mime_type, "trig")) + score = 6; +#ifndef RAPTOR_PARSER_TURTLE + if(strstr((const char*)mime_type, "turtle")) + score += 6; + if(strstr((const char*)mime_type, "n3")) + score += 3; +#endif + } + +#ifndef RAPTOR_PARSER_TURTLE + /* Do this as long as N3 is not supported since it shares the same syntax */ + if(buffer && len) { +#define HAS_TRIG_PREFIX (raptor_memstr((const char*)buffer, len, "@prefix ") != NULL) +/* The following could also be found with N-Triples but not with @prefix */ +#define HAS_TRIG_RDF_URI (raptor_memstr((const char*)buffer, len, ": <http://www.w3.org/1999/02/22-rdf-syntax-ns#>") != NULL) + + if(HAS_TRIG_PREFIX) { + score = 6; + if(HAS_TRIG_RDF_URI) + score += 2; + } + } +#endif + + return score; +} +#endif + + +#ifdef RAPTOR_PARSER_TURTLE +static const char* const turtle_names[4] = { "turtle", "ntriples-plus", "n3", NULL }; + +static const char* const turtle_uri_strings[3] = { + "http://www.w3.org/ns/formats/Turtle", + "http://www.dajobe.org/2004/01/turtle/", + NULL +}; + +#define TURTLE_TYPES_COUNT 6 +static const raptor_type_q turtle_types[TURTLE_TYPES_COUNT + 1] = { + /* first one is the default */ + { "text/turtle", 11, 10}, + { "application/x-turtle", 20, 10}, + { "application/turtle", 18, 10}, + { "text/n3", 7, 3}, + { "text/rdf+n3", 11, 3}, + { "application/rdf+n3", 18, 3}, + { NULL, 0} +}; + +static int +raptor_turtle_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = turtle_names; + + factory->desc.mime_types = turtle_types; + + factory->desc.label = "Turtle Terse RDF Triple Language"; + factory->desc.uri_strings = turtle_uri_strings; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_turtle_parser); + + factory->init = raptor_turtle_parse_init; + factory->terminate = raptor_turtle_parse_terminate; + factory->start = raptor_turtle_parse_start; + factory->chunk = raptor_turtle_parse_chunk; + factory->recognise_syntax = raptor_turtle_parse_recognise_syntax; + factory->get_graph = raptor_turtle_get_graph; + + return rc; +} +#endif + + +#ifdef RAPTOR_PARSER_TRIG +static const char* const trig_names[2] = { "trig", NULL }; + +static const char* const trig_uri_strings[2] = { + "http://www.wiwiss.fu-berlin.de/suhl/bizer/TriG/Spec/", + NULL +}; + +#define TRIG_TYPES_COUNT 1 +static const raptor_type_q trig_types[TRIG_TYPES_COUNT + 1] = { + /* first one is the default */ + { "application/x-trig", 18, 10}, + { NULL, 0, 0} +}; + +static int +raptor_trig_parser_register_factory(raptor_parser_factory *factory) +{ + int rc = 0; + + factory->desc.names = trig_names; + + factory->desc.mime_types = trig_types; + + factory->desc.label = "TriG - Turtle with Named Graphs"; + factory->desc.uri_strings = trig_uri_strings; + + factory->desc.flags = RAPTOR_SYNTAX_NEED_BASE_URI; + + factory->context_length = sizeof(raptor_turtle_parser); + + factory->init = raptor_turtle_parse_init; + factory->terminate = raptor_turtle_parse_terminate; + factory->start = raptor_turtle_parse_start; + factory->chunk = raptor_turtle_parse_chunk; + factory->recognise_syntax = raptor_trig_parse_recognise_syntax; + factory->get_graph = raptor_turtle_get_graph; + + return rc; +} +#endif + + +#ifdef RAPTOR_PARSER_TURTLE +int +raptor_init_parser_turtle(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_turtle_parser_register_factory); +} +#endif + +#ifdef RAPTOR_PARSER_TRIG +int +raptor_init_parser_trig(raptor_world* world) +{ + return !raptor_world_register_parser_factory(world, + &raptor_trig_parser_register_factory); +} +#endif + + +#ifdef STANDALONE +#include <stdio.h> +#include <locale.h> + +#define TURTLE_FILE_BUF_SIZE 2048 + +static void +turtle_parser_print_statement(void *user, + raptor_statement *statement) +{ + FILE* stream = (FILE*)user; + raptor_statement_print(statement, stream); + putc('\n', stream); +} + + + +int +main(int argc, char *argv[]) +{ + char string[TURTLE_FILE_BUF_SIZE]; + raptor_parser rdf_parser; /* static */ + raptor_turtle_parser turtle_parser; /* static */ + raptor_locator *locator = &rdf_parser.locator; + FILE *fh; + const char *filename; + size_t nobj; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 2 + turtle_parser_debug = 1; +#endif + + if(argc > 1) { + filename = argv[1]; + fh = fopen(filename, "r"); + if(!fh) { + fprintf(stderr, "%s: Cannot open file %s - %s\n", argv[0], filename, + strerror(errno)); + exit(1); + } + } else { + filename="<stdin>"; + fh = stdin; + } + + memset(string, 0, TURTLE_FILE_BUF_SIZE); + nobj = fread(string, TURTLE_FILE_BUF_SIZE, 1, fh); + if(nobj < TURTLE_FILE_BUF_SIZE) { + if(ferror(fh)) { + fprintf(stderr, "%s: file '%s' read failed - %s\n", + argv[0], filename, strerror(errno)); + fclose(fh); + return(1); + } + } + + if(argc > 1) + fclose(fh); + + memset(&rdf_parser, 0, sizeof(rdf_parser)); + memset(&turtle_parser, 0, sizeof(turtle_parser)); + + locator->line= locator->column = -1; + locator->file= filename; + + turtle_parser.lineno= 1; + + rdf_parser.world = raptor_new_world(); + rdf_parser.context = &turtle_parser; + rdf_parser.base_uri = raptor_new_uri(rdf_parser.world, + (const unsigned char*)"http://example.org/fake-base-uri/"); + + raptor_parser_set_statement_handler(&rdf_parser, stdout, + turtle_parser_print_statement); + raptor_turtle_parse_init(&rdf_parser, "turtle"); + + turtle_parser.error_count = 0; + +#ifdef TURTLE_PUSH_PARSE + turtle_push_parse(&rdf_parser, string, strlen(string)); +#else + turtle_parse(&rdf_parser, string, strlen(string)); +#endif + + raptor_turtle_parse_terminate(&rdf_parser); + + raptor_free_uri(rdf_parser.base_uri); + + raptor_free_world(rdf_parser.world); + + return (0); +} +#endif diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..9b25fd5 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,44 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor tests +# +# Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +TESTS=raptor_empty_test$(EXEEXT) + +AM_CPPFLAGS=-I$(top_srcdir)/src +AM_CFLAGS= -I$(top_builddir)/src @CFLAGS@ $(MEM) +AM_LDFLAGS=$(top_builddir)/src/libraptor2.la $(MEM_LIBS) + +EXTRA_PROGRAMS=$(TESTS) + +CLEANFILES=$(TESTS) + +raptor_empty_test_SOURCES=empty.c + + +# Used to make N-triples output consistent +BASE_URI=http://librdf.org/raptor/tests/ + +SUBDIRS = rdfxml ntriples ntriples-2013 nquads-2013 turtle mkr turtle-2013 trig grddl rdfa rdfa11 json feeds + + +$(top_builddir)/src/libraptor2.la: + cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libraptor2.la diff --git a/tests/Makefile.in b/tests/Makefile.in new file mode 100644 index 0000000..aa0aba4 --- /dev/null +++ b/tests/Makefile.in @@ -0,0 +1,1155 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor tests +# +# Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am_raptor_empty_test_OBJECTS = empty.$(OBJEXT) +raptor_empty_test_OBJECTS = $(am_raptor_empty_test_OBJECTS) +raptor_empty_test_LDADD = $(LDADD) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/build/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/empty.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(raptor_empty_test_SOURCES) +DIST_SOURCES = $(raptor_empty_test_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + check recheck distdir distdir-am +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__tty_colors_dummy = \ + mgn= red= grn= lgn= blu= brg= std=; \ + am__color_tests=no +am__tty_colors = { \ + $(am__tty_colors_dummy); \ + if test "X$(AM_COLOR_TESTS)" = Xno; then \ + am__color_tests=no; \ + elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ + am__color_tests=yes; \ + elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ + am__color_tests=yes; \ + fi; \ + if test $$am__color_tests = yes; then \ + red=''; \ + grn=''; \ + lgn=''; \ + blu=''; \ + mgn=''; \ + brg=''; \ + std=''; \ + fi; \ +} +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__recheck_rx = ^[ ]*:recheck:[ ]* +am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* +am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* +# A command that, given a newline-separated list of test names on the +# standard input, print the name of the tests that are to be re-run +# upon "make recheck". +am__list_recheck_tests = $(AWK) '{ \ + recheck = 1; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + { \ + if ((getline line2 < ($$0 ".log")) < 0) \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ + { \ + recheck = 0; \ + break; \ + } \ + else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ + { \ + break; \ + } \ + }; \ + if (recheck) \ + print $$0; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# A command that, given a newline-separated list of test names on the +# standard input, create the global log from their .trs and .log files. +am__create_global_log = $(AWK) ' \ +function fatal(msg) \ +{ \ + print "fatal: making $@: " msg | "cat >&2"; \ + exit 1; \ +} \ +function rst_section(header) \ +{ \ + print header; \ + len = length(header); \ + for (i = 1; i <= len; i = i + 1) \ + printf "="; \ + printf "\n\n"; \ +} \ +{ \ + copy_in_global_log = 1; \ + global_test_result = "RUN"; \ + while ((rc = (getline line < ($$0 ".trs"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".trs"); \ + if (line ~ /$(am__global_test_result_rx)/) \ + { \ + sub("$(am__global_test_result_rx)", "", line); \ + sub("[ ]*$$", "", line); \ + global_test_result = line; \ + } \ + else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ + copy_in_global_log = 0; \ + }; \ + if (copy_in_global_log) \ + { \ + rst_section(global_test_result ": " $$0); \ + while ((rc = (getline line < ($$0 ".log"))) != 0) \ + { \ + if (rc < 0) \ + fatal("failed to read from " $$0 ".log"); \ + print line; \ + }; \ + printf "\n"; \ + }; \ + close ($$0 ".trs"); \ + close ($$0 ".log"); \ +}' +# Restructured Text title. +am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } +# Solaris 10 'make', and several other traditional 'make' implementations, +# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it +# by disabling -e (using the XSI extension "set +e") if it's set. +am__sh_e_setup = case $$- in *e*) set +e;; esac +# Default flags passed to test drivers. +am__common_driver_flags = \ + --color-tests "$$am__color_tests" \ + --enable-hard-errors "$$am__enable_hard_errors" \ + --expect-failure "$$am__expect_failure" +# To be inserted before the command running the test. Creates the +# directory for the log if needed. Stores in $dir the directory +# containing $f, in $tst the test, in $log the log. Executes the +# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and +# passes TESTS_ENVIRONMENT. Set up options for the wrapper that +# will run the test scripts (or their associated LOG_COMPILER, if +# thy have one). +am__check_pre = \ +$(am__sh_e_setup); \ +$(am__vpath_adj_setup) $(am__vpath_adj) \ +$(am__tty_colors); \ +srcdir=$(srcdir); export srcdir; \ +case "$@" in \ + */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ + *) am__odir=.;; \ +esac; \ +test "x$$am__odir" = x"." || test -d "$$am__odir" \ + || $(MKDIR_P) "$$am__odir" || exit $$?; \ +if test -f "./$$f"; then dir=./; \ +elif test -f "$$f"; then dir=; \ +else dir="$(srcdir)/"; fi; \ +tst=$$dir$$f; log='$@'; \ +if test -n '$(DISABLE_HARD_ERRORS)'; then \ + am__enable_hard_errors=no; \ +else \ + am__enable_hard_errors=yes; \ +fi; \ +case " $(XFAIL_TESTS) " in \ + *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ + am__expect_failure=yes;; \ + *) \ + am__expect_failure=no;; \ +esac; \ +$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) +# A shell command to get the names of the tests scripts with any registered +# extension removed (i.e., equivalently, the names of the test logs, with +# the '.log' extension removed). The result is saved in the shell variable +# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, +# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", +# since that might cause problem with VPATH rewrites for suffix-less tests. +# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. +am__set_TESTS_bases = \ + bases='$(TEST_LOGS)'; \ + bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ + bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' +RECHECK_LOGS = $(TEST_LOGS) +TEST_SUITE_LOG = test-suite.log +TEST_EXTENSIONS = @EXEEXT@ .test +LOG_DRIVER = $(SHELL) $(top_srcdir)/build/test-driver +LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) +am__set_b = \ + case '$@' in \ + */*) \ + case '$*' in \ + */*) b='$*';; \ + *) b=`echo '$@' | sed 's/\.log$$//'`; \ + esac;; \ + *) \ + b='$*';; \ + esac +am__test_logs1 = $(TESTS:=.log) +am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) +TEST_LOGS = $(am__test_logs2:.test.log=.log) +TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build/test-driver +TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ + $(TEST_LOG_FLAGS) +DIST_SUBDIRS = $(SUBDIRS) +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/build/depcomp \ + $(top_srcdir)/build/test-driver +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TESTS = raptor_empty_test$(EXEEXT) +AM_CPPFLAGS = -I$(top_srcdir)/src +AM_CFLAGS = -I$(top_builddir)/src @CFLAGS@ $(MEM) +AM_LDFLAGS = $(top_builddir)/src/libraptor2.la $(MEM_LIBS) +EXTRA_PROGRAMS = $(TESTS) +CLEANFILES = $(TESTS) +raptor_empty_test_SOURCES = empty.c + +# Used to make N-triples output consistent +BASE_URI = http://librdf.org/raptor/tests/ +SUBDIRS = rdfxml ntriples ntriples-2013 nquads-2013 turtle mkr turtle-2013 trig grddl rdfa rdfa11 json feeds +all: all-recursive + +.SUFFIXES: +.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +raptor_empty_test$(EXEEXT): $(raptor_empty_test_OBJECTS) $(raptor_empty_test_DEPENDENCIES) $(EXTRA_raptor_empty_test_DEPENDENCIES) + @rm -f raptor_empty_test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(raptor_empty_test_OBJECTS) $(raptor_empty_test_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/empty.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +# This directory's subdirectories are mostly independent; you can cd +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +# Recover from deleted '.trs' file; this should ensure that +# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create +# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells +# to avoid problems with "make -n". +.log.trs: + rm -f $< $@ + $(MAKE) $(AM_MAKEFLAGS) $< + +# Leading 'am--fnord' is there to ensure the list of targets does not +# expand to empty, as could happen e.g. with make check TESTS=''. +am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) +am--force-recheck: + @: + +$(TEST_SUITE_LOG): $(TEST_LOGS) + @$(am__set_TESTS_bases); \ + am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ + redo_bases=`for i in $$bases; do \ + am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ + done`; \ + if test -n "$$redo_bases"; then \ + redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ + redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ + if $(am__make_dryrun); then :; else \ + rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ + fi; \ + fi; \ + if test -n "$$am__remaking_logs"; then \ + echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ + "recursion detected" >&2; \ + elif test -n "$$redo_logs"; then \ + am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ + fi; \ + if $(am__make_dryrun); then :; else \ + st=0; \ + errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ + for i in $$redo_bases; do \ + test -f $$i.trs && test -r $$i.trs \ + || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ + test -f $$i.log && test -r $$i.log \ + || { echo "$$errmsg $$i.log" >&2; st=1; }; \ + done; \ + test $$st -eq 0 || exit 1; \ + fi + @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ + ws='[ ]'; \ + results=`for b in $$bases; do echo $$b.trs; done`; \ + test -n "$$results" || results=/dev/null; \ + all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ + pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ + fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ + skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ + xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ + xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ + error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ + if test `expr $$fail + $$xpass + $$error` -eq 0; then \ + success=true; \ + else \ + success=false; \ + fi; \ + br='==================='; br=$$br$$br$$br$$br; \ + result_count () \ + { \ + if test x"$$1" = x"--maybe-color"; then \ + maybe_colorize=yes; \ + elif test x"$$1" = x"--no-color"; then \ + maybe_colorize=no; \ + else \ + echo "$@: invalid 'result_count' usage" >&2; exit 4; \ + fi; \ + shift; \ + desc=$$1 count=$$2; \ + if test $$maybe_colorize = yes && test $$count -gt 0; then \ + color_start=$$3 color_end=$$std; \ + else \ + color_start= color_end=; \ + fi; \ + echo "$${color_start}# $$desc $$count$${color_end}"; \ + }; \ + create_testsuite_report () \ + { \ + result_count $$1 "TOTAL:" $$all "$$brg"; \ + result_count $$1 "PASS: " $$pass "$$grn"; \ + result_count $$1 "SKIP: " $$skip "$$blu"; \ + result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ + result_count $$1 "FAIL: " $$fail "$$red"; \ + result_count $$1 "XPASS:" $$xpass "$$red"; \ + result_count $$1 "ERROR:" $$error "$$mgn"; \ + }; \ + { \ + echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ + $(am__rst_title); \ + create_testsuite_report --no-color; \ + echo; \ + echo ".. contents:: :depth: 2"; \ + echo; \ + for b in $$bases; do echo $$b; done \ + | $(am__create_global_log); \ + } >$(TEST_SUITE_LOG).tmp || exit 1; \ + mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ + if $$success; then \ + col="$$grn"; \ + else \ + col="$$red"; \ + test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ + fi; \ + echo "$${col}$$br$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ + echo "$${col}$$br$${std}"; \ + create_testsuite_report --maybe-color; \ + echo "$$col$$br$$std"; \ + if $$success; then :; else \ + echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ + if test -n "$(PACKAGE_BUGREPORT)"; then \ + echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ + fi; \ + echo "$$col$$br$$std"; \ + fi; \ + $$success || exit 1 + +check-TESTS: + @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list + @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + trs_list=`for i in $$bases; do echo $$i.trs; done`; \ + log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ + exit $$?; +recheck: all + @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + @set +e; $(am__set_TESTS_bases); \ + bases=`for i in $$bases; do echo $$i; done \ + | $(am__list_recheck_tests)` || exit 1; \ + log_list=`for i in $$bases; do echo $$i.log; done`; \ + log_list=`echo $$log_list`; \ + $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ + am__force_recheck=am--force-recheck \ + TEST_LOGS="$$log_list"; \ + exit $$? +raptor_empty_test.log: raptor_empty_test$(EXEEXT) + @p='raptor_empty_test$(EXEEXT)'; \ + b='raptor_empty_test'; \ + $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +.test.log: + @p='$<'; \ + $(am__set_b); \ + $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ + --log-file $$b.log --trs-file $$b.trs \ + $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ + "$$tst" $(AM_TESTS_FD_REDIRECT) +@am__EXEEXT_TRUE@.test$(EXEEXT).log: +@am__EXEEXT_TRUE@ @p='$<'; \ +@am__EXEEXT_TRUE@ $(am__set_b); \ +@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ +@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ +@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ +@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) + -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) + -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + -rm -f ./$(DEPDIR)/empty.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +html-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-dvi: install-dvi-recursive + +install-dvi-am: + +install-exec-am: + +install-html: install-html-recursive + +install-html-am: + +install-info: install-info-recursive + +install-info-am: + +install-man: + +install-pdf: install-pdf-recursive + +install-pdf-am: + +install-ps: install-ps-recursive + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f ./$(DEPDIR)/empty.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +.MAKE: $(am__recursive_targets) check-am install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--depfiles check check-TESTS check-am clean clean-generic \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am recheck tags tags-am \ + uninstall uninstall-am + +.PRECIOUS: Makefile + + +$(top_builddir)/src/libraptor2.la: + cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libraptor2.la + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/empty.c b/tests/empty.c new file mode 100644 index 0000000..aa23fac --- /dev/null +++ b/tests/empty.c @@ -0,0 +1,33 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * empty.c - Raptor empty file test + * + * Copyright (C) 2004-2006, David Beckett http://purl.org/net/dajobe/ + * Copyright (C) 2004-2004, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + +#include <raptor2.h> + +int main(int argc, char *argv[]); + +int +main(int argc, char *argv[]) +{ + return 0; +} diff --git a/tests/feeds/CMakeLists.txt b/tests/feeds/CMakeLists.txt new file mode 100644 index 0000000..43b9bc6 --- /dev/null +++ b/tests/feeds/CMakeLists.txt @@ -0,0 +1,75 @@ +# raptor/tests/feeds/CMakeLists.txt +# +# Original listfile by Daniel Richard G. <skunk@iSKUNK.ORG> +# This file is in the public domain. +# + +IF(RAPTOR_PARSER_RDFXML) + + RAPPER_TEST(feeds.test01.rdf + "${RAPPER} -q -i rdfxml -o turtle -f writeBaseURI=0 -O http://example.org/whatsnew file:${CMAKE_CURRENT_SOURCE_DIR}/test01.rdf" + test01.ttl + ${CMAKE_CURRENT_SOURCE_DIR}/test01-result.ttl + ) + + RAPPER_TEST(feeds.test02.rdf + "${RAPPER} -q -i rdfxml -o turtle -f writeBaseURI=0 -O http://example.org/news/ file:${CMAKE_CURRENT_SOURCE_DIR}/test02.rdf" + test02.ttl + ${CMAKE_CURRENT_SOURCE_DIR}/test02-result.ttl + ) + + RAPPER_TEST(feeds.test03.rdf + "${RAPPER} -q -i rdfxml -o turtle -f writeBaseURI=0 -O http://example.org file:${CMAKE_CURRENT_SOURCE_DIR}/test03.rdf" + test03.ttl + ${CMAKE_CURRENT_SOURCE_DIR}/test03-result.ttl + ) + +ENDIF(RAPTOR_PARSER_RDFXML) + +IF(RAPTOR_PARSER_RSS) + + RAPPER_TEST(feeds.test04.atom + "${RAPPER} -q -i rss-tag-soup -o turtle -f writeBaseURI=0 -O http://www.example.org/blog/ file:${CMAKE_CURRENT_SOURCE_DIR}/test04.atom" + test04.ttl + ${CMAKE_CURRENT_SOURCE_DIR}/test04-result.ttl + ) + + RAPPER_TEST(feeds.test05.atom + "${RAPPER} -q -i rss-tag-soup -o turtle -f writeBaseURI=0 -O http://www.example.org/blog/ file:${CMAKE_CURRENT_SOURCE_DIR}/test05.atom" + test05.ttl + ${CMAKE_CURRENT_SOURCE_DIR}/test05-result.ttl + ) + +ENDIF(RAPTOR_PARSER_RSS) + +IF(RAPTOR_SERIALIZER_ATOM) + + RAPPER_TEST(feeds.test01.ttl + "${RAPPER} -q -i turtle -o atom -f writeBaseURI=0 -f rssTriples=atom-triples -f atomEntryUri=http://example.org/2006/03/28/blog-item -I http://example.org/whatsnew -O http://example.org/whatsnew file:test01.ttl" + test01.atom + ${CMAKE_CURRENT_SOURCE_DIR}/test01-result.atom + ) + + RAPPER_TEST(feeds.test02.ttl + "${RAPPER} -q -i turtle -o atom -f writeBaseURI=0 -f rssTriples=atom-triples -I http://example.org/news/ -O http://example.org/news/ file:test02.ttl" + test02.atom + ${CMAKE_CURRENT_SOURCE_DIR}/test02-result.atom + ) + + RAPPER_TEST(feeds.test03.ttl + "${RAPPER} -q -i turtle -o atom -f writeBaseURI=0 -f rssTriples=atom-triples -I http://example.org -O http://example.org file:test03.ttl" + test03.atom + ${CMAKE_CURRENT_SOURCE_DIR}/test03-result.atom + ) + +ENDIF(RAPTOR_SERIALIZER_ATOM) + +IF(HAVE_JING) + ADD_TEST(feeds.jing-test01.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng test01.atom) + ADD_TEST(feeds.jing-test02.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng test02.atom) + ADD_TEST(feeds.jing-test03.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng test03.atom) + ADD_TEST(feeds.jing-test04.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng ${CMAKE_CURRENT_SOURCE_DIR}/test04.atom) + ADD_TEST(feeds.jing-test05.atom ${JING} ${CMAKE_CURRENT_SOURCE_DIR}/atom.rng ${CMAKE_CURRENT_SOURCE_DIR}/test05.atom) +ENDIF(HAVE_JING) + +# end raptor/tests/feeds/CMakeLists.txt diff --git a/tests/feeds/Makefile.am b/tests/feeds/Makefile.am new file mode 100644 index 0000000..82b67d6 --- /dev/null +++ b/tests/feeds/Makefile.am @@ -0,0 +1,248 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor Feed tests +# +# Copyright (C) 2009, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +# Input RDF/XML (atom model) files - rdfxml parser +TEST_IN_RDF_ATOMS= test01.rdf test02.rdf test03.rdf +# Input Atom 1.0 (atom model) files - rss-tag-soup parser +TEST_IN_ATOMS= test04.atom test05.atom + +# Output files in Turtle (after parsing) and Atom (after serializing) +OUT_RDF_TTLS= $(TEST_IN_RDF_ATOMS:.rdf=.ttl) +OUT_ATOM_TTLS= $(TEST_IN_ATOMS:.atom=.ttl) +OUT_RDF_ATOMS= $(TEST_IN_RDF_ATOMS:.rdf=.atom) + +# Expected results for above +EXPECTED_TTLS= $(OUT_RDF_TTLS:.ttl=-result.ttl) $(OUT_ATOM_TTLS:.ttl=-result.ttl) +EXPECTED_ATOMS= $(OUT_RDF_ATOMS:.atom=-result.atom) + +# Files generated during testing (to delete/clean) +OUT_TTLS = $(OUT_RDF_TTLS) $(OUT_ATOM_TTLS) +OUT_ATOMS = $(OUT_RDF_ATOMS) + +EXTRA_DIST = \ +CMakeLists.txt \ +$(TEST_IN_RDF_ATOMS) $(TEST_IN_ATOMS) \ +$(EXPECTED_TTLS) $(EXPECTED_ATOMS) \ +atom.rng atom.rnc + +CLEANFILES = $(OUT_ATOMS) $(OUT_TTLS) CMakeTests.txt errors*.log + +RAPPER = $(top_builddir)/utils/rapper + +# http://www.thaiopensource.com/relaxng/trang.html +TRANG = trang + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +FEED_TESTS= + +if RAPTOR_PARSER_RDFXML +FEED_TESTS += check-rdfxml-to-turtle +endif + +if RAPTOR_PARSER_RSS +FEED_TESTS += check-atom-to-turtle +endif + +if RAPTOR_SERIALIZER_ATOM +FEED_TESTS += check-serialize-atom +endif + +if MAINTAINER_MODE +FEED_TESTS += check-validate-atom +endif + +check-local: build-rapper $(FEED_TESTS) + +if MAINTAINER_MODE +check_rdfxml_to_turtle_deps = $(TEST_IN_RDF_ATOMS) +endif + +# Parse from RDF/XML and Serialize to Turtle +check-rdfxml-to-turtle: $(check_rdfxml_to_turtle_deps) + @set +e; result=0; \ + $(RECHO) "Testing RDF/XML to Turtle"; \ + printf 'IF(RAPTOR_PARSER_RDFXML)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_IN_RDF_ATOMS); do \ + parser=rdfxml; \ + name=`basename $$test .rdf` ; \ + turtle="$$name.ttl"; \ + expected="$$name-result.ttl"; \ + opts="-f writeBaseURI=0"; \ + if test $$name = test01; then \ + baseuri="http://example.org/whatsnew"; \ + elif test $$name = test02; then \ + baseuri="http://example.org/news/"; \ + elif test $$name = test03; then \ + baseuri="http://example.org"; \ + fi; \ + opts="-q -i $$parser -o turtle $$opts -O $$baseuri"; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) $$opts file:$(srcdir)/$$test > $$turtle 2> errors-crtt.log; \ + status=$$?; \ + if test $$status != 0; then \ + $(RECHO) "FAILED with code $$status"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + cat errors-crtt.log ; \ + result=1 ; \ + elif cmp $(srcdir)/$$expected $$turtle >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + diff -u $(srcdir)/$$expected $$turtle; result=1; \ + fi; \ + rm -f errors-crtt.log ; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + feeds.$$test \ + "\$${RAPPER} $$opts file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$turtle \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_RDFXML)\n\n' >>CMakeTests.txt; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_atom_to_turtle_deps = $(TEST_IN_ATOMS) +endif + +# Parser from Atom and Serialize to Turtle +check-atom-to-turtle: $(check_atom_to_turtle_deps) + @set +e; result=0; \ + $(RECHO) "Testing Atom to Turtle"; \ + printf 'IF(RAPTOR_PARSER_RSS)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_IN_ATOMS); do \ + parser=rss-tag-soup; \ + name=`basename $$test .atom` ; \ + turtle="$$name.ttl"; \ + expected="$$name-result.ttl"; \ + opts="-f writeBaseURI=0"; \ + baseuri="http://www.example.org/blog/"; \ + if test $$name = test04; then \ + baseuri="http://www.example.org/blog/"; \ + fi; \ + opts="-q -i $$parser -o turtle $$opts -O $$baseuri"; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) $$opts file:$(srcdir)/$$test > $$turtle 2> errors-catt.log; \ + status=$$?; \ + if test $$status != 0; then \ + $(RECHO) "FAILED with code $$status"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + cat errors-catt.log ; \ + result=1 ; \ + elif cmp $(srcdir)/$$expected $$turtle >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + diff -u $(srcdir)/$$expected $$turtle; result=1; \ + fi; \ + rm -f errors-catt.log ; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + feeds.$$test \ + "\$${RAPPER} $$opts file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$turtle \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_RSS)\n\n' >>CMakeTests.txt; \ + set -e; exit $$result + +# Parser from Turtle and Serialize to Atom +check-serialize-atom: check-atom-to-turtle + @set +e; result=0; \ + $(RECHO) "Testing Turtle to Atom XML"; \ + printf 'IF(RAPTOR_SERIALIZER_ATOM)\n\n' >>CMakeTests.txt; \ + for test in $(OUT_RDF_TTLS); do \ + name=`basename $$test .ttl` ; \ + atom="$$name.atom"; \ + expected="$$name-result.atom"; \ + opts="-f writeBaseURI=0 -f rssTriples=atom-triples"; \ + if test $$name = test01; then \ + baseuri="http://example.org/whatsnew"; \ + opts="$$opts -f atomEntryUri=http://example.org/2006/03/28/blog-item"; \ + elif test $$name = test02; then \ + baseuri="http://example.org/news/"; \ + elif test $$name = test03; then \ + baseuri="http://example.org"; \ + fi; \ + opts="-q -i turtle -o atom $$opts -I $$baseuri -O $$baseuri"; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) $$opts file:$$test > $$atom 2> errors-csa.log; \ + status=$$?; \ + if test $$status != 0; then \ + $(RECHO) "FAILED with code $$status"; \ + $(RECHO) "$(RAPPER) $$opts file:$$test"; \ + cat errors-csa.log ; \ + result=1 ; \ + elif cmp $(srcdir)/$$expected $$atom >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + diff -u $(srcdir)/$$expected $$atom; result=1; \ + fi; \ + rm -f errors-csa.log ; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + feeds.$$test \ + "\$${RAPPER} $$opts file:$$test" \ + $$atom \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_SERIALIZER_ATOM)\n\n' >>CMakeTests.txt; \ + set -e; exit $$result + + +if MAINTAINER_MODE +SUFFIXES = .rng .rnc + +.rnc.rng: + $(TRANG) $< $@ + +check-validate-atom: $(srcdir)/atom.rng check-serialize-atom $(TEST_IN_ATOMS) + @set +e; result=0; \ + if test "X$(JING)" = X; then \ + $(RECHO) "WARNING: Skipping feed validation RelaxNG tests - jing is missing"; \ + else \ + $(RECHO) "Validating Atom XML with RelaxNG"; \ + for atom in $(OUT_ATOMS) $(TEST_IN_ATOMS); do \ + test -f $$atom || atom=$(srcdir)/$$atom; \ + $(RECHO) $(RECHO_N) "Validating $$atom $(RECHO_C)"; \ + $(JING) $(srcdir)/atom.rng $$atom > errors-cva.log 2>&1; \ + status=$$?; \ + if test $$status != 0; then \ + $(RECHO) "FAILED with code $$status"; result=1; \ + $(RECHO) $(JING) $(srcdir)/atom.rng $$atom; \ + sed -e "s,^.*$$atom,$$atom," errors-cva.log ; \ + result=1 ; \ + else \ + $(RECHO) "ok"; \ + fi; \ + rm -f errors-cva.log; \ + printf '\tADD_TEST(%s %s)\n' \ + feeds.jing-$$atom \ + "\$${JING} \$${CMAKE_CURRENT_SOURCE_DIR}/atom.rng $$atom" >>CMakeTests.txt; \ + done; \ + fi; \ + set -e; exit $$result + +endif diff --git a/tests/feeds/Makefile.in b/tests/feeds/Makefile.in new file mode 100644 index 0000000..e283464 --- /dev/null +++ b/tests/feeds/Makefile.in @@ -0,0 +1,719 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor Feed tests +# +# Copyright (C) 2009, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@RAPTOR_PARSER_RDFXML_TRUE@am__append_1 = check-rdfxml-to-turtle +@RAPTOR_PARSER_RSS_TRUE@am__append_2 = check-atom-to-turtle +@RAPTOR_SERIALIZER_ATOM_TRUE@am__append_3 = check-serialize-atom +@MAINTAINER_MODE_TRUE@am__append_4 = check-validate-atom +subdir = tests/feeds +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# Input RDF/XML (atom model) files - rdfxml parser +TEST_IN_RDF_ATOMS = test01.rdf test02.rdf test03.rdf +# Input Atom 1.0 (atom model) files - rss-tag-soup parser +TEST_IN_ATOMS = test04.atom test05.atom + +# Output files in Turtle (after parsing) and Atom (after serializing) +OUT_RDF_TTLS = $(TEST_IN_RDF_ATOMS:.rdf=.ttl) +OUT_ATOM_TTLS = $(TEST_IN_ATOMS:.atom=.ttl) +OUT_RDF_ATOMS = $(TEST_IN_RDF_ATOMS:.rdf=.atom) + +# Expected results for above +EXPECTED_TTLS = $(OUT_RDF_TTLS:.ttl=-result.ttl) $(OUT_ATOM_TTLS:.ttl=-result.ttl) +EXPECTED_ATOMS = $(OUT_RDF_ATOMS:.atom=-result.atom) + +# Files generated during testing (to delete/clean) +OUT_TTLS = $(OUT_RDF_TTLS) $(OUT_ATOM_TTLS) +OUT_ATOMS = $(OUT_RDF_ATOMS) +EXTRA_DIST = \ +CMakeLists.txt \ +$(TEST_IN_RDF_ATOMS) $(TEST_IN_ATOMS) \ +$(EXPECTED_TTLS) $(EXPECTED_ATOMS) \ +atom.rng atom.rnc + +CLEANFILES = $(OUT_ATOMS) $(OUT_TTLS) CMakeTests.txt errors*.log +RAPPER = $(top_builddir)/utils/rapper + +# http://www.thaiopensource.com/relaxng/trang.html +TRANG = trang +FEED_TESTS = $(am__append_1) $(am__append_2) $(am__append_3) \ + $(am__append_4) +@MAINTAINER_MODE_TRUE@check_rdfxml_to_turtle_deps = $(TEST_IN_RDF_ATOMS) +@MAINTAINER_MODE_TRUE@check_atom_to_turtle_deps = $(TEST_IN_ATOMS) +@MAINTAINER_MODE_TRUE@SUFFIXES = .rng .rnc +all: all-am + +.SUFFIXES: +.SUFFIXES: .rng .rnc +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/feeds/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/feeds/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +check-local: build-rapper $(FEED_TESTS) + +# Parse from RDF/XML and Serialize to Turtle +check-rdfxml-to-turtle: $(check_rdfxml_to_turtle_deps) + @set +e; result=0; \ + $(RECHO) "Testing RDF/XML to Turtle"; \ + printf 'IF(RAPTOR_PARSER_RDFXML)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_IN_RDF_ATOMS); do \ + parser=rdfxml; \ + name=`basename $$test .rdf` ; \ + turtle="$$name.ttl"; \ + expected="$$name-result.ttl"; \ + opts="-f writeBaseURI=0"; \ + if test $$name = test01; then \ + baseuri="http://example.org/whatsnew"; \ + elif test $$name = test02; then \ + baseuri="http://example.org/news/"; \ + elif test $$name = test03; then \ + baseuri="http://example.org"; \ + fi; \ + opts="-q -i $$parser -o turtle $$opts -O $$baseuri"; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) $$opts file:$(srcdir)/$$test > $$turtle 2> errors-crtt.log; \ + status=$$?; \ + if test $$status != 0; then \ + $(RECHO) "FAILED with code $$status"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + cat errors-crtt.log ; \ + result=1 ; \ + elif cmp $(srcdir)/$$expected $$turtle >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + diff -u $(srcdir)/$$expected $$turtle; result=1; \ + fi; \ + rm -f errors-crtt.log ; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + feeds.$$test \ + "\$${RAPPER} $$opts file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$turtle \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_RDFXML)\n\n' >>CMakeTests.txt; \ + set -e; exit $$result + +# Parser from Atom and Serialize to Turtle +check-atom-to-turtle: $(check_atom_to_turtle_deps) + @set +e; result=0; \ + $(RECHO) "Testing Atom to Turtle"; \ + printf 'IF(RAPTOR_PARSER_RSS)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_IN_ATOMS); do \ + parser=rss-tag-soup; \ + name=`basename $$test .atom` ; \ + turtle="$$name.ttl"; \ + expected="$$name-result.ttl"; \ + opts="-f writeBaseURI=0"; \ + baseuri="http://www.example.org/blog/"; \ + if test $$name = test04; then \ + baseuri="http://www.example.org/blog/"; \ + fi; \ + opts="-q -i $$parser -o turtle $$opts -O $$baseuri"; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) $$opts file:$(srcdir)/$$test > $$turtle 2> errors-catt.log; \ + status=$$?; \ + if test $$status != 0; then \ + $(RECHO) "FAILED with code $$status"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + cat errors-catt.log ; \ + result=1 ; \ + elif cmp $(srcdir)/$$expected $$turtle >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + diff -u $(srcdir)/$$expected $$turtle; result=1; \ + fi; \ + rm -f errors-catt.log ; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + feeds.$$test \ + "\$${RAPPER} $$opts file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$turtle \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_RSS)\n\n' >>CMakeTests.txt; \ + set -e; exit $$result + +# Parser from Turtle and Serialize to Atom +check-serialize-atom: check-atom-to-turtle + @set +e; result=0; \ + $(RECHO) "Testing Turtle to Atom XML"; \ + printf 'IF(RAPTOR_SERIALIZER_ATOM)\n\n' >>CMakeTests.txt; \ + for test in $(OUT_RDF_TTLS); do \ + name=`basename $$test .ttl` ; \ + atom="$$name.atom"; \ + expected="$$name-result.atom"; \ + opts="-f writeBaseURI=0 -f rssTriples=atom-triples"; \ + if test $$name = test01; then \ + baseuri="http://example.org/whatsnew"; \ + opts="$$opts -f atomEntryUri=http://example.org/2006/03/28/blog-item"; \ + elif test $$name = test02; then \ + baseuri="http://example.org/news/"; \ + elif test $$name = test03; then \ + baseuri="http://example.org"; \ + fi; \ + opts="-q -i turtle -o atom $$opts -I $$baseuri -O $$baseuri"; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) $$opts file:$$test > $$atom 2> errors-csa.log; \ + status=$$?; \ + if test $$status != 0; then \ + $(RECHO) "FAILED with code $$status"; \ + $(RECHO) "$(RAPPER) $$opts file:$$test"; \ + cat errors-csa.log ; \ + result=1 ; \ + elif cmp $(srcdir)/$$expected $$atom >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "$(RAPPER) $$opts file:$(srcdir)/$$test"; \ + diff -u $(srcdir)/$$expected $$atom; result=1; \ + fi; \ + rm -f errors-csa.log ; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + feeds.$$test \ + "\$${RAPPER} $$opts file:$$test" \ + $$atom \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$expected" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_SERIALIZER_ATOM)\n\n' >>CMakeTests.txt; \ + set -e; exit $$result + +@MAINTAINER_MODE_TRUE@.rnc.rng: +@MAINTAINER_MODE_TRUE@ $(TRANG) $< $@ + +@MAINTAINER_MODE_TRUE@check-validate-atom: $(srcdir)/atom.rng check-serialize-atom $(TEST_IN_ATOMS) +@MAINTAINER_MODE_TRUE@ @set +e; result=0; \ +@MAINTAINER_MODE_TRUE@ if test "X$(JING)" = X; then \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "WARNING: Skipping feed validation RelaxNG tests - jing is missing"; \ +@MAINTAINER_MODE_TRUE@ else \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "Validating Atom XML with RelaxNG"; \ +@MAINTAINER_MODE_TRUE@ for atom in $(OUT_ATOMS) $(TEST_IN_ATOMS); do \ +@MAINTAINER_MODE_TRUE@ test -f $$atom || atom=$(srcdir)/$$atom; \ +@MAINTAINER_MODE_TRUE@ $(RECHO) $(RECHO_N) "Validating $$atom $(RECHO_C)"; \ +@MAINTAINER_MODE_TRUE@ $(JING) $(srcdir)/atom.rng $$atom > errors-cva.log 2>&1; \ +@MAINTAINER_MODE_TRUE@ status=$$?; \ +@MAINTAINER_MODE_TRUE@ if test $$status != 0; then \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "FAILED with code $$status"; result=1; \ +@MAINTAINER_MODE_TRUE@ $(RECHO) $(JING) $(srcdir)/atom.rng $$atom; \ +@MAINTAINER_MODE_TRUE@ sed -e "s,^.*$$atom,$$atom," errors-cva.log ; \ +@MAINTAINER_MODE_TRUE@ result=1 ; \ +@MAINTAINER_MODE_TRUE@ else \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "ok"; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ rm -f errors-cva.log; \ +@MAINTAINER_MODE_TRUE@ printf '\tADD_TEST(%s %s)\n' \ +@MAINTAINER_MODE_TRUE@ feeds.jing-$$atom \ +@MAINTAINER_MODE_TRUE@ "\$${JING} \$${CMAKE_CURRENT_SOURCE_DIR}/atom.rng $$atom" >>CMakeTests.txt; \ +@MAINTAINER_MODE_TRUE@ done; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/feeds/atom.rnc b/tests/feeds/atom.rnc new file mode 100644 index 0000000..c657b24 --- /dev/null +++ b/tests/feeds/atom.rnc @@ -0,0 +1,334 @@ +# -*- rnc -*- +# RELAX NG Compact Syntax Grammar for the +# Atom Format Specification Version 11 + +namespace atom = "http://www.w3.org/2005/Atom" +namespace xhtml = "http://www.w3.org/1999/xhtml" +namespace s = "http://www.ascc.net/xml/schematron" +namespace local = "" + +start = atomFeed | atomEntry + +# Common attributes + +atomCommonAttributes = + attribute xml:base { atomUri }?, + attribute xml:lang { atomLanguageTag }?, + undefinedAttribute* + +# Text Constructs +atomPlainTextConstruct = + atomCommonAttributes, + attribute type { "text" | "html" }?, + text + +atomXHTMLTextConstruct = + atomCommonAttributes, + attribute type { "xhtml" }, + xhtmlDiv + +atomTextConstruct = atomPlainTextConstruct | atomXHTMLTextConstruct + +# Person Construct + +atomPersonConstruct = + atomCommonAttributes, + (element atom:name { text } + & element atom:uri { atomUri }? + & element atom:email { atomEmailAddress }? + & extensionElement*) + +# Date Construct + +atomDateConstruct = + atomCommonAttributes, + xsd:dateTime + +# atom:feed + +atomFeed = + [ + s:rule [ + context = "atom:feed" + s:assert [ + test = "atom:author or not(atom:entry[not(atom:author)])" + "An atom:feed must have an atom:author unless all " + ~ "of its atom:entry children have an atom:author." + ] + ] + ] + element atom:feed { + atomCommonAttributes, + (atomAuthor* + & atomCategory* + & atomContributor* + & atomGenerator? + & atomIcon? + & atomId + & atomLink* + & atomLogo? + & atomRights? + & atomSubtitle? + & atomTitle + & atomUpdated + & extensionElement*), + atomEntry* + } + +# atom:entry + +atomEntry = + [ + s:rule [ + context = "atom:entry" + s:assert [ + test = "atom:link[@rel='alternate'] " + ~ "or atom:link[not(@rel)] " + ~ "or atom:content" + "An atom:entry must have at least one atom:link element " + ~ "with a rel attribute of 'alternate' " + ~ "or an atom:content." + ] + ] + s:rule [ + context = "atom:entry" + s:assert [ + test = "atom:author or " + ~ "../atom:author or atom:source/atom:author" + "An atom:entry must have an atom:author " + ~ "if its feed does not." + ] + ] + ] + element atom:entry { + atomCommonAttributes, + (atomAuthor* + & atomCategory* + & atomContent? + & atomContributor* + & atomId + & atomLink* + & atomPublished? + & atomRights? + & atomSource? + & atomSummary? + & atomTitle + & atomUpdated + & extensionElement*) + } + +# atom:content + +atomInlineTextContent = + element atom:content { + atomCommonAttributes, + attribute type { "text" | "html" }?, + (text)* + } + +atomInlineXHTMLContent = + element atom:content { + atomCommonAttributes, + attribute type { "xhtml" }, + xhtmlDiv + } + +atomInlineOtherContent = + element atom:content { + atomCommonAttributes, + attribute type { atomMediaType }?, + (text|anyElement)* + } + +atomOutOfLineContent = + element atom:content { + atomCommonAttributes, + attribute type { atomMediaType }?, + attribute src { atomUri }, + empty + } + +atomContent = atomInlineTextContent + | atomInlineXHTMLContent + | atomInlineOtherContent + | atomOutOfLineContent + +# atom:author + +atomAuthor = element atom:author { atomPersonConstruct } + +# atom:category + +atomCategory = + element atom:category { + atomCommonAttributes, + attribute term { text }, + attribute scheme { atomUri }?, + attribute label { text }?, + undefinedContent + } + +# atom:contributor + +atomContributor = element atom:contributor { atomPersonConstruct } + +# atom:generator + +atomGenerator = element atom:generator { + atomCommonAttributes, + attribute uri { atomUri }?, + attribute version { text }?, + text +} + +# atom:icon + +atomIcon = element atom:icon { + atomCommonAttributes, + (atomUri) +} + +# atom:id + +atomId = element atom:id { + atomCommonAttributes, + (atomUri) +} + +# atom:logo + +atomLogo = element atom:logo { + atomCommonAttributes, + (atomUri) +} + +# atom:link + +atomLink = + element atom:link { + atomCommonAttributes, + attribute href { atomUri }, + attribute rel { atomNCName | atomUri }?, + attribute type { atomMediaType }?, + attribute hreflang { atomLanguageTag }?, + attribute title { text }?, + attribute length { text }?, + undefinedContent + } + +# atom:published + +atomPublished = element atom:published { atomDateConstruct } + +# atom:rights + +atomRights = element atom:rights { atomTextConstruct } + +# atom:source + +atomSource = + element atom:source { + atomCommonAttributes, + (atomAuthor* + & atomCategory* + & atomContributor* + & atomGenerator? + & atomIcon? + & atomId? + & atomLink* + & atomLogo? + & atomRights? + & atomSubtitle? + & atomTitle? + & atomUpdated? + & extensionElement*) + } + +# atom:subtitle + +atomSubtitle = element atom:subtitle { atomTextConstruct } + +# atom:summary + +atomSummary = element atom:summary { atomTextConstruct } + +# atom:title + +atomTitle = element atom:title { atomTextConstruct } + +# atom:updated +atomUpdated = element atom:updated { atomDateConstruct } + +# Low-level simple types + +atomNCName = xsd:string { minLength = "1" pattern = "[^:]*" } + +# Whatever a media type is, it contains at least one slash +atomMediaType = xsd:string { pattern = ".+/.+" } + +# As defined in RFC 3066 +atomLanguageTag = xsd:string { + pattern = "[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*" +} + +# Unconstrained; it's not entirely clear how IRI fit into +# xsd:anyURI so let's not try to constrain it here +atomUri = text + +# Whatever an email address is, it contains at least one @ +atomEmailAddress = xsd:string { pattern = ".+@.+" } + +# Simple Extension + +simpleExtensionElement = + element * - atom:* { + text + } + +# Structured Extension + +structuredExtensionElement = + element * - atom:* { + (attribute * { text }+, + (text|anyElement)*) + | (attribute * { text }*, + (text?, anyElement+, (text|anyElement)*)) + } + +# Other Extensibility + +extensionElement = + simpleExtensionElement | structuredExtensionElement + +undefinedAttribute = + attribute * - (xml:base | xml:lang | local:*) { text } + +undefinedContent = (text|anyForeignElement)* + +anyElement = + element * { + (attribute * { text } + | text + | anyElement)* + } + +anyForeignElement = + element * - atom:* { + (attribute * { text } + | text + | anyElement)* + } + +# XHTML + +anyXHTML = element xhtml:* { + (attribute * { text } + | text + | anyXHTML)* +} + +xhtmlDiv = element xhtml:div { + (attribute * { text } + | text + | anyXHTML)* +} diff --git a/tests/feeds/atom.rng b/tests/feeds/atom.rng new file mode 100644 index 0000000..c2df4e4 --- /dev/null +++ b/tests/feeds/atom.rng @@ -0,0 +1,597 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + -*- rnc -*- + RELAX NG Compact Syntax Grammar for the + Atom Format Specification Version 11 +--> +<grammar xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s="http://www.ascc.net/xml/schematron" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> + <start> + <choice> + <ref name="atomFeed"/> + <ref name="atomEntry"/> + </choice> + </start> + <!-- Common attributes --> + <define name="atomCommonAttributes"> + <optional> + <attribute name="xml:base"> + <ref name="atomUri"/> + </attribute> + </optional> + <optional> + <attribute name="xml:lang"> + <ref name="atomLanguageTag"/> + </attribute> + </optional> + <zeroOrMore> + <ref name="undefinedAttribute"/> + </zeroOrMore> + </define> + <!-- Text Constructs --> + <define name="atomPlainTextConstruct"> + <ref name="atomCommonAttributes"/> + <optional> + <attribute name="type"> + <choice> + <value>text</value> + <value>html</value> + </choice> + </attribute> + </optional> + <text/> + </define> + <define name="atomXHTMLTextConstruct"> + <ref name="atomCommonAttributes"/> + <attribute name="type"> + <value>xhtml</value> + </attribute> + <ref name="xhtmlDiv"/> + </define> + <define name="atomTextConstruct"> + <choice> + <ref name="atomPlainTextConstruct"/> + <ref name="atomXHTMLTextConstruct"/> + </choice> + </define> + <!-- Person Construct --> + <define name="atomPersonConstruct"> + <ref name="atomCommonAttributes"/> + <interleave> + <element name="atom:name"> + <text/> + </element> + <optional> + <element name="atom:uri"> + <ref name="atomUri"/> + </element> + </optional> + <optional> + <element name="atom:email"> + <ref name="atomEmailAddress"/> + </element> + </optional> + <zeroOrMore> + <ref name="extensionElement"/> + </zeroOrMore> + </interleave> + </define> + <!-- Date Construct --> + <define name="atomDateConstruct"> + <ref name="atomCommonAttributes"/> + <data type="dateTime"/> + </define> + <!-- atom:feed --> + <define name="atomFeed"> + <element name="atom:feed"> + <s:rule context="atom:feed"> + <s:assert test="atom:author or not(atom:entry[not(atom:author)])">An atom:feed must have an atom:author unless all of its atom:entry children have an atom:author.</s:assert> + </s:rule> + <ref name="atomCommonAttributes"/> + <interleave> + <zeroOrMore> + <ref name="atomAuthor"/> + </zeroOrMore> + <zeroOrMore> + <ref name="atomCategory"/> + </zeroOrMore> + <zeroOrMore> + <ref name="atomContributor"/> + </zeroOrMore> + <optional> + <ref name="atomGenerator"/> + </optional> + <optional> + <ref name="atomIcon"/> + </optional> + <ref name="atomId"/> + <zeroOrMore> + <ref name="atomLink"/> + </zeroOrMore> + <optional> + <ref name="atomLogo"/> + </optional> + <optional> + <ref name="atomRights"/> + </optional> + <optional> + <ref name="atomSubtitle"/> + </optional> + <ref name="atomTitle"/> + <ref name="atomUpdated"/> + <zeroOrMore> + <ref name="extensionElement"/> + </zeroOrMore> + </interleave> + <zeroOrMore> + <ref name="atomEntry"/> + </zeroOrMore> + </element> + </define> + <!-- atom:entry --> + <define name="atomEntry"> + <element name="atom:entry"> + <s:rule context="atom:entry"> + <s:assert test="atom:link[@rel='alternate'] or atom:link[not(@rel)] or atom:content">An atom:entry must have at least one atom:link element with a rel attribute of 'alternate' or an atom:content.</s:assert> + </s:rule> + <s:rule context="atom:entry"> + <s:assert test="atom:author or ../atom:author or atom:source/atom:author">An atom:entry must have an atom:author if its feed does not.</s:assert> + </s:rule> + <ref name="atomCommonAttributes"/> + <interleave> + <zeroOrMore> + <ref name="atomAuthor"/> + </zeroOrMore> + <zeroOrMore> + <ref name="atomCategory"/> + </zeroOrMore> + <optional> + <ref name="atomContent"/> + </optional> + <zeroOrMore> + <ref name="atomContributor"/> + </zeroOrMore> + <ref name="atomId"/> + <zeroOrMore> + <ref name="atomLink"/> + </zeroOrMore> + <optional> + <ref name="atomPublished"/> + </optional> + <optional> + <ref name="atomRights"/> + </optional> + <optional> + <ref name="atomSource"/> + </optional> + <optional> + <ref name="atomSummary"/> + </optional> + <ref name="atomTitle"/> + <ref name="atomUpdated"/> + <zeroOrMore> + <ref name="extensionElement"/> + </zeroOrMore> + </interleave> + </element> + </define> + <!-- atom:content --> + <define name="atomInlineTextContent"> + <element name="atom:content"> + <ref name="atomCommonAttributes"/> + <optional> + <attribute name="type"> + <choice> + <value>text</value> + <value>html</value> + </choice> + </attribute> + </optional> + <zeroOrMore> + <text/> + </zeroOrMore> + </element> + </define> + <define name="atomInlineXHTMLContent"> + <element name="atom:content"> + <ref name="atomCommonAttributes"/> + <attribute name="type"> + <value>xhtml</value> + </attribute> + <ref name="xhtmlDiv"/> + </element> + </define> + <define name="atomInlineOtherContent"> + <element name="atom:content"> + <ref name="atomCommonAttributes"/> + <optional> + <attribute name="type"> + <ref name="atomMediaType"/> + </attribute> + </optional> + <zeroOrMore> + <choice> + <text/> + <ref name="anyElement"/> + </choice> + </zeroOrMore> + </element> + </define> + <define name="atomOutOfLineContent"> + <element name="atom:content"> + <ref name="atomCommonAttributes"/> + <optional> + <attribute name="type"> + <ref name="atomMediaType"/> + </attribute> + </optional> + <attribute name="src"> + <ref name="atomUri"/> + </attribute> + <empty/> + </element> + </define> + <define name="atomContent"> + <choice> + <ref name="atomInlineTextContent"/> + <ref name="atomInlineXHTMLContent"/> + <ref name="atomInlineOtherContent"/> + <ref name="atomOutOfLineContent"/> + </choice> + </define> + <!-- atom:author --> + <define name="atomAuthor"> + <element name="atom:author"> + <ref name="atomPersonConstruct"/> + </element> + </define> + <!-- atom:category --> + <define name="atomCategory"> + <element name="atom:category"> + <ref name="atomCommonAttributes"/> + <attribute name="term"/> + <optional> + <attribute name="scheme"> + <ref name="atomUri"/> + </attribute> + </optional> + <optional> + <attribute name="label"/> + </optional> + <ref name="undefinedContent"/> + </element> + </define> + <!-- atom:contributor --> + <define name="atomContributor"> + <element name="atom:contributor"> + <ref name="atomPersonConstruct"/> + </element> + </define> + <!-- atom:generator --> + <define name="atomGenerator"> + <element name="atom:generator"> + <ref name="atomCommonAttributes"/> + <optional> + <attribute name="uri"> + <ref name="atomUri"/> + </attribute> + </optional> + <optional> + <attribute name="version"/> + </optional> + <text/> + </element> + </define> + <!-- atom:icon --> + <define name="atomIcon"> + <element name="atom:icon"> + <ref name="atomCommonAttributes"/> + <ref name="atomUri"/> + </element> + </define> + <!-- atom:id --> + <define name="atomId"> + <element name="atom:id"> + <ref name="atomCommonAttributes"/> + <ref name="atomUri"/> + </element> + </define> + <!-- atom:logo --> + <define name="atomLogo"> + <element name="atom:logo"> + <ref name="atomCommonAttributes"/> + <ref name="atomUri"/> + </element> + </define> + <!-- atom:link --> + <define name="atomLink"> + <element name="atom:link"> + <ref name="atomCommonAttributes"/> + <attribute name="href"> + <ref name="atomUri"/> + </attribute> + <optional> + <attribute name="rel"> + <choice> + <ref name="atomNCName"/> + <ref name="atomUri"/> + </choice> + </attribute> + </optional> + <optional> + <attribute name="type"> + <ref name="atomMediaType"/> + </attribute> + </optional> + <optional> + <attribute name="hreflang"> + <ref name="atomLanguageTag"/> + </attribute> + </optional> + <optional> + <attribute name="title"/> + </optional> + <optional> + <attribute name="length"/> + </optional> + <ref name="undefinedContent"/> + </element> + </define> + <!-- atom:published --> + <define name="atomPublished"> + <element name="atom:published"> + <ref name="atomDateConstruct"/> + </element> + </define> + <!-- atom:rights --> + <define name="atomRights"> + <element name="atom:rights"> + <ref name="atomTextConstruct"/> + </element> + </define> + <!-- atom:source --> + <define name="atomSource"> + <element name="atom:source"> + <ref name="atomCommonAttributes"/> + <interleave> + <zeroOrMore> + <ref name="atomAuthor"/> + </zeroOrMore> + <zeroOrMore> + <ref name="atomCategory"/> + </zeroOrMore> + <zeroOrMore> + <ref name="atomContributor"/> + </zeroOrMore> + <optional> + <ref name="atomGenerator"/> + </optional> + <optional> + <ref name="atomIcon"/> + </optional> + <optional> + <ref name="atomId"/> + </optional> + <zeroOrMore> + <ref name="atomLink"/> + </zeroOrMore> + <optional> + <ref name="atomLogo"/> + </optional> + <optional> + <ref name="atomRights"/> + </optional> + <optional> + <ref name="atomSubtitle"/> + </optional> + <optional> + <ref name="atomTitle"/> + </optional> + <optional> + <ref name="atomUpdated"/> + </optional> + <zeroOrMore> + <ref name="extensionElement"/> + </zeroOrMore> + </interleave> + </element> + </define> + <!-- atom:subtitle --> + <define name="atomSubtitle"> + <element name="atom:subtitle"> + <ref name="atomTextConstruct"/> + </element> + </define> + <!-- atom:summary --> + <define name="atomSummary"> + <element name="atom:summary"> + <ref name="atomTextConstruct"/> + </element> + </define> + <!-- atom:title --> + <define name="atomTitle"> + <element name="atom:title"> + <ref name="atomTextConstruct"/> + </element> + </define> + <!-- atom:updated --> + <define name="atomUpdated"> + <element name="atom:updated"> + <ref name="atomDateConstruct"/> + </element> + </define> + <!-- Low-level simple types --> + <define name="atomNCName"> + <data type="string"> + <param name="minLength">1</param> + <param name="pattern">[^:]*</param> + </data> + </define> + <!-- Whatever a media type is, it contains at least one slash --> + <define name="atomMediaType"> + <data type="string"> + <param name="pattern">.+/.+</param> + </data> + </define> + <!-- As defined in RFC 3066 --> + <define name="atomLanguageTag"> + <data type="string"> + <param name="pattern">[A-Za-z]{1,8}(-[A-Za-z0-9]{1,8})*</param> + </data> + </define> + <!-- + Unconstrained; it's not entirely clear how IRI fit into + xsd:anyURI so let's not try to constrain it here + --> + <define name="atomUri"> + <text/> + </define> + <!-- Whatever an email address is, it contains at least one @ --> + <define name="atomEmailAddress"> + <data type="string"> + <param name="pattern">.+@.+</param> + </data> + </define> + <!-- Simple Extension --> + <define name="simpleExtensionElement"> + <element> + <anyName> + <except> + <nsName ns="http://www.w3.org/2005/Atom"/> + </except> + </anyName> + <text/> + </element> + </define> + <!-- Structured Extension --> + <define name="structuredExtensionElement"> + <element> + <anyName> + <except> + <nsName ns="http://www.w3.org/2005/Atom"/> + </except> + </anyName> + <choice> + <group> + <oneOrMore> + <attribute> + <anyName/> + </attribute> + </oneOrMore> + <zeroOrMore> + <choice> + <text/> + <ref name="anyElement"/> + </choice> + </zeroOrMore> + </group> + <group> + <zeroOrMore> + <attribute> + <anyName/> + </attribute> + </zeroOrMore> + <group> + <optional> + <text/> + </optional> + <oneOrMore> + <ref name="anyElement"/> + </oneOrMore> + <zeroOrMore> + <choice> + <text/> + <ref name="anyElement"/> + </choice> + </zeroOrMore> + </group> + </group> + </choice> + </element> + </define> + <!-- Other Extensibility --> + <define name="extensionElement"> + <choice> + <ref name="simpleExtensionElement"/> + <ref name="structuredExtensionElement"/> + </choice> + </define> + <define name="undefinedAttribute"> + <attribute> + <anyName> + <except> + <name>xml:base</name> + <name>xml:lang</name> + <nsName ns=""/> + </except> + </anyName> + </attribute> + </define> + <define name="undefinedContent"> + <zeroOrMore> + <choice> + <text/> + <ref name="anyForeignElement"/> + </choice> + </zeroOrMore> + </define> + <define name="anyElement"> + <element> + <anyName/> + <zeroOrMore> + <choice> + <attribute> + <anyName/> + </attribute> + <text/> + <ref name="anyElement"/> + </choice> + </zeroOrMore> + </element> + </define> + <define name="anyForeignElement"> + <element> + <anyName> + <except> + <nsName ns="http://www.w3.org/2005/Atom"/> + </except> + </anyName> + <zeroOrMore> + <choice> + <attribute> + <anyName/> + </attribute> + <text/> + <ref name="anyElement"/> + </choice> + </zeroOrMore> + </element> + </define> + <!-- XHTML --> + <define name="anyXHTML"> + <element> + <nsName ns="http://www.w3.org/1999/xhtml"/> + <zeroOrMore> + <choice> + <attribute> + <anyName/> + </attribute> + <text/> + <ref name="anyXHTML"/> + </choice> + </zeroOrMore> + </element> + </define> + <define name="xhtmlDiv"> + <element name="xhtml:div"> + <zeroOrMore> + <choice> + <attribute> + <anyName/> + </attribute> + <text/> + <ref name="anyXHTML"/> + </choice> + </zeroOrMore> + </element> + </define> +</grammar> diff --git a/tests/feeds/test01-result.atom b/tests/feeds/test01-result.atom new file mode 100644 index 0000000..644f4a1 --- /dev/null +++ b/tests/feeds/test01-result.atom @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<entry xmlns:at="http://purl.org/syndication/atomtriples/1" + xmlns:atom="http://www.w3.org/2005/Atom" + xmlns:content="http://purl.org/rss/1.0/modules/content/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:enc="http://purl.oclc.org/net/rss_2.0/enc#" + xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:rss091="http://purl.org/rss/1.0/modules/rss091#" + xmlns:rss="http://purl.org/rss/1.0/" + xmlns="http://www.w3.org/2005/Atom"> + <id>http://example.org/2006/03/28/blog-item</id> + <title>atomic blog item title + 2006-03-28T20:57:15Z + + rss:description here + + + + Example + + + + +
diff --git a/tests/feeds/test01-result.ttl b/tests/feeds/test01-result.ttl new file mode 100644 index 0000000..ed1399e --- /dev/null +++ b/tests/feeds/test01-result.ttl @@ -0,0 +1,40 @@ +@prefix rdf: . +@prefix atom: . +@prefix content: . +@prefix dc: . +@prefix enc: . +@prefix rss091: . +@prefix : . + +<2006/03/28/blog-item> + dc:creator [ + dc:title "Example" ; + a dc:Person + ] ; + dc:date "2006-03-28T20:57:15Z" ; + :description "rss:description here" ; + :link "http://example.org/2006/03/28/blog-item" ; + :title "Original blog item title 2006-03" ; + a :item ; + atom:summary """
The atom:summary description including +tags +over several lines. +
"""^^rdf:XMLLiteral ; + atom:title "atomic blog item title" ; + atom:updated "2006-03-28T20:57:15Z" . + +<> + dc:date "2006-03-28T17:05:01-05:00" ; + :items [ + rdf:_1 <2006/03/28/blog-item> ; + a rdf:Seq + ] ; + :link "http://example.org/whatsnew" ; + :title "example feed with 1 item" ; + a :channel ; + atom:author "example" ; + atom:email "example@example.com" ; + atom:title "atomic title" ; + atom:updated "2006-03-28T20:57:15Z" ; + atom:uri "http://example.com/" . + diff --git a/tests/feeds/test01.rdf b/tests/feeds/test01.rdf new file mode 100644 index 0000000..bb26a6e --- /dev/null +++ b/tests/feeds/test01.rdf @@ -0,0 +1,44 @@ + + + + example feed with 1 item + atomic title + 2006-03-28T20:57:15Z + example + example@example.com + http://example.com/ + http://example.org/whatsnew + 2006-03-28T17:05:01-05:00 + + + + + + + + + Original blog item title 2006-03 + rss:description here +
The atom:summary description including +tags +over several lines. +
+ atomic blog item title + http://example.org/2006/03/28/blog-item + 2006-03-28T20:57:15Z + 2006-03-28T20:57:15Z + + + Example + + +
+ +
diff --git a/tests/feeds/test02-result.atom b/tests/feeds/test02-result.atom new file mode 100644 index 0000000..35c58ee --- /dev/null +++ b/tests/feeds/test02-result.atom @@ -0,0 +1,60 @@ + + + http://example.org/news/ + Example News + 2008-03-30T05:52:06Z + + unknown + + + + atom:id + atom:updated + atom:rights + atom:title + + + atom:summary + atom:id + atom:updated + atom:rights + atom:title + atom:summary + rss091:pubDate + rss:description + + + + http://example.org/news/2008-03-30 + News for 2008-03-30 + 2008-03-30T06:07:28Z + +
+html description 2 +
+ +
+ + + http://example.org/news/2007-10-01 + News for 2007-10-01 + 2007-10-01T06:56:58Z + +
+html description 4 +
+ +
+ +
diff --git a/tests/feeds/test02-result.ttl b/tests/feeds/test02-result.ttl new file mode 100644 index 0000000..ea74c59 --- /dev/null +++ b/tests/feeds/test02-result.ttl @@ -0,0 +1,41 @@ +@prefix rdf: . +@prefix content: . +@prefix dc: . +@prefix : . + +<> + dc:date "2008-03-30T05:52:06Z" ; + :description "Example News feed." ; + :items [ + rdf:_1 <2008-03-30> ; + rdf:_2 <2007-10-01> ; + a rdf:Seq + ] ; + :link "http://example.org/news/" ; + :title "Example News" ; + a :channel . + +<2007-10-01> + dc:date "2007-10-01T06:56:58Z" ; + :description """
+html description 4 +
""" ; + :link "http://example.org/news/2007-10-01" ; + content:encoded """
+html description 3 +
""" ; + :title "News for 2007-10-01" ; + a :item . + +<2008-03-30> + dc:date "2008-03-30T06:07:28Z" ; + :description """
+html description 2 +
""" ; + :link "http://example.org/news/2008-03-30" ; + content:encoded """
+html description 1 +
""" ; + :title "News for 2008-03-30" ; + a :item . + diff --git a/tests/feeds/test02.rdf b/tests/feeds/test02.rdf new file mode 100644 index 0000000..d761513 --- /dev/null +++ b/tests/feeds/test02.rdf @@ -0,0 +1,44 @@ + + + + Example News + http://example.org/news/ + Example News feed. + 2008-03-30T05:52:06Z + + + + + + + + + + http://example.org/news/2008-03-30 + News for 2008-03-30 + +html description 1 +]]> + <div xmlns="http://www.w3.org/1999/xhtml"> +html description 2 +</div> + 2008-03-30T06:07:28Z + + + + http://example.org/news/2007-10-01 + News for 2007-10-01 + +html description 3 +]]> + <div xmlns="http://www.w3.org/1999/xhtml"> +html description 4 +</div> + 2007-10-01T06:56:58Z + + + diff --git a/tests/feeds/test03-result.atom b/tests/feeds/test03-result.atom new file mode 100644 index 0000000..ef0b16e --- /dev/null +++ b/tests/feeds/test03-result.atom @@ -0,0 +1,84 @@ + + + http://example.org/whatsnew + example feed with 3 items + 2006-03-28T20:57:15Z + + bob@bob.com + unknown + http://bob.com/ + + + + atom:id + atom:updated + atom:rights + atom:title + + + atom:summary + atom:id + atom:updated + atom:rights + atom:title + atom:summary + rss091:pubDate + rss:description + + + + http://example.org/2006/03/03/blog-item + blog item title 2006-02 + 2006-03-03T23:59:59Z +
a literal XML atom:content with +tags and +newlines
+ the summary of the item + +
+ + + http://example.org/2006/02/02/blog-item + blog item title 2006-02 + 2006-02-02T00:00:02Z + +
a content:encoded description with +tags and +newlines
+ +
+ + + http://example.org/2006/01/01/blog-item + blog item title 2006-01 + 2006-01-01T00:00:01Z + +
The atom:summary description including +tags +over several lines.
+ +
+ + + http://example.org/2005/12/12/blog-item + blog item title 2005-12 + 2005-12-12T00:00:00Z + + the rss description + + + +
diff --git a/tests/feeds/test03-result.ttl b/tests/feeds/test03-result.ttl new file mode 100644 index 0000000..45c0455 --- /dev/null +++ b/tests/feeds/test03-result.ttl @@ -0,0 +1,57 @@ +@prefix rdf: . +@prefix atom: . +@prefix content: . +@prefix dc: . +@prefix at: . +@prefix : . + + + dc:date "2005-12-12T00:00:00Z" ; + :description "the rss description" ; + :title "blog item title 2005-12" ; + at:contentType "text/html" ; + a :item ; + atom:content . + + + dc:date "2006-01-01T00:00:01Z" ; + :title "blog item title 2006-01" ; + a :item ; + atom:summary """
The atom:summary description including +tags +over several lines.
"""^^rdf:XMLLiteral . + + + dc:date "2006-02-02T00:00:02Z" ; + content:encoded """
a content:encoded description with +tags and +newlines
""" ; + :title "blog item title 2006-02" ; + a :item . + + + dc:date "2006-03-03T12:00:005Z" ; + :description "the summary of the item" ; + :title "blog item title 2006-02" ; + a :item ; + atom:content """
a literal XML atom:content with +tags and +newlines
"""^^rdf:XMLLiteral ; + atom:updated "2006-03-03T23:59:59Z" . + + + dc:date "2006-03-28T17:05:01-05:00" ; + :items [ + rdf:_1 ; + rdf:_2 ; + rdf:_3 ; + rdf:_4 ; + a rdf:Seq + ] ; + :title "example feed with 3 items" ; + a :channel ; + atom:author "bob" ; + atom:email "bob@bob.com" ; + atom:updated "2006-03-28T20:57:15Z" ; + atom:uri "http://bob.com/" . + diff --git a/tests/feeds/test03.rdf b/tests/feeds/test03.rdf new file mode 100644 index 0000000..6a47edd --- /dev/null +++ b/tests/feeds/test03.rdf @@ -0,0 +1,72 @@ + + + + example feed with 3 items + 2006-03-28T20:57:15Z + bob + bob@bob.com + http://bob.com/ + 2006-03-28T17:05:01-05:00 + + + + + + + + + + + + + blog item title 2006-02 + + the summary of the item +
a literal XML atom:content with +tags and +newlines
+ + 2006-03-03T23:59:59Z + 2006-03-03T12:00:005Z +
+ + + + blog item title 2006-02 + + a content:encoded description with +tags and +newlines]]> + 2006-02-02T00:00:02Z + + + + + + blog item title 2006-01 +
The atom:summary description including +tags +over several lines.
+ 2006-01-01T00:00:01Z + +
+ + + + + blog item title 2005-12 + + the rss description + + + text/html + 2005-12-12T00:00:00Z + + +
diff --git a/tests/feeds/test04-result.ttl b/tests/feeds/test04-result.ttl new file mode 100644 index 0000000..8977a78 --- /dev/null +++ b/tests/feeds/test04-result.ttl @@ -0,0 +1,67 @@ +@prefix rdf: . +@prefix rss091: . +@prefix rss: . +@prefix dc: . +@prefix content: . +@prefix atom: . + +<2006/04/01/More-Stuff> + dc:date "2006-04-01T08:03:19-05:00" ; + rss:link "http://www.example.org/blog/2006/04/01/More-Stuff" ; + rss:title "More stuff" ; + a rss:item ; + atom:content "
More stuff
" ; + atom:id ; + atom:link [ + a atom:Link ; + atom:href <2006/04/01/More-Stuff> + ] ; + atom:title "More stuff" ; + atom:updated "2006-04-01T08:03:19-05:00" . + +<2006/04/02/Blah-Blah> + dc:date "2006-04-02T07:06:12-04:00" ; + rss:description "Blah blah summary." ; + rss:link "http://www.example.org/blog/2006/04/02/Blah-Blah" ; + content:encoded "Blah blah summary." ; + rss:title "Blah Blah" ; + a rss:item ; + atom:content "

Blah blah

" ; + atom:id ; + atom:link [ + a atom:Link ; + atom:href <2006/04/02/Blah-Blah> + ] ; + atom:summary "Blah blah summary." ; + atom:title "Blah Blah" ; + atom:updated "2006-04-02T07:06:12-04:00" . + + + dc:date "2006-04-02T22:15:25-04:00" ; + rss:items [ + rdf:_1 <2006/04/02/Blah-Blah> ; + rdf:_2 <2006/04/01/More-Stuff> ; + a rdf:Seq + ] ; + rss:link "http://www.example.org/blog/index.atom" ; + rss:title "Kim Doe" ; + a rss:channel ; + atom:author [ + a atom:Author ; + atom:email "me@example.org" ; + atom:name "Kim Doe" ; + atom:uri "http://www.example.org/blog/" + ] ; + atom:id ; + atom:link [ + a atom:Link ; + atom:href ; + atom:rel "self" + ], [ + a atom:Link ; + atom:href <> + ] ; + atom:subtitle "Blog subtitle" ; + atom:title "Kim Doe" ; + atom:updated "2006-04-02T22:15:25-04:00" . + diff --git a/tests/feeds/test04.atom b/tests/feeds/test04.atom new file mode 100644 index 0000000..ac547c4 --- /dev/null +++ b/tests/feeds/test04.atom @@ -0,0 +1,44 @@ + + + + + http://www.example.org/blog/index.atom + + Kim Doe + Blog subtitle + + Kim Doe + me@example.org + http://www.example.org/blog/ + + 2006-04-02T22:15:25-04:00 + + + + tag:example.org,2004:2217 + + Blah Blah +

Blah blah

+ Blah blah summary. + 2006-04-02T07:06:12-04:00 +
+ + + tag:example.org,2004:2216 + + More stuff +
More stuff
+ 2006-04-01T08:03:19-05:00 +
+ +
diff --git a/tests/feeds/test05-result.ttl b/tests/feeds/test05-result.ttl new file mode 100644 index 0000000..e40cf91 --- /dev/null +++ b/tests/feeds/test05-result.ttl @@ -0,0 +1,24 @@ +@prefix rdf: . +@prefix rss091: . +@prefix rss: . +@prefix dc: . +@prefix atom: . + + + dc:date "2009-01-01T00:00:00-00:00" ; + rss:link "http://www.example.org/blog/index.atom" ; + rss:title "Kim Doe" ; + a rss:channel ; + atom:author [ + a atom:Author ; + atom:name "Kim Doe" + ] ; + atom:id ; + atom:link [ + a atom:Link ; + atom:href ; + atom:rel "self" + ] ; + atom:title "Kim Doe" ; + atom:updated "2009-01-01T00:00:00-00:00" . + diff --git a/tests/feeds/test05.atom b/tests/feeds/test05.atom new file mode 100644 index 0000000..e76a6bb --- /dev/null +++ b/tests/feeds/test05.atom @@ -0,0 +1,9 @@ + + + + http://www.example.org/blog/index.atom + + Kim Doe + Kim Doe + 2009-01-01T00:00:00-00:00 + diff --git a/tests/grddl/CMakeLists.txt b/tests/grddl/CMakeLists.txt new file mode 100644 index 0000000..6873c1a --- /dev/null +++ b/tests/grddl/CMakeLists.txt @@ -0,0 +1,17 @@ +# raptor/tests/grddl/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +IF(RAPTOR_PARSER_GRDDL) + + RAPPER_TEST(grddl.test-01 + "${RAPPER} -f noNet -q -i grddl -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/test-01.html" + test-01.res + ${CMAKE_CURRENT_SOURCE_DIR}/test-01.out + ) + +ENDIF(RAPTOR_PARSER_GRDDL) + +# end raptor/tests/grddl/CMakeLists.txt diff --git a/tests/grddl/Makefile.am b/tests/grddl/Makefile.am new file mode 100644 index 0000000..e0c7774 --- /dev/null +++ b/tests/grddl/Makefile.am @@ -0,0 +1,85 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor GRDDL tests +# +# Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +TEST_FILES=test-01.html +TEST_BAD_FILES= +TEST_OUT_FILES=test-01.out +TEST_DATA_FILES=\ +data-01.rdf data-02.rdf data-01.nt + +ALL_TEST_FILES= \ + $(TEST_FILES) \ + $(TEST_BAD_FILES) \ + $(TEST_OUT_FILES) \ + $(TEST_DATA_FILES) + +EXTRA_DIST = CMakeLists.txt $(ALL_TEST_FILES) + +CLEANFILES = CMakeTests.txt + +RAPPER = $(top_builddir)/utils/rapper + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +if RAPTOR_PARSER_GRDDL +check-local: check-grddl +else +check-local: +endif + +if MAINTAINER_MODE +check_grddl_deps = $(TEST_FILES) +endif + +check-grddl: build-rapper $(check_grddl_deps) + @result=0; \ + $(RECHO) "Testing GRDDL"; \ + printf 'IF(RAPTOR_PARSER_GRDDL)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .html` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -f noNet -q -i grddl -o ntriples $(srcdir)/$$test > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; result=1; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + if test $$status != 1 ; then \ + rm -f $$name.res $$name.err; \ + fi; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + grddl.$$name \ + "\$${RAPPER} -f noNet -q -i grddl -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_GRDDL)\n\n' >>CMakeTests.txt; \ + exit $$result diff --git a/tests/grddl/Makefile.in b/tests/grddl/Makefile.in new file mode 100644 index 0000000..851dc2c --- /dev/null +++ b/tests/grddl/Makefile.in @@ -0,0 +1,571 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor GRDDL tests +# +# Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/grddl +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TEST_FILES = test-01.html +TEST_BAD_FILES = +TEST_OUT_FILES = test-01.out +TEST_DATA_FILES = \ +data-01.rdf data-02.rdf data-01.nt + +ALL_TEST_FILES = \ + $(TEST_FILES) \ + $(TEST_BAD_FILES) \ + $(TEST_OUT_FILES) \ + $(TEST_DATA_FILES) + +EXTRA_DIST = CMakeLists.txt $(ALL_TEST_FILES) +CLEANFILES = CMakeTests.txt +RAPPER = $(top_builddir)/utils/rapper +@MAINTAINER_MODE_TRUE@check_grddl_deps = $(TEST_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/grddl/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/grddl/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +@RAPTOR_PARSER_GRDDL_TRUE@check-local: check-grddl +@RAPTOR_PARSER_GRDDL_FALSE@check-local: + +check-grddl: build-rapper $(check_grddl_deps) + @result=0; \ + $(RECHO) "Testing GRDDL"; \ + printf 'IF(RAPTOR_PARSER_GRDDL)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .html` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -f noNet -q -i grddl -o ntriples $(srcdir)/$$test > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; result=1; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + if test $$status != 1 ; then \ + rm -f $$name.res $$name.err; \ + fi; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + grddl.$$name \ + "\$${RAPPER} -f noNet -q -i grddl -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_GRDDL)\n\n' >>CMakeTests.txt; \ + exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/grddl/data-01.nt b/tests/grddl/data-01.nt new file mode 100644 index 0000000..7ee0b35 --- /dev/null +++ b/tests/grddl/data-01.nt @@ -0,0 +1 @@ +# No Triples diff --git a/tests/grddl/data-01.rdf b/tests/grddl/data-01.rdf new file mode 100644 index 0000000..0982964 --- /dev/null +++ b/tests/grddl/data-01.rdf @@ -0,0 +1,6 @@ + + + + Triple from data-01.rdf + + diff --git a/tests/grddl/data-02.rdf b/tests/grddl/data-02.rdf new file mode 100644 index 0000000..1c7af74 --- /dev/null +++ b/tests/grddl/data-02.rdf @@ -0,0 +1,6 @@ + + + + Triple from data-02.rdf + + diff --git a/tests/grddl/test-01.html b/tests/grddl/test-01.html new file mode 100644 index 0000000..6ea16f6 --- /dev/null +++ b/tests/grddl/test-01.html @@ -0,0 +1,21 @@ + + + + + GRDDL link genid test + + + + + + + + + diff --git a/tests/grddl/test-01.out b/tests/grddl/test-01.out new file mode 100644 index 0000000..7aaecc7 --- /dev/null +++ b/tests/grddl/test-01.out @@ -0,0 +1,2 @@ +_:genid1 "Triple from data-01.rdf" . +_:genid2 "Triple from data-02.rdf" . diff --git a/tests/json/CMakeLists.txt b/tests/json/CMakeLists.txt new file mode 100644 index 0000000..249ace7 --- /dev/null +++ b/tests/json/CMakeLists.txt @@ -0,0 +1,69 @@ +# raptor/tests/json/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +IF(RAPTOR_PARSER_JSON) + + RAPPER_TEST(json.example1 + "${RAPPER} -q -i json -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/example1.json http://example.librdf.org/example1.json" + example1.res + ${CMAKE_CURRENT_SOURCE_DIR}/example1.nt + ) + + RAPPER_TEST(json.example2 + "${RAPPER} -q -i json -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/example2.json http://example.librdf.org/example2.json" + example2.res + ${CMAKE_CURRENT_SOURCE_DIR}/example2.nt + ) + + RAPPER_TEST(json.example3 + "${RAPPER} -q -i json -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/example3.json http://example.librdf.org/example3.json" + example3.res + ${CMAKE_CURRENT_SOURCE_DIR}/example3.nt + ) + + RAPPER_TEST(json.example4 + "${RAPPER} -q -i json -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/example4.json http://example.librdf.org/example4.json" + example4.res + ${CMAKE_CURRENT_SOURCE_DIR}/example4.nt + ) + + ADD_TEST(json.bad-00 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-00.json http://example.librdf.org/bad-00.json) # WILL_FAIL + ADD_TEST(json.bad-01 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-01.json http://example.librdf.org/bad-01.json) # WILL_FAIL + ADD_TEST(json.bad-02 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-02.json http://example.librdf.org/bad-02.json) # WILL_FAIL + ADD_TEST(json.bad-03 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-03.json http://example.librdf.org/bad-03.json) # WILL_FAIL + ADD_TEST(json.bad-04 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-04.json http://example.librdf.org/bad-04.json) # WILL_FAIL + ADD_TEST(json.bad-05 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-05.json http://example.librdf.org/bad-05.json) # WILL_FAIL + ADD_TEST(json.bad-06 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-06.json http://example.librdf.org/bad-06.json) # WILL_FAIL + ADD_TEST(json.bad-07 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-07.json http://example.librdf.org/bad-07.json) # WILL_FAIL + ADD_TEST(json.bad-08 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-08.json http://example.librdf.org/bad-08.json) # WILL_FAIL + ADD_TEST(json.bad-09 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-09.json http://example.librdf.org/bad-09.json) # WILL_FAIL + ADD_TEST(json.bad-10 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-10.json http://example.librdf.org/bad-10.json) # WILL_FAIL + ADD_TEST(json.bad-11 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-11.json http://example.librdf.org/bad-11.json) # WILL_FAIL + ADD_TEST(json.bad-12 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-12.json http://example.librdf.org/bad-12.json) # WILL_FAIL + ADD_TEST(json.bad-13 ${RAPPER} -q -i json -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-13.json http://example.librdf.org/bad-13.json) # WILL_FAIL + + SET_TESTS_PROPERTIES( + json.bad-00 + json.bad-01 + json.bad-02 + json.bad-03 + json.bad-04 + json.bad-05 + json.bad-06 + json.bad-07 + json.bad-08 + json.bad-09 + json.bad-10 + json.bad-11 + json.bad-12 + json.bad-13 + PROPERTIES + WILL_FAIL TRUE + ) + +ENDIF(RAPTOR_PARSER_JSON) + +# end raptor/tests/json/CMakeLists.txt diff --git a/tests/json/Makefile.am b/tests/json/Makefile.am new file mode 100644 index 0000000..ec59cb8 --- /dev/null +++ b/tests/json/Makefile.am @@ -0,0 +1,130 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor JSON tests +# +# Copyright (C) 2010, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +TEST_FILES=\ +example1.json example2.json example3.json example4.json + +TEST_OUT_FILES=\ +example1.nt example2.nt example3.nt example4.nt + +JSON_BAD_TEST_FILES=bad-00.json bad-01.json bad-02.json bad-03.json \ +bad-04.json bad-05.json bad-06.json bad-07.json bad-08.json bad-09.json \ +bad-10.json bad-11.json bad-12.json bad-13.json + +# Used to make N-triples output consistent +BASE_URI=http://example.librdf.org/ + +EXTRA_DIST = \ + CMakeLists.txt \ + $(TEST_FILES) \ + $(TEST_OUT_FILES) \ + $(JSON_BAD_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper + +CLEANFILES = CMakeTests.txt CMakeTmp.txt + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +if RAPTOR_PARSER_JSON +check-local: build-rapper check-json check-bad-json +else +check-local: +endif + +if MAINTAINER_MODE +check_json_deps = $(TEST_FILES) +endif + +check-json: build-rapper $(check_json_deps) + @result=0; \ + $(RECHO) "Testing legal JSON"; \ + printf 'IF(RAPTOR_PARSER_JSON)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .json` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i json -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; result=1; \ + elif cmp $(srcdir)/$$name.nt $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + cat $$name.err; \ + diff $(srcdir)/$$name.nt $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + json.$$name \ + "\$${RAPPER} -q -i json -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.nt" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_JSON)\n\n' >>CMakeTests.txt; \ + exit $$result + +if MAINTAINER_MODE +check_bad_json_deps = $(JSON_BAD_TEST_FILES) +endif + +check-bad-json: build-rapper $(check_bad_json_deps) + @set +e; result=0; \ + $(RECHO) "Testing that bad JSON fails"; \ + printf 'IF(RAPTOR_PARSER_JSON)\n\n' >>CMakeTests.txt; \ + for test in $(JSON_BAD_TEST_FILES); do \ + name=`basename $$test .json` ; \ + baseuri=$(BASE_URI)$$name.json; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i json -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; \ + cat $$name.res; grep Warning $$name.err; result=1; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; \ + cat $$name.res; result=1; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf '\tADD_TEST(%s %s) # WILL_FAIL\n' \ + json.$$name \ + "\$${RAPPER} -q -i json -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" >>CMakeTests.txt; \ + printf '\t\t%s\n' json.$$name >>CMakeTmp.txt; \ + done; \ + (printf '\n\tSET_TESTS_PROPERTIES(\n'; \ + cat CMakeTmp.txt; \ + printf '\t\tPROPERTIES\n\t\tWILL_FAIL TRUE\n\t)\n\n'; \ + printf 'ENDIF(RAPTOR_PARSER_JSON)\n\n') >>CMakeTests.txt; \ + rm -f CMakeTmp.txt; \ + set -e; exit $$result + diff --git a/tests/json/Makefile.in b/tests/json/Makefile.in new file mode 100644 index 0000000..d5c04b7 --- /dev/null +++ b/tests/json/Makefile.in @@ -0,0 +1,613 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor JSON tests +# +# Copyright (C) 2010, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/json +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TEST_FILES = \ +example1.json example2.json example3.json example4.json + +TEST_OUT_FILES = \ +example1.nt example2.nt example3.nt example4.nt + +JSON_BAD_TEST_FILES = bad-00.json bad-01.json bad-02.json bad-03.json \ +bad-04.json bad-05.json bad-06.json bad-07.json bad-08.json bad-09.json \ +bad-10.json bad-11.json bad-12.json bad-13.json + + +# Used to make N-triples output consistent +BASE_URI = http://example.librdf.org/ +EXTRA_DIST = \ + CMakeLists.txt \ + $(TEST_FILES) \ + $(TEST_OUT_FILES) \ + $(JSON_BAD_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +CLEANFILES = CMakeTests.txt CMakeTmp.txt +@MAINTAINER_MODE_TRUE@check_json_deps = $(TEST_FILES) +@MAINTAINER_MODE_TRUE@check_bad_json_deps = $(JSON_BAD_TEST_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/json/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/json/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +@RAPTOR_PARSER_JSON_TRUE@check-local: build-rapper check-json check-bad-json +@RAPTOR_PARSER_JSON_FALSE@check-local: + +check-json: build-rapper $(check_json_deps) + @result=0; \ + $(RECHO) "Testing legal JSON"; \ + printf 'IF(RAPTOR_PARSER_JSON)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .json` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i json -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; result=1; \ + elif cmp $(srcdir)/$$name.nt $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + cat $$name.err; \ + diff $(srcdir)/$$name.nt $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err; \ + printf '\tRAPPER_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t%s\n\t)\n\n' \ + json.$$name \ + "\$${RAPPER} -q -i json -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.nt" >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_JSON)\n\n' >>CMakeTests.txt; \ + exit $$result + +check-bad-json: build-rapper $(check_bad_json_deps) + @set +e; result=0; \ + $(RECHO) "Testing that bad JSON fails"; \ + printf 'IF(RAPTOR_PARSER_JSON)\n\n' >>CMakeTests.txt; \ + for test in $(JSON_BAD_TEST_FILES); do \ + name=`basename $$test .json` ; \ + baseuri=$(BASE_URI)$$name.json; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i json -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; \ + cat $$name.res; grep Warning $$name.err; result=1; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; \ + cat $$name.res; result=1; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf '\tADD_TEST(%s %s) # WILL_FAIL\n' \ + json.$$name \ + "\$${RAPPER} -q -i json -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" >>CMakeTests.txt; \ + printf '\t\t%s\n' json.$$name >>CMakeTmp.txt; \ + done; \ + (printf '\n\tSET_TESTS_PROPERTIES(\n'; \ + cat CMakeTmp.txt; \ + printf '\t\tPROPERTIES\n\t\tWILL_FAIL TRUE\n\t)\n\n'; \ + printf 'ENDIF(RAPTOR_PARSER_JSON)\n\n') >>CMakeTests.txt; \ + rm -f CMakeTmp.txt; \ + set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/json/bad-00.json b/tests/json/bad-00.json new file mode 100644 index 0000000..ba9fba4 --- /dev/null +++ b/tests/json/bad-00.json @@ -0,0 +1,3 @@ +/* bad-00.json - Nearly empty document */ + +{ diff --git a/tests/json/bad-01.json b/tests/json/bad-01.json new file mode 100644 index 0000000..83d2614 --- /dev/null +++ b/tests/json/bad-01.json @@ -0,0 +1,10 @@ +/* bad-01.json - Missing trailing curly-brace */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : "Anna Wilder" } + } + ] diff --git a/tests/json/bad-02.json b/tests/json/bad-02.json new file mode 100644 index 0000000..8188c24 --- /dev/null +++ b/tests/json/bad-02.json @@ -0,0 +1,11 @@ +// bad-02.json - Missing the value for a literal + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal" } + } + ] +} \ No newline at end of file diff --git a/tests/json/bad-03.json b/tests/json/bad-03.json new file mode 100644 index 0000000..913d9e8 --- /dev/null +++ b/tests/json/bad-03.json @@ -0,0 +1,10 @@ +/* bad-03.json - No object defined for triple */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" } + } + ] +} diff --git a/tests/json/bad-04.json b/tests/json/bad-04.json new file mode 100644 index 0000000..6746c18 --- /dev/null +++ b/tests/json/bad-04.json @@ -0,0 +1,7 @@ +/* bad-04.json - Resource-centric JSON missing an object */ + +{ + "http://example.org/about" : { + "http://purl.org/dc/elements/1.1/creator" : [ {} ] + } +} diff --git a/tests/json/bad-05.json b/tests/json/bad-05.json new file mode 100644 index 0000000..0343e08 --- /dev/null +++ b/tests/json/bad-05.json @@ -0,0 +1,11 @@ +/* bad-05.json - Invalid attribute */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : "Anna Wilder", "foo" : "bar" } + } + ] +} \ No newline at end of file diff --git a/tests/json/bad-06.json b/tests/json/bad-06.json new file mode 100644 index 0000000..b2c3ca2 --- /dev/null +++ b/tests/json/bad-06.json @@ -0,0 +1,12 @@ +/* bad-06.json - Invalid term name */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : "Anna Wilder" }, + "foo" : { "type" : "literal", "value" : "Anna Wilder" } + } + ] +} diff --git a/tests/json/bad-07.json b/tests/json/bad-07.json new file mode 100644 index 0000000..408fdc4 --- /dev/null +++ b/tests/json/bad-07.json @@ -0,0 +1,11 @@ +/* bad-07.json - Document with a null value */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : null } + } + ] +} diff --git a/tests/json/bad-08.json b/tests/json/bad-08.json new file mode 100644 index 0000000..02dcf7c --- /dev/null +++ b/tests/json/bad-08.json @@ -0,0 +1,11 @@ +/* bad-08.json - Document with a boolean value */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : true } + } + ] +} diff --git a/tests/json/bad-09.json b/tests/json/bad-09.json new file mode 100644 index 0000000..d442522 --- /dev/null +++ b/tests/json/bad-09.json @@ -0,0 +1,11 @@ +/* bad-07.json - Document with a integer value */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : 44 } + } + ] +} diff --git a/tests/json/bad-10.json b/tests/json/bad-10.json new file mode 100644 index 0000000..9eb69f4 --- /dev/null +++ b/tests/json/bad-10.json @@ -0,0 +1,11 @@ +/* bad-11.json - Document with a float value */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : 4.4 } + } + ] +} diff --git a/tests/json/bad-11.json b/tests/json/bad-11.json new file mode 100644 index 0000000..12a9f36 --- /dev/null +++ b/tests/json/bad-11.json @@ -0,0 +1,11 @@ +/* bad-11.json - Syntax error in the JSON - extra square-brace */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" ]}, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : "Anna Wilder" } + } + ] +} diff --git a/tests/json/bad-12.json b/tests/json/bad-12.json new file mode 100644 index 0000000..d44ed04 --- /dev/null +++ b/tests/json/bad-12.json @@ -0,0 +1,7 @@ +/* bad-12.json - Not RDF/JSON */ + +{ + "key1" : "value1", + "key2" : "value2", + "key3" : "value3" +} diff --git a/tests/json/bad-13.json b/tests/json/bad-13.json new file mode 100644 index 0000000..0763679 --- /dev/null +++ b/tests/json/bad-13.json @@ -0,0 +1,11 @@ +/* bad-06.json - Missing term type */ + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "value" : "Anna Wilder" }, + } + ] +} diff --git a/tests/json/example1.json b/tests/json/example1.json new file mode 100644 index 0000000..23d7b42 --- /dev/null +++ b/tests/json/example1.json @@ -0,0 +1,22 @@ +{ + "http://example.org/about" : { + "http://purl.org/dc/elements/1.1/creator" : [ { "value" : "Anna Wilder", "type" : "literal" } ], + "http://purl.org/dc/elements/1.1/title" : [ { "value" : "Anna's Homepage", "type" : "literal", "lang" : "en" } ] , + "http://xmlns.com/foaf/0.1/maker" : [ { "value" : "_:person", "type" : "bnode" } ] + } , + + "_:person" : { + "http://xmlns.com/foaf/0.1/homepage" : [ { "value" : "http://example.org/about", "type" : "uri" } ] , + "http://xmlns.com/foaf/0.1/made" : [ { "value" : "http://example.org/about", "type" : "uri" } ] , + "http://xmlns.com/foaf/0.1/name" : [ { "value" : "Anna Wilder", "type" : "literal" } ] , + "http://xmlns.com/foaf/0.1/firstName" : [ { "value" : "Anna", "type" : "literal" } ] , + "http://xmlns.com/foaf/0.1/surname" : [ { "value" : "Wilder", "type" : "literal" } ] , + "http://xmlns.com/foaf/0.1/depiction" : [ { "value" : "http://example.org/pic.jpg", "type" : "uri" } ] , + "http://xmlns.com/foaf/0.1/nick" : [ + { "type" : "literal", "value" : "wildling"} , + { "type" : "literal", "value" : "wilda" } + ] , + "http://xmlns.com/foaf/0.1/age" : [ { "value" : "48", "type" : "literal", "datatype" : "http://www.w3.org/2001/XMLSchema#integer" } ] , + "http://xmlns.com/foaf/0.1/mbox_sha1sum" : [ { "value" : "69e31bbcf58d432950127593e292a55975bc66fd", "type" : "literal" } ] + } +} diff --git a/tests/json/example1.nt b/tests/json/example1.nt new file mode 100644 index 0000000..ba74572 --- /dev/null +++ b/tests/json/example1.nt @@ -0,0 +1,13 @@ + "Anna Wilder" . + "Anna's Homepage"@en . + _:person . +_:person . +_:person . +_:person "Anna Wilder" . +_:person "Anna" . +_:person "Wilder" . +_:person . +_:person "wildling" . +_:person "wilda" . +_:person "48"^^ . +_:person "69e31bbcf58d432950127593e292a55975bc66fd" . diff --git a/tests/json/example2.json b/tests/json/example2.json new file mode 100644 index 0000000..adf3a6f --- /dev/null +++ b/tests/json/example2.json @@ -0,0 +1,57 @@ +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + "object" : { "type" : "literal", "value" : "Anna Wilder" } + },{ + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/title" }, + "object" : { "type" : "literal", "value" : "Anna's Homepage", "lang" : "en" } + },{ + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/maker" }, + "object" : { "type" : "bnode", "value" : "_:person" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/homepage" }, + "object" : { "type" : "uri", "value" : "http://example.org/about" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/made" }, + "object" : { "type" : "uri", "value" : "http://example.org/about" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/name" }, + "object" : { "type" : "literal", "value" : "Anna Wilder" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/firstName" }, + "object" : { "type" : "literal", "value" : "Anna" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/surname" }, + "object" : { "type" : "literal", "value" : "Wilder" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/depiction" }, + "object" : { "type" : "uri", "value" : "http://example.org/pic.jpg" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/nick" }, + "object" : { "type" : "literal", "value" : "wildling" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/nick" }, + "object" : { "type" : "literal", "value" : "wilda" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/age" }, + "object" : { "type" : "literal", "value" : "48", "datatype" : "http://www.w3.org/2001/XMLSchema#integer" } + },{ + "subject" : { "type" : "bnode", "value" : "_:person" }, + "predicate" : { "type" : "uri", "value" : "http://xmlns.com/foaf/0.1/mbox_sha1sum" }, + "object" : { "type" : "literal", "value" : "69e31bbcf58d432950127593e292a55975bc66fd" } + } + ] +} diff --git a/tests/json/example2.nt b/tests/json/example2.nt new file mode 100644 index 0000000..ba74572 --- /dev/null +++ b/tests/json/example2.nt @@ -0,0 +1,13 @@ + "Anna Wilder" . + "Anna's Homepage"@en . + _:person . +_:person . +_:person . +_:person "Anna Wilder" . +_:person "Anna" . +_:person "Wilder" . +_:person . +_:person "wildling" . +_:person "wilda" . +_:person "48"^^ . +_:person "69e31bbcf58d432950127593e292a55975bc66fd" . diff --git a/tests/json/example3.json b/tests/json/example3.json new file mode 100644 index 0000000..ba8e095 --- /dev/null +++ b/tests/json/example3.json @@ -0,0 +1,14 @@ +/* example3.json - a comment at the start of the file */ + +// C++ style comment + +{ + "triples" : [ + { + "subject" : { "type" : "uri", "value" : "http://example.org/about" }, + "predicate" : { "type" : "uri", "value" : "http://purl.org/dc/elements/1.1/creator" }, + // Comment in the middle + "object" : { "type" : "literal", "value" : "Anna Wilder" } + } + ] +} diff --git a/tests/json/example3.nt b/tests/json/example3.nt new file mode 100644 index 0000000..4606943 --- /dev/null +++ b/tests/json/example3.nt @@ -0,0 +1 @@ + "Anna Wilder" . diff --git a/tests/json/example4.json b/tests/json/example4.json new file mode 100644 index 0000000..5603272 --- /dev/null +++ b/tests/json/example4.json @@ -0,0 +1,39 @@ +{ + "http://example.com/joe/foaf.rdf" : { + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "value" : "http://xmlns.com/foaf/0.1/PersonalProfileDocument", + "type" : "uri" + } + + ], + "http://xmlns.com/foaf/0.1/primaryTopic" : [ { + "value" : "http://www.example.com/joe#me", + "type" : "uri" + } + + ] + } + , + "http://www.example.com/joe#me" : { + "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" : [ { + "value" : "http://xmlns.com/foaf/0.1/Person", + "type" : "uri" + } + + ], + "http://xmlns.com/foaf/0.1/name" : [ { + "value" : "Joe Bloggs", + "lang" : "en", + "type" : "literal" + } + + ], + "http://xmlns.com/foaf/0.1/age" : [ { + "value" : "59", + "datatype" : "http://www.w3.org/2001/XMLSchema#integer", + "type" : "literal" + } + + ] + } +} diff --git a/tests/json/example4.nt b/tests/json/example4.nt new file mode 100644 index 0000000..ab1bee9 --- /dev/null +++ b/tests/json/example4.nt @@ -0,0 +1,5 @@ + . + . + . + "Joe Bloggs"@en . + "59"^^ . diff --git a/tests/mkr/Makefile.am b/tests/mkr/Makefile.am new file mode 100644 index 0000000..4d5aea2 --- /dev/null +++ b/tests/mkr/Makefile.am @@ -0,0 +1,111 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor MKR tests +# +# Copyright (C) 2014, Richard H. McCullough +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +RDFXML_DIR = ../rdfxml +NTRIPLES_DIR = ../ntriples + + +TEST_SERIALIZE_FILES= \ +rdf-schema.ttl \ +rdfs-namespace.ttl \ +rdfq-results.ttl \ +test-07.ttl test-08.ttl test-16a.ttl \ +test-28.ttl test-31.ttl test-32.ttl test-34.ttl + +TEST_SERIALIZE_OUT_FILES= \ +rdf-schema.mkr \ +rdfs-namespace.mkr \ +rdfq-results.mkr \ +test-07.mkr test-08.mkr test-16a.mkr \ +test-28.mkr test-31.mkr test-32.mkr test-34.mkr + +# Used to make N-triples output consistent +BASE_URI=http://www.w3.org/2001/sw/DataAccess/df1/tests/ +# for rdf-schema.ttl +RDF_NS_URI=http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI=http://www.w3.org/2000/01/rdf-schema + +ALL_TEST_FILES= README.txt \ + $(TEST_SERIALIZE_FILES) \ + $(TEST_SERIALIZE_OUT_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + + +check-local: \ +check-mkr-serialize-syntax + + +if MAINTAINER_MODE +check_mkr_serialize_deps = $(TEST_FILES) +endif + + +if MAINTAINER_MODE +check_mkr_serialize_syntax_deps = $(TEST_SERIALIZE_FILES) +endif + +check-mkr-serialize-syntax: build-rapper $(check_mkr_serialize_syntax_deps) + @set +e; result=0; \ + $(RECHO) "Testing mkr exact serialization output"; \ + for test in $(TEST_SERIALIZE_FILES); do \ + name=`basename $$test .ttl` ; \ + if test $$name = rdf-schema; then \ + baseuri=$(RDF_NS_URI); \ + elif test $$name = rdfs-namespace; then \ + baseuri=$(RDFS_NS_URI); \ + else \ + baseuri=$(BASE_URI)$$test; \ + fi; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o mkr $(srcdir)/$$test $$baseuri > $$name.out 2> $$name.err; \ + cmp -s $$name.out $(srcdir)/$$name.mkr; \ + status=$$?; \ + if test $$status = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o mkr $(srcdir)/$$test $$baseuri '>' $$name.out; \ + cat $$name.err; \ + diff -a -u $$name.out $(srcdir)/$$name.mkr; \ + fi; \ + rm -f $$name.out $$name.err; \ + done; \ + set -e; exit $$result + + + +if MAINTAINER_MODE +zip: tests.zip + +tests.zip: $(ALL_TEST_FILES) + rm -f $@ + zip $@ $(ALL_TEST_FILES) + +endif diff --git a/tests/mkr/Makefile.in b/tests/mkr/Makefile.in new file mode 100644 index 0000000..eef040d --- /dev/null +++ b/tests/mkr/Makefile.in @@ -0,0 +1,587 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor MKR tests +# +# Copyright (C) 2014, Richard H. McCullough +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/mkr +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +RDFXML_DIR = ../rdfxml +NTRIPLES_DIR = ../ntriples +TEST_SERIALIZE_FILES = \ +rdf-schema.ttl \ +rdfs-namespace.ttl \ +rdfq-results.ttl \ +test-07.ttl test-08.ttl test-16a.ttl \ +test-28.ttl test-31.ttl test-32.ttl test-34.ttl + +TEST_SERIALIZE_OUT_FILES = \ +rdf-schema.mkr \ +rdfs-namespace.mkr \ +rdfq-results.mkr \ +test-07.mkr test-08.mkr test-16a.mkr \ +test-28.mkr test-31.mkr test-32.mkr test-34.mkr + + +# Used to make N-triples output consistent +BASE_URI = http://www.w3.org/2001/sw/DataAccess/df1/tests/ +# for rdf-schema.ttl +RDF_NS_URI = http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI = http://www.w3.org/2000/01/rdf-schema +ALL_TEST_FILES = README.txt \ + $(TEST_SERIALIZE_FILES) \ + $(TEST_SERIALIZE_OUT_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff +@MAINTAINER_MODE_TRUE@check_mkr_serialize_deps = $(TEST_FILES) +@MAINTAINER_MODE_TRUE@check_mkr_serialize_syntax_deps = $(TEST_SERIALIZE_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/mkr/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/mkr/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +check-local: \ +check-mkr-serialize-syntax + +check-mkr-serialize-syntax: build-rapper $(check_mkr_serialize_syntax_deps) + @set +e; result=0; \ + $(RECHO) "Testing mkr exact serialization output"; \ + for test in $(TEST_SERIALIZE_FILES); do \ + name=`basename $$test .ttl` ; \ + if test $$name = rdf-schema; then \ + baseuri=$(RDF_NS_URI); \ + elif test $$name = rdfs-namespace; then \ + baseuri=$(RDFS_NS_URI); \ + else \ + baseuri=$(BASE_URI)$$test; \ + fi; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o mkr $(srcdir)/$$test $$baseuri > $$name.out 2> $$name.err; \ + cmp -s $$name.out $(srcdir)/$$name.mkr; \ + status=$$?; \ + if test $$status = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o mkr $(srcdir)/$$test $$baseuri '>' $$name.out; \ + cat $$name.err; \ + diff -a -u $$name.out $(srcdir)/$$name.mkr; \ + fi; \ + rm -f $$name.out $$name.err; \ + done; \ + set -e; exit $$result + +@MAINTAINER_MODE_TRUE@zip: tests.zip + +@MAINTAINER_MODE_TRUE@tests.zip: $(ALL_TEST_FILES) +@MAINTAINER_MODE_TRUE@ rm -f $@ +@MAINTAINER_MODE_TRUE@ zip $@ $(ALL_TEST_FILES) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/mkr/README.txt b/tests/mkr/README.txt new file mode 100644 index 0000000..4607bb9 --- /dev/null +++ b/tests/mkr/README.txt @@ -0,0 +1,12 @@ +These are the tests for the mKR (my Knowledge Representation) Language +that must be passed by conformant systems. See + http://mkrmke.org/parser/ +for the full conformance information. + +The format is a set of exact serialization format tests. + +Tests are a pair of files: + xxx.ttl xxx.mkr +which are the input Turtle file and the expected output mKR file. + +Dick diff --git a/tests/mkr/rdf-schema.mkr b/tests/mkr/rdf-schema.mkr new file mode 100644 index 0000000..901b704 --- /dev/null +++ b/tests/mkr/rdf-schema.mkr @@ -0,0 +1,155 @@ +@base ; +@prefix rdf: <#> ; +@prefix : <../../2000/01/rdf-schema#> ; + +rdf:Alt has + rdf:type = [:Class], + :label = ["Alt"@en, "Choix"@fr], + :subClassOf = [:Container] ; + +rdf:Bag has + rdf:type = [:Class], + :label = ["Bag"@en, "Ensemble"@fr], + :subClassOf = [:Container] ; + +rdf:Property has + rdf:type = [:Class], + :comment = ["The concept of a property."], + :label = ["Property"@en, "Propriété"@fr], + :subClassOf = [:Resource] ; + +rdf:Seq has + rdf:type = [:Class], + :label = ["Sequence"@en, "Séquence"@fr], + :subClassOf = [:Container] ; + +rdf:Statement has + rdf:type = [:Class], + :comment = ["This represents the set of reified statements."], + :label = ["Déclaration"@fr, "Statement"@en], + :subClassOf = [:Resource] ; + +rdf:object has + rdf:type = [rdf:Property], + :domain = [rdf:Statement], + :label = ["object"@en, "objet"@fr] ; + +rdf:predicate has + rdf:type = [rdf:Property], + :domain = [rdf:Statement], + :label = ["predicate"@en, "prédicat"@fr], + :range = [rdf:Property] ; + +rdf:subject has + rdf:type = [rdf:Property], + :domain = [rdf:Statement], + :label = ["subject"@en, "sujet"@fr], + :range = [:Resource] ; + +rdf:type has + rdf:type = [rdf:Property], + :comment = ["Indicates membership of a class"], + :label = ["type"@en, "type"@fr], + :range = [:Class] ; + +rdf:value has + rdf:type = [rdf:Property], + :label = ["object"@en, "value"@fr] ; + +<../../2000/01/rdf-schema#> has + :seeAlso = [<../../2000/01/rdf-schema-more>] ; + +:Class has + rdf:type = [:Class], + :comment = ["The concept of Class"], + :label = ["Class"@en, "Classe"@fr], + :subClassOf = [:Resource] ; + +:ConstraintProperty has + rdf:type = [:Class], + :comment = ["Properties used to express RDF Schema constraints."], + :label = ["ConstraintProperty"@en, "PropriétéContrainte"@fr], + :subClassOf = [rdf:Property, :ConstraintResource] ; + +:ConstraintResource has + rdf:type = [:Class], + :comment = ["Resources used to express RDF Schema constraints."], + :label = ["ConstraintResource"@en, "RessourceContrainte"@fr], + :subClassOf = [:Resource] ; + +:Container has + rdf:type = [:Class], + :comment = ["This represents the set Containers."], + :label = ["Container"@en, "Enveloppe"@fr], + :subClassOf = [:Resource] ; + +:ContainerMembershipProperty has + rdf:type = [:Class], + :label = ["ContainerMembershipProperty"@en], + :subClassOf = [rdf:Property] ; + +:Literal has + rdf:type = [:Class], + :comment = ["This represents the set of atomic values, eg. textual strings."], + :label = ["Literal"@en, "Littéral"@fr] ; + +:Resource has + rdf:type = [:Class], + :comment = ["The most general class"], + :label = ["Resource"@en, "Ressource"@fr] ; + +:comment has + rdf:type = [rdf:Property], + :comment = ["Use this for descriptions"], + :domain = [:Resource], + :label = ["comment"@en, "commentaire"@fr], + :range = [:Literal] ; + +:domain has + rdf:type = [:ConstraintProperty], + :comment = ["This is how we associate a class with properties that its instances can have"], + :label = ["domain"@en, "domaine"@fr] ; + +:isDefinedBy has + rdf:type = [rdf:Property], + :comment = ["Indicates a resource containing and defining the subject resource."], + :domain = [:Resource], + :label = ["esDéfiniPar"@fr, "isDefinedBy"@en], + :range = [:Resource], + :subPropertyOf = [:seeAlso] ; + +:label has + rdf:type = [rdf:Property], + :comment = ["Provides a human-readable version of a resource name."], + :domain = [:Resource], + :label = ["label"@en, "label"@fr], + :range = [:Literal] ; + +:range has + rdf:type = [:ConstraintProperty], + :comment = ["Properties that can be used in a schema to provide constraints"], + :domain = [rdf:Property], + :label = ["range"@en, "étendue"@fr], + :range = [:Class] ; + +:seeAlso has + rdf:type = [rdf:Property], + :comment = ["Indicates a resource that provides information about the subject resource."], + :domain = [:Resource], + :label = ["seeAlso"@en, "voirAussi"@fr], + :range = [:Resource] ; + +:subClassOf has + rdf:type = [rdf:Property], + :comment = ["Indicates membership of a class"], + :domain = [:Class], + :label = ["sousClasseDe"@fr, "subClassOf"@en], + :range = [:Class] ; + +:subPropertyOf has + rdf:type = [rdf:Property], + :comment = ["Indicates specialization of properties"], + :domain = [rdf:Property], + :label = ["sousPropriétéDe"@fr, "subPropertyOf"@en], + :range = [rdf:Property] ; + diff --git a/tests/mkr/rdf-schema.ttl b/tests/mkr/rdf-schema.ttl new file mode 100644 index 0000000..0f1fd89 --- /dev/null +++ b/tests/mkr/rdf-schema.ttl @@ -0,0 +1,154 @@ +# RDF Namespace document converted into Turtle + +@prefix : . +@prefix rdf: . + +rdf:type a rdf:Property; + :comment "Indicates membership of a class"; + :label "type"@en, + "type"@fr; + :range :Class . + +:Class a :Class; + :comment "The concept of Class"; + :label "Class"@en, + "Classe"@fr; + :subClassOf :Resource . + +:ConstraintProperty a :Class; + :comment "Properties used to express RDF Schema constraints."; + :label "ConstraintProperty"@en, + "Propri\u00E9t\u00E9Contrainte"@fr; + :subClassOf :ConstraintResource, + rdf:Property . + +:ConstraintResource a :Class; + :comment "Resources used to express RDF Schema constraints."; + :label "ConstraintResource"@en, + "RessourceContrainte"@fr; + :subClassOf :Resource . + +:Container a :Class; + :comment "This represents the set Containers."; + :label "Container"@en, + "Enveloppe"@fr; + :subClassOf :Resource . + +:ContainerMembershipProperty a :Class; + :label "ContainerMembershipProperty"@en; + :subClassOf rdf:Property . + +:Literal a :Class; + :comment "This represents the set of atomic values, eg. textual strings."; + :label "Literal"@en, + "Litt\u00E9ral"@fr . + +:Resource a :Class; + :comment "The most general class"; + :label "Resource"@en, + "Ressource"@fr . + +:comment a rdf:Property; + :comment "Use this for descriptions"; + :domain :Resource; + :label "comment"@en, + "commentaire"@fr; + :range :Literal . + +:domain a :ConstraintProperty; + :comment "This is how we associate a class with properties that its instances can have"; + :label "domain"@en, + "domaine"@fr . + +:isDefinedBy a rdf:Property; + :comment "Indicates a resource containing and defining the subject resource."; + :domain :Resource; + :label "esD\u00E9finiPar"@fr, + "isDefinedBy"@en; + :range :Resource; + :subPropertyOf :seeAlso . + +:label a rdf:Property; + :comment "Provides a human-readable version of a resource name."; + :domain :Resource; + :label "label"@en, + "label"@fr; + :range :Literal . + +:range a :ConstraintProperty; + :comment "Properties that can be used in a schema to provide constraints"; + :domain rdf:Property; + :label "range"@en, + "\u00E9tendue"@fr; + :range :Class . + +:seeAlso a rdf:Property; + :comment "Indicates a resource that provides information about the subject resource."; + :domain :Resource; + :label "seeAlso"@en, + "voirAussi"@fr; + :range :Resource . + +:subClassOf a rdf:Property; + :comment "Indicates membership of a class"; + :domain :Class; + :label "sousClasseDe"@fr, + "subClassOf"@en; + :range :Class . + +:subPropertyOf a rdf:Property; + :comment "Indicates specialization of properties"; + :domain rdf:Property; + :label "sousPropri\u00E9t\u00E9De"@fr, + "subPropertyOf"@en; + :range rdf:Property . + +rdf:Alt a :Class; + :label "Alt"@en, + "Choix"@fr; + :subClassOf :Container . + +rdf:Bag a :Class; + :label "Bag"@en, + "Ensemble"@fr; + :subClassOf :Container . + +rdf:Property a :Class; + :comment "The concept of a property."; + :label "Property"@en, + "Propri\u00E9t\u00E9"@fr; + :subClassOf :Resource . + +rdf:Seq a :Class; + :label "Sequence"@en, + "S\u00E9quence"@fr; + :subClassOf :Container . + +rdf:Statement a :Class; + :comment "This represents the set of reified statements."; + :label "D\u00E9claration"@fr, + "Statement"@en; + :subClassOf :Resource . + +rdf:object a rdf:Property; + :domain rdf:Statement; + :label "object"@en, + "objet"@fr . + +rdf:predicate a rdf:Property; + :domain rdf:Statement; + :label "predicate"@en, + "pr\u00E9dicat"@fr; + :range rdf:Property . + +rdf:subject a rdf:Property; + :domain rdf:Statement; + :label "subject"@en, + "sujet"@fr; + :range :Resource . + +rdf:value a rdf:Property; + :label "object"@en, + "value"@fr . + +: :seeAlso . diff --git a/tests/mkr/rdfq-results.mkr b/tests/mkr/rdfq-results.mkr new file mode 100644 index 0000000..9cbd603 --- /dev/null +++ b/tests/mkr/rdfq-results.mkr @@ -0,0 +1,13 @@ +@base ; +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> ; +@prefix rs: ; + +result is <> ; +result is relation with format = csv ; +begin relation result ; +x, y ; +anon2, _:a ; +123, ; +2003-01-21, ; +anon1, _:a ; +end relation result ; diff --git a/tests/mkr/rdfq-results.ttl b/tests/mkr/rdfq-results.ttl new file mode 100644 index 0000000..c6e72aa --- /dev/null +++ b/tests/mkr/rdfq-results.ttl @@ -0,0 +1,39 @@ +# from http://www.w3.org/2003/03/rdfqr-tests/recording-query-results.html + +@prefix rdf: . +@prefix rs: . + + +<> rdf:type rs:ResultSet ; + rs:size 4 ; + rs:resultVariable "x" ; rs:resultVariable "y" ; + rs:solution + [ rdf:type rs:ResultSolution ; + rs:binding [ rs:variable "x" ; rs:value 123 ] ; + rs:binding [ rs:variable "y" ; rs:value ] + ] ; + + rs:solution + [ rdf:type rs:ResultSolution ; + rs:binding [ rs:variable "x" ; + rs:value "2003-01-21" ] ; + rs:binding [ rs:variable "y" ; + rs:value ] + ] ; + + rs:solution + [ rdf:type rs:ResultSolution ; + rs:binding [ rs:variable "x" ; + rs:value "anon1" ] ; + rs:binding [ rs:variable "y" ; + rs:value _:a ] + ] ; + + rs:solution + [ rdf:type rs:ResultSolution ; + rs:binding [ rs:variable "x" ; + rs:value "anon2" ] ; + rs:binding [ rs:variable "y" ; + rs:value _:a ] + ] ; + . diff --git a/tests/mkr/rdfs-namespace.mkr b/tests/mkr/rdfs-namespace.mkr new file mode 100644 index 0000000..001b552 --- /dev/null +++ b/tests/mkr/rdfs-namespace.mkr @@ -0,0 +1,185 @@ +@base ; +@prefix rdf: <../../1999/02/22-rdf-syntax-ns#> ; +@prefix : <#> ; + +rdf:Alt has + rdf:type = [:Class], + :comment = ["A collection of alternatives."@en], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["Alt"@en], + :subClassOf = [:Container] ; + +rdf:Bag has + rdf:type = [:Class], + :comment = ["An unordered collection."@en], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["Bag"@en], + :subClassOf = [:Container] ; + +rdf:Property has + rdf:type = [:Class], + :comment = ["The concept of a property."], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["Property"@en], + :subClassOf = [:Resource] ; + +rdf:Seq has + rdf:type = [:Class], + :comment = ["An ordered collection."@en], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["Seq"@en], + :subClassOf = [:Container] ; + +rdf:Statement has + rdf:type = [:Class], + :comment = ["The class of RDF statements."], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["Statement"@en], + :subClassOf = [:Resource] ; + +rdf:object has + rdf:type = [rdf:Property], + :comment = ["The object of an RDF statement."], + :domain = [rdf:Statement], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["object"@en] ; + +rdf:predicate has + rdf:type = [rdf:Property], + :comment = ["the predicate of an RDF statement."], + :domain = [rdf:Statement], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["predicate"@en], + :range = [rdf:Property] ; + +rdf:subject has + rdf:type = [rdf:Property], + :comment = ["The subject of an RDF statement."], + :domain = [rdf:Statement], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["subject"@en], + :range = [:Resource] ; + +rdf:type has + rdf:type = [rdf:Property], + :comment = ["Indicates membership of a class"], + :domain = [:Resource], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["type"@en], + :range = [:Class] ; + +rdf:value has + rdf:type = [rdf:Property], + :comment = ["Identifies the principal value (usually a string) of a property when the property value is a structured resource"], + :domain = [:Resource], + :isDefinedBy = [<../../1999/02/22-rdf-syntax-ns#>], + :label = ["value"@en] ; + +<#> has + :seeAlso = [] ; + +:Class has + rdf:type = [:Class], + :comment = ["The concept of Class"], + :isDefinedBy = [<#>], + :label = ["Class"@en], + :subClassOf = [:Resource] ; + +:Container has + rdf:type = [:Class], + :comment = ["This represents the set Containers."], + :isDefinedBy = [<#>], + :label = ["Container"@en], + :subClassOf = [:Resource] ; + +:ContainerMembershipProperty has + rdf:type = [:Class], + :comment = ["The container membership properties, rdf:1, rdf:2, ..., all of which are sub-properties of 'member'."], + :isDefinedBy = [<#>], + :label = ["ContainerMembershipProperty"@en], + :subClassOf = [rdf:Property] ; + +:Literal has + rdf:type = [:Class], + :comment = ["This represents the set of atomic values, eg. textual strings."], + :isDefinedBy = [<#>], + :label = ["Literal"@en] ; + +:Resource has + rdf:type = [:Class], + :comment = ["The class resource, everything."], + :isDefinedBy = [<#>], + :label = ["Resource"@en] ; + +:comment has + rdf:type = [rdf:Property], + :comment = ["Use this for descriptions"], + :domain = [:Resource], + :isDefinedBy = [<#>], + :label = ["comment"@en], + :range = [:Literal] ; + +:domain has + rdf:type = [rdf:Property], + :comment = ["A domain class for a property type"], + :domain = [rdf:Property], + :isDefinedBy = [<#>], + :label = ["domain"@en], + :range = [:Class] ; + +:isDefinedBy has + rdf:type = [rdf:Property], + :comment = ["Indicates the namespace of a resource"], + :domain = [:Resource], + :isDefinedBy = [<#>], + :label = ["isDefinedBy"@en], + :range = [:Resource], + :subPropertyOf = [:seeAlso] ; + +:label has + rdf:type = [rdf:Property], + :comment = ["Provides a human-readable version of a resource name."], + :domain = [:Resource], + :isDefinedBy = [<#>], + :label = ["label"@en], + :range = [:Literal] ; + +:member has + rdf:type = [rdf:Property], + :comment = ["a member of a container"], + :domain = [:Container], + :isDefinedBy = [<#>], + :label = ["member"@en] ; + +:range has + rdf:type = [rdf:Property], + :comment = ["A range class for a property type"], + :domain = [rdf:Property], + :isDefinedBy = [<#>], + :label = ["range"@en], + :range = [:Class] ; + +:seeAlso has + rdf:type = [rdf:Property], + :comment = ["A resource that provides information about the subject resource"], + :domain = [:Resource], + :isDefinedBy = [<#>], + :label = ["seeAlso"@en], + :range = [:Resource] ; + +:subClassOf has + rdf:type = [rdf:Property], + :comment = ["Indicates membership of a class"], + :domain = [:Class], + :isDefinedBy = [<#>], + :label = ["subClassOf"@en], + :range = [:Class] ; + +:subPropertyOf has + rdf:type = [rdf:Property], + :comment = ["Indicates specialization of properties"], + :domain = [rdf:Property], + :isDefinedBy = [<#>], + :label = ["subPropertyOf"@en], + :range = [rdf:Property] ; + diff --git a/tests/mkr/rdfs-namespace.ttl b/tests/mkr/rdfs-namespace.ttl new file mode 100644 index 0000000..0d73e6b --- /dev/null +++ b/tests/mkr/rdfs-namespace.ttl @@ -0,0 +1,160 @@ +# RDFS Namespace document converted into Turtle + +@prefix : . +@prefix rdf: . + +rdf:type a rdf:Property; + :comment "Indicates membership of a class"; + :domain :Resource; + :isDefinedBy rdf:; + :label "type"@en; + :range :Class . + +rdf:Alt a :Class; + :comment "A collection of alternatives."@en; + :isDefinedBy rdf:; + :label "Alt"@en; + :subClassOf :Container . + +rdf:Bag a :Class; + :comment "An unordered collection."@en; + :isDefinedBy rdf:; + :label "Bag"@en; + :subClassOf :Container . + +rdf:Property a :Class; + :comment "The concept of a property."; + :isDefinedBy rdf:; + :label "Property"@en; + :subClassOf :Resource . + +rdf:Seq a :Class; + :comment "An ordered collection."@en; + :isDefinedBy rdf:; + :label "Seq"@en; + :subClassOf :Container . + +rdf:Statement a :Class; + :comment "The class of RDF statements."; + :isDefinedBy rdf:; + :label "Statement"@en; + :subClassOf :Resource . + +rdf:object a rdf:Property; + :comment "The object of an RDF statement."; + :domain rdf:Statement; + :isDefinedBy rdf:; + :label "object"@en . + +rdf:predicate a rdf:Property; + :comment "the predicate of an RDF statement."; + :domain rdf:Statement; + :isDefinedBy rdf:; + :label "predicate"@en; + :range rdf:Property . + +rdf:subject a rdf:Property; + :comment "The subject of an RDF statement."; + :domain rdf:Statement; + :isDefinedBy rdf:; + :label "subject"@en; + :range :Resource . + +rdf:value a rdf:Property; + :comment "Identifies the principal value (usually a string) of a property when the property value is a structured resource"; + :domain :Resource; + :isDefinedBy rdf:; + :label "value"@en . + +: :seeAlso . + +:Class a :Class; + :comment "The concept of Class"; + :isDefinedBy :; + :label "Class"@en; + :subClassOf :Resource . + +:Container a :Class; + :comment "This represents the set Containers."; + :isDefinedBy :; + :label "Container"@en; + :subClassOf :Resource . + +:ContainerMembershipProperty a :Class; + :comment "The container membership properties, rdf:1, rdf:2, ..., all of which are sub-properties of 'member'."; + :isDefinedBy :; + :label "ContainerMembershipProperty"@en; + :subClassOf rdf:Property . + +:Literal a :Class; + :comment "This represents the set of atomic values, eg. textual strings."; + :isDefinedBy :; + :label "Literal"@en . + +:Resource a :Class; + :comment "The class resource, everything."; + :isDefinedBy :; + :label "Resource"@en . + +:comment a rdf:Property; + :comment "Use this for descriptions"; + :domain :Resource; + :isDefinedBy :; + :label "comment"@en; + :range :Literal . + +:domain a rdf:Property; + :comment "A domain class for a property type"; + :domain rdf:Property; + :isDefinedBy :; + :label "domain"@en; + :range :Class . + +:isDefinedBy a rdf:Property; + :comment "Indicates the namespace of a resource"; + :domain :Resource; + :isDefinedBy :; + :label "isDefinedBy"@en; + :range :Resource; + :subPropertyOf :seeAlso . + +:label a rdf:Property; + :comment "Provides a human-readable version of a resource name."; + :domain :Resource; + :isDefinedBy :; + :label "label"@en; + :range :Literal . + +:member a rdf:Property; + :comment "a member of a container"; + :domain :Container; + :isDefinedBy :; + :label "member"@en . + +:range a rdf:Property; + :comment "A range class for a property type"; + :domain rdf:Property; + :isDefinedBy :; + :label "range"@en; + :range :Class . + +:seeAlso a rdf:Property; + :comment "A resource that provides information about the subject resource"; + :domain :Resource; + :isDefinedBy :; + :label "seeAlso"@en; + :range :Resource . + +:subClassOf a rdf:Property; + :comment "Indicates membership of a class"; + :domain :Class; + :isDefinedBy :; + :label "subClassOf"@en; + :range :Class . + +:subPropertyOf a rdf:Property; + :comment "Indicates specialization of properties"; + :domain rdf:Property; + :isDefinedBy :; + :label "subPropertyOf"@en; + :range rdf:Property . diff --git a/tests/mkr/test-07.mkr b/tests/mkr/test-07.mkr new file mode 100644 index 0000000..7544d2d --- /dev/null +++ b/tests/mkr/test-07.mkr @@ -0,0 +1,7 @@ +@base ; +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> ; +@prefix : ; + +:a has + :b = ["apple","banana"] ; + diff --git a/tests/mkr/test-07.ttl b/tests/mkr/test-07.ttl new file mode 100644 index 0000000..8455940 --- /dev/null +++ b/tests/mkr/test-07.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b ( "apple" "banana" ) . + diff --git a/tests/mkr/test-08.mkr b/tests/mkr/test-08.mkr new file mode 100644 index 0000000..fe25559 --- /dev/null +++ b/tests/mkr/test-08.mkr @@ -0,0 +1,7 @@ +@base ; +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> ; +@prefix : ; + +:a has + :b = [ ] ; + diff --git a/tests/mkr/test-08.ttl b/tests/mkr/test-08.ttl new file mode 100644 index 0000000..adce0a2 --- /dev/null +++ b/tests/mkr/test-08.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b ( ) . + diff --git a/tests/mkr/test-16a.mkr b/tests/mkr/test-16a.mkr new file mode 100644 index 0000000..45a5696 --- /dev/null +++ b/tests/mkr/test-16a.mkr @@ -0,0 +1,7 @@ +@base ; +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> ; +@prefix : ; + +:a has + :b = [:c1, :c10, :c2, :c3, :c4, :c5, :c6, :c7, :c8, :c9] ; + diff --git a/tests/mkr/test-16a.ttl b/tests/mkr/test-16a.ttl new file mode 100644 index 0000000..246ee9b --- /dev/null +++ b/tests/mkr/test-16a.ttl @@ -0,0 +1,11 @@ +@prefix : . +:a :b :c1; + :b :c2; + :b :c3; + :b :c4; + :b :c5; + :b :c6; + :b :c7; + :b :c8; + :b :c9; + :b :c10 . diff --git a/tests/mkr/test-28.mkr b/tests/mkr/test-28.mkr new file mode 100644 index 0000000..8f66e77 --- /dev/null +++ b/tests/mkr/test-28.mkr @@ -0,0 +1,6 @@ +@base ; +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> ; + + has + = [1, 1., 1.0, 1.000000000, 1.2345678901234567890123457890, 2.23400000000000000000005, 2.2340000000000000000005, 2.234000000000000000005, 2.23400000000000000005, 2.2340000000000000005, 2.234000000000000005, 2.23400000000000005, 2.2340000000000005, 2.234000000000005, 2.23400000000005, 2.2340000000005, 2.234000000005, 2.23400000005, 2.2340000005, 2.234000005, 2.3, 2.345] ; + diff --git a/tests/mkr/test-28.ttl b/tests/mkr/test-28.ttl new file mode 100644 index 0000000..7357dd4 --- /dev/null +++ b/tests/mkr/test-28.ttl @@ -0,0 +1,22 @@ + "2.345"^^ . + "1"^^ . + "1.0"^^ . + "1."^^ . + "1.000000000"^^ . + "2.3"^^ . + "2.234000005"^^ . + "2.2340000005"^^ . + "2.23400000005"^^ . + "2.234000000005"^^ . + "2.2340000000005"^^ . + "2.23400000000005"^^ . + "2.234000000000005"^^ . + "2.2340000000000005"^^ . + "2.23400000000000005"^^ . + "2.234000000000000005"^^ . + "2.2340000000000000005"^^ . + "2.23400000000000000005"^^ . + "2.234000000000000000005"^^ . + "2.2340000000000000000005"^^ . + "2.23400000000000000000005"^^ . + "1.2345678901234567890123457890"^^ . diff --git a/tests/mkr/test-31.mkr b/tests/mkr/test-31.mkr new file mode 100644 index 0000000..c54f373 --- /dev/null +++ b/tests/mkr/test-31.mkr @@ -0,0 +1,12 @@ +@base ; +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> ; +@prefix rss: ; + + has + rss:items = [{ + _:genid1 has + rdf:_1 = [], + rdf:_2 = [], + rdf:type = [rdf:Seq] + ;}] ; + diff --git a/tests/mkr/test-31.ttl b/tests/mkr/test-31.ttl new file mode 100644 index 0000000..c1130ed --- /dev/null +++ b/tests/mkr/test-31.ttl @@ -0,0 +1,10 @@ +@prefix rdf: . +@prefix rss: . + + + rss:items [ + rdf:_1 ; + rdf:_2 ; + a rdf:Seq + ] . + diff --git a/tests/mkr/test-32.mkr b/tests/mkr/test-32.mkr new file mode 100644 index 0000000..decb5e2 --- /dev/null +++ b/tests/mkr/test-32.mkr @@ -0,0 +1,7 @@ +@base ; +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> ; +@prefix ex: ; + +ex:node1 has + rdf:value = [ex:item1,ex:item2] ; + diff --git a/tests/mkr/test-32.ttl b/tests/mkr/test-32.ttl new file mode 100644 index 0000000..abf26d2 --- /dev/null +++ b/tests/mkr/test-32.ttl @@ -0,0 +1,5 @@ +@prefix rdf: . +@prefix ex: . + +# Based on Issue#0000274 http://bugs.librdf.org/mantis/view.php?id=274 +ex:node1 rdf:value ( ex:item1 ex:item2 ) . diff --git a/tests/mkr/test-34.mkr b/tests/mkr/test-34.mkr new file mode 100644 index 0000000..1b997e1 --- /dev/null +++ b/tests/mkr/test-34.mkr @@ -0,0 +1,7 @@ +@base ; +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> ; +@prefix dbpedia: ; + + has + = [] ; + diff --git a/tests/mkr/test-34.ttl b/tests/mkr/test-34.ttl new file mode 100644 index 0000000..eb39a8d --- /dev/null +++ b/tests/mkr/test-34.ttl @@ -0,0 +1,4 @@ +@prefix dbpedia: . + + + . diff --git a/tests/nquads-2013/Makefile.am b/tests/nquads-2013/Makefile.am new file mode 100644 index 0000000..ccf3cbd --- /dev/null +++ b/tests/nquads-2013/Makefile.am @@ -0,0 +1,211 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor N-Quads 2013 tests +# +# Copyright (C) 2013, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +RDFCOMPARE=$(srcdir)/../../scripts/rdfcompare + +RDFXML_DIR = ../rdfxml +NTRIPLES_DIR = ../ntriples + +TEST_GOOD_FILES = \ +comment_following_triple.nq \ +langtagged_string.nq \ +lantag_with_subtag.nq \ +literal_all_controls.nq \ +literal_all_punctuation.nq \ +literal_ascii_boundaries.nq \ +literal_false.nq \ +literal.nq \ +literal_true.nq \ +literal_with_2_dquotes.nq \ +literal_with_2_squotes.nq \ +literal_with_BACKSPACE.nq \ +literal_with_CARRIAGE_RETURN.nq \ +literal_with_CHARACTER_TABULATION.nq \ +literal_with_dquote.nq \ +literal_with_FORM_FEED.nq \ +literal_with_LINE_FEED.nq \ +literal_with_numeric_escape4.nq \ +literal_with_numeric_escape8.nq \ +literal_with_REVERSE_SOLIDUS2.nq \ +literal_with_REVERSE_SOLIDUS.nq \ +literal_with_squote.nq \ +literal_with_UTF8_boundaries.nq \ +minimal_whitespace.nq \ +nq-syntax-bnode-01.nq \ +nq-syntax-bnode-02.nq \ +nq-syntax-bnode-03.nq \ +nq-syntax-bnode-04.nq \ +nq-syntax-bnode-05.nq \ +nq-syntax-bnode-06.nq \ +nq-syntax-uri-01.nq \ +nq-syntax-uri-02.nq \ +nq-syntax-uri-03.nq \ +nq-syntax-uri-04.nq \ +nq-syntax-uri-05.nq \ +nq-syntax-uri-06.nq \ +nt-syntax-bnode-01.nq \ +nt-syntax-bnode-02.nq \ +nt-syntax-bnode-03.nq \ +nt-syntax-datatypes-01.nq \ +nt-syntax-datatypes-02.nq \ +nt-syntax-file-01.nq \ +nt-syntax-file-02.nq \ +nt-syntax-file-03.nq \ +nt-syntax-str-esc-01.nq \ +nt-syntax-str-esc-02.nq \ +nt-syntax-str-esc-03.nq \ +nt-syntax-string-01.nq \ +nt-syntax-string-02.nq \ +nt-syntax-string-03.nq \ +nt-syntax-subm-01.nq \ +nt-syntax-uri-01.nq \ +nt-syntax-uri-02.nq \ +nt-syntax-uri-03.nq \ +nt-syntax-uri-04.nq + + +TEST_BAD_FILES = \ +nq-syntax-bad-literal-01.nq \ +nq-syntax-bad-literal-02.nq \ +nq-syntax-bad-literal-03.nq \ +nq-syntax-bad-quint-01.nq \ +nq-syntax-bad-uri-01.nq \ +nt-syntax-bad-base-01.nq \ +nt-syntax-bad-esc-01.nq \ +nt-syntax-bad-esc-02.nq \ +nt-syntax-bad-esc-03.nq \ +nt-syntax-bad-lang-01.nq \ +nt-syntax-bad-num-01.nq \ +nt-syntax-bad-num-02.nq \ +nt-syntax-bad-num-03.nq \ +nt-syntax-bad-prefix-01.nq \ +nt-syntax-bad-string-01.nq \ +nt-syntax-bad-string-02.nq \ +nt-syntax-bad-string-03.nq \ +nt-syntax-bad-string-04.nq \ +nt-syntax-bad-string-05.nq \ +nt-syntax-bad-string-06.nq \ +nt-syntax-bad-string-07.nq \ +nt-syntax-bad-struct-01.nq \ +nt-syntax-bad-struct-02.nq \ +nt-syntax-bad-uri-01.nq \ +nt-syntax-bad-uri-02.nq \ +nt-syntax-bad-uri-03.nq \ +nt-syntax-bad-uri-04.nq \ +nt-syntax-bad-uri-05.nq \ +nt-syntax-bad-uri-06.nq \ +nt-syntax-bad-uri-07.nq \ +nt-syntax-bad-uri-08.nq \ +nt-syntax-bad-uri-09.nq + +# Used to make N-triples output consistent +BASE_URI=http://www.w3.org/2013/N-QuadsTests/ +# for rdf-schema.ttl +RDF_NS_URI=http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI=http://www.w3.org/2000/01/rdf-schema + +ALL_TEST_FILES= README \ + $(TEST_GOOD_FILES) \ + $(TEST_BAD_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-good-nquads check-bad-nquads + +if MAINTAINER_MODE +check_good_ntriples_deps = $(TEST_GOOD_FILES) +endif + +check-good-nquads: build-rapper $(check_good_nquads_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing good N-Quads syntax passes"; \ + for test in $(TEST_GOOD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i nquads -o nquads $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_bad_nquads_deps = $(TEST_BAD_FILES) +endif + +check-bad-nquads: build-rapper $(check_bad_nquads_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing bad N-Quads fails"; \ + for test in $(TEST_BAD_FILES) ; do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result diff --git a/tests/nquads-2013/Makefile.in b/tests/nquads-2013/Makefile.in new file mode 100644 index 0000000..5bc5ccc --- /dev/null +++ b/tests/nquads-2013/Makefile.in @@ -0,0 +1,694 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor N-Quads 2013 tests +# +# Copyright (C) 2013, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/nquads-2013 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in README +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +RDFCOMPARE = $(srcdir)/../../scripts/rdfcompare +RDFXML_DIR = ../rdfxml +NTRIPLES_DIR = ../ntriples +TEST_GOOD_FILES = \ +comment_following_triple.nq \ +langtagged_string.nq \ +lantag_with_subtag.nq \ +literal_all_controls.nq \ +literal_all_punctuation.nq \ +literal_ascii_boundaries.nq \ +literal_false.nq \ +literal.nq \ +literal_true.nq \ +literal_with_2_dquotes.nq \ +literal_with_2_squotes.nq \ +literal_with_BACKSPACE.nq \ +literal_with_CARRIAGE_RETURN.nq \ +literal_with_CHARACTER_TABULATION.nq \ +literal_with_dquote.nq \ +literal_with_FORM_FEED.nq \ +literal_with_LINE_FEED.nq \ +literal_with_numeric_escape4.nq \ +literal_with_numeric_escape8.nq \ +literal_with_REVERSE_SOLIDUS2.nq \ +literal_with_REVERSE_SOLIDUS.nq \ +literal_with_squote.nq \ +literal_with_UTF8_boundaries.nq \ +minimal_whitespace.nq \ +nq-syntax-bnode-01.nq \ +nq-syntax-bnode-02.nq \ +nq-syntax-bnode-03.nq \ +nq-syntax-bnode-04.nq \ +nq-syntax-bnode-05.nq \ +nq-syntax-bnode-06.nq \ +nq-syntax-uri-01.nq \ +nq-syntax-uri-02.nq \ +nq-syntax-uri-03.nq \ +nq-syntax-uri-04.nq \ +nq-syntax-uri-05.nq \ +nq-syntax-uri-06.nq \ +nt-syntax-bnode-01.nq \ +nt-syntax-bnode-02.nq \ +nt-syntax-bnode-03.nq \ +nt-syntax-datatypes-01.nq \ +nt-syntax-datatypes-02.nq \ +nt-syntax-file-01.nq \ +nt-syntax-file-02.nq \ +nt-syntax-file-03.nq \ +nt-syntax-str-esc-01.nq \ +nt-syntax-str-esc-02.nq \ +nt-syntax-str-esc-03.nq \ +nt-syntax-string-01.nq \ +nt-syntax-string-02.nq \ +nt-syntax-string-03.nq \ +nt-syntax-subm-01.nq \ +nt-syntax-uri-01.nq \ +nt-syntax-uri-02.nq \ +nt-syntax-uri-03.nq \ +nt-syntax-uri-04.nq + +TEST_BAD_FILES = \ +nq-syntax-bad-literal-01.nq \ +nq-syntax-bad-literal-02.nq \ +nq-syntax-bad-literal-03.nq \ +nq-syntax-bad-quint-01.nq \ +nq-syntax-bad-uri-01.nq \ +nt-syntax-bad-base-01.nq \ +nt-syntax-bad-esc-01.nq \ +nt-syntax-bad-esc-02.nq \ +nt-syntax-bad-esc-03.nq \ +nt-syntax-bad-lang-01.nq \ +nt-syntax-bad-num-01.nq \ +nt-syntax-bad-num-02.nq \ +nt-syntax-bad-num-03.nq \ +nt-syntax-bad-prefix-01.nq \ +nt-syntax-bad-string-01.nq \ +nt-syntax-bad-string-02.nq \ +nt-syntax-bad-string-03.nq \ +nt-syntax-bad-string-04.nq \ +nt-syntax-bad-string-05.nq \ +nt-syntax-bad-string-06.nq \ +nt-syntax-bad-string-07.nq \ +nt-syntax-bad-struct-01.nq \ +nt-syntax-bad-struct-02.nq \ +nt-syntax-bad-uri-01.nq \ +nt-syntax-bad-uri-02.nq \ +nt-syntax-bad-uri-03.nq \ +nt-syntax-bad-uri-04.nq \ +nt-syntax-bad-uri-05.nq \ +nt-syntax-bad-uri-06.nq \ +nt-syntax-bad-uri-07.nq \ +nt-syntax-bad-uri-08.nq \ +nt-syntax-bad-uri-09.nq + + +# Used to make N-triples output consistent +BASE_URI = http://www.w3.org/2013/N-QuadsTests/ +# for rdf-schema.ttl +RDF_NS_URI = http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI = http://www.w3.org/2000/01/rdf-schema +ALL_TEST_FILES = README \ + $(TEST_GOOD_FILES) \ + $(TEST_BAD_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff +@MAINTAINER_MODE_TRUE@check_good_ntriples_deps = $(TEST_GOOD_FILES) +@MAINTAINER_MODE_TRUE@check_bad_nquads_deps = $(TEST_BAD_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/nquads-2013/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/nquads-2013/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-good-nquads check-bad-nquads + +check-good-nquads: build-rapper $(check_good_nquads_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing good N-Quads syntax passes"; \ + for test in $(TEST_GOOD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i nquads -o nquads $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result + +check-bad-nquads: build-rapper $(check_bad_nquads_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing bad N-Quads fails"; \ + for test in $(TEST_BAD_FILES) ; do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/nquads-2013/README b/tests/nquads-2013/README new file mode 100644 index 0000000..7aef79d --- /dev/null +++ b/tests/nquads-2013/README @@ -0,0 +1,25 @@ +This README is for the W3C RDF Working Group's N-Quads test suite. +This test suite contains two kinds of tests: + + Positive syntax (rdft:TestNQuadsPositiveSyntax) - an input N-Quads + file with no syntax errors. + + Negative syntax (rdft:TestNQuadsNegativeSyntax) - an input N-Quads + file with at least one syntax error. + +The manifest.ttl file in this directory lists tests in the +RDF WG's N-Quads test suite. All +tests have a name (mf:name) and an input (mf:action). + +• An implementation passes a positive syntax test if it parses the + input. + +• An implementation passes a negative syntax test if it fails to parse + the input. + +The home of the test suite is . + +See http://www.w3.org/2011/rdf-wg/wiki/RDF_Test_Suites for more details. + +Eric Prud'hommeaux - 11 June 2013. +Gregg Kellogg - 26 June 2013. diff --git a/tests/nquads-2013/comment_following_triple.nq b/tests/nquads-2013/comment_following_triple.nq new file mode 100644 index 0000000..5619459 --- /dev/null +++ b/tests/nquads-2013/comment_following_triple.nq @@ -0,0 +1,5 @@ + . # comment + _:o . # comment + "o" . # comment + "o"^^ . # comment + "o"@en . # comment diff --git a/tests/nquads-2013/langtagged_string.nq b/tests/nquads-2013/langtagged_string.nq new file mode 100644 index 0000000..1bddb04 --- /dev/null +++ b/tests/nquads-2013/langtagged_string.nq @@ -0,0 +1 @@ + "chat"@en . diff --git a/tests/nquads-2013/lantag_with_subtag.nq b/tests/nquads-2013/lantag_with_subtag.nq new file mode 100644 index 0000000..629cbf4 --- /dev/null +++ b/tests/nquads-2013/lantag_with_subtag.nq @@ -0,0 +1 @@ + "Cheers"@en-UK . diff --git a/tests/nquads-2013/literal.nq b/tests/nquads-2013/literal.nq new file mode 100644 index 0000000..3aba89e --- /dev/null +++ b/tests/nquads-2013/literal.nq @@ -0,0 +1 @@ + "x" . diff --git a/tests/nquads-2013/literal_all_controls.nq b/tests/nquads-2013/literal_all_controls.nq new file mode 100644 index 0000000..91c8af1 --- /dev/null +++ b/tests/nquads-2013/literal_all_controls.nq @@ -0,0 +1 @@ + "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\t\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" . diff --git a/tests/nquads-2013/literal_all_punctuation.nq b/tests/nquads-2013/literal_all_punctuation.nq new file mode 100644 index 0000000..c25d818 --- /dev/null +++ b/tests/nquads-2013/literal_all_punctuation.nq @@ -0,0 +1 @@ + " !\"#$%&():;<=>?@[]^_`{|}~" . diff --git a/tests/nquads-2013/literal_ascii_boundaries.nq b/tests/nquads-2013/literal_ascii_boundaries.nq new file mode 100644 index 0000000..7a4dc71 Binary files /dev/null and b/tests/nquads-2013/literal_ascii_boundaries.nq differ diff --git a/tests/nquads-2013/literal_false.nq b/tests/nquads-2013/literal_false.nq new file mode 100644 index 0000000..5bbbae8 --- /dev/null +++ b/tests/nquads-2013/literal_false.nq @@ -0,0 +1 @@ + "false"^^ . diff --git a/tests/nquads-2013/literal_true.nq b/tests/nquads-2013/literal_true.nq new file mode 100644 index 0000000..054b229 --- /dev/null +++ b/tests/nquads-2013/literal_true.nq @@ -0,0 +1 @@ + "true"^^ . diff --git a/tests/nquads-2013/literal_with_2_dquotes.nq b/tests/nquads-2013/literal_with_2_dquotes.nq new file mode 100644 index 0000000..3e69dc1 --- /dev/null +++ b/tests/nquads-2013/literal_with_2_dquotes.nq @@ -0,0 +1 @@ + "x\"\"y" . diff --git a/tests/nquads-2013/literal_with_2_squotes.nq b/tests/nquads-2013/literal_with_2_squotes.nq new file mode 100644 index 0000000..8ddc52e --- /dev/null +++ b/tests/nquads-2013/literal_with_2_squotes.nq @@ -0,0 +1 @@ + "x''y" . diff --git a/tests/nquads-2013/literal_with_BACKSPACE.nq b/tests/nquads-2013/literal_with_BACKSPACE.nq new file mode 100644 index 0000000..339013d --- /dev/null +++ b/tests/nquads-2013/literal_with_BACKSPACE.nq @@ -0,0 +1 @@ + "\b" . diff --git a/tests/nquads-2013/literal_with_CARRIAGE_RETURN.nq b/tests/nquads-2013/literal_with_CARRIAGE_RETURN.nq new file mode 100644 index 0000000..91b85c8 --- /dev/null +++ b/tests/nquads-2013/literal_with_CARRIAGE_RETURN.nq @@ -0,0 +1 @@ + "\r" . diff --git a/tests/nquads-2013/literal_with_CHARACTER_TABULATION.nq b/tests/nquads-2013/literal_with_CHARACTER_TABULATION.nq new file mode 100644 index 0000000..a6a9d9f --- /dev/null +++ b/tests/nquads-2013/literal_with_CHARACTER_TABULATION.nq @@ -0,0 +1 @@ + "\t" . diff --git a/tests/nquads-2013/literal_with_FORM_FEED.nq b/tests/nquads-2013/literal_with_FORM_FEED.nq new file mode 100644 index 0000000..10d2c6d --- /dev/null +++ b/tests/nquads-2013/literal_with_FORM_FEED.nq @@ -0,0 +1 @@ + "\f" . diff --git a/tests/nquads-2013/literal_with_LINE_FEED.nq b/tests/nquads-2013/literal_with_LINE_FEED.nq new file mode 100644 index 0000000..462f97a --- /dev/null +++ b/tests/nquads-2013/literal_with_LINE_FEED.nq @@ -0,0 +1 @@ + "\n" . diff --git a/tests/nquads-2013/literal_with_REVERSE_SOLIDUS.nq b/tests/nquads-2013/literal_with_REVERSE_SOLIDUS.nq new file mode 100644 index 0000000..ebc846e --- /dev/null +++ b/tests/nquads-2013/literal_with_REVERSE_SOLIDUS.nq @@ -0,0 +1 @@ + "\\" . diff --git a/tests/nquads-2013/literal_with_REVERSE_SOLIDUS2.nq b/tests/nquads-2013/literal_with_REVERSE_SOLIDUS2.nq new file mode 100644 index 0000000..586e364 --- /dev/null +++ b/tests/nquads-2013/literal_with_REVERSE_SOLIDUS2.nq @@ -0,0 +1 @@ + "test-\\" . diff --git a/tests/nquads-2013/literal_with_UTF8_boundaries.nq b/tests/nquads-2013/literal_with_UTF8_boundaries.nq new file mode 100644 index 0000000..0e1616d --- /dev/null +++ b/tests/nquads-2013/literal_with_UTF8_boundaries.nq @@ -0,0 +1 @@ + "€߿ࠀ࿿က쿿퀀퟿�𐀀𿿽񀀀󿿽􀀀􏿽" . diff --git a/tests/nquads-2013/literal_with_dquote.nq b/tests/nquads-2013/literal_with_dquote.nq new file mode 100644 index 0000000..05a1fd3 --- /dev/null +++ b/tests/nquads-2013/literal_with_dquote.nq @@ -0,0 +1 @@ + "x\"y" . diff --git a/tests/nquads-2013/literal_with_numeric_escape4.nq b/tests/nquads-2013/literal_with_numeric_escape4.nq new file mode 100644 index 0000000..16f0a03 --- /dev/null +++ b/tests/nquads-2013/literal_with_numeric_escape4.nq @@ -0,0 +1 @@ + "\u006F" . diff --git a/tests/nquads-2013/literal_with_numeric_escape8.nq b/tests/nquads-2013/literal_with_numeric_escape8.nq new file mode 100644 index 0000000..e909a79 --- /dev/null +++ b/tests/nquads-2013/literal_with_numeric_escape8.nq @@ -0,0 +1 @@ + "\U0000006F" . diff --git a/tests/nquads-2013/literal_with_squote.nq b/tests/nquads-2013/literal_with_squote.nq new file mode 100644 index 0000000..acf7f58 --- /dev/null +++ b/tests/nquads-2013/literal_with_squote.nq @@ -0,0 +1 @@ + "x'y" . diff --git a/tests/nquads-2013/minimal_whitespace.nq b/tests/nquads-2013/minimal_whitespace.nq new file mode 100644 index 0000000..e9e3a80 --- /dev/null +++ b/tests/nquads-2013/minimal_whitespace.nq @@ -0,0 +1,6 @@ +. +"Alice". +_:o. +_:s. +_:s"Alice". +_:s_:bnode1. diff --git a/tests/nquads-2013/nq-syntax-bad-literal-01.nq b/tests/nquads-2013/nq-syntax-bad-literal-01.nq new file mode 100644 index 0000000..bb17eb3 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bad-literal-01.nq @@ -0,0 +1 @@ + "o" . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-bad-literal-02.nq b/tests/nquads-2013/nq-syntax-bad-literal-02.nq new file mode 100644 index 0000000..ea303b2 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bad-literal-02.nq @@ -0,0 +1 @@ + "o"@en . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-bad-literal-03.nq b/tests/nquads-2013/nq-syntax-bad-literal-03.nq new file mode 100644 index 0000000..854b867 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bad-literal-03.nq @@ -0,0 +1 @@ + "o"^^ . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-bad-quint-01.nq b/tests/nquads-2013/nq-syntax-bad-quint-01.nq new file mode 100644 index 0000000..52b7581 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bad-quint-01.nq @@ -0,0 +1,2 @@ +# N-Quads rejects a quint + . diff --git a/tests/nquads-2013/nq-syntax-bad-uri-01.nq b/tests/nquads-2013/nq-syntax-bad-uri-01.nq new file mode 100644 index 0000000..3bf4dbd --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bad-uri-01.nq @@ -0,0 +1,2 @@ +# No relative IRIs in N-Quads + . diff --git a/tests/nquads-2013/nq-syntax-bnode-01.nq b/tests/nquads-2013/nq-syntax-bnode-01.nq new file mode 100644 index 0000000..b7acbd5 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bnode-01.nq @@ -0,0 +1 @@ + _:g . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-bnode-02.nq b/tests/nquads-2013/nq-syntax-bnode-02.nq new file mode 100644 index 0000000..07c9263 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bnode-02.nq @@ -0,0 +1 @@ +_:s _:g . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-bnode-03.nq b/tests/nquads-2013/nq-syntax-bnode-03.nq new file mode 100644 index 0000000..5f89bd9 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bnode-03.nq @@ -0,0 +1 @@ + _:o _:g . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-bnode-04.nq b/tests/nquads-2013/nq-syntax-bnode-04.nq new file mode 100644 index 0000000..f89ca81 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bnode-04.nq @@ -0,0 +1 @@ + "o" _:g . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-bnode-05.nq b/tests/nquads-2013/nq-syntax-bnode-05.nq new file mode 100644 index 0000000..9bb45ce --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bnode-05.nq @@ -0,0 +1 @@ + "o"@en _:g . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-bnode-06.nq b/tests/nquads-2013/nq-syntax-bnode-06.nq new file mode 100644 index 0000000..194ffdc --- /dev/null +++ b/tests/nquads-2013/nq-syntax-bnode-06.nq @@ -0,0 +1 @@ + "o"^^ _:g . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-uri-01.nq b/tests/nquads-2013/nq-syntax-uri-01.nq new file mode 100644 index 0000000..3026e12 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-uri-01.nq @@ -0,0 +1 @@ + . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-uri-02.nq b/tests/nquads-2013/nq-syntax-uri-02.nq new file mode 100644 index 0000000..1590ab9 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-uri-02.nq @@ -0,0 +1 @@ +_:s . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-uri-03.nq b/tests/nquads-2013/nq-syntax-uri-03.nq new file mode 100644 index 0000000..4592edc --- /dev/null +++ b/tests/nquads-2013/nq-syntax-uri-03.nq @@ -0,0 +1 @@ + _:o . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-uri-04.nq b/tests/nquads-2013/nq-syntax-uri-04.nq new file mode 100644 index 0000000..f7b834a --- /dev/null +++ b/tests/nquads-2013/nq-syntax-uri-04.nq @@ -0,0 +1 @@ + "o" . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-uri-05.nq b/tests/nquads-2013/nq-syntax-uri-05.nq new file mode 100644 index 0000000..cf5a0ee --- /dev/null +++ b/tests/nquads-2013/nq-syntax-uri-05.nq @@ -0,0 +1 @@ + "o"@en . \ No newline at end of file diff --git a/tests/nquads-2013/nq-syntax-uri-06.nq b/tests/nquads-2013/nq-syntax-uri-06.nq new file mode 100644 index 0000000..65e7703 --- /dev/null +++ b/tests/nquads-2013/nq-syntax-uri-06.nq @@ -0,0 +1 @@ + "o"^^ . \ No newline at end of file diff --git a/tests/nquads-2013/nt-syntax-bad-base-01.nq b/tests/nquads-2013/nt-syntax-bad-base-01.nq new file mode 100644 index 0000000..dff1b3b --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-base-01.nq @@ -0,0 +1 @@ +@base . diff --git a/tests/nquads-2013/nt-syntax-bad-esc-01.nq b/tests/nquads-2013/nt-syntax-bad-esc-01.nq new file mode 100644 index 0000000..f7a88ad --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-esc-01.nq @@ -0,0 +1,2 @@ +# Bad string escape + "a\zb" . diff --git a/tests/nquads-2013/nt-syntax-bad-esc-02.nq b/tests/nquads-2013/nt-syntax-bad-esc-02.nq new file mode 100644 index 0000000..72711d4 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-esc-02.nq @@ -0,0 +1,2 @@ +# Bad string escape + "\uWXYZ" . diff --git a/tests/nquads-2013/nt-syntax-bad-esc-03.nq b/tests/nquads-2013/nt-syntax-bad-esc-03.nq new file mode 100644 index 0000000..3a4522f --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-esc-03.nq @@ -0,0 +1,2 @@ +# Bad string escape + "\U0000WXYZ" . diff --git a/tests/nquads-2013/nt-syntax-bad-lang-01.nq b/tests/nquads-2013/nt-syntax-bad-lang-01.nq new file mode 100644 index 0000000..a4d952c --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-lang-01.nq @@ -0,0 +1,2 @@ +# Bad lang tag + "string"@1 . diff --git a/tests/nquads-2013/nt-syntax-bad-num-01.nq b/tests/nquads-2013/nt-syntax-bad-num-01.nq new file mode 100644 index 0000000..2be6f51 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-num-01.nq @@ -0,0 +1 @@ + 1 . diff --git a/tests/nquads-2013/nt-syntax-bad-num-02.nq b/tests/nquads-2013/nt-syntax-bad-num-02.nq new file mode 100644 index 0000000..e1d5b06 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-num-02.nq @@ -0,0 +1 @@ + 1.0 . diff --git a/tests/nquads-2013/nt-syntax-bad-num-03.nq b/tests/nquads-2013/nt-syntax-bad-num-03.nq new file mode 100644 index 0000000..a9be82f --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-num-03.nq @@ -0,0 +1 @@ + 1.0e0 . diff --git a/tests/nquads-2013/nt-syntax-bad-prefix-01.nq b/tests/nquads-2013/nt-syntax-bad-prefix-01.nq new file mode 100644 index 0000000..89e08cc --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-prefix-01.nq @@ -0,0 +1 @@ +@prefix : . diff --git a/tests/nquads-2013/nt-syntax-bad-string-01.nq b/tests/nquads-2013/nt-syntax-bad-string-01.nq new file mode 100644 index 0000000..988af87 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-string-01.nq @@ -0,0 +1 @@ + "abc' . diff --git a/tests/nquads-2013/nt-syntax-bad-string-02.nq b/tests/nquads-2013/nt-syntax-bad-string-02.nq new file mode 100644 index 0000000..e1d5b06 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-string-02.nq @@ -0,0 +1 @@ + 1.0 . diff --git a/tests/nquads-2013/nt-syntax-bad-string-03.nq b/tests/nquads-2013/nt-syntax-bad-string-03.nq new file mode 100644 index 0000000..64d343d --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-string-03.nq @@ -0,0 +1 @@ + 1.0e1 . diff --git a/tests/nquads-2013/nt-syntax-bad-string-04.nq b/tests/nquads-2013/nt-syntax-bad-string-04.nq new file mode 100644 index 0000000..af4ff28 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-string-04.nq @@ -0,0 +1 @@ + '''abc''' . diff --git a/tests/nquads-2013/nt-syntax-bad-string-05.nq b/tests/nquads-2013/nt-syntax-bad-string-05.nq new file mode 100644 index 0000000..75ad4b2 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-string-05.nq @@ -0,0 +1 @@ + """abc""" . diff --git a/tests/nquads-2013/nt-syntax-bad-string-06.nq b/tests/nquads-2013/nt-syntax-bad-string-06.nq new file mode 100644 index 0000000..56dcbc6 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-string-06.nq @@ -0,0 +1 @@ + "abc . diff --git a/tests/nquads-2013/nt-syntax-bad-string-07.nq b/tests/nquads-2013/nt-syntax-bad-string-07.nq new file mode 100644 index 0000000..7f1ee80 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-string-07.nq @@ -0,0 +1 @@ + abc" . diff --git a/tests/nquads-2013/nt-syntax-bad-struct-01.nq b/tests/nquads-2013/nt-syntax-bad-struct-01.nq new file mode 100644 index 0000000..d546d56 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-struct-01.nq @@ -0,0 +1 @@ + , . diff --git a/tests/nquads-2013/nt-syntax-bad-struct-02.nq b/tests/nquads-2013/nt-syntax-bad-struct-02.nq new file mode 100644 index 0000000..1f388c6 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-struct-02.nq @@ -0,0 +1 @@ + ; , . diff --git a/tests/nquads-2013/nt-syntax-bad-uri-01.nq b/tests/nquads-2013/nt-syntax-bad-uri-01.nq new file mode 100644 index 0000000..0e69dc0 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-01.nq @@ -0,0 +1,2 @@ +# Bad IRI : space. + . diff --git a/tests/nquads-2013/nt-syntax-bad-uri-02.nq b/tests/nquads-2013/nt-syntax-bad-uri-02.nq new file mode 100644 index 0000000..36d91af --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-02.nq @@ -0,0 +1,2 @@ +# Bad IRI : bad escape + . diff --git a/tests/nquads-2013/nt-syntax-bad-uri-03.nq b/tests/nquads-2013/nt-syntax-bad-uri-03.nq new file mode 100644 index 0000000..f512345 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-03.nq @@ -0,0 +1,2 @@ +# Bad IRI : bad escape + . diff --git a/tests/nquads-2013/nt-syntax-bad-uri-04.nq b/tests/nquads-2013/nt-syntax-bad-uri-04.nq new file mode 100644 index 0000000..5cab062 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-04.nq @@ -0,0 +1,2 @@ +# Bad IRI : character escapes not allowed. + . diff --git a/tests/nquads-2013/nt-syntax-bad-uri-05.nq b/tests/nquads-2013/nt-syntax-bad-uri-05.nq new file mode 100644 index 0000000..be0a21e --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-05.nq @@ -0,0 +1,2 @@ +# Bad IRI : character escapes not allowed. + . diff --git a/tests/nquads-2013/nt-syntax-bad-uri-06.nq b/tests/nquads-2013/nt-syntax-bad-uri-06.nq new file mode 100644 index 0000000..b4e6459 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-06.nq @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples + . diff --git a/tests/nquads-2013/nt-syntax-bad-uri-07.nq b/tests/nquads-2013/nt-syntax-bad-uri-07.nq new file mode 100644 index 0000000..74534dd --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-07.nq @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples +

. diff --git a/tests/nquads-2013/nt-syntax-bad-uri-08.nq b/tests/nquads-2013/nt-syntax-bad-uri-08.nq new file mode 100644 index 0000000..41a953d --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-08.nq @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples + . diff --git a/tests/nquads-2013/nt-syntax-bad-uri-09.nq b/tests/nquads-2013/nt-syntax-bad-uri-09.nq new file mode 100644 index 0000000..58821da --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bad-uri-09.nq @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples + "foo"^^

. diff --git a/tests/nquads-2013/nt-syntax-bnode-01.nq b/tests/nquads-2013/nt-syntax-bnode-01.nq new file mode 100644 index 0000000..5fb0d0f --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bnode-01.nq @@ -0,0 +1 @@ +_:a . diff --git a/tests/nquads-2013/nt-syntax-bnode-02.nq b/tests/nquads-2013/nt-syntax-bnode-02.nq new file mode 100644 index 0000000..737e81b --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bnode-02.nq @@ -0,0 +1,2 @@ + _:a . +_:a . diff --git a/tests/nquads-2013/nt-syntax-bnode-03.nq b/tests/nquads-2013/nt-syntax-bnode-03.nq new file mode 100644 index 0000000..1a1f1c9 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-bnode-03.nq @@ -0,0 +1,2 @@ + _:1a . +_:1a . diff --git a/tests/nquads-2013/nt-syntax-datatypes-01.nq b/tests/nquads-2013/nt-syntax-datatypes-01.nq new file mode 100644 index 0000000..9126309 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-datatypes-01.nq @@ -0,0 +1 @@ + "123"^^ . diff --git a/tests/nquads-2013/nt-syntax-datatypes-02.nq b/tests/nquads-2013/nt-syntax-datatypes-02.nq new file mode 100644 index 0000000..d49cc27 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-datatypes-02.nq @@ -0,0 +1 @@ + "123"^^ . diff --git a/tests/nquads-2013/nt-syntax-file-01.nq b/tests/nquads-2013/nt-syntax-file-01.nq new file mode 100644 index 0000000..e69de29 diff --git a/tests/nquads-2013/nt-syntax-file-02.nq b/tests/nquads-2013/nt-syntax-file-02.nq new file mode 100644 index 0000000..e6d327d --- /dev/null +++ b/tests/nquads-2013/nt-syntax-file-02.nq @@ -0,0 +1 @@ +#Empty file. diff --git a/tests/nquads-2013/nt-syntax-file-03.nq b/tests/nquads-2013/nt-syntax-file-03.nq new file mode 100644 index 0000000..a9ca035 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-file-03.nq @@ -0,0 +1,2 @@ +#One comment, one empty line. + diff --git a/tests/nquads-2013/nt-syntax-str-esc-01.nq b/tests/nquads-2013/nt-syntax-str-esc-01.nq new file mode 100644 index 0000000..3925f2e --- /dev/null +++ b/tests/nquads-2013/nt-syntax-str-esc-01.nq @@ -0,0 +1 @@ + "a\n" . diff --git a/tests/nquads-2013/nt-syntax-str-esc-02.nq b/tests/nquads-2013/nt-syntax-str-esc-02.nq new file mode 100644 index 0000000..e7d032f --- /dev/null +++ b/tests/nquads-2013/nt-syntax-str-esc-02.nq @@ -0,0 +1 @@ + "a\u0020b" . diff --git a/tests/nquads-2013/nt-syntax-str-esc-03.nq b/tests/nquads-2013/nt-syntax-str-esc-03.nq new file mode 100644 index 0000000..b8588c7 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-str-esc-03.nq @@ -0,0 +1 @@ + "a\U00000020b" . diff --git a/tests/nquads-2013/nt-syntax-string-01.nq b/tests/nquads-2013/nt-syntax-string-01.nq new file mode 100644 index 0000000..5333aef --- /dev/null +++ b/tests/nquads-2013/nt-syntax-string-01.nq @@ -0,0 +1 @@ + "string" . diff --git a/tests/nquads-2013/nt-syntax-string-02.nq b/tests/nquads-2013/nt-syntax-string-02.nq new file mode 100644 index 0000000..1ab55a3 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-string-02.nq @@ -0,0 +1 @@ + "string"@en . diff --git a/tests/nquads-2013/nt-syntax-string-03.nq b/tests/nquads-2013/nt-syntax-string-03.nq new file mode 100644 index 0000000..b34ca0f --- /dev/null +++ b/tests/nquads-2013/nt-syntax-string-03.nq @@ -0,0 +1 @@ + "string"@en-uk . diff --git a/tests/nquads-2013/nt-syntax-subm-01.nq b/tests/nquads-2013/nt-syntax-subm-01.nq new file mode 100644 index 0000000..91b4988 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-subm-01.nq @@ -0,0 +1,79 @@ +# +# Copyright World Wide Web Consortium, (Massachusetts Institute of +# Technology, Institut National de Recherche en Informatique et en +# Automatique, Keio University). +# +# All Rights Reserved. +# +# Please see the full Copyright clause at +# +# +# Test file with a variety of legal N-Triples +# +# Dave Beckett - http://purl.org/net/dajobe/ +# +# $Id: test.nt,v 1.7 2003/10/06 15:52:19 dbeckett2 Exp $ +# +##################################################################### + +# comment lines + # comment line after whitespace +# empty blank line, then one with spaces and tabs + + + . +_:anon . + _:anon . +# spaces and tabs throughout: + . + +# line ending with CR NL (ASCII 13, ASCII 10) + . + +# 2 statement lines separated by single CR (ASCII 10) + . + . + + +# All literal escapes + "simple literal" . + "backslash:\\" . + "dquote:\"" . + "newline:\n" . + "return\r" . + "tab:\t" . + +# Space is optional before final . + . + "x". + _:anon. + +# \u and \U escapes +# latin small letter e with acute symbol \u00E9 - 3 UTF-8 bytes #xC3 #A9 + "\u00E9" . +# Euro symbol \u20ac - 3 UTF-8 bytes #xE2 #x82 #xAC + "\u20AC" . +# resource18 test removed +# resource19 test removed +# resource20 test removed + +# XML Literals as Datatyped Literals + ""^^ . + " "^^ . + "x"^^ . + "\""^^ . + ""^^ . + "a "^^ . + "a c"^^ . + "a\n\nc"^^ . + "chat"^^ . +# resource28 test removed 2003-08-03 +# resource29 test removed 2003-08-03 + +# Plain literals with languages + "chat"@fr . + "chat"@en . + +# Typed Literals + "abc"^^ . +# resource33 test removed 2003-08-03 diff --git a/tests/nquads-2013/nt-syntax-uri-01.nq b/tests/nquads-2013/nt-syntax-uri-01.nq new file mode 100644 index 0000000..02e6ba9 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-uri-01.nq @@ -0,0 +1 @@ + . diff --git a/tests/nquads-2013/nt-syntax-uri-02.nq b/tests/nquads-2013/nt-syntax-uri-02.nq new file mode 100644 index 0000000..664feea --- /dev/null +++ b/tests/nquads-2013/nt-syntax-uri-02.nq @@ -0,0 +1,2 @@ +# x53 is capital S + . diff --git a/tests/nquads-2013/nt-syntax-uri-03.nq b/tests/nquads-2013/nt-syntax-uri-03.nq new file mode 100644 index 0000000..b5aeb26 --- /dev/null +++ b/tests/nquads-2013/nt-syntax-uri-03.nq @@ -0,0 +1,2 @@ +# x53 is capital S + . diff --git a/tests/nquads-2013/nt-syntax-uri-04.nq b/tests/nquads-2013/nt-syntax-uri-04.nq new file mode 100644 index 0000000..49bacca --- /dev/null +++ b/tests/nquads-2013/nt-syntax-uri-04.nq @@ -0,0 +1,2 @@ +# IRI with all chars in it. + . diff --git a/tests/ntriples-2013/LITERAL.nt b/tests/ntriples-2013/LITERAL.nt new file mode 100644 index 0000000..3aba89e --- /dev/null +++ b/tests/ntriples-2013/LITERAL.nt @@ -0,0 +1 @@ + "x" . diff --git a/tests/ntriples-2013/LITERAL_all_controls.nt b/tests/ntriples-2013/LITERAL_all_controls.nt new file mode 100644 index 0000000..91c8af1 --- /dev/null +++ b/tests/ntriples-2013/LITERAL_all_controls.nt @@ -0,0 +1 @@ + "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\t\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" . diff --git a/tests/ntriples-2013/LITERAL_all_punctuation.nt b/tests/ntriples-2013/LITERAL_all_punctuation.nt new file mode 100644 index 0000000..c25d818 --- /dev/null +++ b/tests/ntriples-2013/LITERAL_all_punctuation.nt @@ -0,0 +1 @@ + " !\"#$%&():;<=>?@[]^_`{|}~" . diff --git a/tests/ntriples-2013/LITERAL_ascii_boundaries.nt b/tests/ntriples-2013/LITERAL_ascii_boundaries.nt new file mode 100644 index 0000000..7a4dc71 Binary files /dev/null and b/tests/ntriples-2013/LITERAL_ascii_boundaries.nt differ diff --git a/tests/ntriples-2013/LITERAL_with_2_dquotes.nt b/tests/ntriples-2013/LITERAL_with_2_dquotes.nt new file mode 100644 index 0000000..3e69dc1 --- /dev/null +++ b/tests/ntriples-2013/LITERAL_with_2_dquotes.nt @@ -0,0 +1 @@ + "x\"\"y" . diff --git a/tests/ntriples-2013/LITERAL_with_2_squotes.nt b/tests/ntriples-2013/LITERAL_with_2_squotes.nt new file mode 100644 index 0000000..8ddc52e --- /dev/null +++ b/tests/ntriples-2013/LITERAL_with_2_squotes.nt @@ -0,0 +1 @@ + "x''y" . diff --git a/tests/ntriples-2013/LITERAL_with_UTF8_boundaries.nt b/tests/ntriples-2013/LITERAL_with_UTF8_boundaries.nt new file mode 100644 index 0000000..0e1616d --- /dev/null +++ b/tests/ntriples-2013/LITERAL_with_UTF8_boundaries.nt @@ -0,0 +1 @@ + "€߿ࠀ࿿က쿿퀀퟿�𐀀𿿽񀀀󿿽􀀀􏿽" . diff --git a/tests/ntriples-2013/LITERAL_with_dquote.nt b/tests/ntriples-2013/LITERAL_with_dquote.nt new file mode 100644 index 0000000..05a1fd3 --- /dev/null +++ b/tests/ntriples-2013/LITERAL_with_dquote.nt @@ -0,0 +1 @@ + "x\"y" . diff --git a/tests/ntriples-2013/LITERAL_with_squote.nt b/tests/ntriples-2013/LITERAL_with_squote.nt new file mode 100644 index 0000000..acf7f58 --- /dev/null +++ b/tests/ntriples-2013/LITERAL_with_squote.nt @@ -0,0 +1 @@ + "x'y" . diff --git a/tests/ntriples-2013/Makefile.am b/tests/ntriples-2013/Makefile.am new file mode 100644 index 0000000..3696594 --- /dev/null +++ b/tests/ntriples-2013/Makefile.am @@ -0,0 +1,193 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor N-Triples 2013 tests +# +# Copyright (C) 2013, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +RDFCOMPARE=$(srcdir)/../../scripts/rdfcompare + +RDFXML_DIR = ../rdfxml + +TEST_GOOD_FILES = \ + nt-syntax-file-01.nt \ + nt-syntax-file-02.nt \ + nt-syntax-file-03.nt \ + nt-syntax-uri-01.nt \ + nt-syntax-uri-02.nt \ + nt-syntax-uri-03.nt \ + nt-syntax-uri-04.nt \ + nt-syntax-string-01.nt \ + nt-syntax-string-02.nt \ + nt-syntax-string-03.nt \ + nt-syntax-str-esc-01.nt \ + nt-syntax-str-esc-02.nt \ + nt-syntax-str-esc-03.nt \ + nt-syntax-bnode-01.nt \ + nt-syntax-bnode-02.nt \ + nt-syntax-bnode-03.nt \ + nt-syntax-datatypes-01.nt \ + nt-syntax-datatypes-02.nt \ + nt-syntax-subm-01.nt \ + comment_following_triple.nt \ + LITERAL.nt \ + LITERAL_all_controls.nt \ + LITERAL_all_punctuation.nt \ + LITERAL_ascii_boundaries.nt \ + literal_false.nt \ + literal_true.nt \ + LITERAL_with_2_dquotes.nt \ + LITERAL_with_2_squotes.nt \ + literal_with_BACKSPACE.nt \ + literal_with_CARRIAGE_RETURN.nt \ + literal_with_CHARACTER_TABULATION.nt \ + literal_with_FORM_FEED.nt \ + literal_with_LINE_FEED.nt \ + literal_with_REVERSE_SOLIDUS.nt \ + literal_with_REVERSE_SOLIDUS2.nt \ + LITERAL_with_UTF8_boundaries.nt \ + LITERAL_with_dquote.nt \ + literal_with_numeric_escape4.nt \ + literal_with_numeric_escape8.nt \ + LITERAL_with_squote.nt \ + langtagged_string.nt \ + lantag_with_subtag.nt \ + minimal_whitespace.nt + +TEST_BAD_FILES = \ + nt-syntax-bad-uri-01.nt \ + nt-syntax-bad-uri-02.nt \ + nt-syntax-bad-uri-03.nt \ + nt-syntax-bad-uri-04.nt \ + nt-syntax-bad-uri-05.nt \ + nt-syntax-bad-uri-06.nt \ + nt-syntax-bad-uri-07.nt \ + nt-syntax-bad-uri-08.nt \ + nt-syntax-bad-uri-09.nt \ + nt-syntax-bad-prefix-01.nt \ + nt-syntax-bad-base-01.nt \ + nt-syntax-bad-struct-01.nt \ + nt-syntax-bad-struct-02.nt \ + nt-syntax-bad-lang-01.nt \ + nt-syntax-bad-esc-01.nt \ + nt-syntax-bad-esc-02.nt \ + nt-syntax-bad-esc-03.nt \ + nt-syntax-bad-string-01.nt \ + nt-syntax-bad-string-02.nt \ + nt-syntax-bad-string-03.nt \ + nt-syntax-bad-string-04.nt \ + nt-syntax-bad-string-05.nt \ + nt-syntax-bad-string-06.nt \ + nt-syntax-bad-string-07.nt \ + nt-syntax-bad-num-01.nt \ + nt-syntax-bad-num-02.nt \ + nt-syntax-bad-num-03.nt + +# Used to make N-triples output consistent +BASE_URI=http://www.w3.org/2013/N-TriplesTests/ +# for rdf-schema.ttl +RDF_NS_URI=http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI=http://www.w3.org/2000/01/rdf-schema + +ALL_TEST_FILES= \ + $(TEST_GOOD_FILES) \ + $(TEST_BAD_FILES) + +EXTRA_DIST = README \ + $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-good-ntriples check-bad-ntriples + +if MAINTAINER_MODE +check_good_ntriples_deps = $(TEST_GOOD_FILES) +endif + +check-good-ntriples: build-rapper $(check_good_ntriples_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing good N-Triples syntax passes"; \ + for test in $(TEST_GOOD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_bad_ntriples_deps = $(TEST_BAD_FILES) +endif + +check-bad-ntriples: build-rapper $(check_bad_ntriples_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing bad N-Triples fails"; \ + for test in $(TEST_BAD_FILES) ; do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result diff --git a/tests/ntriples-2013/Makefile.in b/tests/ntriples-2013/Makefile.in new file mode 100644 index 0000000..f98441d --- /dev/null +++ b/tests/ntriples-2013/Makefile.in @@ -0,0 +1,678 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor N-Triples 2013 tests +# +# Copyright (C) 2013, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/ntriples-2013 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in README +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +RDFCOMPARE = $(srcdir)/../../scripts/rdfcompare +RDFXML_DIR = ../rdfxml +TEST_GOOD_FILES = \ + nt-syntax-file-01.nt \ + nt-syntax-file-02.nt \ + nt-syntax-file-03.nt \ + nt-syntax-uri-01.nt \ + nt-syntax-uri-02.nt \ + nt-syntax-uri-03.nt \ + nt-syntax-uri-04.nt \ + nt-syntax-string-01.nt \ + nt-syntax-string-02.nt \ + nt-syntax-string-03.nt \ + nt-syntax-str-esc-01.nt \ + nt-syntax-str-esc-02.nt \ + nt-syntax-str-esc-03.nt \ + nt-syntax-bnode-01.nt \ + nt-syntax-bnode-02.nt \ + nt-syntax-bnode-03.nt \ + nt-syntax-datatypes-01.nt \ + nt-syntax-datatypes-02.nt \ + nt-syntax-subm-01.nt \ + comment_following_triple.nt \ + LITERAL.nt \ + LITERAL_all_controls.nt \ + LITERAL_all_punctuation.nt \ + LITERAL_ascii_boundaries.nt \ + literal_false.nt \ + literal_true.nt \ + LITERAL_with_2_dquotes.nt \ + LITERAL_with_2_squotes.nt \ + literal_with_BACKSPACE.nt \ + literal_with_CARRIAGE_RETURN.nt \ + literal_with_CHARACTER_TABULATION.nt \ + literal_with_FORM_FEED.nt \ + literal_with_LINE_FEED.nt \ + literal_with_REVERSE_SOLIDUS.nt \ + literal_with_REVERSE_SOLIDUS2.nt \ + LITERAL_with_UTF8_boundaries.nt \ + LITERAL_with_dquote.nt \ + literal_with_numeric_escape4.nt \ + literal_with_numeric_escape8.nt \ + LITERAL_with_squote.nt \ + langtagged_string.nt \ + lantag_with_subtag.nt \ + minimal_whitespace.nt + +TEST_BAD_FILES = \ + nt-syntax-bad-uri-01.nt \ + nt-syntax-bad-uri-02.nt \ + nt-syntax-bad-uri-03.nt \ + nt-syntax-bad-uri-04.nt \ + nt-syntax-bad-uri-05.nt \ + nt-syntax-bad-uri-06.nt \ + nt-syntax-bad-uri-07.nt \ + nt-syntax-bad-uri-08.nt \ + nt-syntax-bad-uri-09.nt \ + nt-syntax-bad-prefix-01.nt \ + nt-syntax-bad-base-01.nt \ + nt-syntax-bad-struct-01.nt \ + nt-syntax-bad-struct-02.nt \ + nt-syntax-bad-lang-01.nt \ + nt-syntax-bad-esc-01.nt \ + nt-syntax-bad-esc-02.nt \ + nt-syntax-bad-esc-03.nt \ + nt-syntax-bad-string-01.nt \ + nt-syntax-bad-string-02.nt \ + nt-syntax-bad-string-03.nt \ + nt-syntax-bad-string-04.nt \ + nt-syntax-bad-string-05.nt \ + nt-syntax-bad-string-06.nt \ + nt-syntax-bad-string-07.nt \ + nt-syntax-bad-num-01.nt \ + nt-syntax-bad-num-02.nt \ + nt-syntax-bad-num-03.nt + + +# Used to make N-triples output consistent +BASE_URI = http://www.w3.org/2013/N-TriplesTests/ +# for rdf-schema.ttl +RDF_NS_URI = http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI = http://www.w3.org/2000/01/rdf-schema +ALL_TEST_FILES = \ + $(TEST_GOOD_FILES) \ + $(TEST_BAD_FILES) + +EXTRA_DIST = README \ + $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff +@MAINTAINER_MODE_TRUE@check_good_ntriples_deps = $(TEST_GOOD_FILES) +@MAINTAINER_MODE_TRUE@check_bad_ntriples_deps = $(TEST_BAD_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/ntriples-2013/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/ntriples-2013/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-good-ntriples check-bad-ntriples + +check-good-ntriples: build-rapper $(check_good_ntriples_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing good N-Triples syntax passes"; \ + for test in $(TEST_GOOD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result + +check-bad-ntriples: build-rapper $(check_bad_ntriples_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing bad N-Triples fails"; \ + for test in $(TEST_BAD_FILES) ; do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + $(RECHO) "Result: $$errors errors:$$failures"; \ + set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/ntriples-2013/README b/tests/ntriples-2013/README new file mode 100644 index 0000000..12d8bf1 --- /dev/null +++ b/tests/ntriples-2013/README @@ -0,0 +1,25 @@ +This README is for the W3C RDF Working Group's N-Triples test suite. +This test suite contains two kinds of tests: + + Positive syntax (rdft:TestNTriplesPositiveSyntax) - an input N-Triples + file with no syntax errors. + + Negative syntax (rdft:TestNTriplesNegativeSyntax) - an input N-Triples + file with at least one syntax error. + +The manifest.ttl file in this directory lists tests in the +RDF WG's N-Triples test suite. All +tests have a name (mf:name) and an input (mf:action). + +• An implementation passes a positive syntax test if it parses the + input. + +• An implementation passes a negative syntax test if it fails to parse + the input. + +The home of the test suite is . + +See http://www.w3.org/2011/rdf-wg/wiki/RDF_Test_Suites for more details. + +Eric Prud'hommeaux - 11 June 2013. +Gregg Kellogg - 26 June 2013. diff --git a/tests/ntriples-2013/comment_following_triple.nt b/tests/ntriples-2013/comment_following_triple.nt new file mode 100644 index 0000000..5619459 --- /dev/null +++ b/tests/ntriples-2013/comment_following_triple.nt @@ -0,0 +1,5 @@ + . # comment + _:o . # comment + "o" . # comment + "o"^^ . # comment + "o"@en . # comment diff --git a/tests/ntriples-2013/langtagged_string.nt b/tests/ntriples-2013/langtagged_string.nt new file mode 100644 index 0000000..1bddb04 --- /dev/null +++ b/tests/ntriples-2013/langtagged_string.nt @@ -0,0 +1 @@ + "chat"@en . diff --git a/tests/ntriples-2013/lantag_with_subtag.nt b/tests/ntriples-2013/lantag_with_subtag.nt new file mode 100644 index 0000000..629cbf4 --- /dev/null +++ b/tests/ntriples-2013/lantag_with_subtag.nt @@ -0,0 +1 @@ + "Cheers"@en-UK . diff --git a/tests/ntriples-2013/literal_false.nt b/tests/ntriples-2013/literal_false.nt new file mode 100644 index 0000000..5bbbae8 --- /dev/null +++ b/tests/ntriples-2013/literal_false.nt @@ -0,0 +1 @@ + "false"^^ . diff --git a/tests/ntriples-2013/literal_true.nt b/tests/ntriples-2013/literal_true.nt new file mode 100644 index 0000000..054b229 --- /dev/null +++ b/tests/ntriples-2013/literal_true.nt @@ -0,0 +1 @@ + "true"^^ . diff --git a/tests/ntriples-2013/literal_with_BACKSPACE.nt b/tests/ntriples-2013/literal_with_BACKSPACE.nt new file mode 100644 index 0000000..339013d --- /dev/null +++ b/tests/ntriples-2013/literal_with_BACKSPACE.nt @@ -0,0 +1 @@ + "\b" . diff --git a/tests/ntriples-2013/literal_with_CARRIAGE_RETURN.nt b/tests/ntriples-2013/literal_with_CARRIAGE_RETURN.nt new file mode 100644 index 0000000..91b85c8 --- /dev/null +++ b/tests/ntriples-2013/literal_with_CARRIAGE_RETURN.nt @@ -0,0 +1 @@ + "\r" . diff --git a/tests/ntriples-2013/literal_with_CHARACTER_TABULATION.nt b/tests/ntriples-2013/literal_with_CHARACTER_TABULATION.nt new file mode 100644 index 0000000..a6a9d9f --- /dev/null +++ b/tests/ntriples-2013/literal_with_CHARACTER_TABULATION.nt @@ -0,0 +1 @@ + "\t" . diff --git a/tests/ntriples-2013/literal_with_FORM_FEED.nt b/tests/ntriples-2013/literal_with_FORM_FEED.nt new file mode 100644 index 0000000..10d2c6d --- /dev/null +++ b/tests/ntriples-2013/literal_with_FORM_FEED.nt @@ -0,0 +1 @@ + "\f" . diff --git a/tests/ntriples-2013/literal_with_LINE_FEED.nt b/tests/ntriples-2013/literal_with_LINE_FEED.nt new file mode 100644 index 0000000..462f97a --- /dev/null +++ b/tests/ntriples-2013/literal_with_LINE_FEED.nt @@ -0,0 +1 @@ + "\n" . diff --git a/tests/ntriples-2013/literal_with_REVERSE_SOLIDUS.nt b/tests/ntriples-2013/literal_with_REVERSE_SOLIDUS.nt new file mode 100644 index 0000000..ebc846e --- /dev/null +++ b/tests/ntriples-2013/literal_with_REVERSE_SOLIDUS.nt @@ -0,0 +1 @@ + "\\" . diff --git a/tests/ntriples-2013/literal_with_REVERSE_SOLIDUS2.nt b/tests/ntriples-2013/literal_with_REVERSE_SOLIDUS2.nt new file mode 100644 index 0000000..586e364 --- /dev/null +++ b/tests/ntriples-2013/literal_with_REVERSE_SOLIDUS2.nt @@ -0,0 +1 @@ + "test-\\" . diff --git a/tests/ntriples-2013/literal_with_numeric_escape4.nt b/tests/ntriples-2013/literal_with_numeric_escape4.nt new file mode 100644 index 0000000..16f0a03 --- /dev/null +++ b/tests/ntriples-2013/literal_with_numeric_escape4.nt @@ -0,0 +1 @@ + "\u006F" . diff --git a/tests/ntriples-2013/literal_with_numeric_escape8.nt b/tests/ntriples-2013/literal_with_numeric_escape8.nt new file mode 100644 index 0000000..e909a79 --- /dev/null +++ b/tests/ntriples-2013/literal_with_numeric_escape8.nt @@ -0,0 +1 @@ + "\U0000006F" . diff --git a/tests/ntriples-2013/minimal_whitespace.nt b/tests/ntriples-2013/minimal_whitespace.nt new file mode 100644 index 0000000..e9e3a80 --- /dev/null +++ b/tests/ntriples-2013/minimal_whitespace.nt @@ -0,0 +1,6 @@ +. +"Alice". +_:o. +_:s. +_:s"Alice". +_:s_:bnode1. diff --git a/tests/ntriples-2013/nt-syntax-bad-base-01.nt b/tests/ntriples-2013/nt-syntax-bad-base-01.nt new file mode 100644 index 0000000..dff1b3b --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-base-01.nt @@ -0,0 +1 @@ +@base . diff --git a/tests/ntriples-2013/nt-syntax-bad-esc-01.nt b/tests/ntriples-2013/nt-syntax-bad-esc-01.nt new file mode 100644 index 0000000..f7a88ad --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-esc-01.nt @@ -0,0 +1,2 @@ +# Bad string escape + "a\zb" . diff --git a/tests/ntriples-2013/nt-syntax-bad-esc-02.nt b/tests/ntriples-2013/nt-syntax-bad-esc-02.nt new file mode 100644 index 0000000..72711d4 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-esc-02.nt @@ -0,0 +1,2 @@ +# Bad string escape + "\uWXYZ" . diff --git a/tests/ntriples-2013/nt-syntax-bad-esc-03.nt b/tests/ntriples-2013/nt-syntax-bad-esc-03.nt new file mode 100644 index 0000000..3a4522f --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-esc-03.nt @@ -0,0 +1,2 @@ +# Bad string escape + "\U0000WXYZ" . diff --git a/tests/ntriples-2013/nt-syntax-bad-lang-01.nt b/tests/ntriples-2013/nt-syntax-bad-lang-01.nt new file mode 100644 index 0000000..a4d952c --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-lang-01.nt @@ -0,0 +1,2 @@ +# Bad lang tag + "string"@1 . diff --git a/tests/ntriples-2013/nt-syntax-bad-num-01.nt b/tests/ntriples-2013/nt-syntax-bad-num-01.nt new file mode 100644 index 0000000..2be6f51 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-num-01.nt @@ -0,0 +1 @@ + 1 . diff --git a/tests/ntriples-2013/nt-syntax-bad-num-02.nt b/tests/ntriples-2013/nt-syntax-bad-num-02.nt new file mode 100644 index 0000000..e1d5b06 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-num-02.nt @@ -0,0 +1 @@ + 1.0 . diff --git a/tests/ntriples-2013/nt-syntax-bad-num-03.nt b/tests/ntriples-2013/nt-syntax-bad-num-03.nt new file mode 100644 index 0000000..a9be82f --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-num-03.nt @@ -0,0 +1 @@ + 1.0e0 . diff --git a/tests/ntriples-2013/nt-syntax-bad-prefix-01.nt b/tests/ntriples-2013/nt-syntax-bad-prefix-01.nt new file mode 100644 index 0000000..89e08cc --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-prefix-01.nt @@ -0,0 +1 @@ +@prefix : . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-01.nt b/tests/ntriples-2013/nt-syntax-bad-string-01.nt new file mode 100644 index 0000000..988af87 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-01.nt @@ -0,0 +1 @@ + "abc' . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-02.nt b/tests/ntriples-2013/nt-syntax-bad-string-02.nt new file mode 100644 index 0000000..e1d5b06 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-02.nt @@ -0,0 +1 @@ + 1.0 . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-03.nt b/tests/ntriples-2013/nt-syntax-bad-string-03.nt new file mode 100644 index 0000000..64d343d --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-03.nt @@ -0,0 +1 @@ + 1.0e1 . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-04.nt b/tests/ntriples-2013/nt-syntax-bad-string-04.nt new file mode 100644 index 0000000..af4ff28 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-04.nt @@ -0,0 +1 @@ + '''abc''' . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-05.nt b/tests/ntriples-2013/nt-syntax-bad-string-05.nt new file mode 100644 index 0000000..75ad4b2 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-05.nt @@ -0,0 +1 @@ + """abc""" . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-06.nt b/tests/ntriples-2013/nt-syntax-bad-string-06.nt new file mode 100644 index 0000000..56dcbc6 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-06.nt @@ -0,0 +1 @@ + "abc . diff --git a/tests/ntriples-2013/nt-syntax-bad-string-07.nt b/tests/ntriples-2013/nt-syntax-bad-string-07.nt new file mode 100644 index 0000000..7f1ee80 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-string-07.nt @@ -0,0 +1 @@ + abc" . diff --git a/tests/ntriples-2013/nt-syntax-bad-struct-01.nt b/tests/ntriples-2013/nt-syntax-bad-struct-01.nt new file mode 100644 index 0000000..d546d56 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-struct-01.nt @@ -0,0 +1 @@ + , . diff --git a/tests/ntriples-2013/nt-syntax-bad-struct-02.nt b/tests/ntriples-2013/nt-syntax-bad-struct-02.nt new file mode 100644 index 0000000..1f388c6 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-struct-02.nt @@ -0,0 +1 @@ + ; , . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-01.nt b/tests/ntriples-2013/nt-syntax-bad-uri-01.nt new file mode 100644 index 0000000..0e69dc0 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-01.nt @@ -0,0 +1,2 @@ +# Bad IRI : space. + . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-02.nt b/tests/ntriples-2013/nt-syntax-bad-uri-02.nt new file mode 100644 index 0000000..36d91af --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-02.nt @@ -0,0 +1,2 @@ +# Bad IRI : bad escape + . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-03.nt b/tests/ntriples-2013/nt-syntax-bad-uri-03.nt new file mode 100644 index 0000000..f512345 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-03.nt @@ -0,0 +1,2 @@ +# Bad IRI : bad escape + . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-04.nt b/tests/ntriples-2013/nt-syntax-bad-uri-04.nt new file mode 100644 index 0000000..5cab062 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-04.nt @@ -0,0 +1,2 @@ +# Bad IRI : character escapes not allowed. + . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-05.nt b/tests/ntriples-2013/nt-syntax-bad-uri-05.nt new file mode 100644 index 0000000..be0a21e --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-05.nt @@ -0,0 +1,2 @@ +# Bad IRI : character escapes not allowed. + . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-06.nt b/tests/ntriples-2013/nt-syntax-bad-uri-06.nt new file mode 100644 index 0000000..b4e6459 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-06.nt @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples + . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-07.nt b/tests/ntriples-2013/nt-syntax-bad-uri-07.nt new file mode 100644 index 0000000..74534dd --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-07.nt @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples +

. diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-08.nt b/tests/ntriples-2013/nt-syntax-bad-uri-08.nt new file mode 100644 index 0000000..41a953d --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-08.nt @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples + . diff --git a/tests/ntriples-2013/nt-syntax-bad-uri-09.nt b/tests/ntriples-2013/nt-syntax-bad-uri-09.nt new file mode 100644 index 0000000..58821da --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bad-uri-09.nt @@ -0,0 +1,2 @@ +# No relative IRIs in N-Triples + "foo"^^

. diff --git a/tests/ntriples-2013/nt-syntax-bnode-01.nt b/tests/ntriples-2013/nt-syntax-bnode-01.nt new file mode 100644 index 0000000..5fb0d0f --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bnode-01.nt @@ -0,0 +1 @@ +_:a . diff --git a/tests/ntriples-2013/nt-syntax-bnode-02.nt b/tests/ntriples-2013/nt-syntax-bnode-02.nt new file mode 100644 index 0000000..737e81b --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bnode-02.nt @@ -0,0 +1,2 @@ + _:a . +_:a . diff --git a/tests/ntriples-2013/nt-syntax-bnode-03.nt b/tests/ntriples-2013/nt-syntax-bnode-03.nt new file mode 100644 index 0000000..1a1f1c9 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-bnode-03.nt @@ -0,0 +1,2 @@ + _:1a . +_:1a . diff --git a/tests/ntriples-2013/nt-syntax-datatypes-01.nt b/tests/ntriples-2013/nt-syntax-datatypes-01.nt new file mode 100644 index 0000000..9126309 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-datatypes-01.nt @@ -0,0 +1 @@ + "123"^^ . diff --git a/tests/ntriples-2013/nt-syntax-datatypes-02.nt b/tests/ntriples-2013/nt-syntax-datatypes-02.nt new file mode 100644 index 0000000..d49cc27 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-datatypes-02.nt @@ -0,0 +1 @@ + "123"^^ . diff --git a/tests/ntriples-2013/nt-syntax-file-01.nt b/tests/ntriples-2013/nt-syntax-file-01.nt new file mode 100644 index 0000000..e69de29 diff --git a/tests/ntriples-2013/nt-syntax-file-02.nt b/tests/ntriples-2013/nt-syntax-file-02.nt new file mode 100644 index 0000000..e6d327d --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-file-02.nt @@ -0,0 +1 @@ +#Empty file. diff --git a/tests/ntriples-2013/nt-syntax-file-03.nt b/tests/ntriples-2013/nt-syntax-file-03.nt new file mode 100644 index 0000000..a9ca035 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-file-03.nt @@ -0,0 +1,2 @@ +#One comment, one empty line. + diff --git a/tests/ntriples-2013/nt-syntax-str-esc-01.nt b/tests/ntriples-2013/nt-syntax-str-esc-01.nt new file mode 100644 index 0000000..3925f2e --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-str-esc-01.nt @@ -0,0 +1 @@ + "a\n" . diff --git a/tests/ntriples-2013/nt-syntax-str-esc-02.nt b/tests/ntriples-2013/nt-syntax-str-esc-02.nt new file mode 100644 index 0000000..e7d032f --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-str-esc-02.nt @@ -0,0 +1 @@ + "a\u0020b" . diff --git a/tests/ntriples-2013/nt-syntax-str-esc-03.nt b/tests/ntriples-2013/nt-syntax-str-esc-03.nt new file mode 100644 index 0000000..b8588c7 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-str-esc-03.nt @@ -0,0 +1 @@ + "a\U00000020b" . diff --git a/tests/ntriples-2013/nt-syntax-string-01.nt b/tests/ntriples-2013/nt-syntax-string-01.nt new file mode 100644 index 0000000..5333aef --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-string-01.nt @@ -0,0 +1 @@ + "string" . diff --git a/tests/ntriples-2013/nt-syntax-string-02.nt b/tests/ntriples-2013/nt-syntax-string-02.nt new file mode 100644 index 0000000..1ab55a3 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-string-02.nt @@ -0,0 +1 @@ + "string"@en . diff --git a/tests/ntriples-2013/nt-syntax-string-03.nt b/tests/ntriples-2013/nt-syntax-string-03.nt new file mode 100644 index 0000000..b34ca0f --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-string-03.nt @@ -0,0 +1 @@ + "string"@en-uk . diff --git a/tests/ntriples-2013/nt-syntax-subm-01.nt b/tests/ntriples-2013/nt-syntax-subm-01.nt new file mode 100644 index 0000000..91b4988 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-subm-01.nt @@ -0,0 +1,79 @@ +# +# Copyright World Wide Web Consortium, (Massachusetts Institute of +# Technology, Institut National de Recherche en Informatique et en +# Automatique, Keio University). +# +# All Rights Reserved. +# +# Please see the full Copyright clause at +# +# +# Test file with a variety of legal N-Triples +# +# Dave Beckett - http://purl.org/net/dajobe/ +# +# $Id: test.nt,v 1.7 2003/10/06 15:52:19 dbeckett2 Exp $ +# +##################################################################### + +# comment lines + # comment line after whitespace +# empty blank line, then one with spaces and tabs + + + . +_:anon . + _:anon . +# spaces and tabs throughout: + . + +# line ending with CR NL (ASCII 13, ASCII 10) + . + +# 2 statement lines separated by single CR (ASCII 10) + . + . + + +# All literal escapes + "simple literal" . + "backslash:\\" . + "dquote:\"" . + "newline:\n" . + "return\r" . + "tab:\t" . + +# Space is optional before final . + . + "x". + _:anon. + +# \u and \U escapes +# latin small letter e with acute symbol \u00E9 - 3 UTF-8 bytes #xC3 #A9 + "\u00E9" . +# Euro symbol \u20ac - 3 UTF-8 bytes #xE2 #x82 #xAC + "\u20AC" . +# resource18 test removed +# resource19 test removed +# resource20 test removed + +# XML Literals as Datatyped Literals + ""^^ . + " "^^ . + "x"^^ . + "\""^^ . + ""^^ . + "a "^^ . + "a c"^^ . + "a\n\nc"^^ . + "chat"^^ . +# resource28 test removed 2003-08-03 +# resource29 test removed 2003-08-03 + +# Plain literals with languages + "chat"@fr . + "chat"@en . + +# Typed Literals + "abc"^^ . +# resource33 test removed 2003-08-03 diff --git a/tests/ntriples-2013/nt-syntax-uri-01.nt b/tests/ntriples-2013/nt-syntax-uri-01.nt new file mode 100644 index 0000000..02e6ba9 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-uri-01.nt @@ -0,0 +1 @@ + . diff --git a/tests/ntriples-2013/nt-syntax-uri-02.nt b/tests/ntriples-2013/nt-syntax-uri-02.nt new file mode 100644 index 0000000..664feea --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-uri-02.nt @@ -0,0 +1,2 @@ +# x53 is capital S + . diff --git a/tests/ntriples-2013/nt-syntax-uri-03.nt b/tests/ntriples-2013/nt-syntax-uri-03.nt new file mode 100644 index 0000000..b5aeb26 --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-uri-03.nt @@ -0,0 +1,2 @@ +# x53 is capital S + . diff --git a/tests/ntriples-2013/nt-syntax-uri-04.nt b/tests/ntriples-2013/nt-syntax-uri-04.nt new file mode 100644 index 0000000..49bacca --- /dev/null +++ b/tests/ntriples-2013/nt-syntax-uri-04.nt @@ -0,0 +1,2 @@ +# IRI with all chars in it. + . diff --git a/tests/ntriples/CMakeLists.txt b/tests/ntriples/CMakeLists.txt new file mode 100644 index 0000000..f22c2e7 --- /dev/null +++ b/tests/ntriples/CMakeLists.txt @@ -0,0 +1,53 @@ +# raptor/tests/ntriples/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +RAPPER_TEST(ntriples.test + "${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/test.nt http://librdf.org/raptor/tests/test.nt" + test.res + ${CMAKE_CURRENT_SOURCE_DIR}/test.out +) + +ADD_TEST(ntriples.bad-00 ${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-00.nt http://librdf.org/raptor/tests/bad-00.nt) # WILL_FAIL +ADD_TEST(ntriples.bad-01 ${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-01.nt http://librdf.org/raptor/tests/bad-01.nt) # WILL_FAIL +ADD_TEST(ntriples.bad-02 ${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-02.nt http://librdf.org/raptor/tests/bad-02.nt) # WILL_FAIL +ADD_TEST(ntriples.bad-03 ${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-03.nt http://librdf.org/raptor/tests/bad-03.nt) # WILL_FAIL +ADD_TEST(ntriples.bad-04 ${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-04.nt http://librdf.org/raptor/tests/bad-04.nt) # WILL_FAIL +ADD_TEST(ntriples.bad-05 ${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-05.nt http://librdf.org/raptor/tests/bad-05.nt) # WILL_FAIL +ADD_TEST(ntriples.bad-06 ${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-06.nt http://librdf.org/raptor/tests/bad-06.nt) # WILL_FAIL +ADD_TEST(ntriples.bad-07 ${RAPPER} -q -i ntriples -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-07.nt http://librdf.org/raptor/tests/bad-07.nt) # WILL_FAIL + +SET_TESTS_PROPERTIES( + ntriples.bad-00 + ntriples.bad-01 + ntriples.bad-02 + ntriples.bad-03 + ntriples.bad-04 + ntriples.bad-05 + ntriples.bad-06 + ntriples.bad-07 + PROPERTIES + WILL_FAIL TRUE +) + +RAPPER_TEST(ntriples.testnq-1 + "${RAPPER} -q -i nquads -o nquads file:${CMAKE_CURRENT_SOURCE_DIR}/testnq-1.nq http://librdf.org/raptor/tests/testnq-1.nq" + testnq-1.res + ${CMAKE_CURRENT_SOURCE_DIR}/testnq-1.out +) + +RAPPER_TEST(ntriples.testnq-optional-context + "${RAPPER} -q -i nquads -o nquads file:${CMAKE_CURRENT_SOURCE_DIR}/testnq-optional-context.nq http://librdf.org/raptor/tests/testnq-optional-context.nq" + testnq-optional-context.res + ${CMAKE_CURRENT_SOURCE_DIR}/testnq-optional-context.out +) + +RAPPER_TEST(ntriples.bug-481 + "${RAPPER} -q -i nquads -o nquads file:${CMAKE_CURRENT_SOURCE_DIR}/bug-481.nq http://librdf.org/raptor/tests/bug-481.nq" + bug-481.res + ${CMAKE_CURRENT_SOURCE_DIR}/bug-481.out +) + +# end raptor/tests/ntriples/CMakeLists.txt diff --git a/tests/ntriples/Makefile.am b/tests/ntriples/Makefile.am new file mode 100644 index 0000000..9310865 --- /dev/null +++ b/tests/ntriples/Makefile.am @@ -0,0 +1,164 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor N-Triples tests +# +# Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +NT_TEST_FILES = test.nt \ +nt2013-ex1.nt \ +nt2013-ex2.nt \ +nt2013-ex3.nt \ +nt2013-ex4.nt \ +bug-562.nt \ +bug-574.nt \ +bug-577.nt + +NT_OUT_FILES = test.out \ +nt2013-ex1.out \ +nt2013-ex2.out \ +nt2013-ex3.out \ +nt2013-ex4.out \ +bug-562.out \ +bug-574.out \ +bug-577.out + +NT_BAD_TEST_FILES=bad-00.nt bad-02.nt bad-03.nt bad-04.nt \ +bad-05.nt bad-06.nt bad-07.nt + +NQ_TEST_FILES=testnq-1.nq testnq-optional-context.nq bug-481.nq + +NQ_OUT_FILES=testnq-1.out testnq-optional-context.out bug-481.out + +# Used to make N-triples output consistent +BASE_URI=http://librdf.org/raptor/tests/ + +EXTRA_DIST = \ + CMakeLists.txt \ + $(NT_TEST_FILES) \ + $(NT_OUT_FILES) \ + $(NT_BAD_TEST_FILES) \ + $(NQ_TEST_FILES) \ + $(NQ_OUT_FILES) + +CLEANFILES = CMakeTests.txt CMakeTmp.txt + +RAPPER = $(top_builddir)/utils/rapper + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +check-local: build-rapper \ +check-nt check-bad-nt check-nq + +if MAINTAINER_MODE +check_nt_deps = $(NT_TEST_FILES) +endif + +check-nt: build-rapper $(check_nt_deps) + @set +e; result=0; \ + $(RECHO) "Testing N-Triples"; \ + for test in $(NT_TEST_FILES); do \ + name=`basename $$test .nt` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $(BASE_URI)$$test > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -ne 0 ; then \ + $(RECHO) "FAILED"; \ + cat $$name.err; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + ntriples.$$name \ + "\$${RAPPER} -q -i ntriples -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $(BASE_URI)$$test" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_bad_nt_deps = $(NT_BAD_TEST_FILES) +endif + +check-bad-nt: build-rapper $(check_bad_nt_deps) + @set +e; result=0; \ + $(RECHO) "Testing that bad N-Triples fails"; \ + for test in $(NT_BAD_TEST_FILES); do \ + name=`basename $$test .nt` ; \ + baseuri=$(BASE_URI)$$name.nt; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; \ + cat $$name.res; grep Warning $$name.err; result=1; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; \ + cat $$name.res; result=1; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'ADD_TEST(%s %s) # WILL_FAIL\n' \ + ntriples.$$name \ + "\$${RAPPER} -q -i ntriples -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" >>CMakeTests.txt; \ + printf '\t%s\n' ntriples.$$name >>CMakeTmp.txt; \ + done; \ + (printf '\nSET_TESTS_PROPERTIES(\n'; \ + cat CMakeTmp.txt; \ + printf '\tPROPERTIES\n\tWILL_FAIL TRUE\n)\n\n') >>CMakeTests.txt; \ + rm -f CMakeTmp.txt; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_nq_deps = $(NQ_TEST_FILES) +endif + +check-nq: build-rapper $(check_nq_deps) + @set +e; result=0; \ + $(RECHO) "Testing N-Quads"; \ + for test in $(NQ_TEST_FILES); do \ + name=`basename $$test .nq` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $(BASE_URI)$$test > $$name.res 2>/dev/null; \ + if cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + ntriples.$$name \ + "\$${RAPPER} -q -i nquads -o nquads file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $(BASE_URI)$$test" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +print-nt-test-files: + @echo $(NT_TEST_FILES) | tr ' ' '\012' diff --git a/tests/ntriples/Makefile.in b/tests/ntriples/Makefile.in new file mode 100644 index 0000000..e69105e --- /dev/null +++ b/tests/ntriples/Makefile.in @@ -0,0 +1,646 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor N-Triples tests +# +# Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/ntriples +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +NT_TEST_FILES = test.nt \ +nt2013-ex1.nt \ +nt2013-ex2.nt \ +nt2013-ex3.nt \ +nt2013-ex4.nt \ +bug-562.nt \ +bug-574.nt \ +bug-577.nt + +NT_OUT_FILES = test.out \ +nt2013-ex1.out \ +nt2013-ex2.out \ +nt2013-ex3.out \ +nt2013-ex4.out \ +bug-562.out \ +bug-574.out \ +bug-577.out + +NT_BAD_TEST_FILES = bad-00.nt bad-02.nt bad-03.nt bad-04.nt \ +bad-05.nt bad-06.nt bad-07.nt + +NQ_TEST_FILES = testnq-1.nq testnq-optional-context.nq bug-481.nq +NQ_OUT_FILES = testnq-1.out testnq-optional-context.out bug-481.out + +# Used to make N-triples output consistent +BASE_URI = http://librdf.org/raptor/tests/ +EXTRA_DIST = \ + CMakeLists.txt \ + $(NT_TEST_FILES) \ + $(NT_OUT_FILES) \ + $(NT_BAD_TEST_FILES) \ + $(NQ_TEST_FILES) \ + $(NQ_OUT_FILES) + +CLEANFILES = CMakeTests.txt CMakeTmp.txt +RAPPER = $(top_builddir)/utils/rapper +@MAINTAINER_MODE_TRUE@check_nt_deps = $(NT_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_bad_nt_deps = $(NT_BAD_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_nq_deps = $(NQ_TEST_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/ntriples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/ntriples/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +check-local: build-rapper \ +check-nt check-bad-nt check-nq + +check-nt: build-rapper $(check_nt_deps) + @set +e; result=0; \ + $(RECHO) "Testing N-Triples"; \ + for test in $(NT_TEST_FILES); do \ + name=`basename $$test .nt` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $(BASE_URI)$$test > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -ne 0 ; then \ + $(RECHO) "FAILED"; \ + cat $$name.err; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + ntriples.$$name \ + "\$${RAPPER} -q -i ntriples -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $(BASE_URI)$$test" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +check-bad-nt: build-rapper $(check_bad_nt_deps) + @set +e; result=0; \ + $(RECHO) "Testing that bad N-Triples fails"; \ + for test in $(NT_BAD_TEST_FILES); do \ + name=`basename $$test .nt` ; \ + baseuri=$(BASE_URI)$$name.nt; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; \ + cat $$name.res; grep Warning $$name.err; result=1; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; \ + cat $$name.res; result=1; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'ADD_TEST(%s %s) # WILL_FAIL\n' \ + ntriples.$$name \ + "\$${RAPPER} -q -i ntriples -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" >>CMakeTests.txt; \ + printf '\t%s\n' ntriples.$$name >>CMakeTmp.txt; \ + done; \ + (printf '\nSET_TESTS_PROPERTIES(\n'; \ + cat CMakeTmp.txt; \ + printf '\tPROPERTIES\n\tWILL_FAIL TRUE\n)\n\n') >>CMakeTests.txt; \ + rm -f CMakeTmp.txt; \ + set -e; exit $$result + +check-nq: build-rapper $(check_nq_deps) + @set +e; result=0; \ + $(RECHO) "Testing N-Quads"; \ + for test in $(NQ_TEST_FILES); do \ + name=`basename $$test .nq` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i nquads -o nquads file:$(srcdir)/$$test $(BASE_URI)$$test > $$name.res 2>/dev/null; \ + if cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + ntriples.$$name \ + "\$${RAPPER} -q -i nquads -o nquads file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $(BASE_URI)$$test" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +print-nt-test-files: + @echo $(NT_TEST_FILES) | tr ' ' '\012' + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/ntriples/bad-00.nt b/tests/ntriples/bad-00.nt new file mode 100644 index 0000000..9de91e2 --- /dev/null +++ b/tests/ntriples/bad-00.nt @@ -0,0 +1 @@ +_: "blah" . diff --git a/tests/ntriples/bad-02.nt b/tests/ntriples/bad-02.nt new file mode 100644 index 0000000..64c1dfb --- /dev/null +++ b/tests/ntriples/bad-02.nt @@ -0,0 +1 @@ +_:a "blah . diff --git a/tests/ntriples/bad-04.nt b/tests/ntriples/bad-04.nt new file mode 100644 index 0000000..64c1dfb --- /dev/null +++ b/tests/ntriples/bad-04.nt @@ -0,0 +1 @@ +_:a "\U00110000" . diff --git a/tests/ntriples/bad-06.nt b/tests/ntriples/bad-06.nt new file mode 100644 index 0000000..ac35f18 --- /dev/null +++ b/tests/ntriples/bad-06.nt @@ -0,0 +1 @@ + . diff --git a/tests/ntriples/bad-07.nt b/tests/ntriples/bad-07.nt new file mode 100644 index 0000000..732f69c --- /dev/null +++ b/tests/ntriples/bad-07.nt @@ -0,0 +1 @@ + xml"bar" . diff --git a/tests/ntriples/bug-481.nq b/tests/ntriples/bug-481.nq new file mode 100644 index 0000000..be20395 --- /dev/null +++ b/tests/ntriples/bug-481.nq @@ -0,0 +1 @@ +_:httpx3Ax2Fx2Fapix2Ehi5x2Ecomx2Frestx2Fprofilex2Ffoafx2F504083723xxbnode229 "\u0102\uD838\uDF06\u0941\u04EANONGJEE\u04EA\u0941\uD838\uDF06\u0102" . diff --git a/tests/ntriples/bug-481.out b/tests/ntriples/bug-481.out new file mode 100644 index 0000000..be20395 --- /dev/null +++ b/tests/ntriples/bug-481.out @@ -0,0 +1 @@ +_:httpx3Ax2Fx2Fapix2Ehi5x2Ecomx2Frestx2Fprofilex2Ffoafx2F504083723xxbnode229 "\u0102\uD838\uDF06\u0941\u04EANONGJEE\u04EA\u0941\uD838\uDF06\u0102" . diff --git a/tests/ntriples/bug-562.nt b/tests/ntriples/bug-562.nt new file mode 100644 index 0000000..422efeb --- /dev/null +++ b/tests/ntriples/bug-562.nt @@ -0,0 +1,2 @@ +_:b . +_:b _:c . diff --git a/tests/ntriples/bug-562.out b/tests/ntriples/bug-562.out new file mode 100644 index 0000000..422efeb --- /dev/null +++ b/tests/ntriples/bug-562.out @@ -0,0 +1,2 @@ +_:b . +_:b _:c . diff --git a/tests/ntriples/bug-574.nt b/tests/ntriples/bug-574.nt new file mode 100644 index 0000000..9f20497 --- /dev/null +++ b/tests/ntriples/bug-574.nt @@ -0,0 +1 @@ + "SOMETHING"@zh_pinyin . diff --git a/tests/ntriples/bug-574.out b/tests/ntriples/bug-574.out new file mode 100644 index 0000000..09aa702 --- /dev/null +++ b/tests/ntriples/bug-574.out @@ -0,0 +1 @@ + "SOMETHING"@zh-pinyin . diff --git a/tests/ntriples/bug-577.nt b/tests/ntriples/bug-577.nt new file mode 100644 index 0000000..2e5495e --- /dev/null +++ b/tests/ntriples/bug-577.nt @@ -0,0 +1,38 @@ + "escape for 1" . + "escape for 2" . + "escape for 3" . + "escape for 4" . + "escape for 5" . + "escape for 6" . + "escape for 7" . + "escape for 8" . + "escape for 9" . + "escape for 10" . + "escape for 11" . + "escape for 12" . + "escape for 13" . + "escape for 14" . + "escape for 15" . + "escape for 16" . + "escape for 17" . + "escape for 18" . + "escape for 19" . + "escape for 20" . + "escape for 21" . + "escape for 22" . + "escape for 23" . + "escape for 24" . + "escape for 25" . + "escape for 26" . + "escape for 27" . + "escape for 28" . + "escape for 29" . + "escape for 30" . + "escape for 31" . + + "escape for 123" . + "escape for 125" . + "escape for 124" . + "escape for 94" . + "escape for 96" . + "escape for 92" . diff --git a/tests/ntriples/bug-577.out b/tests/ntriples/bug-577.out new file mode 100644 index 0000000..5789e3b --- /dev/null +++ b/tests/ntriples/bug-577.out @@ -0,0 +1,37 @@ + "escape for 1" . + "escape for 2" . + "escape for 3" . + "escape for 4" . + "escape for 5" . + "escape for 6" . + "escape for 7" . + "escape for 8" . + "escape for 9" . + "escape for 10" . + "escape for 11" . + "escape for 12" . + "escape for 13" . + "escape for 14" . + "escape for 15" . + "escape for 16" . + "escape for 17" . + "escape for 18" . + "escape for 19" . + "escape for 20" . + "escape for 21" . + "escape for 22" . + "escape for 23" . + "escape for 24" . + "escape for 25" . + "escape for 26" . + "escape for 27" . + "escape for 28" . + "escape for 29" . + "escape for 30" . + "escape for 31" . + "escape for 123" . + "escape for 125" . + "escape for 124" . + "escape for 94" . + "escape for 96" . + "escape for 92" . diff --git a/tests/ntriples/nt2013-ex1.nt b/tests/ntriples/nt2013-ex1.nt new file mode 100644 index 0000000..9b004b4 --- /dev/null +++ b/tests/ntriples/nt2013-ex1.nt @@ -0,0 +1,4 @@ + . # comments here +# or on a line by themselves +_:subject1 "object1" . +_:subject2 "object2" . diff --git a/tests/ntriples/nt2013-ex1.out b/tests/ntriples/nt2013-ex1.out new file mode 100644 index 0000000..62d85f9 --- /dev/null +++ b/tests/ntriples/nt2013-ex1.out @@ -0,0 +1,3 @@ + . +_:subject1 "object1" . +_:subject2 "object2" . diff --git a/tests/ntriples/nt2013-ex2.nt b/tests/ntriples/nt2013-ex2.nt new file mode 100644 index 0000000..808d8df --- /dev/null +++ b/tests/ntriples/nt2013-ex2.nt @@ -0,0 +1 @@ + . diff --git a/tests/ntriples/nt2013-ex2.out b/tests/ntriples/nt2013-ex2.out new file mode 100644 index 0000000..808d8df --- /dev/null +++ b/tests/ntriples/nt2013-ex2.out @@ -0,0 +1 @@ + . diff --git a/tests/ntriples/nt2013-ex3.nt b/tests/ntriples/nt2013-ex3.nt new file mode 100644 index 0000000..f53611d --- /dev/null +++ b/tests/ntriples/nt2013-ex3.nt @@ -0,0 +1,8 @@ + "That Seventies Show"^^ . # literal with XML Schema string datatype + "That Seventies Show" . # same as above + "That Seventies Show"@en . # literal with a language tag + "Cette Série des Années Septante"@fr-be . # literal outside of ASCII range with a region subtag + "This is a multi-line\nliteral with many quotes (\"\"\"\"\")\nand two apostrophes ('')." . + "2"^^ . # xsd:integer + "1.663E-4"^^ . # xsd:double + diff --git a/tests/ntriples/nt2013-ex3.out b/tests/ntriples/nt2013-ex3.out new file mode 100644 index 0000000..c057085 --- /dev/null +++ b/tests/ntriples/nt2013-ex3.out @@ -0,0 +1,7 @@ + "That Seventies Show"^^ . + "That Seventies Show" . + "That Seventies Show"@en . + "Cette S\u00E9rie des Ann\u00E9es Septante"@fr-be . + "This is a multi-line\nliteral with many quotes (\"\"\"\"\")\nand two apostrophes ('')." . + "2"^^ . + "1.663E-4"^^ . diff --git a/tests/ntriples/nt2013-ex4.nt b/tests/ntriples/nt2013-ex4.nt new file mode 100644 index 0000000..4dcbf20 --- /dev/null +++ b/tests/ntriples/nt2013-ex4.nt @@ -0,0 +1,2 @@ +_:alice _:bob . +_:bob _:alice . diff --git a/tests/ntriples/nt2013-ex4.out b/tests/ntriples/nt2013-ex4.out new file mode 100644 index 0000000..4dcbf20 --- /dev/null +++ b/tests/ntriples/nt2013-ex4.out @@ -0,0 +1,2 @@ +_:alice _:bob . +_:bob _:alice . diff --git a/tests/ntriples/test.nt b/tests/ntriples/test.nt new file mode 100644 index 0000000..e74f1ec --- /dev/null +++ b/tests/ntriples/test.nt @@ -0,0 +1,66 @@ +# +# N-Triples Test Cases +# Dave Beckett - http://purl.org/net/dajobe/ +# +# $Id$ +# +# comment lines + # comment line after whitespace +# empty blank line, then one with spaces and tabs + + + . +_:anon . + _:anon . +# spaces and tabs throughout: + . + +# line ending with CR NL (ASCII 13, ASCII 10) + . + +# 2 statement lines separated by single CR (ASCII 10) + . . + + +# All literal escapes + "simple literal" . + "backslash:\\" . + "dquote:\"" . + "newline:\n" . + "return\r" . + "tab:\t" . + +# Space is optional before final . + . + "x". +# space is required after bnode ID before final . + _:anon . + +# \u and \U escapes +# latin small letter e with acute symbol \u00E9 - 3 UTF-8 bytes #xC3 #A9 + "\u00E9" . +# Euro symbol \u20ac - 3 UTF-8 bytes #xE2 #x82 #xAC + "\u20AC" . +# ? symbol \U0010FFFF - 4 UTF-8 bytes #xF4 #x8F #xBF #xBF + "\U0010FFFF" . + +# extended literal syntax - parseType="Literal" (XML) + ""^^ . + " "^^ . + "x"^^ . + "\""^^ . + ""^^ . + "a "^^ . + "a c"^^ . + "a\n\nc"^^ . + "chat"^^ . +# resource28 removed 2003-08-03 +# resource29 removed 2003-08-03 + +# literals with languages + "chat"@fr . + "chat"@en . + +# Datatype Literals + "abc"^^ . +# resource33 removed 2003-08-03 diff --git a/tests/ntriples/test.out b/tests/ntriples/test.out new file mode 100644 index 0000000..266ee3f --- /dev/null +++ b/tests/ntriples/test.out @@ -0,0 +1,31 @@ + . +_:anon . + _:anon . + . + . + . + . + "simple literal" . + "backslash:\\" . + "dquote:\"" . + "newline:\n" . + "return\r" . + "tab:\t" . + . + "x" . + _:anon . + "\u00E9" . + "\u20AC" . + "\U0010FFFF" . + ""^^ . + " "^^ . + "x"^^ . + "\""^^ . + ""^^ . + "a "^^ . + "a c"^^ . + "a\n\nc"^^ . + "chat"^^ . + "chat"@fr . + "chat"@en . + "abc"^^ . diff --git a/tests/ntriples/testnq-1.nq b/tests/ntriples/testnq-1.nq new file mode 100644 index 0000000..43a0400 --- /dev/null +++ b/tests/ntriples/testnq-1.nq @@ -0,0 +1,11 @@ + . + "Alice" . + _:bnode1 . +_:bnode1 . +_:bnode1 "Bob" . +_:bnode1 . +_:bnode1 . + + . + "Bob" . + . diff --git a/tests/ntriples/testnq-1.out b/tests/ntriples/testnq-1.out new file mode 100644 index 0000000..42b74d1 --- /dev/null +++ b/tests/ntriples/testnq-1.out @@ -0,0 +1,10 @@ + . + "Alice" . + _:bnode1 . +_:bnode1 . +_:bnode1 "Bob" . +_:bnode1 . +_:bnode1 . + . + "Bob" . + . diff --git a/tests/ntriples/testnq-optional-context.nq b/tests/ntriples/testnq-optional-context.nq new file mode 100644 index 0000000..7c7bf96 --- /dev/null +++ b/tests/ntriples/testnq-optional-context.nq @@ -0,0 +1,2 @@ + . + . diff --git a/tests/ntriples/testnq-optional-context.out b/tests/ntriples/testnq-optional-context.out new file mode 100644 index 0000000..7c7bf96 --- /dev/null +++ b/tests/ntriples/testnq-optional-context.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa/0001.out b/tests/rdfa/0001.out new file mode 100644 index 0000000..05e2309 --- /dev/null +++ b/tests/rdfa/0001.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa/0001.xml b/tests/rdfa/0001.xml new file mode 100644 index 0000000..cffb7a4 --- /dev/null +++ b/tests/rdfa/0001.xml @@ -0,0 +1,10 @@ + + + + + Test 0001 + + +

This photo was taken by Mark Birbeck.

+ + \ No newline at end of file diff --git a/tests/rdfa/0006.out b/tests/rdfa/0006.out new file mode 100644 index 0000000..ceb222c --- /dev/null +++ b/tests/rdfa/0006.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa/0006.xml b/tests/rdfa/0006.xml new file mode 100644 index 0000000..44b48a3 --- /dev/null +++ b/tests/rdfa/0006.xml @@ -0,0 +1,15 @@ + + + + + Test 0006 + + +

+ This photo was taken by + Mark Birbeck. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0007.out b/tests/rdfa/0007.out new file mode 100644 index 0000000..721bb2f --- /dev/null +++ b/tests/rdfa/0007.out @@ -0,0 +1,3 @@ + . + "Portrait of Mark" . + . diff --git a/tests/rdfa/0007.xml b/tests/rdfa/0007.xml new file mode 100644 index 0000000..fd7a1aa --- /dev/null +++ b/tests/rdfa/0007.xml @@ -0,0 +1,15 @@ + + + + + Test 0007 + + +

This photo was taken by + Mark Birbeck. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0008.out b/tests/rdfa/0008.out new file mode 100644 index 0000000..79512e5 --- /dev/null +++ b/tests/rdfa/0008.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0008.xml b/tests/rdfa/0008.xml new file mode 100644 index 0000000..955ba1d --- /dev/null +++ b/tests/rdfa/0008.xml @@ -0,0 +1,15 @@ + + + + + Test 0008 + + +

This document is licensed under a + + Creative Commons + . +

+ + \ No newline at end of file diff --git a/tests/rdfa/0009.out b/tests/rdfa/0009.out new file mode 100644 index 0000000..595fa69 --- /dev/null +++ b/tests/rdfa/0009.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0009.xml b/tests/rdfa/0009.xml new file mode 100644 index 0000000..89a33ac --- /dev/null +++ b/tests/rdfa/0009.xml @@ -0,0 +1,13 @@ + + + + + Test 0009 + + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa/0010.out b/tests/rdfa/0010.out new file mode 100644 index 0000000..f194d4b --- /dev/null +++ b/tests/rdfa/0010.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa/0010.xml b/tests/rdfa/0010.xml new file mode 100644 index 0000000..c693827 --- /dev/null +++ b/tests/rdfa/0010.xml @@ -0,0 +1,12 @@ + + + + + Test 0010 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa/0012.out b/tests/rdfa/0012.out new file mode 100644 index 0000000..28e5e42 --- /dev/null +++ b/tests/rdfa/0012.out @@ -0,0 +1 @@ + "chat"@fr . diff --git a/tests/rdfa/0012.xml b/tests/rdfa/0012.xml new file mode 100644 index 0000000..2f727b5 --- /dev/null +++ b/tests/rdfa/0012.xml @@ -0,0 +1,11 @@ + + + + + Test 0012 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa/0013.out b/tests/rdfa/0013.out new file mode 100644 index 0000000..28e5e42 --- /dev/null +++ b/tests/rdfa/0013.out @@ -0,0 +1 @@ + "chat"@fr . diff --git a/tests/rdfa/0013.xml b/tests/rdfa/0013.xml new file mode 100644 index 0000000..e3a201c --- /dev/null +++ b/tests/rdfa/0013.xml @@ -0,0 +1,11 @@ + + + + + Test 0013 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa/0014.out b/tests/rdfa/0014.out new file mode 100644 index 0000000..4f7b7f3 --- /dev/null +++ b/tests/rdfa/0014.out @@ -0,0 +1 @@ + "10"^^ . diff --git a/tests/rdfa/0014.xml b/tests/rdfa/0014.xml new file mode 100644 index 0000000..56b0134 --- /dev/null +++ b/tests/rdfa/0014.xml @@ -0,0 +1,14 @@ + + + + + Test 0014 + + +

+ ten +

+ + \ No newline at end of file diff --git a/tests/rdfa/0015.out b/tests/rdfa/0015.out new file mode 100644 index 0000000..c055122 --- /dev/null +++ b/tests/rdfa/0015.out @@ -0,0 +1,2 @@ + "Fyodor Dostoevsky" . + . diff --git a/tests/rdfa/0015.xml b/tests/rdfa/0015.xml new file mode 100644 index 0000000..5991810 --- /dev/null +++ b/tests/rdfa/0015.xml @@ -0,0 +1,12 @@ + + + + + Test 0015 + + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa/0017.out b/tests/rdfa/0017.out new file mode 100644 index 0000000..eeaa6fb --- /dev/null +++ b/tests/rdfa/0017.out @@ -0,0 +1,3 @@ +_:x "Manu Sporny" . +_:x _:y . +_:y "Ralph Swick" . diff --git a/tests/rdfa/0017.xml b/tests/rdfa/0017.xml new file mode 100644 index 0000000..36328d6 --- /dev/null +++ b/tests/rdfa/0017.xml @@ -0,0 +1,15 @@ + + + + + Test 0017 + + +

+ Manu Sporny + knows + Ralph Swick. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0018.out b/tests/rdfa/0018.out new file mode 100644 index 0000000..0cb9e31 --- /dev/null +++ b/tests/rdfa/0018.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0018.xml b/tests/rdfa/0018.xml new file mode 100644 index 0000000..014b92f --- /dev/null +++ b/tests/rdfa/0018.xml @@ -0,0 +1,16 @@ + + + + + Test 0018 + + +

+ This photo was taken by + Mark Birbeck. +

+ + + + \ No newline at end of file diff --git a/tests/rdfa/0019.out b/tests/rdfa/0019.out new file mode 100644 index 0000000..de2bb18 --- /dev/null +++ b/tests/rdfa/0019.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0019.xml b/tests/rdfa/0019.xml new file mode 100644 index 0000000..d7782f6 --- /dev/null +++ b/tests/rdfa/0019.xml @@ -0,0 +1,11 @@ + + + + + Test 0019 + + +
+ + \ No newline at end of file diff --git a/tests/rdfa/0020.out b/tests/rdfa/0020.out new file mode 100644 index 0000000..05e2309 --- /dev/null +++ b/tests/rdfa/0020.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa/0020.xml b/tests/rdfa/0020.xml new file mode 100644 index 0000000..509e20b --- /dev/null +++ b/tests/rdfa/0020.xml @@ -0,0 +1,16 @@ + + + + + Test 0020 + + +
+ this photo was taken by + Mark Birbeck + +
+ + + + \ No newline at end of file diff --git a/tests/rdfa/0021.out b/tests/rdfa/0021.out new file mode 100644 index 0000000..bc8b5bc --- /dev/null +++ b/tests/rdfa/0021.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa/0021.xml b/tests/rdfa/0021.xml new file mode 100644 index 0000000..1728de4 --- /dev/null +++ b/tests/rdfa/0021.xml @@ -0,0 +1,16 @@ + + + + + Test 0021 + + +
+ this photo was taken by + Mark Birbeck + +
+ + + + \ No newline at end of file diff --git a/tests/rdfa/0023.out b/tests/rdfa/0023.out new file mode 100644 index 0000000..6f1b48f --- /dev/null +++ b/tests/rdfa/0023.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa/0023.xml b/tests/rdfa/0023.xml new file mode 100644 index 0000000..8a153c7 --- /dev/null +++ b/tests/rdfa/0023.xml @@ -0,0 +1,15 @@ + + + + + Test 0023 + + +
+ This photo was taken by + Mark Birbeck +
+ + + + \ No newline at end of file diff --git a/tests/rdfa/0025.out b/tests/rdfa/0025.out new file mode 100644 index 0000000..ac8bf24 --- /dev/null +++ b/tests/rdfa/0025.out @@ -0,0 +1,2 @@ + . + "Ben Adida" . diff --git a/tests/rdfa/0025.xml b/tests/rdfa/0025.xml new file mode 100644 index 0000000..00270df --- /dev/null +++ b/tests/rdfa/0025.xml @@ -0,0 +1,18 @@ + + + + + Test 0025 + + +

+ This paper was written by + + Ben Adida. + +

+ + + + \ No newline at end of file diff --git a/tests/rdfa/0026.out b/tests/rdfa/0026.out new file mode 100644 index 0000000..e867cfd --- /dev/null +++ b/tests/rdfa/0026.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa/0026.xml b/tests/rdfa/0026.xml new file mode 100644 index 0000000..73a37a1 --- /dev/null +++ b/tests/rdfa/0026.xml @@ -0,0 +1,15 @@ + + + + + Test 0026 + + +

+ +

+ + + + \ No newline at end of file diff --git a/tests/rdfa/0027.out b/tests/rdfa/0027.out new file mode 100644 index 0000000..e867cfd --- /dev/null +++ b/tests/rdfa/0027.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa/0027.xml b/tests/rdfa/0027.xml new file mode 100644 index 0000000..56c237a --- /dev/null +++ b/tests/rdfa/0027.xml @@ -0,0 +1,16 @@ + + + + + Test 0027 + + +

+ Mark B. + +

+ + + + \ No newline at end of file diff --git a/tests/rdfa/0029.out b/tests/rdfa/0029.out new file mode 100644 index 0000000..00221fd --- /dev/null +++ b/tests/rdfa/0029.out @@ -0,0 +1 @@ + "Mark Birbeck"^^ . diff --git a/tests/rdfa/0029.xml b/tests/rdfa/0029.xml new file mode 100644 index 0000000..1a46b29 --- /dev/null +++ b/tests/rdfa/0029.xml @@ -0,0 +1,16 @@ + + + + + Test 0029 + + +

+ Mark Birbeck. +

+ + + + \ No newline at end of file diff --git a/tests/rdfa/0030.out b/tests/rdfa/0030.out new file mode 100644 index 0000000..2a294b1 --- /dev/null +++ b/tests/rdfa/0030.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0030.xml b/tests/rdfa/0030.xml new file mode 100644 index 0000000..a901b35 --- /dev/null +++ b/tests/rdfa/0030.xml @@ -0,0 +1,15 @@ + + + + + Test 0030 + + +

This document is licensed under a + + Creative Commons License + . +

+ + \ No newline at end of file diff --git a/tests/rdfa/0031.out b/tests/rdfa/0031.out new file mode 100644 index 0000000..7d653ab --- /dev/null +++ b/tests/rdfa/0031.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0031.xml b/tests/rdfa/0031.xml new file mode 100644 index 0000000..102d506 --- /dev/null +++ b/tests/rdfa/0031.xml @@ -0,0 +1,13 @@ + + + + + Test 0031 + + +

+ The book Weaving the Web (hardcover) has the ISBN + 0752820907. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0032.out b/tests/rdfa/0032.out new file mode 100644 index 0000000..80fb928 --- /dev/null +++ b/tests/rdfa/0032.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0032.xml b/tests/rdfa/0032.xml new file mode 100644 index 0000000..b1155f4 --- /dev/null +++ b/tests/rdfa/0032.xml @@ -0,0 +1,14 @@ + + + + + Test 0032 + + +

+ The book Weaving the Web (hardcover) has the ISBN + 0752820907. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0033.out b/tests/rdfa/0033.out new file mode 100644 index 0000000..567b20c --- /dev/null +++ b/tests/rdfa/0033.out @@ -0,0 +1,2 @@ + _:a . +_:a "Ben Adida" . diff --git a/tests/rdfa/0033.xml b/tests/rdfa/0033.xml new file mode 100644 index 0000000..6ee7917 --- /dev/null +++ b/tests/rdfa/0033.xml @@ -0,0 +1,18 @@ + + + + + Test 0033 + + +

+ This paper was written by + + Ben Adida. + +

+ + + + \ No newline at end of file diff --git a/tests/rdfa/0034.out b/tests/rdfa/0034.out new file mode 100644 index 0000000..ec5eb38 --- /dev/null +++ b/tests/rdfa/0034.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0034.xml b/tests/rdfa/0034.xml new file mode 100644 index 0000000..c54a11e --- /dev/null +++ b/tests/rdfa/0034.xml @@ -0,0 +1,13 @@ + + + + + Test 0034 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0035.out b/tests/rdfa/0035.out new file mode 100644 index 0000000..47d806c --- /dev/null +++ b/tests/rdfa/0035.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0035.xml b/tests/rdfa/0035.xml new file mode 100644 index 0000000..4772d63 --- /dev/null +++ b/tests/rdfa/0035.xml @@ -0,0 +1,16 @@ + + + + + Test 0035 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0036.out b/tests/rdfa/0036.out new file mode 100644 index 0000000..47d806c --- /dev/null +++ b/tests/rdfa/0036.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0036.xml b/tests/rdfa/0036.xml new file mode 100644 index 0000000..fc7f000 --- /dev/null +++ b/tests/rdfa/0036.xml @@ -0,0 +1,16 @@ + + + + + Test 0036 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0037.out b/tests/rdfa/0037.out new file mode 100644 index 0000000..942e7c7 --- /dev/null +++ b/tests/rdfa/0037.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0037.xml b/tests/rdfa/0037.xml new file mode 100644 index 0000000..7304ed7 --- /dev/null +++ b/tests/rdfa/0037.xml @@ -0,0 +1,17 @@ + + + + + Test 0037 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0038.out b/tests/rdfa/0038.out new file mode 100644 index 0000000..4285a7c --- /dev/null +++ b/tests/rdfa/0038.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0038.xml b/tests/rdfa/0038.xml new file mode 100644 index 0000000..697f6ac --- /dev/null +++ b/tests/rdfa/0038.xml @@ -0,0 +1,13 @@ + + + + + Test 0038 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0039.out b/tests/rdfa/0039.out new file mode 100644 index 0000000..51f9b05 --- /dev/null +++ b/tests/rdfa/0039.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0039.xml b/tests/rdfa/0039.xml new file mode 100644 index 0000000..02835f0 --- /dev/null +++ b/tests/rdfa/0039.xml @@ -0,0 +1,16 @@ + + + + + Test 0039 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0040.out b/tests/rdfa/0040.out new file mode 100644 index 0000000..d5c78dd --- /dev/null +++ b/tests/rdfa/0040.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0040.xml b/tests/rdfa/0040.xml new file mode 100644 index 0000000..d9a487a --- /dev/null +++ b/tests/rdfa/0040.xml @@ -0,0 +1,15 @@ + + + + + Test 0040 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0041.out b/tests/rdfa/0041.out new file mode 100644 index 0000000..7679b31 --- /dev/null +++ b/tests/rdfa/0041.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0041.xml b/tests/rdfa/0041.xml new file mode 100644 index 0000000..08ffb9c --- /dev/null +++ b/tests/rdfa/0041.xml @@ -0,0 +1,17 @@ + + + + + Test 0041 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0042.out b/tests/rdfa/0042.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa/0042.xml b/tests/rdfa/0042.xml new file mode 100644 index 0000000..043ba2d --- /dev/null +++ b/tests/rdfa/0042.xml @@ -0,0 +1,14 @@ + + + + + Test 0042 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa/0046.out b/tests/rdfa/0046.out new file mode 100644 index 0000000..9848b91 --- /dev/null +++ b/tests/rdfa/0046.out @@ -0,0 +1,3 @@ +_:a . +_:a _:b . +_:b "John Doe" . diff --git a/tests/rdfa/0046.xml b/tests/rdfa/0046.xml new file mode 100644 index 0000000..6be1342 --- /dev/null +++ b/tests/rdfa/0046.xml @@ -0,0 +1,12 @@ + + + + + Test 0046 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0047.out b/tests/rdfa/0047.out new file mode 100644 index 0000000..1181116 --- /dev/null +++ b/tests/rdfa/0047.out @@ -0,0 +1,3 @@ +_:a . +_:a . + "John Doe" . diff --git a/tests/rdfa/0047.xml b/tests/rdfa/0047.xml new file mode 100644 index 0000000..d30b38f --- /dev/null +++ b/tests/rdfa/0047.xml @@ -0,0 +1,12 @@ + + + + + Test 0047 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0048.out b/tests/rdfa/0048.out new file mode 100644 index 0000000..4f260fc --- /dev/null +++ b/tests/rdfa/0048.out @@ -0,0 +1,3 @@ + . + _:a . +_:a "John Doe" . diff --git a/tests/rdfa/0048.xml b/tests/rdfa/0048.xml new file mode 100644 index 0000000..7cc80b6 --- /dev/null +++ b/tests/rdfa/0048.xml @@ -0,0 +1,12 @@ + + + + + Test 0048 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0049.out b/tests/rdfa/0049.out new file mode 100644 index 0000000..8a369ce --- /dev/null +++ b/tests/rdfa/0049.out @@ -0,0 +1,2 @@ + "John Doe" . + . diff --git a/tests/rdfa/0049.xml b/tests/rdfa/0049.xml new file mode 100644 index 0000000..5f3fbe3 --- /dev/null +++ b/tests/rdfa/0049.xml @@ -0,0 +1,12 @@ + + + + + Test 0049 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0050.out b/tests/rdfa/0050.out new file mode 100644 index 0000000..0dcfd58 --- /dev/null +++ b/tests/rdfa/0050.out @@ -0,0 +1,2 @@ +_:a "John Doe" . +_:a . diff --git a/tests/rdfa/0050.xml b/tests/rdfa/0050.xml new file mode 100644 index 0000000..d330c49 --- /dev/null +++ b/tests/rdfa/0050.xml @@ -0,0 +1,12 @@ + + + + + Test 0050 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0051.out b/tests/rdfa/0051.out new file mode 100644 index 0000000..67fb26e --- /dev/null +++ b/tests/rdfa/0051.out @@ -0,0 +1,2 @@ + . + "John Doe" . diff --git a/tests/rdfa/0051.xml b/tests/rdfa/0051.xml new file mode 100644 index 0000000..ad7c2ae --- /dev/null +++ b/tests/rdfa/0051.xml @@ -0,0 +1,10 @@ + + + + + Test 0051 + + +

John Doe

+ + \ No newline at end of file diff --git a/tests/rdfa/0052.out b/tests/rdfa/0052.out new file mode 100644 index 0000000..a8b78a7 --- /dev/null +++ b/tests/rdfa/0052.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0052.xml b/tests/rdfa/0052.xml new file mode 100644 index 0000000..1c51412 --- /dev/null +++ b/tests/rdfa/0052.xml @@ -0,0 +1,12 @@ + + + + + Test 0052 + + +

+ John Doe +

+ + \ No newline at end of file diff --git a/tests/rdfa/0053.out b/tests/rdfa/0053.out new file mode 100644 index 0000000..ff12bfd --- /dev/null +++ b/tests/rdfa/0053.out @@ -0,0 +1,2 @@ + . + "John Doe" . diff --git a/tests/rdfa/0053.xml b/tests/rdfa/0053.xml new file mode 100644 index 0000000..dbffdd4 --- /dev/null +++ b/tests/rdfa/0053.xml @@ -0,0 +1,12 @@ + + + + + Test 0053 + + +

+ John Doe +

+ + \ No newline at end of file diff --git a/tests/rdfa/0054.out b/tests/rdfa/0054.out new file mode 100644 index 0000000..92f24b0 --- /dev/null +++ b/tests/rdfa/0054.out @@ -0,0 +1,2 @@ + "Fabien Gandon" . + "Fabien Gandon" . diff --git a/tests/rdfa/0054.xml b/tests/rdfa/0054.xml new file mode 100644 index 0000000..470462a --- /dev/null +++ b/tests/rdfa/0054.xml @@ -0,0 +1,13 @@ + + + + + Test 0054 + + +

+ This document was authored and published by + Fabien Gandon. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0055.out b/tests/rdfa/0055.out new file mode 100644 index 0000000..5250259 --- /dev/null +++ b/tests/rdfa/0055.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa/0055.xml b/tests/rdfa/0055.xml new file mode 100644 index 0000000..7e8cef6 --- /dev/null +++ b/tests/rdfa/0055.xml @@ -0,0 +1,13 @@ + + + + + Test 0055 + + +

+ This document was authored and published by + Fabien Gandon. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0056.out b/tests/rdfa/0056.out new file mode 100644 index 0000000..219c49d --- /dev/null +++ b/tests/rdfa/0056.out @@ -0,0 +1,3 @@ + . + . + "Mark Birbeck" . diff --git a/tests/rdfa/0056.xml b/tests/rdfa/0056.xml new file mode 100644 index 0000000..8e79cab --- /dev/null +++ b/tests/rdfa/0056.xml @@ -0,0 +1,12 @@ + + + + + Test 0056 + + +
+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0057.out b/tests/rdfa/0057.out new file mode 100644 index 0000000..6711b2d --- /dev/null +++ b/tests/rdfa/0057.out @@ -0,0 +1,4 @@ + . + . + "Mark Birbeck" . + "Ivan Herman" . diff --git a/tests/rdfa/0057.xml b/tests/rdfa/0057.xml new file mode 100644 index 0000000..03e6236 --- /dev/null +++ b/tests/rdfa/0057.xml @@ -0,0 +1,13 @@ + + + + + Test 0057 + + +
+

Mark Birbeck

+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0058.out b/tests/rdfa/0058.out new file mode 100644 index 0000000..36a85c6 --- /dev/null +++ b/tests/rdfa/0058.out @@ -0,0 +1,6 @@ + _:a . + _:b . +_:a . +_:a "Mark Birbeck" . +_:b . +_:b "Ivan Herman" . diff --git a/tests/rdfa/0058.xml b/tests/rdfa/0058.xml new file mode 100644 index 0000000..dd7f57c --- /dev/null +++ b/tests/rdfa/0058.xml @@ -0,0 +1,13 @@ + + + + + Test 0058 + + +
+

Mark Birbeck

+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0059.out b/tests/rdfa/0059.out new file mode 100644 index 0000000..1e75747 --- /dev/null +++ b/tests/rdfa/0059.out @@ -0,0 +1,6 @@ + . + . + . + . + "Manu Sporny" . + "Fabien Gandon" . diff --git a/tests/rdfa/0059.xml b/tests/rdfa/0059.xml new file mode 100644 index 0000000..3c4aee6 --- /dev/null +++ b/tests/rdfa/0059.xml @@ -0,0 +1,15 @@ + + + + + Test 0059 + + +

This document was authored and published by:

+
    +
  • Manu Sporny
  • +
  • Fabien Gandon
  • +
+ + \ No newline at end of file diff --git a/tests/rdfa/0060.out b/tests/rdfa/0060.out new file mode 100644 index 0000000..5ec9d10 --- /dev/null +++ b/tests/rdfa/0060.out @@ -0,0 +1,2 @@ + . + "\u677E\u672C \u540E\u5B50" . diff --git a/tests/rdfa/0060.xml b/tests/rdfa/0060.xml new file mode 100644 index 0000000..427b3b2 --- /dev/null +++ b/tests/rdfa/0060.xml @@ -0,0 +1,13 @@ + + + + + Test 0060 + + +
+

松本 后子

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0061.out b/tests/rdfa/0061.out new file mode 100644 index 0000000..8562bb2 --- /dev/null +++ b/tests/rdfa/0061.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0061.xml b/tests/rdfa/0061.xml new file mode 100644 index 0000000..299451c --- /dev/null +++ b/tests/rdfa/0061.xml @@ -0,0 +1,11 @@ + + + + + Test 0061 + + + +

This is the first chapter in a series of chapters.

+ + \ No newline at end of file diff --git a/tests/rdfa/0062.out b/tests/rdfa/0062.out new file mode 100644 index 0000000..f4a6365 --- /dev/null +++ b/tests/rdfa/0062.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0062.xml b/tests/rdfa/0062.xml new file mode 100644 index 0000000..ecb2b55 --- /dev/null +++ b/tests/rdfa/0062.xml @@ -0,0 +1,11 @@ + + + + + Test 0062 + + + +

This is unit test #62. The next unit test is #63.

+ + \ No newline at end of file diff --git a/tests/rdfa/0063.out b/tests/rdfa/0063.out new file mode 100644 index 0000000..3239933 --- /dev/null +++ b/tests/rdfa/0063.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0063.xml b/tests/rdfa/0063.xml new file mode 100644 index 0000000..aab4ade --- /dev/null +++ b/tests/rdfa/0063.xml @@ -0,0 +1,11 @@ + + + + + Test 0063 + + + +

This is the 63rd test. The next test is #64.

+ + \ No newline at end of file diff --git a/tests/rdfa/0064.out b/tests/rdfa/0064.out new file mode 100644 index 0000000..dbee7e5 --- /dev/null +++ b/tests/rdfa/0064.out @@ -0,0 +1 @@ +_:a . diff --git a/tests/rdfa/0064.xml b/tests/rdfa/0064.xml new file mode 100644 index 0000000..d7955f0 --- /dev/null +++ b/tests/rdfa/0064.xml @@ -0,0 +1,12 @@ + + + + + Test 0064 + + +

Michael knows + Manu. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0065.out b/tests/rdfa/0065.out new file mode 100644 index 0000000..b1ae56e --- /dev/null +++ b/tests/rdfa/0065.out @@ -0,0 +1,3 @@ +_:a . +_:b . +_:a _:b . diff --git a/tests/rdfa/0065.xml b/tests/rdfa/0065.xml new file mode 100644 index 0000000..a21a778 --- /dev/null +++ b/tests/rdfa/0065.xml @@ -0,0 +1,21 @@ + + + + + Test 0065 + + +
+ Manu Sporny can be reached via + email. + He knows Michael. +
+ +
+ Michael can be reached via + email. +
+ + + + \ No newline at end of file diff --git a/tests/rdfa/0066.out b/tests/rdfa/0066.out new file mode 100644 index 0000000..3ba0a4a --- /dev/null +++ b/tests/rdfa/0066.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0066.xml b/tests/rdfa/0066.xml new file mode 100644 index 0000000..0b59195 --- /dev/null +++ b/tests/rdfa/0066.xml @@ -0,0 +1,10 @@ + + + + + Test 0066 + + +

This is test #66.

+ + \ No newline at end of file diff --git a/tests/rdfa/0067.out b/tests/rdfa/0067.out new file mode 100644 index 0000000..bedebdf --- /dev/null +++ b/tests/rdfa/0067.out @@ -0,0 +1 @@ + "Test 0067" . diff --git a/tests/rdfa/0067.xml b/tests/rdfa/0067.xml new file mode 100644 index 0000000..a3c9e69 --- /dev/null +++ b/tests/rdfa/0067.xml @@ -0,0 +1,10 @@ + + + + + Test 0067 + + +

This is test #67.

+ + \ No newline at end of file diff --git a/tests/rdfa/0068.out b/tests/rdfa/0068.out new file mode 100644 index 0000000..ade3acc --- /dev/null +++ b/tests/rdfa/0068.out @@ -0,0 +1 @@ + "Test 0067" . diff --git a/tests/rdfa/0068.xml b/tests/rdfa/0068.xml new file mode 100644 index 0000000..a4219c0 --- /dev/null +++ b/tests/rdfa/0068.xml @@ -0,0 +1,13 @@ + + + + + Test 0068 + + +

+ The previous test was + Test 0067. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0069.out b/tests/rdfa/0069.out new file mode 100644 index 0000000..5e2cd80 --- /dev/null +++ b/tests/rdfa/0069.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0069.xml b/tests/rdfa/0069.xml new file mode 100644 index 0000000..098c593 --- /dev/null +++ b/tests/rdfa/0069.xml @@ -0,0 +1,12 @@ + + + + + Test 0069 + + +

The next test will be + Test 0070. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0070.out b/tests/rdfa/0070.out new file mode 100644 index 0000000..3981691 --- /dev/null +++ b/tests/rdfa/0070.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0070.xml b/tests/rdfa/0070.xml new file mode 100644 index 0000000..1a8c28c --- /dev/null +++ b/tests/rdfa/0070.xml @@ -0,0 +1,12 @@ + + + + + Test 0070 + + +

The previous test was + Test 0069. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0071.out b/tests/rdfa/0071.out new file mode 100644 index 0000000..9a4d463 --- /dev/null +++ b/tests/rdfa/0071.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0071.xml b/tests/rdfa/0071.xml new file mode 100644 index 0000000..4749bba --- /dev/null +++ b/tests/rdfa/0071.xml @@ -0,0 +1,14 @@ + + + + + Test 0071 + + +

This page is under a Creative Commons + + Attribution-No Derivatives 3.0 license. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0072.out b/tests/rdfa/0072.out new file mode 100644 index 0000000..3756af9 --- /dev/null +++ b/tests/rdfa/0072.out @@ -0,0 +1 @@ + "Example FAQ" . diff --git a/tests/rdfa/0072.xml b/tests/rdfa/0072.xml new file mode 100644 index 0000000..35accf5 --- /dev/null +++ b/tests/rdfa/0072.xml @@ -0,0 +1,14 @@ + + + + + + Test 0072 + + +

+ Learn more by reading the example.org + Example FAQ. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0073.out b/tests/rdfa/0073.out new file mode 100644 index 0000000..1ee3798 --- /dev/null +++ b/tests/rdfa/0073.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0073.xml b/tests/rdfa/0073.xml new file mode 100644 index 0000000..cac4c31 --- /dev/null +++ b/tests/rdfa/0073.xml @@ -0,0 +1,14 @@ + + + + + + Test 0073 + + +

+ This article was written by + Jane. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0074.out b/tests/rdfa/0074.out new file mode 100644 index 0000000..1ee3798 --- /dev/null +++ b/tests/rdfa/0074.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0074.xml b/tests/rdfa/0074.xml new file mode 100644 index 0000000..00335e5 --- /dev/null +++ b/tests/rdfa/0074.xml @@ -0,0 +1,14 @@ + + + + + + Test 0074 + + +

+ This article was written by + Jane. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0075.out b/tests/rdfa/0075.out new file mode 100644 index 0000000..037c1f3 --- /dev/null +++ b/tests/rdfa/0075.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0075.xml b/tests/rdfa/0075.xml new file mode 100644 index 0000000..413ae48 --- /dev/null +++ b/tests/rdfa/0075.xml @@ -0,0 +1,14 @@ + + + + + + Test 0075 + + +

+ This page is under a Creative Commons + Attribution-No Derivatives 3.0 license. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0076.out b/tests/rdfa/0076.out new file mode 100644 index 0000000..67617de --- /dev/null +++ b/tests/rdfa/0076.out @@ -0,0 +1,23 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/rdfa/0076.xml b/tests/rdfa/0076.xml new file mode 100644 index 0000000..4edae83 --- /dev/null +++ b/tests/rdfa/0076.xml @@ -0,0 +1,34 @@ + + + + + Test 0076 + + +

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + + index + last + license + meta + + p3pv1 + + role + section + subsection + start + stylesheet + up +

+ + \ No newline at end of file diff --git a/tests/rdfa/0077.out b/tests/rdfa/0077.out new file mode 100644 index 0000000..78547d1 --- /dev/null +++ b/tests/rdfa/0077.out @@ -0,0 +1,24 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/rdfa/0077.xml b/tests/rdfa/0077.xml new file mode 100644 index 0000000..f4bc8eb --- /dev/null +++ b/tests/rdfa/0077.xml @@ -0,0 +1,59 @@ + + + + + Test 0077 + + +

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + icon + index + first + last + license + meta + next + p3pv1 + prev + role + section + subsection + start + stylesheet + up +

+ + \ No newline at end of file diff --git a/tests/rdfa/0078.out b/tests/rdfa/0078.out new file mode 100644 index 0000000..13d24aa --- /dev/null +++ b/tests/rdfa/0078.out @@ -0,0 +1,6 @@ + _:bnodeid1 . +_:bnodeid1 "Ivan Herman" . +_:bnodeid1 . + _:bnodeid2 . +_:bnodeid2 . +_:bnodeid2 "Mark Birbeck" . diff --git a/tests/rdfa/0078.xml b/tests/rdfa/0078.xml new file mode 100644 index 0000000..5c5cb19 --- /dev/null +++ b/tests/rdfa/0078.xml @@ -0,0 +1,14 @@ + + + + + Test 0078 + + +
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0079.out b/tests/rdfa/0079.out new file mode 100644 index 0000000..b600268 --- /dev/null +++ b/tests/rdfa/0079.out @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/rdfa/0079.xml b/tests/rdfa/0079.xml new file mode 100644 index 0000000..d5d9a54 --- /dev/null +++ b/tests/rdfa/0079.xml @@ -0,0 +1,14 @@ + + + + + Test 0079 + + +
+

Ivan Herman

+

Tim Berners Lee

+

Dan Brickley

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0080.out b/tests/rdfa/0080.out new file mode 100644 index 0000000..66e5baa --- /dev/null +++ b/tests/rdfa/0080.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0080.xml b/tests/rdfa/0080.xml new file mode 100644 index 0000000..973e618 --- /dev/null +++ b/tests/rdfa/0080.xml @@ -0,0 +1,12 @@ + + + + + Test 0080 + + +
+

Dan Brickley

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0081.out b/tests/rdfa/0081.out new file mode 100644 index 0000000..d48f932 --- /dev/null +++ b/tests/rdfa/0081.out @@ -0,0 +1,6 @@ +_:a . +_:a . +_:a "Ivan Herman" . +_:b . +_:b . +_:b "Mark Birbeck" . diff --git a/tests/rdfa/0081.xml b/tests/rdfa/0081.xml new file mode 100644 index 0000000..4027682 --- /dev/null +++ b/tests/rdfa/0081.xml @@ -0,0 +1,14 @@ + + + + + Test 0081 + + +
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0082.out b/tests/rdfa/0082.out new file mode 100644 index 0000000..b1baa9f --- /dev/null +++ b/tests/rdfa/0082.out @@ -0,0 +1,8 @@ + _:a . + _:b . +_:a . +_:a . +_:a "Ivan Herman" . +_:b . +_:b . +_:b "Mark Birbeck" . diff --git a/tests/rdfa/0082.xml b/tests/rdfa/0082.xml new file mode 100644 index 0000000..94808e0 --- /dev/null +++ b/tests/rdfa/0082.xml @@ -0,0 +1,14 @@ + + + + + Test 0082 + + +
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0083.out b/tests/rdfa/0083.out new file mode 100644 index 0000000..854ae53 --- /dev/null +++ b/tests/rdfa/0083.out @@ -0,0 +1,6 @@ + _:a . + . +_:a "Ivan Herman" . +_:a . + . + "Dan Brickley" . diff --git a/tests/rdfa/0083.xml b/tests/rdfa/0083.xml new file mode 100644 index 0000000..4ced120 --- /dev/null +++ b/tests/rdfa/0083.xml @@ -0,0 +1,14 @@ + + + + + Test 0083 + + +
+

Ivan Herman

+

mailto:ivan@w3.org

+

Dan Brickley

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0084.out b/tests/rdfa/0084.out new file mode 100644 index 0000000..df51d3d --- /dev/null +++ b/tests/rdfa/0084.out @@ -0,0 +1,8 @@ + _:a . + . +_:a . +_:a . +_:a "Ivan Herman" . + . + . + "Dan Brickley" . diff --git a/tests/rdfa/0084.xml b/tests/rdfa/0084.xml new file mode 100644 index 0000000..4189fa9 --- /dev/null +++ b/tests/rdfa/0084.xml @@ -0,0 +1,17 @@ + + + + + Test 0084 + + +
+
+

Ivan Herman

+

mailto:ivan@w3.org

+

Dan Brickley

+ +
+
+ + \ No newline at end of file diff --git a/tests/rdfa/0085.out b/tests/rdfa/0085.out new file mode 100644 index 0000000..6432ea0 --- /dev/null +++ b/tests/rdfa/0085.out @@ -0,0 +1,4 @@ + _:a . +_:a . +_:a . +_:a . diff --git a/tests/rdfa/0085.xml b/tests/rdfa/0085.xml new file mode 100644 index 0000000..5cb51ab --- /dev/null +++ b/tests/rdfa/0085.xml @@ -0,0 +1,16 @@ + + + + + Test 0085 + + +
+
+

Ivan Herman

+

Tim Berners Lee

+

Dan Brickley

+
+
+ + \ No newline at end of file diff --git a/tests/rdfa/0087.out b/tests/rdfa/0087.out new file mode 100644 index 0000000..3b4a443 --- /dev/null +++ b/tests/rdfa/0087.out @@ -0,0 +1,24 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/rdfa/0087.xml b/tests/rdfa/0087.xml new file mode 100644 index 0000000..ad589ba --- /dev/null +++ b/tests/rdfa/0087.xml @@ -0,0 +1,35 @@ + + + + + Test 0087 + + +

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + icon + index + first + last + license + meta + next + p3pv1 + prev + role + section + subsection + start + stylesheet + up +

+ + \ No newline at end of file diff --git a/tests/rdfa/0088.out b/tests/rdfa/0088.out new file mode 100644 index 0000000..d37e9dd --- /dev/null +++ b/tests/rdfa/0088.out @@ -0,0 +1,3 @@ + _:a . +_:a . +_:a "Dan Brickley" . diff --git a/tests/rdfa/0088.xml b/tests/rdfa/0088.xml new file mode 100644 index 0000000..870c2fc --- /dev/null +++ b/tests/rdfa/0088.xml @@ -0,0 +1,13 @@ + + + + + Test 0088 + + +
+

Dan Brickley

+

Dan Brickley again:-)

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0089.out b/tests/rdfa/0089.out new file mode 100644 index 0000000..3630849 --- /dev/null +++ b/tests/rdfa/0089.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0089.xml b/tests/rdfa/0089.xml new file mode 100644 index 0000000..7283f2d --- /dev/null +++ b/tests/rdfa/0089.xml @@ -0,0 +1,12 @@ + + + + + Test 0089 + + +
+ example image +
+ + \ No newline at end of file diff --git a/tests/rdfa/0090.out b/tests/rdfa/0090.out new file mode 100644 index 0000000..d902862 --- /dev/null +++ b/tests/rdfa/0090.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0090.xml b/tests/rdfa/0090.xml new file mode 100644 index 0000000..6ad0d81 --- /dev/null +++ b/tests/rdfa/0090.xml @@ -0,0 +1,15 @@ + + + + + Test 0090 + + +
+ example image +
+ + \ No newline at end of file diff --git a/tests/rdfa/0091.out b/tests/rdfa/0091.out new file mode 100644 index 0000000..f57f53e --- /dev/null +++ b/tests/rdfa/0091.out @@ -0,0 +1,3 @@ +_:a "a bi-pedal primate" . +_:a "confused animal" . +_:a "Milky Way" . diff --git a/tests/rdfa/0091.xml b/tests/rdfa/0091.xml new file mode 100644 index 0000000..79f208b --- /dev/null +++ b/tests/rdfa/0091.xml @@ -0,0 +1,16 @@ + + + + + Test 0091 + + +

+ A human is + a bi-pedal primate. + They are quite possibly one of the most + confused animals residing in the + Milky Way. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0093.out b/tests/rdfa/0093.out new file mode 100644 index 0000000..6c96dd4 --- /dev/null +++ b/tests/rdfa/0093.out @@ -0,0 +1,2 @@ + "Albert Einstein" . + "E = mc2: The Most Urgent Problem of Our Time"^^ . diff --git a/tests/rdfa/0093.xml b/tests/rdfa/0093.xml new file mode 100644 index 0000000..e076480 --- /dev/null +++ b/tests/rdfa/0093.xml @@ -0,0 +1,14 @@ + + + + + Test 0093 + + +
+ Author: Albert Einstein +

E = mc2: The Most Urgent Problem of Our Time

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0099.out b/tests/rdfa/0099.out new file mode 100644 index 0000000..a1389b0 --- /dev/null +++ b/tests/rdfa/0099.out @@ -0,0 +1 @@ + "\n We put thirty spokes together and call it a wheel;\n But it is on the space where there is nothing that the usefulness of the wheel depends.\n We turn clay to make a vessel;\n But it is on the space where there is nothing that the usefulness of the vessel depends.\n We pierce doors and windows to make a house;\n And it is on these spaces where there is nothing that the usefulness of the house depends.\n Therefore just as we take advantage of what is, we should recognize the usefulness of what is not.\n\n Lao Tzu: Tao Te Ching" . diff --git a/tests/rdfa/0099.xml b/tests/rdfa/0099.xml new file mode 100644 index 0000000..822ce68 --- /dev/null +++ b/tests/rdfa/0099.xml @@ -0,0 +1,19 @@ + + + + + Test 0099 + + +

+ We put thirty spokes together and call it a wheel; + But it is on the space where there is nothing that the usefulness of the wheel depends. + We turn clay to make a vessel; + But it is on the space where there is nothing that the usefulness of the vessel depends. + We pierce doors and windows to make a house; + And it is on these spaces where there is nothing that the usefulness of the house depends. + Therefore just as we take advantage of what is, we should recognize the usefulness of what is not. + + Lao Tzu: Tao Te Ching

+ + \ No newline at end of file diff --git a/tests/rdfa/0104.out b/tests/rdfa/0104.out new file mode 100644 index 0000000..50073cd --- /dev/null +++ b/tests/rdfa/0104.out @@ -0,0 +1,3 @@ + _:a . +_:a "17" . +_:a "character" . diff --git a/tests/rdfa/0104.xml b/tests/rdfa/0104.xml new file mode 100644 index 0000000..2d990fa --- /dev/null +++ b/tests/rdfa/0104.xml @@ -0,0 +1,17 @@ + + + + + Test 0104 + + +

+ The word "interfenestration" has + + 17 + characters. + +

+ + \ No newline at end of file diff --git a/tests/rdfa/0106.out b/tests/rdfa/0106.out new file mode 100644 index 0000000..3db1836 --- /dev/null +++ b/tests/rdfa/0106.out @@ -0,0 +1 @@ + _:a . diff --git a/tests/rdfa/0106.xml b/tests/rdfa/0106.xml new file mode 100644 index 0000000..c7138c9 --- /dev/null +++ b/tests/rdfa/0106.xml @@ -0,0 +1,12 @@ + + + + + Test 0106 + + +
+ Manu created this page. +
+ + \ No newline at end of file diff --git a/tests/rdfa/0107.out b/tests/rdfa/0107.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa/0107.xml b/tests/rdfa/0107.xml new file mode 100644 index 0000000..2217ce7 --- /dev/null +++ b/tests/rdfa/0107.xml @@ -0,0 +1,10 @@ + + + + + Test 0107 + + + + + \ No newline at end of file diff --git a/tests/rdfa/0108.out b/tests/rdfa/0108.out new file mode 100644 index 0000000..1a5c32d --- /dev/null +++ b/tests/rdfa/0108.out @@ -0,0 +1 @@ + "\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03CC\n\u03AC\u03C3\u03C0\u03C1\u03BF \u03B4\u03B9\u03AC\u03C3\u03C4\u03B7\u03BC\u03B1\n"@el . diff --git a/tests/rdfa/0108.xml b/tests/rdfa/0108.xml new file mode 100644 index 0000000..eaf2cb9 --- /dev/null +++ b/tests/rdfa/0108.xml @@ -0,0 +1,13 @@ + + + + + Test 0108 + + +

ελληνικό +άσπρο διάστημα +

+ + \ No newline at end of file diff --git a/tests/rdfa/0109.out b/tests/rdfa/0109.out new file mode 100644 index 0000000..2cdc0f0 --- /dev/null +++ b/tests/rdfa/0109.out @@ -0,0 +1 @@ + "Test 0109" . diff --git a/tests/rdfa/0109.xml b/tests/rdfa/0109.xml new file mode 100644 index 0000000..68a2e67 --- /dev/null +++ b/tests/rdfa/0109.xml @@ -0,0 +1,14 @@ + + + + + Test 0109 + + + +
+

This is Test 0109.

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0110.out b/tests/rdfa/0110.out new file mode 100644 index 0000000..dbe0b56 --- /dev/null +++ b/tests/rdfa/0110.out @@ -0,0 +1 @@ + _:a . diff --git a/tests/rdfa/0110.xml b/tests/rdfa/0110.xml new file mode 100644 index 0000000..586b875 --- /dev/null +++ b/tests/rdfa/0110.xml @@ -0,0 +1,12 @@ + + + + + Test 0110 + + +
+
+
+ + \ No newline at end of file diff --git a/tests/rdfa/0111.out b/tests/rdfa/0111.out new file mode 100644 index 0000000..f788f8e --- /dev/null +++ b/tests/rdfa/0111.out @@ -0,0 +1,2 @@ + _:a . +_:a _:b . diff --git a/tests/rdfa/0111.xml b/tests/rdfa/0111.xml new file mode 100644 index 0000000..50bd9c2 --- /dev/null +++ b/tests/rdfa/0111.xml @@ -0,0 +1,14 @@ + + + + + Test 0111 + + +
+
+
+
+
+ + \ No newline at end of file diff --git a/tests/rdfa/0112.out b/tests/rdfa/0112.out new file mode 100644 index 0000000..0359dad --- /dev/null +++ b/tests/rdfa/0112.out @@ -0,0 +1 @@ + "not an XML Literal,\nwhitespace preserved\n" . diff --git a/tests/rdfa/0112.xml b/tests/rdfa/0112.xml new file mode 100644 index 0000000..f17a428 --- /dev/null +++ b/tests/rdfa/0112.xml @@ -0,0 +1,15 @@ + + + + + Test 0112 + + +

+ not an XML Literal, +whitespace preserved + +

+ + \ No newline at end of file diff --git a/tests/rdfa/0113.out b/tests/rdfa/0113.out new file mode 100644 index 0000000..5363635 --- /dev/null +++ b/tests/rdfa/0113.out @@ -0,0 +1,2 @@ + "" . + "" . diff --git a/tests/rdfa/0113.xml b/tests/rdfa/0113.xml new file mode 100644 index 0000000..4dbe2fe --- /dev/null +++ b/tests/rdfa/0113.xml @@ -0,0 +1,11 @@ + + + + + Test 0113 + + + + + + \ No newline at end of file diff --git a/tests/rdfa/0114.out b/tests/rdfa/0114.out new file mode 100644 index 0000000..ce68623 --- /dev/null +++ b/tests/rdfa/0114.out @@ -0,0 +1,8 @@ + . + . + . + . + . + . + . + . diff --git a/tests/rdfa/0114.xml b/tests/rdfa/0114.xml new file mode 100644 index 0000000..76caa12 --- /dev/null +++ b/tests/rdfa/0114.xml @@ -0,0 +1,21 @@ + + + + + Test 0114 + + + + + \ No newline at end of file diff --git a/tests/rdfa/0115.out b/tests/rdfa/0115.out new file mode 100644 index 0000000..7fd325b --- /dev/null +++ b/tests/rdfa/0115.out @@ -0,0 +1,4 @@ + ">" . + "Ben & Co." . + "@" . + "@" . diff --git a/tests/rdfa/0115.xml b/tests/rdfa/0115.xml new file mode 100644 index 0000000..81e0288 --- /dev/null +++ b/tests/rdfa/0115.xml @@ -0,0 +1,16 @@ + + + + + Test 0115 + + +

Description: XML entities in the RDFa content

+

+ > + Ben & Co. + @ + @ +

+ + \ No newline at end of file diff --git a/tests/rdfa/0117.out b/tests/rdfa/0117.out new file mode 100644 index 0000000..024ca4f --- /dev/null +++ b/tests/rdfa/0117.out @@ -0,0 +1,2 @@ + "Test 0117" . + "Mark Birbeck" . diff --git a/tests/rdfa/0117.xml b/tests/rdfa/0117.xml new file mode 100644 index 0000000..4ee4b32 --- /dev/null +++ b/tests/rdfa/0117.xml @@ -0,0 +1,14 @@ + + + + + + Test 0117 + + +

+ Mark Birbeck + added this triple test. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0118.out b/tests/rdfa/0118.out new file mode 100644 index 0000000..9bad5c3 --- /dev/null +++ b/tests/rdfa/0118.out @@ -0,0 +1 @@ + "Ben" . diff --git a/tests/rdfa/0118.xml b/tests/rdfa/0118.xml new file mode 100644 index 0000000..38631af --- /dev/null +++ b/tests/rdfa/0118.xml @@ -0,0 +1,16 @@ + + + + + Test 0118 + + +

+ Check to see if parsers get confused when "" is + interpreted as NULL in some chaining cases. + Ben +

+ + + \ No newline at end of file diff --git a/tests/rdfa/0119.out b/tests/rdfa/0119.out new file mode 100644 index 0000000..72b1b09 --- /dev/null +++ b/tests/rdfa/0119.out @@ -0,0 +1 @@ + "Example Website" . diff --git a/tests/rdfa/0119.xml b/tests/rdfa/0119.xml new file mode 100644 index 0000000..3f872d6 --- /dev/null +++ b/tests/rdfa/0119.xml @@ -0,0 +1,18 @@ + + + + + Test 0119 + + +
+

+ The + Example Website + is used in many W3C tutorials. +

+
+ + + \ No newline at end of file diff --git a/tests/rdfa/0120.out b/tests/rdfa/0120.out new file mode 100644 index 0000000..01a237d --- /dev/null +++ b/tests/rdfa/0120.out @@ -0,0 +1 @@ + "The XHTML Vocabulary Document" . diff --git a/tests/rdfa/0120.xml b/tests/rdfa/0120.xml new file mode 100644 index 0000000..8735eb1 --- /dev/null +++ b/tests/rdfa/0120.xml @@ -0,0 +1,15 @@ + + + + + Test 0120 + + +

+ The + The XHTML Vocabulary Document + is the default prefix for XHTML+RDFa 1.0. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0121.out b/tests/rdfa/0121.out new file mode 100644 index 0000000..515f701 --- /dev/null +++ b/tests/rdfa/0121.out @@ -0,0 +1,2 @@ + "Test Case 0121" . + "Shane McCarron" . diff --git a/tests/rdfa/0121.xml b/tests/rdfa/0121.xml new file mode 100644 index 0000000..b0d573a --- /dev/null +++ b/tests/rdfa/0121.xml @@ -0,0 +1,23 @@ + + + + + Test 0121 + + +
+

+ Test Case 0121 + checks to make sure RDFa processors resolve the empty CURIE correctly. +

+ Shane McCarron + contributed to this test. +

+

+
+ + + + + + \ No newline at end of file diff --git a/tests/rdfa/0122.out b/tests/rdfa/0122.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa/0122.xml b/tests/rdfa/0122.xml new file mode 100644 index 0000000..6cbe23b --- /dev/null +++ b/tests/rdfa/0122.xml @@ -0,0 +1,16 @@ + + + + + Test 0122 + + +

+ This section is contained below the main site. +

+ + + + + + \ No newline at end of file diff --git a/tests/rdfa/0126.out b/tests/rdfa/0126.out new file mode 100644 index 0000000..9bf0b7a --- /dev/null +++ b/tests/rdfa/0126.out @@ -0,0 +1,3 @@ + . + . + "My article" . diff --git a/tests/rdfa/0126.xml b/tests/rdfa/0126.xml new file mode 100644 index 0000000..3dbb78a --- /dev/null +++ b/tests/rdfa/0126.xml @@ -0,0 +1,14 @@ + + + + + Test 0126 + + +
+

My article

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0131.out b/tests/rdfa/0131.out new file mode 100644 index 0000000..b3e2547 --- /dev/null +++ b/tests/rdfa/0131.out @@ -0,0 +1,5 @@ + . + . + . + . + . diff --git a/tests/rdfa/0131.xml b/tests/rdfa/0131.xml new file mode 100644 index 0000000..f24b722 --- /dev/null +++ b/tests/rdfa/0131.xml @@ -0,0 +1,10 @@ + + + + + Test + + + + + \ No newline at end of file diff --git a/tests/rdfa/0134.out b/tests/rdfa/0134.out new file mode 100644 index 0000000..4989b6c --- /dev/null +++ b/tests/rdfa/0134.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0134.xml b/tests/rdfa/0134.xml new file mode 100644 index 0000000..d352c4b --- /dev/null +++ b/tests/rdfa/0134.xml @@ -0,0 +1,10 @@ + + + + + Test + + + + + \ No newline at end of file diff --git a/tests/rdfa/0140.out b/tests/rdfa/0140.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa/0140.xml b/tests/rdfa/0140.xml new file mode 100644 index 0000000..2876574 --- /dev/null +++ b/tests/rdfa/0140.xml @@ -0,0 +1,11 @@ + + + + + Blank-node as Predicate Test + + +

Blank Nodes are not allowed to be predicate identifiers in RDF:

+

Test

+ + \ No newline at end of file diff --git a/tests/rdfa/0147.out b/tests/rdfa/0147.out new file mode 100644 index 0000000..8dbe80f --- /dev/null +++ b/tests/rdfa/0147.out @@ -0,0 +1 @@ + "Test" . diff --git a/tests/rdfa/0147.xml b/tests/rdfa/0147.xml new file mode 100644 index 0000000..1d6b062 --- /dev/null +++ b/tests/rdfa/0147.xml @@ -0,0 +1,10 @@ + + + + + Test + + +

Test

+ + \ No newline at end of file diff --git a/tests/rdfa/0172.out b/tests/rdfa/0172.out new file mode 100644 index 0000000..989f53a --- /dev/null +++ b/tests/rdfa/0172.out @@ -0,0 +1 @@ + "A plain literal with a lang tag."@en . diff --git a/tests/rdfa/0172.xml b/tests/rdfa/0172.xml new file mode 100644 index 0000000..055f4a2 --- /dev/null +++ b/tests/rdfa/0172.xml @@ -0,0 +1,11 @@ + + + + + Test 0172 + + + +

A plain literal with a lang tag.

+ + \ No newline at end of file diff --git a/tests/rdfa/0173.out b/tests/rdfa/0173.out new file mode 100644 index 0000000..fcecb33 --- /dev/null +++ b/tests/rdfa/0173.out @@ -0,0 +1 @@ + "Just a plain literal." . diff --git a/tests/rdfa/0173.xml b/tests/rdfa/0173.xml new file mode 100644 index 0000000..f8991aa --- /dev/null +++ b/tests/rdfa/0173.xml @@ -0,0 +1,11 @@ + + + + + Test 0173 + + + +

Just a plain literal.

+ + \ No newline at end of file diff --git a/tests/rdfa/0174.out b/tests/rdfa/0174.out new file mode 100644 index 0000000..5f559e7 --- /dev/null +++ b/tests/rdfa/0174.out @@ -0,0 +1 @@ + "John Doe" . diff --git a/tests/rdfa/0174.xml b/tests/rdfa/0174.xml new file mode 100644 index 0000000..240fcc5 --- /dev/null +++ b/tests/rdfa/0174.xml @@ -0,0 +1,15 @@ + + + + + Test 0174 + + +

+ This test ensures that single-character prefixes are allowed. + My name is: + John Doe +

+ + + \ No newline at end of file diff --git a/tests/rdfa/0181.out b/tests/rdfa/0181.out new file mode 100644 index 0000000..aa88a78 --- /dev/null +++ b/tests/rdfa/0181.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa/0181.xml b/tests/rdfa/0181.xml new file mode 100644 index 0000000..900fa90 --- /dev/null +++ b/tests/rdfa/0181.xml @@ -0,0 +1,12 @@ + + + + + Test 0181 + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0197.out b/tests/rdfa/0197.out new file mode 100644 index 0000000..c083c58 --- /dev/null +++ b/tests/rdfa/0197.out @@ -0,0 +1 @@ + "Ruby" . diff --git a/tests/rdfa/0197.xml b/tests/rdfa/0197.xml new file mode 100644 index 0000000..0d16e53 --- /dev/null +++ b/tests/rdfa/0197.xml @@ -0,0 +1,14 @@ + + + + + Test 0197 + + + +

Gregg Kellogg

+

Ruby

+

Kellogg Associates

+

Ruby Gem

+ + \ No newline at end of file diff --git a/tests/rdfa/0201.out b/tests/rdfa/0201.out new file mode 100644 index 0000000..327cf03 --- /dev/null +++ b/tests/rdfa/0201.out @@ -0,0 +1 @@ + "A yellow rectangle with sharp corners." . diff --git a/tests/rdfa/0201.xml b/tests/rdfa/0201.xml new file mode 100644 index 0000000..2abbc9e --- /dev/null +++ b/tests/rdfa/0201.xml @@ -0,0 +1,12 @@ + + + A yellow rectangle with sharp corners. + + + + + \ No newline at end of file diff --git a/tests/rdfa/0202.out b/tests/rdfa/0202.out new file mode 100644 index 0000000..bf0d427 --- /dev/null +++ b/tests/rdfa/0202.out @@ -0,0 +1 @@ + "A yellow rectangle with sharp corners." . diff --git a/tests/rdfa/0202.xml b/tests/rdfa/0202.xml new file mode 100644 index 0000000..ab01a8b --- /dev/null +++ b/tests/rdfa/0202.xml @@ -0,0 +1,14 @@ + + + version="1.2" + baseProfile="tiny" + A yellow rectangle with sharp corners. + + + + \ No newline at end of file diff --git a/tests/rdfa/0203.out b/tests/rdfa/0203.out new file mode 100644 index 0000000..bf0d427 --- /dev/null +++ b/tests/rdfa/0203.out @@ -0,0 +1 @@ + "A yellow rectangle with sharp corners." . diff --git a/tests/rdfa/0203.xml b/tests/rdfa/0203.xml new file mode 100644 index 0000000..a9ee9aa --- /dev/null +++ b/tests/rdfa/0203.xml @@ -0,0 +1,14 @@ + + + version="1.2" + baseProfile="tiny" + A yellow rectangle with sharp corners. + + + + \ No newline at end of file diff --git a/tests/rdfa/0207.out b/tests/rdfa/0207.out new file mode 100644 index 0000000..c78413b --- /dev/null +++ b/tests/rdfa/0207.out @@ -0,0 +1,6 @@ + . + "Weekend off in Iona" . + "2006-10-21"^^ . + "2006-10-23"^^ . + . + "Iona, UK" . diff --git a/tests/rdfa/0207.xml b/tests/rdfa/0207.xml new file mode 100644 index 0000000..d6c3ffd --- /dev/null +++ b/tests/rdfa/0207.xml @@ -0,0 +1,17 @@ + + + + + Test 0207 + + +

+ Weekend off in Iona: + Oct 21st + to Oct 23rd. + See FreeTime.Example.org for + info on Iona, UK. +

+ + \ No newline at end of file diff --git a/tests/rdfa/0209.out b/tests/rdfa/0209.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa/0209.xml b/tests/rdfa/0209.xml new file mode 100644 index 0000000..ba327ce --- /dev/null +++ b/tests/rdfa/0209.xml @@ -0,0 +1,14 @@ + + + + + Test 0209 + + + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0210.out b/tests/rdfa/0210.out new file mode 100644 index 0000000..6e1576e --- /dev/null +++ b/tests/rdfa/0210.out @@ -0,0 +1 @@ + "Ivan Herman" . diff --git a/tests/rdfa/0210.xml b/tests/rdfa/0210.xml new file mode 100644 index 0000000..d601560 --- /dev/null +++ b/tests/rdfa/0210.xml @@ -0,0 +1,14 @@ + + + + + Test 0210 + + + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa/0211.out b/tests/rdfa/0211.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa/0211.xml b/tests/rdfa/0211.xml new file mode 100644 index 0000000..5bbd005 --- /dev/null +++ b/tests/rdfa/0211.xml @@ -0,0 +1,15 @@ + + + + + Test 0211 + + + + +
+

Ivan Herman

+
+ + + \ No newline at end of file diff --git a/tests/rdfa/0212.out b/tests/rdfa/0212.out new file mode 100644 index 0000000..9534304 --- /dev/null +++ b/tests/rdfa/0212.out @@ -0,0 +1 @@ + "E = mc2: The Most Urgent Problem of Our Time"^^ . diff --git a/tests/rdfa/0212.xml b/tests/rdfa/0212.xml new file mode 100644 index 0000000..0d60cf0 --- /dev/null +++ b/tests/rdfa/0212.xml @@ -0,0 +1,14 @@ + + + + + Test 0212 + + + +
+

E = mc2: The Most Urgent Problem of Our Time

+
+ + + \ No newline at end of file diff --git a/tests/rdfa/0215.out b/tests/rdfa/0215.out new file mode 100644 index 0000000..6d5b231 --- /dev/null +++ b/tests/rdfa/0215.out @@ -0,0 +1 @@ + "Iv\u00E1n" . diff --git a/tests/rdfa/0215.xml b/tests/rdfa/0215.xml new file mode 100644 index 0000000..a9b8f8d --- /dev/null +++ b/tests/rdfa/0215.xml @@ -0,0 +1,30 @@ + + + + + + + + +

Iván

+ + \ No newline at end of file diff --git a/tests/rdfa/0258.out b/tests/rdfa/0258.out new file mode 100644 index 0000000..2637cb7 --- /dev/null +++ b/tests/rdfa/0258.out @@ -0,0 +1 @@ + _:test . diff --git a/tests/rdfa/0258.xml b/tests/rdfa/0258.xml new file mode 100644 index 0000000..ffce955 --- /dev/null +++ b/tests/rdfa/0258.xml @@ -0,0 +1,14 @@ + + + + + Undescore Prefix is Ignored Test + + +

Ensure that the "_" prefix is ignored.

+

Test

+ + \ No newline at end of file diff --git a/tests/rdfa/0262.out b/tests/rdfa/0262.out new file mode 100644 index 0000000..05e2309 --- /dev/null +++ b/tests/rdfa/0262.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa/0262.xml b/tests/rdfa/0262.xml new file mode 100644 index 0000000..fc52664 --- /dev/null +++ b/tests/rdfa/0262.xml @@ -0,0 +1,11 @@ + + + + + Test 0262 + + +

This photo was taken by Mark Birbeck.

+ + \ No newline at end of file diff --git a/tests/rdfa/0291.out b/tests/rdfa/0291.out new file mode 100644 index 0000000..678f4b7 --- /dev/null +++ b/tests/rdfa/0291.out @@ -0,0 +1 @@ + "value" . diff --git a/tests/rdfa/0291.xml b/tests/rdfa/0291.xml new file mode 100644 index 0000000..2686ab9 --- /dev/null +++ b/tests/rdfa/0291.xml @@ -0,0 +1,11 @@ + + + + + Test 0291 + + +

@href as subject overridden by @about

+ ignored + + \ No newline at end of file diff --git a/tests/rdfa/0294.out b/tests/rdfa/0294.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa/0294.xml b/tests/rdfa/0294.xml new file mode 100644 index 0000000..a0cd6e4 --- /dev/null +++ b/tests/rdfa/0294.xml @@ -0,0 +1,48 @@ + + + + + Test 0294 + + +

None of these triples should be generated in RDFa 1.0.

+
+ Vocabulary Prefixes + GRDDL + MA + OWL + RDF + RDFa + RDFS + RIF + SKOS + SKOS-XL + WDR + VOID + WDRS + XHV + XML + XSD +
+
+ Widely Used prefixes + CC + CTAG + DC + DCTERMS + FOAF + GR + ICAL + OG + REV + SIOC + V + VCARD + Schema +
+
+ Vocabulary Terms + DescribedBy +
+ + \ No newline at end of file diff --git a/tests/rdfa/0304.out b/tests/rdfa/0304.out new file mode 100644 index 0000000..5c5e210 --- /dev/null +++ b/tests/rdfa/0304.out @@ -0,0 +1,2 @@ + "Test 0304" . + "A yellow rectangle with sharp corners." . diff --git a/tests/rdfa/0304.xml b/tests/rdfa/0304.xml new file mode 100644 index 0000000..8d3c251 --- /dev/null +++ b/tests/rdfa/0304.xml @@ -0,0 +1,20 @@ + + + A yellow rectangle with sharp corners. + + + + Test 0304 + + + + + + + diff --git a/tests/rdfa/CMakeLists.txt b/tests/rdfa/CMakeLists.txt new file mode 100644 index 0000000..ca67b6e --- /dev/null +++ b/tests/rdfa/CMakeLists.txt @@ -0,0 +1,741 @@ +# raptor/tests/rdfa/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +IF(RAPTOR_PARSER_RDFA) + + RAPPER_RDFDIFF_TEST(rdfa.0001 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0001.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0001.xml" + 0001-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0001.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0001.out 0001-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0006 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0006.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0006.xml" + 0006-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0006.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0006.out 0006-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0007 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0007.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0007.xml" + 0007-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0007.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0007.out 0007-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0008 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0008.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0008.xml" + 0008-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0008.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0008.out 0008-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0009 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0009.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0009.xml" + 0009-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0009.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0009.out 0009-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0010 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0010.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0010.xml" + 0010-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0010.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0010.out 0010-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0012 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0012.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0012.xml" + 0012-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0012.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0012.out 0012-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0013 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0013.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0013.xml" + 0013-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0013.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0013.out 0013-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0014 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0014.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0014.xml" + 0014-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0014.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0014.out 0014-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0015 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0015.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0015.xml" + 0015-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0015.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0015.out 0015-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0017 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0017.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0017.xml" + 0017-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0017.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0017.out 0017-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0018 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0018.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0018.xml" + 0018-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0018.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0018.out 0018-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0019 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0019.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0019.xml" + 0019-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0019.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0019.out 0019-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0020 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0020.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0020.xml" + 0020-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0020.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0020.out 0020-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0021 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0021.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0021.xml" + 0021-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0021.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0021.out 0021-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0023 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0023.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0023.xml" + 0023-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0023.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0023.out 0023-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0025 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0025.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0025.xml" + 0025-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0025.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0025.out 0025-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0026 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0026.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0026.xml" + 0026-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0026.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0026.out 0026-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0027 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0027.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0027.xml" + 0027-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0027.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0027.out 0027-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0029 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0029.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0029.xml" + 0029-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0029.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0029.out 0029-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0030 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0030.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0030.xml" + 0030-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0030.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0030.out 0030-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0031 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0031.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0031.xml" + 0031-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0031.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0031.out 0031-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0032 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0032.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0032.xml" + 0032-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0032.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0032.out 0032-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0033 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0033.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0033.xml" + 0033-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0033.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0033.out 0033-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0034 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0034.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0034.xml" + 0034-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0034.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0034.out 0034-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0035 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0035.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0035.xml" + 0035-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0035.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0035.out 0035-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0036 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0036.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0036.xml" + 0036-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0036.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0036.out 0036-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0037 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0037.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0037.xml" + 0037-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0037.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0037.out 0037-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0038 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0038.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0038.xml" + 0038-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0038.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0038.out 0038-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0039 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0039.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0039.xml" + 0039-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0039.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0039.out 0039-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0040 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0040.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0040.xml" + 0040-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0040.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0040.out 0040-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0041 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0041.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0041.xml" + 0041-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0041.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0041.out 0041-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0042 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0042.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0042.xml" + 0042-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0042.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0042.out 0042-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0046 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0046.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0046.xml" + 0046-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0046.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0046.out 0046-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0047 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0047.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0047.xml" + 0047-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0047.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0047.out 0047-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0048 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0048.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0048.xml" + 0048-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0048.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0048.out 0048-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0049 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0049.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0049.xml" + 0049-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0049.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0049.out 0049-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0050 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0050.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0050.xml" + 0050-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0050.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0050.out 0050-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0051 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0051.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0051.xml" + 0051-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0051.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0051.out 0051-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0052 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0052.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0052.xml" + 0052-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0052.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0052.out 0052-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0053 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0053.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0053.xml" + 0053-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0053.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0053.out 0053-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0054 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0054.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0054.xml" + 0054-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0054.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0054.out 0054-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0055 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0055.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0055.xml" + 0055-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0055.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0055.out 0055-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0056 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0056.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0056.xml" + 0056-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0056.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0056.out 0056-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0057 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0057.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0057.xml" + 0057-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0057.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0057.out 0057-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0058 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0058.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0058.xml" + 0058-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0058.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0058.out 0058-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0059 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0059.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0059.xml" + 0059-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0059.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0059.out 0059-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0060 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0060.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0060.xml" + 0060-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0060.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0060.out 0060-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0061 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0061.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0061.xml" + 0061-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0061.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0061.out 0061-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0062 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0062.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0062.xml" + 0062-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0062.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0062.out 0062-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0063 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0063.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0063.xml" + 0063-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0063.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0063.out 0063-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0064 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0064.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0064.xml" + 0064-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0064.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0064.out 0064-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0065 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0065.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0065.xml" + 0065-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0065.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0065.out 0065-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0066 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0066.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0066.xml" + 0066-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0066.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0066.out 0066-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0067 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0067.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0067.xml" + 0067-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0067.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0067.out 0067-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0068 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0068.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0068.xml" + 0068-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0068.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0068.out 0068-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0069 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0069.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0069.xml" + 0069-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0069.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0069.out 0069-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0070 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0070.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0070.xml" + 0070-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0070.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0070.out 0070-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0071 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0071.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0071.xml" + 0071-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0071.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0071.out 0071-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0072 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0072.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0072.xml" + 0072-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0072.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0072.out 0072-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0073 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0073.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0073.xml" + 0073-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0073.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0073.out 0073-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0074 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0074.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0074.xml" + 0074-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0074.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0074.out 0074-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0075 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0075.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0075.xml" + 0075-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0075.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0075.out 0075-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0076 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0076.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0076.xml" + 0076-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0076.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0076.out 0076-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0077 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0077.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0077.xml" + 0077-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0077.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0077.out 0077-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0078 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0078.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0078.xml" + 0078-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0078.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0078.out 0078-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0079 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0079.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0079.xml" + 0079-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0079.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0079.out 0079-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0080 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0080.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0080.xml" + 0080-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0080.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0080.out 0080-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0081 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0081.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0081.xml" + 0081-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0081.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0081.out 0081-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0082 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0082.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0082.xml" + 0082-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0082.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0082.out 0082-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0083 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0083.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0083.xml" + 0083-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0083.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0083.out 0083-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0084 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0084.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0084.xml" + 0084-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0084.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0084.out 0084-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0085 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0085.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0085.xml" + 0085-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0085.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0085.out 0085-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0087 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0087.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0087.xml" + 0087-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0087.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0087.out 0087-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0088 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0088.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0088.xml" + 0088-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0088.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0088.out 0088-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0089 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0089.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0089.xml" + 0089-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0089.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0089.out 0089-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0090 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0090.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0090.xml" + 0090-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0090.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0090.out 0090-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0091 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0091.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0091.xml" + 0091-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0091.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0091.out 0091-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0093 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0093.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0093.xml" + 0093-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0093.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0093.out 0093-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0099 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0099.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0099.xml" + 0099-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0099.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0099.out 0099-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0104 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0104.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0104.xml" + 0104-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0104.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0104.out 0104-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0106 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0106.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0106.xml" + 0106-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0106.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0106.out 0106-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0107 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0107.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0107.xml" + 0107-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0107.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0107.out 0107-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0108 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0108.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0108.xml" + 0108-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0108.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0108.out 0108-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0109 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0109.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0109.xml" + 0109-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0109.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0109.out 0109-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0110 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0110.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0110.xml" + 0110-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0110.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0110.out 0110-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0111 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0111.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0111.xml" + 0111-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0111.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0111.out 0111-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0112 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0112.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0112.xml" + 0112-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0112.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0112.out 0112-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0113 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0113.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0113.xml" + 0113-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0113.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0113.out 0113-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0114 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0114.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0114.xml" + 0114-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0114.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0114.out 0114-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0115 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0115.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0115.xml" + 0115-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0115.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0115.out 0115-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0117 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0117.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0117.xml" + 0117-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0117.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0117.out 0117-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0118 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0118.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0118.xml" + 0118-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0118.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0118.out 0118-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0119 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0119.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0119.xml" + 0119-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0119.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0119.out 0119-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0120 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0120.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0120.xml" + 0120-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0120.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0120.out 0120-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0121 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0121.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0121.xml" + 0121-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0121.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0121.out 0121-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0122 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0122.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0122.xml" + 0122-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0122.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0122.out 0122-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0126 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0126.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0126.xml" + 0126-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0126.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0126.out 0126-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0131 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0131.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0131.xml" + 0131-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0131.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0131.out 0131-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0134 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0134.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0134.xml" + 0134-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0134.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0134.out 0134-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0140 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0140.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0140.xml" + 0140-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0140.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0140.out 0140-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0147 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0147.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0147.xml" + 0147-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0147.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0147.out 0147-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0172 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0172.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0172.xml" + 0172-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0172.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0172.out 0172-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0173 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0173.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0173.xml" + 0173-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0173.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0173.out 0173-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0174 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0174.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0174.xml" + 0174-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0174.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0174.out 0174-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0181 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0181.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0181.xml" + 0181-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0181.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0181.out 0181-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0197 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0197.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0197.xml" + 0197-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0197.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0197.out 0197-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0201 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0201.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0201.xml" + 0201-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0201.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0201.out 0201-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0202 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0202.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0202.xml" + 0202-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0202.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0202.out 0202-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa.0203 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0203.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0203.xml" + 0203-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0203.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0203.out 0203-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa.0207 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0207.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0207.xml" + 0207-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0207.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0207.out 0207-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0209 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0209.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0209.xml" + 0209-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0209.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0209.out 0209-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0210 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0210.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0210.xml" + 0210-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0210.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0210.out 0210-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0211 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0211.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0211.xml" + 0211-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0211.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0211.out 0211-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0212 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0212.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0212.xml" + 0212-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0212.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0212.out 0212-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0215 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0215.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0215.xml" + 0215-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0215.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0215.out 0215-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0258 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0258.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0258.xml" + 0258-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0258.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0258.out 0258-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0262 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0262.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0262.xml" + 0262-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0262.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0262.out 0262-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0291 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0291.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0291.xml" + 0291-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0291.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0291.out 0291-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa.0294 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0294.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0294.xml" + 0294-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0294.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0294.out 0294-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa.0304 + "${RAPPER} -f noNet -q -i rdfa10 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0304.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0304.xml" + 0304-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0304.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0304.out 0304-res.nt" + EXPECTED_FAILURE + ) + +ENDIF(RAPTOR_PARSER_RDFA) + +# end raptor/tests/rdfa/CMakeLists.txt diff --git a/tests/rdfa/Makefile.am b/tests/rdfa/Makefile.am new file mode 100644 index 0000000..b806083 --- /dev/null +++ b/tests/rdfa/Makefile.am @@ -0,0 +1,168 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor RDFa 1.0 tests +# +# Copyright (C) 2008-2012, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +BASE_URI=http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/ +# +# Manifest: +# https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl +# defines whether sparql ASK should return true or false for success +# +# Query to return all RDFA 1.0 test URIs: +# +# roqet -r csv -D https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl -e 'select ?t where {?t "rdfa1.0"}' +# +# Query to return RDFa 1.0 tests that must return False: +# roqet -r csv -D https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl -e 'select * where {?s false; "rdfa1.0"}' +# +# http://rdfa.info/test-suite/test-cases/0042 +# http://rdfa.info/test-suite/test-cases/0107 +# http://rdfa.info/test-suite/test-cases/0122 +# http://rdfa.info/test-suite/test-cases/0140 +# http://rdfa.info/test-suite/test-cases/0209 +# http://rdfa.info/test-suite/test-cases/0211 +# http://rdfa.info/test-suite/test-cases/0258 +# http://rdfa.info/test-suite/test-cases/0294 +# +# These all expect 0 ntriples - failure is >0 triples or ERROR + +CLEANFILES= \ +CMakeTests.txt \ +*-res.nt + +TEST_FILES= \ +0001.xml 0006.xml 0007.xml 0008.xml 0009.xml 0010.xml 0012.xml \ +0013.xml 0014.xml 0015.xml 0017.xml 0018.xml 0019.xml 0020.xml \ +0021.xml 0023.xml 0025.xml 0026.xml 0027.xml 0029.xml 0030.xml \ +0031.xml 0032.xml 0033.xml 0034.xml 0035.xml 0036.xml 0037.xml \ +0038.xml 0039.xml 0040.xml 0041.xml 0042.xml 0046.xml 0047.xml \ +0048.xml 0049.xml 0050.xml 0051.xml 0052.xml 0053.xml 0054.xml \ +0055.xml 0056.xml 0057.xml 0058.xml 0059.xml 0060.xml 0061.xml \ +0062.xml 0063.xml 0064.xml 0065.xml 0066.xml 0067.xml 0068.xml \ +0069.xml 0070.xml 0071.xml 0072.xml 0073.xml 0074.xml 0075.xml \ +0076.xml 0077.xml 0078.xml 0079.xml 0080.xml 0081.xml 0082.xml \ +0083.xml 0084.xml 0085.xml 0087.xml 0088.xml 0089.xml 0090.xml \ +0091.xml 0093.xml 0099.xml 0104.xml 0106.xml 0107.xml 0108.xml \ +0109.xml 0110.xml 0111.xml 0112.xml 0113.xml 0114.xml 0115.xml \ +0117.xml 0118.xml 0119.xml 0120.xml 0121.xml 0122.xml 0126.xml \ +0131.xml 0134.xml 0140.xml 0147.xml 0172.xml 0173.xml 0174.xml \ +0181.xml 0197.xml 0201.xml 0202.xml 0203.xml 0207.xml 0209.xml \ +0210.xml 0211.xml 0212.xml 0215.xml 0258.xml 0262.xml 0291.xml \ +0294.xml 0304.xml + +TEST_OUT_FILES = \ +0001.out 0006.out 0007.out 0008.out 0009.out 0010.out 0012.out \ +0013.out 0014.out 0015.out 0017.out 0018.out 0019.out 0020.out \ +0021.out 0023.out 0025.out 0026.out 0027.out 0029.out 0030.out \ +0031.out 0032.out 0033.out 0034.out 0035.out 0036.out 0037.out \ +0038.out 0039.out 0040.out 0041.out 0042.out 0046.out 0047.out \ +0048.out 0049.out 0050.out 0051.out 0052.out 0053.out 0054.out \ +0055.out 0056.out 0057.out 0058.out 0059.out 0060.out 0061.out \ +0062.out 0063.out 0064.out 0065.out 0066.out 0067.out 0068.out \ +0069.out 0070.out 0071.out 0072.out 0073.out 0074.out 0075.out \ +0076.out 0077.out 0078.out 0079.out 0080.out 0081.out 0082.out \ +0083.out 0084.out 0085.out 0087.out 0088.out 0089.out 0090.out \ +0091.out 0093.out 0099.out 0104.out 0106.out 0107.out 0108.out \ +0109.out 0110.out 0111.out 0112.out 0113.out 0114.out 0115.out \ +0117.out 0118.out 0119.out 0120.out 0121.out 0122.out 0126.out \ +0131.out 0134.out 0140.out 0147.out 0172.out 0173.out 0174.out \ +0181.out 0197.out 0201.out 0202.out 0203.out 0207.out 0209.out \ +0210.out 0211.out 0212.out 0215.out 0258.out 0262.out 0291.out \ +0294.out 0304.out + +ALL_TEST_FILES= \ + $(TEST_FILES) \ + $(TEST_OUT_FILES) + +# Expected test failures: +# 0202.xml - @xml:base support in SVG +# 0203.xml - @xml:base in non-root in SVG +# 0294.xml - property="xml:" generates a triple but shouldn't +# 0304.xml - embedded rdf/xml in SVG +# (Add a space to the start of this string) +EXPECTED_FAILURES=" 0202.xml 0203.xml 0294.xml 0304.xml" + +EXTRA_DIST = CMakeLists.txt $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +if RAPTOR_PARSER_RDFA +check-local: check-rdfa +else +check-local: +endif + +if MAINTAINER_MODE +check_rdfa_deps = $(TEST_FILES) +endif + +check-rdfa: build-rdfdiff build-rapper $(check_rdfa_deps) + @set +e; result=0; failures=; failure_count=0; \ + $(RECHO) "Testing RDFa 1.0"; \ + printf 'IF(RAPTOR_PARSER_RDFA)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .xml` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + baseuri=$(BASE_URI)$$test; \ + $(RAPPER) -f noNet -q -i rdfa10 -I $$baseuri -o ntriples $(srcdir)/$$test > $$name-res.nt 2> $$name.err; \ + status1=$$?; \ + if test $$status1 = 2; then \ + status1=0; \ + fi; \ + $(RDFDIFF) -f ntriples -u $$baseuri -t ntriples $(srcdir)/$$name.out $$name-res.nt > $$name.res 2> $$name.err; \ + status2=$$?; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "Triple counts: expected: `wc -l < $(srcdir)/$$name.out` got: `wc -l < $$name-res.nt` "; \ + $(RECHO) $(RAPPER) -f noNet -q -i rdfa10 -I $$baseuri -o ntriples $(srcdir)/$$test '>' $$name-res.nt; \ + $(RECHO) $(RDFDIFF) -f ntriples -u $$baseuri -t ntriples $(srcdir)/$$name.out $$name-res.nt '>' $$name.res; \ + cat $$name.err $$name.res; \ + failures="$$failures $$test"; \ + failure_count=`expr $$failure_count + 1`; \ + fi; \ + rm -f $$name-res.nt $$name.res $$name.err; \ + printf '\tRAPPER_RDFDIFF_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t"%s"\n\t)\n\n' \ + rdfa.$$name \ + "\$${RAPPER} -f noNet -q -i rdfa10 -I $$baseuri -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$name-res.nt \ + "\$${RDFDIFF} -f ntriples -u $$baseuri -t ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out $$name-res.nt" \ + >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_RDFA)\n\n' >>CMakeTests.txt; \ + if test "X$$failures" != X; then \ + if test "$$failures" = $(EXPECTED_FAILURES); then \ + echo "Ignoring expected failures"; \ + result=0; \ + else \ + echo "FAILED: Got $$failures but expected $(EXPECTED_FAILURES)"; \ + result=1; \ + fi; \ + fi; \ + set -e; exit $$result diff --git a/tests/rdfa/Makefile.in b/tests/rdfa/Makefile.in new file mode 100644 index 0000000..7b7a5d3 --- /dev/null +++ b/tests/rdfa/Makefile.in @@ -0,0 +1,654 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor RDFa 1.0 tests +# +# Copyright (C) 2008-2012, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/rdfa +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +BASE_URI = http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/ +# +# Manifest: +# https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl +# defines whether sparql ASK should return true or false for success +# +# Query to return all RDFA 1.0 test URIs: +# +# roqet -r csv -D https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl -e 'select ?t where {?t "rdfa1.0"}' +# +# Query to return RDFa 1.0 tests that must return False: +# roqet -r csv -D https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl -e 'select * where {?s false; "rdfa1.0"}' +# +# http://rdfa.info/test-suite/test-cases/0042 +# http://rdfa.info/test-suite/test-cases/0107 +# http://rdfa.info/test-suite/test-cases/0122 +# http://rdfa.info/test-suite/test-cases/0140 +# http://rdfa.info/test-suite/test-cases/0209 +# http://rdfa.info/test-suite/test-cases/0211 +# http://rdfa.info/test-suite/test-cases/0258 +# http://rdfa.info/test-suite/test-cases/0294 +# +# These all expect 0 ntriples - failure is >0 triples or ERROR +CLEANFILES = \ +CMakeTests.txt \ +*-res.nt + +TEST_FILES = \ +0001.xml 0006.xml 0007.xml 0008.xml 0009.xml 0010.xml 0012.xml \ +0013.xml 0014.xml 0015.xml 0017.xml 0018.xml 0019.xml 0020.xml \ +0021.xml 0023.xml 0025.xml 0026.xml 0027.xml 0029.xml 0030.xml \ +0031.xml 0032.xml 0033.xml 0034.xml 0035.xml 0036.xml 0037.xml \ +0038.xml 0039.xml 0040.xml 0041.xml 0042.xml 0046.xml 0047.xml \ +0048.xml 0049.xml 0050.xml 0051.xml 0052.xml 0053.xml 0054.xml \ +0055.xml 0056.xml 0057.xml 0058.xml 0059.xml 0060.xml 0061.xml \ +0062.xml 0063.xml 0064.xml 0065.xml 0066.xml 0067.xml 0068.xml \ +0069.xml 0070.xml 0071.xml 0072.xml 0073.xml 0074.xml 0075.xml \ +0076.xml 0077.xml 0078.xml 0079.xml 0080.xml 0081.xml 0082.xml \ +0083.xml 0084.xml 0085.xml 0087.xml 0088.xml 0089.xml 0090.xml \ +0091.xml 0093.xml 0099.xml 0104.xml 0106.xml 0107.xml 0108.xml \ +0109.xml 0110.xml 0111.xml 0112.xml 0113.xml 0114.xml 0115.xml \ +0117.xml 0118.xml 0119.xml 0120.xml 0121.xml 0122.xml 0126.xml \ +0131.xml 0134.xml 0140.xml 0147.xml 0172.xml 0173.xml 0174.xml \ +0181.xml 0197.xml 0201.xml 0202.xml 0203.xml 0207.xml 0209.xml \ +0210.xml 0211.xml 0212.xml 0215.xml 0258.xml 0262.xml 0291.xml \ +0294.xml 0304.xml + +TEST_OUT_FILES = \ +0001.out 0006.out 0007.out 0008.out 0009.out 0010.out 0012.out \ +0013.out 0014.out 0015.out 0017.out 0018.out 0019.out 0020.out \ +0021.out 0023.out 0025.out 0026.out 0027.out 0029.out 0030.out \ +0031.out 0032.out 0033.out 0034.out 0035.out 0036.out 0037.out \ +0038.out 0039.out 0040.out 0041.out 0042.out 0046.out 0047.out \ +0048.out 0049.out 0050.out 0051.out 0052.out 0053.out 0054.out \ +0055.out 0056.out 0057.out 0058.out 0059.out 0060.out 0061.out \ +0062.out 0063.out 0064.out 0065.out 0066.out 0067.out 0068.out \ +0069.out 0070.out 0071.out 0072.out 0073.out 0074.out 0075.out \ +0076.out 0077.out 0078.out 0079.out 0080.out 0081.out 0082.out \ +0083.out 0084.out 0085.out 0087.out 0088.out 0089.out 0090.out \ +0091.out 0093.out 0099.out 0104.out 0106.out 0107.out 0108.out \ +0109.out 0110.out 0111.out 0112.out 0113.out 0114.out 0115.out \ +0117.out 0118.out 0119.out 0120.out 0121.out 0122.out 0126.out \ +0131.out 0134.out 0140.out 0147.out 0172.out 0173.out 0174.out \ +0181.out 0197.out 0201.out 0202.out 0203.out 0207.out 0209.out \ +0210.out 0211.out 0212.out 0215.out 0258.out 0262.out 0291.out \ +0294.out 0304.out + +ALL_TEST_FILES = \ + $(TEST_FILES) \ + $(TEST_OUT_FILES) + + +# Expected test failures: +# 0202.xml - @xml:base support in SVG +# 0203.xml - @xml:base in non-root in SVG +# 0294.xml - property="xml:" generates a triple but shouldn't +# 0304.xml - embedded rdf/xml in SVG +# (Add a space to the start of this string) +EXPECTED_FAILURES = " 0202.xml 0203.xml 0294.xml 0304.xml" +EXTRA_DIST = CMakeLists.txt $(ALL_TEST_FILES) +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff +@MAINTAINER_MODE_TRUE@check_rdfa_deps = $(TEST_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/rdfa/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/rdfa/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +@RAPTOR_PARSER_RDFA_TRUE@check-local: check-rdfa +@RAPTOR_PARSER_RDFA_FALSE@check-local: + +check-rdfa: build-rdfdiff build-rapper $(check_rdfa_deps) + @set +e; result=0; failures=; failure_count=0; \ + $(RECHO) "Testing RDFa 1.0"; \ + printf 'IF(RAPTOR_PARSER_RDFA)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .xml` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + baseuri=$(BASE_URI)$$test; \ + $(RAPPER) -f noNet -q -i rdfa10 -I $$baseuri -o ntriples $(srcdir)/$$test > $$name-res.nt 2> $$name.err; \ + status1=$$?; \ + if test $$status1 = 2; then \ + status1=0; \ + fi; \ + $(RDFDIFF) -f ntriples -u $$baseuri -t ntriples $(srcdir)/$$name.out $$name-res.nt > $$name.res 2> $$name.err; \ + status2=$$?; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "Triple counts: expected: `wc -l < $(srcdir)/$$name.out` got: `wc -l < $$name-res.nt` "; \ + $(RECHO) $(RAPPER) -f noNet -q -i rdfa10 -I $$baseuri -o ntriples $(srcdir)/$$test '>' $$name-res.nt; \ + $(RECHO) $(RDFDIFF) -f ntriples -u $$baseuri -t ntriples $(srcdir)/$$name.out $$name-res.nt '>' $$name.res; \ + cat $$name.err $$name.res; \ + failures="$$failures $$test"; \ + failure_count=`expr $$failure_count + 1`; \ + fi; \ + rm -f $$name-res.nt $$name.res $$name.err; \ + printf '\tRAPPER_RDFDIFF_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t"%s"\n\t)\n\n' \ + rdfa.$$name \ + "\$${RAPPER} -f noNet -q -i rdfa10 -I $$baseuri -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$name-res.nt \ + "\$${RDFDIFF} -f ntriples -u $$baseuri -t ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out $$name-res.nt" \ + >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_RDFA)\n\n' >>CMakeTests.txt; \ + if test "X$$failures" != X; then \ + if test "$$failures" = $(EXPECTED_FAILURES); then \ + echo "Ignoring expected failures"; \ + result=0; \ + else \ + echo "FAILED: Got $$failures but expected $(EXPECTED_FAILURES)"; \ + result=1; \ + fi; \ + fi; \ + set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/rdfa11/0001.out b/tests/rdfa11/0001.out new file mode 100644 index 0000000..05e2309 --- /dev/null +++ b/tests/rdfa11/0001.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa11/0001.xml b/tests/rdfa11/0001.xml new file mode 100644 index 0000000..cffb7a4 --- /dev/null +++ b/tests/rdfa11/0001.xml @@ -0,0 +1,10 @@ + + + + + Test 0001 + + +

This photo was taken by Mark Birbeck.

+ + \ No newline at end of file diff --git a/tests/rdfa11/0006.out b/tests/rdfa11/0006.out new file mode 100644 index 0000000..ceb222c --- /dev/null +++ b/tests/rdfa11/0006.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa11/0006.xml b/tests/rdfa11/0006.xml new file mode 100644 index 0000000..44b48a3 --- /dev/null +++ b/tests/rdfa11/0006.xml @@ -0,0 +1,15 @@ + + + + + Test 0006 + + +

+ This photo was taken by + Mark Birbeck. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0007.out b/tests/rdfa11/0007.out new file mode 100644 index 0000000..721bb2f --- /dev/null +++ b/tests/rdfa11/0007.out @@ -0,0 +1,3 @@ + . + "Portrait of Mark" . + . diff --git a/tests/rdfa11/0007.xml b/tests/rdfa11/0007.xml new file mode 100644 index 0000000..fd7a1aa --- /dev/null +++ b/tests/rdfa11/0007.xml @@ -0,0 +1,15 @@ + + + + + Test 0007 + + +

This photo was taken by + Mark Birbeck. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0008.out b/tests/rdfa11/0008.out new file mode 100644 index 0000000..79512e5 --- /dev/null +++ b/tests/rdfa11/0008.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0008.xml b/tests/rdfa11/0008.xml new file mode 100644 index 0000000..955ba1d --- /dev/null +++ b/tests/rdfa11/0008.xml @@ -0,0 +1,15 @@ + + + + + Test 0008 + + +

This document is licensed under a + + Creative Commons + . +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0009.out b/tests/rdfa11/0009.out new file mode 100644 index 0000000..595fa69 --- /dev/null +++ b/tests/rdfa11/0009.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0009.xml b/tests/rdfa11/0009.xml new file mode 100644 index 0000000..89a33ac --- /dev/null +++ b/tests/rdfa11/0009.xml @@ -0,0 +1,13 @@ + + + + + Test 0009 + + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0010.out b/tests/rdfa11/0010.out new file mode 100644 index 0000000..f194d4b --- /dev/null +++ b/tests/rdfa11/0010.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa11/0010.xml b/tests/rdfa11/0010.xml new file mode 100644 index 0000000..c693827 --- /dev/null +++ b/tests/rdfa11/0010.xml @@ -0,0 +1,12 @@ + + + + + Test 0010 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0012.out b/tests/rdfa11/0012.out new file mode 100644 index 0000000..28e5e42 --- /dev/null +++ b/tests/rdfa11/0012.out @@ -0,0 +1 @@ + "chat"@fr . diff --git a/tests/rdfa11/0012.xml b/tests/rdfa11/0012.xml new file mode 100644 index 0000000..2f727b5 --- /dev/null +++ b/tests/rdfa11/0012.xml @@ -0,0 +1,11 @@ + + + + + Test 0012 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0013.out b/tests/rdfa11/0013.out new file mode 100644 index 0000000..28e5e42 --- /dev/null +++ b/tests/rdfa11/0013.out @@ -0,0 +1 @@ + "chat"@fr . diff --git a/tests/rdfa11/0013.xml b/tests/rdfa11/0013.xml new file mode 100644 index 0000000..e3a201c --- /dev/null +++ b/tests/rdfa11/0013.xml @@ -0,0 +1,11 @@ + + + + + Test 0013 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0014.out b/tests/rdfa11/0014.out new file mode 100644 index 0000000..4f7b7f3 --- /dev/null +++ b/tests/rdfa11/0014.out @@ -0,0 +1 @@ + "10"^^ . diff --git a/tests/rdfa11/0014.xml b/tests/rdfa11/0014.xml new file mode 100644 index 0000000..56b0134 --- /dev/null +++ b/tests/rdfa11/0014.xml @@ -0,0 +1,14 @@ + + + + + Test 0014 + + +

+ ten +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0015.out b/tests/rdfa11/0015.out new file mode 100644 index 0000000..c055122 --- /dev/null +++ b/tests/rdfa11/0015.out @@ -0,0 +1,2 @@ + "Fyodor Dostoevsky" . + . diff --git a/tests/rdfa11/0015.xml b/tests/rdfa11/0015.xml new file mode 100644 index 0000000..5991810 --- /dev/null +++ b/tests/rdfa11/0015.xml @@ -0,0 +1,12 @@ + + + + + Test 0015 + + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0017.out b/tests/rdfa11/0017.out new file mode 100644 index 0000000..eeaa6fb --- /dev/null +++ b/tests/rdfa11/0017.out @@ -0,0 +1,3 @@ +_:x "Manu Sporny" . +_:x _:y . +_:y "Ralph Swick" . diff --git a/tests/rdfa11/0017.xml b/tests/rdfa11/0017.xml new file mode 100644 index 0000000..36328d6 --- /dev/null +++ b/tests/rdfa11/0017.xml @@ -0,0 +1,15 @@ + + + + + Test 0017 + + +

+ Manu Sporny + knows + Ralph Swick. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0018.out b/tests/rdfa11/0018.out new file mode 100644 index 0000000..0cb9e31 --- /dev/null +++ b/tests/rdfa11/0018.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0018.xml b/tests/rdfa11/0018.xml new file mode 100644 index 0000000..014b92f --- /dev/null +++ b/tests/rdfa11/0018.xml @@ -0,0 +1,16 @@ + + + + + Test 0018 + + +

+ This photo was taken by + Mark Birbeck. +

+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0019.out b/tests/rdfa11/0019.out new file mode 100644 index 0000000..de2bb18 --- /dev/null +++ b/tests/rdfa11/0019.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0019.xml b/tests/rdfa11/0019.xml new file mode 100644 index 0000000..d7782f6 --- /dev/null +++ b/tests/rdfa11/0019.xml @@ -0,0 +1,11 @@ + + + + + Test 0019 + + +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0020.out b/tests/rdfa11/0020.out new file mode 100644 index 0000000..05e2309 --- /dev/null +++ b/tests/rdfa11/0020.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa11/0020.xml b/tests/rdfa11/0020.xml new file mode 100644 index 0000000..509e20b --- /dev/null +++ b/tests/rdfa11/0020.xml @@ -0,0 +1,16 @@ + + + + + Test 0020 + + +
+ this photo was taken by + Mark Birbeck + +
+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0021.out b/tests/rdfa11/0021.out new file mode 100644 index 0000000..bc8b5bc --- /dev/null +++ b/tests/rdfa11/0021.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa11/0021.xml b/tests/rdfa11/0021.xml new file mode 100644 index 0000000..1728de4 --- /dev/null +++ b/tests/rdfa11/0021.xml @@ -0,0 +1,16 @@ + + + + + Test 0021 + + +
+ this photo was taken by + Mark Birbeck + +
+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0023.out b/tests/rdfa11/0023.out new file mode 100644 index 0000000..6f1b48f --- /dev/null +++ b/tests/rdfa11/0023.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa11/0023.xml b/tests/rdfa11/0023.xml new file mode 100644 index 0000000..8a153c7 --- /dev/null +++ b/tests/rdfa11/0023.xml @@ -0,0 +1,15 @@ + + + + + Test 0023 + + +
+ This photo was taken by + Mark Birbeck +
+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0025.out b/tests/rdfa11/0025.out new file mode 100644 index 0000000..ac8bf24 --- /dev/null +++ b/tests/rdfa11/0025.out @@ -0,0 +1,2 @@ + . + "Ben Adida" . diff --git a/tests/rdfa11/0025.xml b/tests/rdfa11/0025.xml new file mode 100644 index 0000000..00270df --- /dev/null +++ b/tests/rdfa11/0025.xml @@ -0,0 +1,18 @@ + + + + + Test 0025 + + +

+ This paper was written by + + Ben Adida. + +

+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0026.out b/tests/rdfa11/0026.out new file mode 100644 index 0000000..e867cfd --- /dev/null +++ b/tests/rdfa11/0026.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa11/0026.xml b/tests/rdfa11/0026.xml new file mode 100644 index 0000000..73a37a1 --- /dev/null +++ b/tests/rdfa11/0026.xml @@ -0,0 +1,15 @@ + + + + + Test 0026 + + +

+ +

+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0027.out b/tests/rdfa11/0027.out new file mode 100644 index 0000000..e867cfd --- /dev/null +++ b/tests/rdfa11/0027.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa11/0027.xml b/tests/rdfa11/0027.xml new file mode 100644 index 0000000..56c237a --- /dev/null +++ b/tests/rdfa11/0027.xml @@ -0,0 +1,16 @@ + + + + + Test 0027 + + +

+ Mark B. + +

+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0029.out b/tests/rdfa11/0029.out new file mode 100644 index 0000000..00221fd --- /dev/null +++ b/tests/rdfa11/0029.out @@ -0,0 +1 @@ + "Mark Birbeck"^^ . diff --git a/tests/rdfa11/0029.xml b/tests/rdfa11/0029.xml new file mode 100644 index 0000000..1a46b29 --- /dev/null +++ b/tests/rdfa11/0029.xml @@ -0,0 +1,16 @@ + + + + + Test 0029 + + +

+ Mark Birbeck. +

+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0030.out b/tests/rdfa11/0030.out new file mode 100644 index 0000000..2a294b1 --- /dev/null +++ b/tests/rdfa11/0030.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0030.xml b/tests/rdfa11/0030.xml new file mode 100644 index 0000000..a901b35 --- /dev/null +++ b/tests/rdfa11/0030.xml @@ -0,0 +1,15 @@ + + + + + Test 0030 + + +

This document is licensed under a + + Creative Commons License + . +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0031.out b/tests/rdfa11/0031.out new file mode 100644 index 0000000..7d653ab --- /dev/null +++ b/tests/rdfa11/0031.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0031.xml b/tests/rdfa11/0031.xml new file mode 100644 index 0000000..102d506 --- /dev/null +++ b/tests/rdfa11/0031.xml @@ -0,0 +1,13 @@ + + + + + Test 0031 + + +

+ The book Weaving the Web (hardcover) has the ISBN + 0752820907. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0032.out b/tests/rdfa11/0032.out new file mode 100644 index 0000000..80fb928 --- /dev/null +++ b/tests/rdfa11/0032.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0032.xml b/tests/rdfa11/0032.xml new file mode 100644 index 0000000..b1155f4 --- /dev/null +++ b/tests/rdfa11/0032.xml @@ -0,0 +1,14 @@ + + + + + Test 0032 + + +

+ The book Weaving the Web (hardcover) has the ISBN + 0752820907. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0033.out b/tests/rdfa11/0033.out new file mode 100644 index 0000000..567b20c --- /dev/null +++ b/tests/rdfa11/0033.out @@ -0,0 +1,2 @@ + _:a . +_:a "Ben Adida" . diff --git a/tests/rdfa11/0033.xml b/tests/rdfa11/0033.xml new file mode 100644 index 0000000..6ee7917 --- /dev/null +++ b/tests/rdfa11/0033.xml @@ -0,0 +1,18 @@ + + + + + Test 0033 + + +

+ This paper was written by + + Ben Adida. + +

+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0034.out b/tests/rdfa11/0034.out new file mode 100644 index 0000000..ec5eb38 --- /dev/null +++ b/tests/rdfa11/0034.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0034.xml b/tests/rdfa11/0034.xml new file mode 100644 index 0000000..c54a11e --- /dev/null +++ b/tests/rdfa11/0034.xml @@ -0,0 +1,13 @@ + + + + + Test 0034 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0035.out b/tests/rdfa11/0035.out new file mode 100644 index 0000000..47d806c --- /dev/null +++ b/tests/rdfa11/0035.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0035.xml b/tests/rdfa11/0035.xml new file mode 100644 index 0000000..4772d63 --- /dev/null +++ b/tests/rdfa11/0035.xml @@ -0,0 +1,16 @@ + + + + + Test 0035 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0036.out b/tests/rdfa11/0036.out new file mode 100644 index 0000000..47d806c --- /dev/null +++ b/tests/rdfa11/0036.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0036.xml b/tests/rdfa11/0036.xml new file mode 100644 index 0000000..fc7f000 --- /dev/null +++ b/tests/rdfa11/0036.xml @@ -0,0 +1,16 @@ + + + + + Test 0036 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0037.out b/tests/rdfa11/0037.out new file mode 100644 index 0000000..942e7c7 --- /dev/null +++ b/tests/rdfa11/0037.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0037.xml b/tests/rdfa11/0037.xml new file mode 100644 index 0000000..7304ed7 --- /dev/null +++ b/tests/rdfa11/0037.xml @@ -0,0 +1,17 @@ + + + + + Test 0037 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0038.out b/tests/rdfa11/0038.out new file mode 100644 index 0000000..4285a7c --- /dev/null +++ b/tests/rdfa11/0038.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0038.xml b/tests/rdfa11/0038.xml new file mode 100644 index 0000000..697f6ac --- /dev/null +++ b/tests/rdfa11/0038.xml @@ -0,0 +1,13 @@ + + + + + Test 0038 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0039.out b/tests/rdfa11/0039.out new file mode 100644 index 0000000..51f9b05 --- /dev/null +++ b/tests/rdfa11/0039.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0039.xml b/tests/rdfa11/0039.xml new file mode 100644 index 0000000..02835f0 --- /dev/null +++ b/tests/rdfa11/0039.xml @@ -0,0 +1,16 @@ + + + + + Test 0039 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0041.out b/tests/rdfa11/0041.out new file mode 100644 index 0000000..7679b31 --- /dev/null +++ b/tests/rdfa11/0041.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0041.xml b/tests/rdfa11/0041.xml new file mode 100644 index 0000000..08ffb9c --- /dev/null +++ b/tests/rdfa11/0041.xml @@ -0,0 +1,17 @@ + + + + + Test 0041 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0048.out b/tests/rdfa11/0048.out new file mode 100644 index 0000000..4f260fc --- /dev/null +++ b/tests/rdfa11/0048.out @@ -0,0 +1,3 @@ + . + _:a . +_:a "John Doe" . diff --git a/tests/rdfa11/0048.xml b/tests/rdfa11/0048.xml new file mode 100644 index 0000000..7cc80b6 --- /dev/null +++ b/tests/rdfa11/0048.xml @@ -0,0 +1,12 @@ + + + + + Test 0048 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0049.out b/tests/rdfa11/0049.out new file mode 100644 index 0000000..8a369ce --- /dev/null +++ b/tests/rdfa11/0049.out @@ -0,0 +1,2 @@ + "John Doe" . + . diff --git a/tests/rdfa11/0049.xml b/tests/rdfa11/0049.xml new file mode 100644 index 0000000..5f3fbe3 --- /dev/null +++ b/tests/rdfa11/0049.xml @@ -0,0 +1,12 @@ + + + + + Test 0049 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0050.out b/tests/rdfa11/0050.out new file mode 100644 index 0000000..0dcfd58 --- /dev/null +++ b/tests/rdfa11/0050.out @@ -0,0 +1,2 @@ +_:a "John Doe" . +_:a . diff --git a/tests/rdfa11/0050.xml b/tests/rdfa11/0050.xml new file mode 100644 index 0000000..d330c49 --- /dev/null +++ b/tests/rdfa11/0050.xml @@ -0,0 +1,12 @@ + + + + + Test 0050 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0051.out b/tests/rdfa11/0051.out new file mode 100644 index 0000000..67fb26e --- /dev/null +++ b/tests/rdfa11/0051.out @@ -0,0 +1,2 @@ + . + "John Doe" . diff --git a/tests/rdfa11/0051.xml b/tests/rdfa11/0051.xml new file mode 100644 index 0000000..ad7c2ae --- /dev/null +++ b/tests/rdfa11/0051.xml @@ -0,0 +1,10 @@ + + + + + Test 0051 + + +

John Doe

+ + \ No newline at end of file diff --git a/tests/rdfa11/0052.out b/tests/rdfa11/0052.out new file mode 100644 index 0000000..a8b78a7 --- /dev/null +++ b/tests/rdfa11/0052.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0052.xml b/tests/rdfa11/0052.xml new file mode 100644 index 0000000..1c51412 --- /dev/null +++ b/tests/rdfa11/0052.xml @@ -0,0 +1,12 @@ + + + + + Test 0052 + + +

+ John Doe +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0053.out b/tests/rdfa11/0053.out new file mode 100644 index 0000000..ff12bfd --- /dev/null +++ b/tests/rdfa11/0053.out @@ -0,0 +1,2 @@ + . + "John Doe" . diff --git a/tests/rdfa11/0053.xml b/tests/rdfa11/0053.xml new file mode 100644 index 0000000..dbffdd4 --- /dev/null +++ b/tests/rdfa11/0053.xml @@ -0,0 +1,12 @@ + + + + + Test 0053 + + +

+ John Doe +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0054.out b/tests/rdfa11/0054.out new file mode 100644 index 0000000..92f24b0 --- /dev/null +++ b/tests/rdfa11/0054.out @@ -0,0 +1,2 @@ + "Fabien Gandon" . + "Fabien Gandon" . diff --git a/tests/rdfa11/0054.xml b/tests/rdfa11/0054.xml new file mode 100644 index 0000000..470462a --- /dev/null +++ b/tests/rdfa11/0054.xml @@ -0,0 +1,13 @@ + + + + + Test 0054 + + +

+ This document was authored and published by + Fabien Gandon. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0055.out b/tests/rdfa11/0055.out new file mode 100644 index 0000000..5250259 --- /dev/null +++ b/tests/rdfa11/0055.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa11/0055.xml b/tests/rdfa11/0055.xml new file mode 100644 index 0000000..7e8cef6 --- /dev/null +++ b/tests/rdfa11/0055.xml @@ -0,0 +1,13 @@ + + + + + Test 0055 + + +

+ This document was authored and published by + Fabien Gandon. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0056.out b/tests/rdfa11/0056.out new file mode 100644 index 0000000..219c49d --- /dev/null +++ b/tests/rdfa11/0056.out @@ -0,0 +1,3 @@ + . + . + "Mark Birbeck" . diff --git a/tests/rdfa11/0056.xml b/tests/rdfa11/0056.xml new file mode 100644 index 0000000..8e79cab --- /dev/null +++ b/tests/rdfa11/0056.xml @@ -0,0 +1,12 @@ + + + + + Test 0056 + + +
+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0057.out b/tests/rdfa11/0057.out new file mode 100644 index 0000000..6711b2d --- /dev/null +++ b/tests/rdfa11/0057.out @@ -0,0 +1,4 @@ + . + . + "Mark Birbeck" . + "Ivan Herman" . diff --git a/tests/rdfa11/0057.xml b/tests/rdfa11/0057.xml new file mode 100644 index 0000000..03e6236 --- /dev/null +++ b/tests/rdfa11/0057.xml @@ -0,0 +1,13 @@ + + + + + Test 0057 + + +
+

Mark Birbeck

+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0059.out b/tests/rdfa11/0059.out new file mode 100644 index 0000000..1e75747 --- /dev/null +++ b/tests/rdfa11/0059.out @@ -0,0 +1,6 @@ + . + . + . + . + "Manu Sporny" . + "Fabien Gandon" . diff --git a/tests/rdfa11/0059.xml b/tests/rdfa11/0059.xml new file mode 100644 index 0000000..3c4aee6 --- /dev/null +++ b/tests/rdfa11/0059.xml @@ -0,0 +1,15 @@ + + + + + Test 0059 + + +

This document was authored and published by:

+
    +
  • Manu Sporny
  • +
  • Fabien Gandon
  • +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0060.out b/tests/rdfa11/0060.out new file mode 100644 index 0000000..5ec9d10 --- /dev/null +++ b/tests/rdfa11/0060.out @@ -0,0 +1,2 @@ + . + "\u677E\u672C \u540E\u5B50" . diff --git a/tests/rdfa11/0060.xml b/tests/rdfa11/0060.xml new file mode 100644 index 0000000..427b3b2 --- /dev/null +++ b/tests/rdfa11/0060.xml @@ -0,0 +1,13 @@ + + + + + Test 0060 + + +
+

松本 后子

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0061.out b/tests/rdfa11/0061.out new file mode 100644 index 0000000..8562bb2 --- /dev/null +++ b/tests/rdfa11/0061.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0061.xml b/tests/rdfa11/0061.xml new file mode 100644 index 0000000..380eb35 --- /dev/null +++ b/tests/rdfa11/0061.xml @@ -0,0 +1,12 @@ + + + + + + Test 0061 + + + +

This is the first chapter in a series of chapters.

+ + diff --git a/tests/rdfa11/0062.out b/tests/rdfa11/0062.out new file mode 100644 index 0000000..f4a6365 --- /dev/null +++ b/tests/rdfa11/0062.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0062.xml b/tests/rdfa11/0062.xml new file mode 100644 index 0000000..d29dd31 --- /dev/null +++ b/tests/rdfa11/0062.xml @@ -0,0 +1,12 @@ + + + + + + Test 0062 + + + +

This is unit test #62. The next unit test is #63.

+ + diff --git a/tests/rdfa11/0063.out b/tests/rdfa11/0063.out new file mode 100644 index 0000000..3239933 --- /dev/null +++ b/tests/rdfa11/0063.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0063.xml b/tests/rdfa11/0063.xml new file mode 100644 index 0000000..aab4ade --- /dev/null +++ b/tests/rdfa11/0063.xml @@ -0,0 +1,11 @@ + + + + + Test 0063 + + + +

This is the 63rd test. The next test is #64.

+ + \ No newline at end of file diff --git a/tests/rdfa11/0064.out b/tests/rdfa11/0064.out new file mode 100644 index 0000000..dbee7e5 --- /dev/null +++ b/tests/rdfa11/0064.out @@ -0,0 +1 @@ +_:a . diff --git a/tests/rdfa11/0064.xml b/tests/rdfa11/0064.xml new file mode 100644 index 0000000..d7955f0 --- /dev/null +++ b/tests/rdfa11/0064.xml @@ -0,0 +1,12 @@ + + + + + Test 0064 + + +

Michael knows + Manu. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0065.out b/tests/rdfa11/0065.out new file mode 100644 index 0000000..b1ae56e --- /dev/null +++ b/tests/rdfa11/0065.out @@ -0,0 +1,3 @@ +_:a . +_:b . +_:a _:b . diff --git a/tests/rdfa11/0065.xml b/tests/rdfa11/0065.xml new file mode 100644 index 0000000..a21a778 --- /dev/null +++ b/tests/rdfa11/0065.xml @@ -0,0 +1,21 @@ + + + + + Test 0065 + + +
+ Manu Sporny can be reached via + email. + He knows Michael. +
+ +
+ Michael can be reached via + email. +
+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0066.out b/tests/rdfa11/0066.out new file mode 100644 index 0000000..3ba0a4a --- /dev/null +++ b/tests/rdfa11/0066.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0066.xml b/tests/rdfa11/0066.xml new file mode 100644 index 0000000..0b59195 --- /dev/null +++ b/tests/rdfa11/0066.xml @@ -0,0 +1,10 @@ + + + + + Test 0066 + + +

This is test #66.

+ + \ No newline at end of file diff --git a/tests/rdfa11/0067.out b/tests/rdfa11/0067.out new file mode 100644 index 0000000..bedebdf --- /dev/null +++ b/tests/rdfa11/0067.out @@ -0,0 +1 @@ + "Test 0067" . diff --git a/tests/rdfa11/0067.xml b/tests/rdfa11/0067.xml new file mode 100644 index 0000000..a3c9e69 --- /dev/null +++ b/tests/rdfa11/0067.xml @@ -0,0 +1,10 @@ + + + + + Test 0067 + + +

This is test #67.

+ + \ No newline at end of file diff --git a/tests/rdfa11/0068.out b/tests/rdfa11/0068.out new file mode 100644 index 0000000..ade3acc --- /dev/null +++ b/tests/rdfa11/0068.out @@ -0,0 +1 @@ + "Test 0067" . diff --git a/tests/rdfa11/0068.xml b/tests/rdfa11/0068.xml new file mode 100644 index 0000000..a4219c0 --- /dev/null +++ b/tests/rdfa11/0068.xml @@ -0,0 +1,13 @@ + + + + + Test 0068 + + +

+ The previous test was + Test 0067. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0069.out b/tests/rdfa11/0069.out new file mode 100644 index 0000000..5e2cd80 --- /dev/null +++ b/tests/rdfa11/0069.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0069.xml b/tests/rdfa11/0069.xml new file mode 100644 index 0000000..098c593 --- /dev/null +++ b/tests/rdfa11/0069.xml @@ -0,0 +1,12 @@ + + + + + Test 0069 + + +

The next test will be + Test 0070. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0070.out b/tests/rdfa11/0070.out new file mode 100644 index 0000000..3981691 --- /dev/null +++ b/tests/rdfa11/0070.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0070.xml b/tests/rdfa11/0070.xml new file mode 100644 index 0000000..1a8c28c --- /dev/null +++ b/tests/rdfa11/0070.xml @@ -0,0 +1,12 @@ + + + + + Test 0070 + + +

The previous test was + Test 0069. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0071.out b/tests/rdfa11/0071.out new file mode 100644 index 0000000..9a4d463 --- /dev/null +++ b/tests/rdfa11/0071.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0071.xml b/tests/rdfa11/0071.xml new file mode 100644 index 0000000..4749bba --- /dev/null +++ b/tests/rdfa11/0071.xml @@ -0,0 +1,14 @@ + + + + + Test 0071 + + +

This page is under a Creative Commons + + Attribution-No Derivatives 3.0 license. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0072.out b/tests/rdfa11/0072.out new file mode 100644 index 0000000..3756af9 --- /dev/null +++ b/tests/rdfa11/0072.out @@ -0,0 +1 @@ + "Example FAQ" . diff --git a/tests/rdfa11/0072.xml b/tests/rdfa11/0072.xml new file mode 100644 index 0000000..35accf5 --- /dev/null +++ b/tests/rdfa11/0072.xml @@ -0,0 +1,14 @@ + + + + + + Test 0072 + + +

+ Learn more by reading the example.org + Example FAQ. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0073.out b/tests/rdfa11/0073.out new file mode 100644 index 0000000..1ee3798 --- /dev/null +++ b/tests/rdfa11/0073.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0073.xml b/tests/rdfa11/0073.xml new file mode 100644 index 0000000..cac4c31 --- /dev/null +++ b/tests/rdfa11/0073.xml @@ -0,0 +1,14 @@ + + + + + + Test 0073 + + +

+ This article was written by + Jane. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0074.out b/tests/rdfa11/0074.out new file mode 100644 index 0000000..1ee3798 --- /dev/null +++ b/tests/rdfa11/0074.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0074.xml b/tests/rdfa11/0074.xml new file mode 100644 index 0000000..00335e5 --- /dev/null +++ b/tests/rdfa11/0074.xml @@ -0,0 +1,14 @@ + + + + + + Test 0074 + + +

+ This article was written by + Jane. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0075.out b/tests/rdfa11/0075.out new file mode 100644 index 0000000..037c1f3 --- /dev/null +++ b/tests/rdfa11/0075.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0075.xml b/tests/rdfa11/0075.xml new file mode 100644 index 0000000..413ae48 --- /dev/null +++ b/tests/rdfa11/0075.xml @@ -0,0 +1,14 @@ + + + + + + Test 0075 + + +

+ This page is under a Creative Commons + Attribution-No Derivatives 3.0 license. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0076.out b/tests/rdfa11/0076.out new file mode 100644 index 0000000..67617de --- /dev/null +++ b/tests/rdfa11/0076.out @@ -0,0 +1,23 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/rdfa11/0076.xml b/tests/rdfa11/0076.xml new file mode 100644 index 0000000..978602e --- /dev/null +++ b/tests/rdfa11/0076.xml @@ -0,0 +1,35 @@ + + + + + + Test 0076 + + +

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + + index + last + license + meta + + p3pv1 + + role + section + subsection + start + stylesheet + up +

+ + diff --git a/tests/rdfa11/0077.out b/tests/rdfa11/0077.out new file mode 100644 index 0000000..78547d1 --- /dev/null +++ b/tests/rdfa11/0077.out @@ -0,0 +1,24 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/rdfa11/0077.xml b/tests/rdfa11/0077.xml new file mode 100644 index 0000000..f1e0c0d --- /dev/null +++ b/tests/rdfa11/0077.xml @@ -0,0 +1,60 @@ + + + + + + Test 0077 + + +

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + icon + index + first + last + license + meta + next + p3pv1 + prev + role + section + subsection + start + stylesheet + up +

+ + diff --git a/tests/rdfa11/0079.out b/tests/rdfa11/0079.out new file mode 100644 index 0000000..b600268 --- /dev/null +++ b/tests/rdfa11/0079.out @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/rdfa11/0079.xml b/tests/rdfa11/0079.xml new file mode 100644 index 0000000..d5d9a54 --- /dev/null +++ b/tests/rdfa11/0079.xml @@ -0,0 +1,14 @@ + + + + + Test 0079 + + +
+

Ivan Herman

+

Tim Berners Lee

+

Dan Brickley

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0080.out b/tests/rdfa11/0080.out new file mode 100644 index 0000000..66e5baa --- /dev/null +++ b/tests/rdfa11/0080.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0080.xml b/tests/rdfa11/0080.xml new file mode 100644 index 0000000..973e618 --- /dev/null +++ b/tests/rdfa11/0080.xml @@ -0,0 +1,12 @@ + + + + + Test 0080 + + +
+

Dan Brickley

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0083.out b/tests/rdfa11/0083.out new file mode 100644 index 0000000..854ae53 --- /dev/null +++ b/tests/rdfa11/0083.out @@ -0,0 +1,6 @@ + _:a . + . +_:a "Ivan Herman" . +_:a . + . + "Dan Brickley" . diff --git a/tests/rdfa11/0083.xml b/tests/rdfa11/0083.xml new file mode 100644 index 0000000..4ced120 --- /dev/null +++ b/tests/rdfa11/0083.xml @@ -0,0 +1,14 @@ + + + + + Test 0083 + + +
+

Ivan Herman

+

mailto:ivan@w3.org

+

Dan Brickley

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0084.out b/tests/rdfa11/0084.out new file mode 100644 index 0000000..df51d3d --- /dev/null +++ b/tests/rdfa11/0084.out @@ -0,0 +1,8 @@ + _:a . + . +_:a . +_:a . +_:a "Ivan Herman" . + . + . + "Dan Brickley" . diff --git a/tests/rdfa11/0084.xml b/tests/rdfa11/0084.xml new file mode 100644 index 0000000..4189fa9 --- /dev/null +++ b/tests/rdfa11/0084.xml @@ -0,0 +1,17 @@ + + + + + Test 0084 + + +
+
+

Ivan Herman

+

mailto:ivan@w3.org

+

Dan Brickley

+ +
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0085.out b/tests/rdfa11/0085.out new file mode 100644 index 0000000..6432ea0 --- /dev/null +++ b/tests/rdfa11/0085.out @@ -0,0 +1,4 @@ + _:a . +_:a . +_:a . +_:a . diff --git a/tests/rdfa11/0085.xml b/tests/rdfa11/0085.xml new file mode 100644 index 0000000..5cb51ab --- /dev/null +++ b/tests/rdfa11/0085.xml @@ -0,0 +1,16 @@ + + + + + Test 0085 + + +
+
+

Ivan Herman

+

Tim Berners Lee

+

Dan Brickley

+
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0087.out b/tests/rdfa11/0087.out new file mode 100644 index 0000000..3b4a443 --- /dev/null +++ b/tests/rdfa11/0087.out @@ -0,0 +1,24 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/rdfa11/0087.xml b/tests/rdfa11/0087.xml new file mode 100644 index 0000000..ad589ba --- /dev/null +++ b/tests/rdfa11/0087.xml @@ -0,0 +1,35 @@ + + + + + Test 0087 + + +

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + icon + index + first + last + license + meta + next + p3pv1 + prev + role + section + subsection + start + stylesheet + up +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0088.out b/tests/rdfa11/0088.out new file mode 100644 index 0000000..d37e9dd --- /dev/null +++ b/tests/rdfa11/0088.out @@ -0,0 +1,3 @@ + _:a . +_:a . +_:a "Dan Brickley" . diff --git a/tests/rdfa11/0088.xml b/tests/rdfa11/0088.xml new file mode 100644 index 0000000..870c2fc --- /dev/null +++ b/tests/rdfa11/0088.xml @@ -0,0 +1,13 @@ + + + + + Test 0088 + + +
+

Dan Brickley

+

Dan Brickley again:-)

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0089.out b/tests/rdfa11/0089.out new file mode 100644 index 0000000..3630849 --- /dev/null +++ b/tests/rdfa11/0089.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0089.xml b/tests/rdfa11/0089.xml new file mode 100644 index 0000000..7283f2d --- /dev/null +++ b/tests/rdfa11/0089.xml @@ -0,0 +1,12 @@ + + + + + Test 0089 + + +
+ example image +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0091.out b/tests/rdfa11/0091.out new file mode 100644 index 0000000..f57f53e --- /dev/null +++ b/tests/rdfa11/0091.out @@ -0,0 +1,3 @@ +_:a "a bi-pedal primate" . +_:a "confused animal" . +_:a "Milky Way" . diff --git a/tests/rdfa11/0091.xml b/tests/rdfa11/0091.xml new file mode 100644 index 0000000..79f208b --- /dev/null +++ b/tests/rdfa11/0091.xml @@ -0,0 +1,16 @@ + + + + + Test 0091 + + +

+ A human is + a bi-pedal primate. + They are quite possibly one of the most + confused animals residing in the + Milky Way. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0093.out b/tests/rdfa11/0093.out new file mode 100644 index 0000000..6c96dd4 --- /dev/null +++ b/tests/rdfa11/0093.out @@ -0,0 +1,2 @@ + "Albert Einstein" . + "E = mc2: The Most Urgent Problem of Our Time"^^ . diff --git a/tests/rdfa11/0093.xml b/tests/rdfa11/0093.xml new file mode 100644 index 0000000..e076480 --- /dev/null +++ b/tests/rdfa11/0093.xml @@ -0,0 +1,14 @@ + + + + + Test 0093 + + +
+ Author: Albert Einstein +

E = mc2: The Most Urgent Problem of Our Time

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0099.out b/tests/rdfa11/0099.out new file mode 100644 index 0000000..a1389b0 --- /dev/null +++ b/tests/rdfa11/0099.out @@ -0,0 +1 @@ + "\n We put thirty spokes together and call it a wheel;\n But it is on the space where there is nothing that the usefulness of the wheel depends.\n We turn clay to make a vessel;\n But it is on the space where there is nothing that the usefulness of the vessel depends.\n We pierce doors and windows to make a house;\n And it is on these spaces where there is nothing that the usefulness of the house depends.\n Therefore just as we take advantage of what is, we should recognize the usefulness of what is not.\n\n Lao Tzu: Tao Te Ching" . diff --git a/tests/rdfa11/0099.xml b/tests/rdfa11/0099.xml new file mode 100644 index 0000000..822ce68 --- /dev/null +++ b/tests/rdfa11/0099.xml @@ -0,0 +1,19 @@ + + + + + Test 0099 + + +

+ We put thirty spokes together and call it a wheel; + But it is on the space where there is nothing that the usefulness of the wheel depends. + We turn clay to make a vessel; + But it is on the space where there is nothing that the usefulness of the vessel depends. + We pierce doors and windows to make a house; + And it is on these spaces where there is nothing that the usefulness of the house depends. + Therefore just as we take advantage of what is, we should recognize the usefulness of what is not. + + Lao Tzu: Tao Te Ching

+ + \ No newline at end of file diff --git a/tests/rdfa11/0104.out b/tests/rdfa11/0104.out new file mode 100644 index 0000000..50073cd --- /dev/null +++ b/tests/rdfa11/0104.out @@ -0,0 +1,3 @@ + _:a . +_:a "17" . +_:a "character" . diff --git a/tests/rdfa11/0104.xml b/tests/rdfa11/0104.xml new file mode 100644 index 0000000..2d990fa --- /dev/null +++ b/tests/rdfa11/0104.xml @@ -0,0 +1,17 @@ + + + + + Test 0104 + + +

+ The word "interfenestration" has + + 17 + characters. + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0106.out b/tests/rdfa11/0106.out new file mode 100644 index 0000000..3db1836 --- /dev/null +++ b/tests/rdfa11/0106.out @@ -0,0 +1 @@ + _:a . diff --git a/tests/rdfa11/0106.xml b/tests/rdfa11/0106.xml new file mode 100644 index 0000000..c7138c9 --- /dev/null +++ b/tests/rdfa11/0106.xml @@ -0,0 +1,12 @@ + + + + + Test 0106 + + +
+ Manu created this page. +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0107.out b/tests/rdfa11/0107.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa11/0107.xml b/tests/rdfa11/0107.xml new file mode 100644 index 0000000..2217ce7 --- /dev/null +++ b/tests/rdfa11/0107.xml @@ -0,0 +1,10 @@ + + + + + Test 0107 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0108.out b/tests/rdfa11/0108.out new file mode 100644 index 0000000..1a5c32d --- /dev/null +++ b/tests/rdfa11/0108.out @@ -0,0 +1 @@ + "\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03CC\n\u03AC\u03C3\u03C0\u03C1\u03BF \u03B4\u03B9\u03AC\u03C3\u03C4\u03B7\u03BC\u03B1\n"@el . diff --git a/tests/rdfa11/0108.xml b/tests/rdfa11/0108.xml new file mode 100644 index 0000000..eaf2cb9 --- /dev/null +++ b/tests/rdfa11/0108.xml @@ -0,0 +1,13 @@ + + + + + Test 0108 + + +

ελληνικό +άσπρο διάστημα +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0109.out b/tests/rdfa11/0109.out new file mode 100644 index 0000000..2cdc0f0 --- /dev/null +++ b/tests/rdfa11/0109.out @@ -0,0 +1 @@ + "Test 0109" . diff --git a/tests/rdfa11/0109.xml b/tests/rdfa11/0109.xml new file mode 100644 index 0000000..68a2e67 --- /dev/null +++ b/tests/rdfa11/0109.xml @@ -0,0 +1,14 @@ + + + + + Test 0109 + + + +
+

This is Test 0109.

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0110.out b/tests/rdfa11/0110.out new file mode 100644 index 0000000..dbe0b56 --- /dev/null +++ b/tests/rdfa11/0110.out @@ -0,0 +1 @@ + _:a . diff --git a/tests/rdfa11/0110.xml b/tests/rdfa11/0110.xml new file mode 100644 index 0000000..586b875 --- /dev/null +++ b/tests/rdfa11/0110.xml @@ -0,0 +1,12 @@ + + + + + Test 0110 + + +
+
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0111.out b/tests/rdfa11/0111.out new file mode 100644 index 0000000..f788f8e --- /dev/null +++ b/tests/rdfa11/0111.out @@ -0,0 +1,2 @@ + _:a . +_:a _:b . diff --git a/tests/rdfa11/0111.xml b/tests/rdfa11/0111.xml new file mode 100644 index 0000000..50bd9c2 --- /dev/null +++ b/tests/rdfa11/0111.xml @@ -0,0 +1,14 @@ + + + + + Test 0111 + + +
+
+
+
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0112.out b/tests/rdfa11/0112.out new file mode 100644 index 0000000..0359dad --- /dev/null +++ b/tests/rdfa11/0112.out @@ -0,0 +1 @@ + "not an XML Literal,\nwhitespace preserved\n" . diff --git a/tests/rdfa11/0112.xml b/tests/rdfa11/0112.xml new file mode 100644 index 0000000..f17a428 --- /dev/null +++ b/tests/rdfa11/0112.xml @@ -0,0 +1,15 @@ + + + + + Test 0112 + + +

+ not an XML Literal, +whitespace preserved + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0113.out b/tests/rdfa11/0113.out new file mode 100644 index 0000000..5363635 --- /dev/null +++ b/tests/rdfa11/0113.out @@ -0,0 +1,2 @@ + "" . + "" . diff --git a/tests/rdfa11/0113.xml b/tests/rdfa11/0113.xml new file mode 100644 index 0000000..4dbe2fe --- /dev/null +++ b/tests/rdfa11/0113.xml @@ -0,0 +1,11 @@ + + + + + Test 0113 + + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0114.out b/tests/rdfa11/0114.out new file mode 100644 index 0000000..ce68623 --- /dev/null +++ b/tests/rdfa11/0114.out @@ -0,0 +1,8 @@ + . + . + . + . + . + . + . + . diff --git a/tests/rdfa11/0114.xml b/tests/rdfa11/0114.xml new file mode 100644 index 0000000..76caa12 --- /dev/null +++ b/tests/rdfa11/0114.xml @@ -0,0 +1,21 @@ + + + + + Test 0114 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0115.out b/tests/rdfa11/0115.out new file mode 100644 index 0000000..7fd325b --- /dev/null +++ b/tests/rdfa11/0115.out @@ -0,0 +1,4 @@ + ">" . + "Ben & Co." . + "@" . + "@" . diff --git a/tests/rdfa11/0115.xml b/tests/rdfa11/0115.xml new file mode 100644 index 0000000..81e0288 --- /dev/null +++ b/tests/rdfa11/0115.xml @@ -0,0 +1,16 @@ + + + + + Test 0115 + + +

Description: XML entities in the RDFa content

+

+ > + Ben & Co. + @ + @ +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0117.out b/tests/rdfa11/0117.out new file mode 100644 index 0000000..024ca4f --- /dev/null +++ b/tests/rdfa11/0117.out @@ -0,0 +1,2 @@ + "Test 0117" . + "Mark Birbeck" . diff --git a/tests/rdfa11/0117.xml b/tests/rdfa11/0117.xml new file mode 100644 index 0000000..4ee4b32 --- /dev/null +++ b/tests/rdfa11/0117.xml @@ -0,0 +1,14 @@ + + + + + + Test 0117 + + +

+ Mark Birbeck + added this triple test. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0118.out b/tests/rdfa11/0118.out new file mode 100644 index 0000000..9bad5c3 --- /dev/null +++ b/tests/rdfa11/0118.out @@ -0,0 +1 @@ + "Ben" . diff --git a/tests/rdfa11/0118.xml b/tests/rdfa11/0118.xml new file mode 100644 index 0000000..38631af --- /dev/null +++ b/tests/rdfa11/0118.xml @@ -0,0 +1,16 @@ + + + + + Test 0118 + + +

+ Check to see if parsers get confused when "" is + interpreted as NULL in some chaining cases. + Ben +

+ + + \ No newline at end of file diff --git a/tests/rdfa11/0119.out b/tests/rdfa11/0119.out new file mode 100644 index 0000000..72b1b09 --- /dev/null +++ b/tests/rdfa11/0119.out @@ -0,0 +1 @@ + "Example Website" . diff --git a/tests/rdfa11/0119.xml b/tests/rdfa11/0119.xml new file mode 100644 index 0000000..3f872d6 --- /dev/null +++ b/tests/rdfa11/0119.xml @@ -0,0 +1,18 @@ + + + + + Test 0119 + + +
+

+ The + Example Website + is used in many W3C tutorials. +

+
+ + + \ No newline at end of file diff --git a/tests/rdfa11/0120.out b/tests/rdfa11/0120.out new file mode 100644 index 0000000..01a237d --- /dev/null +++ b/tests/rdfa11/0120.out @@ -0,0 +1 @@ + "The XHTML Vocabulary Document" . diff --git a/tests/rdfa11/0120.xml b/tests/rdfa11/0120.xml new file mode 100644 index 0000000..8735eb1 --- /dev/null +++ b/tests/rdfa11/0120.xml @@ -0,0 +1,15 @@ + + + + + Test 0120 + + +

+ The + The XHTML Vocabulary Document + is the default prefix for XHTML+RDFa 1.0. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0121.out b/tests/rdfa11/0121.out new file mode 100644 index 0000000..515f701 --- /dev/null +++ b/tests/rdfa11/0121.out @@ -0,0 +1,2 @@ + "Test Case 0121" . + "Shane McCarron" . diff --git a/tests/rdfa11/0121.xml b/tests/rdfa11/0121.xml new file mode 100644 index 0000000..b0d573a --- /dev/null +++ b/tests/rdfa11/0121.xml @@ -0,0 +1,23 @@ + + + + + Test 0121 + + +
+

+ Test Case 0121 + checks to make sure RDFa processors resolve the empty CURIE correctly. +

+ Shane McCarron + contributed to this test. +

+

+
+ + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0122.out b/tests/rdfa11/0122.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa11/0122.xml b/tests/rdfa11/0122.xml new file mode 100644 index 0000000..6cbe23b --- /dev/null +++ b/tests/rdfa11/0122.xml @@ -0,0 +1,16 @@ + + + + + Test 0122 + + +

+ This section is contained below the main site. +

+ + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0126.out b/tests/rdfa11/0126.out new file mode 100644 index 0000000..9bf0b7a --- /dev/null +++ b/tests/rdfa11/0126.out @@ -0,0 +1,3 @@ + . + . + "My article" . diff --git a/tests/rdfa11/0126.xml b/tests/rdfa11/0126.xml new file mode 100644 index 0000000..3dbb78a --- /dev/null +++ b/tests/rdfa11/0126.xml @@ -0,0 +1,14 @@ + + + + + Test 0126 + + +
+

My article

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0131.out b/tests/rdfa11/0131.out new file mode 100644 index 0000000..b3e2547 --- /dev/null +++ b/tests/rdfa11/0131.out @@ -0,0 +1,5 @@ + . + . + . + . + . diff --git a/tests/rdfa11/0131.xml b/tests/rdfa11/0131.xml new file mode 100644 index 0000000..f24b722 --- /dev/null +++ b/tests/rdfa11/0131.xml @@ -0,0 +1,10 @@ + + + + + Test + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0134.out b/tests/rdfa11/0134.out new file mode 100644 index 0000000..8bed4aa --- /dev/null +++ b/tests/rdfa11/0134.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0134.xml b/tests/rdfa11/0134.xml new file mode 100644 index 0000000..d352c4b --- /dev/null +++ b/tests/rdfa11/0134.xml @@ -0,0 +1,10 @@ + + + + + Test + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0140.out b/tests/rdfa11/0140.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfa11/0140.xml b/tests/rdfa11/0140.xml new file mode 100644 index 0000000..2876574 --- /dev/null +++ b/tests/rdfa11/0140.xml @@ -0,0 +1,11 @@ + + + + + Blank-node as Predicate Test + + +

Blank Nodes are not allowed to be predicate identifiers in RDF:

+

Test

+ + \ No newline at end of file diff --git a/tests/rdfa11/0147.out b/tests/rdfa11/0147.out new file mode 100644 index 0000000..8dbe80f --- /dev/null +++ b/tests/rdfa11/0147.out @@ -0,0 +1 @@ + "Test" . diff --git a/tests/rdfa11/0147.xml b/tests/rdfa11/0147.xml new file mode 100644 index 0000000..1d6b062 --- /dev/null +++ b/tests/rdfa11/0147.xml @@ -0,0 +1,10 @@ + + + + + Test + + +

Test

+ + \ No newline at end of file diff --git a/tests/rdfa11/0172.out b/tests/rdfa11/0172.out new file mode 100644 index 0000000..989f53a --- /dev/null +++ b/tests/rdfa11/0172.out @@ -0,0 +1 @@ + "A plain literal with a lang tag."@en . diff --git a/tests/rdfa11/0172.xml b/tests/rdfa11/0172.xml new file mode 100644 index 0000000..cae8618 --- /dev/null +++ b/tests/rdfa11/0172.xml @@ -0,0 +1,13 @@ + + + + + + Test 0172 + + + +

A plain literal with a lang tag.

+ + diff --git a/tests/rdfa11/0173.out b/tests/rdfa11/0173.out new file mode 100644 index 0000000..fcecb33 --- /dev/null +++ b/tests/rdfa11/0173.out @@ -0,0 +1 @@ + "Just a plain literal." . diff --git a/tests/rdfa11/0173.xml b/tests/rdfa11/0173.xml new file mode 100644 index 0000000..35a6a4b --- /dev/null +++ b/tests/rdfa11/0173.xml @@ -0,0 +1,13 @@ + + + + + + Test 0173 + + + +

Just a plain literal.

+ + diff --git a/tests/rdfa11/0174.out b/tests/rdfa11/0174.out new file mode 100644 index 0000000..5f559e7 --- /dev/null +++ b/tests/rdfa11/0174.out @@ -0,0 +1 @@ + "John Doe" . diff --git a/tests/rdfa11/0174.xml b/tests/rdfa11/0174.xml new file mode 100644 index 0000000..240fcc5 --- /dev/null +++ b/tests/rdfa11/0174.xml @@ -0,0 +1,15 @@ + + + + + Test 0174 + + +

+ This test ensures that single-character prefixes are allowed. + My name is: + John Doe +

+ + + \ No newline at end of file diff --git a/tests/rdfa11/0175.out b/tests/rdfa11/0175.out new file mode 100644 index 0000000..f3fe37c --- /dev/null +++ b/tests/rdfa11/0175.out @@ -0,0 +1 @@ +_:a "Gregg Kellogg" . diff --git a/tests/rdfa11/0175.xml b/tests/rdfa11/0175.xml new file mode 100644 index 0000000..8702a1c --- /dev/null +++ b/tests/rdfa11/0175.xml @@ -0,0 +1,12 @@ + + + + + Test 0175 + + +

My name is + Gregg Kellogg. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0176.out b/tests/rdfa11/0176.out new file mode 100644 index 0000000..5d40365 --- /dev/null +++ b/tests/rdfa11/0176.out @@ -0,0 +1,4 @@ +_:manu . +_:manu _:gregg . +_:gregg _:manu . +_:gregg . diff --git a/tests/rdfa11/0176.xml b/tests/rdfa11/0176.xml new file mode 100644 index 0000000..763d107 --- /dev/null +++ b/tests/rdfa11/0176.xml @@ -0,0 +1,22 @@ + + + + + Test 0176 + + +
+ Manu can be reached via + email. + He knows Gregg. + Who knows Manu. +
+ +
+ Gregg can be reached via + email. +
+ + + + \ No newline at end of file diff --git a/tests/rdfa11/0177.out b/tests/rdfa11/0177.out new file mode 100644 index 0000000..18dce01 --- /dev/null +++ b/tests/rdfa11/0177.out @@ -0,0 +1 @@ + "Ivan Herman" . diff --git a/tests/rdfa11/0177.xml b/tests/rdfa11/0177.xml new file mode 100644 index 0000000..d575a44 --- /dev/null +++ b/tests/rdfa11/0177.xml @@ -0,0 +1,13 @@ + + + + + Test 0177 + + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0178.out b/tests/rdfa11/0178.out new file mode 100644 index 0000000..476c929 --- /dev/null +++ b/tests/rdfa11/0178.out @@ -0,0 +1,2 @@ + . + "A particular agent" . diff --git a/tests/rdfa11/0178.xml b/tests/rdfa11/0178.xml new file mode 100644 index 0000000..0b3a3fb --- /dev/null +++ b/tests/rdfa11/0178.xml @@ -0,0 +1,13 @@ + + + + + Test 0178 + + + +
+

A particular agent

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0179.out b/tests/rdfa11/0179.out new file mode 100644 index 0000000..18dce01 --- /dev/null +++ b/tests/rdfa11/0179.out @@ -0,0 +1 @@ + "Ivan Herman" . diff --git a/tests/rdfa11/0179.xml b/tests/rdfa11/0179.xml new file mode 100644 index 0000000..2e30a7c --- /dev/null +++ b/tests/rdfa11/0179.xml @@ -0,0 +1,14 @@ + + + + + Test 0179 + + + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0180.out b/tests/rdfa11/0180.out new file mode 100644 index 0000000..5fc9cba --- /dev/null +++ b/tests/rdfa11/0180.out @@ -0,0 +1 @@ + "Ivan Herman" . diff --git a/tests/rdfa11/0180.xml b/tests/rdfa11/0180.xml new file mode 100644 index 0000000..0c05943 --- /dev/null +++ b/tests/rdfa11/0180.xml @@ -0,0 +1,13 @@ + + + + + Test 0180 + + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0181.out b/tests/rdfa11/0181.out new file mode 100644 index 0000000..aa88a78 --- /dev/null +++ b/tests/rdfa11/0181.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0181.xml b/tests/rdfa11/0181.xml new file mode 100644 index 0000000..900fa90 --- /dev/null +++ b/tests/rdfa11/0181.xml @@ -0,0 +1,12 @@ + + + + + Test 0181 + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0182.out b/tests/rdfa11/0182.out new file mode 100644 index 0000000..476c929 --- /dev/null +++ b/tests/rdfa11/0182.out @@ -0,0 +1,2 @@ + . + "A particular agent" . diff --git a/tests/rdfa11/0182.xml b/tests/rdfa11/0182.xml new file mode 100644 index 0000000..c525423 --- /dev/null +++ b/tests/rdfa11/0182.xml @@ -0,0 +1,15 @@ + + + + + Test 0182 + + + +
+
+

A particular agent

+
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0183.out b/tests/rdfa11/0183.out new file mode 100644 index 0000000..476c929 --- /dev/null +++ b/tests/rdfa11/0183.out @@ -0,0 +1,2 @@ + . + "A particular agent" . diff --git a/tests/rdfa11/0183.xml b/tests/rdfa11/0183.xml new file mode 100644 index 0000000..408b29d --- /dev/null +++ b/tests/rdfa11/0183.xml @@ -0,0 +1,15 @@ + + + + + Test 0183 + + + +
+
+

A particular agent

+
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0186.out b/tests/rdfa11/0186.out new file mode 100644 index 0000000..3a164f2 --- /dev/null +++ b/tests/rdfa11/0186.out @@ -0,0 +1,2 @@ + . + "Ivan Herman" . diff --git a/tests/rdfa11/0186.xml b/tests/rdfa11/0186.xml new file mode 100644 index 0000000..ae9116d --- /dev/null +++ b/tests/rdfa11/0186.xml @@ -0,0 +1,13 @@ + + + + + Test 0186 + + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0187.out b/tests/rdfa11/0187.out new file mode 100644 index 0000000..146542c --- /dev/null +++ b/tests/rdfa11/0187.out @@ -0,0 +1,3 @@ + . + . + "Ivan Herman" . diff --git a/tests/rdfa11/0187.xml b/tests/rdfa11/0187.xml new file mode 100644 index 0000000..da916fc --- /dev/null +++ b/tests/rdfa11/0187.xml @@ -0,0 +1,15 @@ + + + + + Test 0187 + + + +
+
+

Ivan Herman

+
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0188.out b/tests/rdfa11/0188.out new file mode 100644 index 0000000..3a164f2 --- /dev/null +++ b/tests/rdfa11/0188.out @@ -0,0 +1,2 @@ + . + "Ivan Herman" . diff --git a/tests/rdfa11/0188.xml b/tests/rdfa11/0188.xml new file mode 100644 index 0000000..b3f656f --- /dev/null +++ b/tests/rdfa11/0188.xml @@ -0,0 +1,15 @@ + + + + + Test 0188 + + + +
+
+

Ivan Herman

+
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0189.out b/tests/rdfa11/0189.out new file mode 100644 index 0000000..a1c91b3 --- /dev/null +++ b/tests/rdfa11/0189.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa11/0189.xml b/tests/rdfa11/0189.xml new file mode 100644 index 0000000..ea43b0c --- /dev/null +++ b/tests/rdfa11/0189.xml @@ -0,0 +1,12 @@ + + + + + Test 0189 + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0190.out b/tests/rdfa11/0190.out new file mode 100644 index 0000000..aa88a78 --- /dev/null +++ b/tests/rdfa11/0190.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0190.xml b/tests/rdfa11/0190.xml new file mode 100644 index 0000000..9f0770a --- /dev/null +++ b/tests/rdfa11/0190.xml @@ -0,0 +1,12 @@ + + + + + Test 0190 + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0196.out b/tests/rdfa11/0196.out new file mode 100644 index 0000000..3ff8d24 --- /dev/null +++ b/tests/rdfa11/0196.out @@ -0,0 +1,2 @@ + "This is an XMLLiteral"^^ . + "This is a plain literal" . diff --git a/tests/rdfa11/0196.xml b/tests/rdfa11/0196.xml new file mode 100644 index 0000000..90124e9 --- /dev/null +++ b/tests/rdfa11/0196.xml @@ -0,0 +1,14 @@ + + + + + Test 0196 + + +
+

This is an XMLLiteral

+

This is a plain literal

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0197.out b/tests/rdfa11/0197.out new file mode 100644 index 0000000..42d5103 --- /dev/null +++ b/tests/rdfa11/0197.out @@ -0,0 +1,5 @@ + . + "Gregg Kellogg" . + "Ruby"^^ . + . + . diff --git a/tests/rdfa11/0197.xml b/tests/rdfa11/0197.xml new file mode 100644 index 0000000..0d16e53 --- /dev/null +++ b/tests/rdfa11/0197.xml @@ -0,0 +1,14 @@ + + + + + Test 0197 + + + +

Gregg Kellogg

+

Ruby

+

Kellogg Associates

+

Ruby Gem

+ + \ No newline at end of file diff --git a/tests/rdfa11/0198.out b/tests/rdfa11/0198.out new file mode 100644 index 0000000..51690df --- /dev/null +++ b/tests/rdfa11/0198.out @@ -0,0 +1,4 @@ + . + "Mark Birbeck"^^ . + "Mark" . + "Birbeck" . diff --git a/tests/rdfa11/0198.xml b/tests/rdfa11/0198.xml new file mode 100644 index 0000000..6567671 --- /dev/null +++ b/tests/rdfa11/0198.xml @@ -0,0 +1,16 @@ + + + + + Test 0198 + + + +
+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0201.out b/tests/rdfa11/0201.out new file mode 100644 index 0000000..327cf03 --- /dev/null +++ b/tests/rdfa11/0201.out @@ -0,0 +1 @@ + "A yellow rectangle with sharp corners." . diff --git a/tests/rdfa11/0201.xml b/tests/rdfa11/0201.xml new file mode 100644 index 0000000..fa9f4e9 --- /dev/null +++ b/tests/rdfa11/0201.xml @@ -0,0 +1,12 @@ + + + A yellow rectangle with sharp corners. + + + + + diff --git a/tests/rdfa11/0202.out b/tests/rdfa11/0202.out new file mode 100644 index 0000000..bf0d427 --- /dev/null +++ b/tests/rdfa11/0202.out @@ -0,0 +1 @@ + "A yellow rectangle with sharp corners." . diff --git a/tests/rdfa11/0202.xml b/tests/rdfa11/0202.xml new file mode 100644 index 0000000..23452e8 --- /dev/null +++ b/tests/rdfa11/0202.xml @@ -0,0 +1,14 @@ + + + version="1.2" + baseProfile="tiny" + A yellow rectangle with sharp corners. + + + + diff --git a/tests/rdfa11/0203.out b/tests/rdfa11/0203.out new file mode 100644 index 0000000..bf0d427 --- /dev/null +++ b/tests/rdfa11/0203.out @@ -0,0 +1 @@ + "A yellow rectangle with sharp corners." . diff --git a/tests/rdfa11/0203.xml b/tests/rdfa11/0203.xml new file mode 100644 index 0000000..a5cdfc6 --- /dev/null +++ b/tests/rdfa11/0203.xml @@ -0,0 +1,14 @@ + + + version="1.2" + baseProfile="tiny" + A yellow rectangle with sharp corners. + + + + . diff --git a/tests/rdfa11/0206.xml b/tests/rdfa11/0206.xml new file mode 100644 index 0000000..1f01f37 --- /dev/null +++ b/tests/rdfa11/0206.xml @@ -0,0 +1,13 @@ + + + + + Default context test 0206 + + +

+ An OWL Axiom: "xsd:maxExclusive" is a Datatype Property in OWL. +

+ + + \ No newline at end of file diff --git a/tests/rdfa11/0207.out b/tests/rdfa11/0207.out new file mode 100644 index 0000000..c78413b --- /dev/null +++ b/tests/rdfa11/0207.out @@ -0,0 +1,6 @@ + . + "Weekend off in Iona" . + "2006-10-21"^^ . + "2006-10-23"^^ . + . + "Iona, UK" . diff --git a/tests/rdfa11/0207.xml b/tests/rdfa11/0207.xml new file mode 100644 index 0000000..d6c3ffd --- /dev/null +++ b/tests/rdfa11/0207.xml @@ -0,0 +1,17 @@ + + + + + Test 0207 + + +

+ Weekend off in Iona: + Oct 21st + to Oct 23rd. + See FreeTime.Example.org for + info on Iona, UK. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0213.out b/tests/rdfa11/0213.out new file mode 100644 index 0000000..bc9c2e6 --- /dev/null +++ b/tests/rdfa11/0213.out @@ -0,0 +1 @@ + "E = mc2: The Most Urgent Problem of Our Time" . diff --git a/tests/rdfa11/0213.xml b/tests/rdfa11/0213.xml new file mode 100644 index 0000000..090a74f --- /dev/null +++ b/tests/rdfa11/0213.xml @@ -0,0 +1,14 @@ + + + + + Test 0213 + + + +
+

E = mc2: The Most Urgent Problem of Our Time

+
+ + + \ No newline at end of file diff --git a/tests/rdfa11/0214.out b/tests/rdfa11/0214.out new file mode 100644 index 0000000..ce149ac --- /dev/null +++ b/tests/rdfa11/0214.out @@ -0,0 +1,2 @@ + . + "Test 0214" . diff --git a/tests/rdfa11/0214.xml b/tests/rdfa11/0214.xml new file mode 100644 index 0000000..73a7014 --- /dev/null +++ b/tests/rdfa11/0214.xml @@ -0,0 +1,10 @@ + + + + + Test 0214 + + +

This document has a title.

+ + \ No newline at end of file diff --git a/tests/rdfa11/0216.out b/tests/rdfa11/0216.out new file mode 100644 index 0000000..6d5b231 --- /dev/null +++ b/tests/rdfa11/0216.out @@ -0,0 +1 @@ + "Iv\u00E1n" . diff --git a/tests/rdfa11/0216.xml b/tests/rdfa11/0216.xml new file mode 100644 index 0000000..eed700c --- /dev/null +++ b/tests/rdfa11/0216.xml @@ -0,0 +1,31 @@ + + + + + + + + +

Iván

+ + \ No newline at end of file diff --git a/tests/rdfa11/0217.out b/tests/rdfa11/0217.out new file mode 100644 index 0000000..2b4db16 --- /dev/null +++ b/tests/rdfa11/0217.out @@ -0,0 +1,2 @@ + "Gregg Kellogg" . + . diff --git a/tests/rdfa11/0217.xml b/tests/rdfa11/0217.xml new file mode 100644 index 0000000..0dfbeae --- /dev/null +++ b/tests/rdfa11/0217.xml @@ -0,0 +1,13 @@ + + + + + Test 0217 + + + +
+

Gregg Kellogg

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0218.out b/tests/rdfa11/0218.out new file mode 100644 index 0000000..a2ede83 --- /dev/null +++ b/tests/rdfa11/0218.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0218.xml b/tests/rdfa11/0218.xml new file mode 100644 index 0000000..830f6b1 --- /dev/null +++ b/tests/rdfa11/0218.xml @@ -0,0 +1,12 @@ + + + + + Test 0218 + + +
+

+

+ + \ No newline at end of file diff --git a/tests/rdfa11/0219.out b/tests/rdfa11/0219.out new file mode 100644 index 0000000..57bf1f2 --- /dev/null +++ b/tests/rdfa11/0219.out @@ -0,0 +1,3 @@ + _:bnodeid1 . +_:bnodeid1 "Foo" . +_:bnodeid1 . diff --git a/tests/rdfa11/0219.xml b/tests/rdfa11/0219.xml new file mode 100644 index 0000000..1f72945 --- /dev/null +++ b/tests/rdfa11/0219.xml @@ -0,0 +1,12 @@ + + + + + Test 0219 + + +
+

Foo

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0220.out b/tests/rdfa11/0220.out new file mode 100644 index 0000000..3a9d3fe --- /dev/null +++ b/tests/rdfa11/0220.out @@ -0,0 +1,4 @@ + . +_:bnode0 . +_:bnode0 . + _:bnode0 . diff --git a/tests/rdfa11/0220.xml b/tests/rdfa11/0220.xml new file mode 100644 index 0000000..6767896 --- /dev/null +++ b/tests/rdfa11/0220.xml @@ -0,0 +1,12 @@ + + + + + Test 0220 + + +
+ Foo +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0221.out b/tests/rdfa11/0221.out new file mode 100644 index 0000000..f8898b5 --- /dev/null +++ b/tests/rdfa11/0221.out @@ -0,0 +1,6 @@ + . +_:bnode0 "Foo" . +_:bnode0 _:bnode1 . +_:bnode1 . +_:bnode1 . + _:bnode0 . diff --git a/tests/rdfa11/0221.xml b/tests/rdfa11/0221.xml new file mode 100644 index 0000000..3b0143c --- /dev/null +++ b/tests/rdfa11/0221.xml @@ -0,0 +1,13 @@ + + + + + Test 0221 + + +
+

Foo

+ Foo +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0222.out b/tests/rdfa11/0222.out new file mode 100644 index 0000000..8f55346 --- /dev/null +++ b/tests/rdfa11/0222.out @@ -0,0 +1,5 @@ + _:bnodeid2 . +_:bnodeid1 "Bar" . +_:bnodeid1 . +_:bnodeid2 "Foo" . +_:bnodeid2 _:bnodeid1 . diff --git a/tests/rdfa11/0222.xml b/tests/rdfa11/0222.xml new file mode 100644 index 0000000..6cf18e5 --- /dev/null +++ b/tests/rdfa11/0222.xml @@ -0,0 +1,13 @@ + + + + + Test 0222 + + +
+

Foo

+

Bar

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0223.out b/tests/rdfa11/0223.out new file mode 100644 index 0000000..cdc792d --- /dev/null +++ b/tests/rdfa11/0223.out @@ -0,0 +1,6 @@ + _:bnodeid2 . +_:bnodeid1 "Bar" . +_:bnodeid1 . +_:bnodeid2 "Foo" . +_:bnodeid2 _:bnodeid1 . + "Baz" . diff --git a/tests/rdfa11/0223.xml b/tests/rdfa11/0223.xml new file mode 100644 index 0000000..7282f9e --- /dev/null +++ b/tests/rdfa11/0223.xml @@ -0,0 +1,14 @@ + + + + + Test 0223 + + +
+

Foo

+

Bar

+

Baz

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0224.out b/tests/rdfa11/0224.out new file mode 100644 index 0000000..d086d21 --- /dev/null +++ b/tests/rdfa11/0224.out @@ -0,0 +1,5 @@ + _:bnodeid2 . +_:bnodeid1 . +_:bnodeid1 . +_:bnodeid2 . +_:bnodeid2 _:bnodeid1 . diff --git a/tests/rdfa11/0224.xml b/tests/rdfa11/0224.xml new file mode 100644 index 0000000..bf37b41 --- /dev/null +++ b/tests/rdfa11/0224.xml @@ -0,0 +1,15 @@ + + + + + Test 0224 + + +
+
    +
  1. Foo
  2. +
  3. Bar
  4. +
+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0225.out b/tests/rdfa11/0225.out new file mode 100644 index 0000000..662603a --- /dev/null +++ b/tests/rdfa11/0225.out @@ -0,0 +1,6 @@ + _:bnodeid1 . +_:bnodeid1 "Foo" . +_:bnodeid1 . + _:bnodeid2 . +_:bnodeid2 "Bar" . +_:bnodeid2 . diff --git a/tests/rdfa11/0225.xml b/tests/rdfa11/0225.xml new file mode 100644 index 0000000..9e69694 --- /dev/null +++ b/tests/rdfa11/0225.xml @@ -0,0 +1,15 @@ + + + + + Test 0225 + + +
+

Foo

+
+
+

Bar

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0226.out b/tests/rdfa11/0226.out new file mode 100644 index 0000000..c0182f2 --- /dev/null +++ b/tests/rdfa11/0226.out @@ -0,0 +1,7 @@ + _:bnodeid1 . +_:bnodeid1 "Foo" . +_:bnodeid1 . + . + _:bnodeid2 . +_:bnodeid2 "Bar" . +_:bnodeid2 . diff --git a/tests/rdfa11/0226.xml b/tests/rdfa11/0226.xml new file mode 100644 index 0000000..75f7cdf --- /dev/null +++ b/tests/rdfa11/0226.xml @@ -0,0 +1,15 @@ + + + + + Test 0226 + + +
+

Foo

+ +

Bar

+
+
+ + diff --git a/tests/rdfa11/0227.out b/tests/rdfa11/0227.out new file mode 100644 index 0000000..4e2af4e --- /dev/null +++ b/tests/rdfa11/0227.out @@ -0,0 +1,7 @@ + _:bnodeid1 . +_:bnodeid1 "Foo" . +_:bnodeid1 . + . + _:bnodeid2 . +_:bnodeid2 "Bar" . +_:bnodeid2 . diff --git a/tests/rdfa11/0227.xml b/tests/rdfa11/0227.xml new file mode 100644 index 0000000..3a841f6 --- /dev/null +++ b/tests/rdfa11/0227.xml @@ -0,0 +1,15 @@ + + + + + Test 0227 + + +
+

Foo

+ +

Bar

+
+
+ + diff --git a/tests/rdfa11/0228.out b/tests/rdfa11/0228.out new file mode 100644 index 0000000..a5dbf2d --- /dev/null +++ b/tests/rdfa11/0228.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0228.xml b/tests/rdfa11/0228.xml new file mode 100644 index 0000000..22c734e --- /dev/null +++ b/tests/rdfa11/0228.xml @@ -0,0 +1,16 @@ + + + + + Test 0228 + + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0229.out b/tests/rdfa11/0229.out new file mode 100644 index 0000000..fe7d7f5 --- /dev/null +++ b/tests/rdfa11/0229.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0229.xml b/tests/rdfa11/0229.xml new file mode 100644 index 0000000..043ba2d --- /dev/null +++ b/tests/rdfa11/0229.xml @@ -0,0 +1,14 @@ + + + + + Test 0042 + + +
+ A photo depicting Michael +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0230.out b/tests/rdfa11/0230.out new file mode 100644 index 0000000..5d137dd --- /dev/null +++ b/tests/rdfa11/0230.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0230.xml b/tests/rdfa11/0230.xml new file mode 100644 index 0000000..eec1c70 --- /dev/null +++ b/tests/rdfa11/0230.xml @@ -0,0 +1,16 @@ + + + + + Test 0230 + + +
+ example image +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0231.out b/tests/rdfa11/0231.out new file mode 100644 index 0000000..d902862 --- /dev/null +++ b/tests/rdfa11/0231.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0231.xml b/tests/rdfa11/0231.xml new file mode 100644 index 0000000..16765eb --- /dev/null +++ b/tests/rdfa11/0231.xml @@ -0,0 +1,12 @@ + + + + + Test 0231 + + +
+ example image +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0232.out b/tests/rdfa11/0232.out new file mode 100644 index 0000000..898a7d8 --- /dev/null +++ b/tests/rdfa11/0232.out @@ -0,0 +1,3 @@ + _:a . +_:a . +_:a "John Doe" . diff --git a/tests/rdfa11/0232.xml b/tests/rdfa11/0232.xml new file mode 100644 index 0000000..85b893b --- /dev/null +++ b/tests/rdfa11/0232.xml @@ -0,0 +1,12 @@ + + + + + Test 0232 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0233.out b/tests/rdfa11/0233.out new file mode 100644 index 0000000..9b66f72 --- /dev/null +++ b/tests/rdfa11/0233.out @@ -0,0 +1,3 @@ + . + . + "John Doe" . diff --git a/tests/rdfa11/0233.xml b/tests/rdfa11/0233.xml new file mode 100644 index 0000000..4b351fc --- /dev/null +++ b/tests/rdfa11/0233.xml @@ -0,0 +1,12 @@ + + + + + Test 0233 + + +
+

John Doe

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0234.out b/tests/rdfa11/0234.out new file mode 100644 index 0000000..a81c4bd --- /dev/null +++ b/tests/rdfa11/0234.out @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/rdfa11/0234.xml b/tests/rdfa11/0234.xml new file mode 100644 index 0000000..3f9879e --- /dev/null +++ b/tests/rdfa11/0234.xml @@ -0,0 +1,14 @@ + + + + + Test 0234 + + +

+ describedby + license + role +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0235.out b/tests/rdfa11/0235.out new file mode 100644 index 0000000..fef0d0e --- /dev/null +++ b/tests/rdfa11/0235.out @@ -0,0 +1 @@ + "rdfagraph" . diff --git a/tests/rdfa11/0235.xml b/tests/rdfa11/0235.xml new file mode 100644 index 0000000..79b450d --- /dev/null +++ b/tests/rdfa11/0235.xml @@ -0,0 +1,13 @@ + + + + + Test 0235 + + +

+ The rdfagraph should not generate triples when + looking only at the processor graph. +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0236.out b/tests/rdfa11/0236.out new file mode 100644 index 0000000..9143011 --- /dev/null +++ b/tests/rdfa11/0236.out @@ -0,0 +1 @@ +_:s . diff --git a/tests/rdfa11/0236.xml b/tests/rdfa11/0236.xml new file mode 100644 index 0000000..93c5a86 --- /dev/null +++ b/tests/rdfa11/0236.xml @@ -0,0 +1,7 @@ + + + + + Test 0236 + + \ No newline at end of file diff --git a/tests/rdfa11/0237.out b/tests/rdfa11/0237.out new file mode 100644 index 0000000..8f6161a --- /dev/null +++ b/tests/rdfa11/0237.out @@ -0,0 +1 @@ +_:s . diff --git a/tests/rdfa11/0237.xml b/tests/rdfa11/0237.xml new file mode 100644 index 0000000..c1a1ac7 --- /dev/null +++ b/tests/rdfa11/0237.xml @@ -0,0 +1,12 @@ + + + + + Test 0237 + + + Malformed Prefix + + \ No newline at end of file diff --git a/tests/rdfa11/0238.out b/tests/rdfa11/0238.out new file mode 100644 index 0000000..8f6161a --- /dev/null +++ b/tests/rdfa11/0238.out @@ -0,0 +1 @@ +_:s . diff --git a/tests/rdfa11/0238.xml b/tests/rdfa11/0238.xml new file mode 100644 index 0000000..7dff2f1 --- /dev/null +++ b/tests/rdfa11/0238.xml @@ -0,0 +1,10 @@ + + + + + Test 0238 + + + Undefined Term + + \ No newline at end of file diff --git a/tests/rdfa11/0239.out b/tests/rdfa11/0239.out new file mode 100644 index 0000000..8f6161a --- /dev/null +++ b/tests/rdfa11/0239.out @@ -0,0 +1 @@ +_:s . diff --git a/tests/rdfa11/0239.xml b/tests/rdfa11/0239.xml new file mode 100644 index 0000000..e86506a --- /dev/null +++ b/tests/rdfa11/0239.xml @@ -0,0 +1,11 @@ + + + + + Test 0239 + + + Undefined Prefix + + \ No newline at end of file diff --git a/tests/rdfa11/0246.out b/tests/rdfa11/0246.out new file mode 100644 index 0000000..36a85c6 --- /dev/null +++ b/tests/rdfa11/0246.out @@ -0,0 +1,6 @@ + _:a . + _:b . +_:a . +_:a "Mark Birbeck" . +_:b . +_:b "Ivan Herman" . diff --git a/tests/rdfa11/0246.xml b/tests/rdfa11/0246.xml new file mode 100644 index 0000000..5d44f28 --- /dev/null +++ b/tests/rdfa11/0246.xml @@ -0,0 +1,13 @@ + + + + + Test 0246 + + +
+

Mark Birbeck

+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0247.out b/tests/rdfa11/0247.out new file mode 100644 index 0000000..13d24aa --- /dev/null +++ b/tests/rdfa11/0247.out @@ -0,0 +1,6 @@ + _:bnodeid1 . +_:bnodeid1 "Ivan Herman" . +_:bnodeid1 . + _:bnodeid2 . +_:bnodeid2 . +_:bnodeid2 "Mark Birbeck" . diff --git a/tests/rdfa11/0247.xml b/tests/rdfa11/0247.xml new file mode 100644 index 0000000..069c0cb --- /dev/null +++ b/tests/rdfa11/0247.xml @@ -0,0 +1,14 @@ + + + + + Test 0247 + + +
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0248.out b/tests/rdfa11/0248.out new file mode 100644 index 0000000..d48f932 --- /dev/null +++ b/tests/rdfa11/0248.out @@ -0,0 +1,6 @@ +_:a . +_:a . +_:a "Ivan Herman" . +_:b . +_:b . +_:b "Mark Birbeck" . diff --git a/tests/rdfa11/0248.xml b/tests/rdfa11/0248.xml new file mode 100644 index 0000000..0b6100f --- /dev/null +++ b/tests/rdfa11/0248.xml @@ -0,0 +1,14 @@ + + + + + Test 0248 + + +
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0249.out b/tests/rdfa11/0249.out new file mode 100644 index 0000000..b1baa9f --- /dev/null +++ b/tests/rdfa11/0249.out @@ -0,0 +1,8 @@ + _:a . + _:b . +_:a . +_:a . +_:a "Ivan Herman" . +_:b . +_:b . +_:b "Mark Birbeck" . diff --git a/tests/rdfa11/0249.xml b/tests/rdfa11/0249.xml new file mode 100644 index 0000000..dcae239 --- /dev/null +++ b/tests/rdfa11/0249.xml @@ -0,0 +1,14 @@ + + + + + Test 0249 + + +
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0250.out b/tests/rdfa11/0250.out new file mode 100644 index 0000000..3d4d6bf --- /dev/null +++ b/tests/rdfa11/0250.out @@ -0,0 +1,2 @@ + . + "Ivan Herman" . diff --git a/tests/rdfa11/0250.xml b/tests/rdfa11/0250.xml new file mode 100644 index 0000000..87fbaa4 --- /dev/null +++ b/tests/rdfa11/0250.xml @@ -0,0 +1,10 @@ + + + + + Test 0250 + + +

Ivan Herman

+ + \ No newline at end of file diff --git a/tests/rdfa11/0251.out b/tests/rdfa11/0251.out new file mode 100644 index 0000000..28e5e42 --- /dev/null +++ b/tests/rdfa11/0251.out @@ -0,0 +1 @@ + "chat"@fr . diff --git a/tests/rdfa11/0251.xml b/tests/rdfa11/0251.xml new file mode 100644 index 0000000..92b40a7 --- /dev/null +++ b/tests/rdfa11/0251.xml @@ -0,0 +1,11 @@ + + + + + Test 251 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0252.out b/tests/rdfa11/0252.out new file mode 100644 index 0000000..28e5e42 --- /dev/null +++ b/tests/rdfa11/0252.out @@ -0,0 +1 @@ + "chat"@fr . diff --git a/tests/rdfa11/0252.xml b/tests/rdfa11/0252.xml new file mode 100644 index 0000000..1ba1d97 --- /dev/null +++ b/tests/rdfa11/0252.xml @@ -0,0 +1,11 @@ + + + + + Test 0252 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0253.out b/tests/rdfa11/0253.out new file mode 100644 index 0000000..1a5c32d --- /dev/null +++ b/tests/rdfa11/0253.out @@ -0,0 +1 @@ + "\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03CC\n\u03AC\u03C3\u03C0\u03C1\u03BF \u03B4\u03B9\u03AC\u03C3\u03C4\u03B7\u03BC\u03B1\n"@el . diff --git a/tests/rdfa11/0253.xml b/tests/rdfa11/0253.xml new file mode 100644 index 0000000..1c1023f --- /dev/null +++ b/tests/rdfa11/0253.xml @@ -0,0 +1,13 @@ + + + + + Test 0108 + + +

ελληνικό +άσπρο διάστημα +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0254.out b/tests/rdfa11/0254.out new file mode 100644 index 0000000..989f53a --- /dev/null +++ b/tests/rdfa11/0254.out @@ -0,0 +1 @@ + "A plain literal with a lang tag."@en . diff --git a/tests/rdfa11/0254.xml b/tests/rdfa11/0254.xml new file mode 100644 index 0000000..78be11f --- /dev/null +++ b/tests/rdfa11/0254.xml @@ -0,0 +1,11 @@ + + + + + Test 0254 + + + +

A plain literal with a lang tag.

+ + \ No newline at end of file diff --git a/tests/rdfa11/0255.out b/tests/rdfa11/0255.out new file mode 100644 index 0000000..72ef6a6 --- /dev/null +++ b/tests/rdfa11/0255.out @@ -0,0 +1,2 @@ + "Just a plain literal." . + diff --git a/tests/rdfa11/0255.xml b/tests/rdfa11/0255.xml new file mode 100644 index 0000000..e3e6d78 --- /dev/null +++ b/tests/rdfa11/0255.xml @@ -0,0 +1,11 @@ + + + + + Test 0255 + + + +

Just a plain literal.

+ + \ No newline at end of file diff --git a/tests/rdfa11/0256.out b/tests/rdfa11/0256.out new file mode 100644 index 0000000..28e5e42 --- /dev/null +++ b/tests/rdfa11/0256.out @@ -0,0 +1 @@ + "chat"@fr . diff --git a/tests/rdfa11/0256.xml b/tests/rdfa11/0256.xml new file mode 100644 index 0000000..157880f --- /dev/null +++ b/tests/rdfa11/0256.xml @@ -0,0 +1,11 @@ + + + + + Test 0256 + + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0257.out b/tests/rdfa11/0257.out new file mode 100644 index 0000000..4926930 --- /dev/null +++ b/tests/rdfa11/0257.out @@ -0,0 +1 @@ + "" . diff --git a/tests/rdfa11/0257.xml b/tests/rdfa11/0257.xml new file mode 100644 index 0000000..3b5407d --- /dev/null +++ b/tests/rdfa11/0257.xml @@ -0,0 +1,10 @@ + + + + + Test 0257 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0258.out b/tests/rdfa11/0258.out new file mode 100644 index 0000000..2637cb7 --- /dev/null +++ b/tests/rdfa11/0258.out @@ -0,0 +1 @@ + _:test . diff --git a/tests/rdfa11/0258.xml b/tests/rdfa11/0258.xml new file mode 100644 index 0000000..ffce955 --- /dev/null +++ b/tests/rdfa11/0258.xml @@ -0,0 +1,14 @@ + + + + + Undescore Prefix is Ignored Test + + +

Ensure that the "_" prefix is ignored.

+

Test

+ + \ No newline at end of file diff --git a/tests/rdfa11/0259.out b/tests/rdfa11/0259.out new file mode 100644 index 0000000..4b4eb7b --- /dev/null +++ b/tests/rdfa11/0259.out @@ -0,0 +1,31 @@ + "GRDDL" . + "MA" . + "OWL" . + "RDF" . + "RDFa" . + "RDFS" . + "RIF" . + "SKOS" . + "SKOS-XL" . + "WDR" . + "VOID" . + "WDRS" . + "XHV" . + "XML" . + "XSD" . + "CC" . + "CTAG" . + "DC" . + "DCTERMS" . + "FOAF" . + "GR" . + "ICAL" . + "OG" . + "REV" . + "SIOC" . + "V" . + "VCARD" . + "Schema" . + "DescribedBy" . + "License" . + "Role" . diff --git a/tests/rdfa11/0259.xml b/tests/rdfa11/0259.xml new file mode 100644 index 0000000..cefb340 --- /dev/null +++ b/tests/rdfa11/0259.xml @@ -0,0 +1,48 @@ + + + + + Test 0259 + + +
+ Vocabulary Prefixes + GRDDL + MA + OWL + RDF + RDFa + RDFS + RIF + SKOS + SKOS-XL + WDR + VOID + WDRS + XHV + XML + XSD +
+
+ Widely Used prefixes + CC + CTAG + DC + DCTERMS + FOAF + GR + ICAL + OG + REV + SIOC + V + VCARD + Schema +
+
+ Vocabulary Terms + DescribedBy + License + Role +
+ \ No newline at end of file diff --git a/tests/rdfa11/0260.out b/tests/rdfa11/0260.out new file mode 100644 index 0000000..95e9a7b --- /dev/null +++ b/tests/rdfa11/0260.out @@ -0,0 +1,25 @@ + "alternate" . + "appendix" . + "cite" . + "bookmark" . + "contents" . + "chapter" . + "copyright" . + "first" . + "glossary" . + "help" . + "icon" . + "index" . + "last" . + "license" . + "meta" . + "next" . + "prev" . + "previous" . + "section" . + "start" . + "stylesheet" . + "subsection" . + "top" . + "up" . + "p3pv1" . diff --git a/tests/rdfa11/0260.xml b/tests/rdfa11/0260.xml new file mode 100644 index 0000000..9a15684 --- /dev/null +++ b/tests/rdfa11/0260.xml @@ -0,0 +1,37 @@ + + + + + + Test 0259 + + +
+ Vocabulary Terms + alternate + appendix + cite + bookmark + contents + chapter + copyright + first + glossary + help + icon + index + last + license + meta + next + prev + previous + section + start + stylesheet + subsection + top + up + p3pv1 +
+ diff --git a/tests/rdfa11/0261.out b/tests/rdfa11/0261.out new file mode 100644 index 0000000..fd1f0cd --- /dev/null +++ b/tests/rdfa11/0261.out @@ -0,0 +1 @@ + "This is\nan XMLLiteral"^^ . diff --git a/tests/rdfa11/0261.xml b/tests/rdfa11/0261.xml new file mode 100644 index 0000000..d03ccbe --- /dev/null +++ b/tests/rdfa11/0261.xml @@ -0,0 +1,14 @@ + + + + + Test 0261 + + +
+

This is +an XMLLiteral

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0262.out b/tests/rdfa11/0262.out new file mode 100644 index 0000000..05e2309 --- /dev/null +++ b/tests/rdfa11/0262.out @@ -0,0 +1 @@ + "Mark Birbeck" . diff --git a/tests/rdfa11/0262.xml b/tests/rdfa11/0262.xml new file mode 100644 index 0000000..fc52664 --- /dev/null +++ b/tests/rdfa11/0262.xml @@ -0,0 +1,11 @@ + + + + + Test 0262 + + +

This photo was taken by Mark Birbeck.

+ + \ No newline at end of file diff --git a/tests/rdfa11/0263.out b/tests/rdfa11/0263.out new file mode 100644 index 0000000..685035a --- /dev/null +++ b/tests/rdfa11/0263.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0263.xml b/tests/rdfa11/0263.xml new file mode 100644 index 0000000..24bb154 --- /dev/null +++ b/tests/rdfa11/0263.xml @@ -0,0 +1,10 @@ + + + + + Test 0263 + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0264.out b/tests/rdfa11/0264.out new file mode 100644 index 0000000..a829d4c --- /dev/null +++ b/tests/rdfa11/0264.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0264.xml b/tests/rdfa11/0264.xml new file mode 100644 index 0000000..99cc2a5 --- /dev/null +++ b/tests/rdfa11/0264.xml @@ -0,0 +1,10 @@ + + + + + Test 0264 + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0265.out b/tests/rdfa11/0265.out new file mode 100644 index 0000000..b3b6e75 --- /dev/null +++ b/tests/rdfa11/0265.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0265.xml b/tests/rdfa11/0265.xml new file mode 100644 index 0000000..d314d74 --- /dev/null +++ b/tests/rdfa11/0265.xml @@ -0,0 +1,10 @@ + + + + + Test 0265 + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0266.out b/tests/rdfa11/0266.out new file mode 100644 index 0000000..20215fb --- /dev/null +++ b/tests/rdfa11/0266.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa11/0266.xml b/tests/rdfa11/0266.xml new file mode 100644 index 0000000..d6d1220 --- /dev/null +++ b/tests/rdfa11/0266.xml @@ -0,0 +1,12 @@ + + + + + Test 0266 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0267.out b/tests/rdfa11/0267.out new file mode 100644 index 0000000..20215fb --- /dev/null +++ b/tests/rdfa11/0267.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa11/0267.xml b/tests/rdfa11/0267.xml new file mode 100644 index 0000000..239ff3f --- /dev/null +++ b/tests/rdfa11/0267.xml @@ -0,0 +1,12 @@ + + + + + Test 0267 + + +
+

Ivan Herman

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0268.out b/tests/rdfa11/0268.out new file mode 100644 index 0000000..400529e --- /dev/null +++ b/tests/rdfa11/0268.out @@ -0,0 +1,2 @@ + . + . diff --git a/tests/rdfa11/0268.xml b/tests/rdfa11/0268.xml new file mode 100644 index 0000000..b742eca --- /dev/null +++ b/tests/rdfa11/0268.xml @@ -0,0 +1,12 @@ + + + + + Test 0268 + + +
+ +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0269.out b/tests/rdfa11/0269.out new file mode 100644 index 0000000..8dc7816 --- /dev/null +++ b/tests/rdfa11/0269.out @@ -0,0 +1 @@ + "This is an RDFa test" . diff --git a/tests/rdfa11/0269.xml b/tests/rdfa11/0269.xml new file mode 100644 index 0000000..a489b9c --- /dev/null +++ b/tests/rdfa11/0269.xml @@ -0,0 +1,10 @@ + + + + + Test 0269 + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0271.out b/tests/rdfa11/0271.out new file mode 100644 index 0000000..df36453 --- /dev/null +++ b/tests/rdfa11/0271.out @@ -0,0 +1 @@ + "This is an RDFa test" . diff --git a/tests/rdfa11/0271.xml b/tests/rdfa11/0271.xml new file mode 100644 index 0000000..31fb650 --- /dev/null +++ b/tests/rdfa11/0271.xml @@ -0,0 +1,10 @@ + + + + + Test 0269 + + +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0272.out b/tests/rdfa11/0272.out new file mode 100644 index 0000000..1eb3cc2 --- /dev/null +++ b/tests/rdfa11/0272.out @@ -0,0 +1 @@ + "2012-03-18Z"^^ . diff --git a/tests/rdfa11/0272.xml b/tests/rdfa11/0272.xml new file mode 100644 index 0000000..168ee57 --- /dev/null +++ b/tests/rdfa11/0272.xml @@ -0,0 +1,10 @@ + + + + + Test 0272 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0273.out b/tests/rdfa11/0273.out new file mode 100644 index 0000000..35014a6 --- /dev/null +++ b/tests/rdfa11/0273.out @@ -0,0 +1 @@ + "00:00:00Z"^^ . diff --git a/tests/rdfa11/0273.xml b/tests/rdfa11/0273.xml new file mode 100644 index 0000000..277dfe2 --- /dev/null +++ b/tests/rdfa11/0273.xml @@ -0,0 +1,10 @@ + + + + + Test 0273 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0274.out b/tests/rdfa11/0274.out new file mode 100644 index 0000000..6f6a5ad --- /dev/null +++ b/tests/rdfa11/0274.out @@ -0,0 +1 @@ + "2012-03-18T00:00:00Z"^^ . diff --git a/tests/rdfa11/0274.xml b/tests/rdfa11/0274.xml new file mode 100644 index 0000000..3099d07 --- /dev/null +++ b/tests/rdfa11/0274.xml @@ -0,0 +1,10 @@ + + + + + Test 0274 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0275.out b/tests/rdfa11/0275.out new file mode 100644 index 0000000..6660553 --- /dev/null +++ b/tests/rdfa11/0275.out @@ -0,0 +1 @@ + "2012-03-18Z"^^ . diff --git a/tests/rdfa11/0275.xml b/tests/rdfa11/0275.xml new file mode 100644 index 0000000..a92ad76 --- /dev/null +++ b/tests/rdfa11/0275.xml @@ -0,0 +1,10 @@ + + + + + Test 0275 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0276.out b/tests/rdfa11/0276.out new file mode 100644 index 0000000..72aa674 --- /dev/null +++ b/tests/rdfa11/0276.out @@ -0,0 +1 @@ + "00:00:00Z"^^ . diff --git a/tests/rdfa11/0276.xml b/tests/rdfa11/0276.xml new file mode 100644 index 0000000..8063bd9 --- /dev/null +++ b/tests/rdfa11/0276.xml @@ -0,0 +1,10 @@ + + + + + Test 0275 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0277.out b/tests/rdfa11/0277.out new file mode 100644 index 0000000..4f793d1 --- /dev/null +++ b/tests/rdfa11/0277.out @@ -0,0 +1 @@ + "2012-03-18T00:00:00Z"^^ . diff --git a/tests/rdfa11/0277.xml b/tests/rdfa11/0277.xml new file mode 100644 index 0000000..cade4c0 --- /dev/null +++ b/tests/rdfa11/0277.xml @@ -0,0 +1,10 @@ + + + + + Test 0277 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0278.out b/tests/rdfa11/0278.out new file mode 100644 index 0000000..6ea4327 --- /dev/null +++ b/tests/rdfa11/0278.out @@ -0,0 +1 @@ + "2012-03-18"^^ . diff --git a/tests/rdfa11/0278.xml b/tests/rdfa11/0278.xml new file mode 100644 index 0000000..c91f300 --- /dev/null +++ b/tests/rdfa11/0278.xml @@ -0,0 +1,10 @@ + + + + + Test 0278 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0279.out b/tests/rdfa11/0279.out new file mode 100644 index 0000000..82f88a3 --- /dev/null +++ b/tests/rdfa11/0279.out @@ -0,0 +1 @@ + "2012-03-18T00:00:00Z"^^ . diff --git a/tests/rdfa11/0279.xml b/tests/rdfa11/0279.xml new file mode 100644 index 0000000..74f0583 --- /dev/null +++ b/tests/rdfa11/0279.xml @@ -0,0 +1,10 @@ + + + + + Test 0279 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0280.out b/tests/rdfa11/0280.out new file mode 100644 index 0000000..04a8d02 --- /dev/null +++ b/tests/rdfa11/0280.out @@ -0,0 +1 @@ + "P2011Y06M28DT00H00M00S"^^ . diff --git a/tests/rdfa11/0280.xml b/tests/rdfa11/0280.xml new file mode 100644 index 0000000..9ed1333 --- /dev/null +++ b/tests/rdfa11/0280.xml @@ -0,0 +1,10 @@ + + + + + Test 0280 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0281.out b/tests/rdfa11/0281.out new file mode 100644 index 0000000..ebd60c6 --- /dev/null +++ b/tests/rdfa11/0281.out @@ -0,0 +1 @@ + "2012"^^ . diff --git a/tests/rdfa11/0281.xml b/tests/rdfa11/0281.xml new file mode 100644 index 0000000..98cd8d3 --- /dev/null +++ b/tests/rdfa11/0281.xml @@ -0,0 +1,10 @@ + + + + + Test 0281 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0282.out b/tests/rdfa11/0282.out new file mode 100644 index 0000000..e47e6c3 --- /dev/null +++ b/tests/rdfa11/0282.out @@ -0,0 +1 @@ + "2012-03"^^ . diff --git a/tests/rdfa11/0282.xml b/tests/rdfa11/0282.xml new file mode 100644 index 0000000..6cde4e4 --- /dev/null +++ b/tests/rdfa11/0282.xml @@ -0,0 +1,10 @@ + + + + + Test 0282 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0283.out b/tests/rdfa11/0283.out new file mode 100644 index 0000000..d527cad --- /dev/null +++ b/tests/rdfa11/0283.out @@ -0,0 +1 @@ + " 2012-03-18Z" . diff --git a/tests/rdfa11/0283.xml b/tests/rdfa11/0283.xml new file mode 100644 index 0000000..52e08ba --- /dev/null +++ b/tests/rdfa11/0283.xml @@ -0,0 +1,10 @@ + + + + + Test 0283 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0284.out b/tests/rdfa11/0284.out new file mode 100644 index 0000000..61513b0 --- /dev/null +++ b/tests/rdfa11/0284.out @@ -0,0 +1 @@ + " 2012-03-18Z"^^ . diff --git a/tests/rdfa11/0284.xml b/tests/rdfa11/0284.xml new file mode 100644 index 0000000..c2fc319 --- /dev/null +++ b/tests/rdfa11/0284.xml @@ -0,0 +1,10 @@ + + + + + Test 0284 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0285.out b/tests/rdfa11/0285.out new file mode 100644 index 0000000..dee2e36 --- /dev/null +++ b/tests/rdfa11/0285.out @@ -0,0 +1 @@ + "D-Day"@en . diff --git a/tests/rdfa11/0285.xml b/tests/rdfa11/0285.xml new file mode 100644 index 0000000..6f46e6b --- /dev/null +++ b/tests/rdfa11/0285.xml @@ -0,0 +1,12 @@ + + + + + Test 0285 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0286.out b/tests/rdfa11/0286.out new file mode 100644 index 0000000..4dfb778 --- /dev/null +++ b/tests/rdfa11/0286.out @@ -0,0 +1 @@ + "veni, vidi, vici"@lat . diff --git a/tests/rdfa11/0286.xml b/tests/rdfa11/0286.xml new file mode 100644 index 0000000..316eda6 --- /dev/null +++ b/tests/rdfa11/0286.xml @@ -0,0 +1,12 @@ + + + + + Test 0286 + + + + @value overrides @content in the 'data' element. + + + \ No newline at end of file diff --git a/tests/rdfa11/0287.out b/tests/rdfa11/0287.out new file mode 100644 index 0000000..5cfa27e --- /dev/null +++ b/tests/rdfa11/0287.out @@ -0,0 +1 @@ + "2012-03-18T00:00:00-08:00"^^ . diff --git a/tests/rdfa11/0287.xml b/tests/rdfa11/0287.xml new file mode 100644 index 0000000..3aa1bcb --- /dev/null +++ b/tests/rdfa11/0287.xml @@ -0,0 +1,10 @@ + + + + + Test 0287 + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0289.out b/tests/rdfa11/0289.out new file mode 100644 index 0000000..62f3f64 --- /dev/null +++ b/tests/rdfa11/0289.out @@ -0,0 +1 @@ + "value" . diff --git a/tests/rdfa11/0289.xml b/tests/rdfa11/0289.xml new file mode 100644 index 0000000..1afbbc2 --- /dev/null +++ b/tests/rdfa11/0289.xml @@ -0,0 +1,11 @@ + + + + + Test 0289 + + +

@href becomes subject when @property and @content are present

+ ignored + + \ No newline at end of file diff --git a/tests/rdfa11/0290.out b/tests/rdfa11/0290.out new file mode 100644 index 0000000..62f3f64 --- /dev/null +++ b/tests/rdfa11/0290.out @@ -0,0 +1 @@ + "value" . diff --git a/tests/rdfa11/0290.xml b/tests/rdfa11/0290.xml new file mode 100644 index 0000000..814f7ab --- /dev/null +++ b/tests/rdfa11/0290.xml @@ -0,0 +1,11 @@ + + + + + Test 0290 + + +

@href becomes subject when @property and @datatype are present

+ value + + \ No newline at end of file diff --git a/tests/rdfa11/0291.out b/tests/rdfa11/0291.out new file mode 100644 index 0000000..678f4b7 --- /dev/null +++ b/tests/rdfa11/0291.out @@ -0,0 +1 @@ + "value" . diff --git a/tests/rdfa11/0291.xml b/tests/rdfa11/0291.xml new file mode 100644 index 0000000..2686ab9 --- /dev/null +++ b/tests/rdfa11/0291.xml @@ -0,0 +1,11 @@ + + + + + Test 0291 + + +

@href as subject overridden by @about

+ ignored + + \ No newline at end of file diff --git a/tests/rdfa11/0292.out b/tests/rdfa11/0292.out new file mode 100644 index 0000000..ca3f2fa --- /dev/null +++ b/tests/rdfa11/0292.out @@ -0,0 +1,2 @@ + "value one" . + "value two" . diff --git a/tests/rdfa11/0292.xml b/tests/rdfa11/0292.xml new file mode 100644 index 0000000..a67a671 --- /dev/null +++ b/tests/rdfa11/0292.xml @@ -0,0 +1,13 @@ + + + + + Test 0292 + + +

@about overriding @href as subject is used as parent resource

+ + value two + + + \ No newline at end of file diff --git a/tests/rdfa11/0293.out b/tests/rdfa11/0293.out new file mode 100644 index 0000000..9cfff38 --- /dev/null +++ b/tests/rdfa11/0293.out @@ -0,0 +1 @@ + "Test" . diff --git a/tests/rdfa11/0293.xml b/tests/rdfa11/0293.xml new file mode 100644 index 0000000..ba2622e --- /dev/null +++ b/tests/rdfa11/0293.xml @@ -0,0 +1,13 @@ + + + + + Test 0293 + + +

Testing the ':' character usage in a CURIE

+
+

Test

+
+ + \ No newline at end of file diff --git a/tests/rdfa11/0295.out b/tests/rdfa11/0295.out new file mode 100644 index 0000000..ca60e94 --- /dev/null +++ b/tests/rdfa11/0295.out @@ -0,0 +1,495 @@ + "Mark Birbeck" . + . + . + . + . + "Portrait of Mark" . + . + "10"^^ . +_:a "Manu Sporny" . +_:a _:b . +_:b "Ralph Swick" . + . + . + "Mark Birbeck" . + "Mark Birbeck" . + "Mark Birbeck" . + . + "Ben Adida" . + "Mark Birbeck" . + "Mark Birbeck" . + "Mark Birbeck"^^ . + . + . + . +_:bnode0 "Ben Adida" . + _:bnode0 . + . + . + . + . + . + . + . + . + . +_:bnode3 . + _:bnode3 . +_:bnode3 "John Doe" . + . + . + "John Doe" . + . +_:bnode4 "John Doe" . + _:bnode4 . + . + "John Doe" . +_:bnode5 . +_:bnode5 "John Doe" . + . + "John Doe" . + . + . + "John Doe" . + "Fabien Gandon" . + "Fabien Gandon" . + . + . + . + "Mark Birbeck" . + . + "Mark Birbeck" . + . + "Ivan Herman" . + . +_:bnode9 . +_:bnode8 _:bnode9 . + _:bnode8 . +_:bnode10 . +_:bnode8 _:bnode10 . + _:bnode8 . + "Manu Sporny" . + . + . + "Fabien Gandon" . + . + . + . + "\u677E\u672C \u540E\u5B50" . +_:michael . +_:manu . +_:manu _:michael . +_:michael . + "Test 0067" . + . + . + . + "Example FAQ" . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . +_:bnode12 "Ivan Herman" . + _:bnode12 . +_:bnode12 . + _:bnode12 . +_:bnode13 . +_:bnode12 _:bnode13 . + _:bnode12 . + . + . + . + . +_:bnode16 "Ivan Herman" . +_:bnode16 . +_:bnode16 . +_:bnode16 . +_:bnode17 . +_:bnode16 _:bnode17 . +_:bnode16 . +_:bnode18 "Ivan Herman" . + _:bnode18 . +_:bnode18 . +_:bnode18 . + _:bnode18 . +_:bnode18 . +_:bnode19 . +_:bnode18 _:bnode19 . + _:bnode18 . +_:bnode18 . +_:bnode20 "Ivan Herman" . + _:bnode20 . +_:bnode20 . + _:bnode20 . + . + "Dan Brickley" . + . +_:bnode21 "Ivan Herman" . + _:bnode21 . +_:bnode21 . +_:bnode21 . + _:bnode21 . +_:bnode21 . + . + "Dan Brickley" . + . + . +_:bnode22 . +_:bnode22 . +_:bnode22 . + _:bnode22 . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . +_:bnode25 "Dan Brickley" . + _:bnode25 . +_:bnode25 . + _:bnode25 . + . + . +_:human "a bi-pedal primate" . +_:human "confused animal" . +_:human "Milky Way" . + "Albert Einstein" . + "E = mc2: The Most Urgent Problem of Our Time"^^ . + "\n We put thirty spokes together and call it a wheel;\n But it is on the space where there is nothing that the usefulness of the wheel depends.\n We turn clay to make a vessel;\n But it is on the space where there is nothing that the usefulness of the vessel depends.\n We pierce doors and windows to make a house;\n And it is on these spaces where there is nothing that the usefulness of the house depends.\n Therefore just as we take advantage of what is, we should recognize the usefulness of what is not.\n\n Lao Tzu: Tao Te Ching" . +_:bnode26 "17" . + _:bnode26 . +_:bnode26 "character" . + _:bnode26 . + _:bnode27 . + "\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03CC\n\u03AC\u03C3\u03C0\u03C1\u03BF \u03B4\u03B9\u03AC\u03C3\u03C4\u03B7\u03BC\u03B1\n"@el . + "Test 0109" . + _:bnode29 . +_:bnode31 _:bnode32 . + _:bnode31 . + "not an XML Literal,\nwhitespace preserved\n" . + "" . + "" . + . + . + . + . + . + . + . + . + . + ">" . + "Ben & Co." . + "@" . + "@" . + "Mark Birbeck" . + "Ben" . + "Example Website" . + "The XHTML Vocabulary Document" . + "Test Case 0121" . + "Shane McCarron" . + . + . + "My article" . + "Test" . + "John Doe" . +_:gregg "Gregg Kellogg" . +_:manu . +_:manu _:gregg . +_:gregg _:manu . +_:gregg . + "Ivan Herman" . + . + "A particular agent" . + "Ivan Herman" . + "Ivan Herman" . + . + . + "A particular agent" . + . + "A particular agent" . + . + "Ivan Herman" . + . + . + "Ivan Herman" . + . + "Ivan Herman" . + . + . + . + "This is an XMLLiteral"^^ . + "This is a plain literal" . + . + "Gregg Kellogg" . + "Ruby"^^ . + . + . + . + "Mark" . + "Birbeck" . + "Mark Birbeck"^^ . + . + . + "Weekend off in Iona" . + "2006-10-21"^^ . + "2006-10-23"^^ . + . + "Iona, UK" . + "Ivan Herman" . + "Ivan Herman" . + . + "Ivan Herman" . + "E = mc2: The Most Urgent Problem of Our Time" . + "E = mc2: The Most Urgent Problem of Our Time" . + "Iv\u00E1n" . + "Iv\u00E1n" . + . + "Gregg Kellogg" . + . +_:bnode36 "Foo" . +_:bnode36 . + _:bnode36 . + . +_:bnode37 . +_:bnode37 . + _:bnode37 . + . +_:bnode38 "Foo" . +_:bnode38 _:bnode39 . +_:bnode39 . +_:bnode39 . + _:bnode38 . +_:bnode39 "Foo" . +_:bnode39 _:bnode40 . +_:bnode40 "Bar" . +_:bnode40 . + _:bnode39 . + "Baz" . +_:bnode40 "Foo" . +_:bnode40 _:bnode41 . +_:bnode41 "Bar" . +_:bnode41 . + _:bnode40 . +_:bnode41 . +_:bnode41 _:bnode42 . +_:bnode42 . +_:bnode42 . + _:bnode41 . +_:bnode42 "Foo" . +_:bnode42 . + _:bnode42 . +_:bnode43 "Bar" . +_:bnode43 . + _:bnode43 . + . +_:bnode45 "Bar" . +_:bnode45 . + _:bnode45 . +_:bnode44 "Foo" . +_:bnode44 . + _:bnode44 . + . +_:bnode48 "Bar" . +_:bnode48 . + _:bnode48 . +_:bnode46 "Foo" . +_:bnode46 . + _:bnode46 . + . + . + . + . +_:bnode50 . + _:bnode50 . +_:bnode50 "John Doe" . + . + . + "John Doe" . + . + . + . + "rdfagraph" . + "\u03B5\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03CC\n\u03AC\u03C3\u03C0\u03C1\u03BF \u03B4\u03B9\u03AC\u03C3\u03C4\u03B7\u03BC\u03B1\n"@el . + "" . + _:test . + "GRDDL" . + "MA" . + "OWL" . + "RDF" . + "RDFa" . + "RDFS" . + "RIF" . + "SKOS" . + "SKOS-XL" . + "WDR" . + "VOID" . + "WDRS" . + "XHV" . + "XML" . + "XSD" . + "CC" . + "CTAG" . + "DC" . + "DCTERMS" . + "FOAF" . + "GR" . + "ICAL" . + "OG" . + "REV" . + "SIOC" . + "V" . + "VCARD" . + "Schema" . + "DescribedBy" . + "License" . + "Role" . + "alternate" . + "appendix" . + "cite" . + "bookmark" . + "contents" . + "chapter" . + "copyright" . + "first" . + "glossary" . + "help" . + "icon" . + "index" . + "last" . + "license" . + "meta" . + "next" . + "prev" . + "previous" . + "section" . + "start" . + "stylesheet" . + "subsection" . + "top" . + "up" . + "p3pv1" . + "This is\nan XMLLiteral"^^ . + "Mark Birbeck" . + . + . + . + . + . + . + "18 March 2012" . + "midnight" . + "18 March 2012 at midnight" . + "2012-03-18Z" . + "00:00:00Z" . + "2012-03-18T00:00:00Z" . + "not this" . + "18 March 2012 at midnight"^^ . + "2011 years 6 months 28 days" . + "Two Thousand Twelve" . + "March, Two Thousand Twelve" . + " 2012-03-18Z" . + " 2012-03-18Z"^^ . + "\n Non matching lexical value with language.\n "@en . + "I came, I saw, I conquered"@lat . + "18 March 2012 at midnight in San Francisco" . + "" . + "value" . + "value" . + "value" . + "value two" . + "value one" . + "Test" . + "GRDDL" . + "MA" . + "OWL" . + "RDF" . + "RDFa" . + "RDFS" . + "RIF" . + "SKOS" . + "SKOS-XL" . + "WDR" . + "VOID" . + "WDRS" . + "XHV" . + "XML" . + "XSD" . + "CC" . + "CTAG" . + "DC" . + "DCTERMS" . + "FOAF" . + "GR" . + "ICAL" . + "OG" . + "REV" . + "SIOC" . + "V" . + "VCARD" . + "Schema" . + "DescribedBy" . diff --git a/tests/rdfa11/0295.xml b/tests/rdfa11/0295.xml new file mode 100644 index 0000000..ab34129 --- /dev/null +++ b/tests/rdfa11/0295.xml @@ -0,0 +1,930 @@ + + + + + RDFa 1.1 Benchmark File #1 + + +

This photo was taken by Mark Birbeck.

+

+ This photo was taken by + Mark Birbeck. +

+

This photo was taken by + Mark Birbeck. +

+

This document is licensed under a + + Creative Commons + . +

+

+

+

+

+

+ ten +

+

+

+ Manu Sporny + knows + Ralph Swick. +

+

+ This photo was taken by + Mark Birbeck. +

+
+
+ this photo was taken by + Mark Birbeck + +
+
+ this photo was taken by + Mark Birbeck + +
+
+ This photo was taken by + Mark Birbeck +
+

+ This paper was written by + + Ben Adida. + +

+

+ +

+

+ Mark B. + +

+

+ Mark Birbeck. +

+

This document is licensed under a + + Creative Commons License + . +

+

+ The book Weaving the Web (hardcover) has the ISBN + 0752820907. +

+

+ The book Weaving the Web (hardcover) has the ISBN + 0752820907. +

+

+ This paper was written by + + Ben Adida. + +

+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+

John Doe

+
+
+

John Doe

+
+
+

John Doe

+
+
+

John Doe

+
+
+

John Doe

+
+

John Doe

+

+ John Doe +

+

+ John Doe +

+

+ This document was authored and published by + Fabien Gandon. +

+

+ This document was authored and published by + Fabien Gandon. +

+
+

Mark Birbeck

+
+
+

Mark Birbeck

+

Ivan Herman

+
+
+

Mark Birbeck

+

Ivan Herman

+
+

This document was authored and published by:

+
    +
  • Manu Sporny
  • +
  • Fabien Gandon
  • +
+
+

松本 后子

+
+

This is the first chapter in a series of chapters.

+

This is unit test #62. The next unit test is #63.

+

This is the 63rd test. The next test is #64.

+

Michael knows + Manu. +

+
+ Manu Sporny can be reached via + email. + He knows Michael. +
+ +
+ Michael can be reached via + email. +
+

This is test #66.

+

This is test #67.

+

+ The previous test was + Test 0067. +

+

The next test will be + Test 0070. +

+

The previous test was + Test 0069. +

+

This page is under a Creative Commons + + Attribution-No Derivatives 3.0 license. +

+

+ Learn more by reading the example.org + Example FAQ. +

+

+ This article was written by + Jane. +

+

+ This article was written by + Jane. +

+

+ This page is under a Creative Commons + Attribution-No Derivatives 3.0 license. +

+

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + + index + last + license + meta + + p3pv1 + + role + section + subsection + start + stylesheet + up +

+

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + icon + index + first + last + license + meta + next + p3pv1 + prev + role + section + subsection + start + stylesheet + up +

+
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+
+

Ivan Herman

+

Tim Berners Lee

+

Dan Brickley

+
+
+

Dan Brickley

+
+
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+
+

Ivan Herman

+

mailto:ivan@w3.org

+

Mark Birbeck

+
+
+

Ivan Herman

+

mailto:ivan@w3.org

+

Dan Brickley

+
+
+
+

Ivan Herman

+

mailto:ivan@w3.org

+

Dan Brickley

+ +
+
+
+
+

Ivan Herman

+

Tim Berners Lee

+

Dan Brickley

+
+
+

+ alternate + appendix + bookmark + cite + chapter + contents + copyright + glossary + help + icon + index + first + last + license + meta + next + p3pv1 + prev + role + section + subsection + start + stylesheet + up +

+
+

Dan Brickley

+

Dan Brickley again:-)

+
+
+ example image +
+
+ example image +
+

+ A human is + a bi-pedal primate. + They are quite possibly one of the most + confused animals residing in the + Milky Way. +

+
+ Author: Albert Einstein +

E = mc2: The Most Urgent Problem of Our Time

+
+

+ We put thirty spokes together and call it a wheel; + But it is on the space where there is nothing that the usefulness of the wheel depends. + We turn clay to make a vessel; + But it is on the space where there is nothing that the usefulness of the vessel depends. + We pierce doors and windows to make a house; + And it is on these spaces where there is nothing that the usefulness of the house depends. + Therefore just as we take advantage of what is, we should recognize the usefulness of what is not. + + Lao Tzu: Tao Te Ching

+

+ The word "interfenestration" has + + 17 + characters. + +

+
+ Manu created this page. +
+ +

ελληνικό +άσπρο διάστημα +

+ +
+

This is Test 0109.

+
+
+
+
+
+
+
+
+
+

+ not an XML Literal, +whitespace preserved + +

+ + + +

Description: XML entities in the RDFa content

+

+ > + Ben & Co. + @ + @ +

+

+ Mark Birbeck + added this triple test. +

+

+ Check to see if parsers get confused when "" is + interpreted as NULL in some chaining cases. + Ben +

+
+

+ The + Example Website + is used in many W3C tutorials. +

+
+

+ The + The XHTML Vocabulary Document + is the default prefix for XHTML+RDFa 1.0. +

+
+

+ Test Case 0121 + checks to make sure RDFa processors resolve the empty CURIE correctly. +

+ Shane McCarron + contributed to this test. +

+

+
+

+ This section is contained below the main site. +

+
+

My article

+
+

Blank Nodes are not allowed to be predicate identifiers in RDF:

+

Test

+

Test

+

+ This test ensures that single-character prefixes are allowed. + My name is: + John Doe +

+

My name is + Gregg Kellogg. +

+
+ Manu can be reached via + email. + He knows Gregg. + Who knows Manu. +
+ +
+ Gregg can be reached via + email. +
+
+

Ivan Herman

+
+
+

A particular agent

+
+ +
+

Ivan Herman

+
+
+

Ivan Herman

+
+
+

Ivan Herman

+
+
+
+

A particular agent

+
+
+
+
+

A particular agent

+
+
+
+

Ivan Herman

+
+
+
+

Ivan Herman

+
+
+
+
+

Ivan Herman

+
+
+
+

Ivan Herman

+
+
+

Ivan Herman

+
+
+

This is an XMLLiteral

+

This is a plain literal

+
+

Gregg Kellogg

+

Ruby

+

Kellogg Associates

+

Ruby Gem

+
+

Mark Birbeck

+
+

+ An OWL Axiom: "xsd:maxExclusive" is a Datatype Property in OWL. +

+

+ Weekend off in Iona: + Oct 21st + to Oct 23rd. + See FreeTime.Example.org for + info on Iona, UK. +

+ +
+

Ivan Herman

+
+ +
+

Ivan Herman

+
+ +
+

Ivan Herman

+
+ +
+

E = mc2: The Most Urgent Problem of Our Time

+
+ +
+

E = mc2: The Most Urgent Problem of Our Time

+
+

This document has a title.

+ +

Iván

+ +

Iván

+
+

Gregg Kellogg

+
+
+

+

+
+

Foo

+
+
+ Foo +
+
+

Foo

+ Foo +
+
+

Foo

+

Bar

+
+
+

Foo

+

Bar

+

Baz

+
+
+
    +
  1. Foo
  2. +
  3. Bar
  4. +
+
+
+

Foo

+
+
+

Bar

+
+
+

Foo

+ +

Bar

+
+
+
+

Foo

+ +

Bar

+
+
+
+ A photo depicting Michael +
+
+ A photo depicting Michael +
+
+ example image +
+
+ example image +
+
+

John Doe

+
+
+

John Doe

+
+

+ describedby + license + role +

+

+ The rdfagraph should not generate triples when + looking only at the processor graph. +

+

+

+

ελληνικό +άσπρο διάστημα +

+

+ +

Ensure that the "_" prefix is ignored.

+

Test

+
+ Vocabulary Prefixes + GRDDL + MA + OWL + RDF + RDFa + RDFS + RIF + SKOS + SKOS-XL + WDR + VOID + WDRS + XHV + XML + XSD +
+
+ Widely Used prefixes + CC + CTAG + DC + DCTERMS + FOAF + GR + ICAL + OG + REV + SIOC + V + VCARD + Schema +
+
+ Vocabulary Terms + DescribedBy + License + Role +
+
+ Vocabulary Terms + alternate + appendix + cite + bookmark + contents + chapter + copyright + first + glossary + help + icon + index + last + license + meta + next + prev + previous + section + start + stylesheet + subsection + top + up + p3pv1 +
+
+

This is +an XMLLiteral

+
+

This photo was taken by Mark Birbeck.

+

+

+

+ +
+

Ivan Herman

+
+
+ +
+

+

+

+ + + + + + + + + + + + + + + + @value overrides @content in the 'data' element. + + + +

@href becomes subject when @property and @content are present

+ ignored +

@href becomes subject when @property and @datatype are present

+ value +

@href as subject overridden by @about

+ ignored +

@about overriding @href as subject is used as parent resource

+ + value two + +

Testing the ':' character usage in a CURIE

+
+

Test

+
+

None of these triples should be generated in RDFa 1.0.

+
+ Vocabulary Prefixes + GRDDL + MA + OWL + RDF + RDFa + RDFS + RIF + SKOS + SKOS-XL + WDR + VOID + WDRS + XHV + XML + XSD +
+
+ Widely Used prefixes + CC + CTAG + DC + DCTERMS + FOAF + GR + ICAL + OG + REV + SIOC + V + VCARD + Schema +
+
+ Vocabulary Terms + DescribedBy +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0296.out b/tests/rdfa11/0296.out new file mode 100644 index 0000000..5a7d822 --- /dev/null +++ b/tests/rdfa11/0296.out @@ -0,0 +1,20 @@ + . + . + "Gregg" . + . + . + "Niklas" . + . + . + . + "St\u00E9phane" . + . + . + . + "Ivan" . + . + . + . + "Manu" . + . + . diff --git a/tests/rdfa11/0296.xml b/tests/rdfa11/0296.xml new file mode 100644 index 0000000..ad19de2 --- /dev/null +++ b/tests/rdfa11/0296.xml @@ -0,0 +1,27 @@ + + + + + Test 0296 + + +
+ Gregg + Knows + +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0297.out b/tests/rdfa11/0297.out new file mode 100644 index 0000000..c64cfe6 --- /dev/null +++ b/tests/rdfa11/0297.out @@ -0,0 +1,2 @@ +_:bnode0 . + _:bnode0 . diff --git a/tests/rdfa11/0297.xml b/tests/rdfa11/0297.xml new file mode 100644 index 0000000..1232b16 --- /dev/null +++ b/tests/rdfa11/0297.xml @@ -0,0 +1,10 @@ + + + + + Test 0297: Testing @typeof and @about=[] + + +
Alex Milowski
+ + \ No newline at end of file diff --git a/tests/rdfa11/0298.out b/tests/rdfa11/0298.out new file mode 100644 index 0000000..28d7fd2 --- /dev/null +++ b/tests/rdfa11/0298.out @@ -0,0 +1,2 @@ +_:bnodeid1 . +_:bnodeid1 "Alex Milowski" . diff --git a/tests/rdfa11/0298.xml b/tests/rdfa11/0298.xml new file mode 100644 index 0000000..eb4d759 --- /dev/null +++ b/tests/rdfa11/0298.xml @@ -0,0 +1,12 @@ + + + + + Test 0298: Testing @typeof and @about=[] + + +
+ Alex Milowski +
+ + \ No newline at end of file diff --git a/tests/rdfa11/0299.out b/tests/rdfa11/0299.out new file mode 100644 index 0000000..5582265 --- /dev/null +++ b/tests/rdfa11/0299.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0299.xml b/tests/rdfa11/0299.xml new file mode 100644 index 0000000..0a476c9 --- /dev/null +++ b/tests/rdfa11/0299.xml @@ -0,0 +1,10 @@ + + + + + Test 0299: Testing @resource=[] + + + The Foo Document + + \ No newline at end of file diff --git a/tests/rdfa11/0300.out b/tests/rdfa11/0300.out new file mode 100644 index 0000000..5582265 --- /dev/null +++ b/tests/rdfa11/0300.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfa11/0300.xml b/tests/rdfa11/0300.xml new file mode 100644 index 0000000..532fed6 --- /dev/null +++ b/tests/rdfa11/0300.xml @@ -0,0 +1,10 @@ + + + + + Test 0300: Testing @resource=[] + + + The Foo Document + + \ No newline at end of file diff --git a/tests/rdfa11/0301.out b/tests/rdfa11/0301.out new file mode 100644 index 0000000..6a360af --- /dev/null +++ b/tests/rdfa11/0301.out @@ -0,0 +1,4 @@ + . +_:bnode0 . +_:bnode0 "Fizzbit" . + _:bnode0 . diff --git a/tests/rdfa11/0301.xml b/tests/rdfa11/0301.xml new file mode 100644 index 0000000..69a214d --- /dev/null +++ b/tests/rdfa11/0301.xml @@ -0,0 +1,12 @@ + + + + + Test 0301: Typed Property + + +

+ Fizzbit +

+ + \ No newline at end of file diff --git a/tests/rdfa11/0302.out b/tests/rdfa11/0302.out new file mode 100644 index 0000000..5d430e1 --- /dev/null +++ b/tests/rdfa11/0302.out @@ -0,0 +1,6 @@ + . + . + . + . + "St\u00E9phane Corlosquet" . + . diff --git a/tests/rdfa11/0302.xml b/tests/rdfa11/0302.xml new file mode 100644 index 0000000..cec557c --- /dev/null +++ b/tests/rdfa11/0302.xml @@ -0,0 +1,12 @@ + + + + + Test 0302: various types of tokens in @typeof + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0303.out b/tests/rdfa11/0303.out new file mode 100644 index 0000000..a974280 --- /dev/null +++ b/tests/rdfa11/0303.out @@ -0,0 +1,6 @@ + . + . + "Not This" . + . + . + "Gregg Kellogg" . diff --git a/tests/rdfa11/0303.xml b/tests/rdfa11/0303.xml new file mode 100644 index 0000000..8aa216f --- /dev/null +++ b/tests/rdfa11/0303.xml @@ -0,0 +1,13 @@ + + + + + Test 0303: @rel/@rev terms removed if @property exists + + + + + \ No newline at end of file diff --git a/tests/rdfa11/0304.out b/tests/rdfa11/0304.out new file mode 100644 index 0000000..5c5e210 --- /dev/null +++ b/tests/rdfa11/0304.out @@ -0,0 +1,2 @@ + "Test 0304" . + "A yellow rectangle with sharp corners." . diff --git a/tests/rdfa11/0304.xml b/tests/rdfa11/0304.xml new file mode 100644 index 0000000..435df1e --- /dev/null +++ b/tests/rdfa11/0304.xml @@ -0,0 +1,20 @@ + + + A yellow rectangle with sharp corners. + + + + Test 0304 + + + + + + + diff --git a/tests/rdfa11/CMakeLists.txt b/tests/rdfa11/CMakeLists.txt new file mode 100644 index 0000000..5062205 --- /dev/null +++ b/tests/rdfa11/CMakeLists.txt @@ -0,0 +1,1243 @@ +# raptor/tests/rdfa11/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +IF(RAPTOR_PARSER_RDFA) + + RAPPER_RDFDIFF_TEST(rdfa11.0001 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0001.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0001.xml" + 0001-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0001.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0001.out 0001-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0006 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0006.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0006.xml" + 0006-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0006.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0006.out 0006-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0007 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0007.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0007.xml" + 0007-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0007.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0007.out 0007-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0008 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0008.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0008.xml" + 0008-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0008.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0008.out 0008-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0009 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0009.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0009.xml" + 0009-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0009.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0009.out 0009-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0010 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0010.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0010.xml" + 0010-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0010.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0010.out 0010-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0012 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0012.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0012.xml" + 0012-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0012.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0012.out 0012-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0013 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0013.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0013.xml" + 0013-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0013.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0013.out 0013-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0014 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0014.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0014.xml" + 0014-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0014.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0014.out 0014-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0015 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0015.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0015.xml" + 0015-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0015.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0015.out 0015-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0017 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0017.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0017.xml" + 0017-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0017.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0017.out 0017-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0018 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0018.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0018.xml" + 0018-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0018.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0018.out 0018-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0019 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0019.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0019.xml" + 0019-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0019.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0019.out 0019-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0020 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0020.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0020.xml" + 0020-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0020.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0020.out 0020-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0021 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0021.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0021.xml" + 0021-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0021.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0021.out 0021-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0023 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0023.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0023.xml" + 0023-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0023.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0023.out 0023-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0025 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0025.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0025.xml" + 0025-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0025.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0025.out 0025-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0026 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0026.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0026.xml" + 0026-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0026.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0026.out 0026-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0027 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0027.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0027.xml" + 0027-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0027.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0027.out 0027-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0029 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0029.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0029.xml" + 0029-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0029.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0029.out 0029-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0030 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0030.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0030.xml" + 0030-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0030.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0030.out 0030-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0031 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0031.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0031.xml" + 0031-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0031.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0031.out 0031-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0032 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0032.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0032.xml" + 0032-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0032.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0032.out 0032-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0033 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0033.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0033.xml" + 0033-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0033.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0033.out 0033-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0034 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0034.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0034.xml" + 0034-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0034.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0034.out 0034-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0035 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0035.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0035.xml" + 0035-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0035.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0035.out 0035-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0036 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0036.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0036.xml" + 0036-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0036.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0036.out 0036-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0037 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0037.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0037.xml" + 0037-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0037.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0037.out 0037-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0038 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0038.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0038.xml" + 0038-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0038.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0038.out 0038-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0039 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0039.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0039.xml" + 0039-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0039.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0039.out 0039-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0041 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0041.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0041.xml" + 0041-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0041.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0041.out 0041-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0048 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0048.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0048.xml" + 0048-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0048.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0048.out 0048-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0049 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0049.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0049.xml" + 0049-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0049.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0049.out 0049-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0050 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0050.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0050.xml" + 0050-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0050.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0050.out 0050-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0051 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0051.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0051.xml" + 0051-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0051.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0051.out 0051-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0052 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0052.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0052.xml" + 0052-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0052.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0052.out 0052-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0053 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0053.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0053.xml" + 0053-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0053.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0053.out 0053-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0054 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0054.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0054.xml" + 0054-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0054.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0054.out 0054-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0055 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0055.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0055.xml" + 0055-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0055.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0055.out 0055-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0056 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0056.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0056.xml" + 0056-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0056.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0056.out 0056-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0057 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0057.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0057.xml" + 0057-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0057.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0057.out 0057-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0059 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0059.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0059.xml" + 0059-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0059.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0059.out 0059-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0060 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0060.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0060.xml" + 0060-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0060.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0060.out 0060-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0061 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0061.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0061.xml" + 0061-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0061.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0061.out 0061-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0062 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0062.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0062.xml" + 0062-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0062.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0062.out 0062-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0063 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0063.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0063.xml" + 0063-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0063.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0063.out 0063-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0064 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0064.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0064.xml" + 0064-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0064.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0064.out 0064-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0065 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0065.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0065.xml" + 0065-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0065.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0065.out 0065-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0066 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0066.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0066.xml" + 0066-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0066.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0066.out 0066-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0067 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0067.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0067.xml" + 0067-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0067.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0067.out 0067-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0068 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0068.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0068.xml" + 0068-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0068.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0068.out 0068-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0069 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0069.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0069.xml" + 0069-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0069.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0069.out 0069-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0070 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0070.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0070.xml" + 0070-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0070.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0070.out 0070-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0071 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0071.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0071.xml" + 0071-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0071.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0071.out 0071-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0072 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0072.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0072.xml" + 0072-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0072.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0072.out 0072-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0073 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0073.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0073.xml" + 0073-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0073.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0073.out 0073-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0074 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0074.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0074.xml" + 0074-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0074.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0074.out 0074-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0075 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0075.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0075.xml" + 0075-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0075.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0075.out 0075-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0076 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0076.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0076.xml" + 0076-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0076.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0076.out 0076-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0077 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0077.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0077.xml" + 0077-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0077.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0077.out 0077-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0079 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0079.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0079.xml" + 0079-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0079.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0079.out 0079-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0080 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0080.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0080.xml" + 0080-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0080.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0080.out 0080-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0083 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0083.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0083.xml" + 0083-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0083.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0083.out 0083-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0084 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0084.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0084.xml" + 0084-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0084.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0084.out 0084-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0085 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0085.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0085.xml" + 0085-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0085.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0085.out 0085-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0087 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0087.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0087.xml" + 0087-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0087.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0087.out 0087-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0088 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0088.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0088.xml" + 0088-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0088.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0088.out 0088-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0089 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0089.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0089.xml" + 0089-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0089.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0089.out 0089-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0091 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0091.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0091.xml" + 0091-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0091.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0091.out 0091-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0093 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0093.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0093.xml" + 0093-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0093.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0093.out 0093-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0099 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0099.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0099.xml" + 0099-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0099.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0099.out 0099-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0104 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0104.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0104.xml" + 0104-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0104.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0104.out 0104-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0106 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0106.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0106.xml" + 0106-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0106.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0106.out 0106-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0107 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0107.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0107.xml" + 0107-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0107.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0107.out 0107-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0108 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0108.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0108.xml" + 0108-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0108.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0108.out 0108-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0109 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0109.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0109.xml" + 0109-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0109.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0109.out 0109-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0110 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0110.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0110.xml" + 0110-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0110.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0110.out 0110-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0111 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0111.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0111.xml" + 0111-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0111.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0111.out 0111-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0112 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0112.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0112.xml" + 0112-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0112.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0112.out 0112-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0113 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0113.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0113.xml" + 0113-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0113.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0113.out 0113-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0114 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0114.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0114.xml" + 0114-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0114.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0114.out 0114-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0115 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0115.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0115.xml" + 0115-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0115.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0115.out 0115-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0117 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0117.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0117.xml" + 0117-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0117.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0117.out 0117-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0118 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0118.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0118.xml" + 0118-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0118.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0118.out 0118-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0119 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0119.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0119.xml" + 0119-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0119.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0119.out 0119-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0120 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0120.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0120.xml" + 0120-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0120.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0120.out 0120-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0121 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0121.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0121.xml" + 0121-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0121.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0121.out 0121-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0122 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0122.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0122.xml" + 0122-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0122.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0122.out 0122-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0126 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0126.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0126.xml" + 0126-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0126.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0126.out 0126-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0131 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0131.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0131.xml" + 0131-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0131.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0131.out 0131-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0134 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0134.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0134.xml" + 0134-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0134.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0134.out 0134-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0140 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0140.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0140.xml" + 0140-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0140.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0140.out 0140-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0147 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0147.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0147.xml" + 0147-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0147.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0147.out 0147-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0172 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0172.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0172.xml" + 0172-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0172.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0172.out 0172-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0173 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0173.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0173.xml" + 0173-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0173.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0173.out 0173-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0174 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0174.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0174.xml" + 0174-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0174.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0174.out 0174-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0175 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0175.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0175.xml" + 0175-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0175.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0175.out 0175-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0176 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0176.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0176.xml" + 0176-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0176.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0176.out 0176-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0177 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0177.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0177.xml" + 0177-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0177.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0177.out 0177-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0178 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0178.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0178.xml" + 0178-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0178.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0178.out 0178-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0179 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0179.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0179.xml" + 0179-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0179.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0179.out 0179-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0180 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0180.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0180.xml" + 0180-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0180.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0180.out 0180-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0181 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0181.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0181.xml" + 0181-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0181.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0181.out 0181-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0182 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0182.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0182.xml" + 0182-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0182.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0182.out 0182-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0183 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0183.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0183.xml" + 0183-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0183.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0183.out 0183-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0186 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0186.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0186.xml" + 0186-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0186.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0186.out 0186-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0187 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0187.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0187.xml" + 0187-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0187.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0187.out 0187-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0188 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0188.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0188.xml" + 0188-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0188.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0188.out 0188-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0189 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0189.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0189.xml" + 0189-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0189.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0189.out 0189-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0190 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0190.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0190.xml" + 0190-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0190.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0190.out 0190-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0196 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0196.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0196.xml" + 0196-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0196.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0196.out 0196-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0197 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0197.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0197.xml" + 0197-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0197.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0197.out 0197-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0198 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0198.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0198.xml" + 0198-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0198.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0198.out 0198-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0201 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0201.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0201.xml" + 0201-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0201.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0201.out 0201-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0202 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0202.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0202.xml" + 0202-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0202.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0202.out 0202-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0203 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0203.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0203.xml" + 0203-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0203.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0203.out 0203-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0206 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0206.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0206.xml" + 0206-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0206.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0206.out 0206-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0207 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0207.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0207.xml" + 0207-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0207.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0207.out 0207-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0213 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0213.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0213.xml" + 0213-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0213.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0213.out 0213-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0214 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0214.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0214.xml" + 0214-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0214.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0214.out 0214-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0216 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0216.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0216.xml" + 0216-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0216.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0216.out 0216-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0217 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0217.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0217.xml" + 0217-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0217.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0217.out 0217-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0218 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0218.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0218.xml" + 0218-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0218.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0218.out 0218-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0219 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0219.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0219.xml" + 0219-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0219.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0219.out 0219-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0220 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0220.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0220.xml" + 0220-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0220.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0220.out 0220-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0221 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0221.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0221.xml" + 0221-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0221.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0221.out 0221-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0222 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0222.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0222.xml" + 0222-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0222.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0222.out 0222-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0223 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0223.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0223.xml" + 0223-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0223.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0223.out 0223-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0224 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0224.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0224.xml" + 0224-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0224.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0224.out 0224-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0225 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0225.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0225.xml" + 0225-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0225.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0225.out 0225-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0226 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0226.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0226.xml" + 0226-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0226.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0226.out 0226-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0227 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0227.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0227.xml" + 0227-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0227.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0227.out 0227-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0228 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0228.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0228.xml" + 0228-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0228.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0228.out 0228-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0229 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0229.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0229.xml" + 0229-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0229.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0229.out 0229-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0230 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0230.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0230.xml" + 0230-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0230.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0230.out 0230-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0231 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0231.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0231.xml" + 0231-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0231.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0231.out 0231-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0232 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0232.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0232.xml" + 0232-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0232.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0232.out 0232-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0233 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0233.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0233.xml" + 0233-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0233.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0233.out 0233-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0234 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0234.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0234.xml" + 0234-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0234.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0234.out 0234-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0235 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0235.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0235.xml" + 0235-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0235.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0235.out 0235-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0236 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0236.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0236.xml" + 0236-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0236.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0236.out 0236-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0237 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0237.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0237.xml" + 0237-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0237.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0237.out 0237-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0238 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0238.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0238.xml" + 0238-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0238.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0238.out 0238-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0239 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0239.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0239.xml" + 0239-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0239.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0239.out 0239-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0246 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0246.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0246.xml" + 0246-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0246.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0246.out 0246-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0247 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0247.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0247.xml" + 0247-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0247.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0247.out 0247-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0248 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0248.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0248.xml" + 0248-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0248.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0248.out 0248-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0249 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0249.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0249.xml" + 0249-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0249.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0249.out 0249-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0250 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0250.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0250.xml" + 0250-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0250.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0250.out 0250-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0251 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0251.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0251.xml" + 0251-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0251.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0251.out 0251-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0252 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0252.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0252.xml" + 0252-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0252.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0252.out 0252-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0253 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0253.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0253.xml" + 0253-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0253.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0253.out 0253-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0254 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0254.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0254.xml" + 0254-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0254.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0254.out 0254-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0255 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0255.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0255.xml" + 0255-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0255.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0255.out 0255-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0256 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0256.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0256.xml" + 0256-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0256.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0256.out 0256-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0257 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0257.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0257.xml" + 0257-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0257.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0257.out 0257-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0258 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0258.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0258.xml" + 0258-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0258.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0258.out 0258-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0259 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0259.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0259.xml" + 0259-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0259.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0259.out 0259-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0260 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0260.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0260.xml" + 0260-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0260.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0260.out 0260-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0261 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0261.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0261.xml" + 0261-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0261.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0261.out 0261-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0262 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0262.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0262.xml" + 0262-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0262.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0262.out 0262-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0263 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0263.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0263.xml" + 0263-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0263.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0263.out 0263-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0264 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0264.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0264.xml" + 0264-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0264.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0264.out 0264-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0265 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0265.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0265.xml" + 0265-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0265.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0265.out 0265-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0266 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0266.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0266.xml" + 0266-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0266.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0266.out 0266-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0267 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0267.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0267.xml" + 0267-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0267.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0267.out 0267-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0268 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0268.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0268.xml" + 0268-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0268.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0268.out 0268-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0269 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0269.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0269.xml" + 0269-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0269.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0269.out 0269-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0269 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0269.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0269.xml" + 0269-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0269.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0269.out 0269-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0271 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0271.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0271.xml" + 0271-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0271.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0271.out 0271-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0272 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0272.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0272.xml" + 0272-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0272.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0272.out 0272-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0273 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0273.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0273.xml" + 0273-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0273.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0273.out 0273-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0274 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0274.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0274.xml" + 0274-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0274.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0274.out 0274-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0275 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0275.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0275.xml" + 0275-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0275.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0275.out 0275-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0276 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0276.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0276.xml" + 0276-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0276.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0276.out 0276-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0277 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0277.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0277.xml" + 0277-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0277.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0277.out 0277-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0278 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0278.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0278.xml" + 0278-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0278.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0278.out 0278-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0279 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0279.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0279.xml" + 0279-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0279.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0279.out 0279-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0280 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0280.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0280.xml" + 0280-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0280.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0280.out 0280-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0281 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0281.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0281.xml" + 0281-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0281.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0281.out 0281-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0282 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0282.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0282.xml" + 0282-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0282.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0282.out 0282-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0283 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0283.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0283.xml" + 0283-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0283.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0283.out 0283-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0284 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0284.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0284.xml" + 0284-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0284.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0284.out 0284-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0285 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0285.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0285.xml" + 0285-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0285.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0285.out 0285-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0286 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0286.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0286.xml" + 0286-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0286.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0286.out 0286-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0287 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0287.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0287.xml" + 0287-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0287.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0287.out 0287-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0289 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0289.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0289.xml" + 0289-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0289.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0289.out 0289-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0290 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0290.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0290.xml" + 0290-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0290.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0290.out 0290-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0291 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0291.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0291.xml" + 0291-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0291.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0291.out 0291-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0292 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0292.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0292.xml" + 0292-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0292.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0292.out 0292-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0293 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0293.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0293.xml" + 0293-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0293.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0293.out 0293-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0295 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0295.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0295.xml" + 0295-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0295.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0295.out 0295-res.nt" + EXPECTED_FAILURE + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0296 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0296.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0296.xml" + 0296-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0296.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0296.out 0296-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0297 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0297.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0297.xml" + 0297-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0297.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0297.out 0297-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0298 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0298.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0298.xml" + 0298-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0298.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0298.out 0298-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0299 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0299.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0299.xml" + 0299-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0299.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0299.out 0299-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0300 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0300.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0300.xml" + 0300-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0300.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0300.out 0300-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0301 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0301.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0301.xml" + 0301-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0301.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0301.out 0301-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0302 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0302.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0302.xml" + 0302-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0302.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0302.out 0302-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0303 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0303.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0303.xml" + 0303-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0303.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0303.out 0303-res.nt" + ) + + RAPPER_RDFDIFF_TEST(rdfa11.0304 + "${RAPPER} -f noNet -q -i rdfa11 -I http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0304.xml -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0304.xml" + 0304-res.nt + "${RDFDIFF} -f ntriples -u http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/0304.xml -t ntriples ${CMAKE_CURRENT_SOURCE_DIR}/0304.out 0304-res.nt" + EXPECTED_FAILURE + ) + +ENDIF(RAPTOR_PARSER_RDFA) + +# end raptor/tests/rdfa11/CMakeLists.txt diff --git a/tests/rdfa11/Makefile.am b/tests/rdfa11/Makefile.am new file mode 100644 index 0000000..bce2570 --- /dev/null +++ b/tests/rdfa11/Makefile.am @@ -0,0 +1,211 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor RDFa 1.1 tests +# +# Copyright (C) 2012, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +BASE_URI=http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/ +# +# Manifest: +# https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl +# defines whether sparql ASK should return true or false for success +# +# Query to return all RDFA 1.1 test URIs: +# +# roqet -r csv -D https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl -e 'select ?t where {?t "rdfa1.1"}' +# +# Query to return RDFa 1.1 tests that must return False: +# roqet -r csv -D https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl -e 'select * where {?s false; "rdfa1.1"}' +# +# http://rdfa.info/test-suite/test-cases/0107 +# http://rdfa.info/test-suite/test-cases/0122 +# http://rdfa.info/test-suite/test-cases/0140 +# http://rdfa.info/test-suite/test-cases/0235 +# http://rdfa.info/test-suite/test-cases/0258 +# +# http://rdfa.info/test-suite/test-cases/0180 MUST not return given triple; expected to return 1 triple +# +# These all expect 0 ntriples - failure is >0 triples or ERROR + +CLEANFILES= \ +CMakeTests.txt \ +*-res.nt + +TEST_FILES= \ +0001.xml 0006.xml 0007.xml 0008.xml 0009.xml 0010.xml 0012.xml \ +0013.xml 0014.xml 0015.xml 0017.xml 0018.xml 0019.xml 0020.xml \ +0021.xml 0023.xml 0025.xml 0026.xml 0027.xml 0029.xml 0030.xml \ +0031.xml 0032.xml 0033.xml 0034.xml 0035.xml 0036.xml 0037.xml \ +0038.xml 0039.xml 0041.xml 0048.xml 0049.xml 0050.xml 0051.xml \ +0052.xml 0053.xml 0054.xml 0055.xml 0056.xml 0057.xml 0059.xml \ +0060.xml 0061.xml 0062.xml 0063.xml 0064.xml 0065.xml 0066.xml \ +0067.xml 0068.xml 0069.xml 0070.xml 0071.xml 0072.xml 0073.xml \ +0074.xml 0075.xml 0076.xml 0077.xml 0079.xml 0080.xml 0083.xml \ +0084.xml 0085.xml 0087.xml 0088.xml 0089.xml 0091.xml 0093.xml \ +0099.xml 0104.xml 0106.xml 0107.xml 0108.xml 0109.xml 0110.xml \ +0111.xml 0112.xml 0113.xml 0114.xml 0115.xml 0117.xml 0118.xml \ +0119.xml 0120.xml 0121.xml 0122.xml 0126.xml 0131.xml 0134.xml \ +0140.xml 0147.xml 0172.xml 0173.xml 0174.xml 0175.xml 0176.xml \ +0177.xml 0178.xml 0179.xml 0180.xml 0181.xml 0182.xml 0183.xml \ +0186.xml 0187.xml 0188.xml 0189.xml 0190.xml 0196.xml 0197.xml \ +0198.xml 0201.xml 0202.xml 0203.xml 0206.xml 0207.xml 0213.xml \ +0214.xml 0216.xml 0217.xml 0218.xml 0219.xml 0220.xml 0221.xml \ +0222.xml 0223.xml 0224.xml 0225.xml 0226.xml 0227.xml 0228.xml \ +0229.xml 0230.xml 0231.xml 0232.xml 0233.xml 0234.xml 0235.xml \ +0236.xml 0237.xml 0238.xml 0239.xml 0246.xml 0247.xml 0248.xml \ +0249.xml 0250.xml 0251.xml 0252.xml 0253.xml 0254.xml 0255.xml \ +0256.xml 0257.xml 0258.xml 0259.xml 0260.xml 0261.xml 0262.xml \ +0263.xml 0264.xml 0265.xml 0266.xml 0267.xml 0268.xml 0269.xml \ +0269.xml 0271.xml 0272.xml 0273.xml 0274.xml 0275.xml 0276.xml \ +0277.xml 0278.xml 0279.xml 0280.xml 0281.xml 0282.xml 0283.xml \ +0284.xml 0285.xml 0286.xml 0287.xml 0289.xml 0290.xml 0291.xml \ +0292.xml 0293.xml 0295.xml 0296.xml 0297.xml 0298.xml 0299.xml \ +0300.xml 0301.xml 0302.xml 0303.xml 0304.xml + +TEST_OUT_FILES = \ +0001.out 0006.out 0007.out 0008.out 0009.out 0010.out 0012.out \ +0013.out 0014.out 0015.out 0017.out 0018.out 0019.out 0020.out \ +0021.out 0023.out 0025.out 0026.out 0027.out 0029.out 0030.out \ +0031.out 0032.out 0033.out 0034.out 0035.out 0036.out 0037.out \ +0038.out 0039.out 0041.out 0048.out 0049.out 0050.out 0051.out \ +0052.out 0053.out 0054.out 0055.out 0056.out 0057.out 0059.out \ +0060.out 0061.out 0062.out 0063.out 0064.out 0065.out 0066.out \ +0067.out 0068.out 0069.out 0070.out 0071.out 0072.out 0073.out \ +0074.out 0075.out 0076.out 0077.out 0079.out 0080.out 0083.out \ +0084.out 0085.out 0087.out 0088.out 0089.out 0091.out 0093.out \ +0099.out 0104.out 0106.out 0107.out 0108.out 0109.out 0110.out \ +0111.out 0112.out 0113.out 0114.out 0115.out 0117.out 0118.out \ +0119.out 0120.out 0121.out 0122.out 0126.out 0131.out 0134.out \ +0140.out 0147.out 0172.out 0173.out 0174.out 0175.out 0176.out \ +0177.out 0178.out 0179.out 0180.out 0181.out 0182.out 0183.out \ +0186.out 0187.out 0188.out 0189.out 0190.out 0196.out 0197.out \ +0198.out 0201.out 0202.out 0203.out 0206.out 0207.out 0213.out \ +0214.out 0216.out 0217.out 0218.out 0219.out 0220.out 0221.out \ +0222.out 0223.out 0224.out 0225.out 0226.out 0227.out 0228.out \ +0229.out 0230.out 0231.out 0232.out 0233.out 0234.out 0235.out \ +0236.out 0237.out 0238.out 0239.out 0246.out 0247.out 0248.out \ +0249.out 0250.out 0251.out 0252.out 0253.out 0254.out 0255.out \ +0256.out 0257.out 0258.out 0259.out 0260.out 0261.out 0262.out \ +0263.out 0264.out 0265.out 0266.out 0267.out 0268.out 0269.out \ +0269.out 0271.out 0272.out 0273.out 0274.out 0275.out 0276.out \ +0277.out 0278.out 0279.out 0280.out 0281.out 0282.out 0283.out \ +0284.out 0285.out 0286.out 0287.out 0289.out 0290.out 0291.out \ +0292.out 0293.out 0295.out 0296.out 0297.out 0298.out 0299.out \ +0300.out 0301.out 0302.out 0303.out 0304.out + +ALL_TEST_FILES= \ + $(TEST_FILES) \ + $(TEST_OUT_FILES) + +# Expected test failures (24): +# Test Problem Description +# ---------------------------- +# 0190 librdfa fails term case insensitivity +# 0198 raptor XML (HTML) markup differences but same meaning +# 0202 librdfa ensure @xml:base in SVG and XHTML5 +# 0203 librdfa ensure @, XML+RDFa in non-root elements in SVG and XHTML5 +# 0236 librdfa should return triple(?s a ) +# 0238 librdfa should return triple(?s a ) +# 0237 0239 +# librdfa should return triple(?s a ) +# 0256 librdfa wrong language code "hu" instead of "fr" +# 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 +# librdfa datatype support +# 0285 librdfa time element with @datetime an invalid datatype ... +# 0286 librdfa fails to let @value override @content in data +# 0287 librdfa datatype (@datetime etc.) attribute value +# 0304 ??? requires running RDF/XML parse for SVG metadata +# +# NOTE: Some tests such as 0295 blow up rdfdiff with stack overflow +# which is why the 'cmp' is done first. +# +# (Add a space to the start of this string) +EXPECTED_FAILURES=" 0190.xml 0198.xml 0202.xml 0203.xml 0236.xml 0237.xml 0238.xml 0239.xml 0256.xml 0272.xml 0273.xml 0274.xml 0275.xml 0276.xml 0277.xml 0278.xml 0279.xml 0280.xml 0281.xml 0282.xml 0285.xml 0286.xml 0287.xml 0304.xml" + +EXTRA_DIST = CMakeLists.txt $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +if RAPTOR_PARSER_RDFA +check-local: check-rdfa +else +check-local: +endif + +if MAINTAINER_MODE +check_rdfa_deps = $(TEST_FILES) +endif + +check-rdfa: build-rdfdiff build-rapper $(check_rdfa_deps) + @set +e; result=0; failures=; failure_count=0; \ + $(RECHO) "Testing RDFa 1.1"; \ + printf 'IF(RAPTOR_PARSER_RDFA)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .xml` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + baseuri=$(BASE_URI)$$test; \ + $(RAPPER) -f noNet -q -i rdfa11 -I $$baseuri -o ntriples $(srcdir)/$$test > $$name-res.nt 2> $$name.err; \ + status1=$$?; \ + if test $$status1 = 2; then \ + status1=0; \ + fi; \ + if cmp $(srcdir)/$$name.out $$name-res.nt >/dev/null 2>&1; then \ + status2=0; \ + else \ + $(RDFDIFF) -f ntriples -u $$baseuri -t ntriples $(srcdir)/$$name.out $$name-res.nt > $$name.res 2> $$name.err; \ + status2=$$?; \ + fi; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "Triple counts: expected: `wc -l < $(srcdir)/$$name.out` got: `wc -l < $$name-res.nt` "; \ + $(RECHO) $(RAPPER) -f noNet -q -i rdfa11 -I $$baseuri -o ntriples $(srcdir)/$$test '>' $$name-res.nt; \ + $(RECHO) $(RDFDIFF) -f ntriples -u $$baseuri -t ntriples $(srcdir)/$$name.out $$name-res.nt '>' $$name.res; \ + cat $$name.err $$name.res; \ + failures="$$failures $$test"; \ + failure_count=`expr $$failure_count + 1`; \ + fi; \ + rm -f $$name-res.nt $$name.res $$name.err; \ + printf '\tRAPPER_RDFDIFF_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t"%s"\n\t)\n\n' \ + rdfa11.$$name \ + "\$${RAPPER} -f noNet -q -i rdfa11 -I $$baseuri -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$name-res.nt \ + "\$${RDFDIFF} -f ntriples -u $$baseuri -t ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out $$name-res.nt" \ + >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_RDFA)\n\n' >>CMakeTests.txt; \ + if test "X$$failures" != X; then \ + echo "$$failure_count tests FAILED: $$failures"; \ + if test "$$failures" = $(EXPECTED_FAILURES); then \ + echo "Ignoring expected failures"; \ + result=0; \ + else \ + echo "FAILED: Got:"; echo " $$failures"; echo "but expected"; echo " $(EXPECTED_FAILURES)"; \ + result=1; \ + fi; \ + fi; \ + set -e; exit $$result diff --git a/tests/rdfa11/Makefile.in b/tests/rdfa11/Makefile.in new file mode 100644 index 0000000..9443274 --- /dev/null +++ b/tests/rdfa11/Makefile.in @@ -0,0 +1,697 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor RDFa 1.1 tests +# +# Copyright (C) 2012, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/rdfa11 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +BASE_URI = http://rdfa.info/test-suite/test-cases/xhtml1/rdfa1.0/ +# +# Manifest: +# https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl +# defines whether sparql ASK should return true or false for success +# +# Query to return all RDFA 1.1 test URIs: +# +# roqet -r csv -D https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl -e 'select ?t where {?t "rdfa1.1"}' +# +# Query to return RDFa 1.1 tests that must return False: +# roqet -r csv -D https://raw.github.com/rdfa/rdfa-website/master/manifest.ttl -e 'select * where {?s false; "rdfa1.1"}' +# +# http://rdfa.info/test-suite/test-cases/0107 +# http://rdfa.info/test-suite/test-cases/0122 +# http://rdfa.info/test-suite/test-cases/0140 +# http://rdfa.info/test-suite/test-cases/0235 +# http://rdfa.info/test-suite/test-cases/0258 +# +# http://rdfa.info/test-suite/test-cases/0180 MUST not return given triple; expected to return 1 triple +# +# These all expect 0 ntriples - failure is >0 triples or ERROR +CLEANFILES = \ +CMakeTests.txt \ +*-res.nt + +TEST_FILES = \ +0001.xml 0006.xml 0007.xml 0008.xml 0009.xml 0010.xml 0012.xml \ +0013.xml 0014.xml 0015.xml 0017.xml 0018.xml 0019.xml 0020.xml \ +0021.xml 0023.xml 0025.xml 0026.xml 0027.xml 0029.xml 0030.xml \ +0031.xml 0032.xml 0033.xml 0034.xml 0035.xml 0036.xml 0037.xml \ +0038.xml 0039.xml 0041.xml 0048.xml 0049.xml 0050.xml 0051.xml \ +0052.xml 0053.xml 0054.xml 0055.xml 0056.xml 0057.xml 0059.xml \ +0060.xml 0061.xml 0062.xml 0063.xml 0064.xml 0065.xml 0066.xml \ +0067.xml 0068.xml 0069.xml 0070.xml 0071.xml 0072.xml 0073.xml \ +0074.xml 0075.xml 0076.xml 0077.xml 0079.xml 0080.xml 0083.xml \ +0084.xml 0085.xml 0087.xml 0088.xml 0089.xml 0091.xml 0093.xml \ +0099.xml 0104.xml 0106.xml 0107.xml 0108.xml 0109.xml 0110.xml \ +0111.xml 0112.xml 0113.xml 0114.xml 0115.xml 0117.xml 0118.xml \ +0119.xml 0120.xml 0121.xml 0122.xml 0126.xml 0131.xml 0134.xml \ +0140.xml 0147.xml 0172.xml 0173.xml 0174.xml 0175.xml 0176.xml \ +0177.xml 0178.xml 0179.xml 0180.xml 0181.xml 0182.xml 0183.xml \ +0186.xml 0187.xml 0188.xml 0189.xml 0190.xml 0196.xml 0197.xml \ +0198.xml 0201.xml 0202.xml 0203.xml 0206.xml 0207.xml 0213.xml \ +0214.xml 0216.xml 0217.xml 0218.xml 0219.xml 0220.xml 0221.xml \ +0222.xml 0223.xml 0224.xml 0225.xml 0226.xml 0227.xml 0228.xml \ +0229.xml 0230.xml 0231.xml 0232.xml 0233.xml 0234.xml 0235.xml \ +0236.xml 0237.xml 0238.xml 0239.xml 0246.xml 0247.xml 0248.xml \ +0249.xml 0250.xml 0251.xml 0252.xml 0253.xml 0254.xml 0255.xml \ +0256.xml 0257.xml 0258.xml 0259.xml 0260.xml 0261.xml 0262.xml \ +0263.xml 0264.xml 0265.xml 0266.xml 0267.xml 0268.xml 0269.xml \ +0269.xml 0271.xml 0272.xml 0273.xml 0274.xml 0275.xml 0276.xml \ +0277.xml 0278.xml 0279.xml 0280.xml 0281.xml 0282.xml 0283.xml \ +0284.xml 0285.xml 0286.xml 0287.xml 0289.xml 0290.xml 0291.xml \ +0292.xml 0293.xml 0295.xml 0296.xml 0297.xml 0298.xml 0299.xml \ +0300.xml 0301.xml 0302.xml 0303.xml 0304.xml + +TEST_OUT_FILES = \ +0001.out 0006.out 0007.out 0008.out 0009.out 0010.out 0012.out \ +0013.out 0014.out 0015.out 0017.out 0018.out 0019.out 0020.out \ +0021.out 0023.out 0025.out 0026.out 0027.out 0029.out 0030.out \ +0031.out 0032.out 0033.out 0034.out 0035.out 0036.out 0037.out \ +0038.out 0039.out 0041.out 0048.out 0049.out 0050.out 0051.out \ +0052.out 0053.out 0054.out 0055.out 0056.out 0057.out 0059.out \ +0060.out 0061.out 0062.out 0063.out 0064.out 0065.out 0066.out \ +0067.out 0068.out 0069.out 0070.out 0071.out 0072.out 0073.out \ +0074.out 0075.out 0076.out 0077.out 0079.out 0080.out 0083.out \ +0084.out 0085.out 0087.out 0088.out 0089.out 0091.out 0093.out \ +0099.out 0104.out 0106.out 0107.out 0108.out 0109.out 0110.out \ +0111.out 0112.out 0113.out 0114.out 0115.out 0117.out 0118.out \ +0119.out 0120.out 0121.out 0122.out 0126.out 0131.out 0134.out \ +0140.out 0147.out 0172.out 0173.out 0174.out 0175.out 0176.out \ +0177.out 0178.out 0179.out 0180.out 0181.out 0182.out 0183.out \ +0186.out 0187.out 0188.out 0189.out 0190.out 0196.out 0197.out \ +0198.out 0201.out 0202.out 0203.out 0206.out 0207.out 0213.out \ +0214.out 0216.out 0217.out 0218.out 0219.out 0220.out 0221.out \ +0222.out 0223.out 0224.out 0225.out 0226.out 0227.out 0228.out \ +0229.out 0230.out 0231.out 0232.out 0233.out 0234.out 0235.out \ +0236.out 0237.out 0238.out 0239.out 0246.out 0247.out 0248.out \ +0249.out 0250.out 0251.out 0252.out 0253.out 0254.out 0255.out \ +0256.out 0257.out 0258.out 0259.out 0260.out 0261.out 0262.out \ +0263.out 0264.out 0265.out 0266.out 0267.out 0268.out 0269.out \ +0269.out 0271.out 0272.out 0273.out 0274.out 0275.out 0276.out \ +0277.out 0278.out 0279.out 0280.out 0281.out 0282.out 0283.out \ +0284.out 0285.out 0286.out 0287.out 0289.out 0290.out 0291.out \ +0292.out 0293.out 0295.out 0296.out 0297.out 0298.out 0299.out \ +0300.out 0301.out 0302.out 0303.out 0304.out + +ALL_TEST_FILES = \ + $(TEST_FILES) \ + $(TEST_OUT_FILES) + + +# Expected test failures (24): +# Test Problem Description +# ---------------------------- +# 0190 librdfa fails term case insensitivity +# 0198 raptor XML (HTML) markup differences but same meaning +# 0202 librdfa ensure @xml:base in SVG and XHTML5 +# 0203 librdfa ensure @, XML+RDFa in non-root elements in SVG and XHTML5 +# 0236 librdfa should return triple(?s a ) +# 0238 librdfa should return triple(?s a ) +# 0237 0239 +# librdfa should return triple(?s a ) +# 0256 librdfa wrong language code "hu" instead of "fr" +# 0272 0273 0274 0275 0276 0277 0278 0279 0280 0281 0282 +# librdfa datatype support +# 0285 librdfa time element with @datetime an invalid datatype ... +# 0286 librdfa fails to let @value override @content in data +# 0287 librdfa datatype (@datetime etc.) attribute value +# 0304 ??? requires running RDF/XML parse for SVG metadata +# +# NOTE: Some tests such as 0295 blow up rdfdiff with stack overflow +# which is why the 'cmp' is done first. +# +# (Add a space to the start of this string) +EXPECTED_FAILURES = " 0190.xml 0198.xml 0202.xml 0203.xml 0236.xml 0237.xml 0238.xml 0239.xml 0256.xml 0272.xml 0273.xml 0274.xml 0275.xml 0276.xml 0277.xml 0278.xml 0279.xml 0280.xml 0281.xml 0282.xml 0285.xml 0286.xml 0287.xml 0304.xml" +EXTRA_DIST = CMakeLists.txt $(ALL_TEST_FILES) +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff +@MAINTAINER_MODE_TRUE@check_rdfa_deps = $(TEST_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/rdfa11/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/rdfa11/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +@RAPTOR_PARSER_RDFA_TRUE@check-local: check-rdfa +@RAPTOR_PARSER_RDFA_FALSE@check-local: + +check-rdfa: build-rdfdiff build-rapper $(check_rdfa_deps) + @set +e; result=0; failures=; failure_count=0; \ + $(RECHO) "Testing RDFa 1.1"; \ + printf 'IF(RAPTOR_PARSER_RDFA)\n\n' >>CMakeTests.txt; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .xml` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + baseuri=$(BASE_URI)$$test; \ + $(RAPPER) -f noNet -q -i rdfa11 -I $$baseuri -o ntriples $(srcdir)/$$test > $$name-res.nt 2> $$name.err; \ + status1=$$?; \ + if test $$status1 = 2; then \ + status1=0; \ + fi; \ + if cmp $(srcdir)/$$name.out $$name-res.nt >/dev/null 2>&1; then \ + status2=0; \ + else \ + $(RDFDIFF) -f ntriples -u $$baseuri -t ntriples $(srcdir)/$$name.out $$name-res.nt > $$name.res 2> $$name.err; \ + status2=$$?; \ + fi; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + $(RECHO) "Triple counts: expected: `wc -l < $(srcdir)/$$name.out` got: `wc -l < $$name-res.nt` "; \ + $(RECHO) $(RAPPER) -f noNet -q -i rdfa11 -I $$baseuri -o ntriples $(srcdir)/$$test '>' $$name-res.nt; \ + $(RECHO) $(RDFDIFF) -f ntriples -u $$baseuri -t ntriples $(srcdir)/$$name.out $$name-res.nt '>' $$name.res; \ + cat $$name.err $$name.res; \ + failures="$$failures $$test"; \ + failure_count=`expr $$failure_count + 1`; \ + fi; \ + rm -f $$name-res.nt $$name.res $$name.err; \ + printf '\tRAPPER_RDFDIFF_TEST(%s\n\t\t"%s"\n\t\t%s\n\t\t"%s"\n\t)\n\n' \ + rdfa11.$$name \ + "\$${RAPPER} -f noNet -q -i rdfa11 -I $$baseuri -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test" \ + $$name-res.nt \ + "\$${RDFDIFF} -f ntriples -u $$baseuri -t ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out $$name-res.nt" \ + >>CMakeTests.txt; \ + done; \ + printf 'ENDIF(RAPTOR_PARSER_RDFA)\n\n' >>CMakeTests.txt; \ + if test "X$$failures" != X; then \ + echo "$$failure_count tests FAILED: $$failures"; \ + if test "$$failures" = $(EXPECTED_FAILURES); then \ + echo "Ignoring expected failures"; \ + result=0; \ + else \ + echo "FAILED: Got:"; echo " $$failures"; echo "but expected"; echo " $(EXPECTED_FAILURES)"; \ + result=1; \ + fi; \ + fi; \ + set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/rdfxml/22-rdf-syntax-ns.out b/tests/rdfxml/22-rdf-syntax-ns.out new file mode 100644 index 0000000..740be0c --- /dev/null +++ b/tests/rdfxml/22-rdf-syntax-ns.out @@ -0,0 +1,23 @@ + . + "A triple consisting of a predicate, a subject, and an object." . + . + "A name of a property, defining specific meaning for the property" . + . + "An unordered collection" . + . + "An ordered collection" . + . + "A collection of alternatives" . + . + "Identifies the property used in a statement when representing the statement in reified form" . + . + . + . + "Identifies the resource that a statement is describing when representing the statement in reified form" . + . + . + "Identifies the object of a statement when representing the statement in reified form" . + . + "Identifies the Class of a resource" . + . + "Identifies the principal value (usually a string) of a property when the property value is a structured resource" . diff --git a/tests/rdfxml/22-rdf-syntax-ns.rdf b/tests/rdfxml/22-rdf-syntax-ns.rdf new file mode 100644 index 0000000..41d2dfe --- /dev/null +++ b/tests/rdfxml/22-rdf-syntax-ns.rdf @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/rdfxml/CMakeLists.txt b/tests/rdfxml/CMakeLists.txt new file mode 100644 index 0000000..30417ce --- /dev/null +++ b/tests/rdfxml/CMakeLists.txt @@ -0,0 +1,523 @@ +# raptor/tests/rdfxml/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +RAPPER_TEST(rdfxml.ex-00 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-00.rdf http://librdf.org/raptor/tests/ex-00.rdf" + ex-00.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-00.out +) + +RAPPER_TEST(rdfxml.ex-01 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-01.rdf http://librdf.org/raptor/tests/ex-01.rdf" + ex-01.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-01.out +) + +RAPPER_TEST(rdfxml.ex-02 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-02.rdf http://librdf.org/raptor/tests/ex-02.rdf" + ex-02.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-02.out +) + +RAPPER_TEST(rdfxml.ex-04 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-04.rdf http://librdf.org/raptor/tests/ex-04.rdf" + ex-04.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-04.out +) + +RAPPER_TEST(rdfxml.ex-05 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-05.rdf http://librdf.org/raptor/tests/ex-05.rdf" + ex-05.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-05.out +) + +RAPPER_TEST(rdfxml.ex-06 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-06.rdf http://librdf.org/raptor/tests/ex-06.rdf" + ex-06.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-06.out +) + +RAPPER_TEST(rdfxml.ex-07 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-07.rdf http://librdf.org/raptor/tests/ex-07.rdf" + ex-07.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-07.out +) + +RAPPER_TEST(rdfxml.ex-08 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-08.rdf http://librdf.org/raptor/tests/ex-08.rdf" + ex-08.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-08.out +) + +RAPPER_TEST(rdfxml.ex-09 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-09.rdf http://librdf.org/raptor/tests/ex-09.rdf" + ex-09.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-09.out +) + +RAPPER_TEST(rdfxml.ex-10 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-10.rdf http://librdf.org/raptor/tests/ex-10.rdf" + ex-10.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-10.out +) + +RAPPER_TEST(rdfxml.ex-11 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-11.rdf http://librdf.org/raptor/tests/ex-11.rdf" + ex-11.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-11.out +) + +RAPPER_TEST(rdfxml.ex-12 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-12.rdf http://librdf.org/raptor/tests/ex-12.rdf" + ex-12.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-12.out +) + +RAPPER_TEST(rdfxml.ex-13 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-13.rdf http://librdf.org/raptor/tests/ex-13.rdf" + ex-13.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-13.out +) + +RAPPER_TEST(rdfxml.ex-14 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-14.rdf http://librdf.org/raptor/tests/ex-14.rdf" + ex-14.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-14.out +) + +RAPPER_TEST(rdfxml.ex-15 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-15.rdf http://librdf.org/raptor/tests/ex-15.rdf" + ex-15.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-15.out +) + +RAPPER_TEST(rdfxml.ex-16 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-16.rdf http://librdf.org/raptor/tests/ex-16.rdf" + ex-16.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-16.out +) + +RAPPER_TEST(rdfxml.ex-17 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-17.rdf http://librdf.org/raptor/tests/ex-17.rdf" + ex-17.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-17.out +) + +RAPPER_TEST(rdfxml.ex-18 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-18.rdf http://librdf.org/raptor/tests/ex-18.rdf" + ex-18.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-18.out +) + +RAPPER_TEST(rdfxml.ex-20 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-20.rdf http://librdf.org/raptor/tests/ex-20.rdf" + ex-20.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-20.out +) + +RAPPER_TEST(rdfxml.ex-21 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-21.rdf http://librdf.org/raptor/tests/ex-21.rdf" + ex-21.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-21.out +) + +RAPPER_TEST(rdfxml.ex-22 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-22.rdf http://librdf.org/raptor/tests/ex-22.rdf" + ex-22.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-22.out +) + +RAPPER_TEST(rdfxml.ex-23 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-23.rdf http://librdf.org/raptor/tests/ex-23.rdf" + ex-23.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-23.out +) + +RAPPER_TEST(rdfxml.ex-24 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-24.rdf http://librdf.org/raptor/tests/ex-24.rdf" + ex-24.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-24.out +) + +RAPPER_TEST(rdfxml.ex-25 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-25.rdf http://librdf.org/raptor/tests/ex-25.rdf" + ex-25.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-25.out +) + +RAPPER_TEST(rdfxml.ex-26 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-26.rdf http://librdf.org/raptor/tests/ex-26.rdf" + ex-26.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-26.out +) + +RAPPER_TEST(rdfxml.ex-27 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-27.rdf http://librdf.org/raptor/tests/ex-27.rdf" + ex-27.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-27.out +) + +RAPPER_TEST(rdfxml.ex-28 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-28.rdf http://librdf.org/raptor/tests/ex-28.rdf" + ex-28.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-28.out +) + +RAPPER_TEST(rdfxml.ex-29 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-29.rdf http://librdf.org/raptor/tests/ex-29.rdf" + ex-29.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-29.out +) + +RAPPER_TEST(rdfxml.ex-30 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-30.rdf http://librdf.org/raptor/tests/ex-30.rdf" + ex-30.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-30.out +) + +RAPPER_TEST(rdfxml.ex-31 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-31.rdf http://librdf.org/raptor/tests/ex-31.rdf" + ex-31.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-31.out +) + +RAPPER_TEST(rdfxml.ex-32 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-32.rdf http://librdf.org/raptor/tests/ex-32.rdf" + ex-32.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-32.out +) + +RAPPER_TEST(rdfxml.ex-33 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-33.rdf http://librdf.org/raptor/tests/ex-33.rdf" + ex-33.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-33.out +) + +RAPPER_TEST(rdfxml.ex-34 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-34.rdf http://librdf.org/raptor/tests/ex-34.rdf" + ex-34.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-34.out +) + +RAPPER_TEST(rdfxml.ex-35 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-35.rdf http://librdf.org/raptor/tests/ex-35.rdf" + ex-35.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-35.out +) + +RAPPER_TEST(rdfxml.ex-36 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-36.rdf http://librdf.org/raptor/tests/ex-36.rdf" + ex-36.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-36.out +) + +RAPPER_TEST(rdfxml.ex-37 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-37.rdf http://librdf.org/raptor/tests/ex-37.rdf" + ex-37.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-37.out +) + +RAPPER_TEST(rdfxml.ex-38 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-38.rdf http://librdf.org/raptor/tests/ex-38.rdf" + ex-38.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-38.out +) + +RAPPER_TEST(rdfxml.ex-39 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-39.rdf http://librdf.org/raptor/tests/ex-39.rdf" + ex-39.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-39.out +) + +RAPPER_TEST(rdfxml.ex-40 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-40.rdf http://librdf.org/raptor/tests/ex-40.rdf" + ex-40.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-40.out +) + +RAPPER_TEST(rdfxml.ex-41 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-41.rdf http://librdf.org/raptor/tests/ex-41.rdf" + ex-41.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-41.out +) + +RAPPER_TEST(rdfxml.ex-46 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-46.rdf http://librdf.org/raptor/tests/ex-46.rdf" + ex-46.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-46.out +) + +RAPPER_TEST(rdfxml.ex-47 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-47.rdf http://librdf.org/raptor/tests/ex-47.rdf" + ex-47.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-47.out +) + +RAPPER_TEST(rdfxml.ex-48 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-48.rdf http://librdf.org/raptor/tests/ex-48.rdf" + ex-48.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-48.out +) + +RAPPER_TEST(rdfxml.ex-49 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-49.rdf http://librdf.org/raptor/tests/ex-49.rdf" + ex-49.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-49.out +) + +RAPPER_TEST(rdfxml.ex-51 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-51.rdf http://librdf.org/raptor/tests/ex-51.rdf" + ex-51.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-51.out +) + +RAPPER_TEST(rdfxml.ex-53 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-53.rdf http://librdf.org/raptor/tests/ex-53.rdf" + ex-53.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-53.out +) + +RAPPER_TEST(rdfxml.ex-54 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-54.rdf http://librdf.org/raptor/tests/ex-54.rdf" + ex-54.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-54.out +) + +RAPPER_TEST(rdfxml.ex-56 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-56.rdf http://librdf.org/raptor/tests/ex-56.rdf" + ex-56.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-56.out +) + +RAPPER_TEST(rdfxml.ex-57 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-57.rdf http://librdf.org/raptor/tests/ex-57.rdf" + ex-57.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-57.out +) + +RAPPER_TEST(rdfxml.ex-58 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-58.rdf http://librdf.org/raptor/tests/ex-58.rdf" + ex-58.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-58.out +) + +RAPPER_TEST(rdfxml.ex-61 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-61.rdf http://librdf.org/raptor/tests/ex-61.rdf" + ex-61.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-61.out +) + +RAPPER_TEST(rdfxml.ex-62 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-62.rdf http://librdf.org/raptor/tests/ex-62.rdf" + ex-61.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-62.out +) + +RAPPER_TEST(rdfxml.ex-63 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-63.rdf http://librdf.org/raptor/tests/ex-63.rdf" + ex-61.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-63.out +) + +RAPPER_TEST(rdfxml.bug-650 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/bug-650.rdf http://librdf.org/raptor/tests/bug-650.rdf" + ex-61.res + ${CMAKE_CURRENT_SOURCE_DIR}/bug-650.out +) + +RAPPER_TEST(rdfxml.22-rdf-syntax-ns + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/22-rdf-syntax-ns.rdf http://www.w3.org/1999/02/22-rdf-syntax-ns" + 22-rdf-syntax-ns.res + ${CMAKE_CURRENT_SOURCE_DIR}/22-rdf-syntax-ns.out +) + +RAPPER_TEST(rdfxml.rdfs-namespace + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/rdfs-namespace.rdf http://www.w3.org/2000/01/rdf-schema" + rdfs-namespace.res + ${CMAKE_CURRENT_SOURCE_DIR}/rdfs-namespace.out +) + +RAPPER_TEST(rdfxml.rdf-schema + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/rdf-schema.rdf http://www.w3.org/2000/01/rdf-schema" + rdf-schema.res + ${CMAKE_CURRENT_SOURCE_DIR}/rdf-schema.out +) + +RAPPER_TEST(rdfxml.owl-schema + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/owl-schema.rdf http://www.w3.org/2002/07/owl" + owl-schema.res + ${CMAKE_CURRENT_SOURCE_DIR}/owl-schema.out +) + +RAPPER_TEST(rdfxml.daml-oil + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/daml-oil.rdf http://www.daml.org/2001/03/daml+oil" + daml-oil.res + ${CMAKE_CURRENT_SOURCE_DIR}/daml-oil.out +) + +RAPPER_TEST(rdfxml.wine + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/wine.rdf http://www.w3.org/TR/owl-guide/wine.rdf" + wine.res + ${CMAKE_CURRENT_SOURCE_DIR}/wine.out +) + +RAPPER_TEST(rdfxml.ex-55 + "${RAPPER} -q -o ntriples ${CMAKE_CURRENT_SOURCE_DIR}/ex-55.rdf http://librdf.org/raptor/tests/ex-55.rdf" + ex-55.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-55.out +) + +RAPPER_TEST(rdfxml.ex-19 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/ex-19.rdf http://librdf.org/raptor/tests/ex-19.rdf" + ex-19.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-19.out +) + +RAPPER_TEST(rdfxml.ex-52 + "${RAPPER} -q -f scanForRDF -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/ex-52.svg http://librdf.org/raptor/tests/ex-52.rdf" + ex-52.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-52.out +) + +ADD_TEST(rdfxml.bad-00 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-00.rdf http://librdf.org/raptor/tests/bad-00.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-01 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-01.rdf http://librdf.org/raptor/tests/bad-01.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-02 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-02.rdf http://librdf.org/raptor/tests/bad-02.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-03 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-03.rdf http://librdf.org/raptor/tests/bad-03.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-04 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-04.rdf http://librdf.org/raptor/tests/bad-04.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-05 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-05.rdf http://librdf.org/raptor/tests/bad-05.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-06 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-06.rdf http://librdf.org/raptor/tests/bad-06.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-07 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-07.rdf http://librdf.org/raptor/tests/bad-07.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-08 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-08.rdf http://librdf.org/raptor/tests/bad-08.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-09 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-09.rdf http://librdf.org/raptor/tests/bad-09.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-10 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-10.rdf http://librdf.org/raptor/tests/bad-10.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-11 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-11.rdf http://librdf.org/raptor/tests/bad-11.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-12 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-12.rdf http://librdf.org/raptor/tests/bad-12.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-13 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-13.rdf http://librdf.org/raptor/tests/bad-13.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-14 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-14.rdf http://librdf.org/raptor/tests/bad-14.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-18 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-18.rdf http://librdf.org/raptor/tests/bad-18.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-19 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-19.rdf http://librdf.org/raptor/tests/bad-19.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-20 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-20.rdf http://librdf.org/raptor/tests/bad-20.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-21 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-21.rdf http://librdf.org/raptor/tests/bad-21.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-22 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-22.rdf http://librdf.org/raptor/tests/bad-22.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-23 ${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-23.rdf http://librdf.org/raptor/tests/bad-23.rdf) # WILL_FAIL + +SET_TESTS_PROPERTIES( + rdfxml.bad-00 + rdfxml.bad-01 + rdfxml.bad-02 + rdfxml.bad-03 + rdfxml.bad-04 + rdfxml.bad-05 + rdfxml.bad-06 + rdfxml.bad-07 + rdfxml.bad-08 + rdfxml.bad-09 + rdfxml.bad-10 + rdfxml.bad-11 + rdfxml.bad-12 + rdfxml.bad-13 + rdfxml.bad-14 + rdfxml.bad-18 + rdfxml.bad-19 + rdfxml.bad-20 + rdfxml.bad-21 + rdfxml.bad-22 + rdfxml.bad-23 + PROPERTIES + WILL_FAIL TRUE +) + +ADD_TEST(rdfxml.bad-15 ${RAPPER} -q -m strict -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-15.rdf http://librdf.org/raptor/tests/bad-15.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-16 ${RAPPER} -q -m strict -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-16.rdf http://librdf.org/raptor/tests/bad-16.rdf) # WILL_FAIL +ADD_TEST(rdfxml.bad-17 ${RAPPER} -q -m strict -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/bad-17.rdf http://librdf.org/raptor/tests/bad-17.rdf) # WILL_FAIL + +SET_TESTS_PROPERTIES( + rdfxml.bad-15 + rdfxml.bad-16 + rdfxml.bad-17 + PROPERTIES + WILL_FAIL TRUE +) + +RAPPER_TEST(rdfxml.warn-00 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/warn-00.rdf http://librdf.org/raptor/tests/warn-00.rdf" + warn-00.res + ${CMAKE_CURRENT_SOURCE_DIR}/warn-00.out +) + +RAPPER_TEST(rdfxml.warn-02 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/warn-02.rdf http://librdf.org/raptor/tests/warn-02.rdf" + warn-02.res + ${CMAKE_CURRENT_SOURCE_DIR}/warn-02.out +) + +RAPPER_TEST(rdfxml.warn-04 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/warn-04.rdf http://librdf.org/raptor/tests/warn-04.rdf" + warn-04.res + ${CMAKE_CURRENT_SOURCE_DIR}/warn-04.out +) + +RAPPER_TEST(rdfxml.warn-05 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/warn-05.rdf http://librdf.org/raptor/tests/warn-05.rdf" + warn-05.res + ${CMAKE_CURRENT_SOURCE_DIR}/warn-05.out +) + +RAPPER_TEST(rdfxml.warn-06 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/warn-06.rdf http://librdf.org/raptor/tests/warn-06.rdf" + warn-06.res + ${CMAKE_CURRENT_SOURCE_DIR}/warn-06.out +) + +RAPPER_TEST(rdfxml.warn-07 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/warn-07.rdf http://librdf.org/raptor/tests/warn-07.rdf" + warn-07.res + ${CMAKE_CURRENT_SOURCE_DIR}/warn-07.out +) + +RAPPER_TEST(rdfxml.ex-03 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/ex-03.rdf http://librdf.org/raptor/tests/ex-03.rdf" + ex-03.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-03.out +) + +RAPPER_TEST(rdfxml.ex-42 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/ex-42.rdf http://librdf.org/raptor/tests/ex-42.rdf" + ex-42.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-42.out +) + +RAPPER_TEST(rdfxml.ex-43 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/ex-43.rdf http://librdf.org/raptor/tests/ex-43.rdf" + ex-43.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-43.out +) + +RAPPER_TEST(rdfxml.ex-44 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/ex-44.rdf http://librdf.org/raptor/tests/ex-44.rdf" + ex-44.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-44.out +) + +RAPPER_TEST(rdfxml.ex-45 + "${RAPPER} -q -o ntriples file:${CMAKE_CURRENT_SOURCE_DIR}/ex-45.rdf http://librdf.org/raptor/tests/ex-45.rdf" + ex-45.res + ${CMAKE_CURRENT_SOURCE_DIR}/ex-45.out +) + +RAPPER_TEST(rdfxml.ex-59 + "${RAPPER} -q -i ntriples -o rdfxml ${CMAKE_CURRENT_SOURCE_DIR}/ex-59.nt -" + ex-59-rdfxml.rdf + ${CMAKE_CURRENT_SOURCE_DIR}/ex-59.rdf +) + +RAPPER_TEST(rdfxml.ex-60 + "${RAPPER} -q -i ntriples -o rdfxml ${CMAKE_CURRENT_SOURCE_DIR}/ex-60.nt -" + ex-60-rdfxml.rdf + ${CMAKE_CURRENT_SOURCE_DIR}/ex-60.rdf +) + +# end raptor/tests/rdfxml/CMakeLists.txt diff --git a/tests/rdfxml/Makefile.am b/tests/rdfxml/Makefile.am new file mode 100644 index 0000000..a9fe3e7 --- /dev/null +++ b/tests/rdfxml/Makefile.am @@ -0,0 +1,469 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor RDF/XML tests +# +# Copyright (C) 2000-2008, David Beckett http://purl.org/net/dajobe/ +# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +# These are errors in strict mode, warnings in lax - for now +RDF_BAGID_TEST_FILES=ex-03.rdf ex-42.rdf ex-43.rdf ex-44.rdf ex-45.rdf + +RDF_TEST_FILES=ex-00.rdf ex-01.rdf ex-02.rdf ex-04.rdf ex-05.rdf \ +ex-06.rdf ex-07.rdf ex-08.rdf ex-09.rdf ex-10.rdf ex-11.rdf ex-12.rdf \ +ex-13.rdf ex-14.rdf ex-15.rdf ex-16.rdf ex-17.rdf ex-18.rdf \ +ex-20.rdf ex-21.rdf ex-22.rdf ex-23.rdf ex-24.rdf ex-25.rdf ex-26.rdf \ +ex-27.rdf ex-28.rdf ex-29.rdf ex-30.rdf ex-31.rdf ex-32.rdf ex-33.rdf \ +ex-34.rdf ex-35.rdf ex-36.rdf ex-37.rdf ex-38.rdf ex-39.rdf ex-40.rdf \ +ex-41.rdf ex-46.rdf ex-47.rdf ex-48.rdf ex-49.rdf ex-51.rdf \ +ex-53.rdf ex-54.rdf ex-56.rdf ex-57.rdf ex-58.rdf ex-61.rdf \ +ex-62.rdf ex-63.rdf \ +bug-650.rdf \ +22-rdf-syntax-ns.rdf rdfs-namespace.rdf rdf-schema.rdf \ +owl-schema.rdf daml-oil.rdf wine.rdf + +# ex-55 fails with libxml2 +# libxml2 bug report: http://bugs.gnome.org/show_bug.cgi?id=159219 +RDF_MAYFAIL_XML_TEST_FILES=ex-55.rdf + +RDF_BAD_TEST_FILES=bad-00.rdf bad-01.rdf bad-02.rdf bad-03.rdf \ +bad-04.rdf bad-05.rdf bad-06.rdf bad-07.rdf bad-08.rdf bad-09.rdf \ +bad-10.rdf bad-11.rdf bad-12.rdf bad-13.rdf bad-14.rdf bad-18.rdf \ +bad-19.rdf bad-20.rdf bad-21.rdf bad-22.rdf bad-23.rdf + +RDF_BAD_NFC_TEST_FILES=bad-15.rdf bad-16.rdf bad-17.rdf + +RDF_WARN_TEST_FILES=warn-00.rdf warn-02.rdf warn-04.rdf \ +warn-05.rdf warn-06.rdf warn-07.rdf \ +$(RDF_BAGID_TEST_FILES) + +RDF_ASSUME_TEST_FILES=ex-19.rdf + +RDF_SCAN_TEST_FILES=ex-52.svg + +RDF_OUT_FILES=ex-00.out ex-01.out ex-02.out ex-03.out ex-04.out ex-05.out \ +ex-06.out ex-07.out ex-08.out ex-09.out ex-10.out ex-11.out ex-12.out \ +ex-13.out ex-14.out ex-15.out ex-16.out ex-17.out ex-18.out \ +ex-20.out ex-21.out ex-22.out ex-23.out ex-24.out ex-25.out ex-26.out \ +ex-27.out ex-28.out ex-29.out ex-30.out ex-31.out ex-32.out ex-33.out \ +ex-34.out ex-35.out ex-36.out ex-37.out ex-38.out ex-39.out ex-40.out \ +ex-41.out ex-42.out ex-43.out ex-44.out ex-45.out ex-46.out ex-47.out \ +ex-48.out ex-49.out ex-51.out ex-53.out ex-54.out ex-55.out ex-56.out \ +ex-57.out ex-58.out ex-61.out ex-61.out ex-62.out ex-63.out \ +bug-650.out \ +22-rdf-syntax-ns.out rdfs-namespace.out rdf-schema.out \ +owl-schema.out daml-oil.out wine.out + +RDF_HACK_OUT_FILES=ex-38-rdfxmla.out + +RDF_MAYFAIL_XML_OUT_FILES=ex-55.rdf + +RDF_WARN_OUT_FILES=warn-00.out warn-02.out warn-04.out \ +warn-05.out warn-06.out warn-07.out + +RDF_ASSUME_OUT_FILES=ex-19.out + +RDF_SCAN_OUT_FILES=ex-52.out + +RDF_SERIALIZE_TEST_FILES=ex-59.nt ex-60.nt +RDF_SERIALIZE_OUT_FILES=ex-59.rdf ex-60.rdf + + +# Used to make N-triples output consistent +BASE_URI=http://librdf.org/raptor/tests/ +# for 22-rdf-syntax-ns.rdf +RDF_NS_URI=http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.rdf (2002-04-30) and rdf-schema.rdf (2000-03-27) +RDFS_NS_URI=http://www.w3.org/2000/01/rdf-schema + +OWL_DOC_URI="http://www.w3.org/2002/07/owl" + +DAML_OIL_DOC_URI="http://www.daml.org/2001/03/daml+oil" + +OWL_WINE_URI="http://www.w3.org/TR/owl-guide/wine.rdf" + +EXTRA_DIST = \ + CMakeLists.txt \ + $(RDF_TEST_FILES) \ + $(RDF_MAYFAIL_XML_TEST_FILES) \ + $(RDF_ASSUME_TEST_FILES) \ + $(RDF_SCAN_TEST_FILES) \ + $(RDF_BAD_TEST_FILES) \ + $(RDF_BAD_NFC_TEST_FILES) \ + $(RDF_WARN_TEST_FILES) \ + $(RDF_OUT_FILES) \ + $(RDF_MAYFAIL_XML_OUT_FILES) \ + $(RDF_ASSUME_OUT_FILES) \ + $(RDF_SCAN_OUT_FILES) \ + $(RDF_WARN_OUT_FILES) \ + $(RDF_SERIALIZE_TEST_FILES) \ + $(RDF_SERIALIZE_OUT_FILES) \ + $(RDF_HACK_OUT_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +CLEANFILES = CMakeTests.txt CMakeTmp.txt + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: build-rapper \ +check-rdf check-mayfail-xml-rdf check-assume-rdf check-scan-rdf \ +check-bad-rdf check-bad-nfc-rdf check-warn-rdf \ +check-rdfdiff check-rdfxml check-rdfxmla + +## Some non-GNU Make programs modify variables that appear in a target's +## dependencies by prepending VPATH to filenames. We don't want this, so +## we only specify the dependencies in maintainer mode, when GNU Make is +## likely being used. +## +if MAINTAINER_MODE +check_rdf_deps = $(RDF_TEST_FILES) +endif + +check-rdf: build-rapper $(check_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing legal rdf/xml"; \ + for test in $(RDF_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + if test $$name = 22-rdf-syntax-ns; then \ + baseuri=$(RDF_NS_URI); \ + elif test $$name = rdfs-namespace -o $$name = rdf-schema; then \ + baseuri=$(RDFS_NS_URI); \ + elif test $$name = owl-schema; then \ + baseuri=$(OWL_DOC_URI); \ + elif test $$name = daml-oil; then \ + baseuri=$(DAML_OIL_DOC_URI); \ + elif test $$name = wine; then \ + baseuri=$(OWL_WINE_URI); \ + else \ + baseuri=$(BASE_URI)$$name.rdf; \ + fi; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; result=1; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_assume_rdf_deps = $(RDF_ASSUME_TEST_FILES) +endif + +check-assume-rdf: build-rapper $(check_assume_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdf/xml known by context"; \ + for test in $(RDF_ASSUME_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2>/dev/null; \ + if cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_scan_rdf_deps = $(RDF_SCAN_TEST_FILES) +endif + +check-scan-rdf: build-rapper $(check_scan_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdf/xml inside other XML"; \ + for test in $(RDF_SCAN_TEST_FILES); do \ + name=`echo $$test | sed -e 's/\..*//'` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -f scanForRDF -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2>/dev/null; \ + if cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -f scanForRDF -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_mayfail_xml_rdf_deps = $(RDF_MAYFAIL_XML_TEST_FILES) +endif + +check-mayfail-xml-rdf: build-rapper $(check_mayfail_xml_rdf_deps) + @set +e; \ + $(RECHO) "Testing rdf/xml (may fail due to XML parser bugs)"; \ + for test in $(RDF_MAYFAIL_XML_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; \ + fi; \ + rm -f $$name.res $$name.err; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit 0 + +if MAINTAINER_MODE +check_bad_rdf_deps = $(RDF_BAD_TEST_FILES) +endif + +check-bad-rdf: build-rapper $(check_bad_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing that bad rdf/xml fails"; \ + for test in $(RDF_BAD_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; \ + cat $$name.res; grep Warning $$name.err; result=1; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; \ + cat $$name.res; result=1; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'ADD_TEST(%s %s) # WILL_FAIL\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" >>CMakeTests.txt; \ + printf '\t%s\n' rdfxml.$$name >>CMakeTmp.txt; \ + done; \ + (printf '\nSET_TESTS_PROPERTIES(\n'; \ + cat CMakeTmp.txt; \ + printf '\tPROPERTIES\n\tWILL_FAIL TRUE\n)\n\n') >>CMakeTests.txt; \ + rm -f CMakeTmp.txt; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_bad_nfc_rdf_deps = $(RDF_BAD_NFC_TEST_FILES) +endif + +check-bad-nfc-rdf: build-rapper $(check_bad_nfc_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing that rdf/xml with bad Unicode NFC fails"; \ + for test in $(RDF_BAD_NFC_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -m strict -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; \ + cat $$name.res; grep Warning $$name.err; result=1; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed (NFC test)"; \ + cat $$name.res; result=0; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'ADD_TEST(%s %s) # WILL_FAIL\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -m strict -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" >>CMakeTests.txt; \ + printf '\t%s\n' rdfxml.$$name >>CMakeTmp.txt; \ + done; \ + (printf '\nSET_TESTS_PROPERTIES(\n'; \ + cat CMakeTmp.txt; \ + printf '\tPROPERTIES\n\tWILL_FAIL TRUE\n)\n\n') >>CMakeTests.txt; \ + rm -f CMakeTmp.txt; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_warn_rdf_deps = $(RDF_WARN_TEST_FILES) +endif + +check-warn-rdf: build-rapper $(check_warn_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdf/xml with warnings"; \ + for test in $(RDF_WARN_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "FAILED - parsing failed when should have warned"; \ + cat $$name.res; grep Error $$name.err; result=1; \ + elif test $$status -eq 2 ; then \ + if cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_rdfdiff_deps = $(RDF_TEST_FILES) +endif + +check-rdfdiff: build-rdfdiff $(check_rdfdiff_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdfdiff with legal rdf/xml"; \ + for test in $(RDF_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RDFDIFF) $(srcdir)/$$test $(srcdir)/$$test > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + cat $$name.err; result=1; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_rdfxml_deps = $(RDF_SERIALIZE_TEST_FILES) +endif + +check-rdfxml: build-rapper $(check_rdfxml_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdfxml serialization with legal rdf/xml"; \ + for test in $(RDF_SERIALIZE_TEST_FILES); do \ + name=`basename $$test .nt` ; \ + baseuri=-; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o rdfxml $(srcdir)/$$test $$baseuri > $$name-rdfxml.rdf 2> $$name.err; \ + if cmp $(srcdir)/$$name.rdf $$name-rdfxml.rdf >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.rdf $$name-rdfxml.rdf; result=1; \ + fi; \ + rm -f $$name-rdfxml.rdf $$name.res $$name.err; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -i ntriples -o rdfxml \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name-rdfxml.rdf \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.rdf" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_rdfxmla_deps = $(RDF_TEST_FILES) +endif + +check-rdfxmla: build-rdfdiff build-rapper $(check_rdfxmla_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdfxml-abbrev serialization with legal rdf/xml"; \ + for test in $(RDF_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=-; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o rdfxml-abbrev $(srcdir)/$$test $$baseuri > $$name-rdfxmla.rdf 2> $$name.err; \ + status1=$$?; \ + if test $$test = ex-38.rdf; then \ + diff $(srcdir)/ex-38-rdfxmla.out $$name-rdfxmla.rdf > $$name.res 2> $$name.err; \ + status2=$$?; \ + else \ + $(RDFDIFF) $(srcdir)/$$test $$name-rdfxmla.rdf > $$name.res 2> $$name.err; \ + status2=$$?; \ + fi; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + elif test $$status1 = 2 -a $$status2 = 0; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "FAILED"; \ + echo $(RAPPER) -q -o rdfxml-abbrev $(srcdir)/$$test $$baseuri '>' $$name-rdfxmla.rdf; \ + status1=$$?; \ + echo $(RDFDIFF) $(srcdir)/$$test $$name-rdfxmla.rdf '>' $$name.res; \ + echo "rapper + rdfdiff output:"; cat $$name.err; result=1; \ + fi; \ + rm -f $$name-rdfxmla.rdf $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +print-rdf-test-files: + @echo $(RDF_TEST_FILES) | tr ' ' '\012' + diff --git a/tests/rdfxml/Makefile.in b/tests/rdfxml/Makefile.in new file mode 100644 index 0000000..e402ab2 --- /dev/null +++ b/tests/rdfxml/Makefile.in @@ -0,0 +1,914 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor RDF/XML tests +# +# Copyright (C) 2000-2008, David Beckett http://purl.org/net/dajobe/ +# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/rdfxml +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +# These are errors in strict mode, warnings in lax - for now +RDF_BAGID_TEST_FILES = ex-03.rdf ex-42.rdf ex-43.rdf ex-44.rdf ex-45.rdf +RDF_TEST_FILES = ex-00.rdf ex-01.rdf ex-02.rdf ex-04.rdf ex-05.rdf \ +ex-06.rdf ex-07.rdf ex-08.rdf ex-09.rdf ex-10.rdf ex-11.rdf ex-12.rdf \ +ex-13.rdf ex-14.rdf ex-15.rdf ex-16.rdf ex-17.rdf ex-18.rdf \ +ex-20.rdf ex-21.rdf ex-22.rdf ex-23.rdf ex-24.rdf ex-25.rdf ex-26.rdf \ +ex-27.rdf ex-28.rdf ex-29.rdf ex-30.rdf ex-31.rdf ex-32.rdf ex-33.rdf \ +ex-34.rdf ex-35.rdf ex-36.rdf ex-37.rdf ex-38.rdf ex-39.rdf ex-40.rdf \ +ex-41.rdf ex-46.rdf ex-47.rdf ex-48.rdf ex-49.rdf ex-51.rdf \ +ex-53.rdf ex-54.rdf ex-56.rdf ex-57.rdf ex-58.rdf ex-61.rdf \ +ex-62.rdf ex-63.rdf \ +bug-650.rdf \ +22-rdf-syntax-ns.rdf rdfs-namespace.rdf rdf-schema.rdf \ +owl-schema.rdf daml-oil.rdf wine.rdf + + +# ex-55 fails with libxml2 +# libxml2 bug report: http://bugs.gnome.org/show_bug.cgi?id=159219 +RDF_MAYFAIL_XML_TEST_FILES = ex-55.rdf +RDF_BAD_TEST_FILES = bad-00.rdf bad-01.rdf bad-02.rdf bad-03.rdf \ +bad-04.rdf bad-05.rdf bad-06.rdf bad-07.rdf bad-08.rdf bad-09.rdf \ +bad-10.rdf bad-11.rdf bad-12.rdf bad-13.rdf bad-14.rdf bad-18.rdf \ +bad-19.rdf bad-20.rdf bad-21.rdf bad-22.rdf bad-23.rdf + +RDF_BAD_NFC_TEST_FILES = bad-15.rdf bad-16.rdf bad-17.rdf +RDF_WARN_TEST_FILES = warn-00.rdf warn-02.rdf warn-04.rdf \ +warn-05.rdf warn-06.rdf warn-07.rdf \ +$(RDF_BAGID_TEST_FILES) + +RDF_ASSUME_TEST_FILES = ex-19.rdf +RDF_SCAN_TEST_FILES = ex-52.svg +RDF_OUT_FILES = ex-00.out ex-01.out ex-02.out ex-03.out ex-04.out ex-05.out \ +ex-06.out ex-07.out ex-08.out ex-09.out ex-10.out ex-11.out ex-12.out \ +ex-13.out ex-14.out ex-15.out ex-16.out ex-17.out ex-18.out \ +ex-20.out ex-21.out ex-22.out ex-23.out ex-24.out ex-25.out ex-26.out \ +ex-27.out ex-28.out ex-29.out ex-30.out ex-31.out ex-32.out ex-33.out \ +ex-34.out ex-35.out ex-36.out ex-37.out ex-38.out ex-39.out ex-40.out \ +ex-41.out ex-42.out ex-43.out ex-44.out ex-45.out ex-46.out ex-47.out \ +ex-48.out ex-49.out ex-51.out ex-53.out ex-54.out ex-55.out ex-56.out \ +ex-57.out ex-58.out ex-61.out ex-61.out ex-62.out ex-63.out \ +bug-650.out \ +22-rdf-syntax-ns.out rdfs-namespace.out rdf-schema.out \ +owl-schema.out daml-oil.out wine.out + +RDF_HACK_OUT_FILES = ex-38-rdfxmla.out +RDF_MAYFAIL_XML_OUT_FILES = ex-55.rdf +RDF_WARN_OUT_FILES = warn-00.out warn-02.out warn-04.out \ +warn-05.out warn-06.out warn-07.out + +RDF_ASSUME_OUT_FILES = ex-19.out +RDF_SCAN_OUT_FILES = ex-52.out +RDF_SERIALIZE_TEST_FILES = ex-59.nt ex-60.nt +RDF_SERIALIZE_OUT_FILES = ex-59.rdf ex-60.rdf + +# Used to make N-triples output consistent +BASE_URI = http://librdf.org/raptor/tests/ +# for 22-rdf-syntax-ns.rdf +RDF_NS_URI = http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.rdf (2002-04-30) and rdf-schema.rdf (2000-03-27) +RDFS_NS_URI = http://www.w3.org/2000/01/rdf-schema +OWL_DOC_URI = "http://www.w3.org/2002/07/owl" +DAML_OIL_DOC_URI = "http://www.daml.org/2001/03/daml+oil" +OWL_WINE_URI = "http://www.w3.org/TR/owl-guide/wine.rdf" +EXTRA_DIST = \ + CMakeLists.txt \ + $(RDF_TEST_FILES) \ + $(RDF_MAYFAIL_XML_TEST_FILES) \ + $(RDF_ASSUME_TEST_FILES) \ + $(RDF_SCAN_TEST_FILES) \ + $(RDF_BAD_TEST_FILES) \ + $(RDF_BAD_NFC_TEST_FILES) \ + $(RDF_WARN_TEST_FILES) \ + $(RDF_OUT_FILES) \ + $(RDF_MAYFAIL_XML_OUT_FILES) \ + $(RDF_ASSUME_OUT_FILES) \ + $(RDF_SCAN_OUT_FILES) \ + $(RDF_WARN_OUT_FILES) \ + $(RDF_SERIALIZE_TEST_FILES) \ + $(RDF_SERIALIZE_OUT_FILES) \ + $(RDF_HACK_OUT_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff +CLEANFILES = CMakeTests.txt CMakeTmp.txt +@MAINTAINER_MODE_TRUE@check_rdf_deps = $(RDF_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_assume_rdf_deps = $(RDF_ASSUME_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_scan_rdf_deps = $(RDF_SCAN_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_mayfail_xml_rdf_deps = $(RDF_MAYFAIL_XML_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_bad_rdf_deps = $(RDF_BAD_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_bad_nfc_rdf_deps = $(RDF_BAD_NFC_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_warn_rdf_deps = $(RDF_WARN_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_rdfdiff_deps = $(RDF_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_rdfxml_deps = $(RDF_SERIALIZE_TEST_FILES) +@MAINTAINER_MODE_TRUE@check_rdfxmla_deps = $(RDF_TEST_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/rdfxml/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/rdfxml/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: build-rapper \ +check-rdf check-mayfail-xml-rdf check-assume-rdf check-scan-rdf \ +check-bad-rdf check-bad-nfc-rdf check-warn-rdf \ +check-rdfdiff check-rdfxml check-rdfxmla + +check-rdf: build-rapper $(check_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing legal rdf/xml"; \ + for test in $(RDF_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + if test $$name = 22-rdf-syntax-ns; then \ + baseuri=$(RDF_NS_URI); \ + elif test $$name = rdfs-namespace -o $$name = rdf-schema; then \ + baseuri=$(RDFS_NS_URI); \ + elif test $$name = owl-schema; then \ + baseuri=$(OWL_DOC_URI); \ + elif test $$name = daml-oil; then \ + baseuri=$(DAML_OIL_DOC_URI); \ + elif test $$name = wine; then \ + baseuri=$(OWL_WINE_URI); \ + else \ + baseuri=$(BASE_URI)$$name.rdf; \ + fi; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; result=1; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +check-assume-rdf: build-rapper $(check_assume_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdf/xml known by context"; \ + for test in $(RDF_ASSUME_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2>/dev/null; \ + if cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +check-scan-rdf: build-rapper $(check_scan_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdf/xml inside other XML"; \ + for test in $(RDF_SCAN_TEST_FILES); do \ + name=`echo $$test | sed -e 's/\..*//'` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -f scanForRDF -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2>/dev/null; \ + if cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -f scanForRDF -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +check-mayfail-xml-rdf: build-rapper $(check_mayfail_xml_rdf_deps) + @set +e; \ + $(RECHO) "Testing rdf/xml (may fail due to XML parser bugs)"; \ + for test in $(RDF_MAYFAIL_XML_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; \ + fi; \ + rm -f $$name.res $$name.err; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit 0 + +check-bad-rdf: build-rapper $(check_bad_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing that bad rdf/xml fails"; \ + for test in $(RDF_BAD_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; \ + cat $$name.res; grep Warning $$name.err; result=1; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; \ + cat $$name.res; result=1; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'ADD_TEST(%s %s) # WILL_FAIL\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" >>CMakeTests.txt; \ + printf '\t%s\n' rdfxml.$$name >>CMakeTmp.txt; \ + done; \ + (printf '\nSET_TESTS_PROPERTIES(\n'; \ + cat CMakeTmp.txt; \ + printf '\tPROPERTIES\n\tWILL_FAIL TRUE\n)\n\n') >>CMakeTests.txt; \ + rm -f CMakeTmp.txt; \ + set -e; exit $$result + +check-bad-nfc-rdf: build-rapper $(check_bad_nfc_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing that rdf/xml with bad Unicode NFC fails"; \ + for test in $(RDF_BAD_NFC_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -m strict -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; \ + cat $$name.res; grep Warning $$name.err; result=1; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed (NFC test)"; \ + cat $$name.res; result=0; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'ADD_TEST(%s %s) # WILL_FAIL\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -m strict -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" >>CMakeTests.txt; \ + printf '\t%s\n' rdfxml.$$name >>CMakeTmp.txt; \ + done; \ + (printf '\nSET_TESTS_PROPERTIES(\n'; \ + cat CMakeTmp.txt; \ + printf '\tPROPERTIES\n\tWILL_FAIL TRUE\n)\n\n') >>CMakeTests.txt; \ + rm -f CMakeTmp.txt; \ + set -e; exit $$result + +check-warn-rdf: build-rapper $(check_warn_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdf/xml with warnings"; \ + for test in $(RDF_WARN_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=$(BASE_URI)$$name.rdf; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "FAILED - parsing failed when should have warned"; \ + cat $$name.res; grep Error $$name.err; result=1; \ + elif test $$status -eq 2 ; then \ + if cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; \ + cat $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err ; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -o ntriples file:\$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +check-rdfdiff: build-rdfdiff $(check_rdfdiff_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdfdiff with legal rdf/xml"; \ + for test in $(RDF_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RDFDIFF) $(srcdir)/$$test $(srcdir)/$$test > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + cat $$name.err; result=1; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +check-rdfxml: build-rapper $(check_rdfxml_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdfxml serialization with legal rdf/xml"; \ + for test in $(RDF_SERIALIZE_TEST_FILES); do \ + name=`basename $$test .nt` ; \ + baseuri=-; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i ntriples -o rdfxml $(srcdir)/$$test $$baseuri > $$name-rdfxml.rdf 2> $$name.err; \ + if cmp $(srcdir)/$$name.rdf $$name-rdfxml.rdf >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.rdf $$name-rdfxml.rdf; result=1; \ + fi; \ + rm -f $$name-rdfxml.rdf $$name.res $$name.err; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + rdfxml.$$name \ + "\$${RAPPER} -q -i ntriples -o rdfxml \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name-rdfxml.rdf \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.rdf" >>CMakeTests.txt; \ + done; \ + set -e; exit $$result + +check-rdfxmla: build-rdfdiff build-rapper $(check_rdfxmla_deps) + @set +e; result=0; \ + $(RECHO) "Testing rdfxml-abbrev serialization with legal rdf/xml"; \ + for test in $(RDF_TEST_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=-; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o rdfxml-abbrev $(srcdir)/$$test $$baseuri > $$name-rdfxmla.rdf 2> $$name.err; \ + status1=$$?; \ + if test $$test = ex-38.rdf; then \ + diff $(srcdir)/ex-38-rdfxmla.out $$name-rdfxmla.rdf > $$name.res 2> $$name.err; \ + status2=$$?; \ + else \ + $(RDFDIFF) $(srcdir)/$$test $$name-rdfxmla.rdf > $$name.res 2> $$name.err; \ + status2=$$?; \ + fi; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + elif test $$status1 = 2 -a $$status2 = 0; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "FAILED"; \ + echo $(RAPPER) -q -o rdfxml-abbrev $(srcdir)/$$test $$baseuri '>' $$name-rdfxmla.rdf; \ + status1=$$?; \ + echo $(RDFDIFF) $(srcdir)/$$test $$name-rdfxmla.rdf '>' $$name.res; \ + echo "rapper + rdfdiff output:"; cat $$name.err; result=1; \ + fi; \ + rm -f $$name-rdfxmla.rdf $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +print-rdf-test-files: + @echo $(RDF_TEST_FILES) | tr ' ' '\012' + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/rdfxml/bad-00.rdf b/tests/rdfxml/bad-00.rdf new file mode 100644 index 0000000..bc09cd1 --- /dev/null +++ b/tests/rdfxml/bad-00.rdf @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/tests/rdfxml/bad-01.rdf b/tests/rdfxml/bad-01.rdf new file mode 100644 index 0000000..4366c8f --- /dev/null +++ b/tests/rdfxml/bad-01.rdf @@ -0,0 +1,21 @@ + + + + + + + + + + val1 + + + + val2 + + + + + + diff --git a/tests/rdfxml/bad-02.rdf b/tests/rdfxml/bad-02.rdf new file mode 100644 index 0000000..8da30c3 --- /dev/null +++ b/tests/rdfxml/bad-02.rdf @@ -0,0 +1,15 @@ + + + + + + + bar1 + + + + bar2 + + + diff --git a/tests/rdfxml/bad-03.rdf b/tests/rdfxml/bad-03.rdf new file mode 100644 index 0000000..b4a6897 --- /dev/null +++ b/tests/rdfxml/bad-03.rdf @@ -0,0 +1,15 @@ + + + + + + + bar1 + + + + bar2 + + + diff --git a/tests/rdfxml/bad-04.rdf b/tests/rdfxml/bad-04.rdf new file mode 100644 index 0000000..871c065 --- /dev/null +++ b/tests/rdfxml/bad-04.rdf @@ -0,0 +1,11 @@ + + + + + + + bar2 + + + diff --git a/tests/rdfxml/bad-05.rdf b/tests/rdfxml/bad-05.rdf new file mode 100644 index 0000000..d132302 --- /dev/null +++ b/tests/rdfxml/bad-05.rdf @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/tests/rdfxml/bad-06.rdf b/tests/rdfxml/bad-06.rdf new file mode 100644 index 0000000..b5ec6c6 --- /dev/null +++ b/tests/rdfxml/bad-06.rdf @@ -0,0 +1,12 @@ + + + + + + + val + + + diff --git a/tests/rdfxml/bad-07.rdf b/tests/rdfxml/bad-07.rdf new file mode 100644 index 0000000..469f832 --- /dev/null +++ b/tests/rdfxml/bad-07.rdf @@ -0,0 +1,13 @@ + + + + + + + val + + + diff --git a/tests/rdfxml/bad-08.rdf b/tests/rdfxml/bad-08.rdf new file mode 100644 index 0000000..6a06742 --- /dev/null +++ b/tests/rdfxml/bad-08.rdf @@ -0,0 +1,15 @@ + + + + + + + + val2 + + + + diff --git a/tests/rdfxml/bad-09.rdf b/tests/rdfxml/bad-09.rdf new file mode 100644 index 0000000..7c615ba --- /dev/null +++ b/tests/rdfxml/bad-09.rdf @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/tests/rdfxml/bad-10.rdf b/tests/rdfxml/bad-10.rdf new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfxml/bad-11.rdf b/tests/rdfxml/bad-11.rdf new file mode 100644 index 0000000..83fa042 --- /dev/null +++ b/tests/rdfxml/bad-11.rdf @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/tests/rdfxml/bad-12.rdf b/tests/rdfxml/bad-12.rdf new file mode 100644 index 0000000..94931a2 --- /dev/null +++ b/tests/rdfxml/bad-12.rdf @@ -0,0 +1,7 @@ + + + + + + diff --git a/tests/rdfxml/bad-13.rdf b/tests/rdfxml/bad-13.rdf new file mode 100644 index 0000000..1ddbd8b --- /dev/null +++ b/tests/rdfxml/bad-13.rdf @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/tests/rdfxml/bad-14.rdf b/tests/rdfxml/bad-14.rdf new file mode 100644 index 0000000..c77c7e5 --- /dev/null +++ b/tests/rdfxml/bad-14.rdf @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/tests/rdfxml/bad-15.rdf b/tests/rdfxml/bad-15.rdf new file mode 100644 index 0000000..73f9830 --- /dev/null +++ b/tests/rdfxml/bad-15.rdf @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/tests/rdfxml/bad-16.rdf b/tests/rdfxml/bad-16.rdf new file mode 100644 index 0000000..222d159 --- /dev/null +++ b/tests/rdfxml/bad-16.rdf @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/tests/rdfxml/bad-17.rdf b/tests/rdfxml/bad-17.rdf new file mode 100644 index 0000000..8f43742 --- /dev/null +++ b/tests/rdfxml/bad-17.rdf @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/tests/rdfxml/bad-18.rdf b/tests/rdfxml/bad-18.rdf new file mode 100644 index 0000000..0b56d3d --- /dev/null +++ b/tests/rdfxml/bad-18.rdf @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tests/rdfxml/bad-19.rdf b/tests/rdfxml/bad-19.rdf new file mode 100644 index 0000000..5e35247 --- /dev/null +++ b/tests/rdfxml/bad-19.rdf @@ -0,0 +1,10 @@ + + + + + + content + + + diff --git a/tests/rdfxml/bad-20.rdf b/tests/rdfxml/bad-20.rdf new file mode 100644 index 0000000..cbd4630 --- /dev/null +++ b/tests/rdfxml/bad-20.rdf @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/rdfxml/bad-21.rdf b/tests/rdfxml/bad-21.rdf new file mode 100644 index 0000000..dba0c57 --- /dev/null +++ b/tests/rdfxml/bad-21.rdf @@ -0,0 +1,10 @@ + + + + + + + foo + + diff --git a/tests/rdfxml/bad-22.rdf b/tests/rdfxml/bad-22.rdf new file mode 100644 index 0000000..d57649b --- /dev/null +++ b/tests/rdfxml/bad-22.rdf @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/tests/rdfxml/bad-23.rdf b/tests/rdfxml/bad-23.rdf new file mode 100644 index 0000000..d4beb8f --- /dev/null +++ b/tests/rdfxml/bad-23.rdf @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/tests/rdfxml/bug-650.out b/tests/rdfxml/bug-650.out new file mode 100644 index 0000000..c68161f --- /dev/null +++ b/tests/rdfxml/bug-650.out @@ -0,0 +1 @@ + "\n \n "^^ . diff --git a/tests/rdfxml/bug-650.rdf b/tests/rdfxml/bug-650.rdf new file mode 100644 index 0000000..2995e8b --- /dev/null +++ b/tests/rdfxml/bug-650.rdf @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/tests/rdfxml/daml-oil.out b/tests/rdfxml/daml-oil.out new file mode 100644 index 0000000..81a91b3 --- /dev/null +++ b/tests/rdfxml/daml-oil.out @@ -0,0 +1,214 @@ + "$Id: daml+oil.daml,v 1.7 2001/06/06 01:38:21 mdean Exp $" . + . + . + "Class" . + "\n The class of all \"object\" classes\n " . + . + . + "Datatype" . + "\n The class of all datatype classes\n " . + . + . + "Thing" . + "\n The most general (object) class in DAML.\n This is equal to the union of any class and its complement.\n " . +_:genid1 . +_:genid1 . + . +_:genid3 . +_:genid3 _:genid2 . +_:genid1 _:genid3 . +_:genid2 . +_:genid2 . +_:genid3 . + _:genid1 . + . + "Nothing" . + "the class with no things in it." . + . + . + "equivalentTo" . + "\n for equivalentTo(X, Y), read X is an equivalent term to Y.\n " . + . + "sameClassAs" . + "\n for sameClassAs(X, Y), read X is an equivalent class to Y.\n cf OIL Equivalent\n " . + . + . + . + . + . + "samePropertyAs" . + "\n for samePropertyAs(P, R), read P is an equivalent property to R.\n " . + . + . + . + "sameIndividualAs" . + "\n for sameIndividualAs(a, b), read a is the same individual as b.\n " . + . + . + . + . + "disjointWith" . + "\n for disjointWith(X, Y) read: X and Y have no members in common.\n cf OIL Disjoint\n " . + . + . + . + "differentIndividualFrom" . + "\n for differentIndividualFrom(a, b), read a is not the same individual as b.\n " . + . + . + . + "unionOf" . + "\n for unionOf(X, Y) read: X is the union of the classes in the list Y;\n i.e. if something is in any of the classes in Y, it's in X, and vice versa.\n cf OIL OR\n " . + . + . + . + "disjointUnionOf" . + "\n for disjointUnionOf(X, Y) read: X is the disjoint union of the classes in\n the list Y: (a) for any c1 and c2 in Y, disjointWith(c1, c2),\n and (b) unionOf(X, Y). i.e. if something is in any of the classes in Y, it's\n in X, and vice versa.\n cf OIL disjoint-covered\n " . + . + . + . + "intersectionOf" . + "\n for intersectionOf(X, Y) read: X is the intersection of the classes in the list Y;\n i.e. if something is in all the classes in Y, then it's in X, and vice versa.\n cf OIL AND\n " . + . + . + . + "complementOf" . + "\n for complementOf(X, Y) read: X is the complement of Y; if something is in Y,\n then it's not in X, and vice versa.\n cf OIL NOT\n " . + . + . + . + "oneOf" . + "\n for oneOf(C, L) read everything in C is one of the\n things in L;\n This lets us define classes by enumerating the members.\n cf OIL OneOf\n " . + . + . + . + "Restriction" . + "\n something is in the class R if it satisfies the attached restrictions, \n and vice versa.\n " . + . + . + "onProperty" . + "\n for onProperty(R, P), read:\n R is a restricted with respect to property P.\n " . + . + . + . + "toClass" . + "\n for onProperty(R, P) and toClass(R, X), read:\n i is in class R if and only if for all j, P(i, j) implies type(j, X).\n cf OIL ValueType\n " . + . + . + . + "hasValue" . + "\n for onProperty(R, P) and hasValue(R, V), read:\n i is in class R if and only if P(i, V).\n cf OIL HasFiller\n " . + . + . + "hasClass" . + "\n for onProperty(R, P) and hasClass(R, X), read:\n i is in class R if and only if for some j, P(i, j) and type(j, X).\n cf OIL HasValue\n " . + . + . + . + "minCardinality" . + "\n for onProperty(R, P) and minCardinality(R, n), read:\n i is in class R if and only if there are at least n distinct j with P(i, j).\n cf OIL MinCardinality\n " . + . + . + . + "maxCardinality" . + "\n for onProperty(R, P) and maxCardinality(R, n), read:\n i is in class R if and only if there are at most n distinct j with P(i, j).\n cf OIL MaxCardinality\n " . + . + . + . + "cardinality" . + "\n for onProperty(R, P) and cardinality(R, n), read:\n i is in class R if and only if there are exactly n distinct j with P(i, j).\n cf OIL Cardinality\n " . + . + . + . + "hasClassQ" . + "\n property for specifying class restriction with cardinalityQ constraints\n " . + . + . + . + "minCardinality" . + "\n for onProperty(R, P), minCardinalityQ(R, n) and hasClassQ(R, X), read:\n i is in class R if and only if there are at least n distinct j with P(i, j) \n and type(j, X).\n cf OIL MinCardinality\n " . + . + . + . + "maxCardinality" . + "\n for onProperty(R, P), maxCardinalityQ(R, n) and hasClassQ(R, X), read:\n i is in class R if and only if there are at most n distinct j with P(i, j)\n and type(j, X).\n cf OIL MaxCardinality\n " . + . + . + . + "cardinality" . + "\n for onProperty(R, P), cardinalityQ(R, n) and hasClassQ(R, X), read:\n i is in class R if and only if there are exactly n distinct j with P(i, j)\n and type(j, X).\n cf OIL Cardinality\n " . + . + . + . + "ObjectProperty" . + "\n if P is an ObjectProperty, and P(x, y), then y is an object.\n " . + . + . + "DatatypeProperty" . + "\n if P is a DatatypeProperty, and P(x, y), then y is a data value.\n " . + . + . + "inverseOf" . + "\n for inverseOf(R, S) read: R is the inverse of S; i.e.\n if R(x, y) then S(y, x) and vice versa.\n cf OIL inverseRelationOf\n " . + . + . + . + "TransitiveProperty" . + "\n if P is a TransitiveProperty, then if P(x, y) and P(y, z) then P(x, z).\n cf OIL TransitiveProperty.\n " . + . + . + "UniqueProperty" . + "\n compare with maxCardinality=1; e.g. integer successor:\n if P is a UniqueProperty, then if P(x, y) and P(x, z) then y=z.\n cf OIL FunctionalProperty.\n " . + . + . + "UnambiguousProperty" . + "\n if P is an UnambiguousProperty, then if P(x, y) and P(z, y) then x=z.\n aka injective. e.g. if firstBorne(m, Susan)\n and firstBorne(n, Susan) then m and n are the same.\n " . + . + . + . + . + "\n the empty list; this used to be called Empty.\n " . + . + . + . + . + . + . + "\n for item(L, I) read: I is an item in L; either first(L, I)\n or item(R, I) where rest(L, R).\n " . + . + . + "Ontology" . + "\n An Ontology is a document that describes\n a vocabulary of terms for communication between\n (human and) automated agents.\n " . + . + "versionInfo" . + "\n generally, a string giving information about this\n version; e.g. RCS/CVS keywords\n " . + . + "imports" . + "\n for imports(X, Y) read: X imports Y;\n i.e. X asserts the* contents of Y by reference;\n i.e. if imports(X, Y) and you believe X and Y says something,\n then you should believe it.\n Note: \"the contents\" is, in the general case,\n an il-formed definite description. Different\n interactions with a resource may expose contents\n that vary with time, data format, preferred language,\n requestor credentials, etc. So for \"the contents\",\n read \"any contents\".\n " . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/rdfxml/daml-oil.rdf b/tests/rdfxml/daml-oil.rdf new file mode 100644 index 0000000..ea2975e --- /dev/null +++ b/tests/rdfxml/daml-oil.rdf @@ -0,0 +1,492 @@ + + + + + + $Id: daml+oil.daml,v 1.7 2001/06/06 01:38:21 mdean Exp $ + + + + + + + Class + + The class of all "object" classes + + + + + + Datatype + + The class of all datatype classes + + + + + + + + Thing + + The most general (object) class in DAML. + This is equal to the union of any class and its complement. + + + + + + + + + + + Nothing + the class with no things in it. + + + + + + + equivalentTo + + for equivalentTo(X, Y), read X is an equivalent term to Y. + + + + + sameClassAs + + for sameClassAs(X, Y), read X is an equivalent class to Y. + cf OIL Equivalent + + + + + + + + + samePropertyAs + + for samePropertyAs(P, R), read P is an equivalent property to R. + + + + + + + sameIndividualAs + + for sameIndividualAs(a, b), read a is the same individual as b. + + + + + + + + disjointWith + + for disjointWith(X, Y) read: X and Y have no members in common. + cf OIL Disjoint + + + + + + + differentIndividualFrom + + for differentIndividualFrom(a, b), read a is not the same individual as b. + + + + + + + + + + + unionOf + + for unionOf(X, Y) read: X is the union of the classes in the list Y; + i.e. if something is in any of the classes in Y, it's in X, and vice versa. + cf OIL OR + + + + + + + disjointUnionOf + + for disjointUnionOf(X, Y) read: X is the disjoint union of the classes in + the list Y: (a) for any c1 and c2 in Y, disjointWith(c1, c2), + and (b) unionOf(X, Y). i.e. if something is in any of the classes in Y, it's + in X, and vice versa. + cf OIL disjoint-covered + + + + + + + intersectionOf + + for intersectionOf(X, Y) read: X is the intersection of the classes in the list Y; + i.e. if something is in all the classes in Y, then it's in X, and vice versa. + cf OIL AND + + + + + + + complementOf + + for complementOf(X, Y) read: X is the complement of Y; if something is in Y, + then it's not in X, and vice versa. + cf OIL NOT + + + + + + + + + oneOf + + for oneOf(C, L) read everything in C is one of the + things in L; + This lets us define classes by enumerating the members. + cf OIL OneOf + + + + + + + + + Restriction + + something is in the class R if it satisfies the attached restrictions, + and vice versa. + + + + + + onProperty + + for onProperty(R, P), read: + R is a restricted with respect to property P. + + + + + + + toClass + + for onProperty(R, P) and toClass(R, X), read: + i is in class R if and only if for all j, P(i, j) implies type(j, X). + cf OIL ValueType + + + + + + + hasValue + + for onProperty(R, P) and hasValue(R, V), read: + i is in class R if and only if P(i, V). + cf OIL HasFiller + + + + + + hasClass + + for onProperty(R, P) and hasClass(R, X), read: + i is in class R if and only if for some j, P(i, j) and type(j, X). + cf OIL HasValue + + + + + + + + + + minCardinality + + for onProperty(R, P) and minCardinality(R, n), read: + i is in class R if and only if there are at least n distinct j with P(i, j). + cf OIL MinCardinality + + + + + + + maxCardinality + + for onProperty(R, P) and maxCardinality(R, n), read: + i is in class R if and only if there are at most n distinct j with P(i, j). + cf OIL MaxCardinality + + + + + + + cardinality + + for onProperty(R, P) and cardinality(R, n), read: + i is in class R if and only if there are exactly n distinct j with P(i, j). + cf OIL Cardinality + + + + + + + hasClassQ + + property for specifying class restriction with cardinalityQ constraints + + + + + + + minCardinality + + for onProperty(R, P), minCardinalityQ(R, n) and hasClassQ(R, X), read: + i is in class R if and only if there are at least n distinct j with P(i, j) + and type(j, X). + cf OIL MinCardinality + + + + + + + maxCardinality + + for onProperty(R, P), maxCardinalityQ(R, n) and hasClassQ(R, X), read: + i is in class R if and only if there are at most n distinct j with P(i, j) + and type(j, X). + cf OIL MaxCardinality + + + + + + + cardinality + + for onProperty(R, P), cardinalityQ(R, n) and hasClassQ(R, X), read: + i is in class R if and only if there are exactly n distinct j with P(i, j) + and type(j, X). + cf OIL Cardinality + + + + + + + + + ObjectProperty + + if P is an ObjectProperty, and P(x, y), then y is an object. + + + + + + DatatypeProperty + + if P is a DatatypeProperty, and P(x, y), then y is a data value. + + + + + + inverseOf + + for inverseOf(R, S) read: R is the inverse of S; i.e. + if R(x, y) then S(y, x) and vice versa. + cf OIL inverseRelationOf + + + + + + + TransitiveProperty + + if P is a TransitiveProperty, then if P(x, y) and P(y, z) then P(x, z). + cf OIL TransitiveProperty. + + + + + + UniqueProperty + + compare with maxCardinality=1; e.g. integer successor: + if P is a UniqueProperty, then if P(x, y) and P(x, z) then y=z. + cf OIL FunctionalProperty. + + + + + + UnambiguousProperty + + if P is an UnambiguousProperty, then if P(x, y) and P(z, y) then x=z. + aka injective. e.g. if firstBorne(m, Susan) + and firstBorne(n, Susan) then m and n are the same. + + + + + + + + + + + + + the empty list; this used to be called Empty. + + + + + + + + + + + + + + + for item(L, I) read: I is an item in L; either first(L, I) + or item(R, I) where rest(L, R). + + + + + + + + Ontology + + An Ontology is a document that describes + a vocabulary of terms for communication between + (human and) automated agents. + + + + + versionInfo + + generally, a string giving information about this + version; e.g. RCS/CVS keywords + + + + + + + imports + + for imports(X, Y) read: X imports Y; + i.e. X asserts the* contents of Y by reference; + i.e. if imports(X, Y) and you believe X and Y says something, + then you should believe it. + Note: "the contents" is, in the general case, + an il-formed definite description. Different + interactions with a resource may expose contents + that vary with time, data format, preferred language, + requestor credentials, etc. So for "the contents", + read "any contents". + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-00.out b/tests/rdfxml/ex-00.out new file mode 100644 index 0000000..fb7e191 --- /dev/null +++ b/tests/rdfxml/ex-00.out @@ -0,0 +1 @@ +_:genid1 . diff --git a/tests/rdfxml/ex-00.rdf b/tests/rdfxml/ex-00.rdf new file mode 100644 index 0000000..e4d09e7 --- /dev/null +++ b/tests/rdfxml/ex-00.rdf @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/rdfxml/ex-01.out b/tests/rdfxml/ex-01.out new file mode 100644 index 0000000..81b68a9 --- /dev/null +++ b/tests/rdfxml/ex-01.out @@ -0,0 +1,2 @@ +_:genid1 . +_:genid2 . diff --git a/tests/rdfxml/ex-01.rdf b/tests/rdfxml/ex-01.rdf new file mode 100644 index 0000000..b97a61f --- /dev/null +++ b/tests/rdfxml/ex-01.rdf @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/rdfxml/ex-02.out b/tests/rdfxml/ex-02.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfxml/ex-02.rdf b/tests/rdfxml/ex-02.rdf new file mode 100644 index 0000000..c07fffe --- /dev/null +++ b/tests/rdfxml/ex-02.rdf @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/tests/rdfxml/ex-03.out b/tests/rdfxml/ex-03.out new file mode 100644 index 0000000..0cb6496 --- /dev/null +++ b/tests/rdfxml/ex-03.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfxml/ex-03.rdf b/tests/rdfxml/ex-03.rdf new file mode 100644 index 0000000..ca4fe74 --- /dev/null +++ b/tests/rdfxml/ex-03.rdf @@ -0,0 +1,11 @@ + + + + + + + + diff --git a/tests/rdfxml/ex-04.out b/tests/rdfxml/ex-04.out new file mode 100644 index 0000000..aa89fee --- /dev/null +++ b/tests/rdfxml/ex-04.out @@ -0,0 +1,3 @@ +_:genid1 . +_:genid1 "a" . +_:genid1 "b" . diff --git a/tests/rdfxml/ex-04.rdf b/tests/rdfxml/ex-04.rdf new file mode 100644 index 0000000..a91a3e9 --- /dev/null +++ b/tests/rdfxml/ex-04.rdf @@ -0,0 +1,5 @@ + + + + + diff --git a/tests/rdfxml/ex-05.out b/tests/rdfxml/ex-05.out new file mode 100644 index 0000000..3c96542 --- /dev/null +++ b/tests/rdfxml/ex-05.out @@ -0,0 +1,4 @@ +_:genid1 . +_:genid1 "a" . +_:genid1 "b" . +_:genid1 "foo" . diff --git a/tests/rdfxml/ex-05.rdf b/tests/rdfxml/ex-05.rdf new file mode 100644 index 0000000..541546a --- /dev/null +++ b/tests/rdfxml/ex-05.rdf @@ -0,0 +1,6 @@ + + + + + diff --git a/tests/rdfxml/ex-06.out b/tests/rdfxml/ex-06.out new file mode 100644 index 0000000..e2a78bd --- /dev/null +++ b/tests/rdfxml/ex-06.out @@ -0,0 +1,5 @@ +_:genid1 . +_:genid1 . +_:genid1 . +_:genid1 . + _:genid1 . diff --git a/tests/rdfxml/ex-06.rdf b/tests/rdfxml/ex-06.rdf new file mode 100644 index 0000000..65d449b --- /dev/null +++ b/tests/rdfxml/ex-06.rdf @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-07.out b/tests/rdfxml/ex-07.out new file mode 100644 index 0000000..ca7d498 --- /dev/null +++ b/tests/rdfxml/ex-07.out @@ -0,0 +1,3 @@ +_:genid1 . +_:genid1 "some literal text"^^ . + _:genid1 . diff --git a/tests/rdfxml/ex-07.rdf b/tests/rdfxml/ex-07.rdf new file mode 100644 index 0000000..a242967 --- /dev/null +++ b/tests/rdfxml/ex-07.rdf @@ -0,0 +1,11 @@ + + + + + + + some literal text + + + + diff --git a/tests/rdfxml/ex-08.out b/tests/rdfxml/ex-08.out new file mode 100644 index 0000000..1e79906 --- /dev/null +++ b/tests/rdfxml/ex-08.out @@ -0,0 +1,6 @@ + "err" . + "hmm" . + "umm" . + "apple" . + "banana" . + "pear" . diff --git a/tests/rdfxml/ex-08.rdf b/tests/rdfxml/ex-08.rdf new file mode 100644 index 0000000..8e34873 --- /dev/null +++ b/tests/rdfxml/ex-08.rdf @@ -0,0 +1,7 @@ + + + + + + diff --git a/tests/rdfxml/ex-09.out b/tests/rdfxml/ex-09.out new file mode 100644 index 0000000..5ce3198 --- /dev/null +++ b/tests/rdfxml/ex-09.out @@ -0,0 +1,3 @@ + . + "content" . + "blah" . diff --git a/tests/rdfxml/ex-09.rdf b/tests/rdfxml/ex-09.rdf new file mode 100644 index 0000000..5761f5c --- /dev/null +++ b/tests/rdfxml/ex-09.rdf @@ -0,0 +1,8 @@ + + + + + content + blah + + diff --git a/tests/rdfxml/ex-10.out b/tests/rdfxml/ex-10.out new file mode 100644 index 0000000..b273117 --- /dev/null +++ b/tests/rdfxml/ex-10.out @@ -0,0 +1,6 @@ + . +_:genid1 . +_:genid1 . +_:genid1 . +_:genid1 . + _:genid1 . diff --git a/tests/rdfxml/ex-10.rdf b/tests/rdfxml/ex-10.rdf new file mode 100644 index 0000000..2eca6a2 --- /dev/null +++ b/tests/rdfxml/ex-10.rdf @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-11.out b/tests/rdfxml/ex-11.out new file mode 100644 index 0000000..59f9f29 --- /dev/null +++ b/tests/rdfxml/ex-11.out @@ -0,0 +1 @@ + "\n some markup\n blah\n "^^ . diff --git a/tests/rdfxml/ex-11.rdf b/tests/rdfxml/ex-11.rdf new file mode 100644 index 0000000..db728aa --- /dev/null +++ b/tests/rdfxml/ex-11.rdf @@ -0,0 +1,13 @@ + + + + + + some markup + blah + + + + diff --git a/tests/rdfxml/ex-12.out b/tests/rdfxml/ex-12.out new file mode 100644 index 0000000..2b672da --- /dev/null +++ b/tests/rdfxml/ex-12.out @@ -0,0 +1,10 @@ +_:genid1 . +_:genid1 . +_:genid2 . +_:genid2 . +_:genid1 _:genid2 . +_:genid3 . +_:genid3 . +_:genid2 _:genid3 . +_:genid3 . + _:genid1 . diff --git a/tests/rdfxml/ex-12.rdf b/tests/rdfxml/ex-12.rdf new file mode 100644 index 0000000..97328cc --- /dev/null +++ b/tests/rdfxml/ex-12.rdf @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-13.out b/tests/rdfxml/ex-13.out new file mode 100644 index 0000000..7b6b5da --- /dev/null +++ b/tests/rdfxml/ex-13.out @@ -0,0 +1,3 @@ +_:genid2 "jd8734djr08347jyd4" . +_:genid1 _:genid2 . + _:genid1 . diff --git a/tests/rdfxml/ex-13.rdf b/tests/rdfxml/ex-13.rdf new file mode 100644 index 0000000..0791762 --- /dev/null +++ b/tests/rdfxml/ex-13.rdf @@ -0,0 +1,16 @@ + + + + + + + + + + jd8734djr08347jyd4 + + + + diff --git a/tests/rdfxml/ex-14.out b/tests/rdfxml/ex-14.out new file mode 100644 index 0000000..5b19c55 --- /dev/null +++ b/tests/rdfxml/ex-14.out @@ -0,0 +1,4 @@ + . + "John Doe" . + "New York" . + "19010101" . diff --git a/tests/rdfxml/ex-14.rdf b/tests/rdfxml/ex-14.rdf new file mode 100644 index 0000000..378c4cd --- /dev/null +++ b/tests/rdfxml/ex-14.rdf @@ -0,0 +1,18 @@ + + + + + + + + + + + + John Doe + New York + 19010101 + + diff --git a/tests/rdfxml/ex-15.out b/tests/rdfxml/ex-15.out new file mode 100644 index 0000000..e7bb594 --- /dev/null +++ b/tests/rdfxml/ex-15.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfxml/ex-15.rdf b/tests/rdfxml/ex-15.rdf new file mode 100644 index 0000000..0923427 --- /dev/null +++ b/tests/rdfxml/ex-15.rdf @@ -0,0 +1,6 @@ + + + + + diff --git a/tests/rdfxml/ex-16.out b/tests/rdfxml/ex-16.out new file mode 100644 index 0000000..0b42c8a --- /dev/null +++ b/tests/rdfxml/ex-16.out @@ -0,0 +1 @@ + "the content" . diff --git a/tests/rdfxml/ex-16.rdf b/tests/rdfxml/ex-16.rdf new file mode 100644 index 0000000..4300fdb --- /dev/null +++ b/tests/rdfxml/ex-16.rdf @@ -0,0 +1,6 @@ + + + + + diff --git a/tests/rdfxml/ex-17.out b/tests/rdfxml/ex-17.out new file mode 100644 index 0000000..b3d961f --- /dev/null +++ b/tests/rdfxml/ex-17.out @@ -0,0 +1 @@ + "" . diff --git a/tests/rdfxml/ex-17.rdf b/tests/rdfxml/ex-17.rdf new file mode 100644 index 0000000..6c43ca7 --- /dev/null +++ b/tests/rdfxml/ex-17.rdf @@ -0,0 +1,8 @@ + + + + + + + diff --git a/tests/rdfxml/ex-18.out b/tests/rdfxml/ex-18.out new file mode 100644 index 0000000..8249861 --- /dev/null +++ b/tests/rdfxml/ex-18.out @@ -0,0 +1 @@ + "Example" . diff --git a/tests/rdfxml/ex-18.rdf b/tests/rdfxml/ex-18.rdf new file mode 100644 index 0000000..1723d38 --- /dev/null +++ b/tests/rdfxml/ex-18.rdf @@ -0,0 +1,7 @@ + + + + Example + diff --git a/tests/rdfxml/ex-19.out b/tests/rdfxml/ex-19.out new file mode 100644 index 0000000..81da8a0 --- /dev/null +++ b/tests/rdfxml/ex-19.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfxml/ex-19.rdf b/tests/rdfxml/ex-19.rdf new file mode 100644 index 0000000..83efc23 --- /dev/null +++ b/tests/rdfxml/ex-19.rdf @@ -0,0 +1,4 @@ + + diff --git a/tests/rdfxml/ex-20.out b/tests/rdfxml/ex-20.out new file mode 100644 index 0000000..c19cb9a --- /dev/null +++ b/tests/rdfxml/ex-20.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfxml/ex-20.rdf b/tests/rdfxml/ex-20.rdf new file mode 100644 index 0000000..15ad7ff --- /dev/null +++ b/tests/rdfxml/ex-20.rdf @@ -0,0 +1,8 @@ + + + + + + + diff --git a/tests/rdfxml/ex-21.out b/tests/rdfxml/ex-21.out new file mode 100644 index 0000000..01ecf19 --- /dev/null +++ b/tests/rdfxml/ex-21.out @@ -0,0 +1,7 @@ + "val1" . + "val2" . + . + "val1" . +_:genid1 . +_:genid1 "http://example.org/thing3" . +_:genid1 "val1" . diff --git a/tests/rdfxml/ex-21.rdf b/tests/rdfxml/ex-21.rdf new file mode 100644 index 0000000..f6b95b9 --- /dev/null +++ b/tests/rdfxml/ex-21.rdf @@ -0,0 +1,9 @@ + + + + + + + diff --git a/tests/rdfxml/ex-22.out b/tests/rdfxml/ex-22.out new file mode 100644 index 0000000..46b4e2e --- /dev/null +++ b/tests/rdfxml/ex-22.out @@ -0,0 +1,4 @@ +_:genid1 . + . + "value" . +_:genid1 . diff --git a/tests/rdfxml/ex-22.rdf b/tests/rdfxml/ex-22.rdf new file mode 100644 index 0000000..038d8e7 --- /dev/null +++ b/tests/rdfxml/ex-22.rdf @@ -0,0 +1,10 @@ + + + + + + value + + + diff --git a/tests/rdfxml/ex-23.out b/tests/rdfxml/ex-23.out new file mode 100644 index 0000000..009032f --- /dev/null +++ b/tests/rdfxml/ex-23.out @@ -0,0 +1,8 @@ +_:genid1 . +_:genid3 . +_:genid2 _:genid3 . +_:genid4 . +_:genid2 _:genid4 . +_:genid5 . +_:genid2 _:genid5 . +_:genid1 _:genid2 . diff --git a/tests/rdfxml/ex-23.rdf b/tests/rdfxml/ex-23.rdf new file mode 100644 index 0000000..72a5dc2 --- /dev/null +++ b/tests/rdfxml/ex-23.rdf @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-24.out b/tests/rdfxml/ex-24.out new file mode 100644 index 0000000..e328430 --- /dev/null +++ b/tests/rdfxml/ex-24.out @@ -0,0 +1,6 @@ +_:genid2 . +_:genid2 _:genid1 . +_:genid1 . +_:genid1 . +_:genid2 . + _:genid2 . diff --git a/tests/rdfxml/ex-24.rdf b/tests/rdfxml/ex-24.rdf new file mode 100644 index 0000000..c22b0be --- /dev/null +++ b/tests/rdfxml/ex-24.rdf @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-25.out b/tests/rdfxml/ex-25.out new file mode 100644 index 0000000..35f572b --- /dev/null +++ b/tests/rdfxml/ex-25.out @@ -0,0 +1,4 @@ + "1" . + "_1" . + "2" . + "_3" . diff --git a/tests/rdfxml/ex-25.rdf b/tests/rdfxml/ex-25.rdf new file mode 100644 index 0000000..d6b2ae5 --- /dev/null +++ b/tests/rdfxml/ex-25.rdf @@ -0,0 +1,14 @@ + + + + + + + 1 + _1 + 2 + _3 + + + diff --git a/tests/rdfxml/ex-26.out b/tests/rdfxml/ex-26.out new file mode 100644 index 0000000..feb6a7f --- /dev/null +++ b/tests/rdfxml/ex-26.out @@ -0,0 +1,2 @@ + . + "content" . diff --git a/tests/rdfxml/ex-26.rdf b/tests/rdfxml/ex-26.rdf new file mode 100644 index 0000000..46ab6da --- /dev/null +++ b/tests/rdfxml/ex-26.rdf @@ -0,0 +1,12 @@ + + + +]> + + + + content + + diff --git a/tests/rdfxml/ex-27.out b/tests/rdfxml/ex-27.out new file mode 100644 index 0000000..6da8a15 --- /dev/null +++ b/tests/rdfxml/ex-27.out @@ -0,0 +1,6 @@ +_:genid1 "prop1name" . + _:genid1 . +_:genid2 "prop2name" . + _:genid2 . +_:genid3 "prop3name" . + _:genid3 . diff --git a/tests/rdfxml/ex-27.rdf b/tests/rdfxml/ex-27.rdf new file mode 100644 index 0000000..fadc284 --- /dev/null +++ b/tests/rdfxml/ex-27.rdf @@ -0,0 +1,20 @@ + + + + + + prop1name + + + + prop2name + + + + prop3name + + + + + diff --git a/tests/rdfxml/ex-28.out b/tests/rdfxml/ex-28.out new file mode 100644 index 0000000..f0b7a60 --- /dev/null +++ b/tests/rdfxml/ex-28.out @@ -0,0 +1,3 @@ +_:genid1 "foo" . + _:genid1 . + "literal" . diff --git a/tests/rdfxml/ex-28.rdf b/tests/rdfxml/ex-28.rdf new file mode 100644 index 0000000..cafe0bd --- /dev/null +++ b/tests/rdfxml/ex-28.rdf @@ -0,0 +1,14 @@ + + + + + + foo + + + literal + + + + diff --git a/tests/rdfxml/ex-29.out b/tests/rdfxml/ex-29.out new file mode 100644 index 0000000..0fac532 --- /dev/null +++ b/tests/rdfxml/ex-29.out @@ -0,0 +1,3 @@ + "chat"@en . + "chat"@fr . + "chat" . diff --git a/tests/rdfxml/ex-29.rdf b/tests/rdfxml/ex-29.rdf new file mode 100644 index 0000000..1f94787 --- /dev/null +++ b/tests/rdfxml/ex-29.rdf @@ -0,0 +1,14 @@ + + + + + + + chat + chat + chat + + + + diff --git a/tests/rdfxml/ex-30.out b/tests/rdfxml/ex-30.out new file mode 100644 index 0000000..7d6af55 --- /dev/null +++ b/tests/rdfxml/ex-30.out @@ -0,0 +1 @@ + "blah" . diff --git a/tests/rdfxml/ex-30.rdf b/tests/rdfxml/ex-30.rdf new file mode 100644 index 0000000..4f4ef77 --- /dev/null +++ b/tests/rdfxml/ex-30.rdf @@ -0,0 +1,11 @@ + + + + + blah + + diff --git a/tests/rdfxml/ex-31.out b/tests/rdfxml/ex-31.out new file mode 100644 index 0000000..bc9f58e --- /dev/null +++ b/tests/rdfxml/ex-31.out @@ -0,0 +1,5 @@ +_:genid1 "foo" . +_:genid1 "blah" . + _:genid1 . + "2" . + "_3" . diff --git a/tests/rdfxml/ex-31.rdf b/tests/rdfxml/ex-31.rdf new file mode 100644 index 0000000..45833dd --- /dev/null +++ b/tests/rdfxml/ex-31.rdf @@ -0,0 +1,16 @@ + + + + + + + + foo + blah + + 2 + _3 + + + diff --git a/tests/rdfxml/ex-32.out b/tests/rdfxml/ex-32.out new file mode 100644 index 0000000..c95d607 --- /dev/null +++ b/tests/rdfxml/ex-32.out @@ -0,0 +1,2 @@ + "literal" . + . diff --git a/tests/rdfxml/ex-32.rdf b/tests/rdfxml/ex-32.rdf new file mode 100644 index 0000000..34ebef3 --- /dev/null +++ b/tests/rdfxml/ex-32.rdf @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/tests/rdfxml/ex-33.out b/tests/rdfxml/ex-33.out new file mode 100644 index 0000000..0165ec8 --- /dev/null +++ b/tests/rdfxml/ex-33.out @@ -0,0 +1,3 @@ +_:genid1 "literal2" . +_:genid1 "literal3" . + _:genid1 . diff --git a/tests/rdfxml/ex-33.rdf b/tests/rdfxml/ex-33.rdf new file mode 100644 index 0000000..76b04bc --- /dev/null +++ b/tests/rdfxml/ex-33.rdf @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/tests/rdfxml/ex-34.out b/tests/rdfxml/ex-34.out new file mode 100644 index 0000000..fbb9ccf --- /dev/null +++ b/tests/rdfxml/ex-34.out @@ -0,0 +1,9 @@ +_:genid2 . +_:genid2 _:genid1 . +_:genid1 . +_:genid4 . +_:genid4 _:genid3 . +_:genid2 _:genid4 . +_:genid3 . +_:genid4 . + _:genid2 . diff --git a/tests/rdfxml/ex-34.rdf b/tests/rdfxml/ex-34.rdf new file mode 100644 index 0000000..25c132f --- /dev/null +++ b/tests/rdfxml/ex-34.rdf @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-35.out b/tests/rdfxml/ex-35.out new file mode 100644 index 0000000..5541d00 --- /dev/null +++ b/tests/rdfxml/ex-35.out @@ -0,0 +1 @@ + . diff --git a/tests/rdfxml/ex-35.rdf b/tests/rdfxml/ex-35.rdf new file mode 100644 index 0000000..9cea016 --- /dev/null +++ b/tests/rdfxml/ex-35.rdf @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/tests/rdfxml/ex-36.out b/tests/rdfxml/ex-36.out new file mode 100644 index 0000000..1137dba --- /dev/null +++ b/tests/rdfxml/ex-36.out @@ -0,0 +1,4 @@ +_:genid1 . +_:genid1 . +_:genid1 . + _:genid1 . diff --git a/tests/rdfxml/ex-36.rdf b/tests/rdfxml/ex-36.rdf new file mode 100644 index 0000000..e4dcbdf --- /dev/null +++ b/tests/rdfxml/ex-36.rdf @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/tests/rdfxml/ex-37.out b/tests/rdfxml/ex-37.out new file mode 100644 index 0000000..ab1dd96 --- /dev/null +++ b/tests/rdfxml/ex-37.out @@ -0,0 +1,2 @@ +_:genid1 . + _:genid1 . diff --git a/tests/rdfxml/ex-37.rdf b/tests/rdfxml/ex-37.rdf new file mode 100644 index 0000000..f43864c --- /dev/null +++ b/tests/rdfxml/ex-37.rdf @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/tests/rdfxml/ex-38-rdfxmla.out b/tests/rdfxml/ex-38-rdfxmla.out new file mode 100644 index 0000000..662c10f --- /dev/null +++ b/tests/rdfxml/ex-38-rdfxmla.out @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-38.out b/tests/rdfxml/ex-38.out new file mode 100644 index 0000000..0f77c60 --- /dev/null +++ b/tests/rdfxml/ex-38.out @@ -0,0 +1,8 @@ +_:genid1 . +_:genid1 . +_:genid1 . + _:genid1 . + . + . + . + _:genid1 . diff --git a/tests/rdfxml/ex-38.rdf b/tests/rdfxml/ex-38.rdf new file mode 100644 index 0000000..a4f89ca --- /dev/null +++ b/tests/rdfxml/ex-38.rdf @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/tests/rdfxml/ex-39.out b/tests/rdfxml/ex-39.out new file mode 100644 index 0000000..b7277e6 --- /dev/null +++ b/tests/rdfxml/ex-39.out @@ -0,0 +1,7 @@ +_:genid2 _:genid1 . +_:genid1 . +_:genid4 _:genid3 . +_:genid2 _:genid4 . +_:genid3 . +_:genid4 . + _:genid2 . diff --git a/tests/rdfxml/ex-39.rdf b/tests/rdfxml/ex-39.rdf new file mode 100644 index 0000000..ebf858d --- /dev/null +++ b/tests/rdfxml/ex-39.rdf @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-40.out b/tests/rdfxml/ex-40.out new file mode 100644 index 0000000..3d11de9 --- /dev/null +++ b/tests/rdfxml/ex-40.out @@ -0,0 +1 @@ + "value" . diff --git a/tests/rdfxml/ex-40.rdf b/tests/rdfxml/ex-40.rdf new file mode 100644 index 0000000..1fb8f41 --- /dev/null +++ b/tests/rdfxml/ex-40.rdf @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/tests/rdfxml/ex-41.out b/tests/rdfxml/ex-41.out new file mode 100644 index 0000000..6d07f59 --- /dev/null +++ b/tests/rdfxml/ex-41.out @@ -0,0 +1,3 @@ + "val1"^^ . + "val2"^^ . + "val3"^^ . diff --git a/tests/rdfxml/ex-41.rdf b/tests/rdfxml/ex-41.rdf new file mode 100644 index 0000000..0e430ca --- /dev/null +++ b/tests/rdfxml/ex-41.rdf @@ -0,0 +1,13 @@ + + + + + + + val1 + val2 + val3 + + + diff --git a/tests/rdfxml/ex-42.out b/tests/rdfxml/ex-42.out new file mode 100644 index 0000000..6719743 --- /dev/null +++ b/tests/rdfxml/ex-42.out @@ -0,0 +1,19 @@ + . + "val1" . + . + . + . + . + "val1" . + "val2" . + . + . + . + . + "val2" . + "val3"@en . + . + . + . + . + "val3"@en . diff --git a/tests/rdfxml/ex-42.rdf b/tests/rdfxml/ex-42.rdf new file mode 100644 index 0000000..593fb18 --- /dev/null +++ b/tests/rdfxml/ex-42.rdf @@ -0,0 +1,14 @@ + + + + + + + val1 + val2 + val3 + + + diff --git a/tests/rdfxml/ex-43.out b/tests/rdfxml/ex-43.out new file mode 100644 index 0000000..c66b497 --- /dev/null +++ b/tests/rdfxml/ex-43.out @@ -0,0 +1,7 @@ + . + "val1" . + _:genid1 . +_:genid1 . +_:genid1 . +_:genid1 . +_:genid1 "val1" . diff --git a/tests/rdfxml/ex-43.rdf b/tests/rdfxml/ex-43.rdf new file mode 100644 index 0000000..49682ae --- /dev/null +++ b/tests/rdfxml/ex-43.rdf @@ -0,0 +1,12 @@ + + + + + + + val1 + + + diff --git a/tests/rdfxml/ex-44.out b/tests/rdfxml/ex-44.out new file mode 100644 index 0000000..5fc4608 --- /dev/null +++ b/tests/rdfxml/ex-44.out @@ -0,0 +1,8 @@ + . +_:genid1 "val2" . + _:genid2 . +_:genid2 . +_:genid2 _:genid1 . +_:genid2 . +_:genid2 "val2" . + _:genid1 . diff --git a/tests/rdfxml/ex-44.rdf b/tests/rdfxml/ex-44.rdf new file mode 100644 index 0000000..7715a4f --- /dev/null +++ b/tests/rdfxml/ex-44.rdf @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/tests/rdfxml/ex-45.out b/tests/rdfxml/ex-45.out new file mode 100644 index 0000000..87a6570 --- /dev/null +++ b/tests/rdfxml/ex-45.out @@ -0,0 +1,2 @@ + . + "" . diff --git a/tests/rdfxml/ex-45.rdf b/tests/rdfxml/ex-45.rdf new file mode 100644 index 0000000..b9ec8e9 --- /dev/null +++ b/tests/rdfxml/ex-45.rdf @@ -0,0 +1,12 @@ + + + + + + + + + + diff --git a/tests/rdfxml/ex-46.out b/tests/rdfxml/ex-46.out new file mode 100644 index 0000000..d0938ce --- /dev/null +++ b/tests/rdfxml/ex-46.out @@ -0,0 +1,53 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + . + "abc" . + "abc" . + "abc" . + "abc" . + _:node2 . +_:node1 . + "apples" . + "pears"^^ . + "oranges"^^ . + "10"^^ . diff --git a/tests/rdfxml/ex-46.rdf b/tests/rdfxml/ex-46.rdf new file mode 100644 index 0000000..2ee62ab --- /dev/null +++ b/tests/rdfxml/ex-46.rdf @@ -0,0 +1,91 @@ + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + apples + pears + oranges + 10 + + + diff --git a/tests/rdfxml/ex-47.out b/tests/rdfxml/ex-47.out new file mode 100644 index 0000000..b668a3c --- /dev/null +++ b/tests/rdfxml/ex-47.out @@ -0,0 +1,24 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . + "abc" . diff --git a/tests/rdfxml/ex-47.rdf b/tests/rdfxml/ex-47.rdf new file mode 100644 index 0000000..d40eae4 --- /dev/null +++ b/tests/rdfxml/ex-47.rdf @@ -0,0 +1,51 @@ + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/rdfxml/ex-48.out b/tests/rdfxml/ex-48.out new file mode 100644 index 0000000..607eea9 --- /dev/null +++ b/tests/rdfxml/ex-48.out @@ -0,0 +1,5 @@ + " & "^^ . + " < "^^ . + " > "^^ . + ">&<"^^ . + "<ex:notaprop>"^^ . diff --git a/tests/rdfxml/ex-48.rdf b/tests/rdfxml/ex-48.rdf new file mode 100644 index 0000000..88f469b --- /dev/null +++ b/tests/rdfxml/ex-48.rdf @@ -0,0 +1,16 @@ + + + + + + + & + < + > + >&< + <ex:notaprop> + + + diff --git a/tests/rdfxml/ex-49.out b/tests/rdfxml/ex-49.out new file mode 100644 index 0000000..b2cab49 --- /dev/null +++ b/tests/rdfxml/ex-49.out @@ -0,0 +1,4 @@ + " hmm "^^ . + " "^^ . + " "^^ . + " \"> "^^ . diff --git a/tests/rdfxml/ex-49.rdf b/tests/rdfxml/ex-49.rdf new file mode 100644 index 0000000..0e00ea1 --- /dev/null +++ b/tests/rdfxml/ex-49.rdf @@ -0,0 +1,14 @@ + + + + + + + hmm + + + + + + diff --git a/tests/rdfxml/ex-51.out b/tests/rdfxml/ex-51.out new file mode 100644 index 0000000..b956d32 --- /dev/null +++ b/tests/rdfxml/ex-51.out @@ -0,0 +1 @@ + ""^^ . diff --git a/tests/rdfxml/ex-51.rdf b/tests/rdfxml/ex-51.rdf new file mode 100644 index 0000000..d2c01e3 --- /dev/null +++ b/tests/rdfxml/ex-51.rdf @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/tests/rdfxml/ex-52.out b/tests/rdfxml/ex-52.out new file mode 100644 index 0000000..655acea --- /dev/null +++ b/tests/rdfxml/ex-52.out @@ -0,0 +1,2 @@ + "Simple Example" . + "2002-10-05" . diff --git a/tests/rdfxml/ex-52.svg b/tests/rdfxml/ex-52.svg new file mode 100644 index 0000000..d814889 --- /dev/null +++ b/tests/rdfxml/ex-52.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + Simple Example + 2002-10-05 + + + + + diff --git a/tests/rdfxml/ex-53.out b/tests/rdfxml/ex-53.out new file mode 100644 index 0000000..7cb4b91 --- /dev/null +++ b/tests/rdfxml/ex-53.out @@ -0,0 +1 @@ +_:genid1 . diff --git a/tests/rdfxml/ex-53.rdf b/tests/rdfxml/ex-53.rdf new file mode 100644 index 0000000..ff02ef8 --- /dev/null +++ b/tests/rdfxml/ex-53.rdf @@ -0,0 +1 @@ + diff --git a/tests/rdfxml/ex-54.out b/tests/rdfxml/ex-54.out new file mode 100644 index 0000000..36a1d29 --- /dev/null +++ b/tests/rdfxml/ex-54.out @@ -0,0 +1 @@ + "They\u2019re artistic\u2026uhm, bugs, at the very least."^^ . diff --git a/tests/rdfxml/ex-54.rdf b/tests/rdfxml/ex-54.rdf new file mode 100644 index 0000000..462e8f6 --- /dev/null +++ b/tests/rdfxml/ex-54.rdf @@ -0,0 +1,7 @@ + + + + They’re artistic…uhm, bugs, at the very least. + + \ No newline at end of file diff --git a/tests/rdfxml/ex-55.out b/tests/rdfxml/ex-55.out new file mode 100644 index 0000000..942cadf --- /dev/null +++ b/tests/rdfxml/ex-55.out @@ -0,0 +1,2 @@ + "abc" . + "def" . diff --git a/tests/rdfxml/ex-55.rdf b/tests/rdfxml/ex-55.rdf new file mode 100644 index 0000000..ac05844 --- /dev/null +++ b/tests/rdfxml/ex-55.rdf @@ -0,0 +1,11 @@ + + + +]> + + + &bar; + + diff --git a/tests/rdfxml/ex-56.out b/tests/rdfxml/ex-56.out new file mode 100644 index 0000000..72da489 --- /dev/null +++ b/tests/rdfxml/ex-56.out @@ -0,0 +1 @@ + "val"^^ . diff --git a/tests/rdfxml/ex-56.rdf b/tests/rdfxml/ex-56.rdf new file mode 100644 index 0000000..f50683b --- /dev/null +++ b/tests/rdfxml/ex-56.rdf @@ -0,0 +1,8 @@ + + + + val + + diff --git a/tests/rdfxml/ex-57.out b/tests/rdfxml/ex-57.out new file mode 100644 index 0000000..e09ddbe --- /dev/null +++ b/tests/rdfxml/ex-57.out @@ -0,0 +1 @@ + ""^^ . diff --git a/tests/rdfxml/ex-57.rdf b/tests/rdfxml/ex-57.rdf new file mode 100644 index 0000000..460dc0f --- /dev/null +++ b/tests/rdfxml/ex-57.rdf @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/tests/rdfxml/ex-58.out b/tests/rdfxml/ex-58.out new file mode 100644 index 0000000..2822163 --- /dev/null +++ b/tests/rdfxml/ex-58.out @@ -0,0 +1,3 @@ + "World Wide Web Consortium" . + . + . diff --git a/tests/rdfxml/ex-58.rdf b/tests/rdfxml/ex-58.rdf new file mode 100644 index 0000000..081f8df --- /dev/null +++ b/tests/rdfxml/ex-58.rdf @@ -0,0 +1,15 @@ + + + + + + World Wide Web Consortium + + + + diff --git a/tests/rdfxml/ex-59.nt b/tests/rdfxml/ex-59.nt new file mode 100644 index 0000000..d72d5f8 --- /dev/null +++ b/tests/rdfxml/ex-59.nt @@ -0,0 +1 @@ + "value" . diff --git a/tests/rdfxml/ex-59.rdf b/tests/rdfxml/ex-59.rdf new file mode 100644 index 0000000..8aec5f2 --- /dev/null +++ b/tests/rdfxml/ex-59.rdf @@ -0,0 +1,6 @@ + + + + value + + diff --git a/tests/rdfxml/ex-60.nt b/tests/rdfxml/ex-60.nt new file mode 100644 index 0000000..22c3d42 --- /dev/null +++ b/tests/rdfxml/ex-60.nt @@ -0,0 +1 @@ + . diff --git a/tests/rdfxml/ex-60.rdf b/tests/rdfxml/ex-60.rdf new file mode 100644 index 0000000..8d97648 --- /dev/null +++ b/tests/rdfxml/ex-60.rdf @@ -0,0 +1,6 @@ + + + + + + diff --git a/tests/rdfxml/ex-61.out b/tests/rdfxml/ex-61.out new file mode 100644 index 0000000..785d442 --- /dev/null +++ b/tests/rdfxml/ex-61.out @@ -0,0 +1 @@ + "one" . diff --git a/tests/rdfxml/ex-61.rdf b/tests/rdfxml/ex-61.rdf new file mode 100644 index 0000000..fdc1cbb --- /dev/null +++ b/tests/rdfxml/ex-61.rdf @@ -0,0 +1,4 @@ + + + + diff --git a/tests/rdfxml/ex-62.out b/tests/rdfxml/ex-62.out new file mode 100644 index 0000000..06ed8ab --- /dev/null +++ b/tests/rdfxml/ex-62.out @@ -0,0 +1,3 @@ + "Item1" . + "Item2" . + "Item3" . diff --git a/tests/rdfxml/ex-62.rdf b/tests/rdfxml/ex-62.rdf new file mode 100644 index 0000000..f23d47f --- /dev/null +++ b/tests/rdfxml/ex-62.rdf @@ -0,0 +1,24 @@ + + + +]> + + + + Item1 + + + + Item2 + + + + Item3 + + + diff --git a/tests/rdfxml/ex-63.out b/tests/rdfxml/ex-63.out new file mode 100644 index 0000000..2ec9d5b --- /dev/null +++ b/tests/rdfxml/ex-63.out @@ -0,0 +1 @@ + "\n
\n

123

\n\n
\n "^^ . diff --git a/tests/rdfxml/ex-63.rdf b/tests/rdfxml/ex-63.rdf new file mode 100644 index 0000000..13a54fa --- /dev/null +++ b/tests/rdfxml/ex-63.rdf @@ -0,0 +1,11 @@ + + + + +
+

123

+ +
+
+
+
diff --git a/tests/rdfxml/owl-schema.out b/tests/rdfxml/owl-schema.out new file mode 100644 index 0000000..0b5ddf6 --- /dev/null +++ b/tests/rdfxml/owl-schema.out @@ -0,0 +1,160 @@ + . + . + . + . + . + . + "This file specifies in RDF Schema format the\n built-in classes and properties that together form the basis of\n the RDF/XML syntax of OWL Full, OWL DL and OWL Lite.\n We do not expect people to import this file\n explicitly into their ontology. People that do import this file\n should expect their ontology to be an OWL Full ontology. \n " . + "$Id: owl.rdf,v 1.5 2003/08/19 15:07:19 connolly Exp $" . + "$Id: owl.rdf,v 1.5 2003/08/19 15:07:19 connolly Exp $" . + . + "Class" . + . + . + "Thing" . +_:genid1 . + . +_:genid3 _:genid2 . +_:genid1 _:genid3 . +_:genid2 . +_:genid2 . +_:genid3 . + _:genid1 . + . + "Nothing" . + . + . + "equivalentClass" . + . + . + . + . + "disjointWith" . + . + . + . + "equivalentProperty" . + . + . + "sameAs" . + . + . + . + "differentFrom" . + . + . + . + "AllDifferent" . + . + "distinctMembers" . + . + . + . + "unionOf" . + . + . + . + "intersectionOf" . + . + . + . + "complementOf" . + . + . + . + "oneOf" . + . + . + . + "Restriction" . + . + . + "onProperty" . + . + . + . + "allValuesFrom" . + . + . + . + "hasValue" . + . + . + "someValuesFrom" . + . + . + . + "minCardinality" . + . + . + . + "maxCardinality" . + . + . + . + "cardinality" . + . + . + . + "ObjectProperty" . + . + . + "DatatypeProperty" . + . + . + "inverseOf" . + . + . + . + "TransitiveProperty" . + . + . + "SymmetricProperty" . + . + . + "FunctionalProperty" . + . + . + "InverseFunctionalProperty" . + . + . + . + . + . + . + . + . + "Ontology" . + . + . + . + "imports" . + . + . + . + . + "versionInfo" . + . + . + "priorVersion" . + . + . + . + . + "backwardCompatibleWitesh" . + . + . + . + . + "incompatibleWith" . + . + . + . + . + "DeprecatedClass" . + . + . + "DeprecatedProperty" . + . + . + "DataRange" . diff --git a/tests/rdfxml/owl-schema.rdf b/tests/rdfxml/owl-schema.rdf new file mode 100644 index 0000000..eb19db5 --- /dev/null +++ b/tests/rdfxml/owl-schema.rdf @@ -0,0 +1,279 @@ + + + + + + + ]> + + + + + + + + + + This file specifies in RDF Schema format the + built-in classes and properties that together form the basis of + the RDF/XML syntax of OWL Full, OWL DL and OWL Lite. + We do not expect people to import this file + explicitly into their ontology. People that do import this file + should expect their ontology to be an OWL Full ontology. + + $Id: owl.rdf,v 1.5 2003/08/19 15:07:19 connolly Exp $ + $Id: owl.rdf,v 1.5 2003/08/19 15:07:19 connolly Exp $ + + + + Class + + + + + Thing + + + + + + + + + + Nothing + + + + + equivalentClass + + + + + + + disjointWith + + + + + + equivalentProperty + + + + + sameAs + + + + + + differentFrom + + + + + + AllDifferent + + + + distinctMembers + + + + + + unionOf + + + + + + intersectionOf + + + + + + complementOf + + + + + + oneOf + + + + + + Restriction + + + + + onProperty + + + + + + allValuesFrom + + + + + + hasValue + + + + + someValuesFrom + + + + + + minCardinality + + + + + + maxCardinality + + + + + + cardinality + + + + + + ObjectProperty + + + + + DatatypeProperty + + + + + inverseOf + + + + + + TransitiveProperty + + + + + SymmetricProperty + + + + + FunctionalProperty + + + + + InverseFunctionalProperty + + + + + + + + + + + + + + + + + + + + + + + + + Ontology + + + + + + + + imports + + + + + + + versionInfo + + + + + priorVersion + + + + + + + backwardCompatibleWitesh + + + + + + + incompatibleWith + + + + + + + DeprecatedClass + + + + + DeprecatedProperty + + + + + DataRange + + + + + diff --git a/tests/rdfxml/rdf-schema.out b/tests/rdfxml/rdf-schema.out new file mode 100644 index 0000000..d144ceb --- /dev/null +++ b/tests/rdfxml/rdf-schema.out @@ -0,0 +1,129 @@ + . + "Resource"@en . + "Ressource"@fr . + "The most general class" . + . + "type"@en . + "type"@fr . + "Indicates membership of a class" . + . + . + "comment"@en . + "commentaire"@fr . + . + "Use this for descriptions" . + . + . + . + "label"@en . + "label"@fr . + . + "Provides a human-readable version of a resource name." . + . + . + "Class"@en . + "Classe"@fr . + "The concept of Class" . + . + . + "subClassOf"@en . + "sousClasseDe"@fr . + "Indicates membership of a class" . + . + . + . + "subPropertyOf"@en . + "sousPropri\u00E9t\u00E9De"@fr . + "Indicates specialization of properties" . + . + . + . + "seeAlso"@en . + "voirAussi"@fr . + "Indicates a resource that provides information about the subject resource." . + . + . + . + . + . + "isDefinedBy"@en . + "esD\u00E9finiPar"@fr . + "Indicates a resource containing and defining the subject resource." . + . + . + . + "ConstraintResource"@en . + "RessourceContrainte"@fr . + . + . + "Resources used to express RDF Schema constraints." . + . + "ConstraintProperty"@en . + "Propri\u00E9t\u00E9Contrainte"@fr . + . + . + "Properties used to express RDF Schema constraints." . + . + "domain"@en . + "domaine"@fr . + "This is how we associate a class with properties that its instances can have" . + . + "range"@en . + "\u00E9tendue"@fr . + "Properties that can be used in a schema to provide constraints" . + . + . + . + "Property"@en . + "Propri\u00E9t\u00E9"@fr . + "The concept of a property." . + . + . + "Literal"@en . + "Litt\u00E9ral"@fr . + . + "This represents the set of atomic values, eg. textual strings." . + . + "Statement"@en . + "D\u00E9claration"@fr . + . + "This represents the set of reified statements." . + . + "subject"@en . + "sujet"@fr . + . + . + . + "predicate"@en . + "pr\u00E9dicat"@fr . + . + . + . + . + "object"@en . + "objet"@fr . + . + . + "Container"@en . + "Enveloppe"@fr . + . + "This represents the set Containers." . + . + "Bag"@en . + "Ensemble"@fr . + . + . + "Sequence"@en . + "S\u00E9quence"@fr . + . + . + "Alt"@en . + "Choix"@fr . + . + . + "ContainerMembershipProperty"@en . + . + . + "object"@en . + "value"@fr . + . diff --git a/tests/rdfxml/rdf-schema.rdf b/tests/rdfxml/rdf-schema.rdf new file mode 100644 index 0000000..f83f7f6 --- /dev/null +++ b/tests/rdfxml/rdf-schema.rdf @@ -0,0 +1,187 @@ + + + + Resource + Ressource + The most general class + + + + type + type + Indicates membership of a class + + + + + comment + commentaire + + Use this for descriptions + + + + + + label + label + + Provides a human-readable version of a resource name. + + + + + Class + Classe + The concept of Class + + + + + subClassOf + sousClasseDe + Indicates membership of a class + + + + + + subPropertyOf + sousPropriétéDe + Indicates specialization of properties + + + + + + seeAlso + voirAussi + Indicates a resource that provides information about the subject resource. + + + + + + + + isDefinedBy + esDéfiniPar + Indicates a resource containing and defining the subject resource. + + + + + + ConstraintResource + RessourceContrainte + + + Resources used to express RDF Schema constraints. + + + + ConstraintProperty + PropriétéContrainte + + + Properties used to express RDF Schema constraints. + + + + domain + domaine + This is how we associate a class with properties that its instances can have + + + + range + étendue + Properties that can be used in a schema to provide constraints + + + + + + Property + Propriété + The concept of a property. + + + + + Literal + Littéral + + This represents the set of atomic values, eg. textual strings. + + + + Statement + Déclaration + + This represents the set of reified statements. + + + + subject + sujet + + + + + + predicate + prédicat + + + + + + + object + objet + + + + + Container + Enveloppe + + This represents the set Containers. + + + + Bag + Ensemble + + + + + Sequence + Séquence + + + + + Alt + Choix + + + + + ContainerMembershipProperty + + + + + object + value + + + + + + + diff --git a/tests/rdfxml/rdfs-namespace.out b/tests/rdfxml/rdfs-namespace.out new file mode 100644 index 0000000..2097537 --- /dev/null +++ b/tests/rdfxml/rdfs-namespace.out @@ -0,0 +1,132 @@ + . + . + "Resource"@en . + "The class resource, everything." . + . + . + "type"@en . + "Indicates membership of a class" . + . + . + . + . + "Class"@en . + "The concept of Class" . + . + . + . + "subClassOf"@en . + "Indicates membership of a class" . + . + . + . + . + "subPropertyOf"@en . + "Indicates specialization of properties" . + . + . + . + . + "Property"@en . + "The concept of a property." . + . + . + . + "comment"@en . + "Use this for descriptions" . + . + . + . + . + "label"@en . + "Provides a human-readable version of a resource name." . + . + . + . + . + "domain"@en . + "A domain class for a property type" . + . + . + . + . + "range"@en . + "A range class for a property type" . + . + . + . + . + "seeAlso"@en . + "A resource that provides information about the subject resource" . + . + . + . + . + . + . + "isDefinedBy"@en . + "Indicates the namespace of a resource" . + . + . + . + . + "Literal"@en . + "This represents the set of atomic values, eg. textual strings." . + . + . + "Statement"@en . + . + "The class of RDF statements." . + . + . + "subject"@en . + "The subject of an RDF statement." . + . + . + . + . + "predicate"@en . + "the predicate of an RDF statement." . + . + . + . + . + "object"@en . + "The object of an RDF statement." . + . + . + . + "Container"@en . + . + "This represents the set Containers." . + . + . + "Bag"@en . + "An unordered collection."@en . + . + . + . + "Seq"@en . + "An ordered collection."@en . + . + . + . + "Alt"@en . + "A collection of alternatives."@en . + . + . + . + "ContainerMembershipProperty"@en . + "The container membership properties, rdf:1, rdf:2, ..., all of which are sub-properties of 'member'." . + . + . + . + "member"@en . + "a member of a container" . + . + . + . + "value"@en . + "Identifies the principal value (usually a string) of a property when the property value is a structured resource" . + . + . diff --git a/tests/rdfxml/rdfs-namespace.rdf b/tests/rdfxml/rdfs-namespace.rdf new file mode 100644 index 0000000..999fc0e --- /dev/null +++ b/tests/rdfxml/rdfs-namespace.rdf @@ -0,0 +1,188 @@ + + + + + Resource + The class resource, everything. + + + + + type + Indicates membership of a class + + + + + + + Class + The concept of Class + + + + + + subClassOf + Indicates membership of a class + + + + + + + subPropertyOf + Indicates specialization of properties + + + + + + + Property + The concept of a property. + + + + + + comment + Use this for descriptions + + + + + + + label + Provides a human-readable version of a resource name. + + + + + + + domain + A domain class for a property type + + + + + + + range + A range class for a property type + + + + + + + seeAlso + A resource that provides information about the subject resource + + + + + + + + + isDefinedBy + Indicates the namespace of a resource + + + + + + + Literal + This represents the set of atomic values, eg. textual strings. + + + + + Statement + + The class of RDF statements. + + + + + subject + The subject of an RDF statement. + + + + + + + predicate + the predicate of an RDF statement. + + + + + + + object + The object of an RDF statement. + + + + + + Container + + This represents the set Containers. + + + + + Bag + An unordered collection. + + + + + + Seq + An ordered collection. + + + + + + Alt + A collection of alternatives. + + + + + + ContainerMembershipProperty + The container membership properties, rdf:1, rdf:2, ..., all of which are sub-properties of 'member'. + + + + + + member + a member of a container + + + + + + value + Identifies the principal value (usually a string) of a property when the property value is a structured resource + + + + + + + + diff --git a/tests/rdfxml/warn-00.out b/tests/rdfxml/warn-00.out new file mode 100644 index 0000000..2424eaf --- /dev/null +++ b/tests/rdfxml/warn-00.out @@ -0,0 +1,7 @@ + . + "text" . + _:genid1 . +_:genid1 . +_:genid1 . +_:genid1 . +_:genid1 "text" . diff --git a/tests/rdfxml/warn-00.rdf b/tests/rdfxml/warn-00.rdf new file mode 100644 index 0000000..fc1b6a4 --- /dev/null +++ b/tests/rdfxml/warn-00.rdf @@ -0,0 +1,12 @@ + + + + + + + text + + + diff --git a/tests/rdfxml/warn-02.out b/tests/rdfxml/warn-02.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/rdfxml/warn-02.rdf b/tests/rdfxml/warn-02.rdf new file mode 100644 index 0000000..6cea5cf --- /dev/null +++ b/tests/rdfxml/warn-02.rdf @@ -0,0 +1,7 @@ + + + + + + diff --git a/tests/rdfxml/warn-04.out b/tests/rdfxml/warn-04.out new file mode 100644 index 0000000..462a8d9 --- /dev/null +++ b/tests/rdfxml/warn-04.out @@ -0,0 +1,2 @@ + . + "bar" . diff --git a/tests/rdfxml/warn-04.rdf b/tests/rdfxml/warn-04.rdf new file mode 100644 index 0000000..f62c8f2 --- /dev/null +++ b/tests/rdfxml/warn-04.rdf @@ -0,0 +1,10 @@ + + + + + + + bar + + diff --git a/tests/rdfxml/warn-05.out b/tests/rdfxml/warn-05.out new file mode 100644 index 0000000..69624b0 --- /dev/null +++ b/tests/rdfxml/warn-05.out @@ -0,0 +1 @@ + "bar" . diff --git a/tests/rdfxml/warn-05.rdf b/tests/rdfxml/warn-05.rdf new file mode 100644 index 0000000..530d44b --- /dev/null +++ b/tests/rdfxml/warn-05.rdf @@ -0,0 +1,9 @@ + + + + + + + bar + + diff --git a/tests/rdfxml/warn-06.out b/tests/rdfxml/warn-06.out new file mode 100644 index 0000000..676d52e --- /dev/null +++ b/tests/rdfxml/warn-06.out @@ -0,0 +1 @@ + "blah" . diff --git a/tests/rdfxml/warn-06.rdf b/tests/rdfxml/warn-06.rdf new file mode 100644 index 0000000..5bed246 --- /dev/null +++ b/tests/rdfxml/warn-06.rdf @@ -0,0 +1,9 @@ + + + + + + + diff --git a/tests/rdfxml/warn-07.out b/tests/rdfxml/warn-07.out new file mode 100644 index 0000000..3823555 --- /dev/null +++ b/tests/rdfxml/warn-07.out @@ -0,0 +1,2 @@ + "\n prop1name\n "^^ . + "\n \n \n \n "^^ . diff --git a/tests/rdfxml/warn-07.rdf b/tests/rdfxml/warn-07.rdf new file mode 100644 index 0000000..c187dd1 --- /dev/null +++ b/tests/rdfxml/warn-07.rdf @@ -0,0 +1,20 @@ + + + + + + + + prop1name + + + + + + + + + + + diff --git a/tests/rdfxml/wine.out b/tests/rdfxml/wine.out new file mode 100644 index 0000000..5f007db --- /dev/null +++ b/tests/rdfxml/wine.out @@ -0,0 +1,2012 @@ + . + "An example OWL ontology" . + . + . + . + "Derived from the DAML Wine ontology at \n http://ontolingua.stanford.edu/doc/chimaera/ontologies/wines.daml\n Substantially changed, in particular the Region based relations.\n " . + "Wine Ontology" . + . + . +_:genid1 . +_:genid1 . +_:genid1 "1"^^ . + _:genid1 . +_:genid2 . +_:genid2 . +_:genid2 . + _:genid2 . +_:genid3 . +_:genid3 . +_:genid3 "1"^^ . + _:genid3 . +_:genid4 . +_:genid4 . +_:genid4 "1"^^ . + _:genid4 . +_:genid5 . +_:genid5 . +_:genid5 "1"^^ . + _:genid5 . +_:genid6 . +_:genid6 . +_:genid6 "1"^^ . + _:genid6 . +_:genid7 . +_:genid7 . +_:genid7 "1"^^ . + _:genid7 . +_:genid8 . +_:genid8 . +_:genid8 . + _:genid8 . + "wine"@en . + "vin"@fr . + . +_:genid9 . +_:genid9 . +_:genid9 "1"^^ . + _:genid9 . + . + . + . +_:genid10 . + . +_:genid12 _:genid11 . +_:genid10 _:genid12 . +_:genid11 . +_:genid11 . +_:genid11 . +_:genid12 . + _:genid10 . + . +_:genid13 . + . +_:genid15 _:genid14 . +_:genid13 _:genid15 . +_:genid14 . +_:genid14 . +_:genid14 . +_:genid15 . + _:genid13 . + . +_:genid16 . + . +_:genid18 _:genid17 . +_:genid16 _:genid18 . +_:genid17 . +_:genid17 . +_:genid19 . +_:genid20 . + . +_:genid21 . +_:genid20 _:genid21 . + . +_:genid21 . +_:genid19 _:genid20 . +_:genid17 _:genid19 . +_:genid18 . + _:genid16 . + . +_:genid22 . + . +_:genid23 . +_:genid22 _:genid23 . + . +_:genid23 . + _:genid22 . + . +_:genid24 . +_:genid24 . +_:genid25 . +_:genid26 . + . +_:genid27 . +_:genid26 _:genid27 . + . +_:genid28 . +_:genid27 _:genid28 . + . +_:genid28 . +_:genid25 _:genid26 . +_:genid24 _:genid25 . + _:genid24 . + . +_:genid29 . + . +_:genid30 . +_:genid29 _:genid30 . + . +_:genid30 . + _:genid29 . + . +_:genid31 . +_:genid31 . +_:genid31 . + _:genid31 . +_:genid32 . +_:genid32 . +_:genid32 "1"^^ . + _:genid32 . + . +_:genid33 . + . +_:genid34 . +_:genid33 _:genid34 . + . +_:genid34 . + _:genid33 . + . +_:genid35 . +_:genid35 . +_:genid36 . +_:genid37 . + . +_:genid38 . +_:genid37 _:genid38 . + . +_:genid38 . +_:genid36 _:genid37 . +_:genid35 _:genid36 . + _:genid35 . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + "1998"^^ . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . +_:genid39 . + . +_:genid41 _:genid40 . +_:genid39 _:genid41 . +_:genid40 . +_:genid40 . +_:genid40 . +_:genid43 _:genid42 . +_:genid41 _:genid43 . +_:genid42 . +_:genid42 . +_:genid42 "1"^^ . +_:genid43 . + _:genid39 . + . +_:genid44 . +_:genid44 . +_:genid44 . + _:genid44 . +_:genid45 . +_:genid45 . +_:genid45 . + _:genid45 . +_:genid46 . +_:genid46 . +_:genid47 . +_:genid48 . + . +_:genid49 . +_:genid48 _:genid49 . + . +_:genid49 . +_:genid47 _:genid48 . +_:genid46 _:genid47 . + _:genid46 . +_:genid50 . +_:genid50 . +_:genid51 . +_:genid52 . + . +_:genid53 . +_:genid52 _:genid53 . + . +_:genid53 . +_:genid51 _:genid52 . +_:genid50 _:genid51 . + _:genid50 . + . + . + "Made WineDescriptor unionType of tastes and color" . +_:genid54 . + . +_:genid55 . +_:genid54 _:genid55 . + . +_:genid55 . + _:genid54 . + . + . + . + . +_:genid56 . + . +_:genid57 . +_:genid56 _:genid57 . + . +_:genid58 . +_:genid57 _:genid58 . + . +_:genid58 . + _:genid56 . + . + . +_:genid59 . + . +_:genid60 . +_:genid59 _:genid60 . + . +_:genid61 . +_:genid60 _:genid61 . + . +_:genid61 . + _:genid59 . + . + . +_:genid62 . + . +_:genid63 . +_:genid62 _:genid63 . + . +_:genid64 . +_:genid63 _:genid64 . + . +_:genid64 . + _:genid62 . + . + . +_:genid65 . + . +_:genid66 . +_:genid65 _:genid66 . + . +_:genid67 . +_:genid66 _:genid67 . + . +_:genid67 . + _:genid65 . + . + . +_:genid68 . + . +_:genid70 _:genid69 . +_:genid68 _:genid70 . +_:genid69 . +_:genid69 . +_:genid69 . +_:genid70 . + _:genid68 . + . +_:genid71 . +_:genid71 . +_:genid71 . + _:genid71 . +_:genid72 . +_:genid72 . +_:genid72 "1"^^ . + _:genid72 . + . +_:genid73 . + . +_:genid75 _:genid74 . +_:genid73 _:genid75 . +_:genid74 . +_:genid74 . +_:genid74 . +_:genid75 . + _:genid73 . + . +_:genid76 . + . +_:genid78 _:genid77 . +_:genid76 _:genid78 . +_:genid77 . +_:genid77 . +_:genid77 . +_:genid78 . + _:genid76 . + . + . +_:genid79 . +_:genid79 . +_:genid79 . + _:genid79 . +_:genid80 . +_:genid80 . +_:genid81 . +_:genid82 . + . +_:genid83 . +_:genid82 _:genid83 . + . +_:genid83 . +_:genid81 _:genid82 . +_:genid80 _:genid81 . + _:genid80 . +_:genid84 . + . +_:genid86 _:genid85 . +_:genid84 _:genid86 . +_:genid85 . +_:genid85 . +_:genid85 . +_:genid86 . + _:genid84 . + . +_:genid87 . +_:genid87 . +_:genid87 . + _:genid87 . +_:genid88 . +_:genid88 . +_:genid88 . + _:genid88 . +_:genid89 . +_:genid89 . +_:genid89 . + _:genid89 . +_:genid90 . +_:genid90 . +_:genid90 "1"^^ . + _:genid90 . +_:genid91 . + . +_:genid93 _:genid92 . +_:genid91 _:genid93 . +_:genid92 . +_:genid92 . +_:genid92 . +_:genid93 . + _:genid91 . + . +_:genid94 . +_:genid94 . +_:genid94 . + _:genid94 . +_:genid95 . +_:genid95 . +_:genid96 . +_:genid97 . + . +_:genid98 . +_:genid97 _:genid98 . + . +_:genid98 . +_:genid96 _:genid97 . +_:genid95 _:genid96 . + _:genid95 . +_:genid99 . + . +_:genid101 _:genid100 . +_:genid99 _:genid101 . +_:genid100 . +_:genid100 . +_:genid102 . +_:genid103 . + . +_:genid104 . +_:genid103 _:genid104 . + . +_:genid104 . +_:genid102 _:genid103 . +_:genid100 _:genid102 . +_:genid101 . + _:genid99 . + . +_:genid105 . + . +_:genid107 _:genid106 . +_:genid105 _:genid107 . +_:genid106 . +_:genid106 . +_:genid106 . +_:genid109 _:genid108 . +_:genid107 _:genid109 . +_:genid108 . +_:genid108 . +_:genid108 "1"^^ . +_:genid109 . + _:genid105 . + . +_:genid110 . + . +_:genid112 _:genid111 . +_:genid110 _:genid112 . +_:genid111 . +_:genid111 . +_:genid111 . +_:genid114 _:genid113 . +_:genid112 _:genid114 . +_:genid113 . +_:genid113 . +_:genid113 "1"^^ . +_:genid114 . + _:genid110 . + . + . + . +_:genid115 . +_:genid115 . +_:genid115 . + _:genid115 . +_:genid116 . +_:genid116 . +_:genid116 . + _:genid116 . +_:genid117 . +_:genid117 . +_:genid117 . + _:genid117 . + . +_:genid118 . +_:genid118 . +_:genid118 . + _:genid118 . +_:genid119 . +_:genid119 . +_:genid119 . + _:genid119 . +_:genid120 . +_:genid120 . +_:genid120 . + _:genid120 . +_:genid121 . +_:genid121 . +_:genid121 . + _:genid121 . +_:genid122 . +_:genid122 . +_:genid122 "1"^^ . + _:genid122 . +_:genid123 . + . +_:genid125 _:genid124 . +_:genid123 _:genid125 . +_:genid124 . +_:genid124 . +_:genid124 . +_:genid125 . + _:genid123 . + . +_:genid126 . + . +_:genid128 _:genid127 . +_:genid126 _:genid128 . +_:genid127 . +_:genid127 . +_:genid127 . +_:genid128 . + _:genid126 . + . +_:genid129 . +_:genid129 . +_:genid129 . + _:genid129 . +_:genid130 . + . +_:genid132 _:genid131 . +_:genid130 _:genid132 . +_:genid131 . +_:genid131 . +_:genid131 . +_:genid134 _:genid133 . +_:genid132 _:genid134 . +_:genid133 . +_:genid133 . +_:genid133 "1"^^ . +_:genid134 . + _:genid130 . + . +_:genid135 . + . +_:genid137 _:genid136 . +_:genid135 _:genid137 . +_:genid136 . +_:genid136 . +_:genid136 . +_:genid137 . + _:genid135 . + . +_:genid138 . + . +_:genid140 _:genid139 . +_:genid138 _:genid140 . +_:genid139 . +_:genid139 . +_:genid139 . +_:genid140 . + _:genid138 . + . +_:genid141 . +_:genid141 . +_:genid141 . + _:genid141 . +_:genid142 . +_:genid142 . +_:genid142 "1"^^ . + _:genid142 . +_:genid143 . + . +_:genid144 . +_:genid143 _:genid144 . + . +_:genid144 . + _:genid143 . + . +_:genid145 . +_:genid145 . +_:genid146 . +_:genid147 . + . +_:genid148 . +_:genid147 _:genid148 . + . +_:genid148 . +_:genid146 _:genid147 . +_:genid145 _:genid146 . + _:genid145 . +_:genid149 . + . +_:genid150 . +_:genid149 _:genid150 . + . +_:genid150 . + _:genid149 . + . + . +_:genid151 . +_:genid151 . +_:genid151 . + _:genid151 . +_:genid152 . +_:genid152 . +_:genid152 . + _:genid152 . +_:genid153 . +_:genid153 . +_:genid153 . + _:genid153 . +_:genid154 . +_:genid154 . +_:genid154 . + _:genid154 . + . +_:genid155 . +_:genid155 . +_:genid155 . + _:genid155 . +_:genid156 . + . +_:genid158 _:genid157 . +_:genid156 _:genid158 . +_:genid157 . +_:genid157 . +_:genid157 . +_:genid160 _:genid159 . +_:genid158 _:genid160 . +_:genid159 . +_:genid159 . +_:genid159 "1"^^ . +_:genid160 . + _:genid156 . + . +_:genid161 . +_:genid161 . +_:genid161 . + _:genid161 . +_:genid162 . + . +_:genid164 _:genid163 . +_:genid162 _:genid164 . +_:genid163 . +_:genid163 . +_:genid163 . +_:genid166 _:genid165 . +_:genid164 _:genid166 . +_:genid165 . +_:genid165 . +_:genid165 "1"^^ . +_:genid166 . + _:genid162 . + . +_:genid167 . +_:genid167 . +_:genid167 . + _:genid167 . +_:genid168 . +_:genid168 . +_:genid168 . + _:genid168 . +_:genid169 . +_:genid169 . +_:genid170 . +_:genid171 . + . +_:genid172 . +_:genid171 _:genid172 . + . +_:genid172 . +_:genid170 _:genid171 . +_:genid169 _:genid170 . + _:genid169 . +_:genid173 . +_:genid173 . +_:genid174 . +_:genid175 . + . +_:genid176 . +_:genid175 _:genid176 . + . +_:genid176 . +_:genid174 _:genid175 . +_:genid173 _:genid174 . + _:genid173 . +_:genid177 . + . +_:genid179 _:genid178 . +_:genid177 _:genid179 . +_:genid178 . +_:genid178 . +_:genid178 . +_:genid181 _:genid180 . +_:genid179 _:genid181 . +_:genid180 . +_:genid180 . +_:genid180 "1"^^ . +_:genid181 . + _:genid177 . + . +_:genid182 . +_:genid182 . +_:genid182 . + _:genid182 . +_:genid183 . +_:genid183 . +_:genid183 . + _:genid183 . +_:genid184 . +_:genid184 . +_:genid184 . + _:genid184 . +_:genid185 . +_:genid185 . +_:genid185 "1"^^ . + _:genid185 . +_:genid186 . + . +_:genid188 _:genid187 . +_:genid186 _:genid188 . +_:genid187 . +_:genid187 . +_:genid187 . +_:genid188 . + _:genid186 . + . +_:genid189 . +_:genid189 . +_:genid189 . + _:genid189 . +_:genid190 . +_:genid190 . +_:genid190 . + _:genid190 . +_:genid191 . +_:genid191 . +_:genid191 . + _:genid191 . +_:genid192 . +_:genid192 . +_:genid192 . + _:genid192 . +_:genid193 . +_:genid193 . +_:genid193 "1"^^ . + _:genid193 . +_:genid194 . + . +_:genid196 _:genid195 . +_:genid194 _:genid196 . +_:genid195 . +_:genid195 . +_:genid195 . +_:genid196 . + _:genid194 . + . +_:genid197 . +_:genid197 . +_:genid197 . + _:genid197 . +_:genid198 . + . +_:genid200 _:genid199 . +_:genid198 _:genid200 . +_:genid199 . +_:genid199 . +_:genid199 . +_:genid200 . + _:genid198 . + . +_:genid201 . +_:genid201 . +_:genid201 . + _:genid201 . +_:genid202 . +_:genid202 . +_:genid202 . + _:genid202 . +_:genid203 . +_:genid203 . +_:genid204 . +_:genid205 . + . +_:genid206 . +_:genid205 _:genid206 . + . +_:genid206 . +_:genid204 _:genid205 . +_:genid203 _:genid204 . + _:genid203 . +_:genid207 . +_:genid207 . +_:genid208 . +_:genid209 . + . +_:genid210 . +_:genid209 _:genid210 . + . +_:genid210 . +_:genid208 _:genid209 . +_:genid207 _:genid208 . + _:genid207 . +_:genid211 . + . +_:genid213 _:genid212 . +_:genid211 _:genid213 . +_:genid212 . +_:genid212 . +_:genid212 . +_:genid215 _:genid214 . +_:genid213 _:genid215 . +_:genid214 . +_:genid214 . +_:genid214 "1"^^ . +_:genid215 . + _:genid211 . + . +_:genid216 . +_:genid216 . +_:genid216 . + _:genid216 . +_:genid217 . + . +_:genid219 _:genid218 . +_:genid217 _:genid219 . +_:genid218 . +_:genid218 . +_:genid220 . +_:genid221 . + . +_:genid222 . +_:genid221 _:genid222 . + . +_:genid223 . +_:genid222 _:genid223 . + . +_:genid224 . +_:genid223 _:genid224 . + . +_:genid225 . +_:genid224 _:genid225 . + . +_:genid225 . +_:genid220 _:genid221 . +_:genid218 _:genid220 . +_:genid227 _:genid226 . +_:genid219 _:genid227 . +_:genid226 . +_:genid226 . +_:genid226 "2"^^ . +_:genid227 . + _:genid217 . + . + . + . +_:genid228 . +_:genid228 . +_:genid228 . + _:genid228 . +_:genid229 . +_:genid229 . +_:genid229 . + _:genid229 . +_:genid230 . + . +_:genid232 _:genid231 . +_:genid230 _:genid232 . +_:genid231 . +_:genid231 . +_:genid231 . +_:genid232 . + _:genid230 . + . +_:genid233 . +_:genid233 . +_:genid233 . + _:genid233 . +_:genid234 . +_:genid234 . +_:genid234 . + _:genid234 . +_:genid235 . +_:genid235 . +_:genid235 "1"^^ . + _:genid235 . +_:genid236 . + . +_:genid238 _:genid237 . +_:genid236 _:genid238 . +_:genid237 . +_:genid237 . +_:genid237 . +_:genid238 . + _:genid236 . + . + . + . +_:genid239 . + . +_:genid241 _:genid240 . +_:genid239 _:genid241 . +_:genid240 . +_:genid240 . +_:genid240 . +_:genid241 . + _:genid239 . + . + . + . +_:genid242 . +_:genid242 . +_:genid242 . + _:genid242 . +_:genid243 . +_:genid243 . +_:genid244 . +_:genid245 . + . +_:genid246 . +_:genid245 _:genid246 . + . +_:genid246 . +_:genid244 _:genid245 . +_:genid243 _:genid244 . + _:genid243 . + . +_:genid247 . + . +_:genid249 _:genid248 . +_:genid247 _:genid249 . +_:genid248 . +_:genid248 . +_:genid248 . +_:genid249 . + _:genid247 . + . + . +_:genid250 . +_:genid250 . +_:genid251 . +_:genid252 . + . +_:genid253 . +_:genid252 _:genid253 . + . +_:genid253 . +_:genid251 _:genid252 . +_:genid250 _:genid251 . + _:genid250 . +_:genid254 . +_:genid254 . +_:genid255 . +_:genid256 . + . +_:genid257 . +_:genid256 _:genid257 . + . +_:genid257 . +_:genid255 _:genid256 . +_:genid254 _:genid255 . + _:genid254 . +_:genid258 . + . +_:genid259 . +_:genid258 _:genid259 . + . +_:genid261 _:genid260 . +_:genid259 _:genid261 . +_:genid260 . +_:genid260 . +_:genid260 . +_:genid261 . + _:genid258 . + . +_:genid262 . + . +_:genid264 _:genid263 . +_:genid262 _:genid264 . +_:genid263 . +_:genid263 . +_:genid263 . +_:genid264 . + _:genid262 . + . +_:genid265 . + . +_:genid267 _:genid266 . +_:genid265 _:genid267 . +_:genid266 . +_:genid266 . +_:genid266 . +_:genid269 _:genid268 . +_:genid267 _:genid269 . +_:genid268 . +_:genid268 . +_:genid268 "1"^^ . +_:genid269 . + _:genid265 . + . +_:genid270 . + . +_:genid272 _:genid271 . +_:genid270 _:genid272 . +_:genid271 . +_:genid271 . +_:genid271 . +_:genid272 . + _:genid270 . + . + . +_:genid273 . + . +_:genid275 _:genid274 . +_:genid273 _:genid275 . +_:genid274 . +_:genid274 . +_:genid274 . +_:genid275 . + _:genid273 . + . + . +_:genid276 . +_:genid276 . +_:genid277 . +_:genid278 . + . +_:genid279 . +_:genid278 _:genid279 . + . +_:genid279 . +_:genid277 _:genid278 . +_:genid276 _:genid277 . + _:genid276 . + . +_:genid280 . + . +_:genid282 _:genid281 . +_:genid280 _:genid282 . +_:genid281 . +_:genid281 . +_:genid281 . +_:genid282 . + _:genid280 . + . +_:genid283 . + . +_:genid284 . +_:genid283 _:genid284 . + . +_:genid284 . + _:genid283 . + . +_:genid285 . +_:genid285 . +_:genid285 . + _:genid285 . +_:genid286 . +_:genid286 . +_:genid286 . + _:genid286 . +_:genid287 . +_:genid287 . +_:genid288 . +_:genid289 . + . +_:genid290 . +_:genid289 _:genid290 . + . +_:genid290 . +_:genid288 _:genid289 . +_:genid287 _:genid288 . + _:genid287 . +_:genid291 . + . +_:genid293 _:genid292 . +_:genid291 _:genid293 . +_:genid292 . +_:genid292 . +_:genid292 . +_:genid293 . + _:genid291 . + . +_:genid294 . + . +_:genid295 . +_:genid294 _:genid295 . + . +_:genid295 . + _:genid294 . + . + . +_:genid296 . +_:genid296 . +_:genid297 . +_:genid298 . + . +_:genid299 . +_:genid298 _:genid299 . + . +_:genid299 . +_:genid297 _:genid298 . +_:genid296 _:genid297 . + _:genid296 . + . +_:genid300 . +_:genid300 . +_:genid300 . + _:genid300 . +_:genid301 . + . +_:genid303 _:genid302 . +_:genid301 _:genid303 . +_:genid302 . +_:genid302 . +_:genid302 . +_:genid303 . + _:genid301 . + . + . +_:genid304 . +_:genid304 . +_:genid304 . + _:genid304 . +_:genid305 . +_:genid305 . +_:genid305 . + _:genid305 . +_:genid306 . +_:genid306 . +_:genid306 . + _:genid306 . +_:genid307 . +_:genid307 . +_:genid307 . + _:genid307 . +_:genid308 . +_:genid308 . +_:genid308 . + _:genid308 . +_:genid309 . +_:genid309 . +_:genid310 . +_:genid311 . + . +_:genid312 . +_:genid311 _:genid312 . + . +_:genid312 . +_:genid310 _:genid311 . +_:genid309 _:genid310 . + _:genid309 . + . +_:genid313 . +_:genid313 . +_:genid313 . + _:genid313 . +_:genid314 . +_:genid314 . +_:genid314 . + _:genid314 . +_:genid315 . +_:genid315 . +_:genid316 . +_:genid317 . + . +_:genid318 . +_:genid317 _:genid318 . + . +_:genid318 . +_:genid316 _:genid317 . +_:genid315 _:genid316 . + _:genid315 . +_:genid319 . +_:genid319 . +_:genid320 . +_:genid321 . + . +_:genid322 . +_:genid321 _:genid322 . + . +_:genid322 . +_:genid320 _:genid321 . +_:genid319 _:genid320 . + _:genid319 . +_:genid323 . + . +_:genid325 _:genid324 . +_:genid323 _:genid325 . +_:genid324 . +_:genid324 . +_:genid324 . +_:genid327 _:genid326 . +_:genid325 _:genid327 . +_:genid326 . +_:genid326 . +_:genid326 "1"^^ . +_:genid327 . + _:genid323 . + . +_:genid328 . +_:genid328 . +_:genid328 . + _:genid328 . +_:genid329 . +_:genid329 . +_:genid330 . +_:genid331 . + . +_:genid332 . +_:genid331 _:genid332 . + . +_:genid332 . +_:genid330 _:genid331 . +_:genid329 _:genid330 . + _:genid329 . +_:genid333 . +_:genid333 . +_:genid334 . +_:genid335 . + . +_:genid336 . +_:genid335 _:genid336 . + . +_:genid336 . +_:genid334 _:genid335 . +_:genid333 _:genid334 . + _:genid333 . +_:genid337 . + . +_:genid339 _:genid338 . +_:genid337 _:genid339 . +_:genid338 . +_:genid338 . +_:genid338 . +_:genid341 _:genid340 . +_:genid339 _:genid341 . +_:genid340 . +_:genid340 . +_:genid340 "1"^^ . +_:genid341 . + _:genid337 . + . + . + . + . + . +_:genid342 . + . +_:genid344 _:genid343 . +_:genid342 _:genid344 . +_:genid343 . +_:genid343 . +_:genid343 . +_:genid344 . + _:genid342 . + . +_:genid345 . + . +_:genid347 _:genid346 . +_:genid345 _:genid347 . +_:genid346 . +_:genid346 . +_:genid346 . +_:genid347 . + _:genid345 . + . +_:genid348 . +_:genid348 . +_:genid348 . + _:genid348 . +_:genid349 . +_:genid349 . +_:genid349 . + _:genid349 . +_:genid350 . +_:genid350 . +_:genid351 . +_:genid352 . + . +_:genid353 . +_:genid352 _:genid353 . + . +_:genid353 . +_:genid351 _:genid352 . +_:genid350 _:genid351 . + _:genid350 . +_:genid354 . +_:genid354 . +_:genid355 . +_:genid356 . + . +_:genid357 . +_:genid356 _:genid357 . + . +_:genid357 . +_:genid355 _:genid356 . +_:genid354 _:genid355 . + _:genid354 . +_:genid358 . + . +_:genid360 _:genid359 . +_:genid358 _:genid360 . +_:genid359 . +_:genid359 . +_:genid359 . +_:genid362 _:genid361 . +_:genid360 _:genid362 . +_:genid361 . +_:genid361 . +_:genid361 "1"^^ . +_:genid362 . + _:genid358 . + . +_:genid363 . +_:genid363 . +_:genid363 . + _:genid363 . +_:genid364 . +_:genid364 . +_:genid364 . + _:genid364 . +_:genid365 . +_:genid365 . +_:genid365 . + _:genid365 . +_:genid366 . +_:genid366 . +_:genid366 . + _:genid366 . +_:genid367 . + . +_:genid369 _:genid368 . +_:genid367 _:genid369 . +_:genid368 . +_:genid368 . +_:genid368 . +_:genid371 _:genid370 . +_:genid369 _:genid371 . +_:genid370 . +_:genid370 . +_:genid370 "1"^^ . +_:genid371 . + _:genid367 . + . +_:genid372 . + . +_:genid374 _:genid373 . +_:genid372 _:genid374 . +_:genid373 . +_:genid373 . +_:genid373 . +_:genid374 . + _:genid372 . +_:genid375 . +_:genid375 . +_:genid375 . + _:genid375 . + . + . + . + . + . +_:genid376 . + . +_:genid378 _:genid377 . +_:genid376 _:genid378 . +_:genid377 . +_:genid377 . +_:genid377 . +_:genid378 . + _:genid376 . + . +_:genid379 . +_:genid379 . +_:genid379 . + _:genid379 . +_:genid380 . +_:genid380 . +_:genid380 . + _:genid380 . +_:genid381 . +_:genid381 . +_:genid381 . + _:genid381 . +_:genid382 . +_:genid382 . +_:genid382 . + _:genid382 . +_:genid383 . +_:genid383 . +_:genid383 . + _:genid383 . +_:genid384 . +_:genid384 . +_:genid384 "1"^^ . + _:genid384 . +_:genid385 . + . +_:genid387 _:genid386 . +_:genid385 _:genid387 . +_:genid386 . +_:genid386 . +_:genid386 . +_:genid387 . + _:genid385 . + . + . +_:genid388 . +_:genid388 . +_:genid388 . + _:genid388 . +_:genid389 . +_:genid389 . +_:genid389 . + _:genid389 . +_:genid390 . +_:genid390 . +_:genid390 . + _:genid390 . +_:genid391 . +_:genid391 . +_:genid391 . + _:genid391 . +_:genid392 . + . +_:genid394 _:genid393 . +_:genid392 _:genid394 . +_:genid393 . +_:genid393 . +_:genid393 . +_:genid394 . + _:genid392 . + . +_:genid395 . + . +_:genid397 _:genid396 . +_:genid395 _:genid397 . +_:genid396 . +_:genid396 . +_:genid396 . +_:genid397 . + _:genid395 . + . +_:genid398 . + . +_:genid400 _:genid399 . +_:genid398 _:genid400 . +_:genid399 . +_:genid399 . +_:genid399 . +_:genid400 . + _:genid398 . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . +_:genid401 . +_:genid402 . + . +_:genid403 . +_:genid402 _:genid403 . + . +_:genid404 . +_:genid403 _:genid404 . + . +_:genid404 . +_:genid401 _:genid402 . +_:genid405 . +_:genid406 . + . +_:genid407 . +_:genid406 _:genid407 . + . +_:genid408 . +_:genid407 _:genid408 . + . +_:genid408 . +_:genid405 _:genid406 . +_:genid409 . +_:genid410 . + . +_:genid411 . +_:genid410 _:genid411 . + . +_:genid412 . +_:genid411 _:genid412 . + . +_:genid412 . +_:genid409 _:genid410 . +_:genid413 . +_:genid414 . + . +_:genid415 . +_:genid414 _:genid415 . + . +_:genid416 . +_:genid415 _:genid416 . + . +_:genid416 . +_:genid413 _:genid414 . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . +_:genid417 . +_:genid418 . + . +_:genid419 . +_:genid418 _:genid419 . + . +_:genid420 . +_:genid419 _:genid420 . + . +_:genid421 . +_:genid420 _:genid421 . + . +_:genid422 . +_:genid421 _:genid422 . + . +_:genid423 . +_:genid422 _:genid423 . + . +_:genid424 . +_:genid423 _:genid424 . + . +_:genid425 . +_:genid424 _:genid425 . + . +_:genid426 . +_:genid425 _:genid426 . + . +_:genid427 . +_:genid426 _:genid427 . + . +_:genid428 . +_:genid427 _:genid428 . + . +_:genid429 . +_:genid428 _:genid429 . + . +_:genid430 . +_:genid429 _:genid430 . + . +_:genid431 . +_:genid430 _:genid431 . + . +_:genid432 . +_:genid431 _:genid432 . + . +_:genid433 . +_:genid432 _:genid433 . + . +_:genid434 . +_:genid433 _:genid434 . + . +_:genid435 . +_:genid434 _:genid435 . + . +_:genid436 . +_:genid435 _:genid436 . + . +_:genid437 . +_:genid436 _:genid437 . + . +_:genid438 . +_:genid437 _:genid438 . + . +_:genid439 . +_:genid438 _:genid439 . + . +_:genid440 . +_:genid439 _:genid440 . + . +_:genid441 . +_:genid440 _:genid441 . + . +_:genid442 . +_:genid441 _:genid442 . + . +_:genid443 . +_:genid442 _:genid443 . + . +_:genid444 . +_:genid443 _:genid444 . + . +_:genid445 . +_:genid444 _:genid445 . + . +_:genid446 . +_:genid445 _:genid446 . + . +_:genid447 . +_:genid446 _:genid447 . + . +_:genid448 . +_:genid447 _:genid448 . + . +_:genid449 . +_:genid448 _:genid449 . + . +_:genid450 . +_:genid449 _:genid450 . + . +_:genid451 . +_:genid450 _:genid451 . + . +_:genid452 . +_:genid451 _:genid452 . + . +_:genid453 . +_:genid452 _:genid453 . + . +_:genid454 . +_:genid453 _:genid454 . + . +_:genid455 . +_:genid454 _:genid455 . + . +_:genid456 . +_:genid455 _:genid456 . + . +_:genid457 . +_:genid456 _:genid457 . + . +_:genid458 . +_:genid457 _:genid458 . + . +_:genid458 . +_:genid417 _:genid418 . diff --git a/tests/rdfxml/wine.rdf b/tests/rdfxml/wine.rdf new file mode 100644 index 0000000..91c0f5d --- /dev/null +++ b/tests/rdfxml/wine.rdf @@ -0,0 +1,2402 @@ + + + + + + ]> + + + + + An example OWL ontology + + + + + Derived from the DAML Wine ontology at + http://ontolingua.stanford.edu/doc/chimaera/ontologies/wines.daml + Substantially changed, in particular the Region based relations. + + Wine Ontology + + + + + + + + 1 + + + + + + + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + + + 1 + + + + + + + + + wine + vin + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1998 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Made WineDescriptor unionType of tastes and color + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/trig/CMakeLists.txt b/tests/trig/CMakeLists.txt new file mode 100644 index 0000000..b85d90d --- /dev/null +++ b/tests/trig/CMakeLists.txt @@ -0,0 +1,37 @@ +# raptor/tests/trig/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +RAPPER_TEST(trig.example1 + "${RAPPER} -q -i trig -o nquads ${CMAKE_CURRENT_SOURCE_DIR}/example1.trig http://example.librdf.org/example1.trig" + example1.res + ${CMAKE_CURRENT_SOURCE_DIR}/example1.out +) + +RAPPER_TEST(trig.example2 + "${RAPPER} -q -i trig -o nquads ${CMAKE_CURRENT_SOURCE_DIR}/example2.trig http://example.librdf.org/example2.trig" + example2.res + ${CMAKE_CURRENT_SOURCE_DIR}/example2.out +) + +RAPPER_TEST(trig.example3 + "${RAPPER} -q -i trig -o nquads ${CMAKE_CURRENT_SOURCE_DIR}/example3.trig http://example.librdf.org/example3.trig" + example3.res + ${CMAKE_CURRENT_SOURCE_DIR}/example3.out +) + +RAPPER_TEST(trig.bug370 + "${RAPPER} -q -i trig -o nquads ${CMAKE_CURRENT_SOURCE_DIR}/bug370.trig http://example.librdf.org/bug370.trig" + bug370.res + ${CMAKE_CURRENT_SOURCE_DIR}/bug370.out +) + +RAPPER_TEST(trig.bug451 + "${RAPPER} -q -i trig -o nquads ${CMAKE_CURRENT_SOURCE_DIR}/bug451.trig http://example.librdf.org/bug451.trig" + bug451.res + ${CMAKE_CURRENT_SOURCE_DIR}/bug451.out +) + +# end raptor/tests/trig/CMakeLists.txt diff --git a/tests/trig/Makefile.am b/tests/trig/Makefile.am new file mode 100644 index 0000000..82066ca --- /dev/null +++ b/tests/trig/Makefile.am @@ -0,0 +1,80 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor TRiG tests +# +# Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +TEST_FILES=\ +example1.trig example2.trig example3.trig bug370.trig bug451.trig \ +bug-584-dos.trig bug-584-unix.trig issue-37.trig + +TEST_OUT_FILES=\ +example1.out example2.out example3.out bug370.out bug451.out \ +bug-584-dos.out bug-584-unix.out issue-37.out + +# Used to make N-triples output consistent +BASE_URI=http://example.librdf.org/ + +EXTRA_DIST = \ + CMakeLists.txt \ + $(TEST_FILES) \ + $(TEST_OUT_FILES) + +RAPPER = $(top_builddir)/utils/rapper + +CLEANFILES = CMakeTests.txt + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +check-local: check-trig + +if MAINTAINER_MODE +check_trig_deps = $(TEST_FILES) +endif + +check-trig: build-rapper $(check_trig_deps) + @result=0; \ + $(RECHO) "Testing legal TRiG"; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .trig` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i trig -o nquads $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; result=1; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + trig.$$name \ + "\$${RAPPER} -q -i trig -o nquads \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + exit $$result diff --git a/tests/trig/Makefile.in b/tests/trig/Makefile.in new file mode 100644 index 0000000..5230568 --- /dev/null +++ b/tests/trig/Makefile.in @@ -0,0 +1,570 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor TRiG tests +# +# Copyright (C) 2007, David Beckett http://purl.org/net/dajobe/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/trig +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +TEST_FILES = \ +example1.trig example2.trig example3.trig bug370.trig bug451.trig \ +bug-584-dos.trig bug-584-unix.trig issue-37.trig + +TEST_OUT_FILES = \ +example1.out example2.out example3.out bug370.out bug451.out \ +bug-584-dos.out bug-584-unix.out issue-37.out + + +# Used to make N-triples output consistent +BASE_URI = http://example.librdf.org/ +EXTRA_DIST = \ + CMakeLists.txt \ + $(TEST_FILES) \ + $(TEST_OUT_FILES) + +RAPPER = $(top_builddir)/utils/rapper +CLEANFILES = CMakeTests.txt +@MAINTAINER_MODE_TRUE@check_trig_deps = $(TEST_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/trig/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/trig/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +check-local: check-trig + +check-trig: build-rapper $(check_trig_deps) + @result=0; \ + $(RECHO) "Testing legal TRiG"; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .trig` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i trig -o nquads $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) FAILED returned status $$status; result=1; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; \ + diff $(srcdir)/$$name.out $$name.res; result=1; \ + fi; \ + rm -f $$name.res $$name.err; \ + printf 'RAPPER_TEST(%s\n\t"%s"\n\t%s\n\t%s\n)\n\n' \ + trig.$$name \ + "\$${RAPPER} -q -i trig -o nquads \$${CMAKE_CURRENT_SOURCE_DIR}/$$test $$baseuri" \ + $$name.res \ + "\$${CMAKE_CURRENT_SOURCE_DIR}/$$name.out" >>CMakeTests.txt; \ + done; \ + exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/trig/bug-584-dos.out b/tests/trig/bug-584-dos.out new file mode 100644 index 0000000..02aa5f5 --- /dev/null +++ b/tests/trig/bug-584-dos.out @@ -0,0 +1 @@ + . diff --git a/tests/trig/bug-584-dos.trig b/tests/trig/bug-584-dos.trig new file mode 100644 index 0000000..3b239ca --- /dev/null +++ b/tests/trig/bug-584-dos.trig @@ -0,0 +1,2 @@ + + { a . } diff --git a/tests/trig/bug-584-unix.out b/tests/trig/bug-584-unix.out new file mode 100644 index 0000000..02aa5f5 --- /dev/null +++ b/tests/trig/bug-584-unix.out @@ -0,0 +1 @@ + . diff --git a/tests/trig/bug-584-unix.trig b/tests/trig/bug-584-unix.trig new file mode 100644 index 0000000..256d45c --- /dev/null +++ b/tests/trig/bug-584-unix.trig @@ -0,0 +1,2 @@ + + { a . } diff --git a/tests/trig/bug370.out b/tests/trig/bug370.out new file mode 100644 index 0000000..71009b5 --- /dev/null +++ b/tests/trig/bug370.out @@ -0,0 +1,8 @@ + . + "Romeo Montague" . + . + "Juliet Capulet" . + "female" . + . + . + "male" . diff --git a/tests/trig/bug370.trig b/tests/trig/bug370.trig new file mode 100644 index 0000000..2cf4c90 --- /dev/null +++ b/tests/trig/bug370.trig @@ -0,0 +1,27 @@ +# Issue #0000370 http://bugs.librdf.org/mantis/bug_change_status_page.php +# +# rapper -i trig --show-graphs bug370.trig http://mmt.me.uk/examples/rdf/trig1.tt +# + +@base . + +@prefix xsd: . +@prefix foaf: . +@prefix foo: . +@prefix : . + +:romeo a foaf:Person ; + foaf:name "Romeo Montague". + +:juliet a foaf:Person ; + foaf:name "Juliet Capulet" . + +:juliet foaf:gender "female" . + +:reality { + :romeo foo:loves :juliet . } + +:alternative { + :romeo foo:hates :juliet . } + +:romeo foaf:gender "male" . diff --git a/tests/trig/bug451.out b/tests/trig/bug451.out new file mode 100644 index 0000000..2dd98b0 --- /dev/null +++ b/tests/trig/bug451.out @@ -0,0 +1,9 @@ + . + "Characterset in which the content of the InformationElement was created." . + . + "characterSet" . + . + "1" . + . + . + . diff --git a/tests/trig/bug451.trig b/tests/trig/bug451.trig new file mode 100644 index 0000000..f8c89c6 --- /dev/null +++ b/tests/trig/bug451.trig @@ -0,0 +1,26 @@ +@prefix nie: . +@prefix dcterms: . +@prefix rdfs: . +@prefix nrl: . +@prefix rdf: . +@prefix xsd: . + +# HERE "nie:" is used as graph name +nie: {nie:characterSet + a rdf:Property ; + rdfs:comment "Characterset in which the content of the InformationElement was created." ; + rdfs:domain nie:InformationElement ; + rdfs:label "characterSet" ; + rdfs:range xsd:string ; + nrl:maxCardinality "1" . +} + + { + nie: a nrl:Ontology ; + . + + + a nrl:GraphMetadata ; + nrl:coreGraphMetadataFor + nie: . +} diff --git a/tests/trig/example1.out b/tests/trig/example1.out new file mode 100644 index 0000000..0a39d75 --- /dev/null +++ b/tests/trig/example1.out @@ -0,0 +1,15 @@ + "Monica Murphy" . + . + . + . + . + . + _:w1 . +_:w1 . +_:w1 "2003-10-02"^^ . + _:w2 . + _:w2 . +_:w2 "2003-09-03"^^ . +_:w2 . + . + . diff --git a/tests/trig/example1.trig b/tests/trig/example1.trig new file mode 100644 index 0000000..b189e63 --- /dev/null +++ b/tests/trig/example1.trig @@ -0,0 +1,29 @@ + + +# TriG Example Document 1 +# This document encodes three graphs. + +@prefix rdf: . +@prefix xsd: . +@prefix swp: . +@prefix dc: . +@prefix ex: . +@prefix : . + +:G1 { :Monica ex:name "Monica Murphy" . + :Monica ex:homepage . + :Monica ex:email . + :Monica ex:hasSkill ex:Management } + +:G2 { :Monica rdf:type ex:Person . + :Monica ex:hasSkill ex:Programming } + +:G3 { :G1 swp:assertedBy _:w1 . + _:w1 swp:authority :Chris . + _:w1 dc:date "2003-10-02"^^xsd:date . + :G2 swp:quotedBy _:w2 . + :G3 swp:assertedBy _:w2 . + _:w2 dc:date "2003-09-03"^^xsd:date . + _:w2 swp:authority :Chris . + :Chris rdf:type ex:Person . + :Chris ex:email } diff --git a/tests/trig/example2.out b/tests/trig/example2.out new file mode 100644 index 0000000..e39a611 --- /dev/null +++ b/tests/trig/example2.out @@ -0,0 +1,6 @@ + . + "Monica Murphy" . + . + . + . + . diff --git a/tests/trig/example2.trig b/tests/trig/example2.trig new file mode 100644 index 0000000..7c5cd06 --- /dev/null +++ b/tests/trig/example2.trig @@ -0,0 +1,11 @@ +# TriG Example Document 2 + +@prefix ex: . +@prefix : . + +:G1 = { :Monica a ex:Person ; + ex:name "Monica Murphy" ; + ex:homepage ; + ex:email ; + ex:hasSkill ex:Management , + ex:Programming . } diff --git a/tests/trig/example3.out b/tests/trig/example3.out new file mode 100644 index 0000000..2289753 --- /dev/null +++ b/tests/trig/example3.out @@ -0,0 +1,6 @@ + "Bob" . + "Alice" . +_:a "Bob" . +_:a . +_:a "Alice" . +_:a . diff --git a/tests/trig/example3.trig b/tests/trig/example3.trig new file mode 100644 index 0000000..0ef71d3 --- /dev/null +++ b/tests/trig/example3.trig @@ -0,0 +1,26 @@ + + +# TriG Example Document 3 +# This document contains a default graph and two named graphs. + +@prefix rdf: . +@prefix dc: . +@prefix foaf: . + +# default graph + { + dc:publisher "Bob" . + dc:publisher "Alice" . + } + + + { + _:a foaf:name "Bob" . + _:a foaf:mbox . + } + + + { + _:a foaf:name "Alice" . + _:a foaf:mbox . + } diff --git a/tests/trig/issue-37.out b/tests/trig/issue-37.out new file mode 100644 index 0000000..68f216a --- /dev/null +++ b/tests/trig/issue-37.out @@ -0,0 +1,2 @@ +_:genid1 . +_:genid1 . diff --git a/tests/trig/issue-37.trig b/tests/trig/issue-37.trig new file mode 100644 index 0000000..93a3522 --- /dev/null +++ b/tests/trig/issue-37.trig @@ -0,0 +1 @@ + { [ a ] .} diff --git a/tests/turtle-2013/HYPHEN_MINUS_in_localName.nt b/tests/turtle-2013/HYPHEN_MINUS_in_localName.nt new file mode 100644 index 0000000..25546b3 --- /dev/null +++ b/tests/turtle-2013/HYPHEN_MINUS_in_localName.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/HYPHEN_MINUS_in_localName.ttl b/tests/turtle-2013/HYPHEN_MINUS_in_localName.ttl new file mode 100644 index 0000000..0340b8c --- /dev/null +++ b/tests/turtle-2013/HYPHEN_MINUS_in_localName.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:s- . diff --git a/tests/turtle-2013/IRIREF_datatype.nt b/tests/turtle-2013/IRIREF_datatype.nt new file mode 100644 index 0000000..c333a5f --- /dev/null +++ b/tests/turtle-2013/IRIREF_datatype.nt @@ -0,0 +1 @@ + "1"^^ . diff --git a/tests/turtle-2013/IRIREF_datatype.ttl b/tests/turtle-2013/IRIREF_datatype.ttl new file mode 100644 index 0000000..c333a5f --- /dev/null +++ b/tests/turtle-2013/IRIREF_datatype.ttl @@ -0,0 +1 @@ + "1"^^ . diff --git a/tests/turtle-2013/IRI_spo.nt b/tests/turtle-2013/IRI_spo.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/IRI_spo.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/IRI_subject.nt b/tests/turtle-2013/IRI_subject.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/IRI_subject.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/IRI_subject.ttl b/tests/turtle-2013/IRI_subject.ttl new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/IRI_subject.ttl @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/IRI_with_all_punctuation.nt b/tests/turtle-2013/IRI_with_all_punctuation.nt new file mode 100644 index 0000000..9415877 --- /dev/null +++ b/tests/turtle-2013/IRI_with_all_punctuation.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/IRI_with_all_punctuation.ttl b/tests/turtle-2013/IRI_with_all_punctuation.ttl new file mode 100644 index 0000000..9415877 --- /dev/null +++ b/tests/turtle-2013/IRI_with_all_punctuation.ttl @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/IRI_with_eight_digit_numeric_escape.nt b/tests/turtle-2013/IRI_with_eight_digit_numeric_escape.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/IRI_with_eight_digit_numeric_escape.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/IRI_with_eight_digit_numeric_escape.ttl b/tests/turtle-2013/IRI_with_eight_digit_numeric_escape.ttl new file mode 100644 index 0000000..434034e --- /dev/null +++ b/tests/turtle-2013/IRI_with_eight_digit_numeric_escape.ttl @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/IRI_with_four_digit_numeric_escape.nt b/tests/turtle-2013/IRI_with_four_digit_numeric_escape.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/IRI_with_four_digit_numeric_escape.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/IRI_with_four_digit_numeric_escape.ttl b/tests/turtle-2013/IRI_with_four_digit_numeric_escape.ttl new file mode 100644 index 0000000..4163636 --- /dev/null +++ b/tests/turtle-2013/IRI_with_four_digit_numeric_escape.ttl @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/LITERAL1.nt b/tests/turtle-2013/LITERAL1.nt new file mode 100644 index 0000000..3aba89e --- /dev/null +++ b/tests/turtle-2013/LITERAL1.nt @@ -0,0 +1 @@ + "x" . diff --git a/tests/turtle-2013/LITERAL1.ttl b/tests/turtle-2013/LITERAL1.ttl new file mode 100644 index 0000000..725a240 --- /dev/null +++ b/tests/turtle-2013/LITERAL1.ttl @@ -0,0 +1 @@ + 'x' . diff --git a/tests/turtle-2013/LITERAL1_all_controls.nt b/tests/turtle-2013/LITERAL1_all_controls.nt new file mode 100644 index 0000000..91c8af1 --- /dev/null +++ b/tests/turtle-2013/LITERAL1_all_controls.nt @@ -0,0 +1 @@ + "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\t\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F" . diff --git a/tests/turtle-2013/LITERAL1_all_controls.ttl b/tests/turtle-2013/LITERAL1_all_controls.ttl new file mode 100644 index 0000000..dbf3721 Binary files /dev/null and b/tests/turtle-2013/LITERAL1_all_controls.ttl differ diff --git a/tests/turtle-2013/LITERAL1_all_punctuation.nt b/tests/turtle-2013/LITERAL1_all_punctuation.nt new file mode 100644 index 0000000..c25d818 --- /dev/null +++ b/tests/turtle-2013/LITERAL1_all_punctuation.nt @@ -0,0 +1 @@ + " !\"#$%&():;<=>?@[]^_`{|}~" . diff --git a/tests/turtle-2013/LITERAL1_all_punctuation.ttl b/tests/turtle-2013/LITERAL1_all_punctuation.ttl new file mode 100644 index 0000000..7b1d9e5 --- /dev/null +++ b/tests/turtle-2013/LITERAL1_all_punctuation.ttl @@ -0,0 +1 @@ + ' !"#$%&():;<=>?@[]^_`{|}~' . diff --git a/tests/turtle-2013/LITERAL1_ascii_boundaries.nt b/tests/turtle-2013/LITERAL1_ascii_boundaries.nt new file mode 100644 index 0000000..69c4144 --- /dev/null +++ b/tests/turtle-2013/LITERAL1_ascii_boundaries.nt @@ -0,0 +1 @@ + "\u0000\t\u000B\u000C\u000E&([]\u007F" . diff --git a/tests/turtle-2013/LITERAL1_ascii_boundaries.ttl b/tests/turtle-2013/LITERAL1_ascii_boundaries.ttl new file mode 100644 index 0000000..7d65396 Binary files /dev/null and b/tests/turtle-2013/LITERAL1_ascii_boundaries.ttl differ diff --git a/tests/turtle-2013/LITERAL1_with_UTF8_boundaries.nt b/tests/turtle-2013/LITERAL1_with_UTF8_boundaries.nt new file mode 100644 index 0000000..47a2527 --- /dev/null +++ b/tests/turtle-2013/LITERAL1_with_UTF8_boundaries.nt @@ -0,0 +1 @@ + "\u0080\u07FF\u0800\u0FFF\u1000\uCFFF\uD000\uD7FF\uE000\uFFFD\U00010000\U0003FFFD\U00040000\U000FFFFD\U00100000\U0010FFFD" . diff --git a/tests/turtle-2013/LITERAL1_with_UTF8_boundaries.ttl b/tests/turtle-2013/LITERAL1_with_UTF8_boundaries.ttl new file mode 100644 index 0000000..b72eb04 --- /dev/null +++ b/tests/turtle-2013/LITERAL1_with_UTF8_boundaries.ttl @@ -0,0 +1 @@ + '€߿ࠀ࿿က쿿퀀퟿�𐀀𿿽񀀀󿿽􀀀􏿽' . diff --git a/tests/turtle-2013/LITERAL2.nt b/tests/turtle-2013/LITERAL2.nt new file mode 100644 index 0000000..3aba89e --- /dev/null +++ b/tests/turtle-2013/LITERAL2.nt @@ -0,0 +1 @@ + "x" . diff --git a/tests/turtle-2013/LITERAL2.ttl b/tests/turtle-2013/LITERAL2.ttl new file mode 100644 index 0000000..3aba89e --- /dev/null +++ b/tests/turtle-2013/LITERAL2.ttl @@ -0,0 +1 @@ + "x" . diff --git a/tests/turtle-2013/LITERAL2_ascii_boundaries.nt b/tests/turtle-2013/LITERAL2_ascii_boundaries.nt new file mode 100644 index 0000000..270a51e --- /dev/null +++ b/tests/turtle-2013/LITERAL2_ascii_boundaries.nt @@ -0,0 +1 @@ + "\u0000\t\u000B\u000C\u000E!#[]\u007F" . diff --git a/tests/turtle-2013/LITERAL2_ascii_boundaries.ttl b/tests/turtle-2013/LITERAL2_ascii_boundaries.ttl new file mode 100644 index 0000000..90b4cd6 Binary files /dev/null and b/tests/turtle-2013/LITERAL2_ascii_boundaries.ttl differ diff --git a/tests/turtle-2013/LITERAL2_with_UTF8_boundaries.nt b/tests/turtle-2013/LITERAL2_with_UTF8_boundaries.nt new file mode 100644 index 0000000..47a2527 --- /dev/null +++ b/tests/turtle-2013/LITERAL2_with_UTF8_boundaries.nt @@ -0,0 +1 @@ + "\u0080\u07FF\u0800\u0FFF\u1000\uCFFF\uD000\uD7FF\uE000\uFFFD\U00010000\U0003FFFD\U00040000\U000FFFFD\U00100000\U0010FFFD" . diff --git a/tests/turtle-2013/LITERAL2_with_UTF8_boundaries.ttl b/tests/turtle-2013/LITERAL2_with_UTF8_boundaries.ttl new file mode 100644 index 0000000..0e1616d --- /dev/null +++ b/tests/turtle-2013/LITERAL2_with_UTF8_boundaries.ttl @@ -0,0 +1 @@ + "€߿ࠀ࿿က쿿퀀퟿�𐀀𿿽񀀀󿿽􀀀􏿽" . diff --git a/tests/turtle-2013/LITERAL_LONG1.nt b/tests/turtle-2013/LITERAL_LONG1.nt new file mode 100644 index 0000000..3aba89e --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1.nt @@ -0,0 +1 @@ + "x" . diff --git a/tests/turtle-2013/LITERAL_LONG1.ttl b/tests/turtle-2013/LITERAL_LONG1.ttl new file mode 100644 index 0000000..ab6baa9 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1.ttl @@ -0,0 +1 @@ + '''x''' . diff --git a/tests/turtle-2013/LITERAL_LONG1_ascii_boundaries.nt b/tests/turtle-2013/LITERAL_LONG1_ascii_boundaries.nt new file mode 100644 index 0000000..a592b4a --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1_ascii_boundaries.nt @@ -0,0 +1 @@ + "\u0000&([]\u007F" . diff --git a/tests/turtle-2013/LITERAL_LONG1_ascii_boundaries.ttl b/tests/turtle-2013/LITERAL_LONG1_ascii_boundaries.ttl new file mode 100644 index 0000000..f943e24 Binary files /dev/null and b/tests/turtle-2013/LITERAL_LONG1_ascii_boundaries.ttl differ diff --git a/tests/turtle-2013/LITERAL_LONG1_with_1_squote.nt b/tests/turtle-2013/LITERAL_LONG1_with_1_squote.nt new file mode 100644 index 0000000..acf7f58 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1_with_1_squote.nt @@ -0,0 +1 @@ + "x'y" . diff --git a/tests/turtle-2013/LITERAL_LONG1_with_1_squote.ttl b/tests/turtle-2013/LITERAL_LONG1_with_1_squote.ttl new file mode 100644 index 0000000..3b93046 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1_with_1_squote.ttl @@ -0,0 +1 @@ + '''x'y''' . diff --git a/tests/turtle-2013/LITERAL_LONG1_with_2_squotes.nt b/tests/turtle-2013/LITERAL_LONG1_with_2_squotes.nt new file mode 100644 index 0000000..8ddc52e --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1_with_2_squotes.nt @@ -0,0 +1 @@ + "x''y" . diff --git a/tests/turtle-2013/LITERAL_LONG1_with_2_squotes.ttl b/tests/turtle-2013/LITERAL_LONG1_with_2_squotes.ttl new file mode 100644 index 0000000..1219bad --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1_with_2_squotes.ttl @@ -0,0 +1 @@ + '''x''y''' . diff --git a/tests/turtle-2013/LITERAL_LONG1_with_UTF8_boundaries.nt b/tests/turtle-2013/LITERAL_LONG1_with_UTF8_boundaries.nt new file mode 100644 index 0000000..47a2527 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1_with_UTF8_boundaries.nt @@ -0,0 +1 @@ + "\u0080\u07FF\u0800\u0FFF\u1000\uCFFF\uD000\uD7FF\uE000\uFFFD\U00010000\U0003FFFD\U00040000\U000FFFFD\U00100000\U0010FFFD" . diff --git a/tests/turtle-2013/LITERAL_LONG1_with_UTF8_boundaries.ttl b/tests/turtle-2013/LITERAL_LONG1_with_UTF8_boundaries.ttl new file mode 100644 index 0000000..e04b675 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG1_with_UTF8_boundaries.ttl @@ -0,0 +1 @@ + '''€߿ࠀ࿿က쿿퀀퟿�𐀀𿿽񀀀󿿽􀀀􏿽''' . diff --git a/tests/turtle-2013/LITERAL_LONG2.nt b/tests/turtle-2013/LITERAL_LONG2.nt new file mode 100644 index 0000000..3aba89e --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2.nt @@ -0,0 +1 @@ + "x" . diff --git a/tests/turtle-2013/LITERAL_LONG2.ttl b/tests/turtle-2013/LITERAL_LONG2.ttl new file mode 100644 index 0000000..e37bf4a --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2.ttl @@ -0,0 +1 @@ + """x""" . diff --git a/tests/turtle-2013/LITERAL_LONG2_ascii_boundaries.nt b/tests/turtle-2013/LITERAL_LONG2_ascii_boundaries.nt new file mode 100644 index 0000000..2878503 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_ascii_boundaries.nt @@ -0,0 +1 @@ + "\u0000!#[]\u007F" . diff --git a/tests/turtle-2013/LITERAL_LONG2_ascii_boundaries.ttl b/tests/turtle-2013/LITERAL_LONG2_ascii_boundaries.ttl new file mode 100644 index 0000000..e919865 Binary files /dev/null and b/tests/turtle-2013/LITERAL_LONG2_ascii_boundaries.ttl differ diff --git a/tests/turtle-2013/LITERAL_LONG2_with_1_squote.nt b/tests/turtle-2013/LITERAL_LONG2_with_1_squote.nt new file mode 100644 index 0000000..05a1fd3 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_with_1_squote.nt @@ -0,0 +1 @@ + "x\"y" . diff --git a/tests/turtle-2013/LITERAL_LONG2_with_1_squote.ttl b/tests/turtle-2013/LITERAL_LONG2_with_1_squote.ttl new file mode 100644 index 0000000..80e389b --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_with_1_squote.ttl @@ -0,0 +1 @@ + """x"y""" . diff --git a/tests/turtle-2013/LITERAL_LONG2_with_2_squotes.nt b/tests/turtle-2013/LITERAL_LONG2_with_2_squotes.nt new file mode 100644 index 0000000..3e69dc1 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_with_2_squotes.nt @@ -0,0 +1 @@ + "x\"\"y" . diff --git a/tests/turtle-2013/LITERAL_LONG2_with_2_squotes.ttl b/tests/turtle-2013/LITERAL_LONG2_with_2_squotes.ttl new file mode 100644 index 0000000..2f14f5b --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_with_2_squotes.ttl @@ -0,0 +1 @@ + """x""y""" . diff --git a/tests/turtle-2013/LITERAL_LONG2_with_REVERSE_SOLIDUS.nt b/tests/turtle-2013/LITERAL_LONG2_with_REVERSE_SOLIDUS.nt new file mode 100644 index 0000000..586e364 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_with_REVERSE_SOLIDUS.nt @@ -0,0 +1 @@ + "test-\\" . diff --git a/tests/turtle-2013/LITERAL_LONG2_with_REVERSE_SOLIDUS.ttl b/tests/turtle-2013/LITERAL_LONG2_with_REVERSE_SOLIDUS.ttl new file mode 100644 index 0000000..2206e33 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_with_REVERSE_SOLIDUS.ttl @@ -0,0 +1,3 @@ +@prefix : . + +:s :p1 """test-\\""" . diff --git a/tests/turtle-2013/LITERAL_LONG2_with_UTF8_boundaries.nt b/tests/turtle-2013/LITERAL_LONG2_with_UTF8_boundaries.nt new file mode 100644 index 0000000..47a2527 --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_with_UTF8_boundaries.nt @@ -0,0 +1 @@ + "\u0080\u07FF\u0800\u0FFF\u1000\uCFFF\uD000\uD7FF\uE000\uFFFD\U00010000\U0003FFFD\U00040000\U000FFFFD\U00100000\U0010FFFD" . diff --git a/tests/turtle-2013/LITERAL_LONG2_with_UTF8_boundaries.ttl b/tests/turtle-2013/LITERAL_LONG2_with_UTF8_boundaries.ttl new file mode 100644 index 0000000..644b32d --- /dev/null +++ b/tests/turtle-2013/LITERAL_LONG2_with_UTF8_boundaries.ttl @@ -0,0 +1 @@ + """€߿ࠀ࿿က쿿퀀퟿�𐀀𿿽񀀀󿿽􀀀􏿽""" . diff --git a/tests/turtle-2013/LITERAL_with_UTF8_boundaries.nt b/tests/turtle-2013/LITERAL_with_UTF8_boundaries.nt new file mode 100644 index 0000000..47a2527 --- /dev/null +++ b/tests/turtle-2013/LITERAL_with_UTF8_boundaries.nt @@ -0,0 +1 @@ + "\u0080\u07FF\u0800\u0FFF\u1000\uCFFF\uD000\uD7FF\uE000\uFFFD\U00010000\U0003FFFD\U00040000\U000FFFFD\U00100000\U0010FFFD" . diff --git a/tests/turtle-2013/Makefile.am b/tests/turtle-2013/Makefile.am new file mode 100644 index 0000000..3683000 --- /dev/null +++ b/tests/turtle-2013/Makefile.am @@ -0,0 +1,603 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor Turtle 2013 tests +# +# Copyright (C) 2013, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +RDFCOMPARE=$(srcdir)/../../scripts/rdfcompare + +RDFXML_DIR = ../rdfxml +NTRIPLES_DIR = ../ntriples + +TEST_GOOD_FILES = \ + turtle-syntax-file-01.ttl \ + turtle-syntax-file-02.ttl \ + turtle-syntax-file-03.ttl \ + turtle-syntax-uri-01.ttl \ + turtle-syntax-uri-02.ttl \ + turtle-syntax-uri-03.ttl \ + turtle-syntax-uri-04.ttl \ + turtle-syntax-base-01.ttl \ + turtle-syntax-base-02.ttl \ + turtle-syntax-base-03.ttl \ + turtle-syntax-base-04.ttl \ + turtle-syntax-prefix-01.ttl \ + turtle-syntax-prefix-02.ttl \ + turtle-syntax-prefix-03.ttl \ + turtle-syntax-prefix-04.ttl \ + turtle-syntax-prefix-05.ttl \ + turtle-syntax-prefix-06.ttl \ + turtle-syntax-prefix-07.ttl \ + turtle-syntax-prefix-08.ttl \ + turtle-syntax-prefix-09.ttl \ + turtle-syntax-string-01.ttl \ + turtle-syntax-string-02.ttl \ + turtle-syntax-string-03.ttl \ + turtle-syntax-string-04.ttl \ + turtle-syntax-string-05.ttl \ + turtle-syntax-string-06.ttl \ + turtle-syntax-string-07.ttl \ + turtle-syntax-string-08.ttl \ + turtle-syntax-string-09.ttl \ + turtle-syntax-string-10.ttl \ + turtle-syntax-string-11.ttl \ + turtle-syntax-str-esc-01.ttl \ + turtle-syntax-str-esc-02.ttl \ + turtle-syntax-str-esc-03.ttl \ + turtle-syntax-pname-esc-01.ttl \ + turtle-syntax-pname-esc-02.ttl \ + turtle-syntax-pname-esc-03.ttl \ + turtle-syntax-bnode-01.ttl \ + turtle-syntax-bnode-02.ttl \ + turtle-syntax-bnode-03.ttl \ + turtle-syntax-bnode-04.ttl \ + turtle-syntax-bnode-05.ttl \ + turtle-syntax-bnode-06.ttl \ + turtle-syntax-bnode-07.ttl \ + turtle-syntax-bnode-08.ttl \ + turtle-syntax-bnode-09.ttl \ + turtle-syntax-bnode-10.ttl \ + turtle-syntax-number-01.ttl \ + turtle-syntax-number-02.ttl \ + turtle-syntax-number-03.ttl \ + turtle-syntax-number-04.ttl \ + turtle-syntax-number-05.ttl \ + turtle-syntax-number-06.ttl \ + turtle-syntax-number-07.ttl \ + turtle-syntax-number-08.ttl \ + turtle-syntax-number-09.ttl \ + turtle-syntax-number-10.ttl \ + turtle-syntax-number-11.ttl \ + turtle-syntax-datatypes-01.ttl \ + turtle-syntax-datatypes-02.ttl \ + turtle-syntax-kw-01.ttl \ + turtle-syntax-kw-02.ttl \ + turtle-syntax-kw-03.ttl \ + turtle-syntax-struct-01.ttl \ + turtle-syntax-struct-02.ttl \ + turtle-syntax-struct-03.ttl \ + turtle-syntax-struct-04.ttl \ + turtle-syntax-struct-05.ttl \ + turtle-syntax-lists-01.ttl \ + turtle-syntax-lists-02.ttl \ + turtle-syntax-lists-03.ttl \ + turtle-syntax-lists-04.ttl \ + turtle-syntax-lists-05.ttl \ + turtle-syntax-ln-dots.ttl \ + turtle-syntax-ln-colons.ttl \ + turtle-syntax-ns-dots.ttl \ + turtle-syntax-blank-label.ttl + +TEST_BAD_FILES = \ + turtle-syntax-bad-uri-01.ttl \ + turtle-syntax-bad-uri-02.ttl \ + turtle-syntax-bad-uri-03.ttl \ + turtle-syntax-bad-uri-04.ttl \ + turtle-syntax-bad-uri-05.ttl \ + turtle-syntax-bad-prefix-01.ttl \ + turtle-syntax-bad-prefix-02.ttl \ + turtle-syntax-bad-prefix-03.ttl \ + turtle-syntax-bad-prefix-04.ttl \ + turtle-syntax-bad-prefix-05.ttl \ + turtle-syntax-bad-base-01.ttl \ + turtle-syntax-bad-base-02.ttl \ + turtle-syntax-bad-base-03.ttl \ + turtle-syntax-bad-struct-01.ttl \ + turtle-syntax-bad-struct-02.ttl \ + turtle-syntax-bad-struct-03.ttl \ + turtle-syntax-bad-struct-04.ttl \ + turtle-syntax-bad-struct-05.ttl \ + turtle-syntax-bad-struct-06.ttl \ + turtle-syntax-bad-struct-07.ttl \ + turtle-syntax-bad-kw-01.ttl \ + turtle-syntax-bad-kw-02.ttl \ + turtle-syntax-bad-kw-03.ttl \ + turtle-syntax-bad-kw-04.ttl \ + turtle-syntax-bad-kw-05.ttl \ + turtle-syntax-bad-n3-extras-01.ttl \ + turtle-syntax-bad-n3-extras-02.ttl \ + turtle-syntax-bad-n3-extras-03.ttl \ + turtle-syntax-bad-n3-extras-04.ttl \ + turtle-syntax-bad-n3-extras-05.ttl \ + turtle-syntax-bad-n3-extras-06.ttl \ + turtle-syntax-bad-n3-extras-07.ttl \ + turtle-syntax-bad-n3-extras-08.ttl \ + turtle-syntax-bad-n3-extras-09.ttl \ + turtle-syntax-bad-n3-extras-10.ttl \ + turtle-syntax-bad-n3-extras-11.ttl \ + turtle-syntax-bad-n3-extras-12.ttl \ + turtle-syntax-bad-n3-extras-13.ttl \ + turtle-syntax-bad-struct-08.ttl \ + turtle-syntax-bad-struct-09.ttl \ + turtle-syntax-bad-struct-10.ttl \ + turtle-syntax-bad-struct-11.ttl \ + turtle-syntax-bad-struct-12.ttl \ + turtle-syntax-bad-struct-13.ttl \ + turtle-syntax-bad-struct-14.ttl \ + turtle-syntax-bad-struct-15.ttl \ + turtle-syntax-bad-struct-16.ttl \ + turtle-syntax-bad-struct-17.ttl \ + turtle-syntax-bad-lang-01.ttl \ + turtle-syntax-bad-esc-01.ttl \ + turtle-syntax-bad-esc-02.ttl \ + turtle-syntax-bad-esc-03.ttl \ + turtle-syntax-bad-esc-04.ttl \ + turtle-syntax-bad-pname-01.ttl \ + turtle-syntax-bad-pname-02.ttl \ + turtle-syntax-bad-pname-03.ttl \ + turtle-syntax-bad-string-01.ttl \ + turtle-syntax-bad-string-02.ttl \ + turtle-syntax-bad-string-03.ttl \ + turtle-syntax-bad-string-04.ttl \ + turtle-syntax-bad-string-05.ttl \ + turtle-syntax-bad-string-06.ttl \ + turtle-syntax-bad-string-07.ttl \ + turtle-syntax-bad-num-01.ttl \ + turtle-syntax-bad-num-02.ttl \ + turtle-syntax-bad-num-03.ttl \ + turtle-syntax-bad-num-04.ttl \ + turtle-syntax-bad-num-05.ttl \ + turtle-syntax-bad-LITERAL2_with_langtag_and_datatype.ttl \ + turtle-syntax-bad-blank-label-dot-end.ttl \ + turtle-syntax-bad-number-dot-in-anon.ttl \ + turtle-syntax-bad-ln-dash-start.ttl \ + turtle-syntax-bad-ln-escape.ttl \ + turtle-syntax-bad-ln-escape-start.ttl \ + turtle-syntax-bad-ns-dot-end.ttl \ + turtle-syntax-bad-ns-dot-start.ttl \ + turtle-syntax-bad-missing-ns-dot-end.ttl \ + turtle-syntax-bad-missing-ns-dot-start.ttl + +TEST_EVAL_FILES = \ + IRI_subject.ttl \ + IRI_with_four_digit_numeric_escape.ttl \ + IRI_with_eight_digit_numeric_escape.ttl \ + IRI_with_all_punctuation.ttl \ + bareword_a_predicate.ttl \ + old_style_prefix.ttl \ + SPARQL_style_prefix.ttl \ + prefixed_IRI_predicate.ttl \ + prefixed_IRI_object.ttl \ + prefix_only_IRI.ttl \ + prefix_with_PN_CHARS_BASE_character_boundaries.ttl \ + prefix_with_non_leading_extras.ttl \ + localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.ttl \ + localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.ttl \ + localName_with_nfc_PN_CHARS_BASE_character_boundaries.ttl \ + default_namespace_IRI.ttl \ + prefix_reassigned_and_used.ttl \ + reserved_escaped_localName.ttl \ + percent_escaped_localName.ttl \ + HYPHEN_MINUS_in_localName.ttl \ + underscore_in_localName.ttl \ + localname_with_COLON.ttl \ + localName_with_leading_underscore.ttl \ + localName_with_leading_digit.ttl \ + localName_with_non_leading_extras.ttl \ + old_style_base.ttl \ + SPARQL_style_base.ttl \ + labeled_blank_node_subject.ttl \ + labeled_blank_node_object.ttl \ + labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.ttl \ + labeled_blank_node_with_leading_underscore.ttl \ + labeled_blank_node_with_leading_digit.ttl \ + labeled_blank_node_with_non_leading_extras.ttl \ + anonymous_blank_node_subject.ttl \ + anonymous_blank_node_object.ttl \ + sole_blankNodePropertyList.ttl \ + blankNodePropertyList_as_subject.ttl \ + blankNodePropertyList_as_object.ttl \ + blankNodePropertyList_with_multiple_triples.ttl \ + nested_blankNodePropertyLists.ttl \ + blankNodePropertyList_containing_collection.ttl \ + collection_subject.ttl \ + collection_object.ttl \ + empty_collection.ttl \ + nested_collection.ttl \ + first.ttl \ + last.ttl \ + LITERAL1.ttl \ + LITERAL1_ascii_boundaries.ttl \ + LITERAL1_with_UTF8_boundaries.ttl \ + LITERAL1_all_controls.ttl \ + LITERAL1_all_punctuation.ttl \ + LITERAL_LONG1.ttl \ + LITERAL_LONG1_ascii_boundaries.ttl \ + LITERAL_LONG1_with_UTF8_boundaries.ttl \ + LITERAL_LONG1_with_1_squote.ttl \ + LITERAL_LONG1_with_2_squotes.ttl \ + LITERAL2.ttl \ + LITERAL2_ascii_boundaries.ttl \ + LITERAL2_with_UTF8_boundaries.ttl \ + LITERAL_LONG2.ttl \ + LITERAL_LONG2_ascii_boundaries.ttl \ + LITERAL_LONG2_with_UTF8_boundaries.ttl \ + LITERAL_LONG2_with_1_squote.ttl \ + LITERAL_LONG2_with_2_squotes.ttl \ + literal_with_CHARACTER_TABULATION.ttl \ + literal_with_BACKSPACE.ttl \ + literal_with_LINE_FEED.ttl \ + literal_with_CARRIAGE_RETURN.ttl \ + literal_with_FORM_FEED.ttl \ + literal_with_REVERSE_SOLIDUS.ttl \ + literal_with_escaped_CHARACTER_TABULATION.ttl \ + literal_with_escaped_BACKSPACE.ttl \ + literal_with_escaped_LINE_FEED.ttl \ + literal_with_escaped_CARRIAGE_RETURN.ttl \ + literal_with_escaped_FORM_FEED.ttl \ + literal_with_numeric_escape4.ttl \ + literal_with_numeric_escape8.ttl \ + IRIREF_datatype.ttl \ + prefixed_name_datatype.ttl \ + bareword_integer.ttl \ + bareword_decimal.ttl \ + bareword_double.ttl \ + double_lower_case_e.ttl \ + negative_numeric.ttl \ + positive_numeric.ttl \ + numeric_with_leading_0.ttl \ + literal_true.ttl \ + literal_false.ttl \ + langtagged_non_LONG.ttl \ + langtagged_LONG.ttl \ + lantag_with_subtag.ttl \ + objectList_with_two_objects.ttl \ + predicateObjectList_with_two_objectLists.ttl \ + repeated_semis_at_end.ttl \ + repeated_semis_not_at_end.ttl \ + turtle-eval-struct-01.ttl \ + turtle-eval-struct-02.ttl \ + turtle-subm-01.ttl \ + turtle-subm-02.ttl \ + turtle-subm-03.ttl \ + turtle-subm-04.ttl \ + turtle-subm-05.ttl \ + turtle-subm-06.ttl \ + turtle-subm-07.ttl \ + turtle-subm-08.ttl \ + turtle-subm-09.ttl \ + turtle-subm-10.ttl \ + turtle-subm-11.ttl \ + turtle-subm-12.ttl \ + turtle-subm-13.ttl \ + turtle-subm-14.ttl \ + turtle-subm-15.ttl \ + turtle-subm-16.ttl \ + turtle-subm-17.ttl \ + turtle-subm-18.ttl \ + turtle-subm-19.ttl \ + turtle-subm-20.ttl \ + turtle-subm-21.ttl \ + turtle-subm-22.ttl \ + turtle-subm-23.ttl \ + turtle-subm-24.ttl \ + turtle-subm-25.ttl \ + turtle-subm-26.ttl \ + turtle-subm-27.ttl \ + comment_following_localName.ttl \ + number_sign_following_localName.ttl \ + comment_following_PNAME_NS.ttl \ + number_sign_following_PNAME_NS.ttl \ + LITERAL_LONG2_with_REVERSE_SOLIDUS.ttl \ + two_LITERAL_LONG2s.ttl \ + langtagged_LONG_with_subtag.ttl \ + oops.ttl + +TEST_BAD_EVAL_FILES = \ + turtle-eval-bad-01.ttl \ + turtle-eval-bad-02.ttl \ + turtle-eval-bad-03.ttl \ + turtle-eval-bad-04.ttl + +TEST_OUT_FILES = \ + HYPHEN_MINUS_in_localName.nt \ + IRIREF_datatype.nt \ + IRI_spo.nt \ + IRI_subject.nt \ + IRI_with_all_punctuation.nt \ + IRI_with_eight_digit_numeric_escape.nt \ + IRI_with_four_digit_numeric_escape.nt \ + LITERAL1.nt \ + LITERAL1_all_controls.nt \ + LITERAL1_all_punctuation.nt \ + LITERAL1_ascii_boundaries.nt \ + LITERAL1_with_UTF8_boundaries.nt \ + LITERAL2.nt \ + LITERAL2_ascii_boundaries.nt \ + LITERAL2_with_UTF8_boundaries.nt \ + LITERAL_LONG1.nt \ + LITERAL_LONG1_ascii_boundaries.nt \ + LITERAL_LONG1_with_1_squote.nt \ + LITERAL_LONG1_with_2_squotes.nt \ + LITERAL_LONG1_with_UTF8_boundaries.nt \ + LITERAL_LONG2.nt \ + LITERAL_LONG2_ascii_boundaries.nt \ + LITERAL_LONG2_with_1_squote.nt \ + LITERAL_LONG2_with_2_squotes.nt \ + LITERAL_LONG2_with_REVERSE_SOLIDUS.nt \ + LITERAL_LONG2_with_UTF8_boundaries.nt \ + LITERAL_with_UTF8_boundaries.nt \ + SPARQL_style_base.nt \ + SPARQL_style_prefix.nt \ + anonymous_blank_node_object.nt \ + anonymous_blank_node_subject.nt \ + bareword_a_predicate.nt \ + bareword_decimal.nt \ + bareword_double.nt \ + bareword_integer.nt \ + blankNodePropertyList_as_object.nt \ + blankNodePropertyList_as_subject.nt \ + blankNodePropertyList_containing_collection.nt \ + blankNodePropertyList_with_multiple_triples.nt \ + collection_object.nt \ + collection_subject.nt \ + comment_following_PNAME_NS.nt \ + comment_following_localName.nt \ + default_namespace_IRI.nt \ + double_lower_case_e.nt \ + empty_collection.nt \ + first.nt \ + labeled_blank_node_object.nt \ + labeled_blank_node_subject.nt \ + labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.nt \ + labeled_blank_node_with_leading_digit.nt \ + labeled_blank_node_with_leading_underscore.nt \ + labeled_blank_node_with_non_leading_extras.nt \ + langtagged_LONG.nt \ + langtagged_LONG_with_subtag.nt \ + langtagged_non_LONG.nt \ + lantag_with_subtag.nt \ + last.nt \ + literal_false.nt \ + literal_true.nt \ + literal_with_BACKSPACE.nt \ + literal_with_CARRIAGE_RETURN.nt \ + literal_with_CHARACTER_TABULATION.nt \ + literal_with_FORM_FEED.nt \ + literal_with_LINE_FEED.nt \ + literal_with_REVERSE_SOLIDUS.nt \ + literal_with_escaped_BACKSPACE.nt \ + literal_with_escaped_CARRIAGE_RETURN.nt \ + literal_with_escaped_CHARACTER_TABULATION.nt \ + literal_with_escaped_FORM_FEED.nt \ + literal_with_escaped_LINE_FEED.nt \ + literal_with_numeric_escape4.nt \ + literal_with_numeric_escape8.nt \ + localName_with_PN_CHARS_BASE_character_boundaries.nt \ + localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.nt \ + localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.nt \ + localName_with_leading_digit.nt \ + localName_with_leading_underscore.nt \ + localName_with_nfc_PN_CHARS_BASE_character_boundaries.nt \ + localName_with_non_leading_extras.nt \ + localname_with_COLON.nt \ + negative_numeric.nt \ + nested_blankNodePropertyLists.nt \ + nested_collection.nt \ + number_sign_following_PNAME_NS.nt \ + number_sign_following_localName.nt \ + numeric_with_leading_0.nt \ + objectList_with_two_objects.nt \ + old_style_base.nt \ + old_style_prefix.nt \ + percent_escaped_localName.nt \ + positive_numeric.nt \ + predicateObjectList_with_two_objectLists.nt \ + prefix_only_IRI.nt \ + prefix_reassigned_and_used.nt \ + prefix_with_PN_CHARS_BASE_character_boundaries.nt \ + prefix_with_non_leading_extras.nt \ + prefixed_IRI_object.nt \ + prefixed_IRI_predicate.nt \ + prefixed_name_datatype.nt \ + repeated_semis_at_end.nt \ + repeated_semis_not_at_end.nt \ + reserved_escaped_localName.nt \ + sole_blankNodePropertyList.nt \ + turtle-eval-struct-01.nt \ + turtle-eval-struct-02.nt \ + turtle-subm-01.nt \ + turtle-subm-02.nt \ + turtle-subm-03.nt \ + turtle-subm-04.nt \ + turtle-subm-05.nt \ + turtle-subm-06.nt \ + turtle-subm-07.nt \ + turtle-subm-08.nt \ + turtle-subm-09.nt \ + turtle-subm-10.nt \ + turtle-subm-11.nt \ + turtle-subm-12.nt \ + turtle-subm-13.nt \ + turtle-subm-14.nt \ + turtle-subm-15.nt \ + turtle-subm-16.nt \ + turtle-subm-17.nt \ + turtle-subm-18.nt \ + turtle-subm-19.nt \ + turtle-subm-20.nt \ + turtle-subm-21.nt \ + turtle-subm-22.nt \ + turtle-subm-23.nt \ + turtle-subm-24.nt \ + turtle-subm-25.nt \ + turtle-subm-26.nt \ + turtle-subm-27.nt \ + turtle-syntax-blank-label.nt \ + turtle-syntax-ln-colons.nt \ + turtle-syntax-ln-dots.nt \ + two_LITERAL_LONG2s.nt \ + underscore_in_localName.nt \ + oops.nt + +# Used to make N-triples output consistent +BASE_URI=http://www.w3.org/2013/TurtleTests/ +# for rdf-schema.ttl +RDF_NS_URI=http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI=http://www.w3.org/2000/01/rdf-schema + +ALL_TEST_FILES= README \ + $(TEST_GOOD_FILES) \ + $(TEST_BAD_FILES) \ + $(TEST_EVAL_FILES) \ + $(TEST_BAD_EVAL_FILES) \ + $(TEST_OUT_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-good-turtle check-bad-turtle check-eval-turtle + +if MAINTAINER_MODE +check_good_turtle_deps = $(TEST_GOOD_FILES) +endif + +check-good-turtle: build-rapper $(check_good_turtle_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing good Turtle syntax passes"; \ + for test in $(TEST_GOOD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + $(RECHO) "Result: $$errors errors: $$failures"; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_bad_turtle_deps = $(TEST_BAD_FILES) $(TEST_BAD_EVAL_FILES) +endif + +check-bad-turtle: build-rapper $(check_bad_turtle_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing bad Turtle fails"; \ + for test in $(TEST_BAD_FILES) $(TEST_BAD_EVAL_FILES) ; do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + $(RECHO) "Result: $$errors errors: $$failures"; \ + set -e; exit $$result + + +if MAINTAINER_MODE +check_eval_turtle_deps = $(TEST_EVAL_FILES) +endif + +check-eval-turtle: build-rapper $(check_eval_turtle_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing eval Turtle"; \ + for test in $(TEST_EVAL_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$name.nt > $$name.nnt; \ + $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif $(RDFCOMPARE) $$name.nnt $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + diff $$name.nnt $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err $$name.nnt; \ + done; \ + $(RECHO) "Result: $$errors errors: $$failures"; \ + set -e; exit $$result diff --git a/tests/turtle-2013/Makefile.in b/tests/turtle-2013/Makefile.in new file mode 100644 index 0000000..dc8e7d6 --- /dev/null +++ b/tests/turtle-2013/Makefile.in @@ -0,0 +1,1083 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor Turtle 2013 tests +# +# Copyright (C) 2013, David Beckett http://www.dajobe.org/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/turtle-2013 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in README +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +RDFCOMPARE = $(srcdir)/../../scripts/rdfcompare +RDFXML_DIR = ../rdfxml +NTRIPLES_DIR = ../ntriples +TEST_GOOD_FILES = \ + turtle-syntax-file-01.ttl \ + turtle-syntax-file-02.ttl \ + turtle-syntax-file-03.ttl \ + turtle-syntax-uri-01.ttl \ + turtle-syntax-uri-02.ttl \ + turtle-syntax-uri-03.ttl \ + turtle-syntax-uri-04.ttl \ + turtle-syntax-base-01.ttl \ + turtle-syntax-base-02.ttl \ + turtle-syntax-base-03.ttl \ + turtle-syntax-base-04.ttl \ + turtle-syntax-prefix-01.ttl \ + turtle-syntax-prefix-02.ttl \ + turtle-syntax-prefix-03.ttl \ + turtle-syntax-prefix-04.ttl \ + turtle-syntax-prefix-05.ttl \ + turtle-syntax-prefix-06.ttl \ + turtle-syntax-prefix-07.ttl \ + turtle-syntax-prefix-08.ttl \ + turtle-syntax-prefix-09.ttl \ + turtle-syntax-string-01.ttl \ + turtle-syntax-string-02.ttl \ + turtle-syntax-string-03.ttl \ + turtle-syntax-string-04.ttl \ + turtle-syntax-string-05.ttl \ + turtle-syntax-string-06.ttl \ + turtle-syntax-string-07.ttl \ + turtle-syntax-string-08.ttl \ + turtle-syntax-string-09.ttl \ + turtle-syntax-string-10.ttl \ + turtle-syntax-string-11.ttl \ + turtle-syntax-str-esc-01.ttl \ + turtle-syntax-str-esc-02.ttl \ + turtle-syntax-str-esc-03.ttl \ + turtle-syntax-pname-esc-01.ttl \ + turtle-syntax-pname-esc-02.ttl \ + turtle-syntax-pname-esc-03.ttl \ + turtle-syntax-bnode-01.ttl \ + turtle-syntax-bnode-02.ttl \ + turtle-syntax-bnode-03.ttl \ + turtle-syntax-bnode-04.ttl \ + turtle-syntax-bnode-05.ttl \ + turtle-syntax-bnode-06.ttl \ + turtle-syntax-bnode-07.ttl \ + turtle-syntax-bnode-08.ttl \ + turtle-syntax-bnode-09.ttl \ + turtle-syntax-bnode-10.ttl \ + turtle-syntax-number-01.ttl \ + turtle-syntax-number-02.ttl \ + turtle-syntax-number-03.ttl \ + turtle-syntax-number-04.ttl \ + turtle-syntax-number-05.ttl \ + turtle-syntax-number-06.ttl \ + turtle-syntax-number-07.ttl \ + turtle-syntax-number-08.ttl \ + turtle-syntax-number-09.ttl \ + turtle-syntax-number-10.ttl \ + turtle-syntax-number-11.ttl \ + turtle-syntax-datatypes-01.ttl \ + turtle-syntax-datatypes-02.ttl \ + turtle-syntax-kw-01.ttl \ + turtle-syntax-kw-02.ttl \ + turtle-syntax-kw-03.ttl \ + turtle-syntax-struct-01.ttl \ + turtle-syntax-struct-02.ttl \ + turtle-syntax-struct-03.ttl \ + turtle-syntax-struct-04.ttl \ + turtle-syntax-struct-05.ttl \ + turtle-syntax-lists-01.ttl \ + turtle-syntax-lists-02.ttl \ + turtle-syntax-lists-03.ttl \ + turtle-syntax-lists-04.ttl \ + turtle-syntax-lists-05.ttl \ + turtle-syntax-ln-dots.ttl \ + turtle-syntax-ln-colons.ttl \ + turtle-syntax-ns-dots.ttl \ + turtle-syntax-blank-label.ttl + +TEST_BAD_FILES = \ + turtle-syntax-bad-uri-01.ttl \ + turtle-syntax-bad-uri-02.ttl \ + turtle-syntax-bad-uri-03.ttl \ + turtle-syntax-bad-uri-04.ttl \ + turtle-syntax-bad-uri-05.ttl \ + turtle-syntax-bad-prefix-01.ttl \ + turtle-syntax-bad-prefix-02.ttl \ + turtle-syntax-bad-prefix-03.ttl \ + turtle-syntax-bad-prefix-04.ttl \ + turtle-syntax-bad-prefix-05.ttl \ + turtle-syntax-bad-base-01.ttl \ + turtle-syntax-bad-base-02.ttl \ + turtle-syntax-bad-base-03.ttl \ + turtle-syntax-bad-struct-01.ttl \ + turtle-syntax-bad-struct-02.ttl \ + turtle-syntax-bad-struct-03.ttl \ + turtle-syntax-bad-struct-04.ttl \ + turtle-syntax-bad-struct-05.ttl \ + turtle-syntax-bad-struct-06.ttl \ + turtle-syntax-bad-struct-07.ttl \ + turtle-syntax-bad-kw-01.ttl \ + turtle-syntax-bad-kw-02.ttl \ + turtle-syntax-bad-kw-03.ttl \ + turtle-syntax-bad-kw-04.ttl \ + turtle-syntax-bad-kw-05.ttl \ + turtle-syntax-bad-n3-extras-01.ttl \ + turtle-syntax-bad-n3-extras-02.ttl \ + turtle-syntax-bad-n3-extras-03.ttl \ + turtle-syntax-bad-n3-extras-04.ttl \ + turtle-syntax-bad-n3-extras-05.ttl \ + turtle-syntax-bad-n3-extras-06.ttl \ + turtle-syntax-bad-n3-extras-07.ttl \ + turtle-syntax-bad-n3-extras-08.ttl \ + turtle-syntax-bad-n3-extras-09.ttl \ + turtle-syntax-bad-n3-extras-10.ttl \ + turtle-syntax-bad-n3-extras-11.ttl \ + turtle-syntax-bad-n3-extras-12.ttl \ + turtle-syntax-bad-n3-extras-13.ttl \ + turtle-syntax-bad-struct-08.ttl \ + turtle-syntax-bad-struct-09.ttl \ + turtle-syntax-bad-struct-10.ttl \ + turtle-syntax-bad-struct-11.ttl \ + turtle-syntax-bad-struct-12.ttl \ + turtle-syntax-bad-struct-13.ttl \ + turtle-syntax-bad-struct-14.ttl \ + turtle-syntax-bad-struct-15.ttl \ + turtle-syntax-bad-struct-16.ttl \ + turtle-syntax-bad-struct-17.ttl \ + turtle-syntax-bad-lang-01.ttl \ + turtle-syntax-bad-esc-01.ttl \ + turtle-syntax-bad-esc-02.ttl \ + turtle-syntax-bad-esc-03.ttl \ + turtle-syntax-bad-esc-04.ttl \ + turtle-syntax-bad-pname-01.ttl \ + turtle-syntax-bad-pname-02.ttl \ + turtle-syntax-bad-pname-03.ttl \ + turtle-syntax-bad-string-01.ttl \ + turtle-syntax-bad-string-02.ttl \ + turtle-syntax-bad-string-03.ttl \ + turtle-syntax-bad-string-04.ttl \ + turtle-syntax-bad-string-05.ttl \ + turtle-syntax-bad-string-06.ttl \ + turtle-syntax-bad-string-07.ttl \ + turtle-syntax-bad-num-01.ttl \ + turtle-syntax-bad-num-02.ttl \ + turtle-syntax-bad-num-03.ttl \ + turtle-syntax-bad-num-04.ttl \ + turtle-syntax-bad-num-05.ttl \ + turtle-syntax-bad-LITERAL2_with_langtag_and_datatype.ttl \ + turtle-syntax-bad-blank-label-dot-end.ttl \ + turtle-syntax-bad-number-dot-in-anon.ttl \ + turtle-syntax-bad-ln-dash-start.ttl \ + turtle-syntax-bad-ln-escape.ttl \ + turtle-syntax-bad-ln-escape-start.ttl \ + turtle-syntax-bad-ns-dot-end.ttl \ + turtle-syntax-bad-ns-dot-start.ttl \ + turtle-syntax-bad-missing-ns-dot-end.ttl \ + turtle-syntax-bad-missing-ns-dot-start.ttl + +TEST_EVAL_FILES = \ + IRI_subject.ttl \ + IRI_with_four_digit_numeric_escape.ttl \ + IRI_with_eight_digit_numeric_escape.ttl \ + IRI_with_all_punctuation.ttl \ + bareword_a_predicate.ttl \ + old_style_prefix.ttl \ + SPARQL_style_prefix.ttl \ + prefixed_IRI_predicate.ttl \ + prefixed_IRI_object.ttl \ + prefix_only_IRI.ttl \ + prefix_with_PN_CHARS_BASE_character_boundaries.ttl \ + prefix_with_non_leading_extras.ttl \ + localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.ttl \ + localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.ttl \ + localName_with_nfc_PN_CHARS_BASE_character_boundaries.ttl \ + default_namespace_IRI.ttl \ + prefix_reassigned_and_used.ttl \ + reserved_escaped_localName.ttl \ + percent_escaped_localName.ttl \ + HYPHEN_MINUS_in_localName.ttl \ + underscore_in_localName.ttl \ + localname_with_COLON.ttl \ + localName_with_leading_underscore.ttl \ + localName_with_leading_digit.ttl \ + localName_with_non_leading_extras.ttl \ + old_style_base.ttl \ + SPARQL_style_base.ttl \ + labeled_blank_node_subject.ttl \ + labeled_blank_node_object.ttl \ + labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.ttl \ + labeled_blank_node_with_leading_underscore.ttl \ + labeled_blank_node_with_leading_digit.ttl \ + labeled_blank_node_with_non_leading_extras.ttl \ + anonymous_blank_node_subject.ttl \ + anonymous_blank_node_object.ttl \ + sole_blankNodePropertyList.ttl \ + blankNodePropertyList_as_subject.ttl \ + blankNodePropertyList_as_object.ttl \ + blankNodePropertyList_with_multiple_triples.ttl \ + nested_blankNodePropertyLists.ttl \ + blankNodePropertyList_containing_collection.ttl \ + collection_subject.ttl \ + collection_object.ttl \ + empty_collection.ttl \ + nested_collection.ttl \ + first.ttl \ + last.ttl \ + LITERAL1.ttl \ + LITERAL1_ascii_boundaries.ttl \ + LITERAL1_with_UTF8_boundaries.ttl \ + LITERAL1_all_controls.ttl \ + LITERAL1_all_punctuation.ttl \ + LITERAL_LONG1.ttl \ + LITERAL_LONG1_ascii_boundaries.ttl \ + LITERAL_LONG1_with_UTF8_boundaries.ttl \ + LITERAL_LONG1_with_1_squote.ttl \ + LITERAL_LONG1_with_2_squotes.ttl \ + LITERAL2.ttl \ + LITERAL2_ascii_boundaries.ttl \ + LITERAL2_with_UTF8_boundaries.ttl \ + LITERAL_LONG2.ttl \ + LITERAL_LONG2_ascii_boundaries.ttl \ + LITERAL_LONG2_with_UTF8_boundaries.ttl \ + LITERAL_LONG2_with_1_squote.ttl \ + LITERAL_LONG2_with_2_squotes.ttl \ + literal_with_CHARACTER_TABULATION.ttl \ + literal_with_BACKSPACE.ttl \ + literal_with_LINE_FEED.ttl \ + literal_with_CARRIAGE_RETURN.ttl \ + literal_with_FORM_FEED.ttl \ + literal_with_REVERSE_SOLIDUS.ttl \ + literal_with_escaped_CHARACTER_TABULATION.ttl \ + literal_with_escaped_BACKSPACE.ttl \ + literal_with_escaped_LINE_FEED.ttl \ + literal_with_escaped_CARRIAGE_RETURN.ttl \ + literal_with_escaped_FORM_FEED.ttl \ + literal_with_numeric_escape4.ttl \ + literal_with_numeric_escape8.ttl \ + IRIREF_datatype.ttl \ + prefixed_name_datatype.ttl \ + bareword_integer.ttl \ + bareword_decimal.ttl \ + bareword_double.ttl \ + double_lower_case_e.ttl \ + negative_numeric.ttl \ + positive_numeric.ttl \ + numeric_with_leading_0.ttl \ + literal_true.ttl \ + literal_false.ttl \ + langtagged_non_LONG.ttl \ + langtagged_LONG.ttl \ + lantag_with_subtag.ttl \ + objectList_with_two_objects.ttl \ + predicateObjectList_with_two_objectLists.ttl \ + repeated_semis_at_end.ttl \ + repeated_semis_not_at_end.ttl \ + turtle-eval-struct-01.ttl \ + turtle-eval-struct-02.ttl \ + turtle-subm-01.ttl \ + turtle-subm-02.ttl \ + turtle-subm-03.ttl \ + turtle-subm-04.ttl \ + turtle-subm-05.ttl \ + turtle-subm-06.ttl \ + turtle-subm-07.ttl \ + turtle-subm-08.ttl \ + turtle-subm-09.ttl \ + turtle-subm-10.ttl \ + turtle-subm-11.ttl \ + turtle-subm-12.ttl \ + turtle-subm-13.ttl \ + turtle-subm-14.ttl \ + turtle-subm-15.ttl \ + turtle-subm-16.ttl \ + turtle-subm-17.ttl \ + turtle-subm-18.ttl \ + turtle-subm-19.ttl \ + turtle-subm-20.ttl \ + turtle-subm-21.ttl \ + turtle-subm-22.ttl \ + turtle-subm-23.ttl \ + turtle-subm-24.ttl \ + turtle-subm-25.ttl \ + turtle-subm-26.ttl \ + turtle-subm-27.ttl \ + comment_following_localName.ttl \ + number_sign_following_localName.ttl \ + comment_following_PNAME_NS.ttl \ + number_sign_following_PNAME_NS.ttl \ + LITERAL_LONG2_with_REVERSE_SOLIDUS.ttl \ + two_LITERAL_LONG2s.ttl \ + langtagged_LONG_with_subtag.ttl \ + oops.ttl + +TEST_BAD_EVAL_FILES = \ + turtle-eval-bad-01.ttl \ + turtle-eval-bad-02.ttl \ + turtle-eval-bad-03.ttl \ + turtle-eval-bad-04.ttl + +TEST_OUT_FILES = \ + HYPHEN_MINUS_in_localName.nt \ + IRIREF_datatype.nt \ + IRI_spo.nt \ + IRI_subject.nt \ + IRI_with_all_punctuation.nt \ + IRI_with_eight_digit_numeric_escape.nt \ + IRI_with_four_digit_numeric_escape.nt \ + LITERAL1.nt \ + LITERAL1_all_controls.nt \ + LITERAL1_all_punctuation.nt \ + LITERAL1_ascii_boundaries.nt \ + LITERAL1_with_UTF8_boundaries.nt \ + LITERAL2.nt \ + LITERAL2_ascii_boundaries.nt \ + LITERAL2_with_UTF8_boundaries.nt \ + LITERAL_LONG1.nt \ + LITERAL_LONG1_ascii_boundaries.nt \ + LITERAL_LONG1_with_1_squote.nt \ + LITERAL_LONG1_with_2_squotes.nt \ + LITERAL_LONG1_with_UTF8_boundaries.nt \ + LITERAL_LONG2.nt \ + LITERAL_LONG2_ascii_boundaries.nt \ + LITERAL_LONG2_with_1_squote.nt \ + LITERAL_LONG2_with_2_squotes.nt \ + LITERAL_LONG2_with_REVERSE_SOLIDUS.nt \ + LITERAL_LONG2_with_UTF8_boundaries.nt \ + LITERAL_with_UTF8_boundaries.nt \ + SPARQL_style_base.nt \ + SPARQL_style_prefix.nt \ + anonymous_blank_node_object.nt \ + anonymous_blank_node_subject.nt \ + bareword_a_predicate.nt \ + bareword_decimal.nt \ + bareword_double.nt \ + bareword_integer.nt \ + blankNodePropertyList_as_object.nt \ + blankNodePropertyList_as_subject.nt \ + blankNodePropertyList_containing_collection.nt \ + blankNodePropertyList_with_multiple_triples.nt \ + collection_object.nt \ + collection_subject.nt \ + comment_following_PNAME_NS.nt \ + comment_following_localName.nt \ + default_namespace_IRI.nt \ + double_lower_case_e.nt \ + empty_collection.nt \ + first.nt \ + labeled_blank_node_object.nt \ + labeled_blank_node_subject.nt \ + labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.nt \ + labeled_blank_node_with_leading_digit.nt \ + labeled_blank_node_with_leading_underscore.nt \ + labeled_blank_node_with_non_leading_extras.nt \ + langtagged_LONG.nt \ + langtagged_LONG_with_subtag.nt \ + langtagged_non_LONG.nt \ + lantag_with_subtag.nt \ + last.nt \ + literal_false.nt \ + literal_true.nt \ + literal_with_BACKSPACE.nt \ + literal_with_CARRIAGE_RETURN.nt \ + literal_with_CHARACTER_TABULATION.nt \ + literal_with_FORM_FEED.nt \ + literal_with_LINE_FEED.nt \ + literal_with_REVERSE_SOLIDUS.nt \ + literal_with_escaped_BACKSPACE.nt \ + literal_with_escaped_CARRIAGE_RETURN.nt \ + literal_with_escaped_CHARACTER_TABULATION.nt \ + literal_with_escaped_FORM_FEED.nt \ + literal_with_escaped_LINE_FEED.nt \ + literal_with_numeric_escape4.nt \ + literal_with_numeric_escape8.nt \ + localName_with_PN_CHARS_BASE_character_boundaries.nt \ + localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.nt \ + localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.nt \ + localName_with_leading_digit.nt \ + localName_with_leading_underscore.nt \ + localName_with_nfc_PN_CHARS_BASE_character_boundaries.nt \ + localName_with_non_leading_extras.nt \ + localname_with_COLON.nt \ + negative_numeric.nt \ + nested_blankNodePropertyLists.nt \ + nested_collection.nt \ + number_sign_following_PNAME_NS.nt \ + number_sign_following_localName.nt \ + numeric_with_leading_0.nt \ + objectList_with_two_objects.nt \ + old_style_base.nt \ + old_style_prefix.nt \ + percent_escaped_localName.nt \ + positive_numeric.nt \ + predicateObjectList_with_two_objectLists.nt \ + prefix_only_IRI.nt \ + prefix_reassigned_and_used.nt \ + prefix_with_PN_CHARS_BASE_character_boundaries.nt \ + prefix_with_non_leading_extras.nt \ + prefixed_IRI_object.nt \ + prefixed_IRI_predicate.nt \ + prefixed_name_datatype.nt \ + repeated_semis_at_end.nt \ + repeated_semis_not_at_end.nt \ + reserved_escaped_localName.nt \ + sole_blankNodePropertyList.nt \ + turtle-eval-struct-01.nt \ + turtle-eval-struct-02.nt \ + turtle-subm-01.nt \ + turtle-subm-02.nt \ + turtle-subm-03.nt \ + turtle-subm-04.nt \ + turtle-subm-05.nt \ + turtle-subm-06.nt \ + turtle-subm-07.nt \ + turtle-subm-08.nt \ + turtle-subm-09.nt \ + turtle-subm-10.nt \ + turtle-subm-11.nt \ + turtle-subm-12.nt \ + turtle-subm-13.nt \ + turtle-subm-14.nt \ + turtle-subm-15.nt \ + turtle-subm-16.nt \ + turtle-subm-17.nt \ + turtle-subm-18.nt \ + turtle-subm-19.nt \ + turtle-subm-20.nt \ + turtle-subm-21.nt \ + turtle-subm-22.nt \ + turtle-subm-23.nt \ + turtle-subm-24.nt \ + turtle-subm-25.nt \ + turtle-subm-26.nt \ + turtle-subm-27.nt \ + turtle-syntax-blank-label.nt \ + turtle-syntax-ln-colons.nt \ + turtle-syntax-ln-dots.nt \ + two_LITERAL_LONG2s.nt \ + underscore_in_localName.nt \ + oops.nt + + +# Used to make N-triples output consistent +BASE_URI = http://www.w3.org/2013/TurtleTests/ +# for rdf-schema.ttl +RDF_NS_URI = http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI = http://www.w3.org/2000/01/rdf-schema +ALL_TEST_FILES = README \ + $(TEST_GOOD_FILES) \ + $(TEST_BAD_FILES) \ + $(TEST_EVAL_FILES) \ + $(TEST_BAD_EVAL_FILES) \ + $(TEST_OUT_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff +@MAINTAINER_MODE_TRUE@check_good_turtle_deps = $(TEST_GOOD_FILES) +@MAINTAINER_MODE_TRUE@check_bad_turtle_deps = $(TEST_BAD_FILES) $(TEST_BAD_EVAL_FILES) +@MAINTAINER_MODE_TRUE@check_eval_turtle_deps = $(TEST_EVAL_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/turtle-2013/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/turtle-2013/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-good-turtle check-bad-turtle check-eval-turtle + +check-good-turtle: build-rapper $(check_good_turtle_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing good Turtle syntax passes"; \ + for test in $(TEST_GOOD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + $(RECHO) "Result: $$errors errors: $$failures"; \ + set -e; exit $$result + +check-bad-turtle: build-rapper $(check_bad_turtle_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing bad Turtle fails"; \ + for test in $(TEST_BAD_FILES) $(TEST_BAD_EVAL_FILES) ; do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + $(RECHO) "Result: $$errors errors: $$failures"; \ + set -e; exit $$result + +check-eval-turtle: build-rapper $(check_eval_turtle_deps) + @set +e; result=0; errors=0; failures=''; \ + $(RECHO) "Testing eval Turtle"; \ + for test in $(TEST_EVAL_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$name.nt > $$name.nnt; \ + $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + elif $(RDFCOMPARE) $$name.nnt $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + diff $$name.nnt $$name.res; \ + errors=`expr $$errors + 1`; \ + failures="$$failures $$test"; \ + fi; \ + rm -f $$name.res $$name.err $$name.nnt; \ + done; \ + $(RECHO) "Result: $$errors errors: $$failures"; \ + set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/turtle-2013/README b/tests/turtle-2013/README new file mode 100644 index 0000000..1b049b9 --- /dev/null +++ b/tests/turtle-2013/README @@ -0,0 +1,65 @@ +This README is for the W3C RDF Working Group's Turtle test suite. +This test suite contains four kinds of tests: + + 132 Evaluation (rdft:TestTurtleEval) - a pair of an input turtle + file and reference ntriples file. + + 77 Positive syntax (rdft:TestTurtlePositiveSyntax) - an input turtle + file with no syntax errors. + + 78 Negative syntax (rdft:TestTurtleNegativeSyntax) - an input turtle + file with at least one syntax error. + + 4 Negative Evaluation (rdft:TestTurtleNegativeEval) - a pair of an + input turtle file and reference ntriples file. These tests have the + same properties as rdft:TestTurtleNegativeSyntax. + +The manifest.ttl file in this directory lists all of the tests in the +RDF WG's Turtle test suite. Each test is one of the above tests. All +tests have a name (mf:name) and an input (mf:action). The Evaluation +tests have an expected result (mf:result). + +• An implementation passes an Evaluation test if it parses the input + into a graph, parses the expecte result into another graph, and + those two graphs are isomorphic (see + ). + +• An implementation passes a positive syntax test if it parses the + input. + +• An implementation passes a negative syntax test if it fails to parse + the input. + + +RELATIVE IRI RESOLUTION: + +The home of the test suite is . +Per RFC 3986 section 5.1.3, the base IRI for parsing each file is the +retrieval IRI for that file. For example, the tests turtle-subm-01 and +turtle-subm-27 require relative IRI resolution against a base of + and + respectively. + + +CHARACTER ENCODING: + +The Turtle language uses UTF-8 encoding. The following tests include +non-ascii characters: + localName_with_assigned_nfc_bmp_PN_CHARS_BASE_character_boundaries + localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries * + localName_with_nfc_PN_CHARS_BASE_character_boundaries * + labeled_blank_node_with_PN_CHARS_BASE_character_boundaries * + LITERAL1_with_UTF8_boundaries * + LITERAL_LONG1_with_UTF8_boundaries * + LITERAL2_with_UTF8_boundaries * + LITERAL_LONG2_with_UTF8_boundaries * + +Those marked with a * include characters with codepoints greater than +U+FFFD and are thus expressed as a pair of surrogate characters when +represented in UCS2. + + +See http://www.w3.org/2011/rdf-wg/wiki/Turtle_Test_Suite for more details. + + +Eric Prud'hommeaux - 11 June 2013. diff --git a/tests/turtle-2013/SPARQL_style_base.nt b/tests/turtle-2013/SPARQL_style_base.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/SPARQL_style_base.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/SPARQL_style_base.ttl b/tests/turtle-2013/SPARQL_style_base.ttl new file mode 100644 index 0000000..d134ea8 --- /dev/null +++ b/tests/turtle-2013/SPARQL_style_base.ttl @@ -0,0 +1,2 @@ +BASE + . diff --git a/tests/turtle-2013/SPARQL_style_prefix.nt b/tests/turtle-2013/SPARQL_style_prefix.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/SPARQL_style_prefix.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/SPARQL_style_prefix.ttl b/tests/turtle-2013/SPARQL_style_prefix.ttl new file mode 100644 index 0000000..e7e4a3d --- /dev/null +++ b/tests/turtle-2013/SPARQL_style_prefix.ttl @@ -0,0 +1,2 @@ +PREFIX p: +p:s . diff --git a/tests/turtle-2013/anonymous_blank_node_object.nt b/tests/turtle-2013/anonymous_blank_node_object.nt new file mode 100644 index 0000000..42e31a1 --- /dev/null +++ b/tests/turtle-2013/anonymous_blank_node_object.nt @@ -0,0 +1 @@ + _:genid1 . diff --git a/tests/turtle-2013/anonymous_blank_node_object.ttl b/tests/turtle-2013/anonymous_blank_node_object.ttl new file mode 100644 index 0000000..0b2ce43 --- /dev/null +++ b/tests/turtle-2013/anonymous_blank_node_object.ttl @@ -0,0 +1 @@ + [] . diff --git a/tests/turtle-2013/anonymous_blank_node_subject.nt b/tests/turtle-2013/anonymous_blank_node_subject.nt new file mode 100644 index 0000000..ca071e6 --- /dev/null +++ b/tests/turtle-2013/anonymous_blank_node_subject.nt @@ -0,0 +1 @@ +_:genid1 . diff --git a/tests/turtle-2013/anonymous_blank_node_subject.ttl b/tests/turtle-2013/anonymous_blank_node_subject.ttl new file mode 100644 index 0000000..17b378c --- /dev/null +++ b/tests/turtle-2013/anonymous_blank_node_subject.ttl @@ -0,0 +1 @@ +[] . diff --git a/tests/turtle-2013/bareword_a_predicate.nt b/tests/turtle-2013/bareword_a_predicate.nt new file mode 100644 index 0000000..afe1425 --- /dev/null +++ b/tests/turtle-2013/bareword_a_predicate.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/bareword_a_predicate.ttl b/tests/turtle-2013/bareword_a_predicate.ttl new file mode 100644 index 0000000..66fa0d0 --- /dev/null +++ b/tests/turtle-2013/bareword_a_predicate.ttl @@ -0,0 +1 @@ + a . diff --git a/tests/turtle-2013/bareword_decimal.nt b/tests/turtle-2013/bareword_decimal.nt new file mode 100644 index 0000000..e177a9c --- /dev/null +++ b/tests/turtle-2013/bareword_decimal.nt @@ -0,0 +1 @@ + "1.0"^^ . diff --git a/tests/turtle-2013/bareword_decimal.ttl b/tests/turtle-2013/bareword_decimal.ttl new file mode 100644 index 0000000..20955d5 --- /dev/null +++ b/tests/turtle-2013/bareword_decimal.ttl @@ -0,0 +1 @@ + 1.0 . diff --git a/tests/turtle-2013/bareword_double.nt b/tests/turtle-2013/bareword_double.nt new file mode 100644 index 0000000..dd8be2f --- /dev/null +++ b/tests/turtle-2013/bareword_double.nt @@ -0,0 +1 @@ + "1E0"^^ . diff --git a/tests/turtle-2013/bareword_double.ttl b/tests/turtle-2013/bareword_double.ttl new file mode 100644 index 0000000..7ce25b1 --- /dev/null +++ b/tests/turtle-2013/bareword_double.ttl @@ -0,0 +1 @@ + 1E0 . diff --git a/tests/turtle-2013/bareword_integer.nt b/tests/turtle-2013/bareword_integer.nt new file mode 100644 index 0000000..c333a5f --- /dev/null +++ b/tests/turtle-2013/bareword_integer.nt @@ -0,0 +1 @@ + "1"^^ . diff --git a/tests/turtle-2013/bareword_integer.ttl b/tests/turtle-2013/bareword_integer.ttl new file mode 100644 index 0000000..087e71b --- /dev/null +++ b/tests/turtle-2013/bareword_integer.ttl @@ -0,0 +1 @@ + 1 . diff --git a/tests/turtle-2013/blankNodePropertyList_as_object.nt b/tests/turtle-2013/blankNodePropertyList_as_object.nt new file mode 100644 index 0000000..509f5d3 --- /dev/null +++ b/tests/turtle-2013/blankNodePropertyList_as_object.nt @@ -0,0 +1,2 @@ +_:genid1 . + _:genid1 . diff --git a/tests/turtle-2013/blankNodePropertyList_as_object.ttl b/tests/turtle-2013/blankNodePropertyList_as_object.ttl new file mode 100644 index 0000000..aa85a74 --- /dev/null +++ b/tests/turtle-2013/blankNodePropertyList_as_object.ttl @@ -0,0 +1 @@ + [ ] . diff --git a/tests/turtle-2013/blankNodePropertyList_as_subject.nt b/tests/turtle-2013/blankNodePropertyList_as_subject.nt new file mode 100644 index 0000000..379804a --- /dev/null +++ b/tests/turtle-2013/blankNodePropertyList_as_subject.nt @@ -0,0 +1,2 @@ +_:genid1 . +_:genid1 . diff --git a/tests/turtle-2013/blankNodePropertyList_as_subject.ttl b/tests/turtle-2013/blankNodePropertyList_as_subject.ttl new file mode 100644 index 0000000..cb2e52a --- /dev/null +++ b/tests/turtle-2013/blankNodePropertyList_as_subject.ttl @@ -0,0 +1 @@ +[ ] . diff --git a/tests/turtle-2013/blankNodePropertyList_containing_collection.nt b/tests/turtle-2013/blankNodePropertyList_containing_collection.nt new file mode 100644 index 0000000..af4f434 --- /dev/null +++ b/tests/turtle-2013/blankNodePropertyList_containing_collection.nt @@ -0,0 +1,3 @@ +_:genid1 "1"^^ . +_:genid1 . +_:genid2 _:genid1 . diff --git a/tests/turtle-2013/blankNodePropertyList_containing_collection.ttl b/tests/turtle-2013/blankNodePropertyList_containing_collection.ttl new file mode 100644 index 0000000..bf164c8 --- /dev/null +++ b/tests/turtle-2013/blankNodePropertyList_containing_collection.ttl @@ -0,0 +1 @@ +[ (1) ] . diff --git a/tests/turtle-2013/blankNodePropertyList_with_multiple_triples.nt b/tests/turtle-2013/blankNodePropertyList_with_multiple_triples.nt new file mode 100644 index 0000000..0102838 --- /dev/null +++ b/tests/turtle-2013/blankNodePropertyList_with_multiple_triples.nt @@ -0,0 +1,3 @@ +_:genid1 . +_:genid1 . +_:genid1 . diff --git a/tests/turtle-2013/blankNodePropertyList_with_multiple_triples.ttl b/tests/turtle-2013/blankNodePropertyList_with_multiple_triples.ttl new file mode 100644 index 0000000..6153c13 --- /dev/null +++ b/tests/turtle-2013/blankNodePropertyList_with_multiple_triples.ttl @@ -0,0 +1 @@ +[ ; ] . diff --git a/tests/turtle-2013/collection_object.nt b/tests/turtle-2013/collection_object.nt new file mode 100644 index 0000000..c52ea9a --- /dev/null +++ b/tests/turtle-2013/collection_object.nt @@ -0,0 +1,3 @@ +_:genid1 "1"^^ . +_:genid1 . + _:genid1 . diff --git a/tests/turtle-2013/collection_object.ttl b/tests/turtle-2013/collection_object.ttl new file mode 100644 index 0000000..6af3471 --- /dev/null +++ b/tests/turtle-2013/collection_object.ttl @@ -0,0 +1 @@ + (1) . diff --git a/tests/turtle-2013/collection_subject.nt b/tests/turtle-2013/collection_subject.nt new file mode 100644 index 0000000..1752364 --- /dev/null +++ b/tests/turtle-2013/collection_subject.nt @@ -0,0 +1,3 @@ +_:genid1 "1"^^ . +_:genid1 . +_:genid1 . diff --git a/tests/turtle-2013/collection_subject.ttl b/tests/turtle-2013/collection_subject.ttl new file mode 100644 index 0000000..00a4c0b --- /dev/null +++ b/tests/turtle-2013/collection_subject.ttl @@ -0,0 +1 @@ +(1) . diff --git a/tests/turtle-2013/comment_following_PNAME_NS.nt b/tests/turtle-2013/comment_following_PNAME_NS.nt new file mode 100644 index 0000000..a8ca81c --- /dev/null +++ b/tests/turtle-2013/comment_following_PNAME_NS.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/comment_following_PNAME_NS.ttl b/tests/turtle-2013/comment_following_PNAME_NS.ttl new file mode 100644 index 0000000..c03124c --- /dev/null +++ b/tests/turtle-2013/comment_following_PNAME_NS.ttl @@ -0,0 +1,3 @@ +@prefix p: . + p:#comment +. diff --git a/tests/turtle-2013/comment_following_localName.nt b/tests/turtle-2013/comment_following_localName.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/comment_following_localName.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/comment_following_localName.ttl b/tests/turtle-2013/comment_following_localName.ttl new file mode 100644 index 0000000..919f876 --- /dev/null +++ b/tests/turtle-2013/comment_following_localName.ttl @@ -0,0 +1,3 @@ +@prefix p: . + p:o#comment +. diff --git a/tests/turtle-2013/default_namespace_IRI.nt b/tests/turtle-2013/default_namespace_IRI.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/default_namespace_IRI.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/default_namespace_IRI.ttl b/tests/turtle-2013/default_namespace_IRI.ttl new file mode 100644 index 0000000..f1f83fd --- /dev/null +++ b/tests/turtle-2013/default_namespace_IRI.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s . diff --git a/tests/turtle-2013/double_lower_case_e.nt b/tests/turtle-2013/double_lower_case_e.nt new file mode 100644 index 0000000..49a792b --- /dev/null +++ b/tests/turtle-2013/double_lower_case_e.nt @@ -0,0 +1 @@ + "1e0"^^ . diff --git a/tests/turtle-2013/double_lower_case_e.ttl b/tests/turtle-2013/double_lower_case_e.ttl new file mode 100644 index 0000000..5f4552b --- /dev/null +++ b/tests/turtle-2013/double_lower_case_e.ttl @@ -0,0 +1 @@ + 1e0 . diff --git a/tests/turtle-2013/empty_collection.nt b/tests/turtle-2013/empty_collection.nt new file mode 100644 index 0000000..82726a3 --- /dev/null +++ b/tests/turtle-2013/empty_collection.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/empty_collection.ttl b/tests/turtle-2013/empty_collection.ttl new file mode 100644 index 0000000..02f9cc0 --- /dev/null +++ b/tests/turtle-2013/empty_collection.ttl @@ -0,0 +1 @@ + () . diff --git a/tests/turtle-2013/first.nt b/tests/turtle-2013/first.nt new file mode 100644 index 0000000..10bd2a2 --- /dev/null +++ b/tests/turtle-2013/first.nt @@ -0,0 +1,7 @@ +_:genid1 "1"^^ . +_:genid1 . +_:genid2 "2"^^ . +_:genid2 . +_:genid3 _:genid1 . +_:genid3 _:genid2 . + _:genid3 . diff --git a/tests/turtle-2013/first.ttl b/tests/turtle-2013/first.ttl new file mode 100644 index 0000000..44f496c --- /dev/null +++ b/tests/turtle-2013/first.ttl @@ -0,0 +1 @@ + ((1) 2) . diff --git a/tests/turtle-2013/labeled_blank_node_object.nt b/tests/turtle-2013/labeled_blank_node_object.nt new file mode 100644 index 0000000..2645d4e --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_object.nt @@ -0,0 +1 @@ + _:o . diff --git a/tests/turtle-2013/labeled_blank_node_object.ttl b/tests/turtle-2013/labeled_blank_node_object.ttl new file mode 100644 index 0000000..2645d4e --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_object.ttl @@ -0,0 +1 @@ + _:o . diff --git a/tests/turtle-2013/labeled_blank_node_subject.nt b/tests/turtle-2013/labeled_blank_node_subject.nt new file mode 100644 index 0000000..d0c7f45 --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_subject.nt @@ -0,0 +1 @@ +_:s . diff --git a/tests/turtle-2013/labeled_blank_node_subject.ttl b/tests/turtle-2013/labeled_blank_node_subject.ttl new file mode 100644 index 0000000..d0c7f45 --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_subject.ttl @@ -0,0 +1 @@ +_:s . diff --git a/tests/turtle-2013/labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.nt b/tests/turtle-2013/labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.nt new file mode 100644 index 0000000..50be8d6 --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.nt @@ -0,0 +1 @@ + _:AZazÀÖØöø˿ͰͽͿ῿‌‍⁰↏Ⰰ⿯、퟿豈﷏ﷰ�𐀀󯿽 . diff --git a/tests/turtle-2013/labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.ttl b/tests/turtle-2013/labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.ttl new file mode 100644 index 0000000..50be8d6 --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_with_PN_CHARS_BASE_character_boundaries.ttl @@ -0,0 +1 @@ + _:AZazÀÖØöø˿ͰͽͿ῿‌‍⁰↏Ⰰ⿯、퟿豈﷏ﷰ�𐀀󯿽 . diff --git a/tests/turtle-2013/labeled_blank_node_with_leading_digit.nt b/tests/turtle-2013/labeled_blank_node_with_leading_digit.nt new file mode 100644 index 0000000..7244d80 --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_with_leading_digit.nt @@ -0,0 +1 @@ + _:0 . diff --git a/tests/turtle-2013/labeled_blank_node_with_leading_digit.ttl b/tests/turtle-2013/labeled_blank_node_with_leading_digit.ttl new file mode 100644 index 0000000..7244d80 --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_with_leading_digit.ttl @@ -0,0 +1 @@ + _:0 . diff --git a/tests/turtle-2013/labeled_blank_node_with_leading_underscore.nt b/tests/turtle-2013/labeled_blank_node_with_leading_underscore.nt new file mode 100644 index 0000000..15d9ffc --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_with_leading_underscore.nt @@ -0,0 +1 @@ + _:_ . diff --git a/tests/turtle-2013/labeled_blank_node_with_leading_underscore.ttl b/tests/turtle-2013/labeled_blank_node_with_leading_underscore.ttl new file mode 100644 index 0000000..15d9ffc --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_with_leading_underscore.ttl @@ -0,0 +1 @@ + _:_ . diff --git a/tests/turtle-2013/labeled_blank_node_with_non_leading_extras.nt b/tests/turtle-2013/labeled_blank_node_with_non_leading_extras.nt new file mode 100644 index 0000000..5ae09b7 --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_with_non_leading_extras.nt @@ -0,0 +1 @@ + _:a·̀ͯ‿.⁀ . diff --git a/tests/turtle-2013/labeled_blank_node_with_non_leading_extras.ttl b/tests/turtle-2013/labeled_blank_node_with_non_leading_extras.ttl new file mode 100644 index 0000000..5ae09b7 --- /dev/null +++ b/tests/turtle-2013/labeled_blank_node_with_non_leading_extras.ttl @@ -0,0 +1 @@ + _:a·̀ͯ‿.⁀ . diff --git a/tests/turtle-2013/langtagged_LONG.nt b/tests/turtle-2013/langtagged_LONG.nt new file mode 100644 index 0000000..1bddb04 --- /dev/null +++ b/tests/turtle-2013/langtagged_LONG.nt @@ -0,0 +1 @@ + "chat"@en . diff --git a/tests/turtle-2013/langtagged_LONG.ttl b/tests/turtle-2013/langtagged_LONG.ttl new file mode 100644 index 0000000..2baefe5 --- /dev/null +++ b/tests/turtle-2013/langtagged_LONG.ttl @@ -0,0 +1 @@ + """chat"""@en . diff --git a/tests/turtle-2013/langtagged_LONG_with_subtag.nt b/tests/turtle-2013/langtagged_LONG_with_subtag.nt new file mode 100644 index 0000000..629cbf4 --- /dev/null +++ b/tests/turtle-2013/langtagged_LONG_with_subtag.nt @@ -0,0 +1 @@ + "Cheers"@en-UK . diff --git a/tests/turtle-2013/langtagged_LONG_with_subtag.ttl b/tests/turtle-2013/langtagged_LONG_with_subtag.ttl new file mode 100644 index 0000000..7fd527c --- /dev/null +++ b/tests/turtle-2013/langtagged_LONG_with_subtag.ttl @@ -0,0 +1,3 @@ +# Test long literal with lang tag +@prefix : . +:a :b """Cheers"""@en-UK . diff --git a/tests/turtle-2013/langtagged_non_LONG.nt b/tests/turtle-2013/langtagged_non_LONG.nt new file mode 100644 index 0000000..1bddb04 --- /dev/null +++ b/tests/turtle-2013/langtagged_non_LONG.nt @@ -0,0 +1 @@ + "chat"@en . diff --git a/tests/turtle-2013/langtagged_non_LONG.ttl b/tests/turtle-2013/langtagged_non_LONG.ttl new file mode 100644 index 0000000..1bddb04 --- /dev/null +++ b/tests/turtle-2013/langtagged_non_LONG.ttl @@ -0,0 +1 @@ + "chat"@en . diff --git a/tests/turtle-2013/lantag_with_subtag.nt b/tests/turtle-2013/lantag_with_subtag.nt new file mode 100644 index 0000000..46c9d53 --- /dev/null +++ b/tests/turtle-2013/lantag_with_subtag.nt @@ -0,0 +1 @@ + "chat"@en-us . diff --git a/tests/turtle-2013/lantag_with_subtag.ttl b/tests/turtle-2013/lantag_with_subtag.ttl new file mode 100644 index 0000000..46c9d53 --- /dev/null +++ b/tests/turtle-2013/lantag_with_subtag.ttl @@ -0,0 +1 @@ + "chat"@en-us . diff --git a/tests/turtle-2013/last.nt b/tests/turtle-2013/last.nt new file mode 100644 index 0000000..84d04ce --- /dev/null +++ b/tests/turtle-2013/last.nt @@ -0,0 +1,7 @@ +_:genid1 "2"^^ . +_:genid1 . +_:genid2 _:genid1 . +_:genid2 . +_:genid3 "1"^^ . +_:genid3 _:genid2 . + _:genid3 . diff --git a/tests/turtle-2013/last.ttl b/tests/turtle-2013/last.ttl new file mode 100644 index 0000000..1254c26 --- /dev/null +++ b/tests/turtle-2013/last.ttl @@ -0,0 +1 @@ + (1 (2)) . diff --git a/tests/turtle-2013/literal_false.nt b/tests/turtle-2013/literal_false.nt new file mode 100644 index 0000000..5bbbae8 --- /dev/null +++ b/tests/turtle-2013/literal_false.nt @@ -0,0 +1 @@ + "false"^^ . diff --git a/tests/turtle-2013/literal_false.ttl b/tests/turtle-2013/literal_false.ttl new file mode 100644 index 0000000..6a32e36 --- /dev/null +++ b/tests/turtle-2013/literal_false.ttl @@ -0,0 +1 @@ + false . diff --git a/tests/turtle-2013/literal_true.nt b/tests/turtle-2013/literal_true.nt new file mode 100644 index 0000000..054b229 --- /dev/null +++ b/tests/turtle-2013/literal_true.nt @@ -0,0 +1 @@ + "true"^^ . diff --git a/tests/turtle-2013/literal_true.ttl b/tests/turtle-2013/literal_true.ttl new file mode 100644 index 0000000..6c5bb74 --- /dev/null +++ b/tests/turtle-2013/literal_true.ttl @@ -0,0 +1 @@ + true . diff --git a/tests/turtle-2013/literal_with_BACKSPACE.nt b/tests/turtle-2013/literal_with_BACKSPACE.nt new file mode 100644 index 0000000..7dba113 --- /dev/null +++ b/tests/turtle-2013/literal_with_BACKSPACE.nt @@ -0,0 +1 @@ + "\u0008" . diff --git a/tests/turtle-2013/literal_with_BACKSPACE.ttl b/tests/turtle-2013/literal_with_BACKSPACE.ttl new file mode 100644 index 0000000..17b2880 --- /dev/null +++ b/tests/turtle-2013/literal_with_BACKSPACE.ttl @@ -0,0 +1 @@ + '' . diff --git a/tests/turtle-2013/literal_with_CARRIAGE_RETURN.nt b/tests/turtle-2013/literal_with_CARRIAGE_RETURN.nt new file mode 100644 index 0000000..91b85c8 --- /dev/null +++ b/tests/turtle-2013/literal_with_CARRIAGE_RETURN.nt @@ -0,0 +1 @@ + "\r" . diff --git a/tests/turtle-2013/literal_with_CARRIAGE_RETURN.ttl b/tests/turtle-2013/literal_with_CARRIAGE_RETURN.ttl new file mode 100644 index 0000000..3cd1d89 --- /dev/null +++ b/tests/turtle-2013/literal_with_CARRIAGE_RETURN.ttl @@ -0,0 +1 @@ + ''' ''' . diff --git a/tests/turtle-2013/literal_with_CHARACTER_TABULATION.nt b/tests/turtle-2013/literal_with_CHARACTER_TABULATION.nt new file mode 100644 index 0000000..a6a9d9f --- /dev/null +++ b/tests/turtle-2013/literal_with_CHARACTER_TABULATION.nt @@ -0,0 +1 @@ + "\t" . diff --git a/tests/turtle-2013/literal_with_CHARACTER_TABULATION.ttl b/tests/turtle-2013/literal_with_CHARACTER_TABULATION.ttl new file mode 100644 index 0000000..37fbd9d --- /dev/null +++ b/tests/turtle-2013/literal_with_CHARACTER_TABULATION.ttl @@ -0,0 +1 @@ + ' ' . diff --git a/tests/turtle-2013/literal_with_FORM_FEED.nt b/tests/turtle-2013/literal_with_FORM_FEED.nt new file mode 100644 index 0000000..2a4490b --- /dev/null +++ b/tests/turtle-2013/literal_with_FORM_FEED.nt @@ -0,0 +1 @@ + "\u000C" . diff --git a/tests/turtle-2013/literal_with_FORM_FEED.ttl b/tests/turtle-2013/literal_with_FORM_FEED.ttl new file mode 100644 index 0000000..76d6ee7 --- /dev/null +++ b/tests/turtle-2013/literal_with_FORM_FEED.ttl @@ -0,0 +1 @@ + ' ' . diff --git a/tests/turtle-2013/literal_with_LINE_FEED.nt b/tests/turtle-2013/literal_with_LINE_FEED.nt new file mode 100644 index 0000000..462f97a --- /dev/null +++ b/tests/turtle-2013/literal_with_LINE_FEED.nt @@ -0,0 +1 @@ + "\n" . diff --git a/tests/turtle-2013/literal_with_LINE_FEED.ttl b/tests/turtle-2013/literal_with_LINE_FEED.ttl new file mode 100644 index 0000000..50cc8a8 --- /dev/null +++ b/tests/turtle-2013/literal_with_LINE_FEED.ttl @@ -0,0 +1,2 @@ + ''' +''' . diff --git a/tests/turtle-2013/literal_with_REVERSE_SOLIDUS.nt b/tests/turtle-2013/literal_with_REVERSE_SOLIDUS.nt new file mode 100644 index 0000000..ebc846e --- /dev/null +++ b/tests/turtle-2013/literal_with_REVERSE_SOLIDUS.nt @@ -0,0 +1 @@ + "\\" . diff --git a/tests/turtle-2013/literal_with_REVERSE_SOLIDUS.ttl b/tests/turtle-2013/literal_with_REVERSE_SOLIDUS.ttl new file mode 100644 index 0000000..380a3d0 --- /dev/null +++ b/tests/turtle-2013/literal_with_REVERSE_SOLIDUS.ttl @@ -0,0 +1 @@ + '\\' . diff --git a/tests/turtle-2013/literal_with_escaped_BACKSPACE.nt b/tests/turtle-2013/literal_with_escaped_BACKSPACE.nt new file mode 100644 index 0000000..7dba113 --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_BACKSPACE.nt @@ -0,0 +1 @@ + "\u0008" . diff --git a/tests/turtle-2013/literal_with_escaped_BACKSPACE.ttl b/tests/turtle-2013/literal_with_escaped_BACKSPACE.ttl new file mode 100644 index 0000000..5284b9b --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_BACKSPACE.ttl @@ -0,0 +1 @@ + '\b' . diff --git a/tests/turtle-2013/literal_with_escaped_CARRIAGE_RETURN.nt b/tests/turtle-2013/literal_with_escaped_CARRIAGE_RETURN.nt new file mode 100644 index 0000000..91b85c8 --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_CARRIAGE_RETURN.nt @@ -0,0 +1 @@ + "\r" . diff --git a/tests/turtle-2013/literal_with_escaped_CARRIAGE_RETURN.ttl b/tests/turtle-2013/literal_with_escaped_CARRIAGE_RETURN.ttl new file mode 100644 index 0000000..a28e7c0 --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_CARRIAGE_RETURN.ttl @@ -0,0 +1 @@ + '\r' . diff --git a/tests/turtle-2013/literal_with_escaped_CHARACTER_TABULATION.nt b/tests/turtle-2013/literal_with_escaped_CHARACTER_TABULATION.nt new file mode 100644 index 0000000..a6a9d9f --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_CHARACTER_TABULATION.nt @@ -0,0 +1 @@ + "\t" . diff --git a/tests/turtle-2013/literal_with_escaped_CHARACTER_TABULATION.ttl b/tests/turtle-2013/literal_with_escaped_CHARACTER_TABULATION.ttl new file mode 100644 index 0000000..67966f7 --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_CHARACTER_TABULATION.ttl @@ -0,0 +1 @@ + '\t' . diff --git a/tests/turtle-2013/literal_with_escaped_FORM_FEED.nt b/tests/turtle-2013/literal_with_escaped_FORM_FEED.nt new file mode 100644 index 0000000..2a4490b --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_FORM_FEED.nt @@ -0,0 +1 @@ + "\u000C" . diff --git a/tests/turtle-2013/literal_with_escaped_FORM_FEED.ttl b/tests/turtle-2013/literal_with_escaped_FORM_FEED.ttl new file mode 100644 index 0000000..21acace --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_FORM_FEED.ttl @@ -0,0 +1 @@ + '\f' . diff --git a/tests/turtle-2013/literal_with_escaped_LINE_FEED.nt b/tests/turtle-2013/literal_with_escaped_LINE_FEED.nt new file mode 100644 index 0000000..462f97a --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_LINE_FEED.nt @@ -0,0 +1 @@ + "\n" . diff --git a/tests/turtle-2013/literal_with_escaped_LINE_FEED.ttl b/tests/turtle-2013/literal_with_escaped_LINE_FEED.ttl new file mode 100644 index 0000000..b53f49e --- /dev/null +++ b/tests/turtle-2013/literal_with_escaped_LINE_FEED.ttl @@ -0,0 +1 @@ + '\n' . diff --git a/tests/turtle-2013/literal_with_numeric_escape4.nt b/tests/turtle-2013/literal_with_numeric_escape4.nt new file mode 100644 index 0000000..0b35a89 --- /dev/null +++ b/tests/turtle-2013/literal_with_numeric_escape4.nt @@ -0,0 +1 @@ + "o" . diff --git a/tests/turtle-2013/literal_with_numeric_escape4.ttl b/tests/turtle-2013/literal_with_numeric_escape4.ttl new file mode 100644 index 0000000..2b4e017 --- /dev/null +++ b/tests/turtle-2013/literal_with_numeric_escape4.ttl @@ -0,0 +1 @@ + '\u006F' . diff --git a/tests/turtle-2013/literal_with_numeric_escape8.nt b/tests/turtle-2013/literal_with_numeric_escape8.nt new file mode 100644 index 0000000..0b35a89 --- /dev/null +++ b/tests/turtle-2013/literal_with_numeric_escape8.nt @@ -0,0 +1 @@ + "o" . diff --git a/tests/turtle-2013/literal_with_numeric_escape8.ttl b/tests/turtle-2013/literal_with_numeric_escape8.ttl new file mode 100644 index 0000000..8d0e4ef --- /dev/null +++ b/tests/turtle-2013/literal_with_numeric_escape8.ttl @@ -0,0 +1 @@ + '\U0000006F' . diff --git a/tests/turtle-2013/localName_with_PN_CHARS_BASE_character_boundaries.nt b/tests/turtle-2013/localName_with_PN_CHARS_BASE_character_boundaries.nt new file mode 100644 index 0000000..cd3bc3d --- /dev/null +++ b/tests/turtle-2013/localName_with_PN_CHARS_BASE_character_boundaries.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.nt b/tests/turtle-2013/localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.nt new file mode 100644 index 0000000..4b60c9e --- /dev/null +++ b/tests/turtle-2013/localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.ttl b/tests/turtle-2013/localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.ttl new file mode 100644 index 0000000..c532e3d --- /dev/null +++ b/tests/turtle-2013/localName_with_assigned_nfc_PN_CHARS_BASE_character_boundaries.ttl @@ -0,0 +1,2 @@ +@prefix p: . + p:AZazÀÖØöø˿Ͱͽ΄῾‌‍⁰↉Ⰰ⿕、ퟻ﨎ﷇﷰ￯𐀀󠇯 . diff --git a/tests/turtle-2013/localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.nt b/tests/turtle-2013/localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.nt new file mode 100644 index 0000000..78ef108 --- /dev/null +++ b/tests/turtle-2013/localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.ttl b/tests/turtle-2013/localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.ttl new file mode 100644 index 0000000..15b23dd --- /dev/null +++ b/tests/turtle-2013/localName_with_assigned_nfc_bmp_PN_CHARS_BASE_char_boundaries.ttl @@ -0,0 +1,2 @@ +@prefix p: . + p:AZazÀÖØöø˿Ͱͽ΄῾‌‍⁰↉Ⰰ⿕、ퟻ﨎ﷇﷰ￯ . diff --git a/tests/turtle-2013/localName_with_leading_digit.nt b/tests/turtle-2013/localName_with_leading_digit.nt new file mode 100644 index 0000000..a9e101e --- /dev/null +++ b/tests/turtle-2013/localName_with_leading_digit.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/localName_with_leading_digit.ttl b/tests/turtle-2013/localName_with_leading_digit.ttl new file mode 100644 index 0000000..65da249 --- /dev/null +++ b/tests/turtle-2013/localName_with_leading_digit.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:0 . diff --git a/tests/turtle-2013/localName_with_leading_underscore.nt b/tests/turtle-2013/localName_with_leading_underscore.nt new file mode 100644 index 0000000..e042a7b --- /dev/null +++ b/tests/turtle-2013/localName_with_leading_underscore.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/localName_with_leading_underscore.ttl b/tests/turtle-2013/localName_with_leading_underscore.ttl new file mode 100644 index 0000000..762ace9 --- /dev/null +++ b/tests/turtle-2013/localName_with_leading_underscore.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:_ . diff --git a/tests/turtle-2013/localName_with_nfc_PN_CHARS_BASE_character_boundaries.nt b/tests/turtle-2013/localName_with_nfc_PN_CHARS_BASE_character_boundaries.nt new file mode 100644 index 0000000..5b34691 --- /dev/null +++ b/tests/turtle-2013/localName_with_nfc_PN_CHARS_BASE_character_boundaries.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/localName_with_nfc_PN_CHARS_BASE_character_boundaries.ttl b/tests/turtle-2013/localName_with_nfc_PN_CHARS_BASE_character_boundaries.ttl new file mode 100644 index 0000000..0922d95 --- /dev/null +++ b/tests/turtle-2013/localName_with_nfc_PN_CHARS_BASE_character_boundaries.ttl @@ -0,0 +1,2 @@ +@prefix p: . + p:AZazÀÖØöø˿ͰͽͿ῿‌‍⁰↏Ⰰ⿯、퟿﨎﷏ﷰ￯𐀀󯿽 . diff --git a/tests/turtle-2013/localName_with_non_leading_extras.nt b/tests/turtle-2013/localName_with_non_leading_extras.nt new file mode 100644 index 0000000..edd03f7 --- /dev/null +++ b/tests/turtle-2013/localName_with_non_leading_extras.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/localName_with_non_leading_extras.ttl b/tests/turtle-2013/localName_with_non_leading_extras.ttl new file mode 100644 index 0000000..db25a8a --- /dev/null +++ b/tests/turtle-2013/localName_with_non_leading_extras.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:a·̀ͯ‿.⁀ . diff --git a/tests/turtle-2013/localname_with_COLON.nt b/tests/turtle-2013/localname_with_COLON.nt new file mode 100644 index 0000000..eb966ca --- /dev/null +++ b/tests/turtle-2013/localname_with_COLON.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/localname_with_COLON.ttl b/tests/turtle-2013/localname_with_COLON.ttl new file mode 100644 index 0000000..1d45f20 --- /dev/null +++ b/tests/turtle-2013/localname_with_COLON.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:s: . diff --git a/tests/turtle-2013/negative_numeric.nt b/tests/turtle-2013/negative_numeric.nt new file mode 100644 index 0000000..4baf628 --- /dev/null +++ b/tests/turtle-2013/negative_numeric.nt @@ -0,0 +1 @@ + "-1"^^ . diff --git a/tests/turtle-2013/negative_numeric.ttl b/tests/turtle-2013/negative_numeric.ttl new file mode 100644 index 0000000..a6a7f57 --- /dev/null +++ b/tests/turtle-2013/negative_numeric.ttl @@ -0,0 +1 @@ + -1 . diff --git a/tests/turtle-2013/nested_blankNodePropertyLists.nt b/tests/turtle-2013/nested_blankNodePropertyLists.nt new file mode 100644 index 0000000..47cb70f --- /dev/null +++ b/tests/turtle-2013/nested_blankNodePropertyLists.nt @@ -0,0 +1,3 @@ +_:genid1 . +_:genid2 _:genid1 . +_:genid2 . diff --git a/tests/turtle-2013/nested_blankNodePropertyLists.ttl b/tests/turtle-2013/nested_blankNodePropertyLists.ttl new file mode 100644 index 0000000..a3e4681 --- /dev/null +++ b/tests/turtle-2013/nested_blankNodePropertyLists.ttl @@ -0,0 +1 @@ +[ [ ] ; ]. diff --git a/tests/turtle-2013/nested_collection.nt b/tests/turtle-2013/nested_collection.nt new file mode 100644 index 0000000..47d734d --- /dev/null +++ b/tests/turtle-2013/nested_collection.nt @@ -0,0 +1,5 @@ +_:genid1 "1"^^ . +_:genid1 . +_:genid2 _:genid1 . +_:genid2 . + _:genid2 . diff --git a/tests/turtle-2013/nested_collection.ttl b/tests/turtle-2013/nested_collection.ttl new file mode 100644 index 0000000..944e7c6 --- /dev/null +++ b/tests/turtle-2013/nested_collection.ttl @@ -0,0 +1 @@ + ((1)) . diff --git a/tests/turtle-2013/number_sign_following_PNAME_NS.nt b/tests/turtle-2013/number_sign_following_PNAME_NS.nt new file mode 100644 index 0000000..82d9629 --- /dev/null +++ b/tests/turtle-2013/number_sign_following_PNAME_NS.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/number_sign_following_PNAME_NS.ttl b/tests/turtle-2013/number_sign_following_PNAME_NS.ttl new file mode 100644 index 0000000..2003fa4 --- /dev/null +++ b/tests/turtle-2013/number_sign_following_PNAME_NS.ttl @@ -0,0 +1,3 @@ +@prefix p: . + p:\#numbersign +. diff --git a/tests/turtle-2013/number_sign_following_localName.nt b/tests/turtle-2013/number_sign_following_localName.nt new file mode 100644 index 0000000..5ae57b8 --- /dev/null +++ b/tests/turtle-2013/number_sign_following_localName.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/number_sign_following_localName.ttl b/tests/turtle-2013/number_sign_following_localName.ttl new file mode 100644 index 0000000..a0e39ec --- /dev/null +++ b/tests/turtle-2013/number_sign_following_localName.ttl @@ -0,0 +1,3 @@ +@prefix p: . + p:o\#numbersign +. diff --git a/tests/turtle-2013/numeric_with_leading_0.nt b/tests/turtle-2013/numeric_with_leading_0.nt new file mode 100644 index 0000000..1df5c47 --- /dev/null +++ b/tests/turtle-2013/numeric_with_leading_0.nt @@ -0,0 +1 @@ + "01"^^ . diff --git a/tests/turtle-2013/numeric_with_leading_0.ttl b/tests/turtle-2013/numeric_with_leading_0.ttl new file mode 100644 index 0000000..a5eac20 --- /dev/null +++ b/tests/turtle-2013/numeric_with_leading_0.ttl @@ -0,0 +1 @@ + 01 . diff --git a/tests/turtle-2013/objectList_with_two_objects.nt b/tests/turtle-2013/objectList_with_two_objects.nt new file mode 100644 index 0000000..7f8e9c0 --- /dev/null +++ b/tests/turtle-2013/objectList_with_two_objects.nt @@ -0,0 +1,2 @@ + . + . diff --git a/tests/turtle-2013/objectList_with_two_objects.ttl b/tests/turtle-2013/objectList_with_two_objects.ttl new file mode 100644 index 0000000..b12f02d --- /dev/null +++ b/tests/turtle-2013/objectList_with_two_objects.ttl @@ -0,0 +1 @@ + , . diff --git a/tests/turtle-2013/old_style_base.nt b/tests/turtle-2013/old_style_base.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/old_style_base.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/old_style_base.ttl b/tests/turtle-2013/old_style_base.ttl new file mode 100644 index 0000000..f0f4c03 --- /dev/null +++ b/tests/turtle-2013/old_style_base.ttl @@ -0,0 +1,2 @@ +@base . + . diff --git a/tests/turtle-2013/old_style_prefix.nt b/tests/turtle-2013/old_style_prefix.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/old_style_prefix.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/old_style_prefix.ttl b/tests/turtle-2013/old_style_prefix.ttl new file mode 100644 index 0000000..5959567 --- /dev/null +++ b/tests/turtle-2013/old_style_prefix.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:s . diff --git a/tests/turtle-2013/oops.nt b/tests/turtle-2013/oops.nt new file mode 100644 index 0000000..d3e7e73 --- /dev/null +++ b/tests/turtle-2013/oops.nt @@ -0,0 +1,5 @@ + " ''' " . + " \"\"\" " . + " \"\"a " . + "\"\"\"" . + "\"\"a" . diff --git a/tests/turtle-2013/oops.ttl b/tests/turtle-2013/oops.ttl new file mode 100644 index 0000000..a194c15 --- /dev/null +++ b/tests/turtle-2013/oops.ttl @@ -0,0 +1,9 @@ +

''' ''\' ''' . + +

""" ""\" """ . + +

""" ""\u0061 """ . + +

"""""\"""" . + +

"""""\u0061""" . diff --git a/tests/turtle-2013/percent_escaped_localName.nt b/tests/turtle-2013/percent_escaped_localName.nt new file mode 100644 index 0000000..e0af4b6 --- /dev/null +++ b/tests/turtle-2013/percent_escaped_localName.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/percent_escaped_localName.ttl b/tests/turtle-2013/percent_escaped_localName.ttl new file mode 100644 index 0000000..0564cca --- /dev/null +++ b/tests/turtle-2013/percent_escaped_localName.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:%25 . diff --git a/tests/turtle-2013/positive_numeric.nt b/tests/turtle-2013/positive_numeric.nt new file mode 100644 index 0000000..96e6086 --- /dev/null +++ b/tests/turtle-2013/positive_numeric.nt @@ -0,0 +1 @@ + "+1"^^ . diff --git a/tests/turtle-2013/positive_numeric.ttl b/tests/turtle-2013/positive_numeric.ttl new file mode 100644 index 0000000..606691d --- /dev/null +++ b/tests/turtle-2013/positive_numeric.ttl @@ -0,0 +1 @@ + +1 . diff --git a/tests/turtle-2013/predicateObjectList_with_two_objectLists.nt b/tests/turtle-2013/predicateObjectList_with_two_objectLists.nt new file mode 100644 index 0000000..274182c --- /dev/null +++ b/tests/turtle-2013/predicateObjectList_with_two_objectLists.nt @@ -0,0 +1,2 @@ + . + . diff --git a/tests/turtle-2013/predicateObjectList_with_two_objectLists.ttl b/tests/turtle-2013/predicateObjectList_with_two_objectLists.ttl new file mode 100644 index 0000000..337b132 --- /dev/null +++ b/tests/turtle-2013/predicateObjectList_with_two_objectLists.ttl @@ -0,0 +1 @@ + ; . diff --git a/tests/turtle-2013/prefix_only_IRI.nt b/tests/turtle-2013/prefix_only_IRI.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/prefix_only_IRI.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/prefix_only_IRI.ttl b/tests/turtle-2013/prefix_only_IRI.ttl new file mode 100644 index 0000000..9ff6660 --- /dev/null +++ b/tests/turtle-2013/prefix_only_IRI.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p: . diff --git a/tests/turtle-2013/prefix_reassigned_and_used.nt b/tests/turtle-2013/prefix_reassigned_and_used.nt new file mode 100644 index 0000000..68bc9ef --- /dev/null +++ b/tests/turtle-2013/prefix_reassigned_and_used.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/prefix_reassigned_and_used.ttl b/tests/turtle-2013/prefix_reassigned_and_used.ttl new file mode 100644 index 0000000..1f94859 --- /dev/null +++ b/tests/turtle-2013/prefix_reassigned_and_used.ttl @@ -0,0 +1,3 @@ +@prefix p: . +@prefix p: . +p:s . diff --git a/tests/turtle-2013/prefix_with_PN_CHARS_BASE_character_boundaries.nt b/tests/turtle-2013/prefix_with_PN_CHARS_BASE_character_boundaries.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/prefix_with_PN_CHARS_BASE_character_boundaries.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/prefix_with_PN_CHARS_BASE_character_boundaries.ttl b/tests/turtle-2013/prefix_with_PN_CHARS_BASE_character_boundaries.ttl new file mode 100644 index 0000000..bc436bd --- /dev/null +++ b/tests/turtle-2013/prefix_with_PN_CHARS_BASE_character_boundaries.ttl @@ -0,0 +1,2 @@ +@prefix AZazÀÖØöø˿ͰͽͿ῿‌‍⁰↏Ⰰ⿯、퟿豈﷏ﷰ�𐀀󯿽: . + AZazÀÖØöø˿ͰͽͿ῿‌‍⁰↏Ⰰ⿯、퟿豈﷏ﷰ�𐀀󯿽:o . diff --git a/tests/turtle-2013/prefix_with_non_leading_extras.nt b/tests/turtle-2013/prefix_with_non_leading_extras.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/prefix_with_non_leading_extras.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/prefix_with_non_leading_extras.ttl b/tests/turtle-2013/prefix_with_non_leading_extras.ttl new file mode 100644 index 0000000..193460a --- /dev/null +++ b/tests/turtle-2013/prefix_with_non_leading_extras.ttl @@ -0,0 +1,2 @@ +@prefix a·̀ͯ‿.⁀: . +a·̀ͯ‿.⁀:s . diff --git a/tests/turtle-2013/prefixed_IRI_object.nt b/tests/turtle-2013/prefixed_IRI_object.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/prefixed_IRI_object.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/prefixed_IRI_object.ttl b/tests/turtle-2013/prefixed_IRI_object.ttl new file mode 100644 index 0000000..c2d5036 --- /dev/null +++ b/tests/turtle-2013/prefixed_IRI_object.ttl @@ -0,0 +1,2 @@ +@prefix p: . + p:o . diff --git a/tests/turtle-2013/prefixed_IRI_predicate.nt b/tests/turtle-2013/prefixed_IRI_predicate.nt new file mode 100644 index 0000000..01125e5 --- /dev/null +++ b/tests/turtle-2013/prefixed_IRI_predicate.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/prefixed_IRI_predicate.ttl b/tests/turtle-2013/prefixed_IRI_predicate.ttl new file mode 100644 index 0000000..2c1e5cc --- /dev/null +++ b/tests/turtle-2013/prefixed_IRI_predicate.ttl @@ -0,0 +1,2 @@ +@prefix p: . + p:p . diff --git a/tests/turtle-2013/prefixed_name_datatype.nt b/tests/turtle-2013/prefixed_name_datatype.nt new file mode 100644 index 0000000..c333a5f --- /dev/null +++ b/tests/turtle-2013/prefixed_name_datatype.nt @@ -0,0 +1 @@ + "1"^^ . diff --git a/tests/turtle-2013/prefixed_name_datatype.ttl b/tests/turtle-2013/prefixed_name_datatype.ttl new file mode 100644 index 0000000..4a52607 --- /dev/null +++ b/tests/turtle-2013/prefixed_name_datatype.ttl @@ -0,0 +1,2 @@ +@prefix xsd: . + "1"^^xsd:integer . diff --git a/tests/turtle-2013/repeated_semis_at_end.nt b/tests/turtle-2013/repeated_semis_at_end.nt new file mode 100644 index 0000000..274182c --- /dev/null +++ b/tests/turtle-2013/repeated_semis_at_end.nt @@ -0,0 +1,2 @@ + . + . diff --git a/tests/turtle-2013/repeated_semis_at_end.ttl b/tests/turtle-2013/repeated_semis_at_end.ttl new file mode 100644 index 0000000..8a4d935 --- /dev/null +++ b/tests/turtle-2013/repeated_semis_at_end.ttl @@ -0,0 +1 @@ + ;; . diff --git a/tests/turtle-2013/repeated_semis_not_at_end.nt b/tests/turtle-2013/repeated_semis_not_at_end.nt new file mode 100644 index 0000000..9ac6005 --- /dev/null +++ b/tests/turtle-2013/repeated_semis_not_at_end.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/repeated_semis_not_at_end.ttl b/tests/turtle-2013/repeated_semis_not_at_end.ttl new file mode 100644 index 0000000..3c8144f --- /dev/null +++ b/tests/turtle-2013/repeated_semis_not_at_end.ttl @@ -0,0 +1 @@ + ;; . diff --git a/tests/turtle-2013/reserved_escaped_localName.nt b/tests/turtle-2013/reserved_escaped_localName.nt new file mode 100644 index 0000000..1ee4f32 --- /dev/null +++ b/tests/turtle-2013/reserved_escaped_localName.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/reserved_escaped_localName.ttl b/tests/turtle-2013/reserved_escaped_localName.ttl new file mode 100644 index 0000000..ae97f8a --- /dev/null +++ b/tests/turtle-2013/reserved_escaped_localName.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:\_\~\.\-\!\$\&\'\(\)\*\+\,\;\=\/\?\#\@\%00 . diff --git a/tests/turtle-2013/sole_blankNodePropertyList.nt b/tests/turtle-2013/sole_blankNodePropertyList.nt new file mode 100644 index 0000000..ca071e6 --- /dev/null +++ b/tests/turtle-2013/sole_blankNodePropertyList.nt @@ -0,0 +1 @@ +_:genid1 . diff --git a/tests/turtle-2013/sole_blankNodePropertyList.ttl b/tests/turtle-2013/sole_blankNodePropertyList.ttl new file mode 100644 index 0000000..5cc300f --- /dev/null +++ b/tests/turtle-2013/sole_blankNodePropertyList.ttl @@ -0,0 +1 @@ +[ ] . diff --git a/tests/turtle-2013/turtle-eval-bad-01.ttl b/tests/turtle-2013/turtle-eval-bad-01.ttl new file mode 100644 index 0000000..c9c458e --- /dev/null +++ b/tests/turtle-2013/turtle-eval-bad-01.ttl @@ -0,0 +1,2 @@ +# Bad IRI : good escape, bad charcater + . diff --git a/tests/turtle-2013/turtle-eval-bad-02.ttl b/tests/turtle-2013/turtle-eval-bad-02.ttl new file mode 100644 index 0000000..f2be6ea --- /dev/null +++ b/tests/turtle-2013/turtle-eval-bad-02.ttl @@ -0,0 +1,2 @@ +# Bad IRI : hex 3C is < + . diff --git a/tests/turtle-2013/turtle-eval-bad-03.ttl b/tests/turtle-2013/turtle-eval-bad-03.ttl new file mode 100644 index 0000000..1aec7ff --- /dev/null +++ b/tests/turtle-2013/turtle-eval-bad-03.ttl @@ -0,0 +1,2 @@ +# Bad IRI : hex 3E is > + . diff --git a/tests/turtle-2013/turtle-eval-bad-04.ttl b/tests/turtle-2013/turtle-eval-bad-04.ttl new file mode 100644 index 0000000..4b7601b --- /dev/null +++ b/tests/turtle-2013/turtle-eval-bad-04.ttl @@ -0,0 +1,2 @@ +# Bad IRI + . diff --git a/tests/turtle-2013/turtle-eval-struct-01.nt b/tests/turtle-2013/turtle-eval-struct-01.nt new file mode 100644 index 0000000..2e2d5ba --- /dev/null +++ b/tests/turtle-2013/turtle-eval-struct-01.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/turtle-eval-struct-01.ttl b/tests/turtle-2013/turtle-eval-struct-01.ttl new file mode 100644 index 0000000..2e2d5ba --- /dev/null +++ b/tests/turtle-2013/turtle-eval-struct-01.ttl @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/turtle-eval-struct-02.nt b/tests/turtle-2013/turtle-eval-struct-02.nt new file mode 100644 index 0000000..6cdc856 --- /dev/null +++ b/tests/turtle-2013/turtle-eval-struct-02.nt @@ -0,0 +1,2 @@ + . + . diff --git a/tests/turtle-2013/turtle-eval-struct-02.ttl b/tests/turtle-2013/turtle-eval-struct-02.ttl new file mode 100644 index 0000000..45b9ea0 --- /dev/null +++ b/tests/turtle-2013/turtle-eval-struct-02.ttl @@ -0,0 +1,4 @@ + + ; + ; + . diff --git a/tests/turtle-2013/turtle-subm-01.nt b/tests/turtle-2013/turtle-subm-01.nt new file mode 100644 index 0000000..1f9a262 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-01.nt @@ -0,0 +1 @@ +_:genid1 . diff --git a/tests/turtle-2013/turtle-subm-01.ttl b/tests/turtle-2013/turtle-subm-01.ttl new file mode 100644 index 0000000..78da35e --- /dev/null +++ b/tests/turtle-2013/turtle-subm-01.ttl @@ -0,0 +1,2 @@ +@prefix : <#> . +[] :x :y . diff --git a/tests/turtle-2013/turtle-subm-02.nt b/tests/turtle-2013/turtle-subm-02.nt new file mode 100644 index 0000000..5ccb5bd --- /dev/null +++ b/tests/turtle-2013/turtle-subm-02.nt @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/turtle-2013/turtle-subm-02.ttl b/tests/turtle-2013/turtle-subm-02.ttl new file mode 100644 index 0000000..9070d2c --- /dev/null +++ b/tests/turtle-2013/turtle-subm-02.ttl @@ -0,0 +1,7 @@ +# Test @prefix and qnames +@prefix : . +@prefix a: . +@prefix b: . +:a :b :c . +a:a a:b a:c . +:a a:a b:a . diff --git a/tests/turtle-2013/turtle-subm-03.nt b/tests/turtle-2013/turtle-subm-03.nt new file mode 100644 index 0000000..99732ab --- /dev/null +++ b/tests/turtle-2013/turtle-subm-03.nt @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/turtle-2013/turtle-subm-03.ttl b/tests/turtle-2013/turtle-subm-03.ttl new file mode 100644 index 0000000..a623f3c --- /dev/null +++ b/tests/turtle-2013/turtle-subm-03.ttl @@ -0,0 +1,5 @@ +# Test , operator +@prefix : . +:a :b :c, + :d, + :e . diff --git a/tests/turtle-2013/turtle-subm-04.nt b/tests/turtle-2013/turtle-subm-04.nt new file mode 100644 index 0000000..d6ce9e8 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-04.nt @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/turtle-2013/turtle-subm-04.ttl b/tests/turtle-2013/turtle-subm-04.ttl new file mode 100644 index 0000000..9179fa5 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-04.ttl @@ -0,0 +1,5 @@ +# Test ; operator +@prefix : . +:a :b :c ; + :d :e ; + :f :g . diff --git a/tests/turtle-2013/turtle-subm-05.nt b/tests/turtle-2013/turtle-subm-05.nt new file mode 100644 index 0000000..414e4b8 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-05.nt @@ -0,0 +1,2 @@ +_:genid1 . + _:genid2 . diff --git a/tests/turtle-2013/turtle-subm-05.ttl b/tests/turtle-2013/turtle-subm-05.ttl new file mode 100644 index 0000000..c518147 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-05.ttl @@ -0,0 +1,4 @@ +# Test empty [] operator; not allowed as predicate +@prefix : . +[] :a :b . +:c :d [] . diff --git a/tests/turtle-2013/turtle-subm-06.nt b/tests/turtle-2013/turtle-subm-06.nt new file mode 100644 index 0000000..6925d40 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-06.nt @@ -0,0 +1,4 @@ +_:genid1 . +_:genid1 . +_:genid2 . + _:genid2 . diff --git a/tests/turtle-2013/turtle-subm-06.ttl b/tests/turtle-2013/turtle-subm-06.ttl new file mode 100644 index 0000000..adcbcab --- /dev/null +++ b/tests/turtle-2013/turtle-subm-06.ttl @@ -0,0 +1,4 @@ +# Test non empty [] operator; not allowed as predicate +@prefix : . +[ :a :b ] :c :d . +:e :f [ :g :h ] . diff --git a/tests/turtle-2013/turtle-subm-07.nt b/tests/turtle-2013/turtle-subm-07.nt new file mode 100644 index 0000000..49961ea --- /dev/null +++ b/tests/turtle-2013/turtle-subm-07.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/turtle-subm-07.ttl b/tests/turtle-2013/turtle-subm-07.ttl new file mode 100644 index 0000000..9c1005c --- /dev/null +++ b/tests/turtle-2013/turtle-subm-07.ttl @@ -0,0 +1,3 @@ +# 'a' only allowed as a predicate +@prefix : . +:a a :b . diff --git a/tests/turtle-2013/turtle-subm-08.nt b/tests/turtle-2013/turtle-subm-08.nt new file mode 100644 index 0000000..7ab6806 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-08.nt @@ -0,0 +1,5 @@ +_:genid1 "banana" . +_:genid1 . +_:genid2 "apple" . +_:genid2 _:genid1 . + _:genid2 . diff --git a/tests/turtle-2013/turtle-subm-08.ttl b/tests/turtle-2013/turtle-subm-08.ttl new file mode 100644 index 0000000..8455940 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-08.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b ( "apple" "banana" ) . + diff --git a/tests/turtle-2013/turtle-subm-09.nt b/tests/turtle-2013/turtle-subm-09.nt new file mode 100644 index 0000000..a77939c --- /dev/null +++ b/tests/turtle-2013/turtle-subm-09.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/turtle-subm-09.ttl b/tests/turtle-2013/turtle-subm-09.ttl new file mode 100644 index 0000000..adce0a2 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-09.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b ( ) . + diff --git a/tests/turtle-2013/turtle-subm-10.nt b/tests/turtle-2013/turtle-subm-10.nt new file mode 100644 index 0000000..5fdb909 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-10.nt @@ -0,0 +1,4 @@ +_:hasParent . +_:genid1 . +_:genid1 _:hasParent . +_:genid1 "2"^^ . diff --git a/tests/turtle-2013/turtle-subm-10.ttl b/tests/turtle-2013/turtle-subm-10.ttl new file mode 100644 index 0000000..0afe1b0 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-10.ttl @@ -0,0 +1,10 @@ +# Test integer datatyped literals using an OWL cardinality constraint +@prefix owl: . + +# based on examples in the OWL Reference + +_:hasParent a owl:ObjectProperty . + +[] a owl:Restriction ; + owl:onProperty _:hasParent ; + owl:maxCardinality 2 . diff --git a/tests/turtle-2013/turtle-subm-11.nt b/tests/turtle-2013/turtle-subm-11.nt new file mode 100644 index 0000000..ff88aa6 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-11.nt @@ -0,0 +1,5 @@ + "000000"^^ . + "0"^^ . + "000001"^^ . + "2"^^ . + "4"^^ . diff --git a/tests/turtle-2013/turtle-subm-11.ttl b/tests/turtle-2013/turtle-subm-11.ttl new file mode 100644 index 0000000..5d36360 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-11.ttl @@ -0,0 +1,5 @@ + 000000 . + 0 . + 000001 . + 2 . + 4 . diff --git a/tests/turtle-2013/turtle-subm-12.nt b/tests/turtle-2013/turtle-subm-12.nt new file mode 100644 index 0000000..f936a5b --- /dev/null +++ b/tests/turtle-2013/turtle-subm-12.nt @@ -0,0 +1,4 @@ + "a" . + "b" . + "c" . + "d" . diff --git a/tests/turtle-2013/turtle-subm-12.ttl b/tests/turtle-2013/turtle-subm-12.ttl new file mode 100644 index 0000000..3de1a43 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-12.ttl @@ -0,0 +1,10 @@ +# Tests for - and _ in names, qnames +@prefix ex1: . +@prefix ex-2: . +@prefix ex3_: . +@prefix ex4-: . + +ex1:foo-bar ex1:foo_bar "a" . +ex-2:foo-bar ex-2:foo_bar "b" . +ex3_:foo-bar ex3_:foo_bar "c" . +ex4-:foo-bar ex4-:foo_bar "d" . diff --git a/tests/turtle-2013/turtle-subm-13.nt b/tests/turtle-2013/turtle-subm-13.nt new file mode 100644 index 0000000..67404a5 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-13.nt @@ -0,0 +1,4 @@ + "1" . + "2" . + "def" . + "678" . diff --git a/tests/turtle-2013/turtle-subm-13.ttl b/tests/turtle-2013/turtle-subm-13.ttl new file mode 100644 index 0000000..1fed9f5 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-13.ttl @@ -0,0 +1,9 @@ +# Tests for rdf:_ and other qnames starting with _ +@prefix rdf: . +@prefix ex: . +@prefix : . + +ex:foo rdf:_1 "1" . +ex:foo rdf:_2 "2" . +ex:foo :_abc "def" . +ex:foo :_345 "678" . diff --git a/tests/turtle-2013/turtle-subm-14.nt b/tests/turtle-2013/turtle-subm-14.nt new file mode 100644 index 0000000..9feb5ad --- /dev/null +++ b/tests/turtle-2013/turtle-subm-14.nt @@ -0,0 +1,2 @@ +_:genid1 _:genid2 . + . diff --git a/tests/turtle-2013/turtle-subm-14.ttl b/tests/turtle-2013/turtle-subm-14.ttl new file mode 100644 index 0000000..a8be95b --- /dev/null +++ b/tests/turtle-2013/turtle-subm-14.ttl @@ -0,0 +1,7 @@ +# Test for : allowed +@prefix : . + +[] : [] . + +: : : . + diff --git a/tests/turtle-2013/turtle-subm-15.nt b/tests/turtle-2013/turtle-subm-15.nt new file mode 100644 index 0000000..466edbb --- /dev/null +++ b/tests/turtle-2013/turtle-subm-15.nt @@ -0,0 +1 @@ + "a long\n\tliteral\nwith\nnewlines" . diff --git a/tests/turtle-2013/turtle-subm-15.ttl b/tests/turtle-2013/turtle-subm-15.ttl new file mode 100644 index 0000000..86c453b --- /dev/null +++ b/tests/turtle-2013/turtle-subm-15.ttl @@ -0,0 +1,6 @@ +# Test long literal +@prefix : . +:a :b """a long + literal +with +newlines""" . diff --git a/tests/turtle-2013/turtle-subm-16.nt b/tests/turtle-2013/turtle-subm-16.nt new file mode 100644 index 0000000..7726bbf --- /dev/null +++ b/tests/turtle-2013/turtle-subm-16.nt @@ -0,0 +1,2 @@ + "\nthis \ris a \U00012451long\t\nliteral\uABCD\n" . + "\tThis \uABCDis\r \U00012451another\n\none\n" . diff --git a/tests/turtle-2013/turtle-subm-16.ttl b/tests/turtle-2013/turtle-subm-16.ttl new file mode 100644 index 0000000..f5482d4 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-16.ttl @@ -0,0 +1,20 @@ +@prefix : . + +## \U00015678 is a not a legal codepoint +## :a :b """\nthis \ris a \U00015678long\t +## literal\uABCD +## """ . +## +## :d :e """\tThis \uABCDis\r \U00015678another\n +## one +## """ . + +# \U00015678 is a not a legal codepoint +# \U00012451 in Cuneiform numeric ban 3 +:a :b """\nthis \ris a \U00012451long\t +literal\uABCD +""" . + +:d :e """\tThis \uABCDis\r \U00012451another\n +one +""" . diff --git a/tests/turtle-2013/turtle-subm-17.nt b/tests/turtle-2013/turtle-subm-17.nt new file mode 100644 index 0000000..2e2dbe4 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-17.nt @@ -0,0 +1 @@ + "1.0"^^ . diff --git a/tests/turtle-2013/turtle-subm-17.ttl b/tests/turtle-2013/turtle-subm-17.ttl new file mode 100644 index 0000000..9de0c07 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-17.ttl @@ -0,0 +1,4 @@ +@prefix : . + +:a :b 1.0 . + diff --git a/tests/turtle-2013/turtle-subm-18.nt b/tests/turtle-2013/turtle-subm-18.nt new file mode 100644 index 0000000..fff2da5 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-18.nt @@ -0,0 +1,2 @@ + "" . + "" . diff --git a/tests/turtle-2013/turtle-subm-18.ttl b/tests/turtle-2013/turtle-subm-18.ttl new file mode 100644 index 0000000..37a9a4f --- /dev/null +++ b/tests/turtle-2013/turtle-subm-18.ttl @@ -0,0 +1,6 @@ +@prefix : . + +:a :b "" . + +:c :d """""" . + diff --git a/tests/turtle-2013/turtle-subm-19.nt b/tests/turtle-2013/turtle-subm-19.nt new file mode 100644 index 0000000..d5dca69 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-19.nt @@ -0,0 +1,3 @@ + "1.0"^^ . + "1"^^ . + "1.0e0"^^ . diff --git a/tests/turtle-2013/turtle-subm-19.ttl b/tests/turtle-2013/turtle-subm-19.ttl new file mode 100644 index 0000000..a8e8dc1 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-19.ttl @@ -0,0 +1,4 @@ +@prefix : . +:a :b 1.0 . +:c :d 1 . +:e :f 1.0e0 . diff --git a/tests/turtle-2013/turtle-subm-20.nt b/tests/turtle-2013/turtle-subm-20.nt new file mode 100644 index 0000000..3d0f970 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-20.nt @@ -0,0 +1,3 @@ + "-1.0"^^ . + "-1"^^ . + "-1.0e0"^^ . diff --git a/tests/turtle-2013/turtle-subm-20.ttl b/tests/turtle-2013/turtle-subm-20.ttl new file mode 100644 index 0000000..9b1a725 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-20.ttl @@ -0,0 +1,4 @@ +@prefix : . +:a :b -1.0 . +:c :d -1 . +:e :f -1.0e0 . diff --git a/tests/turtle-2013/turtle-subm-21.nt b/tests/turtle-2013/turtle-subm-21.nt new file mode 100644 index 0000000..fde3131 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-21.nt @@ -0,0 +1 @@ + "John said: \"Hello World!\"" . diff --git a/tests/turtle-2013/turtle-subm-21.ttl b/tests/turtle-2013/turtle-subm-21.ttl new file mode 100644 index 0000000..9f5360a --- /dev/null +++ b/tests/turtle-2013/turtle-subm-21.ttl @@ -0,0 +1,3 @@ +# Test long literal +@prefix : . +:a :b """John said: "Hello World!\"""" . diff --git a/tests/turtle-2013/turtle-subm-22.nt b/tests/turtle-2013/turtle-subm-22.nt new file mode 100644 index 0000000..5a70bff --- /dev/null +++ b/tests/turtle-2013/turtle-subm-22.nt @@ -0,0 +1,2 @@ + "true"^^ . + "false"^^ . diff --git a/tests/turtle-2013/turtle-subm-22.ttl b/tests/turtle-2013/turtle-subm-22.ttl new file mode 100644 index 0000000..25f3b75 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-22.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b true . +:c :d false . diff --git a/tests/turtle-2013/turtle-subm-23.nt b/tests/turtle-2013/turtle-subm-23.nt new file mode 100644 index 0000000..1a38415 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-23.nt @@ -0,0 +1,7 @@ + . + . + . + . + . + . + . diff --git a/tests/turtle-2013/turtle-subm-23.ttl b/tests/turtle-2013/turtle-subm-23.ttl new file mode 100644 index 0000000..310349d --- /dev/null +++ b/tests/turtle-2013/turtle-subm-23.ttl @@ -0,0 +1,14 @@ +# comment test +@prefix : . +:a :b :c . # end of line comment +:d # ignore me + :e # and me + :f # and me + . +:g :h #ignore me + :i, # and me + :j . # and me + +:k :l :m ; #ignore me + :n :o ; # and me + :p :q . # and me diff --git a/tests/turtle-2013/turtle-subm-24.nt b/tests/turtle-2013/turtle-subm-24.nt new file mode 100644 index 0000000..ad105cf --- /dev/null +++ b/tests/turtle-2013/turtle-subm-24.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/turtle-subm-24.ttl b/tests/turtle-2013/turtle-subm-24.ttl new file mode 100644 index 0000000..0667c6b --- /dev/null +++ b/tests/turtle-2013/turtle-subm-24.ttl @@ -0,0 +1,4 @@ +# comment line with no final newline test +@prefix : . +:a :b :c . +#foo diff --git a/tests/turtle-2013/turtle-subm-25.nt b/tests/turtle-2013/turtle-subm-25.nt new file mode 100644 index 0000000..7da0635 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-25.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/turtle-subm-25.ttl b/tests/turtle-2013/turtle-subm-25.ttl new file mode 100644 index 0000000..569023c --- /dev/null +++ b/tests/turtle-2013/turtle-subm-25.ttl @@ -0,0 +1,5 @@ +@prefix foo: . +@prefix foo: . + +foo:blah foo:blah foo:blah . + diff --git a/tests/turtle-2013/turtle-subm-26.nt b/tests/turtle-2013/turtle-subm-26.nt new file mode 100644 index 0000000..7357dd4 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-26.nt @@ -0,0 +1,22 @@ + "2.345"^^ . + "1"^^ . + "1.0"^^ . + "1."^^ . + "1.000000000"^^ . + "2.3"^^ . + "2.234000005"^^ . + "2.2340000005"^^ . + "2.23400000005"^^ . + "2.234000000005"^^ . + "2.2340000000005"^^ . + "2.23400000000005"^^ . + "2.234000000000005"^^ . + "2.2340000000000005"^^ . + "2.23400000000000005"^^ . + "2.234000000000000005"^^ . + "2.2340000000000000005"^^ . + "2.23400000000000000005"^^ . + "2.234000000000000000005"^^ . + "2.2340000000000000000005"^^ . + "2.23400000000000000000005"^^ . + "1.2345678901234567890123457890"^^ . diff --git a/tests/turtle-2013/turtle-subm-26.ttl b/tests/turtle-2013/turtle-subm-26.ttl new file mode 100644 index 0000000..7357dd4 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-26.ttl @@ -0,0 +1,22 @@ + "2.345"^^ . + "1"^^ . + "1.0"^^ . + "1."^^ . + "1.000000000"^^ . + "2.3"^^ . + "2.234000005"^^ . + "2.2340000005"^^ . + "2.23400000005"^^ . + "2.234000000005"^^ . + "2.2340000000005"^^ . + "2.23400000000005"^^ . + "2.234000000000005"^^ . + "2.2340000000000005"^^ . + "2.23400000000000005"^^ . + "2.234000000000000005"^^ . + "2.2340000000000000005"^^ . + "2.23400000000000000005"^^ . + "2.234000000000000000005"^^ . + "2.2340000000000000000005"^^ . + "2.23400000000000000000005"^^ . + "1.2345678901234567890123457890"^^ . diff --git a/tests/turtle-2013/turtle-subm-27.nt b/tests/turtle-2013/turtle-subm-27.nt new file mode 100644 index 0000000..f9ebfef --- /dev/null +++ b/tests/turtle-2013/turtle-subm-27.nt @@ -0,0 +1,5 @@ + . + . + . + . + . diff --git a/tests/turtle-2013/turtle-subm-27.ttl b/tests/turtle-2013/turtle-subm-27.ttl new file mode 100644 index 0000000..ad39c02 --- /dev/null +++ b/tests/turtle-2013/turtle-subm-27.ttl @@ -0,0 +1,12 @@ +# In-scope base URI is at this point + . +@base . +# In-scope base URI is http://example.org/ns/ at this point + . +@base . +# In-scope base URI is http://example.org/ns/foo/ at this point + . +@prefix : . +:a4 :b4 :c4 . +@prefix : . +:a5 :b5 :c5 . diff --git a/tests/turtle-2013/turtle-syntax-bad-LITERAL2_with_langtag_and_datatype.ttl b/tests/turtle-2013/turtle-syntax-bad-LITERAL2_with_langtag_and_datatype.ttl new file mode 100644 index 0000000..5618041 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-LITERAL2_with_langtag_and_datatype.ttl @@ -0,0 +1 @@ + "value"@en^^ . diff --git a/tests/turtle-2013/turtle-syntax-bad-base-01.ttl b/tests/turtle-2013/turtle-syntax-bad-base-01.ttl new file mode 100644 index 0000000..7b0412f --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-base-01.ttl @@ -0,0 +1,2 @@ +# @base without URI. +@base . diff --git a/tests/turtle-2013/turtle-syntax-bad-base-02.ttl b/tests/turtle-2013/turtle-syntax-bad-base-02.ttl new file mode 100644 index 0000000..8893b65 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-base-02.ttl @@ -0,0 +1,2 @@ +# @base in wrong case. +@BASE . diff --git a/tests/turtle-2013/turtle-syntax-bad-base-03.ttl b/tests/turtle-2013/turtle-syntax-bad-base-03.ttl new file mode 100644 index 0000000..013f9f2 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-base-03.ttl @@ -0,0 +1,3 @@ +# FULL STOP used after SPARQL BASE +BASE . +

. diff --git a/tests/turtle-2013/turtle-syntax-bad-blank-label-dot-end.ttl b/tests/turtle-2013/turtle-syntax-bad-blank-label-dot-end.ttl new file mode 100644 index 0000000..58c0aa2 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-blank-label-dot-end.ttl @@ -0,0 +1,2 @@ +@prefix : . +_:b1. :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-esc-01.ttl b/tests/turtle-2013/turtle-syntax-bad-esc-01.ttl new file mode 100644 index 0000000..6daa1b5 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-esc-01.ttl @@ -0,0 +1,2 @@ +# Bad string escape + "a\zb" . diff --git a/tests/turtle-2013/turtle-syntax-bad-esc-02.ttl b/tests/turtle-2013/turtle-syntax-bad-esc-02.ttl new file mode 100644 index 0000000..62457eb --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-esc-02.ttl @@ -0,0 +1,2 @@ +# Bad string escape + "\uWXYZ" . diff --git a/tests/turtle-2013/turtle-syntax-bad-esc-03.ttl b/tests/turtle-2013/turtle-syntax-bad-esc-03.ttl new file mode 100644 index 0000000..a9b9f1c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-esc-03.ttl @@ -0,0 +1,2 @@ +# Bad string escape + "\U0000WXYZ" . diff --git a/tests/turtle-2013/turtle-syntax-bad-esc-04.ttl b/tests/turtle-2013/turtle-syntax-bad-esc-04.ttl new file mode 100644 index 0000000..a9b9f1c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-esc-04.ttl @@ -0,0 +1,2 @@ +# Bad string escape + "\U0000WXYZ" . diff --git a/tests/turtle-2013/turtle-syntax-bad-kw-01.ttl b/tests/turtle-2013/turtle-syntax-bad-kw-01.ttl new file mode 100644 index 0000000..f85448d --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-kw-01.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s A :C . diff --git a/tests/turtle-2013/turtle-syntax-bad-kw-02.ttl b/tests/turtle-2013/turtle-syntax-bad-kw-02.ttl new file mode 100644 index 0000000..d25986c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-kw-02.ttl @@ -0,0 +1,2 @@ +@prefix : . +a :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-kw-03.ttl b/tests/turtle-2013/turtle-syntax-bad-kw-03.ttl new file mode 100644 index 0000000..3d54b92 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-kw-03.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p a . diff --git a/tests/turtle-2013/turtle-syntax-bad-kw-04.ttl b/tests/turtle-2013/turtle-syntax-bad-kw-04.ttl new file mode 100644 index 0000000..229491e --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-kw-04.ttl @@ -0,0 +1,2 @@ +@prefix : . +true :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-kw-05.ttl b/tests/turtle-2013/turtle-syntax-bad-kw-05.ttl new file mode 100644 index 0000000..c2420af --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-kw-05.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s true :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-lang-01.ttl b/tests/turtle-2013/turtle-syntax-bad-lang-01.ttl new file mode 100644 index 0000000..80685aa --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-lang-01.ttl @@ -0,0 +1,2 @@ +# Bad lang tag + "string"@1 . diff --git a/tests/turtle-2013/turtle-syntax-bad-ln-dash-start.ttl b/tests/turtle-2013/turtle-syntax-bad-ln-dash-start.ttl new file mode 100644 index 0000000..9af36a1 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-ln-dash-start.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p :-o . diff --git a/tests/turtle-2013/turtle-syntax-bad-ln-escape-start.ttl b/tests/turtle-2013/turtle-syntax-bad-ln-escape-start.ttl new file mode 100644 index 0000000..9c7a435 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-ln-escape-start.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p :%2o . diff --git a/tests/turtle-2013/turtle-syntax-bad-ln-escape.ttl b/tests/turtle-2013/turtle-syntax-bad-ln-escape.ttl new file mode 100644 index 0000000..212d43a --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-ln-escape.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p :o%2 . diff --git a/tests/turtle-2013/turtle-syntax-bad-missing-ns-dot-end.ttl b/tests/turtle-2013/turtle-syntax-bad-missing-ns-dot-end.ttl new file mode 100644 index 0000000..d06f4e6 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-missing-ns-dot-end.ttl @@ -0,0 +1 @@ +valid:s valid:p invalid.:o . diff --git a/tests/turtle-2013/turtle-syntax-bad-missing-ns-dot-start.ttl b/tests/turtle-2013/turtle-syntax-bad-missing-ns-dot-start.ttl new file mode 100644 index 0000000..23514bc --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-missing-ns-dot-start.ttl @@ -0,0 +1 @@ +.undefined:s .undefined:p .undefined:o . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-01.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-01.ttl new file mode 100644 index 0000000..f7b19b7 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-01.ttl @@ -0,0 +1,5 @@ +# {} fomulae not in Turtle +@prefix : . + +{ :a :q :c . } :p :z . + diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-02.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-02.ttl new file mode 100644 index 0000000..e834f15 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-02.ttl @@ -0,0 +1,4 @@ +# = is not Turtle +@prefix : . + +:a = :b . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-03.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-03.ttl new file mode 100644 index 0000000..ad5d6ad --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-03.ttl @@ -0,0 +1,7 @@ +# N3 paths +@prefix : . +@prefix ns: . + +:x. + ns:p. + ns:q :p :z . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-04.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-04.ttl new file mode 100644 index 0000000..895f9ec --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-04.ttl @@ -0,0 +1,5 @@ +# N3 paths +@prefix : . +@prefix ns: . + +:x^ns:p :p :z . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-05.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-05.ttl new file mode 100644 index 0000000..de879b1 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-05.ttl @@ -0,0 +1,4 @@ +# N3 is...of +@prefix : . + +:z is :p of :x . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-06.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-06.ttl new file mode 100644 index 0000000..56610f6 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-06.ttl @@ -0,0 +1,4 @@ +# = is not Turtle +@prefix : . + +:a.:b.:c . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-07.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-07.ttl new file mode 100644 index 0000000..419f7ca --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-07.ttl @@ -0,0 +1,3 @@ +# @keywords is not Turtle +@keywords a . +x a Item . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-08.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-08.ttl new file mode 100644 index 0000000..419f7ca --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-08.ttl @@ -0,0 +1,3 @@ +# @keywords is not Turtle +@keywords a . +x a Item . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-09.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-09.ttl new file mode 100644 index 0000000..f093b58 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-09.ttl @@ -0,0 +1,3 @@ +# => is not Turtle +@prefix : . +:s => :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-10.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-10.ttl new file mode 100644 index 0000000..974252f --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-10.ttl @@ -0,0 +1,3 @@ +# <= is not Turtle +@prefix : . +:s <= :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-11.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-11.ttl new file mode 100644 index 0000000..b74d74a --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-11.ttl @@ -0,0 +1,3 @@ +# @forSome is not Turtle +@prefix : . +@forSome :x . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-12.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-12.ttl new file mode 100644 index 0000000..dc2c5b0 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-12.ttl @@ -0,0 +1,3 @@ +# @forAll is not Turtle +@prefix : . +@forAll :x . diff --git a/tests/turtle-2013/turtle-syntax-bad-n3-extras-13.ttl b/tests/turtle-2013/turtle-syntax-bad-n3-extras-13.ttl new file mode 100644 index 0000000..5f719a2 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-n3-extras-13.ttl @@ -0,0 +1,3 @@ +# @keywords is not Turtle +@keywords . +x @a Item . diff --git a/tests/turtle-2013/turtle-syntax-bad-ns-dot-end.ttl b/tests/turtle-2013/turtle-syntax-bad-ns-dot-end.ttl new file mode 100644 index 0000000..fa67031 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-ns-dot-end.ttl @@ -0,0 +1,2 @@ +@prefix eg. : . +eg.:s eg.:p eg.:o . diff --git a/tests/turtle-2013/turtle-syntax-bad-ns-dot-start.ttl b/tests/turtle-2013/turtle-syntax-bad-ns-dot-start.ttl new file mode 100644 index 0000000..e09d595 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-ns-dot-start.ttl @@ -0,0 +1,2 @@ +@prefix .eg : . +.eg:s .eg:p .eg:o . diff --git a/tests/turtle-2013/turtle-syntax-bad-num-01.ttl b/tests/turtle-2013/turtle-syntax-bad-num-01.ttl new file mode 100644 index 0000000..cb4730c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-num-01.ttl @@ -0,0 +1 @@ + 123.abc . diff --git a/tests/turtle-2013/turtle-syntax-bad-num-02.ttl b/tests/turtle-2013/turtle-syntax-bad-num-02.ttl new file mode 100644 index 0000000..1c8cbb2 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-num-02.ttl @@ -0,0 +1 @@ + 123e . diff --git a/tests/turtle-2013/turtle-syntax-bad-num-03.ttl b/tests/turtle-2013/turtle-syntax-bad-num-03.ttl new file mode 100644 index 0000000..7c8fa2c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-num-03.ttl @@ -0,0 +1 @@ + 123abc . diff --git a/tests/turtle-2013/turtle-syntax-bad-num-04.ttl b/tests/turtle-2013/turtle-syntax-bad-num-04.ttl new file mode 100644 index 0000000..ad8e0cf --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-num-04.ttl @@ -0,0 +1 @@ + 0x123 . diff --git a/tests/turtle-2013/turtle-syntax-bad-num-05.ttl b/tests/turtle-2013/turtle-syntax-bad-num-05.ttl new file mode 100644 index 0000000..2ee461a --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-num-05.ttl @@ -0,0 +1 @@ + +-1 . diff --git a/tests/turtle-2013/turtle-syntax-bad-number-dot-in-anon.ttl b/tests/turtle-2013/turtle-syntax-bad-number-dot-in-anon.ttl new file mode 100644 index 0000000..779cbec --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-number-dot-in-anon.ttl @@ -0,0 +1,6 @@ +@prefix : . + +:s + :p [ + :p1 27. + ] . diff --git a/tests/turtle-2013/turtle-syntax-bad-pname-01.ttl b/tests/turtle-2013/turtle-syntax-bad-pname-01.ttl new file mode 100644 index 0000000..5f3098d --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-pname-01.ttl @@ -0,0 +1,3 @@ +# ~ must be escaped. +@prefix : . +:a~b :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-pname-02.ttl b/tests/turtle-2013/turtle-syntax-bad-pname-02.ttl new file mode 100644 index 0000000..fb30823 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-pname-02.ttl @@ -0,0 +1,3 @@ +# Bad %-sequence +@prefix : . +:a%2 :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-pname-03.ttl b/tests/turtle-2013/turtle-syntax-bad-pname-03.ttl new file mode 100644 index 0000000..b9af59e --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-pname-03.ttl @@ -0,0 +1,3 @@ +# No \u (x39 is "9") +@prefix : . +:a\u0039 :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bad-prefix-01.ttl b/tests/turtle-2013/turtle-syntax-bad-prefix-01.ttl new file mode 100644 index 0000000..b1b80df --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-prefix-01.ttl @@ -0,0 +1,2 @@ +# No prefix +:s "x" . diff --git a/tests/turtle-2013/turtle-syntax-bad-prefix-02.ttl b/tests/turtle-2013/turtle-syntax-bad-prefix-02.ttl new file mode 100644 index 0000000..6e7269f --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-prefix-02.ttl @@ -0,0 +1,3 @@ +# No prefix +@prefix rdf: . + rdf:type :C . diff --git a/tests/turtle-2013/turtle-syntax-bad-prefix-03.ttl b/tests/turtle-2013/turtle-syntax-bad-prefix-03.ttl new file mode 100644 index 0000000..1ab01e7 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-prefix-03.ttl @@ -0,0 +1,2 @@ +# @prefix without URI. +@prefix ex: . diff --git a/tests/turtle-2013/turtle-syntax-bad-prefix-04.ttl b/tests/turtle-2013/turtle-syntax-bad-prefix-04.ttl new file mode 100644 index 0000000..5f338f3 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-prefix-04.ttl @@ -0,0 +1,2 @@ +# @prefix without prefix name . +@prefix . diff --git a/tests/turtle-2013/turtle-syntax-bad-prefix-05.ttl b/tests/turtle-2013/turtle-syntax-bad-prefix-05.ttl new file mode 100644 index 0000000..efb86c5 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-prefix-05.ttl @@ -0,0 +1,2 @@ +# @prefix without : +@prefix x . diff --git a/tests/turtle-2013/turtle-syntax-bad-string-01.ttl b/tests/turtle-2013/turtle-syntax-bad-string-01.ttl new file mode 100644 index 0000000..ef62a6c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-string-01.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p "abc' . diff --git a/tests/turtle-2013/turtle-syntax-bad-string-02.ttl b/tests/turtle-2013/turtle-syntax-bad-string-02.ttl new file mode 100644 index 0000000..2335d52 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-string-02.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p 'abc" . diff --git a/tests/turtle-2013/turtle-syntax-bad-string-03.ttl b/tests/turtle-2013/turtle-syntax-bad-string-03.ttl new file mode 100644 index 0000000..8a9e7ff --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-string-03.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p '''abc' . diff --git a/tests/turtle-2013/turtle-syntax-bad-string-04.ttl b/tests/turtle-2013/turtle-syntax-bad-string-04.ttl new file mode 100644 index 0000000..9911def --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-string-04.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p """abc''' . diff --git a/tests/turtle-2013/turtle-syntax-bad-string-05.ttl b/tests/turtle-2013/turtle-syntax-bad-string-05.ttl new file mode 100644 index 0000000..f5de740 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-string-05.ttl @@ -0,0 +1,4 @@ +# Long literal with missing end +@prefix : . +:s :p """abc +def diff --git a/tests/turtle-2013/turtle-syntax-bad-string-06.ttl b/tests/turtle-2013/turtle-syntax-bad-string-06.ttl new file mode 100644 index 0000000..6bcbc93 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-string-06.ttl @@ -0,0 +1,3 @@ +# Long literal with 4" +@prefix : . +:s :p """abc""""@en . diff --git a/tests/turtle-2013/turtle-syntax-bad-string-07.ttl b/tests/turtle-2013/turtle-syntax-bad-string-07.ttl new file mode 100644 index 0000000..534614d --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-string-07.ttl @@ -0,0 +1,3 @@ +# Long literal with 4' +@prefix : . +:s :p '''abc''''@en . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-01.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-01.ttl new file mode 100644 index 0000000..7b8b852 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-01.ttl @@ -0,0 +1,2 @@ +# Turtle is not TriG +{ } diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-02.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-02.ttl new file mode 100644 index 0000000..cb86b9d --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-02.ttl @@ -0,0 +1,2 @@ +# Turtle is not N3 + = . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-03.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-03.ttl new file mode 100644 index 0000000..98d9c7e --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-03.ttl @@ -0,0 +1,2 @@ +# Turtle is not NQuads + . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-04.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-04.ttl new file mode 100644 index 0000000..40cd7b7 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-04.ttl @@ -0,0 +1,2 @@ +# Turtle does not allow literals-as-subjects +"hello" . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-05.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-05.ttl new file mode 100644 index 0000000..e1a3afb --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-05.ttl @@ -0,0 +1,2 @@ +# Turtle does not allow literals-as-predicates + "hello" . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-06.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-06.ttl new file mode 100644 index 0000000..2680229 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-06.ttl @@ -0,0 +1,2 @@ +# Turtle does not allow bnodes-as-predicates + [] . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-07.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-07.ttl new file mode 100644 index 0000000..5f74a8b --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-07.ttl @@ -0,0 +1,2 @@ +# Turtle does not allow bnodes-as-predicates + _:p . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-08.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-08.ttl new file mode 100644 index 0000000..86aaf4b --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-08.ttl @@ -0,0 +1,2 @@ +# No DOT + diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-09.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-09.ttl new file mode 100644 index 0000000..92aae4c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-09.ttl @@ -0,0 +1,2 @@ +# Too many DOT + . . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-10.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-10.ttl new file mode 100644 index 0000000..eb893b2 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-10.ttl @@ -0,0 +1,3 @@ +# Too many DOT + . . + . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-11.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-11.ttl new file mode 100644 index 0000000..fc6bb99 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-11.ttl @@ -0,0 +1,2 @@ +# Trailing ; + ; diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-12.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-12.ttl new file mode 100644 index 0000000..1038da8 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-12.ttl @@ -0,0 +1 @@ + diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-13.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-13.ttl new file mode 100644 index 0000000..1038da8 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-13.ttl @@ -0,0 +1 @@ + diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-14.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-14.ttl new file mode 100644 index 0000000..44db7be --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-14.ttl @@ -0,0 +1,2 @@ +# Literal as subject +"abc" . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-15.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-15.ttl new file mode 100644 index 0000000..788cfd6 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-15.ttl @@ -0,0 +1,2 @@ +# Literal as predicate + "abc" . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-16.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-16.ttl new file mode 100644 index 0000000..d30a80b --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-16.ttl @@ -0,0 +1,2 @@ +# BNode as predicate + [] . diff --git a/tests/turtle-2013/turtle-syntax-bad-struct-17.ttl b/tests/turtle-2013/turtle-syntax-bad-struct-17.ttl new file mode 100644 index 0000000..50ea265 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-struct-17.ttl @@ -0,0 +1,2 @@ +# BNode as predicate + _:a . diff --git a/tests/turtle-2013/turtle-syntax-bad-uri-01.ttl b/tests/turtle-2013/turtle-syntax-bad-uri-01.ttl new file mode 100644 index 0000000..ebea3f2 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-uri-01.ttl @@ -0,0 +1,2 @@ +# Bad IRI : space. + . diff --git a/tests/turtle-2013/turtle-syntax-bad-uri-02.ttl b/tests/turtle-2013/turtle-syntax-bad-uri-02.ttl new file mode 100644 index 0000000..e9096bc --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-uri-02.ttl @@ -0,0 +1,2 @@ +# Bad IRI : bad escape + . diff --git a/tests/turtle-2013/turtle-syntax-bad-uri-03.ttl b/tests/turtle-2013/turtle-syntax-bad-uri-03.ttl new file mode 100644 index 0000000..7fe2bf0 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-uri-03.ttl @@ -0,0 +1,2 @@ +# Bad IRI : bad escape + . diff --git a/tests/turtle-2013/turtle-syntax-bad-uri-04.ttl b/tests/turtle-2013/turtle-syntax-bad-uri-04.ttl new file mode 100644 index 0000000..258997c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-uri-04.ttl @@ -0,0 +1,2 @@ +# Bad IRI : character escapes not allowed. + . diff --git a/tests/turtle-2013/turtle-syntax-bad-uri-05.ttl b/tests/turtle-2013/turtle-syntax-bad-uri-05.ttl new file mode 100644 index 0000000..542b2b6 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bad-uri-05.ttl @@ -0,0 +1,2 @@ +# Bad IRI : character escapes not allowed. + . diff --git a/tests/turtle-2013/turtle-syntax-base-01.ttl b/tests/turtle-2013/turtle-syntax-base-01.ttl new file mode 100644 index 0000000..108ceaf --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-base-01.ttl @@ -0,0 +1 @@ +@base . diff --git a/tests/turtle-2013/turtle-syntax-base-02.ttl b/tests/turtle-2013/turtle-syntax-base-02.ttl new file mode 100644 index 0000000..7a2724f --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-base-02.ttl @@ -0,0 +1 @@ +BASE diff --git a/tests/turtle-2013/turtle-syntax-base-03.ttl b/tests/turtle-2013/turtle-syntax-base-03.ttl new file mode 100644 index 0000000..e90dc14 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-base-03.ttl @@ -0,0 +1,2 @@ +@base . +

. diff --git a/tests/turtle-2013/turtle-syntax-base-04.ttl b/tests/turtle-2013/turtle-syntax-base-04.ttl new file mode 100644 index 0000000..b0bb422 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-base-04.ttl @@ -0,0 +1,2 @@ +base +

. diff --git a/tests/turtle-2013/turtle-syntax-blank-label.nt b/tests/turtle-2013/turtle-syntax-blank-label.nt new file mode 100644 index 0000000..a1b96eb --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-blank-label.nt @@ -0,0 +1,3 @@ +_:0b . +_:_b . +_:b.0 . diff --git a/tests/turtle-2013/turtle-syntax-blank-label.ttl b/tests/turtle-2013/turtle-syntax-blank-label.ttl new file mode 100644 index 0000000..b7fae10 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-blank-label.ttl @@ -0,0 +1,4 @@ +@prefix : . +_:0b :p :o . # Starts with digit +_:_b :p :o . # Starts with underscore +_:b.0 :p :o . # Contains dot, ends with digit diff --git a/tests/turtle-2013/turtle-syntax-bnode-01.ttl b/tests/turtle-2013/turtle-syntax-bnode-01.ttl new file mode 100644 index 0000000..274a478 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-01.ttl @@ -0,0 +1,2 @@ +@prefix : . +[] :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bnode-02.ttl b/tests/turtle-2013/turtle-syntax-bnode-02.ttl new file mode 100644 index 0000000..91b9c16 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-02.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p [] . diff --git a/tests/turtle-2013/turtle-syntax-bnode-03.ttl b/tests/turtle-2013/turtle-syntax-bnode-03.ttl new file mode 100644 index 0000000..36c8450 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-03.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p [ :q :o ] . diff --git a/tests/turtle-2013/turtle-syntax-bnode-04.ttl b/tests/turtle-2013/turtle-syntax-bnode-04.ttl new file mode 100644 index 0000000..942dedd --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-04.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p [ :q1 :o1 ; :q2 :o2 ] . diff --git a/tests/turtle-2013/turtle-syntax-bnode-05.ttl b/tests/turtle-2013/turtle-syntax-bnode-05.ttl new file mode 100644 index 0000000..c2f4169 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-05.ttl @@ -0,0 +1,2 @@ +@prefix : . +[ :q1 :o1 ; :q2 :o2 ] :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bnode-06.ttl b/tests/turtle-2013/turtle-syntax-bnode-06.ttl new file mode 100644 index 0000000..f9ffec8 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-06.ttl @@ -0,0 +1,2 @@ +@prefix : . +_:a :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bnode-07.ttl b/tests/turtle-2013/turtle-syntax-bnode-07.ttl new file mode 100644 index 0000000..c0dba05 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-07.ttl @@ -0,0 +1,3 @@ +@prefix : . +:s :p _:a . +_:a :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bnode-08.ttl b/tests/turtle-2013/turtle-syntax-bnode-08.ttl new file mode 100644 index 0000000..630843b --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-08.ttl @@ -0,0 +1,2 @@ +@prefix : . +[ :p :o ] . diff --git a/tests/turtle-2013/turtle-syntax-bnode-09.ttl b/tests/turtle-2013/turtle-syntax-bnode-09.ttl new file mode 100644 index 0000000..cd75e3a --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-09.ttl @@ -0,0 +1,3 @@ +@prefix : . +[ :p :o1,:2 ] . +:s :p :o . diff --git a/tests/turtle-2013/turtle-syntax-bnode-10.ttl b/tests/turtle-2013/turtle-syntax-bnode-10.ttl new file mode 100644 index 0000000..03fa67c --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-bnode-10.ttl @@ -0,0 +1,5 @@ +@prefix : . + +:s1 :p :o . +[ :p1 :o1 ; :p2 :o2 ] . +:s2 :p :o . diff --git a/tests/turtle-2013/turtle-syntax-datatypes-01.ttl b/tests/turtle-2013/turtle-syntax-datatypes-01.ttl new file mode 100644 index 0000000..9e273c5 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-datatypes-01.ttl @@ -0,0 +1,2 @@ +@prefix xsd: . +

"123"^^xsd:byte . diff --git a/tests/turtle-2013/turtle-syntax-datatypes-02.ttl b/tests/turtle-2013/turtle-syntax-datatypes-02.ttl new file mode 100644 index 0000000..477bd73 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-datatypes-02.ttl @@ -0,0 +1,3 @@ +@prefix rdf: . +@prefix xsd: . +

"123"^^xsd:string . diff --git a/tests/turtle-2013/turtle-syntax-file-01.ttl b/tests/turtle-2013/turtle-syntax-file-01.ttl new file mode 100644 index 0000000..e69de29 diff --git a/tests/turtle-2013/turtle-syntax-file-02.ttl b/tests/turtle-2013/turtle-syntax-file-02.ttl new file mode 100644 index 0000000..e6d327d --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-file-02.ttl @@ -0,0 +1 @@ +#Empty file. diff --git a/tests/turtle-2013/turtle-syntax-file-03.ttl b/tests/turtle-2013/turtle-syntax-file-03.ttl new file mode 100644 index 0000000..a9ca035 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-file-03.ttl @@ -0,0 +1,2 @@ +#One comment, one empty line. + diff --git a/tests/turtle-2013/turtle-syntax-kw-01.ttl b/tests/turtle-2013/turtle-syntax-kw-01.ttl new file mode 100644 index 0000000..854c756 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-kw-01.ttl @@ -0,0 +1 @@ +

true . diff --git a/tests/turtle-2013/turtle-syntax-kw-02.ttl b/tests/turtle-2013/turtle-syntax-kw-02.ttl new file mode 100644 index 0000000..c948160 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-kw-02.ttl @@ -0,0 +1 @@ +

false . diff --git a/tests/turtle-2013/turtle-syntax-kw-03.ttl b/tests/turtle-2013/turtle-syntax-kw-03.ttl new file mode 100644 index 0000000..bb479bf --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-kw-03.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s a :C . diff --git a/tests/turtle-2013/turtle-syntax-lists-01.ttl b/tests/turtle-2013/turtle-syntax-lists-01.ttl new file mode 100644 index 0000000..c6ee0fb --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-lists-01.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p () . diff --git a/tests/turtle-2013/turtle-syntax-lists-02.ttl b/tests/turtle-2013/turtle-syntax-lists-02.ttl new file mode 100644 index 0000000..06a0cd1 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-lists-02.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p (1 "2" :o) . diff --git a/tests/turtle-2013/turtle-syntax-lists-03.ttl b/tests/turtle-2013/turtle-syntax-lists-03.ttl new file mode 100644 index 0000000..e71f027 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-lists-03.ttl @@ -0,0 +1,2 @@ +@prefix : . +(1) :p (1) . diff --git a/tests/turtle-2013/turtle-syntax-lists-04.ttl b/tests/turtle-2013/turtle-syntax-lists-04.ttl new file mode 100644 index 0000000..a988538 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-lists-04.ttl @@ -0,0 +1,2 @@ +@prefix : . +(()) :p (()) . diff --git a/tests/turtle-2013/turtle-syntax-lists-05.ttl b/tests/turtle-2013/turtle-syntax-lists-05.ttl new file mode 100644 index 0000000..43e68a4 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-lists-05.ttl @@ -0,0 +1,2 @@ +@prefix : . +(1 2 (1 2)) :p (( "a") "b" :o) . diff --git a/tests/turtle-2013/turtle-syntax-ln-colons.nt b/tests/turtle-2013/turtle-syntax-ln-colons.nt new file mode 100644 index 0000000..20ac2d1 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-ln-colons.nt @@ -0,0 +1,5 @@ + . + . + . + . + . diff --git a/tests/turtle-2013/turtle-syntax-ln-colons.ttl b/tests/turtle-2013/turtle-syntax-ln-colons.ttl new file mode 100644 index 0000000..80a2e3d --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-ln-colons.ttl @@ -0,0 +1,6 @@ +@prefix : . +:s:1 :p:1 :o:1 . +:s::2 :p::2 :o::2 . +:3:s :3:p :3 . +::s ::p ::o . +::s: ::p: ::o: . diff --git a/tests/turtle-2013/turtle-syntax-ln-dots.nt b/tests/turtle-2013/turtle-syntax-ln-dots.nt new file mode 100644 index 0000000..43101c1 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-ln-dots.nt @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/turtle-2013/turtle-syntax-ln-dots.ttl b/tests/turtle-2013/turtle-syntax-ln-dots.ttl new file mode 100644 index 0000000..ca5bba9 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-ln-dots.ttl @@ -0,0 +1,4 @@ +@prefix : . +:s.1 :p.1 :o.1 . +:s..2 :p..2 :o..2. +:3.s :3.p :3. diff --git a/tests/turtle-2013/turtle-syntax-ns-dots.ttl b/tests/turtle-2013/turtle-syntax-ns-dots.ttl new file mode 100644 index 0000000..1059b57 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-ns-dots.ttl @@ -0,0 +1,2 @@ +@prefix e.g: . +e.g:s e.g:p e.g:o . diff --git a/tests/turtle-2013/turtle-syntax-number-01.ttl b/tests/turtle-2013/turtle-syntax-number-01.ttl new file mode 100644 index 0000000..016fa8f --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-01.ttl @@ -0,0 +1 @@ +

123 . diff --git a/tests/turtle-2013/turtle-syntax-number-02.ttl b/tests/turtle-2013/turtle-syntax-number-02.ttl new file mode 100644 index 0000000..66d1b38 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-02.ttl @@ -0,0 +1 @@ +

-123 . diff --git a/tests/turtle-2013/turtle-syntax-number-03.ttl b/tests/turtle-2013/turtle-syntax-number-03.ttl new file mode 100644 index 0000000..4414285 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-03.ttl @@ -0,0 +1 @@ +

+123 . diff --git a/tests/turtle-2013/turtle-syntax-number-04.ttl b/tests/turtle-2013/turtle-syntax-number-04.ttl new file mode 100644 index 0000000..ab48cbc --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-04.ttl @@ -0,0 +1,2 @@ +# This is a decimal. +

123.0 . diff --git a/tests/turtle-2013/turtle-syntax-number-05.ttl b/tests/turtle-2013/turtle-syntax-number-05.ttl new file mode 100644 index 0000000..a8d5845 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-05.ttl @@ -0,0 +1,2 @@ +# This is a decimal. +

.1 . diff --git a/tests/turtle-2013/turtle-syntax-number-06.ttl b/tests/turtle-2013/turtle-syntax-number-06.ttl new file mode 100644 index 0000000..cb3a2b0 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-06.ttl @@ -0,0 +1,2 @@ +# This is a decimal. +

-123.0 . diff --git a/tests/turtle-2013/turtle-syntax-number-07.ttl b/tests/turtle-2013/turtle-syntax-number-07.ttl new file mode 100644 index 0000000..8b0050e --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-07.ttl @@ -0,0 +1,2 @@ +# This is a decimal. +

+123.0 . diff --git a/tests/turtle-2013/turtle-syntax-number-08.ttl b/tests/turtle-2013/turtle-syntax-number-08.ttl new file mode 100644 index 0000000..70ddeed --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-08.ttl @@ -0,0 +1,2 @@ +# This is an integer +

123. diff --git a/tests/turtle-2013/turtle-syntax-number-09.ttl b/tests/turtle-2013/turtle-syntax-number-09.ttl new file mode 100644 index 0000000..386b819 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-09.ttl @@ -0,0 +1 @@ +

123.0e1 . diff --git a/tests/turtle-2013/turtle-syntax-number-10.ttl b/tests/turtle-2013/turtle-syntax-number-10.ttl new file mode 100644 index 0000000..46875e9 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-10.ttl @@ -0,0 +1 @@ +

-123e-1 . diff --git a/tests/turtle-2013/turtle-syntax-number-11.ttl b/tests/turtle-2013/turtle-syntax-number-11.ttl new file mode 100644 index 0000000..1d8c367 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-number-11.ttl @@ -0,0 +1 @@ +

123.E+1 . diff --git a/tests/turtle-2013/turtle-syntax-pname-esc-01.ttl b/tests/turtle-2013/turtle-syntax-pname-esc-01.ttl new file mode 100644 index 0000000..5a3a5fd --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-pname-esc-01.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p :\~\.\-\!\$\&\'\(\)\*\+\,\;\=\/\?\#\@\_\%AA . diff --git a/tests/turtle-2013/turtle-syntax-pname-esc-02.ttl b/tests/turtle-2013/turtle-syntax-pname-esc-02.ttl new file mode 100644 index 0000000..5d806cf --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-pname-esc-02.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p :0123\~\.\-\!\$\&\'\(\)\*\+\,\;\=\/\?\#\@\_\%AA123 . diff --git a/tests/turtle-2013/turtle-syntax-pname-esc-03.ttl b/tests/turtle-2013/turtle-syntax-pname-esc-03.ttl new file mode 100644 index 0000000..9949c52 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-pname-esc-03.ttl @@ -0,0 +1,2 @@ +@prefix : . +:xyz\~ :abc\.: : . diff --git a/tests/turtle-2013/turtle-syntax-prefix-01.ttl b/tests/turtle-2013/turtle-syntax-prefix-01.ttl new file mode 100644 index 0000000..7fd6932 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-01.ttl @@ -0,0 +1 @@ +@prefix : . diff --git a/tests/turtle-2013/turtle-syntax-prefix-02.ttl b/tests/turtle-2013/turtle-syntax-prefix-02.ttl new file mode 100644 index 0000000..99d4ae4 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-02.ttl @@ -0,0 +1 @@ +PreFIX : diff --git a/tests/turtle-2013/turtle-syntax-prefix-03.ttl b/tests/turtle-2013/turtle-syntax-prefix-03.ttl new file mode 100644 index 0000000..c834d10 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-03.ttl @@ -0,0 +1,2 @@ +PREFIX : +:s :p :123 . diff --git a/tests/turtle-2013/turtle-syntax-prefix-04.ttl b/tests/turtle-2013/turtle-syntax-prefix-04.ttl new file mode 100644 index 0000000..4ff94dc --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-04.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p :%20 . diff --git a/tests/turtle-2013/turtle-syntax-prefix-05.ttl b/tests/turtle-2013/turtle-syntax-prefix-05.ttl new file mode 100644 index 0000000..3044102 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-05.ttl @@ -0,0 +1,2 @@ +@prefix : . +: : : . diff --git a/tests/turtle-2013/turtle-syntax-prefix-06.ttl b/tests/turtle-2013/turtle-syntax-prefix-06.ttl new file mode 100644 index 0000000..7044be5 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-06.ttl @@ -0,0 +1,4 @@ +# colon is a legal pname character +@prefix : . +@prefix x: . +:a:b:c x:d:e:f :::: . diff --git a/tests/turtle-2013/turtle-syntax-prefix-07.ttl b/tests/turtle-2013/turtle-syntax-prefix-07.ttl new file mode 100644 index 0000000..1db61e8 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-07.ttl @@ -0,0 +1,3 @@ +# dash is a legal pname character +@prefix x: . +x:a-b-c x:p x:o . diff --git a/tests/turtle-2013/turtle-syntax-prefix-08.ttl b/tests/turtle-2013/turtle-syntax-prefix-08.ttl new file mode 100644 index 0000000..f969a4a --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-08.ttl @@ -0,0 +1,3 @@ +# underscore is a legal pname character +@prefix x: . +x:_ x:p_1 x:o . diff --git a/tests/turtle-2013/turtle-syntax-prefix-09.ttl b/tests/turtle-2013/turtle-syntax-prefix-09.ttl new file mode 100644 index 0000000..5c57ebe --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-prefix-09.ttl @@ -0,0 +1,4 @@ +# percents +@prefix : . +@prefix x: . +:a%3E x:%25 :a%3Eb . diff --git a/tests/turtle-2013/turtle-syntax-str-esc-01.ttl b/tests/turtle-2013/turtle-syntax-str-esc-01.ttl new file mode 100644 index 0000000..f11f282 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-str-esc-01.ttl @@ -0,0 +1 @@ + "a\n" . diff --git a/tests/turtle-2013/turtle-syntax-str-esc-02.ttl b/tests/turtle-2013/turtle-syntax-str-esc-02.ttl new file mode 100644 index 0000000..0b77f95 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-str-esc-02.ttl @@ -0,0 +1 @@ + "a\u0020b" . diff --git a/tests/turtle-2013/turtle-syntax-str-esc-03.ttl b/tests/turtle-2013/turtle-syntax-str-esc-03.ttl new file mode 100644 index 0000000..af1e328 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-str-esc-03.ttl @@ -0,0 +1 @@ + "a\U00000020b" . diff --git a/tests/turtle-2013/turtle-syntax-string-01.ttl b/tests/turtle-2013/turtle-syntax-string-01.ttl new file mode 100644 index 0000000..7bf8a6d --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-01.ttl @@ -0,0 +1 @@ + "string" . diff --git a/tests/turtle-2013/turtle-syntax-string-02.ttl b/tests/turtle-2013/turtle-syntax-string-02.ttl new file mode 100644 index 0000000..8cb89e9 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-02.ttl @@ -0,0 +1 @@ + "string"@en . diff --git a/tests/turtle-2013/turtle-syntax-string-03.ttl b/tests/turtle-2013/turtle-syntax-string-03.ttl new file mode 100644 index 0000000..312d1d6 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-03.ttl @@ -0,0 +1 @@ + "string"@en-uk . diff --git a/tests/turtle-2013/turtle-syntax-string-04.ttl b/tests/turtle-2013/turtle-syntax-string-04.ttl new file mode 100644 index 0000000..3ecdea3 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-04.ttl @@ -0,0 +1 @@ + 'string' . diff --git a/tests/turtle-2013/turtle-syntax-string-05.ttl b/tests/turtle-2013/turtle-syntax-string-05.ttl new file mode 100644 index 0000000..f32b6d0 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-05.ttl @@ -0,0 +1 @@ + 'string'@en . diff --git a/tests/turtle-2013/turtle-syntax-string-06.ttl b/tests/turtle-2013/turtle-syntax-string-06.ttl new file mode 100644 index 0000000..7739938 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-06.ttl @@ -0,0 +1 @@ + 'string'@en-uk . diff --git a/tests/turtle-2013/turtle-syntax-string-07.ttl b/tests/turtle-2013/turtle-syntax-string-07.ttl new file mode 100644 index 0000000..6c3e6a4 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-07.ttl @@ -0,0 +1 @@ + """abc""def''ghi""" . diff --git a/tests/turtle-2013/turtle-syntax-string-08.ttl b/tests/turtle-2013/turtle-syntax-string-08.ttl new file mode 100644 index 0000000..2fb0227 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-08.ttl @@ -0,0 +1,2 @@ + """abc +def""" . diff --git a/tests/turtle-2013/turtle-syntax-string-09.ttl b/tests/turtle-2013/turtle-syntax-string-09.ttl new file mode 100644 index 0000000..390c8af --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-09.ttl @@ -0,0 +1,2 @@ + '''abc +def''' . diff --git a/tests/turtle-2013/turtle-syntax-string-10.ttl b/tests/turtle-2013/turtle-syntax-string-10.ttl new file mode 100644 index 0000000..5b6e5c3 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-10.ttl @@ -0,0 +1,2 @@ + """abc +def"""@en . diff --git a/tests/turtle-2013/turtle-syntax-string-11.ttl b/tests/turtle-2013/turtle-syntax-string-11.ttl new file mode 100644 index 0000000..7b78abf --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-string-11.ttl @@ -0,0 +1,2 @@ + '''abc +def'''@en . diff --git a/tests/turtle-2013/turtle-syntax-struct-01.ttl b/tests/turtle-2013/turtle-syntax-struct-01.ttl new file mode 100644 index 0000000..990e516 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-struct-01.ttl @@ -0,0 +1,2 @@ +@prefix : . +:s :p :o1 , :o2 . diff --git a/tests/turtle-2013/turtle-syntax-struct-02.ttl b/tests/turtle-2013/turtle-syntax-struct-02.ttl new file mode 100644 index 0000000..0684b2f --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-struct-02.ttl @@ -0,0 +1,3 @@ +@prefix : . +:s :p1 :o1 ; + :p2 :o2 . diff --git a/tests/turtle-2013/turtle-syntax-struct-03.ttl b/tests/turtle-2013/turtle-syntax-struct-03.ttl new file mode 100644 index 0000000..1e30351 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-struct-03.ttl @@ -0,0 +1,4 @@ +@prefix : . +:s :p1 :o1 ; + :p2 :o2 ; + . diff --git a/tests/turtle-2013/turtle-syntax-struct-04.ttl b/tests/turtle-2013/turtle-syntax-struct-04.ttl new file mode 100644 index 0000000..3d1bf3b --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-struct-04.ttl @@ -0,0 +1,4 @@ +@prefix : . +:s :p1 :o1 ;; + :p2 :o2 + . diff --git a/tests/turtle-2013/turtle-syntax-struct-05.ttl b/tests/turtle-2013/turtle-syntax-struct-05.ttl new file mode 100644 index 0000000..c39e041 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-struct-05.ttl @@ -0,0 +1,4 @@ +@prefix : . +:s :p1 :o1 ; + :p2 :o2 ;; + . diff --git a/tests/turtle-2013/turtle-syntax-uri-01.ttl b/tests/turtle-2013/turtle-syntax-uri-01.ttl new file mode 100644 index 0000000..2e2d5ba --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-uri-01.ttl @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/turtle-syntax-uri-02.ttl b/tests/turtle-2013/turtle-syntax-uri-02.ttl new file mode 100644 index 0000000..f355d38 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-uri-02.ttl @@ -0,0 +1,2 @@ +# x53 is capital S + . diff --git a/tests/turtle-2013/turtle-syntax-uri-03.ttl b/tests/turtle-2013/turtle-syntax-uri-03.ttl new file mode 100644 index 0000000..0ea581a --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-uri-03.ttl @@ -0,0 +1,2 @@ +# x53 is capital S + . diff --git a/tests/turtle-2013/turtle-syntax-uri-04.ttl b/tests/turtle-2013/turtle-syntax-uri-04.ttl new file mode 100644 index 0000000..db805c8 --- /dev/null +++ b/tests/turtle-2013/turtle-syntax-uri-04.ttl @@ -0,0 +1,3 @@ +# IRI with all chars in it. + + . diff --git a/tests/turtle-2013/two_LITERAL_LONG2s.nt b/tests/turtle-2013/two_LITERAL_LONG2s.nt new file mode 100644 index 0000000..af94fe6 --- /dev/null +++ b/tests/turtle-2013/two_LITERAL_LONG2s.nt @@ -0,0 +1,2 @@ + "first long literal" . + "second long literal" . diff --git a/tests/turtle-2013/two_LITERAL_LONG2s.ttl b/tests/turtle-2013/two_LITERAL_LONG2s.ttl new file mode 100644 index 0000000..ceaad3d --- /dev/null +++ b/tests/turtle-2013/two_LITERAL_LONG2s.ttl @@ -0,0 +1,4 @@ +# Test long literal twice to ensure it does not over-quote +@prefix : . +:a :b """first long literal""" . +:c :d """second long literal""" . diff --git a/tests/turtle-2013/underscore_in_localName.nt b/tests/turtle-2013/underscore_in_localName.nt new file mode 100644 index 0000000..f9d0c4f --- /dev/null +++ b/tests/turtle-2013/underscore_in_localName.nt @@ -0,0 +1 @@ + . diff --git a/tests/turtle-2013/underscore_in_localName.ttl b/tests/turtle-2013/underscore_in_localName.ttl new file mode 100644 index 0000000..34596fd --- /dev/null +++ b/tests/turtle-2013/underscore_in_localName.ttl @@ -0,0 +1,2 @@ +@prefix p: . +p:s_ . diff --git a/tests/turtle/Makefile.am b/tests/turtle/Makefile.am new file mode 100644 index 0000000..daf041d --- /dev/null +++ b/tests/turtle/Makefile.am @@ -0,0 +1,295 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor Turtle tests +# +# Copyright (C) 2003-2009, David Beckett http://www.dajobe.org/ +# Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +RDFXML_DIR = ../rdfxml +NTRIPLES_DIR = ../ntriples + +TEST_FILES=test-00.ttl test-01.ttl test-02.ttl test-03.ttl \ +test-04.ttl test-05.ttl test-06.ttl test-07.ttl test-08.ttl \ +test-09.ttl test-10.ttl test-11.ttl test-12.ttl test-13.ttl \ +test-14.ttl test-15.ttl test-16.ttl test-17.ttl test-18.ttl \ +test-19.ttl test-20.ttl test-21.ttl test-22.ttl test-23.ttl \ +test-24.ttl test-25.ttl test-26.ttl test-27.ttl \ +test-29.ttl test-30.ttl test-33.ttl test-36.ttl test-37.ttl \ +test-38.ttl bad-15.ttl bad-17.ttl bad-18.ttl bad-21.ttl bad-22.ttl \ +rdf-schema.ttl \ +rdfs-namespace.ttl \ +rdfq-results.ttl + +TEST_BAD_FILES=bad-00.ttl bad-01.ttl bad-02.ttl bad-03.ttl \ +bad-04.ttl bad-05.ttl bad-06.ttl bad-07.ttl bad-08.ttl bad-09.ttl \ +bad-10.ttl bad-11.ttl bad-12.ttl bad-13.ttl bad-14.ttl bad-16.ttl \ +bad-19.ttl bad-20.ttl \ +bad-23.ttl bad-24.ttl + +TEST_OUT_FILES=test-00.out test-01.out test-02.out test-03.out \ +test-04.out test-05.out test-06.out test-07.out test-08.out \ +test-09.out test-10.out test-11.out test-12.out test-13.out \ +test-14.out test-15.out test-16.out test-17.out test-18.out \ +test-19.out test-20.out test-21.out test-22.out test-23.out \ +test-24.out test-25.out test-26.out test-27.out test-28.out \ +test-29.out test-30.out test-33.out test-36.out test-37.out \ +test-38.out bad-15.out bad-17.out bad-18.out bad-21.out bad-22.out \ +rdf-schema.out \ +rdfs-namespace.out \ +rdfq-results.out + +TEST_SERIALIZE_FILES= \ +test-28.ttl test-31.ttl test-32.ttl test-34.ttl test-39.ttl + +TEST_SERIALIZE_OUT_FILES= \ +test-28-out.ttl test-31-out.ttl test-32-out.ttl test-34-out.ttl test-39-out.ttl + +TURTLE_HACK_OUT_FILES= \ +ex-38-turtle.out + +TURTLE_SERIALIZE_RDF_FILES=ex-62.rdf + +TEST_MANIFEST_FILES=manifest.ttl manifest-bad.ttl + +# Used to make N-triples output consistent +BASE_URI=http://www.w3.org/2001/sw/DataAccess/df1/tests/ +# for rdf-schema.ttl +RDF_NS_URI=http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI=http://www.w3.org/2000/01/rdf-schema + +ALL_TEST_FILES= README.txt \ + $(TEST_FILES) \ + $(TEST_BAD_FILES) \ + $(TEST_OUT_FILES) \ + $(TEST_MANIFEST_FILES) \ + $(TEST_SERIALIZE_FILES) \ + $(TEST_SERIALIZE_OUT_FILES) \ + $(TURTLE_SERIALIZE_RDF_TEST_FILES) \ + $(TURTLE_SERIALIZE_RDF_FILES) \ + $(TURTLE_HACK_OUT_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) + +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-rdf check-bad-rdf check-turtle-serialize \ +check-turtle-serialize-syntax check-turtle-parse-ntriples \ +check-turtle-serialize-rdf + +if MAINTAINER_MODE +check_rdf_deps = $(TEST_FILES) +endif + +check-rdf: build-rapper $(check_rdf_deps) + @result=0; \ + $(RECHO) "Testing legal Turtle"; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + diff $(srcdir)/$$name.out $$name.res; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + exit $$result + +if MAINTAINER_MODE +check_bad_rdf_deps = $(TEST_BAD_FILES) +endif + +check-bad-rdf: build-rapper $(check_bad_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing bad Turtle fails"; \ + for test in $(TEST_BAD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_turtle_serialize_deps = $(TEST_FILES) +endif + +check-turtle-serialize: build-rdfdiff build-rapper $(check_turtle_serialize_deps) + @set +e; result=0; \ + $(RECHO) "Testing turtle serialization with legal turtle"; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .ttl` ; \ + if test $$name = rdf-schema; then \ + baseuri=$(RDF_NS_URI); \ + elif test $$name = rdfs-namespace; then \ + baseuri=$(RDFS_NS_URI); \ + else \ + baseuri=$(BASE_URI)$$test; \ + fi; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o turtle $(srcdir)/$$test $$baseuri > $$name-turtle.ttl 2> $$name.err; \ + status1=$$?; \ + $(RDFDIFF) -f turtle -u $$baseuri -t turtle $(srcdir)/$$test $$name-turtle.ttl > $$name.res 2> $$name.err; \ + status2=$$?; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o turtle $(srcdir)/$$test $$baseuri '>' $$name-turtle.ttl; \ + $(RECHO) $(RDFDIFF) -f turtle -u $$baseuri -t turtle $(srcdir)/$$test $$name-turtle.ttl '>' $$name.res; \ + cat $$name-turtle.ttl; cat $$name.err; \ + fi; \ + rm -f $$name-turtle.ttl $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +if MAINTAINER_MODE +check_turtle_serialize_syntax_deps = $(TEST_SERIALIZE_FILES) +endif + +check-turtle-serialize-syntax: build-rapper $(check_turtle_serialize_syntax_deps) + @set +e; result=0; \ + $(RECHO) "Testing turtle exact serialization output"; \ + for test in $(TEST_SERIALIZE_FILES); do \ + name=`basename $$test .ttl` ; \ + if test $$name = rdf-schema; then \ + baseuri=$(RDF_NS_URI); \ + elif test $$name = rdfs-namespace; then \ + baseuri=$(RDFS_NS_URI); \ + elif test $$name = test-31 -o $$name = test-32 -o $$name = test-39; then \ + baseuri=-; \ + else \ + baseuri=$(BASE_URI)$$test; \ + fi; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o turtle $(srcdir)/$$test $$baseuri > $$name-turtle.ttl 2> $$name.err; \ + cmp -s $(srcdir)/$$name-out.ttl $$name-turtle.ttl; \ + status=$$?; \ + if test $$status = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o turtle $(srcdir)/$$test $$baseuri '>' $$name-turtle.ttl; \ + cat $$name.err; \ + diff -a -u $(srcdir)/$$name-out.ttl $$name-turtle.ttl; \ + fi; \ + rm -f $$name-turtle.ttl $$name.err; \ + done; \ + set -e; exit $$result + +check-turtle-parse-ntriples: build-rapper + @set +e; result=0; \ + $(RECHO) "Testing Turtle parsing with N-Triples tests"; \ + NT_TEST_FILES=`unset MAKELEVEL MAKEFLAGS; cd $(NTRIPLES_DIR) && $(MAKE) print-nt-test-files | sed -e 's,^, ,' -e 's, ,$(NTRIPLES_DIR)/,g'`; \ + for test in $$NT_TEST_FILES; do \ + name=`basename $$test .nt` ; \ + baseuri=-; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + test_expected=$(srcdir)/$(NTRIPLES_DIR)/$$name.out; \ + if cmp $$test_expected $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + diff $$test_expected $$name.res; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +check-turtle-serialize-rdf: build-rdfdiff build-rapper + @set +e; result=0; \ + RDF_TEST_FILES=`unset MAKELEVEL MAKEFLAGS; cd $(RDFXML_DIR) && $(MAKE) print-rdf-test-files | sed -e 's,^, ,' -e 's, ,$(RDFXML_DIR)/,g'`; \ + $(RECHO) "Testing turtle serialization with legal rdf/xml"; \ + for test in $$RDF_TEST_FILES $(TURTLE_SERIALIZE_RDF_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=-; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o turtle $(srcdir)/$$test $$baseuri > $$name-turtle.ttl 2> $$name.err; \ + status1=$$?; \ + if test $$test = "$(RDFXML_DIR)/ex-38.rdf"; then \ + diff $(srcdir)/ex-38-turtle.out $$name-turtle.ttl > $$name.res 2> $$name.err; \ + status2=$$?; \ + else \ + $(RDFDIFF) -t turtle $(srcdir)/$$test $$name-turtle.ttl > $$name.res 2> $$name.err; \ + status2=$$?; \ + fi; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -o turtle $(srcdir)/$$test $$baseuri '>' $$name-turtle.ttl; \ + $(RECHO) $(RDFDIFF) -t turtle $(srcdir)/$$test $$name-turtle.ttl '>' $$name.res; \ + cat $$name.err; \ + fi; \ + rm -f $$name-turtle.ttl $$name.res $$name.err; \ + done; \ + set -e; exit $$result + + +if MAINTAINER_MODE +zip: tests.zip + +tests.zip: $(ALL_TEST_FILES) + rm -f $@ + zip $@ $(ALL_TEST_FILES) + +endif diff --git a/tests/turtle/Makefile.in b/tests/turtle/Makefile.in new file mode 100644 index 0000000..38d28f8 --- /dev/null +++ b/tests/turtle/Makefile.in @@ -0,0 +1,768 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor Turtle tests +# +# Copyright (C) 2003-2009, David Beckett http://www.dajobe.org/ +# Copyright (C) 2003-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = tests/turtle +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +SOURCES = +DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +am__DIST_COMMON = $(srcdir)/Makefile.in +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +RDFXML_DIR = ../rdfxml +NTRIPLES_DIR = ../ntriples +TEST_FILES = test-00.ttl test-01.ttl test-02.ttl test-03.ttl \ +test-04.ttl test-05.ttl test-06.ttl test-07.ttl test-08.ttl \ +test-09.ttl test-10.ttl test-11.ttl test-12.ttl test-13.ttl \ +test-14.ttl test-15.ttl test-16.ttl test-17.ttl test-18.ttl \ +test-19.ttl test-20.ttl test-21.ttl test-22.ttl test-23.ttl \ +test-24.ttl test-25.ttl test-26.ttl test-27.ttl \ +test-29.ttl test-30.ttl test-33.ttl test-36.ttl test-37.ttl \ +test-38.ttl bad-15.ttl bad-17.ttl bad-18.ttl bad-21.ttl bad-22.ttl \ +rdf-schema.ttl \ +rdfs-namespace.ttl \ +rdfq-results.ttl + +TEST_BAD_FILES = bad-00.ttl bad-01.ttl bad-02.ttl bad-03.ttl \ +bad-04.ttl bad-05.ttl bad-06.ttl bad-07.ttl bad-08.ttl bad-09.ttl \ +bad-10.ttl bad-11.ttl bad-12.ttl bad-13.ttl bad-14.ttl bad-16.ttl \ +bad-19.ttl bad-20.ttl \ +bad-23.ttl bad-24.ttl + +TEST_OUT_FILES = test-00.out test-01.out test-02.out test-03.out \ +test-04.out test-05.out test-06.out test-07.out test-08.out \ +test-09.out test-10.out test-11.out test-12.out test-13.out \ +test-14.out test-15.out test-16.out test-17.out test-18.out \ +test-19.out test-20.out test-21.out test-22.out test-23.out \ +test-24.out test-25.out test-26.out test-27.out test-28.out \ +test-29.out test-30.out test-33.out test-36.out test-37.out \ +test-38.out bad-15.out bad-17.out bad-18.out bad-21.out bad-22.out \ +rdf-schema.out \ +rdfs-namespace.out \ +rdfq-results.out + +TEST_SERIALIZE_FILES = \ +test-28.ttl test-31.ttl test-32.ttl test-34.ttl test-39.ttl + +TEST_SERIALIZE_OUT_FILES = \ +test-28-out.ttl test-31-out.ttl test-32-out.ttl test-34-out.ttl test-39-out.ttl + +TURTLE_HACK_OUT_FILES = \ +ex-38-turtle.out + +TURTLE_SERIALIZE_RDF_FILES = ex-62.rdf +TEST_MANIFEST_FILES = manifest.ttl manifest-bad.ttl + +# Used to make N-triples output consistent +BASE_URI = http://www.w3.org/2001/sw/DataAccess/df1/tests/ +# for rdf-schema.ttl +RDF_NS_URI = http://www.w3.org/1999/02/22-rdf-syntax-ns +# for rdfs-namespace.ttl +RDFS_NS_URI = http://www.w3.org/2000/01/rdf-schema +ALL_TEST_FILES = README.txt \ + $(TEST_FILES) \ + $(TEST_BAD_FILES) \ + $(TEST_OUT_FILES) \ + $(TEST_MANIFEST_FILES) \ + $(TEST_SERIALIZE_FILES) \ + $(TEST_SERIALIZE_OUT_FILES) \ + $(TURTLE_SERIALIZE_RDF_TEST_FILES) \ + $(TURTLE_SERIALIZE_RDF_FILES) \ + $(TURTLE_HACK_OUT_FILES) + +EXTRA_DIST = $(ALL_TEST_FILES) +RAPPER = $(top_builddir)/utils/rapper +RDFDIFF = $(top_builddir)/utils/rdfdiff +@MAINTAINER_MODE_TRUE@check_rdf_deps = $(TEST_FILES) +@MAINTAINER_MODE_TRUE@check_bad_rdf_deps = $(TEST_BAD_FILES) +@MAINTAINER_MODE_TRUE@check_turtle_serialize_deps = $(TEST_FILES) +@MAINTAINER_MODE_TRUE@check_turtle_serialize_syntax_deps = $(TEST_SERIALIZE_FILES) +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/turtle/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/turtle/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags TAGS: + +ctags CTAGS: + +cscope cscopelist: + +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-am check-local clean clean-generic \ + clean-libtool cscopelist-am ctags-am distclean \ + distclean-generic distclean-libtool distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am + +.PRECIOUS: Makefile + + +build-rapper: + @(cd $(top_builddir)/utils ; $(MAKE) rapper$(EXEEXT)) + +build-rdfdiff: + @(cd $(top_builddir)/utils ; $(MAKE) rdfdiff$(EXEEXT)) + +check-local: check-rdf check-bad-rdf check-turtle-serialize \ +check-turtle-serialize-syntax check-turtle-parse-ntriples \ +check-turtle-serialize-rdf + +check-rdf: build-rapper $(check_rdf_deps) + @result=0; \ + $(RECHO) "Testing legal Turtle"; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status != 0 -a $$status != 2 ; then \ + $(RECHO) "FAILED returned status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + elif cmp $(srcdir)/$$name.out $$name.res >/dev/null 2>&1; then \ + if test $$status = 2 ; then \ + $(RECHO) "ok with warnings"; grep Warning $$name.err; \ + else \ + $(RECHO) "ok"; \ + fi; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples $(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + diff $(srcdir)/$$name.out $$name.res; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + exit $$result + +check-bad-rdf: build-rapper $(check_bad_rdf_deps) + @set +e; result=0; \ + $(RECHO) "Testing bad Turtle fails"; \ + for test in $(TEST_BAD_FILES); do \ + name=`basename $$test .ttl` ; \ + baseuri=$(BASE_URI)$$test; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + status=$$?; \ + if test $$status -eq 1 ; then \ + $(RECHO) "ok"; \ + elif test $$status -eq 2 ; then \ + $(RECHO) "FAILED - parsing succeeded with a warning"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; grep Warning $$name.err; \ + elif test $$status -eq 0 ; then \ + $(RECHO) "FAILED - parsing succeeded but should have failed"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.res; \ + else \ + $(RECHO) "FAILED - parsing failed with unknown status $$status"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + cat $$name.res; \ + fi; \ + rm -f $$name.res $$name.err ; \ + done; \ + set -e; exit $$result + +check-turtle-serialize: build-rdfdiff build-rapper $(check_turtle_serialize_deps) + @set +e; result=0; \ + $(RECHO) "Testing turtle serialization with legal turtle"; \ + for test in $(TEST_FILES); do \ + name=`basename $$test .ttl` ; \ + if test $$name = rdf-schema; then \ + baseuri=$(RDF_NS_URI); \ + elif test $$name = rdfs-namespace; then \ + baseuri=$(RDFS_NS_URI); \ + else \ + baseuri=$(BASE_URI)$$test; \ + fi; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o turtle $(srcdir)/$$test $$baseuri > $$name-turtle.ttl 2> $$name.err; \ + status1=$$?; \ + $(RDFDIFF) -f turtle -u $$baseuri -t turtle $(srcdir)/$$test $$name-turtle.ttl > $$name.res 2> $$name.err; \ + status2=$$?; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o turtle $(srcdir)/$$test $$baseuri '>' $$name-turtle.ttl; \ + $(RECHO) $(RDFDIFF) -f turtle -u $$baseuri -t turtle $(srcdir)/$$test $$name-turtle.ttl '>' $$name.res; \ + cat $$name-turtle.ttl; cat $$name.err; \ + fi; \ + rm -f $$name-turtle.ttl $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +check-turtle-serialize-syntax: build-rapper $(check_turtle_serialize_syntax_deps) + @set +e; result=0; \ + $(RECHO) "Testing turtle exact serialization output"; \ + for test in $(TEST_SERIALIZE_FILES); do \ + name=`basename $$test .ttl` ; \ + if test $$name = rdf-schema; then \ + baseuri=$(RDF_NS_URI); \ + elif test $$name = rdfs-namespace; then \ + baseuri=$(RDFS_NS_URI); \ + elif test $$name = test-31 -o $$name = test-32 -o $$name = test-39; then \ + baseuri=-; \ + else \ + baseuri=$(BASE_URI)$$test; \ + fi; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o turtle $(srcdir)/$$test $$baseuri > $$name-turtle.ttl 2> $$name.err; \ + cmp -s $(srcdir)/$$name-out.ttl $$name-turtle.ttl; \ + status=$$?; \ + if test $$status = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o turtle $(srcdir)/$$test $$baseuri '>' $$name-turtle.ttl; \ + cat $$name.err; \ + diff -a -u $(srcdir)/$$name-out.ttl $$name-turtle.ttl; \ + fi; \ + rm -f $$name-turtle.ttl $$name.err; \ + done; \ + set -e; exit $$result + +check-turtle-parse-ntriples: build-rapper + @set +e; result=0; \ + $(RECHO) "Testing Turtle parsing with N-Triples tests"; \ + NT_TEST_FILES=`unset MAKELEVEL MAKEFLAGS; cd $(NTRIPLES_DIR) && $(MAKE) print-nt-test-files | sed -e 's,^, ,' -e 's, ,$(NTRIPLES_DIR)/,g'`; \ + for test in $$NT_TEST_FILES; do \ + name=`basename $$test .nt` ; \ + baseuri=-; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri > $$name.res 2> $$name.err; \ + test_expected=$(srcdir)/$(NTRIPLES_DIR)/$$name.out; \ + if cmp $$test_expected $$name.res >/dev/null 2>&1; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -i turtle -o ntriples file:$(srcdir)/$$test $$baseuri '>' $$name.res; \ + cat $$name.err; \ + diff $$test_expected $$name.res; \ + fi; \ + rm -f $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +check-turtle-serialize-rdf: build-rdfdiff build-rapper + @set +e; result=0; \ + RDF_TEST_FILES=`unset MAKELEVEL MAKEFLAGS; cd $(RDFXML_DIR) && $(MAKE) print-rdf-test-files | sed -e 's,^, ,' -e 's, ,$(RDFXML_DIR)/,g'`; \ + $(RECHO) "Testing turtle serialization with legal rdf/xml"; \ + for test in $$RDF_TEST_FILES $(TURTLE_SERIALIZE_RDF_FILES); do \ + name=`basename $$test .rdf` ; \ + baseuri=-; \ + $(RECHO) $(RECHO_N) "Checking $$test $(RECHO_C)"; \ + $(RAPPER) -q -o turtle $(srcdir)/$$test $$baseuri > $$name-turtle.ttl 2> $$name.err; \ + status1=$$?; \ + if test $$test = "$(RDFXML_DIR)/ex-38.rdf"; then \ + diff $(srcdir)/ex-38-turtle.out $$name-turtle.ttl > $$name.res 2> $$name.err; \ + status2=$$?; \ + else \ + $(RDFDIFF) -t turtle $(srcdir)/$$test $$name-turtle.ttl > $$name.res 2> $$name.err; \ + status2=$$?; \ + fi; \ + if test $$status1 = 0 -a $$status2 = 0; then \ + $(RECHO) "ok"; \ + else \ + $(RECHO) "FAILED"; result=1; \ + $(RECHO) $(RAPPER) -q -o turtle $(srcdir)/$$test $$baseuri '>' $$name-turtle.ttl; \ + $(RECHO) $(RDFDIFF) -t turtle $(srcdir)/$$test $$name-turtle.ttl '>' $$name.res; \ + cat $$name.err; \ + fi; \ + rm -f $$name-turtle.ttl $$name.res $$name.err; \ + done; \ + set -e; exit $$result + +@MAINTAINER_MODE_TRUE@zip: tests.zip + +@MAINTAINER_MODE_TRUE@tests.zip: $(ALL_TEST_FILES) +@MAINTAINER_MODE_TRUE@ rm -f $@ +@MAINTAINER_MODE_TRUE@ zip $@ $(ALL_TEST_FILES) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/tests/turtle/README.txt b/tests/turtle/README.txt new file mode 100644 index 0000000..37460e6 --- /dev/null +++ b/tests/turtle/README.txt @@ -0,0 +1,20 @@ +These are the tests for the Turtle Terse RDF Triple Language +that must be passed by conformant systems. See + http://www.dajobe.org/2004/01/turtle/ +for the full conformance information. + +The format is a set of good tests and bad tests. + +Good tests are a pair of files: + abc.ttl abc.out +which are the input Turtle file and the expected output RDF triples, +written in N-Triples. + +bad tests are of the form + bad-XX.ttl +which must fail. + +The tests should be performed with an assumed base URI +of http://www.w3.org/2001/sw/DataAccess/df1/tests/ + +Dave diff --git a/tests/turtle/bad-00.ttl b/tests/turtle/bad-00.ttl new file mode 100644 index 0000000..b1a1b36 --- /dev/null +++ b/tests/turtle/bad-00.ttl @@ -0,0 +1,2 @@ +# prefix name must end in a : +@prefix a <#> . diff --git a/tests/turtle/bad-01.ttl b/tests/turtle/bad-01.ttl new file mode 100644 index 0000000..533bc21 --- /dev/null +++ b/tests/turtle/bad-01.ttl @@ -0,0 +1,3 @@ +# Forbidden by RDF - predicate cannot be blank +@prefix : . +:a [ :b :c ] :d . diff --git a/tests/turtle/bad-02.ttl b/tests/turtle/bad-02.ttl new file mode 100644 index 0000000..fd2014d --- /dev/null +++ b/tests/turtle/bad-02.ttl @@ -0,0 +1,3 @@ +# Forbidden by RDF - predicate cannot be blank +@prefix : . +:a [] :b . diff --git a/tests/turtle/bad-03.ttl b/tests/turtle/bad-03.ttl new file mode 100644 index 0000000..07a372f --- /dev/null +++ b/tests/turtle/bad-03.ttl @@ -0,0 +1,3 @@ +# 'a' only allowed as a predicate +@prefix : . +a :a :b . diff --git a/tests/turtle/bad-04.ttl b/tests/turtle/bad-04.ttl new file mode 100644 index 0000000..ee7246c --- /dev/null +++ b/tests/turtle/bad-04.ttl @@ -0,0 +1,3 @@ +# No comma is allowed in collections +@prefix : . +:a :b ( "apple", "banana" ) . diff --git a/tests/turtle/bad-05.ttl b/tests/turtle/bad-05.ttl new file mode 100644 index 0000000..387015f --- /dev/null +++ b/tests/turtle/bad-05.ttl @@ -0,0 +1,4 @@ +# N3 {}s are not in Turtle +@prefix : . +{ :a :b :c . } :d :e . + diff --git a/tests/turtle/bad-06.ttl b/tests/turtle/bad-06.ttl new file mode 100644 index 0000000..a8f1a0f --- /dev/null +++ b/tests/turtle/bad-06.ttl @@ -0,0 +1,3 @@ +# is and of are not in turtle +@prefix : . +:a is :b of :c . diff --git a/tests/turtle/bad-07.ttl b/tests/turtle/bad-07.ttl new file mode 100644 index 0000000..18ea4fa --- /dev/null +++ b/tests/turtle/bad-07.ttl @@ -0,0 +1,4 @@ +# paths are not in turtle +@prefix : . +:a.:b.:c . +:a^:b^:c . diff --git a/tests/turtle/bad-08.ttl b/tests/turtle/bad-08.ttl new file mode 100644 index 0000000..07918f9 --- /dev/null +++ b/tests/turtle/bad-08.ttl @@ -0,0 +1,2 @@ +@keywords something. +# @keywords is not in turtle diff --git a/tests/turtle/bad-09.ttl b/tests/turtle/bad-09.ttl new file mode 100644 index 0000000..d2d76c1 --- /dev/null +++ b/tests/turtle/bad-09.ttl @@ -0,0 +1,3 @@ +# implies is not in turtle +@prefix : . +:a => :b . diff --git a/tests/turtle/bad-10.ttl b/tests/turtle/bad-10.ttl new file mode 100644 index 0000000..b5ef1f5 --- /dev/null +++ b/tests/turtle/bad-10.ttl @@ -0,0 +1,3 @@ +# equivalence is not in turtle +@prefix : . +:a = :b . diff --git a/tests/turtle/bad-11.ttl b/tests/turtle/bad-11.ttl new file mode 100644 index 0000000..09e7b6a --- /dev/null +++ b/tests/turtle/bad-11.ttl @@ -0,0 +1,3 @@ +# @forAll is not in turtle +@prefix : . +@forAll :x . diff --git a/tests/turtle/bad-12.ttl b/tests/turtle/bad-12.ttl new file mode 100644 index 0000000..cef48ff --- /dev/null +++ b/tests/turtle/bad-12.ttl @@ -0,0 +1,3 @@ +# @forSome is not in turtle +@prefix : . +@forSome :x . diff --git a/tests/turtle/bad-13.ttl b/tests/turtle/bad-13.ttl new file mode 100644 index 0000000..91accf2 --- /dev/null +++ b/tests/turtle/bad-13.ttl @@ -0,0 +1,3 @@ +# <= is not in turtle +@prefix : . +:a <= :b . diff --git a/tests/turtle/bad-14.ttl b/tests/turtle/bad-14.ttl new file mode 100644 index 0000000..f4a7acf --- /dev/null +++ b/tests/turtle/bad-14.ttl @@ -0,0 +1,6 @@ +# Test long literals with missing end +@prefix : . +:a :b """a long + literal +with +newlines diff --git a/tests/turtle/bad-15.out b/tests/turtle/bad-15.out new file mode 100644 index 0000000..e560c6b --- /dev/null +++ b/tests/turtle/bad-15.out @@ -0,0 +1 @@ +_:genid1 . diff --git a/tests/turtle/bad-15.ttl b/tests/turtle/bad-15.ttl new file mode 100644 index 0000000..7c86fc7 --- /dev/null +++ b/tests/turtle/bad-15.ttl @@ -0,0 +1,2 @@ +@prefix : . +[ :a :b ] . diff --git a/tests/turtle/bad-16.ttl b/tests/turtle/bad-16.ttl new file mode 100644 index 0000000..da438e4 --- /dev/null +++ b/tests/turtle/bad-16.ttl @@ -0,0 +1 @@ +( 1 2 3 ) . diff --git a/tests/turtle/bad-17.out b/tests/turtle/bad-17.out new file mode 100644 index 0000000..fde3131 --- /dev/null +++ b/tests/turtle/bad-17.out @@ -0,0 +1 @@ + "John said: \"Hello World!\"" . diff --git a/tests/turtle/bad-17.ttl b/tests/turtle/bad-17.ttl new file mode 100644 index 0000000..2127722 --- /dev/null +++ b/tests/turtle/bad-17.ttl @@ -0,0 +1,3 @@ +# '-quoted long literal +@prefix : . +:a :b 'John said: "Hello World!"' . diff --git a/tests/turtle/bad-18.out b/tests/turtle/bad-18.out new file mode 100644 index 0000000..fde3131 --- /dev/null +++ b/tests/turtle/bad-18.out @@ -0,0 +1 @@ + "John said: \"Hello World!\"" . diff --git a/tests/turtle/bad-18.ttl b/tests/turtle/bad-18.ttl new file mode 100644 index 0000000..1273b96 --- /dev/null +++ b/tests/turtle/bad-18.ttl @@ -0,0 +1,3 @@ +# '''-quoted long literal +@prefix : . +:a :b '''John said: "Hello World!"''' . diff --git a/tests/turtle/bad-19.ttl b/tests/turtle/bad-19.ttl new file mode 100644 index 0000000..66e729b --- /dev/null +++ b/tests/turtle/bad-19.ttl @@ -0,0 +1,3 @@ +# Bad () in predicate position +@prefix : . +:a () :b . diff --git a/tests/turtle/bad-20.ttl b/tests/turtle/bad-20.ttl new file mode 100644 index 0000000..c5cfc79 --- /dev/null +++ b/tests/turtle/bad-20.ttl @@ -0,0 +1,3 @@ +# Escape end-of-file +@prefix : . +:a :b """\ \ No newline at end of file diff --git a/tests/turtle/bad-21.out b/tests/turtle/bad-21.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/turtle/bad-21.ttl b/tests/turtle/bad-21.ttl new file mode 100644 index 0000000..5430fbf --- /dev/null +++ b/tests/turtle/bad-21.ttl @@ -0,0 +1,2 @@ +# Turtle spec does not allow . in namespace prefix (token prefixName) +@prefix foo.bar: . diff --git a/tests/turtle/bad-22.out b/tests/turtle/bad-22.out new file mode 100644 index 0000000..a99dea2 --- /dev/null +++ b/tests/turtle/bad-22.out @@ -0,0 +1 @@ + . diff --git a/tests/turtle/bad-22.ttl b/tests/turtle/bad-22.ttl new file mode 100644 index 0000000..1a23923 --- /dev/null +++ b/tests/turtle/bad-22.ttl @@ -0,0 +1,3 @@ +# Turtle spec does not allow . in namespace name (token name) +@prefix ex: . +ex:not.allowed ex:not.allowed ex:not.allowed . diff --git a/tests/turtle/bad-23.ttl b/tests/turtle/bad-23.ttl new file mode 100644 index 0000000..864b4ff --- /dev/null +++ b/tests/turtle/bad-23.ttl @@ -0,0 +1,7 @@ +# from Redland Issue #0000369 +# http://bugs.librdf.org/mantis/view.php?id=369 +# The terminating """ is three leftmost-parsed double-quotes + + + + """This literal ends with an unescaped quote"""" . diff --git a/tests/turtle/bad-24.ttl b/tests/turtle/bad-24.ttl new file mode 100644 index 0000000..5618041 --- /dev/null +++ b/tests/turtle/bad-24.ttl @@ -0,0 +1 @@ + "value"@en^^ . diff --git a/tests/turtle/ex-38-turtle.out b/tests/turtle/ex-38-turtle.out new file mode 100644 index 0000000..35056c1 --- /dev/null +++ b/tests/turtle/ex-38-turtle.out @@ -0,0 +1,17 @@ +@prefix rdf: . +@prefix ex: . + + + rdf:object _:genid1 ; + rdf:predicate ex:property ; + rdf:subject ex:resource ; + a rdf:Statement . + +ex:resource + ex:property _:genid1 . + +_:genid1 + ex:resource1 ; + ; + a . + diff --git a/tests/turtle/ex-62.rdf b/tests/turtle/ex-62.rdf new file mode 100644 index 0000000..98a26c3 --- /dev/null +++ b/tests/turtle/ex-62.rdf @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + diff --git a/tests/turtle/manifest-bad.ttl b/tests/turtle/manifest-bad.ttl new file mode 100644 index 0000000..3a9d0e8 --- /dev/null +++ b/tests/turtle/manifest-bad.ttl @@ -0,0 +1,123 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix mf: . +@prefix qt: . + +<> rdf:type mf:Manifest ; + rdfs:comment "Turtle bad syntax test cases (must fail)" ; + mf:entries + ( + + [ mf:name "bad-00" ; + rdfs:comment "prefix name must end in a :" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-01" ; + rdfs:comment "blank predicate forbidden" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-02" ; + rdfs:comment "blank predicate forbidden" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-03" ; + rdfs:comment "a forbidden as subject" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-04" ; + rdfs:comment ", not allowed in collections" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-05" ; + rdfs:comment "{} not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-06" ; + rdfs:comment "is and of not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-07" ; + rdfs:comment "paths not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-08" ; + rdfs:comment "@keywords not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-09" ; + rdfs:comment "=> not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-10" ; + rdfs:comment "= not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-11" ; + rdfs:comment "@forAll not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-12" ; + rdfs:comment "@forSome not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-13" ; + rdfs:comment "<= not allowed in Turtle" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-14" ; + rdfs:comment "long literal with missing end" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-17" ; + rdfs:comment "literal with ''s" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-18" ; + rdfs:comment "long literal with '''s" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-19" ; + rdfs:comment "Bad () in predicate position" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-20" ; + rdfs:comment "Escape end-of-file" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-21" ; + rdfs:comment "Turtle spec does not allow . in namespace prefix (token prefixName)" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-22" ; + rdfs:comment "Turtle spec does not allow . in namespace name (token name)" ; + mf:action [ qt:data ] ; + ] + + [ mf:name "bad-23" ; + rdfs:comment "Bad terminating long literal" ; + mf:action [ qt:data ] ; + ] + + + # End of tests + ). diff --git a/tests/turtle/manifest.ttl b/tests/turtle/manifest.ttl new file mode 100644 index 0000000..e7a24e2 --- /dev/null +++ b/tests/turtle/manifest.ttl @@ -0,0 +1,263 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix mf: . +@prefix qt: . + +<> rdf:type mf:Manifest ; + rdfs:comment "Turtle good syntax test cases (must pass)" ; + mf:entries + ( + [ mf:name "test-00" ; + rdfs:comment "Blank subject" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-01" ; + rdfs:comment "@prefix and qnames" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-02" ; + rdfs:comment ", operator" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-03" ; + rdfs:comment "; operator" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-04" ; + rdfs:comment "empty [] as subject and object" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-05" ; + rdfs:comment "non-empty [] as subject and object" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-06" ; + rdfs:comment "'a' as predicate" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-07" ; + rdfs:comment "simple collection" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-08" ; + rdfs:comment "empty collection" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-09" ; + rdfs:comment "integer datatyped literal" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-10" ; + rdfs:comment "decimal integer canonicalization" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-11" ; + rdfs:comment "- and _ in names and qnames" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-12" ; + rdfs:comment "tests for rdf:_ and other qnames starting with _" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-13" ; + rdfs:comment "bare : allowed" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-14" ; + rdfs:comment "10000 triples, more than the default Bison stack size" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-15" ; + rdfs:comment "10000 triple objects (10000 triples)" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-16" ; + rdfs:comment "10000 items (10000 triples)" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-17" ; + rdfs:comment "simple long literal" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-18" ; + rdfs:comment "long literals with escapes" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-19" ; + rdfs:comment "floating point number" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-20" ; + rdfs:comment "empty literals, normal and long variant" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-21" ; + rdfs:comment "positive integer, decimal and doubles" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-22" ; + rdfs:comment "negative integer, decimal and doubles" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-23" ; + rdfs:comment "long literal ending in double quote" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-24" ; + rdfs:comment "boolean literals" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-25" ; + rdfs:comment "comments" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-26" ; + rdfs:comment "no final mewline" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-27" ; + rdfs:comment "duplicate prefix" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-28" ; + rdfs:comment "decimal data types (serializing test)" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-29" ; + rdfs:comment "Escaping U+0001 to U+007F in a URI" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-30" ; + rdfs:comment "@base" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-31" ; + rdfs:comment "RSS test" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-32" ; + rdfs:comment "RDF Value" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-33" ; + rdfs:comment "Long literal ending in escaped slash" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-34" ; + rdfs:comment "URI ending in period character" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-35" ; + rdfs:comment "XMLLiteral with lang tag" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-36" ; + rdfs:comment "Test long literal twice to ensure it does not over-quote" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-37" ; + rdfs:comment "Test long literal with lang tag" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "test-38" ; + rdfs:comment "Unicode surrogates in literal" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "rdf-schema" ; + rdfs:comment "RDF Namespace document converted into Turtle" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "rdfs-namespace" ; + rdfs:comment "RDFS Namespace document converted into Turtle" ; + mf:action [ qt:data ] ; + mf:result + ] + + [ mf:name "rdfq-results" ; + rdfs:comment "Example query result from http://www.w3.org/2003/03/rdfqr-tests/recording-query-results.html" ; + mf:action [ qt:data ] ; + mf:result + ] + + # End of tests + ). diff --git a/tests/turtle/rdf-schema.out b/tests/turtle/rdf-schema.out new file mode 100644 index 0000000..ea0e6cb --- /dev/null +++ b/tests/turtle/rdf-schema.out @@ -0,0 +1,124 @@ + . + "Indicates membership of a class" . + "type"@en . + "type"@fr . + . + . + "The concept of Class" . + "Class"@en . + "Classe"@fr . + . + . + "Properties used to express RDF Schema constraints." . + "ConstraintProperty"@en . + "Propri\u00E9t\u00E9Contrainte"@fr . + . + . + . + "Resources used to express RDF Schema constraints." . + "ConstraintResource"@en . + "RessourceContrainte"@fr . + . + . + "This represents the set Containers." . + "Container"@en . + "Enveloppe"@fr . + . + . + "ContainerMembershipProperty"@en . + . + . + "This represents the set of atomic values, eg. textual strings." . + "Literal"@en . + "Litt\u00E9ral"@fr . + . + "The most general class" . + "Resource"@en . + "Ressource"@fr . + . + "Use this for descriptions" . + . + "comment"@en . + "commentaire"@fr . + . + . + "This is how we associate a class with properties that its instances can have" . + "domain"@en . + "domaine"@fr . + . + "Indicates a resource containing and defining the subject resource." . + . + "esD\u00E9finiPar"@fr . + "isDefinedBy"@en . + . + . + . + "Provides a human-readable version of a resource name." . + . + "label"@en . + "label"@fr . + . + . + "Properties that can be used in a schema to provide constraints" . + . + "range"@en . + "\u00E9tendue"@fr . + . + . + "Indicates a resource that provides information about the subject resource." . + . + "seeAlso"@en . + "voirAussi"@fr . + . + . + "Indicates membership of a class" . + . + "sousClasseDe"@fr . + "subClassOf"@en . + . + . + "Indicates specialization of properties" . + . + "sousPropri\u00E9t\u00E9De"@fr . + "subPropertyOf"@en . + . + . + "Alt"@en . + "Choix"@fr . + . + . + "Bag"@en . + "Ensemble"@fr . + . + . + "The concept of a property." . + "Property"@en . + "Propri\u00E9t\u00E9"@fr . + . + . + "Sequence"@en . + "S\u00E9quence"@fr . + . + . + "This represents the set of reified statements." . + "D\u00E9claration"@fr . + "Statement"@en . + . + . + . + "object"@en . + "objet"@fr . + . + . + "predicate"@en . + "pr\u00E9dicat"@fr . + . + . + . + "subject"@en . + "sujet"@fr . + . + . + "object"@en . + "value"@fr . + . diff --git a/tests/turtle/rdf-schema.ttl b/tests/turtle/rdf-schema.ttl new file mode 100644 index 0000000..0f1fd89 --- /dev/null +++ b/tests/turtle/rdf-schema.ttl @@ -0,0 +1,154 @@ +# RDF Namespace document converted into Turtle + +@prefix : . +@prefix rdf: . + +rdf:type a rdf:Property; + :comment "Indicates membership of a class"; + :label "type"@en, + "type"@fr; + :range :Class . + +:Class a :Class; + :comment "The concept of Class"; + :label "Class"@en, + "Classe"@fr; + :subClassOf :Resource . + +:ConstraintProperty a :Class; + :comment "Properties used to express RDF Schema constraints."; + :label "ConstraintProperty"@en, + "Propri\u00E9t\u00E9Contrainte"@fr; + :subClassOf :ConstraintResource, + rdf:Property . + +:ConstraintResource a :Class; + :comment "Resources used to express RDF Schema constraints."; + :label "ConstraintResource"@en, + "RessourceContrainte"@fr; + :subClassOf :Resource . + +:Container a :Class; + :comment "This represents the set Containers."; + :label "Container"@en, + "Enveloppe"@fr; + :subClassOf :Resource . + +:ContainerMembershipProperty a :Class; + :label "ContainerMembershipProperty"@en; + :subClassOf rdf:Property . + +:Literal a :Class; + :comment "This represents the set of atomic values, eg. textual strings."; + :label "Literal"@en, + "Litt\u00E9ral"@fr . + +:Resource a :Class; + :comment "The most general class"; + :label "Resource"@en, + "Ressource"@fr . + +:comment a rdf:Property; + :comment "Use this for descriptions"; + :domain :Resource; + :label "comment"@en, + "commentaire"@fr; + :range :Literal . + +:domain a :ConstraintProperty; + :comment "This is how we associate a class with properties that its instances can have"; + :label "domain"@en, + "domaine"@fr . + +:isDefinedBy a rdf:Property; + :comment "Indicates a resource containing and defining the subject resource."; + :domain :Resource; + :label "esD\u00E9finiPar"@fr, + "isDefinedBy"@en; + :range :Resource; + :subPropertyOf :seeAlso . + +:label a rdf:Property; + :comment "Provides a human-readable version of a resource name."; + :domain :Resource; + :label "label"@en, + "label"@fr; + :range :Literal . + +:range a :ConstraintProperty; + :comment "Properties that can be used in a schema to provide constraints"; + :domain rdf:Property; + :label "range"@en, + "\u00E9tendue"@fr; + :range :Class . + +:seeAlso a rdf:Property; + :comment "Indicates a resource that provides information about the subject resource."; + :domain :Resource; + :label "seeAlso"@en, + "voirAussi"@fr; + :range :Resource . + +:subClassOf a rdf:Property; + :comment "Indicates membership of a class"; + :domain :Class; + :label "sousClasseDe"@fr, + "subClassOf"@en; + :range :Class . + +:subPropertyOf a rdf:Property; + :comment "Indicates specialization of properties"; + :domain rdf:Property; + :label "sousPropri\u00E9t\u00E9De"@fr, + "subPropertyOf"@en; + :range rdf:Property . + +rdf:Alt a :Class; + :label "Alt"@en, + "Choix"@fr; + :subClassOf :Container . + +rdf:Bag a :Class; + :label "Bag"@en, + "Ensemble"@fr; + :subClassOf :Container . + +rdf:Property a :Class; + :comment "The concept of a property."; + :label "Property"@en, + "Propri\u00E9t\u00E9"@fr; + :subClassOf :Resource . + +rdf:Seq a :Class; + :label "Sequence"@en, + "S\u00E9quence"@fr; + :subClassOf :Container . + +rdf:Statement a :Class; + :comment "This represents the set of reified statements."; + :label "D\u00E9claration"@fr, + "Statement"@en; + :subClassOf :Resource . + +rdf:object a rdf:Property; + :domain rdf:Statement; + :label "object"@en, + "objet"@fr . + +rdf:predicate a rdf:Property; + :domain rdf:Statement; + :label "predicate"@en, + "pr\u00E9dicat"@fr; + :range rdf:Property . + +rdf:subject a rdf:Property; + :domain rdf:Statement; + :label "subject"@en, + "sujet"@fr; + :range :Resource . + +rdf:value a rdf:Property; + :label "object"@en, + "value"@fr . + +: :seeAlso . diff --git a/tests/turtle/rdfq-results.out b/tests/turtle/rdfq-results.out new file mode 100644 index 0000000..fb25429 --- /dev/null +++ b/tests/turtle/rdfq-results.out @@ -0,0 +1,36 @@ +_:genid1 "x" . +_:genid1 "123"^^ . +_:genid2 "y" . +_:genid2 . +_:genid3 . +_:genid3 _:genid1 . +_:genid3 _:genid2 . +_:genid4 "x" . +_:genid4 "2003-01-21" . +_:genid5 "y" . +_:genid5 . +_:genid6 . +_:genid6 _:genid4 . +_:genid6 _:genid5 . +_:genid7 "x" . +_:genid7 "anon1" . +_:genid8 "y" . +_:genid8 _:a . +_:genid9 . +_:genid9 _:genid7 . +_:genid9 _:genid8 . +_:genid10 "x" . +_:genid10 "anon2" . +_:genid11 "y" . +_:genid11 _:a . +_:genid12 . +_:genid12 _:genid10 . +_:genid12 _:genid11 . + . + "4"^^ . + "x" . + "y" . + _:genid3 . + _:genid6 . + _:genid9 . + _:genid12 . diff --git a/tests/turtle/rdfq-results.ttl b/tests/turtle/rdfq-results.ttl new file mode 100644 index 0000000..c6e72aa --- /dev/null +++ b/tests/turtle/rdfq-results.ttl @@ -0,0 +1,39 @@ +# from http://www.w3.org/2003/03/rdfqr-tests/recording-query-results.html + +@prefix rdf: . +@prefix rs: . + + +<> rdf:type rs:ResultSet ; + rs:size 4 ; + rs:resultVariable "x" ; rs:resultVariable "y" ; + rs:solution + [ rdf:type rs:ResultSolution ; + rs:binding [ rs:variable "x" ; rs:value 123 ] ; + rs:binding [ rs:variable "y" ; rs:value ] + ] ; + + rs:solution + [ rdf:type rs:ResultSolution ; + rs:binding [ rs:variable "x" ; + rs:value "2003-01-21" ] ; + rs:binding [ rs:variable "y" ; + rs:value ] + ] ; + + rs:solution + [ rdf:type rs:ResultSolution ; + rs:binding [ rs:variable "x" ; + rs:value "anon1" ] ; + rs:binding [ rs:variable "y" ; + rs:value _:a ] + ] ; + + rs:solution + [ rdf:type rs:ResultSolution ; + rs:binding [ rs:variable "x" ; + rs:value "anon2" ] ; + rs:binding [ rs:variable "y" ; + rs:value _:a ] + ] ; + . diff --git a/tests/turtle/rdfs-namespace.out b/tests/turtle/rdfs-namespace.out new file mode 100644 index 0000000..4696f8c --- /dev/null +++ b/tests/turtle/rdfs-namespace.out @@ -0,0 +1,131 @@ + . + "Indicates membership of a class" . + . + . + "type"@en . + . + . + "A collection of alternatives."@en . + . + "Alt"@en . + . + . + "An unordered collection."@en . + . + "Bag"@en . + . + . + "The concept of a property." . + . + "Property"@en . + . + . + "An ordered collection."@en . + . + "Seq"@en . + . + . + "The class of RDF statements." . + . + "Statement"@en . + . + . + "The object of an RDF statement." . + . + . + "object"@en . + . + "the predicate of an RDF statement." . + . + . + "predicate"@en . + . + . + "The subject of an RDF statement." . + . + . + "subject"@en . + . + . + "Identifies the principal value (usually a string) of a property when the property value is a structured resource" . + . + . + "value"@en . + . + . + "The concept of Class" . + . + "Class"@en . + . + . + "This represents the set Containers." . + . + "Container"@en . + . + . + "The container membership properties, rdf:1, rdf:2, ..., all of which are sub-properties of 'member'." . + . + "ContainerMembershipProperty"@en . + . + . + "This represents the set of atomic values, eg. textual strings." . + . + "Literal"@en . + . + "The class resource, everything." . + . + "Resource"@en . + . + "Use this for descriptions" . + . + . + "comment"@en . + . + . + "A domain class for a property type" . + . + . + "domain"@en . + . + . + "Indicates the namespace of a resource" . + . + . + "isDefinedBy"@en . + . + . + . + "Provides a human-readable version of a resource name." . + . + . + "label"@en . + . + . + "a member of a container" . + . + . + "member"@en . + . + "A range class for a property type" . + . + . + "range"@en . + . + . + "A resource that provides information about the subject resource" . + . + . + "seeAlso"@en . + . + . + "Indicates membership of a class" . + . + . + "subClassOf"@en . + . + . + "Indicates specialization of properties" . + . + . + "subPropertyOf"@en . + . diff --git a/tests/turtle/rdfs-namespace.ttl b/tests/turtle/rdfs-namespace.ttl new file mode 100644 index 0000000..0d73e6b --- /dev/null +++ b/tests/turtle/rdfs-namespace.ttl @@ -0,0 +1,160 @@ +# RDFS Namespace document converted into Turtle + +@prefix : . +@prefix rdf: . + +rdf:type a rdf:Property; + :comment "Indicates membership of a class"; + :domain :Resource; + :isDefinedBy rdf:; + :label "type"@en; + :range :Class . + +rdf:Alt a :Class; + :comment "A collection of alternatives."@en; + :isDefinedBy rdf:; + :label "Alt"@en; + :subClassOf :Container . + +rdf:Bag a :Class; + :comment "An unordered collection."@en; + :isDefinedBy rdf:; + :label "Bag"@en; + :subClassOf :Container . + +rdf:Property a :Class; + :comment "The concept of a property."; + :isDefinedBy rdf:; + :label "Property"@en; + :subClassOf :Resource . + +rdf:Seq a :Class; + :comment "An ordered collection."@en; + :isDefinedBy rdf:; + :label "Seq"@en; + :subClassOf :Container . + +rdf:Statement a :Class; + :comment "The class of RDF statements."; + :isDefinedBy rdf:; + :label "Statement"@en; + :subClassOf :Resource . + +rdf:object a rdf:Property; + :comment "The object of an RDF statement."; + :domain rdf:Statement; + :isDefinedBy rdf:; + :label "object"@en . + +rdf:predicate a rdf:Property; + :comment "the predicate of an RDF statement."; + :domain rdf:Statement; + :isDefinedBy rdf:; + :label "predicate"@en; + :range rdf:Property . + +rdf:subject a rdf:Property; + :comment "The subject of an RDF statement."; + :domain rdf:Statement; + :isDefinedBy rdf:; + :label "subject"@en; + :range :Resource . + +rdf:value a rdf:Property; + :comment "Identifies the principal value (usually a string) of a property when the property value is a structured resource"; + :domain :Resource; + :isDefinedBy rdf:; + :label "value"@en . + +: :seeAlso . + +:Class a :Class; + :comment "The concept of Class"; + :isDefinedBy :; + :label "Class"@en; + :subClassOf :Resource . + +:Container a :Class; + :comment "This represents the set Containers."; + :isDefinedBy :; + :label "Container"@en; + :subClassOf :Resource . + +:ContainerMembershipProperty a :Class; + :comment "The container membership properties, rdf:1, rdf:2, ..., all of which are sub-properties of 'member'."; + :isDefinedBy :; + :label "ContainerMembershipProperty"@en; + :subClassOf rdf:Property . + +:Literal a :Class; + :comment "This represents the set of atomic values, eg. textual strings."; + :isDefinedBy :; + :label "Literal"@en . + +:Resource a :Class; + :comment "The class resource, everything."; + :isDefinedBy :; + :label "Resource"@en . + +:comment a rdf:Property; + :comment "Use this for descriptions"; + :domain :Resource; + :isDefinedBy :; + :label "comment"@en; + :range :Literal . + +:domain a rdf:Property; + :comment "A domain class for a property type"; + :domain rdf:Property; + :isDefinedBy :; + :label "domain"@en; + :range :Class . + +:isDefinedBy a rdf:Property; + :comment "Indicates the namespace of a resource"; + :domain :Resource; + :isDefinedBy :; + :label "isDefinedBy"@en; + :range :Resource; + :subPropertyOf :seeAlso . + +:label a rdf:Property; + :comment "Provides a human-readable version of a resource name."; + :domain :Resource; + :isDefinedBy :; + :label "label"@en; + :range :Literal . + +:member a rdf:Property; + :comment "a member of a container"; + :domain :Container; + :isDefinedBy :; + :label "member"@en . + +:range a rdf:Property; + :comment "A range class for a property type"; + :domain rdf:Property; + :isDefinedBy :; + :label "range"@en; + :range :Class . + +:seeAlso a rdf:Property; + :comment "A resource that provides information about the subject resource"; + :domain :Resource; + :isDefinedBy :; + :label "seeAlso"@en; + :range :Resource . + +:subClassOf a rdf:Property; + :comment "Indicates membership of a class"; + :domain :Class; + :isDefinedBy :; + :label "subClassOf"@en; + :range :Class . + +:subPropertyOf a rdf:Property; + :comment "Indicates specialization of properties"; + :domain rdf:Property; + :isDefinedBy :; + :label "subPropertyOf"@en; + :range rdf:Property . diff --git a/tests/turtle/test-00.out b/tests/turtle/test-00.out new file mode 100644 index 0000000..7f8b717 --- /dev/null +++ b/tests/turtle/test-00.out @@ -0,0 +1 @@ +_:genid1 . diff --git a/tests/turtle/test-00.ttl b/tests/turtle/test-00.ttl new file mode 100644 index 0000000..78da35e --- /dev/null +++ b/tests/turtle/test-00.ttl @@ -0,0 +1,2 @@ +@prefix : <#> . +[] :x :y . diff --git a/tests/turtle/test-01.out b/tests/turtle/test-01.out new file mode 100644 index 0000000..5ccb5bd --- /dev/null +++ b/tests/turtle/test-01.out @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/turtle/test-01.ttl b/tests/turtle/test-01.ttl new file mode 100644 index 0000000..9070d2c --- /dev/null +++ b/tests/turtle/test-01.ttl @@ -0,0 +1,7 @@ +# Test @prefix and qnames +@prefix : . +@prefix a: . +@prefix b: . +:a :b :c . +a:a a:b a:c . +:a a:a b:a . diff --git a/tests/turtle/test-02.out b/tests/turtle/test-02.out new file mode 100644 index 0000000..99732ab --- /dev/null +++ b/tests/turtle/test-02.out @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/turtle/test-02.ttl b/tests/turtle/test-02.ttl new file mode 100644 index 0000000..a623f3c --- /dev/null +++ b/tests/turtle/test-02.ttl @@ -0,0 +1,5 @@ +# Test , operator +@prefix : . +:a :b :c, + :d, + :e . diff --git a/tests/turtle/test-03.out b/tests/turtle/test-03.out new file mode 100644 index 0000000..d6ce9e8 --- /dev/null +++ b/tests/turtle/test-03.out @@ -0,0 +1,3 @@ + . + . + . diff --git a/tests/turtle/test-03.ttl b/tests/turtle/test-03.ttl new file mode 100644 index 0000000..9179fa5 --- /dev/null +++ b/tests/turtle/test-03.ttl @@ -0,0 +1,5 @@ +# Test ; operator +@prefix : . +:a :b :c ; + :d :e ; + :f :g . diff --git a/tests/turtle/test-04.out b/tests/turtle/test-04.out new file mode 100644 index 0000000..414e4b8 --- /dev/null +++ b/tests/turtle/test-04.out @@ -0,0 +1,2 @@ +_:genid1 . + _:genid2 . diff --git a/tests/turtle/test-04.ttl b/tests/turtle/test-04.ttl new file mode 100644 index 0000000..c518147 --- /dev/null +++ b/tests/turtle/test-04.ttl @@ -0,0 +1,4 @@ +# Test empty [] operator; not allowed as predicate +@prefix : . +[] :a :b . +:c :d [] . diff --git a/tests/turtle/test-05.out b/tests/turtle/test-05.out new file mode 100644 index 0000000..6925d40 --- /dev/null +++ b/tests/turtle/test-05.out @@ -0,0 +1,4 @@ +_:genid1 . +_:genid1 . +_:genid2 . + _:genid2 . diff --git a/tests/turtle/test-05.ttl b/tests/turtle/test-05.ttl new file mode 100644 index 0000000..adcbcab --- /dev/null +++ b/tests/turtle/test-05.ttl @@ -0,0 +1,4 @@ +# Test non empty [] operator; not allowed as predicate +@prefix : . +[ :a :b ] :c :d . +:e :f [ :g :h ] . diff --git a/tests/turtle/test-06.out b/tests/turtle/test-06.out new file mode 100644 index 0000000..49961ea --- /dev/null +++ b/tests/turtle/test-06.out @@ -0,0 +1 @@ + . diff --git a/tests/turtle/test-06.ttl b/tests/turtle/test-06.ttl new file mode 100644 index 0000000..9c1005c --- /dev/null +++ b/tests/turtle/test-06.ttl @@ -0,0 +1,3 @@ +# 'a' only allowed as a predicate +@prefix : . +:a a :b . diff --git a/tests/turtle/test-07.out b/tests/turtle/test-07.out new file mode 100644 index 0000000..7ab6806 --- /dev/null +++ b/tests/turtle/test-07.out @@ -0,0 +1,5 @@ +_:genid1 "banana" . +_:genid1 . +_:genid2 "apple" . +_:genid2 _:genid1 . + _:genid2 . diff --git a/tests/turtle/test-07.ttl b/tests/turtle/test-07.ttl new file mode 100644 index 0000000..8455940 --- /dev/null +++ b/tests/turtle/test-07.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b ( "apple" "banana" ) . + diff --git a/tests/turtle/test-08.out b/tests/turtle/test-08.out new file mode 100644 index 0000000..a77939c --- /dev/null +++ b/tests/turtle/test-08.out @@ -0,0 +1 @@ + . diff --git a/tests/turtle/test-08.ttl b/tests/turtle/test-08.ttl new file mode 100644 index 0000000..adce0a2 --- /dev/null +++ b/tests/turtle/test-08.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b ( ) . + diff --git a/tests/turtle/test-09.out b/tests/turtle/test-09.out new file mode 100644 index 0000000..5fdb909 --- /dev/null +++ b/tests/turtle/test-09.out @@ -0,0 +1,4 @@ +_:hasParent . +_:genid1 . +_:genid1 _:hasParent . +_:genid1 "2"^^ . diff --git a/tests/turtle/test-09.ttl b/tests/turtle/test-09.ttl new file mode 100644 index 0000000..0afe1b0 --- /dev/null +++ b/tests/turtle/test-09.ttl @@ -0,0 +1,10 @@ +# Test integer datatyped literals using an OWL cardinality constraint +@prefix owl: . + +# based on examples in the OWL Reference + +_:hasParent a owl:ObjectProperty . + +[] a owl:Restriction ; + owl:onProperty _:hasParent ; + owl:maxCardinality 2 . diff --git a/tests/turtle/test-10.out b/tests/turtle/test-10.out new file mode 100644 index 0000000..ff88aa6 --- /dev/null +++ b/tests/turtle/test-10.out @@ -0,0 +1,5 @@ + "000000"^^ . + "0"^^ . + "000001"^^ . + "2"^^ . + "4"^^ . diff --git a/tests/turtle/test-10.ttl b/tests/turtle/test-10.ttl new file mode 100644 index 0000000..5d36360 --- /dev/null +++ b/tests/turtle/test-10.ttl @@ -0,0 +1,5 @@ + 000000 . + 0 . + 000001 . + 2 . + 4 . diff --git a/tests/turtle/test-11.out b/tests/turtle/test-11.out new file mode 100644 index 0000000..f936a5b --- /dev/null +++ b/tests/turtle/test-11.out @@ -0,0 +1,4 @@ + "a" . + "b" . + "c" . + "d" . diff --git a/tests/turtle/test-11.ttl b/tests/turtle/test-11.ttl new file mode 100644 index 0000000..3de1a43 --- /dev/null +++ b/tests/turtle/test-11.ttl @@ -0,0 +1,10 @@ +# Tests for - and _ in names, qnames +@prefix ex1: . +@prefix ex-2: . +@prefix ex3_: . +@prefix ex4-: . + +ex1:foo-bar ex1:foo_bar "a" . +ex-2:foo-bar ex-2:foo_bar "b" . +ex3_:foo-bar ex3_:foo_bar "c" . +ex4-:foo-bar ex4-:foo_bar "d" . diff --git a/tests/turtle/test-12.out b/tests/turtle/test-12.out new file mode 100644 index 0000000..67404a5 --- /dev/null +++ b/tests/turtle/test-12.out @@ -0,0 +1,4 @@ + "1" . + "2" . + "def" . + "678" . diff --git a/tests/turtle/test-12.ttl b/tests/turtle/test-12.ttl new file mode 100644 index 0000000..1fed9f5 --- /dev/null +++ b/tests/turtle/test-12.ttl @@ -0,0 +1,9 @@ +# Tests for rdf:_ and other qnames starting with _ +@prefix rdf: . +@prefix ex: . +@prefix : . + +ex:foo rdf:_1 "1" . +ex:foo rdf:_2 "2" . +ex:foo :_abc "def" . +ex:foo :_345 "678" . diff --git a/tests/turtle/test-13.out b/tests/turtle/test-13.out new file mode 100644 index 0000000..9feb5ad --- /dev/null +++ b/tests/turtle/test-13.out @@ -0,0 +1,2 @@ +_:genid1 _:genid2 . + . diff --git a/tests/turtle/test-13.ttl b/tests/turtle/test-13.ttl new file mode 100644 index 0000000..a8be95b --- /dev/null +++ b/tests/turtle/test-13.ttl @@ -0,0 +1,7 @@ +# Test for : allowed +@prefix : . + +[] : [] . + +: : : . + diff --git a/tests/turtle/test-14.out b/tests/turtle/test-14.out new file mode 100644 index 0000000..791b3a7 --- /dev/null +++ b/tests/turtle/test-14.out @@ -0,0 +1,10000 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/turtle/test-14.ttl b/tests/turtle/test-14.ttl new file mode 100644 index 0000000..ad9dbde --- /dev/null +++ b/tests/turtle/test-14.ttl @@ -0,0 +1,10002 @@ +# 10000 triples, more than the default Bison stack size +@prefix : . +:a1 :a1 :a1. +:a2 :a2 :a2. +:a3 :a3 :a3. +:a4 :a4 :a4. +:a5 :a5 :a5. +:a6 :a6 :a6. +:a7 :a7 :a7. +:a8 :a8 :a8. +:a9 :a9 :a9. +:a10 :a10 :a10. +:a11 :a11 :a11. +:a12 :a12 :a12. +:a13 :a13 :a13. +:a14 :a14 :a14. +:a15 :a15 :a15. +:a16 :a16 :a16. +:a17 :a17 :a17. +:a18 :a18 :a18. +:a19 :a19 :a19. +:a20 :a20 :a20. +:a21 :a21 :a21. +:a22 :a22 :a22. +:a23 :a23 :a23. +:a24 :a24 :a24. +:a25 :a25 :a25. +:a26 :a26 :a26. +:a27 :a27 :a27. +:a28 :a28 :a28. +:a29 :a29 :a29. +:a30 :a30 :a30. +:a31 :a31 :a31. +:a32 :a32 :a32. +:a33 :a33 :a33. +:a34 :a34 :a34. +:a35 :a35 :a35. +:a36 :a36 :a36. +:a37 :a37 :a37. +:a38 :a38 :a38. +:a39 :a39 :a39. +:a40 :a40 :a40. +:a41 :a41 :a41. +:a42 :a42 :a42. +:a43 :a43 :a43. +:a44 :a44 :a44. +:a45 :a45 :a45. +:a46 :a46 :a46. +:a47 :a47 :a47. +:a48 :a48 :a48. +:a49 :a49 :a49. +:a50 :a50 :a50. +:a51 :a51 :a51. +:a52 :a52 :a52. +:a53 :a53 :a53. +:a54 :a54 :a54. +:a55 :a55 :a55. +:a56 :a56 :a56. +:a57 :a57 :a57. +:a58 :a58 :a58. +:a59 :a59 :a59. +:a60 :a60 :a60. +:a61 :a61 :a61. +:a62 :a62 :a62. +:a63 :a63 :a63. +:a64 :a64 :a64. +:a65 :a65 :a65. +:a66 :a66 :a66. +:a67 :a67 :a67. +:a68 :a68 :a68. +:a69 :a69 :a69. +:a70 :a70 :a70. +:a71 :a71 :a71. +:a72 :a72 :a72. +:a73 :a73 :a73. +:a74 :a74 :a74. +:a75 :a75 :a75. +:a76 :a76 :a76. +:a77 :a77 :a77. +:a78 :a78 :a78. +:a79 :a79 :a79. +:a80 :a80 :a80. +:a81 :a81 :a81. +:a82 :a82 :a82. +:a83 :a83 :a83. +:a84 :a84 :a84. +:a85 :a85 :a85. +:a86 :a86 :a86. +:a87 :a87 :a87. +:a88 :a88 :a88. +:a89 :a89 :a89. +:a90 :a90 :a90. +:a91 :a91 :a91. +:a92 :a92 :a92. +:a93 :a93 :a93. +:a94 :a94 :a94. +:a95 :a95 :a95. +:a96 :a96 :a96. +:a97 :a97 :a97. +:a98 :a98 :a98. +:a99 :a99 :a99. +:a100 :a100 :a100. +:a101 :a101 :a101. +:a102 :a102 :a102. +:a103 :a103 :a103. +:a104 :a104 :a104. +:a105 :a105 :a105. +:a106 :a106 :a106. +:a107 :a107 :a107. +:a108 :a108 :a108. +:a109 :a109 :a109. +:a110 :a110 :a110. +:a111 :a111 :a111. +:a112 :a112 :a112. +:a113 :a113 :a113. +:a114 :a114 :a114. +:a115 :a115 :a115. +:a116 :a116 :a116. +:a117 :a117 :a117. +:a118 :a118 :a118. +:a119 :a119 :a119. +:a120 :a120 :a120. +:a121 :a121 :a121. +:a122 :a122 :a122. +:a123 :a123 :a123. +:a124 :a124 :a124. +:a125 :a125 :a125. +:a126 :a126 :a126. +:a127 :a127 :a127. +:a128 :a128 :a128. +:a129 :a129 :a129. +:a130 :a130 :a130. +:a131 :a131 :a131. +:a132 :a132 :a132. +:a133 :a133 :a133. +:a134 :a134 :a134. +:a135 :a135 :a135. +:a136 :a136 :a136. +:a137 :a137 :a137. +:a138 :a138 :a138. +:a139 :a139 :a139. +:a140 :a140 :a140. +:a141 :a141 :a141. +:a142 :a142 :a142. +:a143 :a143 :a143. +:a144 :a144 :a144. +:a145 :a145 :a145. +:a146 :a146 :a146. +:a147 :a147 :a147. +:a148 :a148 :a148. +:a149 :a149 :a149. +:a150 :a150 :a150. +:a151 :a151 :a151. +:a152 :a152 :a152. +:a153 :a153 :a153. +:a154 :a154 :a154. +:a155 :a155 :a155. +:a156 :a156 :a156. +:a157 :a157 :a157. +:a158 :a158 :a158. +:a159 :a159 :a159. +:a160 :a160 :a160. +:a161 :a161 :a161. +:a162 :a162 :a162. +:a163 :a163 :a163. +:a164 :a164 :a164. +:a165 :a165 :a165. +:a166 :a166 :a166. +:a167 :a167 :a167. +:a168 :a168 :a168. +:a169 :a169 :a169. +:a170 :a170 :a170. +:a171 :a171 :a171. +:a172 :a172 :a172. +:a173 :a173 :a173. +:a174 :a174 :a174. +:a175 :a175 :a175. +:a176 :a176 :a176. +:a177 :a177 :a177. +:a178 :a178 :a178. +:a179 :a179 :a179. +:a180 :a180 :a180. +:a181 :a181 :a181. +:a182 :a182 :a182. +:a183 :a183 :a183. +:a184 :a184 :a184. +:a185 :a185 :a185. +:a186 :a186 :a186. +:a187 :a187 :a187. +:a188 :a188 :a188. +:a189 :a189 :a189. +:a190 :a190 :a190. +:a191 :a191 :a191. +:a192 :a192 :a192. +:a193 :a193 :a193. +:a194 :a194 :a194. +:a195 :a195 :a195. +:a196 :a196 :a196. +:a197 :a197 :a197. +:a198 :a198 :a198. +:a199 :a199 :a199. +:a200 :a200 :a200. +:a201 :a201 :a201. +:a202 :a202 :a202. +:a203 :a203 :a203. +:a204 :a204 :a204. +:a205 :a205 :a205. +:a206 :a206 :a206. +:a207 :a207 :a207. +:a208 :a208 :a208. +:a209 :a209 :a209. +:a210 :a210 :a210. +:a211 :a211 :a211. +:a212 :a212 :a212. +:a213 :a213 :a213. +:a214 :a214 :a214. +:a215 :a215 :a215. +:a216 :a216 :a216. +:a217 :a217 :a217. +:a218 :a218 :a218. +:a219 :a219 :a219. +:a220 :a220 :a220. +:a221 :a221 :a221. +:a222 :a222 :a222. +:a223 :a223 :a223. +:a224 :a224 :a224. +:a225 :a225 :a225. +:a226 :a226 :a226. +:a227 :a227 :a227. +:a228 :a228 :a228. +:a229 :a229 :a229. +:a230 :a230 :a230. +:a231 :a231 :a231. +:a232 :a232 :a232. +:a233 :a233 :a233. +:a234 :a234 :a234. +:a235 :a235 :a235. +:a236 :a236 :a236. +:a237 :a237 :a237. +:a238 :a238 :a238. +:a239 :a239 :a239. +:a240 :a240 :a240. +:a241 :a241 :a241. +:a242 :a242 :a242. +:a243 :a243 :a243. +:a244 :a244 :a244. +:a245 :a245 :a245. +:a246 :a246 :a246. +:a247 :a247 :a247. +:a248 :a248 :a248. +:a249 :a249 :a249. +:a250 :a250 :a250. +:a251 :a251 :a251. +:a252 :a252 :a252. +:a253 :a253 :a253. +:a254 :a254 :a254. +:a255 :a255 :a255. +:a256 :a256 :a256. +:a257 :a257 :a257. +:a258 :a258 :a258. +:a259 :a259 :a259. +:a260 :a260 :a260. +:a261 :a261 :a261. +:a262 :a262 :a262. +:a263 :a263 :a263. +:a264 :a264 :a264. +:a265 :a265 :a265. +:a266 :a266 :a266. +:a267 :a267 :a267. +:a268 :a268 :a268. +:a269 :a269 :a269. +:a270 :a270 :a270. +:a271 :a271 :a271. +:a272 :a272 :a272. +:a273 :a273 :a273. +:a274 :a274 :a274. +:a275 :a275 :a275. +:a276 :a276 :a276. +:a277 :a277 :a277. +:a278 :a278 :a278. +:a279 :a279 :a279. +:a280 :a280 :a280. +:a281 :a281 :a281. +:a282 :a282 :a282. +:a283 :a283 :a283. +:a284 :a284 :a284. +:a285 :a285 :a285. +:a286 :a286 :a286. +:a287 :a287 :a287. +:a288 :a288 :a288. +:a289 :a289 :a289. +:a290 :a290 :a290. +:a291 :a291 :a291. +:a292 :a292 :a292. +:a293 :a293 :a293. +:a294 :a294 :a294. +:a295 :a295 :a295. +:a296 :a296 :a296. +:a297 :a297 :a297. +:a298 :a298 :a298. +:a299 :a299 :a299. +:a300 :a300 :a300. +:a301 :a301 :a301. +:a302 :a302 :a302. +:a303 :a303 :a303. +:a304 :a304 :a304. +:a305 :a305 :a305. +:a306 :a306 :a306. +:a307 :a307 :a307. +:a308 :a308 :a308. +:a309 :a309 :a309. +:a310 :a310 :a310. +:a311 :a311 :a311. +:a312 :a312 :a312. +:a313 :a313 :a313. +:a314 :a314 :a314. +:a315 :a315 :a315. +:a316 :a316 :a316. +:a317 :a317 :a317. +:a318 :a318 :a318. +:a319 :a319 :a319. +:a320 :a320 :a320. +:a321 :a321 :a321. +:a322 :a322 :a322. +:a323 :a323 :a323. +:a324 :a324 :a324. +:a325 :a325 :a325. +:a326 :a326 :a326. +:a327 :a327 :a327. +:a328 :a328 :a328. +:a329 :a329 :a329. +:a330 :a330 :a330. +:a331 :a331 :a331. +:a332 :a332 :a332. +:a333 :a333 :a333. +:a334 :a334 :a334. +:a335 :a335 :a335. +:a336 :a336 :a336. +:a337 :a337 :a337. +:a338 :a338 :a338. +:a339 :a339 :a339. +:a340 :a340 :a340. +:a341 :a341 :a341. +:a342 :a342 :a342. +:a343 :a343 :a343. +:a344 :a344 :a344. +:a345 :a345 :a345. +:a346 :a346 :a346. +:a347 :a347 :a347. +:a348 :a348 :a348. +:a349 :a349 :a349. +:a350 :a350 :a350. +:a351 :a351 :a351. +:a352 :a352 :a352. +:a353 :a353 :a353. +:a354 :a354 :a354. +:a355 :a355 :a355. +:a356 :a356 :a356. +:a357 :a357 :a357. +:a358 :a358 :a358. +:a359 :a359 :a359. +:a360 :a360 :a360. +:a361 :a361 :a361. +:a362 :a362 :a362. +:a363 :a363 :a363. +:a364 :a364 :a364. +:a365 :a365 :a365. +:a366 :a366 :a366. +:a367 :a367 :a367. +:a368 :a368 :a368. +:a369 :a369 :a369. +:a370 :a370 :a370. +:a371 :a371 :a371. +:a372 :a372 :a372. +:a373 :a373 :a373. +:a374 :a374 :a374. +:a375 :a375 :a375. +:a376 :a376 :a376. +:a377 :a377 :a377. +:a378 :a378 :a378. +:a379 :a379 :a379. +:a380 :a380 :a380. +:a381 :a381 :a381. +:a382 :a382 :a382. +:a383 :a383 :a383. +:a384 :a384 :a384. +:a385 :a385 :a385. +:a386 :a386 :a386. +:a387 :a387 :a387. +:a388 :a388 :a388. +:a389 :a389 :a389. +:a390 :a390 :a390. +:a391 :a391 :a391. +:a392 :a392 :a392. +:a393 :a393 :a393. +:a394 :a394 :a394. +:a395 :a395 :a395. +:a396 :a396 :a396. +:a397 :a397 :a397. +:a398 :a398 :a398. +:a399 :a399 :a399. +:a400 :a400 :a400. +:a401 :a401 :a401. +:a402 :a402 :a402. +:a403 :a403 :a403. +:a404 :a404 :a404. +:a405 :a405 :a405. +:a406 :a406 :a406. +:a407 :a407 :a407. +:a408 :a408 :a408. +:a409 :a409 :a409. +:a410 :a410 :a410. +:a411 :a411 :a411. +:a412 :a412 :a412. +:a413 :a413 :a413. +:a414 :a414 :a414. +:a415 :a415 :a415. +:a416 :a416 :a416. +:a417 :a417 :a417. +:a418 :a418 :a418. +:a419 :a419 :a419. +:a420 :a420 :a420. +:a421 :a421 :a421. +:a422 :a422 :a422. +:a423 :a423 :a423. +:a424 :a424 :a424. +:a425 :a425 :a425. +:a426 :a426 :a426. +:a427 :a427 :a427. +:a428 :a428 :a428. +:a429 :a429 :a429. +:a430 :a430 :a430. +:a431 :a431 :a431. +:a432 :a432 :a432. +:a433 :a433 :a433. +:a434 :a434 :a434. +:a435 :a435 :a435. +:a436 :a436 :a436. +:a437 :a437 :a437. +:a438 :a438 :a438. +:a439 :a439 :a439. +:a440 :a440 :a440. +:a441 :a441 :a441. +:a442 :a442 :a442. +:a443 :a443 :a443. +:a444 :a444 :a444. +:a445 :a445 :a445. +:a446 :a446 :a446. +:a447 :a447 :a447. +:a448 :a448 :a448. +:a449 :a449 :a449. +:a450 :a450 :a450. +:a451 :a451 :a451. +:a452 :a452 :a452. +:a453 :a453 :a453. +:a454 :a454 :a454. +:a455 :a455 :a455. +:a456 :a456 :a456. +:a457 :a457 :a457. +:a458 :a458 :a458. +:a459 :a459 :a459. +:a460 :a460 :a460. +:a461 :a461 :a461. +:a462 :a462 :a462. +:a463 :a463 :a463. +:a464 :a464 :a464. +:a465 :a465 :a465. +:a466 :a466 :a466. +:a467 :a467 :a467. +:a468 :a468 :a468. +:a469 :a469 :a469. +:a470 :a470 :a470. +:a471 :a471 :a471. +:a472 :a472 :a472. +:a473 :a473 :a473. +:a474 :a474 :a474. +:a475 :a475 :a475. +:a476 :a476 :a476. +:a477 :a477 :a477. +:a478 :a478 :a478. +:a479 :a479 :a479. +:a480 :a480 :a480. +:a481 :a481 :a481. +:a482 :a482 :a482. +:a483 :a483 :a483. +:a484 :a484 :a484. +:a485 :a485 :a485. +:a486 :a486 :a486. +:a487 :a487 :a487. +:a488 :a488 :a488. +:a489 :a489 :a489. +:a490 :a490 :a490. +:a491 :a491 :a491. +:a492 :a492 :a492. +:a493 :a493 :a493. +:a494 :a494 :a494. +:a495 :a495 :a495. +:a496 :a496 :a496. +:a497 :a497 :a497. +:a498 :a498 :a498. +:a499 :a499 :a499. +:a500 :a500 :a500. +:a501 :a501 :a501. +:a502 :a502 :a502. +:a503 :a503 :a503. +:a504 :a504 :a504. +:a505 :a505 :a505. +:a506 :a506 :a506. +:a507 :a507 :a507. +:a508 :a508 :a508. +:a509 :a509 :a509. +:a510 :a510 :a510. +:a511 :a511 :a511. +:a512 :a512 :a512. +:a513 :a513 :a513. +:a514 :a514 :a514. +:a515 :a515 :a515. +:a516 :a516 :a516. +:a517 :a517 :a517. +:a518 :a518 :a518. +:a519 :a519 :a519. +:a520 :a520 :a520. +:a521 :a521 :a521. +:a522 :a522 :a522. +:a523 :a523 :a523. +:a524 :a524 :a524. +:a525 :a525 :a525. +:a526 :a526 :a526. +:a527 :a527 :a527. +:a528 :a528 :a528. +:a529 :a529 :a529. +:a530 :a530 :a530. +:a531 :a531 :a531. +:a532 :a532 :a532. +:a533 :a533 :a533. +:a534 :a534 :a534. +:a535 :a535 :a535. +:a536 :a536 :a536. +:a537 :a537 :a537. +:a538 :a538 :a538. +:a539 :a539 :a539. +:a540 :a540 :a540. +:a541 :a541 :a541. +:a542 :a542 :a542. +:a543 :a543 :a543. +:a544 :a544 :a544. +:a545 :a545 :a545. +:a546 :a546 :a546. +:a547 :a547 :a547. +:a548 :a548 :a548. +:a549 :a549 :a549. +:a550 :a550 :a550. +:a551 :a551 :a551. +:a552 :a552 :a552. +:a553 :a553 :a553. +:a554 :a554 :a554. +:a555 :a555 :a555. +:a556 :a556 :a556. +:a557 :a557 :a557. +:a558 :a558 :a558. +:a559 :a559 :a559. +:a560 :a560 :a560. +:a561 :a561 :a561. +:a562 :a562 :a562. +:a563 :a563 :a563. +:a564 :a564 :a564. +:a565 :a565 :a565. +:a566 :a566 :a566. +:a567 :a567 :a567. +:a568 :a568 :a568. +:a569 :a569 :a569. +:a570 :a570 :a570. +:a571 :a571 :a571. +:a572 :a572 :a572. +:a573 :a573 :a573. +:a574 :a574 :a574. +:a575 :a575 :a575. +:a576 :a576 :a576. +:a577 :a577 :a577. +:a578 :a578 :a578. +:a579 :a579 :a579. +:a580 :a580 :a580. +:a581 :a581 :a581. +:a582 :a582 :a582. +:a583 :a583 :a583. +:a584 :a584 :a584. +:a585 :a585 :a585. +:a586 :a586 :a586. +:a587 :a587 :a587. +:a588 :a588 :a588. +:a589 :a589 :a589. +:a590 :a590 :a590. +:a591 :a591 :a591. +:a592 :a592 :a592. +:a593 :a593 :a593. +:a594 :a594 :a594. +:a595 :a595 :a595. +:a596 :a596 :a596. +:a597 :a597 :a597. +:a598 :a598 :a598. +:a599 :a599 :a599. +:a600 :a600 :a600. +:a601 :a601 :a601. +:a602 :a602 :a602. +:a603 :a603 :a603. +:a604 :a604 :a604. +:a605 :a605 :a605. +:a606 :a606 :a606. +:a607 :a607 :a607. +:a608 :a608 :a608. +:a609 :a609 :a609. +:a610 :a610 :a610. +:a611 :a611 :a611. +:a612 :a612 :a612. +:a613 :a613 :a613. +:a614 :a614 :a614. +:a615 :a615 :a615. +:a616 :a616 :a616. +:a617 :a617 :a617. +:a618 :a618 :a618. +:a619 :a619 :a619. +:a620 :a620 :a620. +:a621 :a621 :a621. +:a622 :a622 :a622. +:a623 :a623 :a623. +:a624 :a624 :a624. +:a625 :a625 :a625. +:a626 :a626 :a626. +:a627 :a627 :a627. +:a628 :a628 :a628. +:a629 :a629 :a629. +:a630 :a630 :a630. +:a631 :a631 :a631. +:a632 :a632 :a632. +:a633 :a633 :a633. +:a634 :a634 :a634. +:a635 :a635 :a635. +:a636 :a636 :a636. +:a637 :a637 :a637. +:a638 :a638 :a638. +:a639 :a639 :a639. +:a640 :a640 :a640. +:a641 :a641 :a641. +:a642 :a642 :a642. +:a643 :a643 :a643. +:a644 :a644 :a644. +:a645 :a645 :a645. +:a646 :a646 :a646. +:a647 :a647 :a647. +:a648 :a648 :a648. +:a649 :a649 :a649. +:a650 :a650 :a650. +:a651 :a651 :a651. +:a652 :a652 :a652. +:a653 :a653 :a653. +:a654 :a654 :a654. +:a655 :a655 :a655. +:a656 :a656 :a656. +:a657 :a657 :a657. +:a658 :a658 :a658. +:a659 :a659 :a659. +:a660 :a660 :a660. +:a661 :a661 :a661. +:a662 :a662 :a662. +:a663 :a663 :a663. +:a664 :a664 :a664. +:a665 :a665 :a665. +:a666 :a666 :a666. +:a667 :a667 :a667. +:a668 :a668 :a668. +:a669 :a669 :a669. +:a670 :a670 :a670. +:a671 :a671 :a671. +:a672 :a672 :a672. +:a673 :a673 :a673. +:a674 :a674 :a674. +:a675 :a675 :a675. +:a676 :a676 :a676. +:a677 :a677 :a677. +:a678 :a678 :a678. +:a679 :a679 :a679. +:a680 :a680 :a680. +:a681 :a681 :a681. +:a682 :a682 :a682. +:a683 :a683 :a683. +:a684 :a684 :a684. +:a685 :a685 :a685. +:a686 :a686 :a686. +:a687 :a687 :a687. +:a688 :a688 :a688. +:a689 :a689 :a689. +:a690 :a690 :a690. +:a691 :a691 :a691. +:a692 :a692 :a692. +:a693 :a693 :a693. +:a694 :a694 :a694. +:a695 :a695 :a695. +:a696 :a696 :a696. +:a697 :a697 :a697. +:a698 :a698 :a698. +:a699 :a699 :a699. +:a700 :a700 :a700. +:a701 :a701 :a701. +:a702 :a702 :a702. +:a703 :a703 :a703. +:a704 :a704 :a704. +:a705 :a705 :a705. +:a706 :a706 :a706. +:a707 :a707 :a707. +:a708 :a708 :a708. +:a709 :a709 :a709. +:a710 :a710 :a710. +:a711 :a711 :a711. +:a712 :a712 :a712. +:a713 :a713 :a713. +:a714 :a714 :a714. +:a715 :a715 :a715. +:a716 :a716 :a716. +:a717 :a717 :a717. +:a718 :a718 :a718. +:a719 :a719 :a719. +:a720 :a720 :a720. +:a721 :a721 :a721. +:a722 :a722 :a722. +:a723 :a723 :a723. +:a724 :a724 :a724. +:a725 :a725 :a725. +:a726 :a726 :a726. +:a727 :a727 :a727. +:a728 :a728 :a728. +:a729 :a729 :a729. +:a730 :a730 :a730. +:a731 :a731 :a731. +:a732 :a732 :a732. +:a733 :a733 :a733. +:a734 :a734 :a734. +:a735 :a735 :a735. +:a736 :a736 :a736. +:a737 :a737 :a737. +:a738 :a738 :a738. +:a739 :a739 :a739. +:a740 :a740 :a740. +:a741 :a741 :a741. +:a742 :a742 :a742. +:a743 :a743 :a743. +:a744 :a744 :a744. +:a745 :a745 :a745. +:a746 :a746 :a746. +:a747 :a747 :a747. +:a748 :a748 :a748. +:a749 :a749 :a749. +:a750 :a750 :a750. +:a751 :a751 :a751. +:a752 :a752 :a752. +:a753 :a753 :a753. +:a754 :a754 :a754. +:a755 :a755 :a755. +:a756 :a756 :a756. +:a757 :a757 :a757. +:a758 :a758 :a758. +:a759 :a759 :a759. +:a760 :a760 :a760. +:a761 :a761 :a761. +:a762 :a762 :a762. +:a763 :a763 :a763. +:a764 :a764 :a764. +:a765 :a765 :a765. +:a766 :a766 :a766. +:a767 :a767 :a767. +:a768 :a768 :a768. +:a769 :a769 :a769. +:a770 :a770 :a770. +:a771 :a771 :a771. +:a772 :a772 :a772. +:a773 :a773 :a773. +:a774 :a774 :a774. +:a775 :a775 :a775. +:a776 :a776 :a776. +:a777 :a777 :a777. +:a778 :a778 :a778. +:a779 :a779 :a779. +:a780 :a780 :a780. +:a781 :a781 :a781. +:a782 :a782 :a782. +:a783 :a783 :a783. +:a784 :a784 :a784. +:a785 :a785 :a785. +:a786 :a786 :a786. +:a787 :a787 :a787. +:a788 :a788 :a788. +:a789 :a789 :a789. +:a790 :a790 :a790. +:a791 :a791 :a791. +:a792 :a792 :a792. +:a793 :a793 :a793. +:a794 :a794 :a794. +:a795 :a795 :a795. +:a796 :a796 :a796. +:a797 :a797 :a797. +:a798 :a798 :a798. +:a799 :a799 :a799. +:a800 :a800 :a800. +:a801 :a801 :a801. +:a802 :a802 :a802. +:a803 :a803 :a803. +:a804 :a804 :a804. +:a805 :a805 :a805. +:a806 :a806 :a806. +:a807 :a807 :a807. +:a808 :a808 :a808. +:a809 :a809 :a809. +:a810 :a810 :a810. +:a811 :a811 :a811. +:a812 :a812 :a812. +:a813 :a813 :a813. +:a814 :a814 :a814. +:a815 :a815 :a815. +:a816 :a816 :a816. +:a817 :a817 :a817. +:a818 :a818 :a818. +:a819 :a819 :a819. +:a820 :a820 :a820. +:a821 :a821 :a821. +:a822 :a822 :a822. +:a823 :a823 :a823. +:a824 :a824 :a824. +:a825 :a825 :a825. +:a826 :a826 :a826. +:a827 :a827 :a827. +:a828 :a828 :a828. +:a829 :a829 :a829. +:a830 :a830 :a830. +:a831 :a831 :a831. +:a832 :a832 :a832. +:a833 :a833 :a833. +:a834 :a834 :a834. +:a835 :a835 :a835. +:a836 :a836 :a836. +:a837 :a837 :a837. +:a838 :a838 :a838. +:a839 :a839 :a839. +:a840 :a840 :a840. +:a841 :a841 :a841. +:a842 :a842 :a842. +:a843 :a843 :a843. +:a844 :a844 :a844. +:a845 :a845 :a845. +:a846 :a846 :a846. +:a847 :a847 :a847. +:a848 :a848 :a848. +:a849 :a849 :a849. +:a850 :a850 :a850. +:a851 :a851 :a851. +:a852 :a852 :a852. +:a853 :a853 :a853. +:a854 :a854 :a854. +:a855 :a855 :a855. +:a856 :a856 :a856. +:a857 :a857 :a857. +:a858 :a858 :a858. +:a859 :a859 :a859. +:a860 :a860 :a860. +:a861 :a861 :a861. +:a862 :a862 :a862. +:a863 :a863 :a863. +:a864 :a864 :a864. +:a865 :a865 :a865. +:a866 :a866 :a866. +:a867 :a867 :a867. +:a868 :a868 :a868. +:a869 :a869 :a869. +:a870 :a870 :a870. +:a871 :a871 :a871. +:a872 :a872 :a872. +:a873 :a873 :a873. +:a874 :a874 :a874. +:a875 :a875 :a875. +:a876 :a876 :a876. +:a877 :a877 :a877. +:a878 :a878 :a878. +:a879 :a879 :a879. +:a880 :a880 :a880. +:a881 :a881 :a881. +:a882 :a882 :a882. +:a883 :a883 :a883. +:a884 :a884 :a884. +:a885 :a885 :a885. +:a886 :a886 :a886. +:a887 :a887 :a887. +:a888 :a888 :a888. +:a889 :a889 :a889. +:a890 :a890 :a890. +:a891 :a891 :a891. +:a892 :a892 :a892. +:a893 :a893 :a893. +:a894 :a894 :a894. +:a895 :a895 :a895. +:a896 :a896 :a896. +:a897 :a897 :a897. +:a898 :a898 :a898. +:a899 :a899 :a899. +:a900 :a900 :a900. +:a901 :a901 :a901. +:a902 :a902 :a902. +:a903 :a903 :a903. +:a904 :a904 :a904. +:a905 :a905 :a905. +:a906 :a906 :a906. +:a907 :a907 :a907. +:a908 :a908 :a908. +:a909 :a909 :a909. +:a910 :a910 :a910. +:a911 :a911 :a911. +:a912 :a912 :a912. +:a913 :a913 :a913. +:a914 :a914 :a914. +:a915 :a915 :a915. +:a916 :a916 :a916. +:a917 :a917 :a917. +:a918 :a918 :a918. +:a919 :a919 :a919. +:a920 :a920 :a920. +:a921 :a921 :a921. +:a922 :a922 :a922. +:a923 :a923 :a923. +:a924 :a924 :a924. +:a925 :a925 :a925. +:a926 :a926 :a926. +:a927 :a927 :a927. +:a928 :a928 :a928. +:a929 :a929 :a929. +:a930 :a930 :a930. +:a931 :a931 :a931. +:a932 :a932 :a932. +:a933 :a933 :a933. +:a934 :a934 :a934. +:a935 :a935 :a935. +:a936 :a936 :a936. +:a937 :a937 :a937. +:a938 :a938 :a938. +:a939 :a939 :a939. +:a940 :a940 :a940. +:a941 :a941 :a941. +:a942 :a942 :a942. +:a943 :a943 :a943. +:a944 :a944 :a944. +:a945 :a945 :a945. +:a946 :a946 :a946. +:a947 :a947 :a947. +:a948 :a948 :a948. +:a949 :a949 :a949. +:a950 :a950 :a950. +:a951 :a951 :a951. +:a952 :a952 :a952. +:a953 :a953 :a953. +:a954 :a954 :a954. +:a955 :a955 :a955. +:a956 :a956 :a956. +:a957 :a957 :a957. +:a958 :a958 :a958. +:a959 :a959 :a959. +:a960 :a960 :a960. +:a961 :a961 :a961. +:a962 :a962 :a962. +:a963 :a963 :a963. +:a964 :a964 :a964. +:a965 :a965 :a965. +:a966 :a966 :a966. +:a967 :a967 :a967. +:a968 :a968 :a968. +:a969 :a969 :a969. +:a970 :a970 :a970. +:a971 :a971 :a971. +:a972 :a972 :a972. +:a973 :a973 :a973. +:a974 :a974 :a974. +:a975 :a975 :a975. +:a976 :a976 :a976. +:a977 :a977 :a977. +:a978 :a978 :a978. +:a979 :a979 :a979. +:a980 :a980 :a980. +:a981 :a981 :a981. +:a982 :a982 :a982. +:a983 :a983 :a983. +:a984 :a984 :a984. +:a985 :a985 :a985. +:a986 :a986 :a986. +:a987 :a987 :a987. +:a988 :a988 :a988. +:a989 :a989 :a989. +:a990 :a990 :a990. +:a991 :a991 :a991. +:a992 :a992 :a992. +:a993 :a993 :a993. +:a994 :a994 :a994. +:a995 :a995 :a995. +:a996 :a996 :a996. +:a997 :a997 :a997. +:a998 :a998 :a998. +:a999 :a999 :a999. +:a1000 :a1000 :a1000. +:a1001 :a1001 :a1001. +:a1002 :a1002 :a1002. +:a1003 :a1003 :a1003. +:a1004 :a1004 :a1004. +:a1005 :a1005 :a1005. +:a1006 :a1006 :a1006. +:a1007 :a1007 :a1007. +:a1008 :a1008 :a1008. +:a1009 :a1009 :a1009. +:a1010 :a1010 :a1010. +:a1011 :a1011 :a1011. +:a1012 :a1012 :a1012. +:a1013 :a1013 :a1013. +:a1014 :a1014 :a1014. +:a1015 :a1015 :a1015. +:a1016 :a1016 :a1016. +:a1017 :a1017 :a1017. +:a1018 :a1018 :a1018. +:a1019 :a1019 :a1019. +:a1020 :a1020 :a1020. +:a1021 :a1021 :a1021. +:a1022 :a1022 :a1022. +:a1023 :a1023 :a1023. +:a1024 :a1024 :a1024. +:a1025 :a1025 :a1025. +:a1026 :a1026 :a1026. +:a1027 :a1027 :a1027. +:a1028 :a1028 :a1028. +:a1029 :a1029 :a1029. +:a1030 :a1030 :a1030. +:a1031 :a1031 :a1031. +:a1032 :a1032 :a1032. +:a1033 :a1033 :a1033. +:a1034 :a1034 :a1034. +:a1035 :a1035 :a1035. +:a1036 :a1036 :a1036. +:a1037 :a1037 :a1037. +:a1038 :a1038 :a1038. +:a1039 :a1039 :a1039. +:a1040 :a1040 :a1040. +:a1041 :a1041 :a1041. +:a1042 :a1042 :a1042. +:a1043 :a1043 :a1043. +:a1044 :a1044 :a1044. +:a1045 :a1045 :a1045. +:a1046 :a1046 :a1046. +:a1047 :a1047 :a1047. +:a1048 :a1048 :a1048. +:a1049 :a1049 :a1049. +:a1050 :a1050 :a1050. +:a1051 :a1051 :a1051. +:a1052 :a1052 :a1052. +:a1053 :a1053 :a1053. +:a1054 :a1054 :a1054. +:a1055 :a1055 :a1055. +:a1056 :a1056 :a1056. +:a1057 :a1057 :a1057. +:a1058 :a1058 :a1058. +:a1059 :a1059 :a1059. +:a1060 :a1060 :a1060. +:a1061 :a1061 :a1061. +:a1062 :a1062 :a1062. +:a1063 :a1063 :a1063. +:a1064 :a1064 :a1064. +:a1065 :a1065 :a1065. +:a1066 :a1066 :a1066. +:a1067 :a1067 :a1067. +:a1068 :a1068 :a1068. +:a1069 :a1069 :a1069. +:a1070 :a1070 :a1070. +:a1071 :a1071 :a1071. +:a1072 :a1072 :a1072. +:a1073 :a1073 :a1073. +:a1074 :a1074 :a1074. +:a1075 :a1075 :a1075. +:a1076 :a1076 :a1076. +:a1077 :a1077 :a1077. +:a1078 :a1078 :a1078. +:a1079 :a1079 :a1079. +:a1080 :a1080 :a1080. +:a1081 :a1081 :a1081. +:a1082 :a1082 :a1082. +:a1083 :a1083 :a1083. +:a1084 :a1084 :a1084. +:a1085 :a1085 :a1085. +:a1086 :a1086 :a1086. +:a1087 :a1087 :a1087. +:a1088 :a1088 :a1088. +:a1089 :a1089 :a1089. +:a1090 :a1090 :a1090. +:a1091 :a1091 :a1091. +:a1092 :a1092 :a1092. +:a1093 :a1093 :a1093. +:a1094 :a1094 :a1094. +:a1095 :a1095 :a1095. +:a1096 :a1096 :a1096. +:a1097 :a1097 :a1097. +:a1098 :a1098 :a1098. +:a1099 :a1099 :a1099. +:a1100 :a1100 :a1100. +:a1101 :a1101 :a1101. +:a1102 :a1102 :a1102. +:a1103 :a1103 :a1103. +:a1104 :a1104 :a1104. +:a1105 :a1105 :a1105. +:a1106 :a1106 :a1106. +:a1107 :a1107 :a1107. +:a1108 :a1108 :a1108. +:a1109 :a1109 :a1109. +:a1110 :a1110 :a1110. +:a1111 :a1111 :a1111. +:a1112 :a1112 :a1112. +:a1113 :a1113 :a1113. +:a1114 :a1114 :a1114. +:a1115 :a1115 :a1115. +:a1116 :a1116 :a1116. +:a1117 :a1117 :a1117. +:a1118 :a1118 :a1118. +:a1119 :a1119 :a1119. +:a1120 :a1120 :a1120. +:a1121 :a1121 :a1121. +:a1122 :a1122 :a1122. +:a1123 :a1123 :a1123. +:a1124 :a1124 :a1124. +:a1125 :a1125 :a1125. +:a1126 :a1126 :a1126. +:a1127 :a1127 :a1127. +:a1128 :a1128 :a1128. +:a1129 :a1129 :a1129. +:a1130 :a1130 :a1130. +:a1131 :a1131 :a1131. +:a1132 :a1132 :a1132. +:a1133 :a1133 :a1133. +:a1134 :a1134 :a1134. +:a1135 :a1135 :a1135. +:a1136 :a1136 :a1136. +:a1137 :a1137 :a1137. +:a1138 :a1138 :a1138. +:a1139 :a1139 :a1139. +:a1140 :a1140 :a1140. +:a1141 :a1141 :a1141. +:a1142 :a1142 :a1142. +:a1143 :a1143 :a1143. +:a1144 :a1144 :a1144. +:a1145 :a1145 :a1145. +:a1146 :a1146 :a1146. +:a1147 :a1147 :a1147. +:a1148 :a1148 :a1148. +:a1149 :a1149 :a1149. +:a1150 :a1150 :a1150. +:a1151 :a1151 :a1151. +:a1152 :a1152 :a1152. +:a1153 :a1153 :a1153. +:a1154 :a1154 :a1154. +:a1155 :a1155 :a1155. +:a1156 :a1156 :a1156. +:a1157 :a1157 :a1157. +:a1158 :a1158 :a1158. +:a1159 :a1159 :a1159. +:a1160 :a1160 :a1160. +:a1161 :a1161 :a1161. +:a1162 :a1162 :a1162. +:a1163 :a1163 :a1163. +:a1164 :a1164 :a1164. +:a1165 :a1165 :a1165. +:a1166 :a1166 :a1166. +:a1167 :a1167 :a1167. +:a1168 :a1168 :a1168. +:a1169 :a1169 :a1169. +:a1170 :a1170 :a1170. +:a1171 :a1171 :a1171. +:a1172 :a1172 :a1172. +:a1173 :a1173 :a1173. +:a1174 :a1174 :a1174. +:a1175 :a1175 :a1175. +:a1176 :a1176 :a1176. +:a1177 :a1177 :a1177. +:a1178 :a1178 :a1178. +:a1179 :a1179 :a1179. +:a1180 :a1180 :a1180. +:a1181 :a1181 :a1181. +:a1182 :a1182 :a1182. +:a1183 :a1183 :a1183. +:a1184 :a1184 :a1184. +:a1185 :a1185 :a1185. +:a1186 :a1186 :a1186. +:a1187 :a1187 :a1187. +:a1188 :a1188 :a1188. +:a1189 :a1189 :a1189. +:a1190 :a1190 :a1190. +:a1191 :a1191 :a1191. +:a1192 :a1192 :a1192. +:a1193 :a1193 :a1193. +:a1194 :a1194 :a1194. +:a1195 :a1195 :a1195. +:a1196 :a1196 :a1196. +:a1197 :a1197 :a1197. +:a1198 :a1198 :a1198. +:a1199 :a1199 :a1199. +:a1200 :a1200 :a1200. +:a1201 :a1201 :a1201. +:a1202 :a1202 :a1202. +:a1203 :a1203 :a1203. +:a1204 :a1204 :a1204. +:a1205 :a1205 :a1205. +:a1206 :a1206 :a1206. +:a1207 :a1207 :a1207. +:a1208 :a1208 :a1208. +:a1209 :a1209 :a1209. +:a1210 :a1210 :a1210. +:a1211 :a1211 :a1211. +:a1212 :a1212 :a1212. +:a1213 :a1213 :a1213. +:a1214 :a1214 :a1214. +:a1215 :a1215 :a1215. +:a1216 :a1216 :a1216. +:a1217 :a1217 :a1217. +:a1218 :a1218 :a1218. +:a1219 :a1219 :a1219. +:a1220 :a1220 :a1220. +:a1221 :a1221 :a1221. +:a1222 :a1222 :a1222. +:a1223 :a1223 :a1223. +:a1224 :a1224 :a1224. +:a1225 :a1225 :a1225. +:a1226 :a1226 :a1226. +:a1227 :a1227 :a1227. +:a1228 :a1228 :a1228. +:a1229 :a1229 :a1229. +:a1230 :a1230 :a1230. +:a1231 :a1231 :a1231. +:a1232 :a1232 :a1232. +:a1233 :a1233 :a1233. +:a1234 :a1234 :a1234. +:a1235 :a1235 :a1235. +:a1236 :a1236 :a1236. +:a1237 :a1237 :a1237. +:a1238 :a1238 :a1238. +:a1239 :a1239 :a1239. +:a1240 :a1240 :a1240. +:a1241 :a1241 :a1241. +:a1242 :a1242 :a1242. +:a1243 :a1243 :a1243. +:a1244 :a1244 :a1244. +:a1245 :a1245 :a1245. +:a1246 :a1246 :a1246. +:a1247 :a1247 :a1247. +:a1248 :a1248 :a1248. +:a1249 :a1249 :a1249. +:a1250 :a1250 :a1250. +:a1251 :a1251 :a1251. +:a1252 :a1252 :a1252. +:a1253 :a1253 :a1253. +:a1254 :a1254 :a1254. +:a1255 :a1255 :a1255. +:a1256 :a1256 :a1256. +:a1257 :a1257 :a1257. +:a1258 :a1258 :a1258. +:a1259 :a1259 :a1259. +:a1260 :a1260 :a1260. +:a1261 :a1261 :a1261. +:a1262 :a1262 :a1262. +:a1263 :a1263 :a1263. +:a1264 :a1264 :a1264. +:a1265 :a1265 :a1265. +:a1266 :a1266 :a1266. +:a1267 :a1267 :a1267. +:a1268 :a1268 :a1268. +:a1269 :a1269 :a1269. +:a1270 :a1270 :a1270. +:a1271 :a1271 :a1271. +:a1272 :a1272 :a1272. +:a1273 :a1273 :a1273. +:a1274 :a1274 :a1274. +:a1275 :a1275 :a1275. +:a1276 :a1276 :a1276. +:a1277 :a1277 :a1277. +:a1278 :a1278 :a1278. +:a1279 :a1279 :a1279. +:a1280 :a1280 :a1280. +:a1281 :a1281 :a1281. +:a1282 :a1282 :a1282. +:a1283 :a1283 :a1283. +:a1284 :a1284 :a1284. +:a1285 :a1285 :a1285. +:a1286 :a1286 :a1286. +:a1287 :a1287 :a1287. +:a1288 :a1288 :a1288. +:a1289 :a1289 :a1289. +:a1290 :a1290 :a1290. +:a1291 :a1291 :a1291. +:a1292 :a1292 :a1292. +:a1293 :a1293 :a1293. +:a1294 :a1294 :a1294. +:a1295 :a1295 :a1295. +:a1296 :a1296 :a1296. +:a1297 :a1297 :a1297. +:a1298 :a1298 :a1298. +:a1299 :a1299 :a1299. +:a1300 :a1300 :a1300. +:a1301 :a1301 :a1301. +:a1302 :a1302 :a1302. +:a1303 :a1303 :a1303. +:a1304 :a1304 :a1304. +:a1305 :a1305 :a1305. +:a1306 :a1306 :a1306. +:a1307 :a1307 :a1307. +:a1308 :a1308 :a1308. +:a1309 :a1309 :a1309. +:a1310 :a1310 :a1310. +:a1311 :a1311 :a1311. +:a1312 :a1312 :a1312. +:a1313 :a1313 :a1313. +:a1314 :a1314 :a1314. +:a1315 :a1315 :a1315. +:a1316 :a1316 :a1316. +:a1317 :a1317 :a1317. +:a1318 :a1318 :a1318. +:a1319 :a1319 :a1319. +:a1320 :a1320 :a1320. +:a1321 :a1321 :a1321. +:a1322 :a1322 :a1322. +:a1323 :a1323 :a1323. +:a1324 :a1324 :a1324. +:a1325 :a1325 :a1325. +:a1326 :a1326 :a1326. +:a1327 :a1327 :a1327. +:a1328 :a1328 :a1328. +:a1329 :a1329 :a1329. +:a1330 :a1330 :a1330. +:a1331 :a1331 :a1331. +:a1332 :a1332 :a1332. +:a1333 :a1333 :a1333. +:a1334 :a1334 :a1334. +:a1335 :a1335 :a1335. +:a1336 :a1336 :a1336. +:a1337 :a1337 :a1337. +:a1338 :a1338 :a1338. +:a1339 :a1339 :a1339. +:a1340 :a1340 :a1340. +:a1341 :a1341 :a1341. +:a1342 :a1342 :a1342. +:a1343 :a1343 :a1343. +:a1344 :a1344 :a1344. +:a1345 :a1345 :a1345. +:a1346 :a1346 :a1346. +:a1347 :a1347 :a1347. +:a1348 :a1348 :a1348. +:a1349 :a1349 :a1349. +:a1350 :a1350 :a1350. +:a1351 :a1351 :a1351. +:a1352 :a1352 :a1352. +:a1353 :a1353 :a1353. +:a1354 :a1354 :a1354. +:a1355 :a1355 :a1355. +:a1356 :a1356 :a1356. +:a1357 :a1357 :a1357. +:a1358 :a1358 :a1358. +:a1359 :a1359 :a1359. +:a1360 :a1360 :a1360. +:a1361 :a1361 :a1361. +:a1362 :a1362 :a1362. +:a1363 :a1363 :a1363. +:a1364 :a1364 :a1364. +:a1365 :a1365 :a1365. +:a1366 :a1366 :a1366. +:a1367 :a1367 :a1367. +:a1368 :a1368 :a1368. +:a1369 :a1369 :a1369. +:a1370 :a1370 :a1370. +:a1371 :a1371 :a1371. +:a1372 :a1372 :a1372. +:a1373 :a1373 :a1373. +:a1374 :a1374 :a1374. +:a1375 :a1375 :a1375. +:a1376 :a1376 :a1376. +:a1377 :a1377 :a1377. +:a1378 :a1378 :a1378. +:a1379 :a1379 :a1379. +:a1380 :a1380 :a1380. +:a1381 :a1381 :a1381. +:a1382 :a1382 :a1382. +:a1383 :a1383 :a1383. +:a1384 :a1384 :a1384. +:a1385 :a1385 :a1385. +:a1386 :a1386 :a1386. +:a1387 :a1387 :a1387. +:a1388 :a1388 :a1388. +:a1389 :a1389 :a1389. +:a1390 :a1390 :a1390. +:a1391 :a1391 :a1391. +:a1392 :a1392 :a1392. +:a1393 :a1393 :a1393. +:a1394 :a1394 :a1394. +:a1395 :a1395 :a1395. +:a1396 :a1396 :a1396. +:a1397 :a1397 :a1397. +:a1398 :a1398 :a1398. +:a1399 :a1399 :a1399. +:a1400 :a1400 :a1400. +:a1401 :a1401 :a1401. +:a1402 :a1402 :a1402. +:a1403 :a1403 :a1403. +:a1404 :a1404 :a1404. +:a1405 :a1405 :a1405. +:a1406 :a1406 :a1406. +:a1407 :a1407 :a1407. +:a1408 :a1408 :a1408. +:a1409 :a1409 :a1409. +:a1410 :a1410 :a1410. +:a1411 :a1411 :a1411. +:a1412 :a1412 :a1412. +:a1413 :a1413 :a1413. +:a1414 :a1414 :a1414. +:a1415 :a1415 :a1415. +:a1416 :a1416 :a1416. +:a1417 :a1417 :a1417. +:a1418 :a1418 :a1418. +:a1419 :a1419 :a1419. +:a1420 :a1420 :a1420. +:a1421 :a1421 :a1421. +:a1422 :a1422 :a1422. +:a1423 :a1423 :a1423. +:a1424 :a1424 :a1424. +:a1425 :a1425 :a1425. +:a1426 :a1426 :a1426. +:a1427 :a1427 :a1427. +:a1428 :a1428 :a1428. +:a1429 :a1429 :a1429. +:a1430 :a1430 :a1430. +:a1431 :a1431 :a1431. +:a1432 :a1432 :a1432. +:a1433 :a1433 :a1433. +:a1434 :a1434 :a1434. +:a1435 :a1435 :a1435. +:a1436 :a1436 :a1436. +:a1437 :a1437 :a1437. +:a1438 :a1438 :a1438. +:a1439 :a1439 :a1439. +:a1440 :a1440 :a1440. +:a1441 :a1441 :a1441. +:a1442 :a1442 :a1442. +:a1443 :a1443 :a1443. +:a1444 :a1444 :a1444. +:a1445 :a1445 :a1445. +:a1446 :a1446 :a1446. +:a1447 :a1447 :a1447. +:a1448 :a1448 :a1448. +:a1449 :a1449 :a1449. +:a1450 :a1450 :a1450. +:a1451 :a1451 :a1451. +:a1452 :a1452 :a1452. +:a1453 :a1453 :a1453. +:a1454 :a1454 :a1454. +:a1455 :a1455 :a1455. +:a1456 :a1456 :a1456. +:a1457 :a1457 :a1457. +:a1458 :a1458 :a1458. +:a1459 :a1459 :a1459. +:a1460 :a1460 :a1460. +:a1461 :a1461 :a1461. +:a1462 :a1462 :a1462. +:a1463 :a1463 :a1463. +:a1464 :a1464 :a1464. +:a1465 :a1465 :a1465. +:a1466 :a1466 :a1466. +:a1467 :a1467 :a1467. +:a1468 :a1468 :a1468. +:a1469 :a1469 :a1469. +:a1470 :a1470 :a1470. +:a1471 :a1471 :a1471. +:a1472 :a1472 :a1472. +:a1473 :a1473 :a1473. +:a1474 :a1474 :a1474. +:a1475 :a1475 :a1475. +:a1476 :a1476 :a1476. +:a1477 :a1477 :a1477. +:a1478 :a1478 :a1478. +:a1479 :a1479 :a1479. +:a1480 :a1480 :a1480. +:a1481 :a1481 :a1481. +:a1482 :a1482 :a1482. +:a1483 :a1483 :a1483. +:a1484 :a1484 :a1484. +:a1485 :a1485 :a1485. +:a1486 :a1486 :a1486. +:a1487 :a1487 :a1487. +:a1488 :a1488 :a1488. +:a1489 :a1489 :a1489. +:a1490 :a1490 :a1490. +:a1491 :a1491 :a1491. +:a1492 :a1492 :a1492. +:a1493 :a1493 :a1493. +:a1494 :a1494 :a1494. +:a1495 :a1495 :a1495. +:a1496 :a1496 :a1496. +:a1497 :a1497 :a1497. +:a1498 :a1498 :a1498. +:a1499 :a1499 :a1499. +:a1500 :a1500 :a1500. +:a1501 :a1501 :a1501. +:a1502 :a1502 :a1502. +:a1503 :a1503 :a1503. +:a1504 :a1504 :a1504. +:a1505 :a1505 :a1505. +:a1506 :a1506 :a1506. +:a1507 :a1507 :a1507. +:a1508 :a1508 :a1508. +:a1509 :a1509 :a1509. +:a1510 :a1510 :a1510. +:a1511 :a1511 :a1511. +:a1512 :a1512 :a1512. +:a1513 :a1513 :a1513. +:a1514 :a1514 :a1514. +:a1515 :a1515 :a1515. +:a1516 :a1516 :a1516. +:a1517 :a1517 :a1517. +:a1518 :a1518 :a1518. +:a1519 :a1519 :a1519. +:a1520 :a1520 :a1520. +:a1521 :a1521 :a1521. +:a1522 :a1522 :a1522. +:a1523 :a1523 :a1523. +:a1524 :a1524 :a1524. +:a1525 :a1525 :a1525. +:a1526 :a1526 :a1526. +:a1527 :a1527 :a1527. +:a1528 :a1528 :a1528. +:a1529 :a1529 :a1529. +:a1530 :a1530 :a1530. +:a1531 :a1531 :a1531. +:a1532 :a1532 :a1532. +:a1533 :a1533 :a1533. +:a1534 :a1534 :a1534. +:a1535 :a1535 :a1535. +:a1536 :a1536 :a1536. +:a1537 :a1537 :a1537. +:a1538 :a1538 :a1538. +:a1539 :a1539 :a1539. +:a1540 :a1540 :a1540. +:a1541 :a1541 :a1541. +:a1542 :a1542 :a1542. +:a1543 :a1543 :a1543. +:a1544 :a1544 :a1544. +:a1545 :a1545 :a1545. +:a1546 :a1546 :a1546. +:a1547 :a1547 :a1547. +:a1548 :a1548 :a1548. +:a1549 :a1549 :a1549. +:a1550 :a1550 :a1550. +:a1551 :a1551 :a1551. +:a1552 :a1552 :a1552. +:a1553 :a1553 :a1553. +:a1554 :a1554 :a1554. +:a1555 :a1555 :a1555. +:a1556 :a1556 :a1556. +:a1557 :a1557 :a1557. +:a1558 :a1558 :a1558. +:a1559 :a1559 :a1559. +:a1560 :a1560 :a1560. +:a1561 :a1561 :a1561. +:a1562 :a1562 :a1562. +:a1563 :a1563 :a1563. +:a1564 :a1564 :a1564. +:a1565 :a1565 :a1565. +:a1566 :a1566 :a1566. +:a1567 :a1567 :a1567. +:a1568 :a1568 :a1568. +:a1569 :a1569 :a1569. +:a1570 :a1570 :a1570. +:a1571 :a1571 :a1571. +:a1572 :a1572 :a1572. +:a1573 :a1573 :a1573. +:a1574 :a1574 :a1574. +:a1575 :a1575 :a1575. +:a1576 :a1576 :a1576. +:a1577 :a1577 :a1577. +:a1578 :a1578 :a1578. +:a1579 :a1579 :a1579. +:a1580 :a1580 :a1580. +:a1581 :a1581 :a1581. +:a1582 :a1582 :a1582. +:a1583 :a1583 :a1583. +:a1584 :a1584 :a1584. +:a1585 :a1585 :a1585. +:a1586 :a1586 :a1586. +:a1587 :a1587 :a1587. +:a1588 :a1588 :a1588. +:a1589 :a1589 :a1589. +:a1590 :a1590 :a1590. +:a1591 :a1591 :a1591. +:a1592 :a1592 :a1592. +:a1593 :a1593 :a1593. +:a1594 :a1594 :a1594. +:a1595 :a1595 :a1595. +:a1596 :a1596 :a1596. +:a1597 :a1597 :a1597. +:a1598 :a1598 :a1598. +:a1599 :a1599 :a1599. +:a1600 :a1600 :a1600. +:a1601 :a1601 :a1601. +:a1602 :a1602 :a1602. +:a1603 :a1603 :a1603. +:a1604 :a1604 :a1604. +:a1605 :a1605 :a1605. +:a1606 :a1606 :a1606. +:a1607 :a1607 :a1607. +:a1608 :a1608 :a1608. +:a1609 :a1609 :a1609. +:a1610 :a1610 :a1610. +:a1611 :a1611 :a1611. +:a1612 :a1612 :a1612. +:a1613 :a1613 :a1613. +:a1614 :a1614 :a1614. +:a1615 :a1615 :a1615. +:a1616 :a1616 :a1616. +:a1617 :a1617 :a1617. +:a1618 :a1618 :a1618. +:a1619 :a1619 :a1619. +:a1620 :a1620 :a1620. +:a1621 :a1621 :a1621. +:a1622 :a1622 :a1622. +:a1623 :a1623 :a1623. +:a1624 :a1624 :a1624. +:a1625 :a1625 :a1625. +:a1626 :a1626 :a1626. +:a1627 :a1627 :a1627. +:a1628 :a1628 :a1628. +:a1629 :a1629 :a1629. +:a1630 :a1630 :a1630. +:a1631 :a1631 :a1631. +:a1632 :a1632 :a1632. +:a1633 :a1633 :a1633. +:a1634 :a1634 :a1634. +:a1635 :a1635 :a1635. +:a1636 :a1636 :a1636. +:a1637 :a1637 :a1637. +:a1638 :a1638 :a1638. +:a1639 :a1639 :a1639. +:a1640 :a1640 :a1640. +:a1641 :a1641 :a1641. +:a1642 :a1642 :a1642. +:a1643 :a1643 :a1643. +:a1644 :a1644 :a1644. +:a1645 :a1645 :a1645. +:a1646 :a1646 :a1646. +:a1647 :a1647 :a1647. +:a1648 :a1648 :a1648. +:a1649 :a1649 :a1649. +:a1650 :a1650 :a1650. +:a1651 :a1651 :a1651. +:a1652 :a1652 :a1652. +:a1653 :a1653 :a1653. +:a1654 :a1654 :a1654. +:a1655 :a1655 :a1655. +:a1656 :a1656 :a1656. +:a1657 :a1657 :a1657. +:a1658 :a1658 :a1658. +:a1659 :a1659 :a1659. +:a1660 :a1660 :a1660. +:a1661 :a1661 :a1661. +:a1662 :a1662 :a1662. +:a1663 :a1663 :a1663. +:a1664 :a1664 :a1664. +:a1665 :a1665 :a1665. +:a1666 :a1666 :a1666. +:a1667 :a1667 :a1667. +:a1668 :a1668 :a1668. +:a1669 :a1669 :a1669. +:a1670 :a1670 :a1670. +:a1671 :a1671 :a1671. +:a1672 :a1672 :a1672. +:a1673 :a1673 :a1673. +:a1674 :a1674 :a1674. +:a1675 :a1675 :a1675. +:a1676 :a1676 :a1676. +:a1677 :a1677 :a1677. +:a1678 :a1678 :a1678. +:a1679 :a1679 :a1679. +:a1680 :a1680 :a1680. +:a1681 :a1681 :a1681. +:a1682 :a1682 :a1682. +:a1683 :a1683 :a1683. +:a1684 :a1684 :a1684. +:a1685 :a1685 :a1685. +:a1686 :a1686 :a1686. +:a1687 :a1687 :a1687. +:a1688 :a1688 :a1688. +:a1689 :a1689 :a1689. +:a1690 :a1690 :a1690. +:a1691 :a1691 :a1691. +:a1692 :a1692 :a1692. +:a1693 :a1693 :a1693. +:a1694 :a1694 :a1694. +:a1695 :a1695 :a1695. +:a1696 :a1696 :a1696. +:a1697 :a1697 :a1697. +:a1698 :a1698 :a1698. +:a1699 :a1699 :a1699. +:a1700 :a1700 :a1700. +:a1701 :a1701 :a1701. +:a1702 :a1702 :a1702. +:a1703 :a1703 :a1703. +:a1704 :a1704 :a1704. +:a1705 :a1705 :a1705. +:a1706 :a1706 :a1706. +:a1707 :a1707 :a1707. +:a1708 :a1708 :a1708. +:a1709 :a1709 :a1709. +:a1710 :a1710 :a1710. +:a1711 :a1711 :a1711. +:a1712 :a1712 :a1712. +:a1713 :a1713 :a1713. +:a1714 :a1714 :a1714. +:a1715 :a1715 :a1715. +:a1716 :a1716 :a1716. +:a1717 :a1717 :a1717. +:a1718 :a1718 :a1718. +:a1719 :a1719 :a1719. +:a1720 :a1720 :a1720. +:a1721 :a1721 :a1721. +:a1722 :a1722 :a1722. +:a1723 :a1723 :a1723. +:a1724 :a1724 :a1724. +:a1725 :a1725 :a1725. +:a1726 :a1726 :a1726. +:a1727 :a1727 :a1727. +:a1728 :a1728 :a1728. +:a1729 :a1729 :a1729. +:a1730 :a1730 :a1730. +:a1731 :a1731 :a1731. +:a1732 :a1732 :a1732. +:a1733 :a1733 :a1733. +:a1734 :a1734 :a1734. +:a1735 :a1735 :a1735. +:a1736 :a1736 :a1736. +:a1737 :a1737 :a1737. +:a1738 :a1738 :a1738. +:a1739 :a1739 :a1739. +:a1740 :a1740 :a1740. +:a1741 :a1741 :a1741. +:a1742 :a1742 :a1742. +:a1743 :a1743 :a1743. +:a1744 :a1744 :a1744. +:a1745 :a1745 :a1745. +:a1746 :a1746 :a1746. +:a1747 :a1747 :a1747. +:a1748 :a1748 :a1748. +:a1749 :a1749 :a1749. +:a1750 :a1750 :a1750. +:a1751 :a1751 :a1751. +:a1752 :a1752 :a1752. +:a1753 :a1753 :a1753. +:a1754 :a1754 :a1754. +:a1755 :a1755 :a1755. +:a1756 :a1756 :a1756. +:a1757 :a1757 :a1757. +:a1758 :a1758 :a1758. +:a1759 :a1759 :a1759. +:a1760 :a1760 :a1760. +:a1761 :a1761 :a1761. +:a1762 :a1762 :a1762. +:a1763 :a1763 :a1763. +:a1764 :a1764 :a1764. +:a1765 :a1765 :a1765. +:a1766 :a1766 :a1766. +:a1767 :a1767 :a1767. +:a1768 :a1768 :a1768. +:a1769 :a1769 :a1769. +:a1770 :a1770 :a1770. +:a1771 :a1771 :a1771. +:a1772 :a1772 :a1772. +:a1773 :a1773 :a1773. +:a1774 :a1774 :a1774. +:a1775 :a1775 :a1775. +:a1776 :a1776 :a1776. +:a1777 :a1777 :a1777. +:a1778 :a1778 :a1778. +:a1779 :a1779 :a1779. +:a1780 :a1780 :a1780. +:a1781 :a1781 :a1781. +:a1782 :a1782 :a1782. +:a1783 :a1783 :a1783. +:a1784 :a1784 :a1784. +:a1785 :a1785 :a1785. +:a1786 :a1786 :a1786. +:a1787 :a1787 :a1787. +:a1788 :a1788 :a1788. +:a1789 :a1789 :a1789. +:a1790 :a1790 :a1790. +:a1791 :a1791 :a1791. +:a1792 :a1792 :a1792. +:a1793 :a1793 :a1793. +:a1794 :a1794 :a1794. +:a1795 :a1795 :a1795. +:a1796 :a1796 :a1796. +:a1797 :a1797 :a1797. +:a1798 :a1798 :a1798. +:a1799 :a1799 :a1799. +:a1800 :a1800 :a1800. +:a1801 :a1801 :a1801. +:a1802 :a1802 :a1802. +:a1803 :a1803 :a1803. +:a1804 :a1804 :a1804. +:a1805 :a1805 :a1805. +:a1806 :a1806 :a1806. +:a1807 :a1807 :a1807. +:a1808 :a1808 :a1808. +:a1809 :a1809 :a1809. +:a1810 :a1810 :a1810. +:a1811 :a1811 :a1811. +:a1812 :a1812 :a1812. +:a1813 :a1813 :a1813. +:a1814 :a1814 :a1814. +:a1815 :a1815 :a1815. +:a1816 :a1816 :a1816. +:a1817 :a1817 :a1817. +:a1818 :a1818 :a1818. +:a1819 :a1819 :a1819. +:a1820 :a1820 :a1820. +:a1821 :a1821 :a1821. +:a1822 :a1822 :a1822. +:a1823 :a1823 :a1823. +:a1824 :a1824 :a1824. +:a1825 :a1825 :a1825. +:a1826 :a1826 :a1826. +:a1827 :a1827 :a1827. +:a1828 :a1828 :a1828. +:a1829 :a1829 :a1829. +:a1830 :a1830 :a1830. +:a1831 :a1831 :a1831. +:a1832 :a1832 :a1832. +:a1833 :a1833 :a1833. +:a1834 :a1834 :a1834. +:a1835 :a1835 :a1835. +:a1836 :a1836 :a1836. +:a1837 :a1837 :a1837. +:a1838 :a1838 :a1838. +:a1839 :a1839 :a1839. +:a1840 :a1840 :a1840. +:a1841 :a1841 :a1841. +:a1842 :a1842 :a1842. +:a1843 :a1843 :a1843. +:a1844 :a1844 :a1844. +:a1845 :a1845 :a1845. +:a1846 :a1846 :a1846. +:a1847 :a1847 :a1847. +:a1848 :a1848 :a1848. +:a1849 :a1849 :a1849. +:a1850 :a1850 :a1850. +:a1851 :a1851 :a1851. +:a1852 :a1852 :a1852. +:a1853 :a1853 :a1853. +:a1854 :a1854 :a1854. +:a1855 :a1855 :a1855. +:a1856 :a1856 :a1856. +:a1857 :a1857 :a1857. +:a1858 :a1858 :a1858. +:a1859 :a1859 :a1859. +:a1860 :a1860 :a1860. +:a1861 :a1861 :a1861. +:a1862 :a1862 :a1862. +:a1863 :a1863 :a1863. +:a1864 :a1864 :a1864. +:a1865 :a1865 :a1865. +:a1866 :a1866 :a1866. +:a1867 :a1867 :a1867. +:a1868 :a1868 :a1868. +:a1869 :a1869 :a1869. +:a1870 :a1870 :a1870. +:a1871 :a1871 :a1871. +:a1872 :a1872 :a1872. +:a1873 :a1873 :a1873. +:a1874 :a1874 :a1874. +:a1875 :a1875 :a1875. +:a1876 :a1876 :a1876. +:a1877 :a1877 :a1877. +:a1878 :a1878 :a1878. +:a1879 :a1879 :a1879. +:a1880 :a1880 :a1880. +:a1881 :a1881 :a1881. +:a1882 :a1882 :a1882. +:a1883 :a1883 :a1883. +:a1884 :a1884 :a1884. +:a1885 :a1885 :a1885. +:a1886 :a1886 :a1886. +:a1887 :a1887 :a1887. +:a1888 :a1888 :a1888. +:a1889 :a1889 :a1889. +:a1890 :a1890 :a1890. +:a1891 :a1891 :a1891. +:a1892 :a1892 :a1892. +:a1893 :a1893 :a1893. +:a1894 :a1894 :a1894. +:a1895 :a1895 :a1895. +:a1896 :a1896 :a1896. +:a1897 :a1897 :a1897. +:a1898 :a1898 :a1898. +:a1899 :a1899 :a1899. +:a1900 :a1900 :a1900. +:a1901 :a1901 :a1901. +:a1902 :a1902 :a1902. +:a1903 :a1903 :a1903. +:a1904 :a1904 :a1904. +:a1905 :a1905 :a1905. +:a1906 :a1906 :a1906. +:a1907 :a1907 :a1907. +:a1908 :a1908 :a1908. +:a1909 :a1909 :a1909. +:a1910 :a1910 :a1910. +:a1911 :a1911 :a1911. +:a1912 :a1912 :a1912. +:a1913 :a1913 :a1913. +:a1914 :a1914 :a1914. +:a1915 :a1915 :a1915. +:a1916 :a1916 :a1916. +:a1917 :a1917 :a1917. +:a1918 :a1918 :a1918. +:a1919 :a1919 :a1919. +:a1920 :a1920 :a1920. +:a1921 :a1921 :a1921. +:a1922 :a1922 :a1922. +:a1923 :a1923 :a1923. +:a1924 :a1924 :a1924. +:a1925 :a1925 :a1925. +:a1926 :a1926 :a1926. +:a1927 :a1927 :a1927. +:a1928 :a1928 :a1928. +:a1929 :a1929 :a1929. +:a1930 :a1930 :a1930. +:a1931 :a1931 :a1931. +:a1932 :a1932 :a1932. +:a1933 :a1933 :a1933. +:a1934 :a1934 :a1934. +:a1935 :a1935 :a1935. +:a1936 :a1936 :a1936. +:a1937 :a1937 :a1937. +:a1938 :a1938 :a1938. +:a1939 :a1939 :a1939. +:a1940 :a1940 :a1940. +:a1941 :a1941 :a1941. +:a1942 :a1942 :a1942. +:a1943 :a1943 :a1943. +:a1944 :a1944 :a1944. +:a1945 :a1945 :a1945. +:a1946 :a1946 :a1946. +:a1947 :a1947 :a1947. +:a1948 :a1948 :a1948. +:a1949 :a1949 :a1949. +:a1950 :a1950 :a1950. +:a1951 :a1951 :a1951. +:a1952 :a1952 :a1952. +:a1953 :a1953 :a1953. +:a1954 :a1954 :a1954. +:a1955 :a1955 :a1955. +:a1956 :a1956 :a1956. +:a1957 :a1957 :a1957. +:a1958 :a1958 :a1958. +:a1959 :a1959 :a1959. +:a1960 :a1960 :a1960. +:a1961 :a1961 :a1961. +:a1962 :a1962 :a1962. +:a1963 :a1963 :a1963. +:a1964 :a1964 :a1964. +:a1965 :a1965 :a1965. +:a1966 :a1966 :a1966. +:a1967 :a1967 :a1967. +:a1968 :a1968 :a1968. +:a1969 :a1969 :a1969. +:a1970 :a1970 :a1970. +:a1971 :a1971 :a1971. +:a1972 :a1972 :a1972. +:a1973 :a1973 :a1973. +:a1974 :a1974 :a1974. +:a1975 :a1975 :a1975. +:a1976 :a1976 :a1976. +:a1977 :a1977 :a1977. +:a1978 :a1978 :a1978. +:a1979 :a1979 :a1979. +:a1980 :a1980 :a1980. +:a1981 :a1981 :a1981. +:a1982 :a1982 :a1982. +:a1983 :a1983 :a1983. +:a1984 :a1984 :a1984. +:a1985 :a1985 :a1985. +:a1986 :a1986 :a1986. +:a1987 :a1987 :a1987. +:a1988 :a1988 :a1988. +:a1989 :a1989 :a1989. +:a1990 :a1990 :a1990. +:a1991 :a1991 :a1991. +:a1992 :a1992 :a1992. +:a1993 :a1993 :a1993. +:a1994 :a1994 :a1994. +:a1995 :a1995 :a1995. +:a1996 :a1996 :a1996. +:a1997 :a1997 :a1997. +:a1998 :a1998 :a1998. +:a1999 :a1999 :a1999. +:a2000 :a2000 :a2000. +:a2001 :a2001 :a2001. +:a2002 :a2002 :a2002. +:a2003 :a2003 :a2003. +:a2004 :a2004 :a2004. +:a2005 :a2005 :a2005. +:a2006 :a2006 :a2006. +:a2007 :a2007 :a2007. +:a2008 :a2008 :a2008. +:a2009 :a2009 :a2009. +:a2010 :a2010 :a2010. +:a2011 :a2011 :a2011. +:a2012 :a2012 :a2012. +:a2013 :a2013 :a2013. +:a2014 :a2014 :a2014. +:a2015 :a2015 :a2015. +:a2016 :a2016 :a2016. +:a2017 :a2017 :a2017. +:a2018 :a2018 :a2018. +:a2019 :a2019 :a2019. +:a2020 :a2020 :a2020. +:a2021 :a2021 :a2021. +:a2022 :a2022 :a2022. +:a2023 :a2023 :a2023. +:a2024 :a2024 :a2024. +:a2025 :a2025 :a2025. +:a2026 :a2026 :a2026. +:a2027 :a2027 :a2027. +:a2028 :a2028 :a2028. +:a2029 :a2029 :a2029. +:a2030 :a2030 :a2030. +:a2031 :a2031 :a2031. +:a2032 :a2032 :a2032. +:a2033 :a2033 :a2033. +:a2034 :a2034 :a2034. +:a2035 :a2035 :a2035. +:a2036 :a2036 :a2036. +:a2037 :a2037 :a2037. +:a2038 :a2038 :a2038. +:a2039 :a2039 :a2039. +:a2040 :a2040 :a2040. +:a2041 :a2041 :a2041. +:a2042 :a2042 :a2042. +:a2043 :a2043 :a2043. +:a2044 :a2044 :a2044. +:a2045 :a2045 :a2045. +:a2046 :a2046 :a2046. +:a2047 :a2047 :a2047. +:a2048 :a2048 :a2048. +:a2049 :a2049 :a2049. +:a2050 :a2050 :a2050. +:a2051 :a2051 :a2051. +:a2052 :a2052 :a2052. +:a2053 :a2053 :a2053. +:a2054 :a2054 :a2054. +:a2055 :a2055 :a2055. +:a2056 :a2056 :a2056. +:a2057 :a2057 :a2057. +:a2058 :a2058 :a2058. +:a2059 :a2059 :a2059. +:a2060 :a2060 :a2060. +:a2061 :a2061 :a2061. +:a2062 :a2062 :a2062. +:a2063 :a2063 :a2063. +:a2064 :a2064 :a2064. +:a2065 :a2065 :a2065. +:a2066 :a2066 :a2066. +:a2067 :a2067 :a2067. +:a2068 :a2068 :a2068. +:a2069 :a2069 :a2069. +:a2070 :a2070 :a2070. +:a2071 :a2071 :a2071. +:a2072 :a2072 :a2072. +:a2073 :a2073 :a2073. +:a2074 :a2074 :a2074. +:a2075 :a2075 :a2075. +:a2076 :a2076 :a2076. +:a2077 :a2077 :a2077. +:a2078 :a2078 :a2078. +:a2079 :a2079 :a2079. +:a2080 :a2080 :a2080. +:a2081 :a2081 :a2081. +:a2082 :a2082 :a2082. +:a2083 :a2083 :a2083. +:a2084 :a2084 :a2084. +:a2085 :a2085 :a2085. +:a2086 :a2086 :a2086. +:a2087 :a2087 :a2087. +:a2088 :a2088 :a2088. +:a2089 :a2089 :a2089. +:a2090 :a2090 :a2090. +:a2091 :a2091 :a2091. +:a2092 :a2092 :a2092. +:a2093 :a2093 :a2093. +:a2094 :a2094 :a2094. +:a2095 :a2095 :a2095. +:a2096 :a2096 :a2096. +:a2097 :a2097 :a2097. +:a2098 :a2098 :a2098. +:a2099 :a2099 :a2099. +:a2100 :a2100 :a2100. +:a2101 :a2101 :a2101. +:a2102 :a2102 :a2102. +:a2103 :a2103 :a2103. +:a2104 :a2104 :a2104. +:a2105 :a2105 :a2105. +:a2106 :a2106 :a2106. +:a2107 :a2107 :a2107. +:a2108 :a2108 :a2108. +:a2109 :a2109 :a2109. +:a2110 :a2110 :a2110. +:a2111 :a2111 :a2111. +:a2112 :a2112 :a2112. +:a2113 :a2113 :a2113. +:a2114 :a2114 :a2114. +:a2115 :a2115 :a2115. +:a2116 :a2116 :a2116. +:a2117 :a2117 :a2117. +:a2118 :a2118 :a2118. +:a2119 :a2119 :a2119. +:a2120 :a2120 :a2120. +:a2121 :a2121 :a2121. +:a2122 :a2122 :a2122. +:a2123 :a2123 :a2123. +:a2124 :a2124 :a2124. +:a2125 :a2125 :a2125. +:a2126 :a2126 :a2126. +:a2127 :a2127 :a2127. +:a2128 :a2128 :a2128. +:a2129 :a2129 :a2129. +:a2130 :a2130 :a2130. +:a2131 :a2131 :a2131. +:a2132 :a2132 :a2132. +:a2133 :a2133 :a2133. +:a2134 :a2134 :a2134. +:a2135 :a2135 :a2135. +:a2136 :a2136 :a2136. +:a2137 :a2137 :a2137. +:a2138 :a2138 :a2138. +:a2139 :a2139 :a2139. +:a2140 :a2140 :a2140. +:a2141 :a2141 :a2141. +:a2142 :a2142 :a2142. +:a2143 :a2143 :a2143. +:a2144 :a2144 :a2144. +:a2145 :a2145 :a2145. +:a2146 :a2146 :a2146. +:a2147 :a2147 :a2147. +:a2148 :a2148 :a2148. +:a2149 :a2149 :a2149. +:a2150 :a2150 :a2150. +:a2151 :a2151 :a2151. +:a2152 :a2152 :a2152. +:a2153 :a2153 :a2153. +:a2154 :a2154 :a2154. +:a2155 :a2155 :a2155. +:a2156 :a2156 :a2156. +:a2157 :a2157 :a2157. +:a2158 :a2158 :a2158. +:a2159 :a2159 :a2159. +:a2160 :a2160 :a2160. +:a2161 :a2161 :a2161. +:a2162 :a2162 :a2162. +:a2163 :a2163 :a2163. +:a2164 :a2164 :a2164. +:a2165 :a2165 :a2165. +:a2166 :a2166 :a2166. +:a2167 :a2167 :a2167. +:a2168 :a2168 :a2168. +:a2169 :a2169 :a2169. +:a2170 :a2170 :a2170. +:a2171 :a2171 :a2171. +:a2172 :a2172 :a2172. +:a2173 :a2173 :a2173. +:a2174 :a2174 :a2174. +:a2175 :a2175 :a2175. +:a2176 :a2176 :a2176. +:a2177 :a2177 :a2177. +:a2178 :a2178 :a2178. +:a2179 :a2179 :a2179. +:a2180 :a2180 :a2180. +:a2181 :a2181 :a2181. +:a2182 :a2182 :a2182. +:a2183 :a2183 :a2183. +:a2184 :a2184 :a2184. +:a2185 :a2185 :a2185. +:a2186 :a2186 :a2186. +:a2187 :a2187 :a2187. +:a2188 :a2188 :a2188. +:a2189 :a2189 :a2189. +:a2190 :a2190 :a2190. +:a2191 :a2191 :a2191. +:a2192 :a2192 :a2192. +:a2193 :a2193 :a2193. +:a2194 :a2194 :a2194. +:a2195 :a2195 :a2195. +:a2196 :a2196 :a2196. +:a2197 :a2197 :a2197. +:a2198 :a2198 :a2198. +:a2199 :a2199 :a2199. +:a2200 :a2200 :a2200. +:a2201 :a2201 :a2201. +:a2202 :a2202 :a2202. +:a2203 :a2203 :a2203. +:a2204 :a2204 :a2204. +:a2205 :a2205 :a2205. +:a2206 :a2206 :a2206. +:a2207 :a2207 :a2207. +:a2208 :a2208 :a2208. +:a2209 :a2209 :a2209. +:a2210 :a2210 :a2210. +:a2211 :a2211 :a2211. +:a2212 :a2212 :a2212. +:a2213 :a2213 :a2213. +:a2214 :a2214 :a2214. +:a2215 :a2215 :a2215. +:a2216 :a2216 :a2216. +:a2217 :a2217 :a2217. +:a2218 :a2218 :a2218. +:a2219 :a2219 :a2219. +:a2220 :a2220 :a2220. +:a2221 :a2221 :a2221. +:a2222 :a2222 :a2222. +:a2223 :a2223 :a2223. +:a2224 :a2224 :a2224. +:a2225 :a2225 :a2225. +:a2226 :a2226 :a2226. +:a2227 :a2227 :a2227. +:a2228 :a2228 :a2228. +:a2229 :a2229 :a2229. +:a2230 :a2230 :a2230. +:a2231 :a2231 :a2231. +:a2232 :a2232 :a2232. +:a2233 :a2233 :a2233. +:a2234 :a2234 :a2234. +:a2235 :a2235 :a2235. +:a2236 :a2236 :a2236. +:a2237 :a2237 :a2237. +:a2238 :a2238 :a2238. +:a2239 :a2239 :a2239. +:a2240 :a2240 :a2240. +:a2241 :a2241 :a2241. +:a2242 :a2242 :a2242. +:a2243 :a2243 :a2243. +:a2244 :a2244 :a2244. +:a2245 :a2245 :a2245. +:a2246 :a2246 :a2246. +:a2247 :a2247 :a2247. +:a2248 :a2248 :a2248. +:a2249 :a2249 :a2249. +:a2250 :a2250 :a2250. +:a2251 :a2251 :a2251. +:a2252 :a2252 :a2252. +:a2253 :a2253 :a2253. +:a2254 :a2254 :a2254. +:a2255 :a2255 :a2255. +:a2256 :a2256 :a2256. +:a2257 :a2257 :a2257. +:a2258 :a2258 :a2258. +:a2259 :a2259 :a2259. +:a2260 :a2260 :a2260. +:a2261 :a2261 :a2261. +:a2262 :a2262 :a2262. +:a2263 :a2263 :a2263. +:a2264 :a2264 :a2264. +:a2265 :a2265 :a2265. +:a2266 :a2266 :a2266. +:a2267 :a2267 :a2267. +:a2268 :a2268 :a2268. +:a2269 :a2269 :a2269. +:a2270 :a2270 :a2270. +:a2271 :a2271 :a2271. +:a2272 :a2272 :a2272. +:a2273 :a2273 :a2273. +:a2274 :a2274 :a2274. +:a2275 :a2275 :a2275. +:a2276 :a2276 :a2276. +:a2277 :a2277 :a2277. +:a2278 :a2278 :a2278. +:a2279 :a2279 :a2279. +:a2280 :a2280 :a2280. +:a2281 :a2281 :a2281. +:a2282 :a2282 :a2282. +:a2283 :a2283 :a2283. +:a2284 :a2284 :a2284. +:a2285 :a2285 :a2285. +:a2286 :a2286 :a2286. +:a2287 :a2287 :a2287. +:a2288 :a2288 :a2288. +:a2289 :a2289 :a2289. +:a2290 :a2290 :a2290. +:a2291 :a2291 :a2291. +:a2292 :a2292 :a2292. +:a2293 :a2293 :a2293. +:a2294 :a2294 :a2294. +:a2295 :a2295 :a2295. +:a2296 :a2296 :a2296. +:a2297 :a2297 :a2297. +:a2298 :a2298 :a2298. +:a2299 :a2299 :a2299. +:a2300 :a2300 :a2300. +:a2301 :a2301 :a2301. +:a2302 :a2302 :a2302. +:a2303 :a2303 :a2303. +:a2304 :a2304 :a2304. +:a2305 :a2305 :a2305. +:a2306 :a2306 :a2306. +:a2307 :a2307 :a2307. +:a2308 :a2308 :a2308. +:a2309 :a2309 :a2309. +:a2310 :a2310 :a2310. +:a2311 :a2311 :a2311. +:a2312 :a2312 :a2312. +:a2313 :a2313 :a2313. +:a2314 :a2314 :a2314. +:a2315 :a2315 :a2315. +:a2316 :a2316 :a2316. +:a2317 :a2317 :a2317. +:a2318 :a2318 :a2318. +:a2319 :a2319 :a2319. +:a2320 :a2320 :a2320. +:a2321 :a2321 :a2321. +:a2322 :a2322 :a2322. +:a2323 :a2323 :a2323. +:a2324 :a2324 :a2324. +:a2325 :a2325 :a2325. +:a2326 :a2326 :a2326. +:a2327 :a2327 :a2327. +:a2328 :a2328 :a2328. +:a2329 :a2329 :a2329. +:a2330 :a2330 :a2330. +:a2331 :a2331 :a2331. +:a2332 :a2332 :a2332. +:a2333 :a2333 :a2333. +:a2334 :a2334 :a2334. +:a2335 :a2335 :a2335. +:a2336 :a2336 :a2336. +:a2337 :a2337 :a2337. +:a2338 :a2338 :a2338. +:a2339 :a2339 :a2339. +:a2340 :a2340 :a2340. +:a2341 :a2341 :a2341. +:a2342 :a2342 :a2342. +:a2343 :a2343 :a2343. +:a2344 :a2344 :a2344. +:a2345 :a2345 :a2345. +:a2346 :a2346 :a2346. +:a2347 :a2347 :a2347. +:a2348 :a2348 :a2348. +:a2349 :a2349 :a2349. +:a2350 :a2350 :a2350. +:a2351 :a2351 :a2351. +:a2352 :a2352 :a2352. +:a2353 :a2353 :a2353. +:a2354 :a2354 :a2354. +:a2355 :a2355 :a2355. +:a2356 :a2356 :a2356. +:a2357 :a2357 :a2357. +:a2358 :a2358 :a2358. +:a2359 :a2359 :a2359. +:a2360 :a2360 :a2360. +:a2361 :a2361 :a2361. +:a2362 :a2362 :a2362. +:a2363 :a2363 :a2363. +:a2364 :a2364 :a2364. +:a2365 :a2365 :a2365. +:a2366 :a2366 :a2366. +:a2367 :a2367 :a2367. +:a2368 :a2368 :a2368. +:a2369 :a2369 :a2369. +:a2370 :a2370 :a2370. +:a2371 :a2371 :a2371. +:a2372 :a2372 :a2372. +:a2373 :a2373 :a2373. +:a2374 :a2374 :a2374. +:a2375 :a2375 :a2375. +:a2376 :a2376 :a2376. +:a2377 :a2377 :a2377. +:a2378 :a2378 :a2378. +:a2379 :a2379 :a2379. +:a2380 :a2380 :a2380. +:a2381 :a2381 :a2381. +:a2382 :a2382 :a2382. +:a2383 :a2383 :a2383. +:a2384 :a2384 :a2384. +:a2385 :a2385 :a2385. +:a2386 :a2386 :a2386. +:a2387 :a2387 :a2387. +:a2388 :a2388 :a2388. +:a2389 :a2389 :a2389. +:a2390 :a2390 :a2390. +:a2391 :a2391 :a2391. +:a2392 :a2392 :a2392. +:a2393 :a2393 :a2393. +:a2394 :a2394 :a2394. +:a2395 :a2395 :a2395. +:a2396 :a2396 :a2396. +:a2397 :a2397 :a2397. +:a2398 :a2398 :a2398. +:a2399 :a2399 :a2399. +:a2400 :a2400 :a2400. +:a2401 :a2401 :a2401. +:a2402 :a2402 :a2402. +:a2403 :a2403 :a2403. +:a2404 :a2404 :a2404. +:a2405 :a2405 :a2405. +:a2406 :a2406 :a2406. +:a2407 :a2407 :a2407. +:a2408 :a2408 :a2408. +:a2409 :a2409 :a2409. +:a2410 :a2410 :a2410. +:a2411 :a2411 :a2411. +:a2412 :a2412 :a2412. +:a2413 :a2413 :a2413. +:a2414 :a2414 :a2414. +:a2415 :a2415 :a2415. +:a2416 :a2416 :a2416. +:a2417 :a2417 :a2417. +:a2418 :a2418 :a2418. +:a2419 :a2419 :a2419. +:a2420 :a2420 :a2420. +:a2421 :a2421 :a2421. +:a2422 :a2422 :a2422. +:a2423 :a2423 :a2423. +:a2424 :a2424 :a2424. +:a2425 :a2425 :a2425. +:a2426 :a2426 :a2426. +:a2427 :a2427 :a2427. +:a2428 :a2428 :a2428. +:a2429 :a2429 :a2429. +:a2430 :a2430 :a2430. +:a2431 :a2431 :a2431. +:a2432 :a2432 :a2432. +:a2433 :a2433 :a2433. +:a2434 :a2434 :a2434. +:a2435 :a2435 :a2435. +:a2436 :a2436 :a2436. +:a2437 :a2437 :a2437. +:a2438 :a2438 :a2438. +:a2439 :a2439 :a2439. +:a2440 :a2440 :a2440. +:a2441 :a2441 :a2441. +:a2442 :a2442 :a2442. +:a2443 :a2443 :a2443. +:a2444 :a2444 :a2444. +:a2445 :a2445 :a2445. +:a2446 :a2446 :a2446. +:a2447 :a2447 :a2447. +:a2448 :a2448 :a2448. +:a2449 :a2449 :a2449. +:a2450 :a2450 :a2450. +:a2451 :a2451 :a2451. +:a2452 :a2452 :a2452. +:a2453 :a2453 :a2453. +:a2454 :a2454 :a2454. +:a2455 :a2455 :a2455. +:a2456 :a2456 :a2456. +:a2457 :a2457 :a2457. +:a2458 :a2458 :a2458. +:a2459 :a2459 :a2459. +:a2460 :a2460 :a2460. +:a2461 :a2461 :a2461. +:a2462 :a2462 :a2462. +:a2463 :a2463 :a2463. +:a2464 :a2464 :a2464. +:a2465 :a2465 :a2465. +:a2466 :a2466 :a2466. +:a2467 :a2467 :a2467. +:a2468 :a2468 :a2468. +:a2469 :a2469 :a2469. +:a2470 :a2470 :a2470. +:a2471 :a2471 :a2471. +:a2472 :a2472 :a2472. +:a2473 :a2473 :a2473. +:a2474 :a2474 :a2474. +:a2475 :a2475 :a2475. +:a2476 :a2476 :a2476. +:a2477 :a2477 :a2477. +:a2478 :a2478 :a2478. +:a2479 :a2479 :a2479. +:a2480 :a2480 :a2480. +:a2481 :a2481 :a2481. +:a2482 :a2482 :a2482. +:a2483 :a2483 :a2483. +:a2484 :a2484 :a2484. +:a2485 :a2485 :a2485. +:a2486 :a2486 :a2486. +:a2487 :a2487 :a2487. +:a2488 :a2488 :a2488. +:a2489 :a2489 :a2489. +:a2490 :a2490 :a2490. +:a2491 :a2491 :a2491. +:a2492 :a2492 :a2492. +:a2493 :a2493 :a2493. +:a2494 :a2494 :a2494. +:a2495 :a2495 :a2495. +:a2496 :a2496 :a2496. +:a2497 :a2497 :a2497. +:a2498 :a2498 :a2498. +:a2499 :a2499 :a2499. +:a2500 :a2500 :a2500. +:a2501 :a2501 :a2501. +:a2502 :a2502 :a2502. +:a2503 :a2503 :a2503. +:a2504 :a2504 :a2504. +:a2505 :a2505 :a2505. +:a2506 :a2506 :a2506. +:a2507 :a2507 :a2507. +:a2508 :a2508 :a2508. +:a2509 :a2509 :a2509. +:a2510 :a2510 :a2510. +:a2511 :a2511 :a2511. +:a2512 :a2512 :a2512. +:a2513 :a2513 :a2513. +:a2514 :a2514 :a2514. +:a2515 :a2515 :a2515. +:a2516 :a2516 :a2516. +:a2517 :a2517 :a2517. +:a2518 :a2518 :a2518. +:a2519 :a2519 :a2519. +:a2520 :a2520 :a2520. +:a2521 :a2521 :a2521. +:a2522 :a2522 :a2522. +:a2523 :a2523 :a2523. +:a2524 :a2524 :a2524. +:a2525 :a2525 :a2525. +:a2526 :a2526 :a2526. +:a2527 :a2527 :a2527. +:a2528 :a2528 :a2528. +:a2529 :a2529 :a2529. +:a2530 :a2530 :a2530. +:a2531 :a2531 :a2531. +:a2532 :a2532 :a2532. +:a2533 :a2533 :a2533. +:a2534 :a2534 :a2534. +:a2535 :a2535 :a2535. +:a2536 :a2536 :a2536. +:a2537 :a2537 :a2537. +:a2538 :a2538 :a2538. +:a2539 :a2539 :a2539. +:a2540 :a2540 :a2540. +:a2541 :a2541 :a2541. +:a2542 :a2542 :a2542. +:a2543 :a2543 :a2543. +:a2544 :a2544 :a2544. +:a2545 :a2545 :a2545. +:a2546 :a2546 :a2546. +:a2547 :a2547 :a2547. +:a2548 :a2548 :a2548. +:a2549 :a2549 :a2549. +:a2550 :a2550 :a2550. +:a2551 :a2551 :a2551. +:a2552 :a2552 :a2552. +:a2553 :a2553 :a2553. +:a2554 :a2554 :a2554. +:a2555 :a2555 :a2555. +:a2556 :a2556 :a2556. +:a2557 :a2557 :a2557. +:a2558 :a2558 :a2558. +:a2559 :a2559 :a2559. +:a2560 :a2560 :a2560. +:a2561 :a2561 :a2561. +:a2562 :a2562 :a2562. +:a2563 :a2563 :a2563. +:a2564 :a2564 :a2564. +:a2565 :a2565 :a2565. +:a2566 :a2566 :a2566. +:a2567 :a2567 :a2567. +:a2568 :a2568 :a2568. +:a2569 :a2569 :a2569. +:a2570 :a2570 :a2570. +:a2571 :a2571 :a2571. +:a2572 :a2572 :a2572. +:a2573 :a2573 :a2573. +:a2574 :a2574 :a2574. +:a2575 :a2575 :a2575. +:a2576 :a2576 :a2576. +:a2577 :a2577 :a2577. +:a2578 :a2578 :a2578. +:a2579 :a2579 :a2579. +:a2580 :a2580 :a2580. +:a2581 :a2581 :a2581. +:a2582 :a2582 :a2582. +:a2583 :a2583 :a2583. +:a2584 :a2584 :a2584. +:a2585 :a2585 :a2585. +:a2586 :a2586 :a2586. +:a2587 :a2587 :a2587. +:a2588 :a2588 :a2588. +:a2589 :a2589 :a2589. +:a2590 :a2590 :a2590. +:a2591 :a2591 :a2591. +:a2592 :a2592 :a2592. +:a2593 :a2593 :a2593. +:a2594 :a2594 :a2594. +:a2595 :a2595 :a2595. +:a2596 :a2596 :a2596. +:a2597 :a2597 :a2597. +:a2598 :a2598 :a2598. +:a2599 :a2599 :a2599. +:a2600 :a2600 :a2600. +:a2601 :a2601 :a2601. +:a2602 :a2602 :a2602. +:a2603 :a2603 :a2603. +:a2604 :a2604 :a2604. +:a2605 :a2605 :a2605. +:a2606 :a2606 :a2606. +:a2607 :a2607 :a2607. +:a2608 :a2608 :a2608. +:a2609 :a2609 :a2609. +:a2610 :a2610 :a2610. +:a2611 :a2611 :a2611. +:a2612 :a2612 :a2612. +:a2613 :a2613 :a2613. +:a2614 :a2614 :a2614. +:a2615 :a2615 :a2615. +:a2616 :a2616 :a2616. +:a2617 :a2617 :a2617. +:a2618 :a2618 :a2618. +:a2619 :a2619 :a2619. +:a2620 :a2620 :a2620. +:a2621 :a2621 :a2621. +:a2622 :a2622 :a2622. +:a2623 :a2623 :a2623. +:a2624 :a2624 :a2624. +:a2625 :a2625 :a2625. +:a2626 :a2626 :a2626. +:a2627 :a2627 :a2627. +:a2628 :a2628 :a2628. +:a2629 :a2629 :a2629. +:a2630 :a2630 :a2630. +:a2631 :a2631 :a2631. +:a2632 :a2632 :a2632. +:a2633 :a2633 :a2633. +:a2634 :a2634 :a2634. +:a2635 :a2635 :a2635. +:a2636 :a2636 :a2636. +:a2637 :a2637 :a2637. +:a2638 :a2638 :a2638. +:a2639 :a2639 :a2639. +:a2640 :a2640 :a2640. +:a2641 :a2641 :a2641. +:a2642 :a2642 :a2642. +:a2643 :a2643 :a2643. +:a2644 :a2644 :a2644. +:a2645 :a2645 :a2645. +:a2646 :a2646 :a2646. +:a2647 :a2647 :a2647. +:a2648 :a2648 :a2648. +:a2649 :a2649 :a2649. +:a2650 :a2650 :a2650. +:a2651 :a2651 :a2651. +:a2652 :a2652 :a2652. +:a2653 :a2653 :a2653. +:a2654 :a2654 :a2654. +:a2655 :a2655 :a2655. +:a2656 :a2656 :a2656. +:a2657 :a2657 :a2657. +:a2658 :a2658 :a2658. +:a2659 :a2659 :a2659. +:a2660 :a2660 :a2660. +:a2661 :a2661 :a2661. +:a2662 :a2662 :a2662. +:a2663 :a2663 :a2663. +:a2664 :a2664 :a2664. +:a2665 :a2665 :a2665. +:a2666 :a2666 :a2666. +:a2667 :a2667 :a2667. +:a2668 :a2668 :a2668. +:a2669 :a2669 :a2669. +:a2670 :a2670 :a2670. +:a2671 :a2671 :a2671. +:a2672 :a2672 :a2672. +:a2673 :a2673 :a2673. +:a2674 :a2674 :a2674. +:a2675 :a2675 :a2675. +:a2676 :a2676 :a2676. +:a2677 :a2677 :a2677. +:a2678 :a2678 :a2678. +:a2679 :a2679 :a2679. +:a2680 :a2680 :a2680. +:a2681 :a2681 :a2681. +:a2682 :a2682 :a2682. +:a2683 :a2683 :a2683. +:a2684 :a2684 :a2684. +:a2685 :a2685 :a2685. +:a2686 :a2686 :a2686. +:a2687 :a2687 :a2687. +:a2688 :a2688 :a2688. +:a2689 :a2689 :a2689. +:a2690 :a2690 :a2690. +:a2691 :a2691 :a2691. +:a2692 :a2692 :a2692. +:a2693 :a2693 :a2693. +:a2694 :a2694 :a2694. +:a2695 :a2695 :a2695. +:a2696 :a2696 :a2696. +:a2697 :a2697 :a2697. +:a2698 :a2698 :a2698. +:a2699 :a2699 :a2699. +:a2700 :a2700 :a2700. +:a2701 :a2701 :a2701. +:a2702 :a2702 :a2702. +:a2703 :a2703 :a2703. +:a2704 :a2704 :a2704. +:a2705 :a2705 :a2705. +:a2706 :a2706 :a2706. +:a2707 :a2707 :a2707. +:a2708 :a2708 :a2708. +:a2709 :a2709 :a2709. +:a2710 :a2710 :a2710. +:a2711 :a2711 :a2711. +:a2712 :a2712 :a2712. +:a2713 :a2713 :a2713. +:a2714 :a2714 :a2714. +:a2715 :a2715 :a2715. +:a2716 :a2716 :a2716. +:a2717 :a2717 :a2717. +:a2718 :a2718 :a2718. +:a2719 :a2719 :a2719. +:a2720 :a2720 :a2720. +:a2721 :a2721 :a2721. +:a2722 :a2722 :a2722. +:a2723 :a2723 :a2723. +:a2724 :a2724 :a2724. +:a2725 :a2725 :a2725. +:a2726 :a2726 :a2726. +:a2727 :a2727 :a2727. +:a2728 :a2728 :a2728. +:a2729 :a2729 :a2729. +:a2730 :a2730 :a2730. +:a2731 :a2731 :a2731. +:a2732 :a2732 :a2732. +:a2733 :a2733 :a2733. +:a2734 :a2734 :a2734. +:a2735 :a2735 :a2735. +:a2736 :a2736 :a2736. +:a2737 :a2737 :a2737. +:a2738 :a2738 :a2738. +:a2739 :a2739 :a2739. +:a2740 :a2740 :a2740. +:a2741 :a2741 :a2741. +:a2742 :a2742 :a2742. +:a2743 :a2743 :a2743. +:a2744 :a2744 :a2744. +:a2745 :a2745 :a2745. +:a2746 :a2746 :a2746. +:a2747 :a2747 :a2747. +:a2748 :a2748 :a2748. +:a2749 :a2749 :a2749. +:a2750 :a2750 :a2750. +:a2751 :a2751 :a2751. +:a2752 :a2752 :a2752. +:a2753 :a2753 :a2753. +:a2754 :a2754 :a2754. +:a2755 :a2755 :a2755. +:a2756 :a2756 :a2756. +:a2757 :a2757 :a2757. +:a2758 :a2758 :a2758. +:a2759 :a2759 :a2759. +:a2760 :a2760 :a2760. +:a2761 :a2761 :a2761. +:a2762 :a2762 :a2762. +:a2763 :a2763 :a2763. +:a2764 :a2764 :a2764. +:a2765 :a2765 :a2765. +:a2766 :a2766 :a2766. +:a2767 :a2767 :a2767. +:a2768 :a2768 :a2768. +:a2769 :a2769 :a2769. +:a2770 :a2770 :a2770. +:a2771 :a2771 :a2771. +:a2772 :a2772 :a2772. +:a2773 :a2773 :a2773. +:a2774 :a2774 :a2774. +:a2775 :a2775 :a2775. +:a2776 :a2776 :a2776. +:a2777 :a2777 :a2777. +:a2778 :a2778 :a2778. +:a2779 :a2779 :a2779. +:a2780 :a2780 :a2780. +:a2781 :a2781 :a2781. +:a2782 :a2782 :a2782. +:a2783 :a2783 :a2783. +:a2784 :a2784 :a2784. +:a2785 :a2785 :a2785. +:a2786 :a2786 :a2786. +:a2787 :a2787 :a2787. +:a2788 :a2788 :a2788. +:a2789 :a2789 :a2789. +:a2790 :a2790 :a2790. +:a2791 :a2791 :a2791. +:a2792 :a2792 :a2792. +:a2793 :a2793 :a2793. +:a2794 :a2794 :a2794. +:a2795 :a2795 :a2795. +:a2796 :a2796 :a2796. +:a2797 :a2797 :a2797. +:a2798 :a2798 :a2798. +:a2799 :a2799 :a2799. +:a2800 :a2800 :a2800. +:a2801 :a2801 :a2801. +:a2802 :a2802 :a2802. +:a2803 :a2803 :a2803. +:a2804 :a2804 :a2804. +:a2805 :a2805 :a2805. +:a2806 :a2806 :a2806. +:a2807 :a2807 :a2807. +:a2808 :a2808 :a2808. +:a2809 :a2809 :a2809. +:a2810 :a2810 :a2810. +:a2811 :a2811 :a2811. +:a2812 :a2812 :a2812. +:a2813 :a2813 :a2813. +:a2814 :a2814 :a2814. +:a2815 :a2815 :a2815. +:a2816 :a2816 :a2816. +:a2817 :a2817 :a2817. +:a2818 :a2818 :a2818. +:a2819 :a2819 :a2819. +:a2820 :a2820 :a2820. +:a2821 :a2821 :a2821. +:a2822 :a2822 :a2822. +:a2823 :a2823 :a2823. +:a2824 :a2824 :a2824. +:a2825 :a2825 :a2825. +:a2826 :a2826 :a2826. +:a2827 :a2827 :a2827. +:a2828 :a2828 :a2828. +:a2829 :a2829 :a2829. +:a2830 :a2830 :a2830. +:a2831 :a2831 :a2831. +:a2832 :a2832 :a2832. +:a2833 :a2833 :a2833. +:a2834 :a2834 :a2834. +:a2835 :a2835 :a2835. +:a2836 :a2836 :a2836. +:a2837 :a2837 :a2837. +:a2838 :a2838 :a2838. +:a2839 :a2839 :a2839. +:a2840 :a2840 :a2840. +:a2841 :a2841 :a2841. +:a2842 :a2842 :a2842. +:a2843 :a2843 :a2843. +:a2844 :a2844 :a2844. +:a2845 :a2845 :a2845. +:a2846 :a2846 :a2846. +:a2847 :a2847 :a2847. +:a2848 :a2848 :a2848. +:a2849 :a2849 :a2849. +:a2850 :a2850 :a2850. +:a2851 :a2851 :a2851. +:a2852 :a2852 :a2852. +:a2853 :a2853 :a2853. +:a2854 :a2854 :a2854. +:a2855 :a2855 :a2855. +:a2856 :a2856 :a2856. +:a2857 :a2857 :a2857. +:a2858 :a2858 :a2858. +:a2859 :a2859 :a2859. +:a2860 :a2860 :a2860. +:a2861 :a2861 :a2861. +:a2862 :a2862 :a2862. +:a2863 :a2863 :a2863. +:a2864 :a2864 :a2864. +:a2865 :a2865 :a2865. +:a2866 :a2866 :a2866. +:a2867 :a2867 :a2867. +:a2868 :a2868 :a2868. +:a2869 :a2869 :a2869. +:a2870 :a2870 :a2870. +:a2871 :a2871 :a2871. +:a2872 :a2872 :a2872. +:a2873 :a2873 :a2873. +:a2874 :a2874 :a2874. +:a2875 :a2875 :a2875. +:a2876 :a2876 :a2876. +:a2877 :a2877 :a2877. +:a2878 :a2878 :a2878. +:a2879 :a2879 :a2879. +:a2880 :a2880 :a2880. +:a2881 :a2881 :a2881. +:a2882 :a2882 :a2882. +:a2883 :a2883 :a2883. +:a2884 :a2884 :a2884. +:a2885 :a2885 :a2885. +:a2886 :a2886 :a2886. +:a2887 :a2887 :a2887. +:a2888 :a2888 :a2888. +:a2889 :a2889 :a2889. +:a2890 :a2890 :a2890. +:a2891 :a2891 :a2891. +:a2892 :a2892 :a2892. +:a2893 :a2893 :a2893. +:a2894 :a2894 :a2894. +:a2895 :a2895 :a2895. +:a2896 :a2896 :a2896. +:a2897 :a2897 :a2897. +:a2898 :a2898 :a2898. +:a2899 :a2899 :a2899. +:a2900 :a2900 :a2900. +:a2901 :a2901 :a2901. +:a2902 :a2902 :a2902. +:a2903 :a2903 :a2903. +:a2904 :a2904 :a2904. +:a2905 :a2905 :a2905. +:a2906 :a2906 :a2906. +:a2907 :a2907 :a2907. +:a2908 :a2908 :a2908. +:a2909 :a2909 :a2909. +:a2910 :a2910 :a2910. +:a2911 :a2911 :a2911. +:a2912 :a2912 :a2912. +:a2913 :a2913 :a2913. +:a2914 :a2914 :a2914. +:a2915 :a2915 :a2915. +:a2916 :a2916 :a2916. +:a2917 :a2917 :a2917. +:a2918 :a2918 :a2918. +:a2919 :a2919 :a2919. +:a2920 :a2920 :a2920. +:a2921 :a2921 :a2921. +:a2922 :a2922 :a2922. +:a2923 :a2923 :a2923. +:a2924 :a2924 :a2924. +:a2925 :a2925 :a2925. +:a2926 :a2926 :a2926. +:a2927 :a2927 :a2927. +:a2928 :a2928 :a2928. +:a2929 :a2929 :a2929. +:a2930 :a2930 :a2930. +:a2931 :a2931 :a2931. +:a2932 :a2932 :a2932. +:a2933 :a2933 :a2933. +:a2934 :a2934 :a2934. +:a2935 :a2935 :a2935. +:a2936 :a2936 :a2936. +:a2937 :a2937 :a2937. +:a2938 :a2938 :a2938. +:a2939 :a2939 :a2939. +:a2940 :a2940 :a2940. +:a2941 :a2941 :a2941. +:a2942 :a2942 :a2942. +:a2943 :a2943 :a2943. +:a2944 :a2944 :a2944. +:a2945 :a2945 :a2945. +:a2946 :a2946 :a2946. +:a2947 :a2947 :a2947. +:a2948 :a2948 :a2948. +:a2949 :a2949 :a2949. +:a2950 :a2950 :a2950. +:a2951 :a2951 :a2951. +:a2952 :a2952 :a2952. +:a2953 :a2953 :a2953. +:a2954 :a2954 :a2954. +:a2955 :a2955 :a2955. +:a2956 :a2956 :a2956. +:a2957 :a2957 :a2957. +:a2958 :a2958 :a2958. +:a2959 :a2959 :a2959. +:a2960 :a2960 :a2960. +:a2961 :a2961 :a2961. +:a2962 :a2962 :a2962. +:a2963 :a2963 :a2963. +:a2964 :a2964 :a2964. +:a2965 :a2965 :a2965. +:a2966 :a2966 :a2966. +:a2967 :a2967 :a2967. +:a2968 :a2968 :a2968. +:a2969 :a2969 :a2969. +:a2970 :a2970 :a2970. +:a2971 :a2971 :a2971. +:a2972 :a2972 :a2972. +:a2973 :a2973 :a2973. +:a2974 :a2974 :a2974. +:a2975 :a2975 :a2975. +:a2976 :a2976 :a2976. +:a2977 :a2977 :a2977. +:a2978 :a2978 :a2978. +:a2979 :a2979 :a2979. +:a2980 :a2980 :a2980. +:a2981 :a2981 :a2981. +:a2982 :a2982 :a2982. +:a2983 :a2983 :a2983. +:a2984 :a2984 :a2984. +:a2985 :a2985 :a2985. +:a2986 :a2986 :a2986. +:a2987 :a2987 :a2987. +:a2988 :a2988 :a2988. +:a2989 :a2989 :a2989. +:a2990 :a2990 :a2990. +:a2991 :a2991 :a2991. +:a2992 :a2992 :a2992. +:a2993 :a2993 :a2993. +:a2994 :a2994 :a2994. +:a2995 :a2995 :a2995. +:a2996 :a2996 :a2996. +:a2997 :a2997 :a2997. +:a2998 :a2998 :a2998. +:a2999 :a2999 :a2999. +:a3000 :a3000 :a3000. +:a3001 :a3001 :a3001. +:a3002 :a3002 :a3002. +:a3003 :a3003 :a3003. +:a3004 :a3004 :a3004. +:a3005 :a3005 :a3005. +:a3006 :a3006 :a3006. +:a3007 :a3007 :a3007. +:a3008 :a3008 :a3008. +:a3009 :a3009 :a3009. +:a3010 :a3010 :a3010. +:a3011 :a3011 :a3011. +:a3012 :a3012 :a3012. +:a3013 :a3013 :a3013. +:a3014 :a3014 :a3014. +:a3015 :a3015 :a3015. +:a3016 :a3016 :a3016. +:a3017 :a3017 :a3017. +:a3018 :a3018 :a3018. +:a3019 :a3019 :a3019. +:a3020 :a3020 :a3020. +:a3021 :a3021 :a3021. +:a3022 :a3022 :a3022. +:a3023 :a3023 :a3023. +:a3024 :a3024 :a3024. +:a3025 :a3025 :a3025. +:a3026 :a3026 :a3026. +:a3027 :a3027 :a3027. +:a3028 :a3028 :a3028. +:a3029 :a3029 :a3029. +:a3030 :a3030 :a3030. +:a3031 :a3031 :a3031. +:a3032 :a3032 :a3032. +:a3033 :a3033 :a3033. +:a3034 :a3034 :a3034. +:a3035 :a3035 :a3035. +:a3036 :a3036 :a3036. +:a3037 :a3037 :a3037. +:a3038 :a3038 :a3038. +:a3039 :a3039 :a3039. +:a3040 :a3040 :a3040. +:a3041 :a3041 :a3041. +:a3042 :a3042 :a3042. +:a3043 :a3043 :a3043. +:a3044 :a3044 :a3044. +:a3045 :a3045 :a3045. +:a3046 :a3046 :a3046. +:a3047 :a3047 :a3047. +:a3048 :a3048 :a3048. +:a3049 :a3049 :a3049. +:a3050 :a3050 :a3050. +:a3051 :a3051 :a3051. +:a3052 :a3052 :a3052. +:a3053 :a3053 :a3053. +:a3054 :a3054 :a3054. +:a3055 :a3055 :a3055. +:a3056 :a3056 :a3056. +:a3057 :a3057 :a3057. +:a3058 :a3058 :a3058. +:a3059 :a3059 :a3059. +:a3060 :a3060 :a3060. +:a3061 :a3061 :a3061. +:a3062 :a3062 :a3062. +:a3063 :a3063 :a3063. +:a3064 :a3064 :a3064. +:a3065 :a3065 :a3065. +:a3066 :a3066 :a3066. +:a3067 :a3067 :a3067. +:a3068 :a3068 :a3068. +:a3069 :a3069 :a3069. +:a3070 :a3070 :a3070. +:a3071 :a3071 :a3071. +:a3072 :a3072 :a3072. +:a3073 :a3073 :a3073. +:a3074 :a3074 :a3074. +:a3075 :a3075 :a3075. +:a3076 :a3076 :a3076. +:a3077 :a3077 :a3077. +:a3078 :a3078 :a3078. +:a3079 :a3079 :a3079. +:a3080 :a3080 :a3080. +:a3081 :a3081 :a3081. +:a3082 :a3082 :a3082. +:a3083 :a3083 :a3083. +:a3084 :a3084 :a3084. +:a3085 :a3085 :a3085. +:a3086 :a3086 :a3086. +:a3087 :a3087 :a3087. +:a3088 :a3088 :a3088. +:a3089 :a3089 :a3089. +:a3090 :a3090 :a3090. +:a3091 :a3091 :a3091. +:a3092 :a3092 :a3092. +:a3093 :a3093 :a3093. +:a3094 :a3094 :a3094. +:a3095 :a3095 :a3095. +:a3096 :a3096 :a3096. +:a3097 :a3097 :a3097. +:a3098 :a3098 :a3098. +:a3099 :a3099 :a3099. +:a3100 :a3100 :a3100. +:a3101 :a3101 :a3101. +:a3102 :a3102 :a3102. +:a3103 :a3103 :a3103. +:a3104 :a3104 :a3104. +:a3105 :a3105 :a3105. +:a3106 :a3106 :a3106. +:a3107 :a3107 :a3107. +:a3108 :a3108 :a3108. +:a3109 :a3109 :a3109. +:a3110 :a3110 :a3110. +:a3111 :a3111 :a3111. +:a3112 :a3112 :a3112. +:a3113 :a3113 :a3113. +:a3114 :a3114 :a3114. +:a3115 :a3115 :a3115. +:a3116 :a3116 :a3116. +:a3117 :a3117 :a3117. +:a3118 :a3118 :a3118. +:a3119 :a3119 :a3119. +:a3120 :a3120 :a3120. +:a3121 :a3121 :a3121. +:a3122 :a3122 :a3122. +:a3123 :a3123 :a3123. +:a3124 :a3124 :a3124. +:a3125 :a3125 :a3125. +:a3126 :a3126 :a3126. +:a3127 :a3127 :a3127. +:a3128 :a3128 :a3128. +:a3129 :a3129 :a3129. +:a3130 :a3130 :a3130. +:a3131 :a3131 :a3131. +:a3132 :a3132 :a3132. +:a3133 :a3133 :a3133. +:a3134 :a3134 :a3134. +:a3135 :a3135 :a3135. +:a3136 :a3136 :a3136. +:a3137 :a3137 :a3137. +:a3138 :a3138 :a3138. +:a3139 :a3139 :a3139. +:a3140 :a3140 :a3140. +:a3141 :a3141 :a3141. +:a3142 :a3142 :a3142. +:a3143 :a3143 :a3143. +:a3144 :a3144 :a3144. +:a3145 :a3145 :a3145. +:a3146 :a3146 :a3146. +:a3147 :a3147 :a3147. +:a3148 :a3148 :a3148. +:a3149 :a3149 :a3149. +:a3150 :a3150 :a3150. +:a3151 :a3151 :a3151. +:a3152 :a3152 :a3152. +:a3153 :a3153 :a3153. +:a3154 :a3154 :a3154. +:a3155 :a3155 :a3155. +:a3156 :a3156 :a3156. +:a3157 :a3157 :a3157. +:a3158 :a3158 :a3158. +:a3159 :a3159 :a3159. +:a3160 :a3160 :a3160. +:a3161 :a3161 :a3161. +:a3162 :a3162 :a3162. +:a3163 :a3163 :a3163. +:a3164 :a3164 :a3164. +:a3165 :a3165 :a3165. +:a3166 :a3166 :a3166. +:a3167 :a3167 :a3167. +:a3168 :a3168 :a3168. +:a3169 :a3169 :a3169. +:a3170 :a3170 :a3170. +:a3171 :a3171 :a3171. +:a3172 :a3172 :a3172. +:a3173 :a3173 :a3173. +:a3174 :a3174 :a3174. +:a3175 :a3175 :a3175. +:a3176 :a3176 :a3176. +:a3177 :a3177 :a3177. +:a3178 :a3178 :a3178. +:a3179 :a3179 :a3179. +:a3180 :a3180 :a3180. +:a3181 :a3181 :a3181. +:a3182 :a3182 :a3182. +:a3183 :a3183 :a3183. +:a3184 :a3184 :a3184. +:a3185 :a3185 :a3185. +:a3186 :a3186 :a3186. +:a3187 :a3187 :a3187. +:a3188 :a3188 :a3188. +:a3189 :a3189 :a3189. +:a3190 :a3190 :a3190. +:a3191 :a3191 :a3191. +:a3192 :a3192 :a3192. +:a3193 :a3193 :a3193. +:a3194 :a3194 :a3194. +:a3195 :a3195 :a3195. +:a3196 :a3196 :a3196. +:a3197 :a3197 :a3197. +:a3198 :a3198 :a3198. +:a3199 :a3199 :a3199. +:a3200 :a3200 :a3200. +:a3201 :a3201 :a3201. +:a3202 :a3202 :a3202. +:a3203 :a3203 :a3203. +:a3204 :a3204 :a3204. +:a3205 :a3205 :a3205. +:a3206 :a3206 :a3206. +:a3207 :a3207 :a3207. +:a3208 :a3208 :a3208. +:a3209 :a3209 :a3209. +:a3210 :a3210 :a3210. +:a3211 :a3211 :a3211. +:a3212 :a3212 :a3212. +:a3213 :a3213 :a3213. +:a3214 :a3214 :a3214. +:a3215 :a3215 :a3215. +:a3216 :a3216 :a3216. +:a3217 :a3217 :a3217. +:a3218 :a3218 :a3218. +:a3219 :a3219 :a3219. +:a3220 :a3220 :a3220. +:a3221 :a3221 :a3221. +:a3222 :a3222 :a3222. +:a3223 :a3223 :a3223. +:a3224 :a3224 :a3224. +:a3225 :a3225 :a3225. +:a3226 :a3226 :a3226. +:a3227 :a3227 :a3227. +:a3228 :a3228 :a3228. +:a3229 :a3229 :a3229. +:a3230 :a3230 :a3230. +:a3231 :a3231 :a3231. +:a3232 :a3232 :a3232. +:a3233 :a3233 :a3233. +:a3234 :a3234 :a3234. +:a3235 :a3235 :a3235. +:a3236 :a3236 :a3236. +:a3237 :a3237 :a3237. +:a3238 :a3238 :a3238. +:a3239 :a3239 :a3239. +:a3240 :a3240 :a3240. +:a3241 :a3241 :a3241. +:a3242 :a3242 :a3242. +:a3243 :a3243 :a3243. +:a3244 :a3244 :a3244. +:a3245 :a3245 :a3245. +:a3246 :a3246 :a3246. +:a3247 :a3247 :a3247. +:a3248 :a3248 :a3248. +:a3249 :a3249 :a3249. +:a3250 :a3250 :a3250. +:a3251 :a3251 :a3251. +:a3252 :a3252 :a3252. +:a3253 :a3253 :a3253. +:a3254 :a3254 :a3254. +:a3255 :a3255 :a3255. +:a3256 :a3256 :a3256. +:a3257 :a3257 :a3257. +:a3258 :a3258 :a3258. +:a3259 :a3259 :a3259. +:a3260 :a3260 :a3260. +:a3261 :a3261 :a3261. +:a3262 :a3262 :a3262. +:a3263 :a3263 :a3263. +:a3264 :a3264 :a3264. +:a3265 :a3265 :a3265. +:a3266 :a3266 :a3266. +:a3267 :a3267 :a3267. +:a3268 :a3268 :a3268. +:a3269 :a3269 :a3269. +:a3270 :a3270 :a3270. +:a3271 :a3271 :a3271. +:a3272 :a3272 :a3272. +:a3273 :a3273 :a3273. +:a3274 :a3274 :a3274. +:a3275 :a3275 :a3275. +:a3276 :a3276 :a3276. +:a3277 :a3277 :a3277. +:a3278 :a3278 :a3278. +:a3279 :a3279 :a3279. +:a3280 :a3280 :a3280. +:a3281 :a3281 :a3281. +:a3282 :a3282 :a3282. +:a3283 :a3283 :a3283. +:a3284 :a3284 :a3284. +:a3285 :a3285 :a3285. +:a3286 :a3286 :a3286. +:a3287 :a3287 :a3287. +:a3288 :a3288 :a3288. +:a3289 :a3289 :a3289. +:a3290 :a3290 :a3290. +:a3291 :a3291 :a3291. +:a3292 :a3292 :a3292. +:a3293 :a3293 :a3293. +:a3294 :a3294 :a3294. +:a3295 :a3295 :a3295. +:a3296 :a3296 :a3296. +:a3297 :a3297 :a3297. +:a3298 :a3298 :a3298. +:a3299 :a3299 :a3299. +:a3300 :a3300 :a3300. +:a3301 :a3301 :a3301. +:a3302 :a3302 :a3302. +:a3303 :a3303 :a3303. +:a3304 :a3304 :a3304. +:a3305 :a3305 :a3305. +:a3306 :a3306 :a3306. +:a3307 :a3307 :a3307. +:a3308 :a3308 :a3308. +:a3309 :a3309 :a3309. +:a3310 :a3310 :a3310. +:a3311 :a3311 :a3311. +:a3312 :a3312 :a3312. +:a3313 :a3313 :a3313. +:a3314 :a3314 :a3314. +:a3315 :a3315 :a3315. +:a3316 :a3316 :a3316. +:a3317 :a3317 :a3317. +:a3318 :a3318 :a3318. +:a3319 :a3319 :a3319. +:a3320 :a3320 :a3320. +:a3321 :a3321 :a3321. +:a3322 :a3322 :a3322. +:a3323 :a3323 :a3323. +:a3324 :a3324 :a3324. +:a3325 :a3325 :a3325. +:a3326 :a3326 :a3326. +:a3327 :a3327 :a3327. +:a3328 :a3328 :a3328. +:a3329 :a3329 :a3329. +:a3330 :a3330 :a3330. +:a3331 :a3331 :a3331. +:a3332 :a3332 :a3332. +:a3333 :a3333 :a3333. +:a3334 :a3334 :a3334. +:a3335 :a3335 :a3335. +:a3336 :a3336 :a3336. +:a3337 :a3337 :a3337. +:a3338 :a3338 :a3338. +:a3339 :a3339 :a3339. +:a3340 :a3340 :a3340. +:a3341 :a3341 :a3341. +:a3342 :a3342 :a3342. +:a3343 :a3343 :a3343. +:a3344 :a3344 :a3344. +:a3345 :a3345 :a3345. +:a3346 :a3346 :a3346. +:a3347 :a3347 :a3347. +:a3348 :a3348 :a3348. +:a3349 :a3349 :a3349. +:a3350 :a3350 :a3350. +:a3351 :a3351 :a3351. +:a3352 :a3352 :a3352. +:a3353 :a3353 :a3353. +:a3354 :a3354 :a3354. +:a3355 :a3355 :a3355. +:a3356 :a3356 :a3356. +:a3357 :a3357 :a3357. +:a3358 :a3358 :a3358. +:a3359 :a3359 :a3359. +:a3360 :a3360 :a3360. +:a3361 :a3361 :a3361. +:a3362 :a3362 :a3362. +:a3363 :a3363 :a3363. +:a3364 :a3364 :a3364. +:a3365 :a3365 :a3365. +:a3366 :a3366 :a3366. +:a3367 :a3367 :a3367. +:a3368 :a3368 :a3368. +:a3369 :a3369 :a3369. +:a3370 :a3370 :a3370. +:a3371 :a3371 :a3371. +:a3372 :a3372 :a3372. +:a3373 :a3373 :a3373. +:a3374 :a3374 :a3374. +:a3375 :a3375 :a3375. +:a3376 :a3376 :a3376. +:a3377 :a3377 :a3377. +:a3378 :a3378 :a3378. +:a3379 :a3379 :a3379. +:a3380 :a3380 :a3380. +:a3381 :a3381 :a3381. +:a3382 :a3382 :a3382. +:a3383 :a3383 :a3383. +:a3384 :a3384 :a3384. +:a3385 :a3385 :a3385. +:a3386 :a3386 :a3386. +:a3387 :a3387 :a3387. +:a3388 :a3388 :a3388. +:a3389 :a3389 :a3389. +:a3390 :a3390 :a3390. +:a3391 :a3391 :a3391. +:a3392 :a3392 :a3392. +:a3393 :a3393 :a3393. +:a3394 :a3394 :a3394. +:a3395 :a3395 :a3395. +:a3396 :a3396 :a3396. +:a3397 :a3397 :a3397. +:a3398 :a3398 :a3398. +:a3399 :a3399 :a3399. +:a3400 :a3400 :a3400. +:a3401 :a3401 :a3401. +:a3402 :a3402 :a3402. +:a3403 :a3403 :a3403. +:a3404 :a3404 :a3404. +:a3405 :a3405 :a3405. +:a3406 :a3406 :a3406. +:a3407 :a3407 :a3407. +:a3408 :a3408 :a3408. +:a3409 :a3409 :a3409. +:a3410 :a3410 :a3410. +:a3411 :a3411 :a3411. +:a3412 :a3412 :a3412. +:a3413 :a3413 :a3413. +:a3414 :a3414 :a3414. +:a3415 :a3415 :a3415. +:a3416 :a3416 :a3416. +:a3417 :a3417 :a3417. +:a3418 :a3418 :a3418. +:a3419 :a3419 :a3419. +:a3420 :a3420 :a3420. +:a3421 :a3421 :a3421. +:a3422 :a3422 :a3422. +:a3423 :a3423 :a3423. +:a3424 :a3424 :a3424. +:a3425 :a3425 :a3425. +:a3426 :a3426 :a3426. +:a3427 :a3427 :a3427. +:a3428 :a3428 :a3428. +:a3429 :a3429 :a3429. +:a3430 :a3430 :a3430. +:a3431 :a3431 :a3431. +:a3432 :a3432 :a3432. +:a3433 :a3433 :a3433. +:a3434 :a3434 :a3434. +:a3435 :a3435 :a3435. +:a3436 :a3436 :a3436. +:a3437 :a3437 :a3437. +:a3438 :a3438 :a3438. +:a3439 :a3439 :a3439. +:a3440 :a3440 :a3440. +:a3441 :a3441 :a3441. +:a3442 :a3442 :a3442. +:a3443 :a3443 :a3443. +:a3444 :a3444 :a3444. +:a3445 :a3445 :a3445. +:a3446 :a3446 :a3446. +:a3447 :a3447 :a3447. +:a3448 :a3448 :a3448. +:a3449 :a3449 :a3449. +:a3450 :a3450 :a3450. +:a3451 :a3451 :a3451. +:a3452 :a3452 :a3452. +:a3453 :a3453 :a3453. +:a3454 :a3454 :a3454. +:a3455 :a3455 :a3455. +:a3456 :a3456 :a3456. +:a3457 :a3457 :a3457. +:a3458 :a3458 :a3458. +:a3459 :a3459 :a3459. +:a3460 :a3460 :a3460. +:a3461 :a3461 :a3461. +:a3462 :a3462 :a3462. +:a3463 :a3463 :a3463. +:a3464 :a3464 :a3464. +:a3465 :a3465 :a3465. +:a3466 :a3466 :a3466. +:a3467 :a3467 :a3467. +:a3468 :a3468 :a3468. +:a3469 :a3469 :a3469. +:a3470 :a3470 :a3470. +:a3471 :a3471 :a3471. +:a3472 :a3472 :a3472. +:a3473 :a3473 :a3473. +:a3474 :a3474 :a3474. +:a3475 :a3475 :a3475. +:a3476 :a3476 :a3476. +:a3477 :a3477 :a3477. +:a3478 :a3478 :a3478. +:a3479 :a3479 :a3479. +:a3480 :a3480 :a3480. +:a3481 :a3481 :a3481. +:a3482 :a3482 :a3482. +:a3483 :a3483 :a3483. +:a3484 :a3484 :a3484. +:a3485 :a3485 :a3485. +:a3486 :a3486 :a3486. +:a3487 :a3487 :a3487. +:a3488 :a3488 :a3488. +:a3489 :a3489 :a3489. +:a3490 :a3490 :a3490. +:a3491 :a3491 :a3491. +:a3492 :a3492 :a3492. +:a3493 :a3493 :a3493. +:a3494 :a3494 :a3494. +:a3495 :a3495 :a3495. +:a3496 :a3496 :a3496. +:a3497 :a3497 :a3497. +:a3498 :a3498 :a3498. +:a3499 :a3499 :a3499. +:a3500 :a3500 :a3500. +:a3501 :a3501 :a3501. +:a3502 :a3502 :a3502. +:a3503 :a3503 :a3503. +:a3504 :a3504 :a3504. +:a3505 :a3505 :a3505. +:a3506 :a3506 :a3506. +:a3507 :a3507 :a3507. +:a3508 :a3508 :a3508. +:a3509 :a3509 :a3509. +:a3510 :a3510 :a3510. +:a3511 :a3511 :a3511. +:a3512 :a3512 :a3512. +:a3513 :a3513 :a3513. +:a3514 :a3514 :a3514. +:a3515 :a3515 :a3515. +:a3516 :a3516 :a3516. +:a3517 :a3517 :a3517. +:a3518 :a3518 :a3518. +:a3519 :a3519 :a3519. +:a3520 :a3520 :a3520. +:a3521 :a3521 :a3521. +:a3522 :a3522 :a3522. +:a3523 :a3523 :a3523. +:a3524 :a3524 :a3524. +:a3525 :a3525 :a3525. +:a3526 :a3526 :a3526. +:a3527 :a3527 :a3527. +:a3528 :a3528 :a3528. +:a3529 :a3529 :a3529. +:a3530 :a3530 :a3530. +:a3531 :a3531 :a3531. +:a3532 :a3532 :a3532. +:a3533 :a3533 :a3533. +:a3534 :a3534 :a3534. +:a3535 :a3535 :a3535. +:a3536 :a3536 :a3536. +:a3537 :a3537 :a3537. +:a3538 :a3538 :a3538. +:a3539 :a3539 :a3539. +:a3540 :a3540 :a3540. +:a3541 :a3541 :a3541. +:a3542 :a3542 :a3542. +:a3543 :a3543 :a3543. +:a3544 :a3544 :a3544. +:a3545 :a3545 :a3545. +:a3546 :a3546 :a3546. +:a3547 :a3547 :a3547. +:a3548 :a3548 :a3548. +:a3549 :a3549 :a3549. +:a3550 :a3550 :a3550. +:a3551 :a3551 :a3551. +:a3552 :a3552 :a3552. +:a3553 :a3553 :a3553. +:a3554 :a3554 :a3554. +:a3555 :a3555 :a3555. +:a3556 :a3556 :a3556. +:a3557 :a3557 :a3557. +:a3558 :a3558 :a3558. +:a3559 :a3559 :a3559. +:a3560 :a3560 :a3560. +:a3561 :a3561 :a3561. +:a3562 :a3562 :a3562. +:a3563 :a3563 :a3563. +:a3564 :a3564 :a3564. +:a3565 :a3565 :a3565. +:a3566 :a3566 :a3566. +:a3567 :a3567 :a3567. +:a3568 :a3568 :a3568. +:a3569 :a3569 :a3569. +:a3570 :a3570 :a3570. +:a3571 :a3571 :a3571. +:a3572 :a3572 :a3572. +:a3573 :a3573 :a3573. +:a3574 :a3574 :a3574. +:a3575 :a3575 :a3575. +:a3576 :a3576 :a3576. +:a3577 :a3577 :a3577. +:a3578 :a3578 :a3578. +:a3579 :a3579 :a3579. +:a3580 :a3580 :a3580. +:a3581 :a3581 :a3581. +:a3582 :a3582 :a3582. +:a3583 :a3583 :a3583. +:a3584 :a3584 :a3584. +:a3585 :a3585 :a3585. +:a3586 :a3586 :a3586. +:a3587 :a3587 :a3587. +:a3588 :a3588 :a3588. +:a3589 :a3589 :a3589. +:a3590 :a3590 :a3590. +:a3591 :a3591 :a3591. +:a3592 :a3592 :a3592. +:a3593 :a3593 :a3593. +:a3594 :a3594 :a3594. +:a3595 :a3595 :a3595. +:a3596 :a3596 :a3596. +:a3597 :a3597 :a3597. +:a3598 :a3598 :a3598. +:a3599 :a3599 :a3599. +:a3600 :a3600 :a3600. +:a3601 :a3601 :a3601. +:a3602 :a3602 :a3602. +:a3603 :a3603 :a3603. +:a3604 :a3604 :a3604. +:a3605 :a3605 :a3605. +:a3606 :a3606 :a3606. +:a3607 :a3607 :a3607. +:a3608 :a3608 :a3608. +:a3609 :a3609 :a3609. +:a3610 :a3610 :a3610. +:a3611 :a3611 :a3611. +:a3612 :a3612 :a3612. +:a3613 :a3613 :a3613. +:a3614 :a3614 :a3614. +:a3615 :a3615 :a3615. +:a3616 :a3616 :a3616. +:a3617 :a3617 :a3617. +:a3618 :a3618 :a3618. +:a3619 :a3619 :a3619. +:a3620 :a3620 :a3620. +:a3621 :a3621 :a3621. +:a3622 :a3622 :a3622. +:a3623 :a3623 :a3623. +:a3624 :a3624 :a3624. +:a3625 :a3625 :a3625. +:a3626 :a3626 :a3626. +:a3627 :a3627 :a3627. +:a3628 :a3628 :a3628. +:a3629 :a3629 :a3629. +:a3630 :a3630 :a3630. +:a3631 :a3631 :a3631. +:a3632 :a3632 :a3632. +:a3633 :a3633 :a3633. +:a3634 :a3634 :a3634. +:a3635 :a3635 :a3635. +:a3636 :a3636 :a3636. +:a3637 :a3637 :a3637. +:a3638 :a3638 :a3638. +:a3639 :a3639 :a3639. +:a3640 :a3640 :a3640. +:a3641 :a3641 :a3641. +:a3642 :a3642 :a3642. +:a3643 :a3643 :a3643. +:a3644 :a3644 :a3644. +:a3645 :a3645 :a3645. +:a3646 :a3646 :a3646. +:a3647 :a3647 :a3647. +:a3648 :a3648 :a3648. +:a3649 :a3649 :a3649. +:a3650 :a3650 :a3650. +:a3651 :a3651 :a3651. +:a3652 :a3652 :a3652. +:a3653 :a3653 :a3653. +:a3654 :a3654 :a3654. +:a3655 :a3655 :a3655. +:a3656 :a3656 :a3656. +:a3657 :a3657 :a3657. +:a3658 :a3658 :a3658. +:a3659 :a3659 :a3659. +:a3660 :a3660 :a3660. +:a3661 :a3661 :a3661. +:a3662 :a3662 :a3662. +:a3663 :a3663 :a3663. +:a3664 :a3664 :a3664. +:a3665 :a3665 :a3665. +:a3666 :a3666 :a3666. +:a3667 :a3667 :a3667. +:a3668 :a3668 :a3668. +:a3669 :a3669 :a3669. +:a3670 :a3670 :a3670. +:a3671 :a3671 :a3671. +:a3672 :a3672 :a3672. +:a3673 :a3673 :a3673. +:a3674 :a3674 :a3674. +:a3675 :a3675 :a3675. +:a3676 :a3676 :a3676. +:a3677 :a3677 :a3677. +:a3678 :a3678 :a3678. +:a3679 :a3679 :a3679. +:a3680 :a3680 :a3680. +:a3681 :a3681 :a3681. +:a3682 :a3682 :a3682. +:a3683 :a3683 :a3683. +:a3684 :a3684 :a3684. +:a3685 :a3685 :a3685. +:a3686 :a3686 :a3686. +:a3687 :a3687 :a3687. +:a3688 :a3688 :a3688. +:a3689 :a3689 :a3689. +:a3690 :a3690 :a3690. +:a3691 :a3691 :a3691. +:a3692 :a3692 :a3692. +:a3693 :a3693 :a3693. +:a3694 :a3694 :a3694. +:a3695 :a3695 :a3695. +:a3696 :a3696 :a3696. +:a3697 :a3697 :a3697. +:a3698 :a3698 :a3698. +:a3699 :a3699 :a3699. +:a3700 :a3700 :a3700. +:a3701 :a3701 :a3701. +:a3702 :a3702 :a3702. +:a3703 :a3703 :a3703. +:a3704 :a3704 :a3704. +:a3705 :a3705 :a3705. +:a3706 :a3706 :a3706. +:a3707 :a3707 :a3707. +:a3708 :a3708 :a3708. +:a3709 :a3709 :a3709. +:a3710 :a3710 :a3710. +:a3711 :a3711 :a3711. +:a3712 :a3712 :a3712. +:a3713 :a3713 :a3713. +:a3714 :a3714 :a3714. +:a3715 :a3715 :a3715. +:a3716 :a3716 :a3716. +:a3717 :a3717 :a3717. +:a3718 :a3718 :a3718. +:a3719 :a3719 :a3719. +:a3720 :a3720 :a3720. +:a3721 :a3721 :a3721. +:a3722 :a3722 :a3722. +:a3723 :a3723 :a3723. +:a3724 :a3724 :a3724. +:a3725 :a3725 :a3725. +:a3726 :a3726 :a3726. +:a3727 :a3727 :a3727. +:a3728 :a3728 :a3728. +:a3729 :a3729 :a3729. +:a3730 :a3730 :a3730. +:a3731 :a3731 :a3731. +:a3732 :a3732 :a3732. +:a3733 :a3733 :a3733. +:a3734 :a3734 :a3734. +:a3735 :a3735 :a3735. +:a3736 :a3736 :a3736. +:a3737 :a3737 :a3737. +:a3738 :a3738 :a3738. +:a3739 :a3739 :a3739. +:a3740 :a3740 :a3740. +:a3741 :a3741 :a3741. +:a3742 :a3742 :a3742. +:a3743 :a3743 :a3743. +:a3744 :a3744 :a3744. +:a3745 :a3745 :a3745. +:a3746 :a3746 :a3746. +:a3747 :a3747 :a3747. +:a3748 :a3748 :a3748. +:a3749 :a3749 :a3749. +:a3750 :a3750 :a3750. +:a3751 :a3751 :a3751. +:a3752 :a3752 :a3752. +:a3753 :a3753 :a3753. +:a3754 :a3754 :a3754. +:a3755 :a3755 :a3755. +:a3756 :a3756 :a3756. +:a3757 :a3757 :a3757. +:a3758 :a3758 :a3758. +:a3759 :a3759 :a3759. +:a3760 :a3760 :a3760. +:a3761 :a3761 :a3761. +:a3762 :a3762 :a3762. +:a3763 :a3763 :a3763. +:a3764 :a3764 :a3764. +:a3765 :a3765 :a3765. +:a3766 :a3766 :a3766. +:a3767 :a3767 :a3767. +:a3768 :a3768 :a3768. +:a3769 :a3769 :a3769. +:a3770 :a3770 :a3770. +:a3771 :a3771 :a3771. +:a3772 :a3772 :a3772. +:a3773 :a3773 :a3773. +:a3774 :a3774 :a3774. +:a3775 :a3775 :a3775. +:a3776 :a3776 :a3776. +:a3777 :a3777 :a3777. +:a3778 :a3778 :a3778. +:a3779 :a3779 :a3779. +:a3780 :a3780 :a3780. +:a3781 :a3781 :a3781. +:a3782 :a3782 :a3782. +:a3783 :a3783 :a3783. +:a3784 :a3784 :a3784. +:a3785 :a3785 :a3785. +:a3786 :a3786 :a3786. +:a3787 :a3787 :a3787. +:a3788 :a3788 :a3788. +:a3789 :a3789 :a3789. +:a3790 :a3790 :a3790. +:a3791 :a3791 :a3791. +:a3792 :a3792 :a3792. +:a3793 :a3793 :a3793. +:a3794 :a3794 :a3794. +:a3795 :a3795 :a3795. +:a3796 :a3796 :a3796. +:a3797 :a3797 :a3797. +:a3798 :a3798 :a3798. +:a3799 :a3799 :a3799. +:a3800 :a3800 :a3800. +:a3801 :a3801 :a3801. +:a3802 :a3802 :a3802. +:a3803 :a3803 :a3803. +:a3804 :a3804 :a3804. +:a3805 :a3805 :a3805. +:a3806 :a3806 :a3806. +:a3807 :a3807 :a3807. +:a3808 :a3808 :a3808. +:a3809 :a3809 :a3809. +:a3810 :a3810 :a3810. +:a3811 :a3811 :a3811. +:a3812 :a3812 :a3812. +:a3813 :a3813 :a3813. +:a3814 :a3814 :a3814. +:a3815 :a3815 :a3815. +:a3816 :a3816 :a3816. +:a3817 :a3817 :a3817. +:a3818 :a3818 :a3818. +:a3819 :a3819 :a3819. +:a3820 :a3820 :a3820. +:a3821 :a3821 :a3821. +:a3822 :a3822 :a3822. +:a3823 :a3823 :a3823. +:a3824 :a3824 :a3824. +:a3825 :a3825 :a3825. +:a3826 :a3826 :a3826. +:a3827 :a3827 :a3827. +:a3828 :a3828 :a3828. +:a3829 :a3829 :a3829. +:a3830 :a3830 :a3830. +:a3831 :a3831 :a3831. +:a3832 :a3832 :a3832. +:a3833 :a3833 :a3833. +:a3834 :a3834 :a3834. +:a3835 :a3835 :a3835. +:a3836 :a3836 :a3836. +:a3837 :a3837 :a3837. +:a3838 :a3838 :a3838. +:a3839 :a3839 :a3839. +:a3840 :a3840 :a3840. +:a3841 :a3841 :a3841. +:a3842 :a3842 :a3842. +:a3843 :a3843 :a3843. +:a3844 :a3844 :a3844. +:a3845 :a3845 :a3845. +:a3846 :a3846 :a3846. +:a3847 :a3847 :a3847. +:a3848 :a3848 :a3848. +:a3849 :a3849 :a3849. +:a3850 :a3850 :a3850. +:a3851 :a3851 :a3851. +:a3852 :a3852 :a3852. +:a3853 :a3853 :a3853. +:a3854 :a3854 :a3854. +:a3855 :a3855 :a3855. +:a3856 :a3856 :a3856. +:a3857 :a3857 :a3857. +:a3858 :a3858 :a3858. +:a3859 :a3859 :a3859. +:a3860 :a3860 :a3860. +:a3861 :a3861 :a3861. +:a3862 :a3862 :a3862. +:a3863 :a3863 :a3863. +:a3864 :a3864 :a3864. +:a3865 :a3865 :a3865. +:a3866 :a3866 :a3866. +:a3867 :a3867 :a3867. +:a3868 :a3868 :a3868. +:a3869 :a3869 :a3869. +:a3870 :a3870 :a3870. +:a3871 :a3871 :a3871. +:a3872 :a3872 :a3872. +:a3873 :a3873 :a3873. +:a3874 :a3874 :a3874. +:a3875 :a3875 :a3875. +:a3876 :a3876 :a3876. +:a3877 :a3877 :a3877. +:a3878 :a3878 :a3878. +:a3879 :a3879 :a3879. +:a3880 :a3880 :a3880. +:a3881 :a3881 :a3881. +:a3882 :a3882 :a3882. +:a3883 :a3883 :a3883. +:a3884 :a3884 :a3884. +:a3885 :a3885 :a3885. +:a3886 :a3886 :a3886. +:a3887 :a3887 :a3887. +:a3888 :a3888 :a3888. +:a3889 :a3889 :a3889. +:a3890 :a3890 :a3890. +:a3891 :a3891 :a3891. +:a3892 :a3892 :a3892. +:a3893 :a3893 :a3893. +:a3894 :a3894 :a3894. +:a3895 :a3895 :a3895. +:a3896 :a3896 :a3896. +:a3897 :a3897 :a3897. +:a3898 :a3898 :a3898. +:a3899 :a3899 :a3899. +:a3900 :a3900 :a3900. +:a3901 :a3901 :a3901. +:a3902 :a3902 :a3902. +:a3903 :a3903 :a3903. +:a3904 :a3904 :a3904. +:a3905 :a3905 :a3905. +:a3906 :a3906 :a3906. +:a3907 :a3907 :a3907. +:a3908 :a3908 :a3908. +:a3909 :a3909 :a3909. +:a3910 :a3910 :a3910. +:a3911 :a3911 :a3911. +:a3912 :a3912 :a3912. +:a3913 :a3913 :a3913. +:a3914 :a3914 :a3914. +:a3915 :a3915 :a3915. +:a3916 :a3916 :a3916. +:a3917 :a3917 :a3917. +:a3918 :a3918 :a3918. +:a3919 :a3919 :a3919. +:a3920 :a3920 :a3920. +:a3921 :a3921 :a3921. +:a3922 :a3922 :a3922. +:a3923 :a3923 :a3923. +:a3924 :a3924 :a3924. +:a3925 :a3925 :a3925. +:a3926 :a3926 :a3926. +:a3927 :a3927 :a3927. +:a3928 :a3928 :a3928. +:a3929 :a3929 :a3929. +:a3930 :a3930 :a3930. +:a3931 :a3931 :a3931. +:a3932 :a3932 :a3932. +:a3933 :a3933 :a3933. +:a3934 :a3934 :a3934. +:a3935 :a3935 :a3935. +:a3936 :a3936 :a3936. +:a3937 :a3937 :a3937. +:a3938 :a3938 :a3938. +:a3939 :a3939 :a3939. +:a3940 :a3940 :a3940. +:a3941 :a3941 :a3941. +:a3942 :a3942 :a3942. +:a3943 :a3943 :a3943. +:a3944 :a3944 :a3944. +:a3945 :a3945 :a3945. +:a3946 :a3946 :a3946. +:a3947 :a3947 :a3947. +:a3948 :a3948 :a3948. +:a3949 :a3949 :a3949. +:a3950 :a3950 :a3950. +:a3951 :a3951 :a3951. +:a3952 :a3952 :a3952. +:a3953 :a3953 :a3953. +:a3954 :a3954 :a3954. +:a3955 :a3955 :a3955. +:a3956 :a3956 :a3956. +:a3957 :a3957 :a3957. +:a3958 :a3958 :a3958. +:a3959 :a3959 :a3959. +:a3960 :a3960 :a3960. +:a3961 :a3961 :a3961. +:a3962 :a3962 :a3962. +:a3963 :a3963 :a3963. +:a3964 :a3964 :a3964. +:a3965 :a3965 :a3965. +:a3966 :a3966 :a3966. +:a3967 :a3967 :a3967. +:a3968 :a3968 :a3968. +:a3969 :a3969 :a3969. +:a3970 :a3970 :a3970. +:a3971 :a3971 :a3971. +:a3972 :a3972 :a3972. +:a3973 :a3973 :a3973. +:a3974 :a3974 :a3974. +:a3975 :a3975 :a3975. +:a3976 :a3976 :a3976. +:a3977 :a3977 :a3977. +:a3978 :a3978 :a3978. +:a3979 :a3979 :a3979. +:a3980 :a3980 :a3980. +:a3981 :a3981 :a3981. +:a3982 :a3982 :a3982. +:a3983 :a3983 :a3983. +:a3984 :a3984 :a3984. +:a3985 :a3985 :a3985. +:a3986 :a3986 :a3986. +:a3987 :a3987 :a3987. +:a3988 :a3988 :a3988. +:a3989 :a3989 :a3989. +:a3990 :a3990 :a3990. +:a3991 :a3991 :a3991. +:a3992 :a3992 :a3992. +:a3993 :a3993 :a3993. +:a3994 :a3994 :a3994. +:a3995 :a3995 :a3995. +:a3996 :a3996 :a3996. +:a3997 :a3997 :a3997. +:a3998 :a3998 :a3998. +:a3999 :a3999 :a3999. +:a4000 :a4000 :a4000. +:a4001 :a4001 :a4001. +:a4002 :a4002 :a4002. +:a4003 :a4003 :a4003. +:a4004 :a4004 :a4004. +:a4005 :a4005 :a4005. +:a4006 :a4006 :a4006. +:a4007 :a4007 :a4007. +:a4008 :a4008 :a4008. +:a4009 :a4009 :a4009. +:a4010 :a4010 :a4010. +:a4011 :a4011 :a4011. +:a4012 :a4012 :a4012. +:a4013 :a4013 :a4013. +:a4014 :a4014 :a4014. +:a4015 :a4015 :a4015. +:a4016 :a4016 :a4016. +:a4017 :a4017 :a4017. +:a4018 :a4018 :a4018. +:a4019 :a4019 :a4019. +:a4020 :a4020 :a4020. +:a4021 :a4021 :a4021. +:a4022 :a4022 :a4022. +:a4023 :a4023 :a4023. +:a4024 :a4024 :a4024. +:a4025 :a4025 :a4025. +:a4026 :a4026 :a4026. +:a4027 :a4027 :a4027. +:a4028 :a4028 :a4028. +:a4029 :a4029 :a4029. +:a4030 :a4030 :a4030. +:a4031 :a4031 :a4031. +:a4032 :a4032 :a4032. +:a4033 :a4033 :a4033. +:a4034 :a4034 :a4034. +:a4035 :a4035 :a4035. +:a4036 :a4036 :a4036. +:a4037 :a4037 :a4037. +:a4038 :a4038 :a4038. +:a4039 :a4039 :a4039. +:a4040 :a4040 :a4040. +:a4041 :a4041 :a4041. +:a4042 :a4042 :a4042. +:a4043 :a4043 :a4043. +:a4044 :a4044 :a4044. +:a4045 :a4045 :a4045. +:a4046 :a4046 :a4046. +:a4047 :a4047 :a4047. +:a4048 :a4048 :a4048. +:a4049 :a4049 :a4049. +:a4050 :a4050 :a4050. +:a4051 :a4051 :a4051. +:a4052 :a4052 :a4052. +:a4053 :a4053 :a4053. +:a4054 :a4054 :a4054. +:a4055 :a4055 :a4055. +:a4056 :a4056 :a4056. +:a4057 :a4057 :a4057. +:a4058 :a4058 :a4058. +:a4059 :a4059 :a4059. +:a4060 :a4060 :a4060. +:a4061 :a4061 :a4061. +:a4062 :a4062 :a4062. +:a4063 :a4063 :a4063. +:a4064 :a4064 :a4064. +:a4065 :a4065 :a4065. +:a4066 :a4066 :a4066. +:a4067 :a4067 :a4067. +:a4068 :a4068 :a4068. +:a4069 :a4069 :a4069. +:a4070 :a4070 :a4070. +:a4071 :a4071 :a4071. +:a4072 :a4072 :a4072. +:a4073 :a4073 :a4073. +:a4074 :a4074 :a4074. +:a4075 :a4075 :a4075. +:a4076 :a4076 :a4076. +:a4077 :a4077 :a4077. +:a4078 :a4078 :a4078. +:a4079 :a4079 :a4079. +:a4080 :a4080 :a4080. +:a4081 :a4081 :a4081. +:a4082 :a4082 :a4082. +:a4083 :a4083 :a4083. +:a4084 :a4084 :a4084. +:a4085 :a4085 :a4085. +:a4086 :a4086 :a4086. +:a4087 :a4087 :a4087. +:a4088 :a4088 :a4088. +:a4089 :a4089 :a4089. +:a4090 :a4090 :a4090. +:a4091 :a4091 :a4091. +:a4092 :a4092 :a4092. +:a4093 :a4093 :a4093. +:a4094 :a4094 :a4094. +:a4095 :a4095 :a4095. +:a4096 :a4096 :a4096. +:a4097 :a4097 :a4097. +:a4098 :a4098 :a4098. +:a4099 :a4099 :a4099. +:a4100 :a4100 :a4100. +:a4101 :a4101 :a4101. +:a4102 :a4102 :a4102. +:a4103 :a4103 :a4103. +:a4104 :a4104 :a4104. +:a4105 :a4105 :a4105. +:a4106 :a4106 :a4106. +:a4107 :a4107 :a4107. +:a4108 :a4108 :a4108. +:a4109 :a4109 :a4109. +:a4110 :a4110 :a4110. +:a4111 :a4111 :a4111. +:a4112 :a4112 :a4112. +:a4113 :a4113 :a4113. +:a4114 :a4114 :a4114. +:a4115 :a4115 :a4115. +:a4116 :a4116 :a4116. +:a4117 :a4117 :a4117. +:a4118 :a4118 :a4118. +:a4119 :a4119 :a4119. +:a4120 :a4120 :a4120. +:a4121 :a4121 :a4121. +:a4122 :a4122 :a4122. +:a4123 :a4123 :a4123. +:a4124 :a4124 :a4124. +:a4125 :a4125 :a4125. +:a4126 :a4126 :a4126. +:a4127 :a4127 :a4127. +:a4128 :a4128 :a4128. +:a4129 :a4129 :a4129. +:a4130 :a4130 :a4130. +:a4131 :a4131 :a4131. +:a4132 :a4132 :a4132. +:a4133 :a4133 :a4133. +:a4134 :a4134 :a4134. +:a4135 :a4135 :a4135. +:a4136 :a4136 :a4136. +:a4137 :a4137 :a4137. +:a4138 :a4138 :a4138. +:a4139 :a4139 :a4139. +:a4140 :a4140 :a4140. +:a4141 :a4141 :a4141. +:a4142 :a4142 :a4142. +:a4143 :a4143 :a4143. +:a4144 :a4144 :a4144. +:a4145 :a4145 :a4145. +:a4146 :a4146 :a4146. +:a4147 :a4147 :a4147. +:a4148 :a4148 :a4148. +:a4149 :a4149 :a4149. +:a4150 :a4150 :a4150. +:a4151 :a4151 :a4151. +:a4152 :a4152 :a4152. +:a4153 :a4153 :a4153. +:a4154 :a4154 :a4154. +:a4155 :a4155 :a4155. +:a4156 :a4156 :a4156. +:a4157 :a4157 :a4157. +:a4158 :a4158 :a4158. +:a4159 :a4159 :a4159. +:a4160 :a4160 :a4160. +:a4161 :a4161 :a4161. +:a4162 :a4162 :a4162. +:a4163 :a4163 :a4163. +:a4164 :a4164 :a4164. +:a4165 :a4165 :a4165. +:a4166 :a4166 :a4166. +:a4167 :a4167 :a4167. +:a4168 :a4168 :a4168. +:a4169 :a4169 :a4169. +:a4170 :a4170 :a4170. +:a4171 :a4171 :a4171. +:a4172 :a4172 :a4172. +:a4173 :a4173 :a4173. +:a4174 :a4174 :a4174. +:a4175 :a4175 :a4175. +:a4176 :a4176 :a4176. +:a4177 :a4177 :a4177. +:a4178 :a4178 :a4178. +:a4179 :a4179 :a4179. +:a4180 :a4180 :a4180. +:a4181 :a4181 :a4181. +:a4182 :a4182 :a4182. +:a4183 :a4183 :a4183. +:a4184 :a4184 :a4184. +:a4185 :a4185 :a4185. +:a4186 :a4186 :a4186. +:a4187 :a4187 :a4187. +:a4188 :a4188 :a4188. +:a4189 :a4189 :a4189. +:a4190 :a4190 :a4190. +:a4191 :a4191 :a4191. +:a4192 :a4192 :a4192. +:a4193 :a4193 :a4193. +:a4194 :a4194 :a4194. +:a4195 :a4195 :a4195. +:a4196 :a4196 :a4196. +:a4197 :a4197 :a4197. +:a4198 :a4198 :a4198. +:a4199 :a4199 :a4199. +:a4200 :a4200 :a4200. +:a4201 :a4201 :a4201. +:a4202 :a4202 :a4202. +:a4203 :a4203 :a4203. +:a4204 :a4204 :a4204. +:a4205 :a4205 :a4205. +:a4206 :a4206 :a4206. +:a4207 :a4207 :a4207. +:a4208 :a4208 :a4208. +:a4209 :a4209 :a4209. +:a4210 :a4210 :a4210. +:a4211 :a4211 :a4211. +:a4212 :a4212 :a4212. +:a4213 :a4213 :a4213. +:a4214 :a4214 :a4214. +:a4215 :a4215 :a4215. +:a4216 :a4216 :a4216. +:a4217 :a4217 :a4217. +:a4218 :a4218 :a4218. +:a4219 :a4219 :a4219. +:a4220 :a4220 :a4220. +:a4221 :a4221 :a4221. +:a4222 :a4222 :a4222. +:a4223 :a4223 :a4223. +:a4224 :a4224 :a4224. +:a4225 :a4225 :a4225. +:a4226 :a4226 :a4226. +:a4227 :a4227 :a4227. +:a4228 :a4228 :a4228. +:a4229 :a4229 :a4229. +:a4230 :a4230 :a4230. +:a4231 :a4231 :a4231. +:a4232 :a4232 :a4232. +:a4233 :a4233 :a4233. +:a4234 :a4234 :a4234. +:a4235 :a4235 :a4235. +:a4236 :a4236 :a4236. +:a4237 :a4237 :a4237. +:a4238 :a4238 :a4238. +:a4239 :a4239 :a4239. +:a4240 :a4240 :a4240. +:a4241 :a4241 :a4241. +:a4242 :a4242 :a4242. +:a4243 :a4243 :a4243. +:a4244 :a4244 :a4244. +:a4245 :a4245 :a4245. +:a4246 :a4246 :a4246. +:a4247 :a4247 :a4247. +:a4248 :a4248 :a4248. +:a4249 :a4249 :a4249. +:a4250 :a4250 :a4250. +:a4251 :a4251 :a4251. +:a4252 :a4252 :a4252. +:a4253 :a4253 :a4253. +:a4254 :a4254 :a4254. +:a4255 :a4255 :a4255. +:a4256 :a4256 :a4256. +:a4257 :a4257 :a4257. +:a4258 :a4258 :a4258. +:a4259 :a4259 :a4259. +:a4260 :a4260 :a4260. +:a4261 :a4261 :a4261. +:a4262 :a4262 :a4262. +:a4263 :a4263 :a4263. +:a4264 :a4264 :a4264. +:a4265 :a4265 :a4265. +:a4266 :a4266 :a4266. +:a4267 :a4267 :a4267. +:a4268 :a4268 :a4268. +:a4269 :a4269 :a4269. +:a4270 :a4270 :a4270. +:a4271 :a4271 :a4271. +:a4272 :a4272 :a4272. +:a4273 :a4273 :a4273. +:a4274 :a4274 :a4274. +:a4275 :a4275 :a4275. +:a4276 :a4276 :a4276. +:a4277 :a4277 :a4277. +:a4278 :a4278 :a4278. +:a4279 :a4279 :a4279. +:a4280 :a4280 :a4280. +:a4281 :a4281 :a4281. +:a4282 :a4282 :a4282. +:a4283 :a4283 :a4283. +:a4284 :a4284 :a4284. +:a4285 :a4285 :a4285. +:a4286 :a4286 :a4286. +:a4287 :a4287 :a4287. +:a4288 :a4288 :a4288. +:a4289 :a4289 :a4289. +:a4290 :a4290 :a4290. +:a4291 :a4291 :a4291. +:a4292 :a4292 :a4292. +:a4293 :a4293 :a4293. +:a4294 :a4294 :a4294. +:a4295 :a4295 :a4295. +:a4296 :a4296 :a4296. +:a4297 :a4297 :a4297. +:a4298 :a4298 :a4298. +:a4299 :a4299 :a4299. +:a4300 :a4300 :a4300. +:a4301 :a4301 :a4301. +:a4302 :a4302 :a4302. +:a4303 :a4303 :a4303. +:a4304 :a4304 :a4304. +:a4305 :a4305 :a4305. +:a4306 :a4306 :a4306. +:a4307 :a4307 :a4307. +:a4308 :a4308 :a4308. +:a4309 :a4309 :a4309. +:a4310 :a4310 :a4310. +:a4311 :a4311 :a4311. +:a4312 :a4312 :a4312. +:a4313 :a4313 :a4313. +:a4314 :a4314 :a4314. +:a4315 :a4315 :a4315. +:a4316 :a4316 :a4316. +:a4317 :a4317 :a4317. +:a4318 :a4318 :a4318. +:a4319 :a4319 :a4319. +:a4320 :a4320 :a4320. +:a4321 :a4321 :a4321. +:a4322 :a4322 :a4322. +:a4323 :a4323 :a4323. +:a4324 :a4324 :a4324. +:a4325 :a4325 :a4325. +:a4326 :a4326 :a4326. +:a4327 :a4327 :a4327. +:a4328 :a4328 :a4328. +:a4329 :a4329 :a4329. +:a4330 :a4330 :a4330. +:a4331 :a4331 :a4331. +:a4332 :a4332 :a4332. +:a4333 :a4333 :a4333. +:a4334 :a4334 :a4334. +:a4335 :a4335 :a4335. +:a4336 :a4336 :a4336. +:a4337 :a4337 :a4337. +:a4338 :a4338 :a4338. +:a4339 :a4339 :a4339. +:a4340 :a4340 :a4340. +:a4341 :a4341 :a4341. +:a4342 :a4342 :a4342. +:a4343 :a4343 :a4343. +:a4344 :a4344 :a4344. +:a4345 :a4345 :a4345. +:a4346 :a4346 :a4346. +:a4347 :a4347 :a4347. +:a4348 :a4348 :a4348. +:a4349 :a4349 :a4349. +:a4350 :a4350 :a4350. +:a4351 :a4351 :a4351. +:a4352 :a4352 :a4352. +:a4353 :a4353 :a4353. +:a4354 :a4354 :a4354. +:a4355 :a4355 :a4355. +:a4356 :a4356 :a4356. +:a4357 :a4357 :a4357. +:a4358 :a4358 :a4358. +:a4359 :a4359 :a4359. +:a4360 :a4360 :a4360. +:a4361 :a4361 :a4361. +:a4362 :a4362 :a4362. +:a4363 :a4363 :a4363. +:a4364 :a4364 :a4364. +:a4365 :a4365 :a4365. +:a4366 :a4366 :a4366. +:a4367 :a4367 :a4367. +:a4368 :a4368 :a4368. +:a4369 :a4369 :a4369. +:a4370 :a4370 :a4370. +:a4371 :a4371 :a4371. +:a4372 :a4372 :a4372. +:a4373 :a4373 :a4373. +:a4374 :a4374 :a4374. +:a4375 :a4375 :a4375. +:a4376 :a4376 :a4376. +:a4377 :a4377 :a4377. +:a4378 :a4378 :a4378. +:a4379 :a4379 :a4379. +:a4380 :a4380 :a4380. +:a4381 :a4381 :a4381. +:a4382 :a4382 :a4382. +:a4383 :a4383 :a4383. +:a4384 :a4384 :a4384. +:a4385 :a4385 :a4385. +:a4386 :a4386 :a4386. +:a4387 :a4387 :a4387. +:a4388 :a4388 :a4388. +:a4389 :a4389 :a4389. +:a4390 :a4390 :a4390. +:a4391 :a4391 :a4391. +:a4392 :a4392 :a4392. +:a4393 :a4393 :a4393. +:a4394 :a4394 :a4394. +:a4395 :a4395 :a4395. +:a4396 :a4396 :a4396. +:a4397 :a4397 :a4397. +:a4398 :a4398 :a4398. +:a4399 :a4399 :a4399. +:a4400 :a4400 :a4400. +:a4401 :a4401 :a4401. +:a4402 :a4402 :a4402. +:a4403 :a4403 :a4403. +:a4404 :a4404 :a4404. +:a4405 :a4405 :a4405. +:a4406 :a4406 :a4406. +:a4407 :a4407 :a4407. +:a4408 :a4408 :a4408. +:a4409 :a4409 :a4409. +:a4410 :a4410 :a4410. +:a4411 :a4411 :a4411. +:a4412 :a4412 :a4412. +:a4413 :a4413 :a4413. +:a4414 :a4414 :a4414. +:a4415 :a4415 :a4415. +:a4416 :a4416 :a4416. +:a4417 :a4417 :a4417. +:a4418 :a4418 :a4418. +:a4419 :a4419 :a4419. +:a4420 :a4420 :a4420. +:a4421 :a4421 :a4421. +:a4422 :a4422 :a4422. +:a4423 :a4423 :a4423. +:a4424 :a4424 :a4424. +:a4425 :a4425 :a4425. +:a4426 :a4426 :a4426. +:a4427 :a4427 :a4427. +:a4428 :a4428 :a4428. +:a4429 :a4429 :a4429. +:a4430 :a4430 :a4430. +:a4431 :a4431 :a4431. +:a4432 :a4432 :a4432. +:a4433 :a4433 :a4433. +:a4434 :a4434 :a4434. +:a4435 :a4435 :a4435. +:a4436 :a4436 :a4436. +:a4437 :a4437 :a4437. +:a4438 :a4438 :a4438. +:a4439 :a4439 :a4439. +:a4440 :a4440 :a4440. +:a4441 :a4441 :a4441. +:a4442 :a4442 :a4442. +:a4443 :a4443 :a4443. +:a4444 :a4444 :a4444. +:a4445 :a4445 :a4445. +:a4446 :a4446 :a4446. +:a4447 :a4447 :a4447. +:a4448 :a4448 :a4448. +:a4449 :a4449 :a4449. +:a4450 :a4450 :a4450. +:a4451 :a4451 :a4451. +:a4452 :a4452 :a4452. +:a4453 :a4453 :a4453. +:a4454 :a4454 :a4454. +:a4455 :a4455 :a4455. +:a4456 :a4456 :a4456. +:a4457 :a4457 :a4457. +:a4458 :a4458 :a4458. +:a4459 :a4459 :a4459. +:a4460 :a4460 :a4460. +:a4461 :a4461 :a4461. +:a4462 :a4462 :a4462. +:a4463 :a4463 :a4463. +:a4464 :a4464 :a4464. +:a4465 :a4465 :a4465. +:a4466 :a4466 :a4466. +:a4467 :a4467 :a4467. +:a4468 :a4468 :a4468. +:a4469 :a4469 :a4469. +:a4470 :a4470 :a4470. +:a4471 :a4471 :a4471. +:a4472 :a4472 :a4472. +:a4473 :a4473 :a4473. +:a4474 :a4474 :a4474. +:a4475 :a4475 :a4475. +:a4476 :a4476 :a4476. +:a4477 :a4477 :a4477. +:a4478 :a4478 :a4478. +:a4479 :a4479 :a4479. +:a4480 :a4480 :a4480. +:a4481 :a4481 :a4481. +:a4482 :a4482 :a4482. +:a4483 :a4483 :a4483. +:a4484 :a4484 :a4484. +:a4485 :a4485 :a4485. +:a4486 :a4486 :a4486. +:a4487 :a4487 :a4487. +:a4488 :a4488 :a4488. +:a4489 :a4489 :a4489. +:a4490 :a4490 :a4490. +:a4491 :a4491 :a4491. +:a4492 :a4492 :a4492. +:a4493 :a4493 :a4493. +:a4494 :a4494 :a4494. +:a4495 :a4495 :a4495. +:a4496 :a4496 :a4496. +:a4497 :a4497 :a4497. +:a4498 :a4498 :a4498. +:a4499 :a4499 :a4499. +:a4500 :a4500 :a4500. +:a4501 :a4501 :a4501. +:a4502 :a4502 :a4502. +:a4503 :a4503 :a4503. +:a4504 :a4504 :a4504. +:a4505 :a4505 :a4505. +:a4506 :a4506 :a4506. +:a4507 :a4507 :a4507. +:a4508 :a4508 :a4508. +:a4509 :a4509 :a4509. +:a4510 :a4510 :a4510. +:a4511 :a4511 :a4511. +:a4512 :a4512 :a4512. +:a4513 :a4513 :a4513. +:a4514 :a4514 :a4514. +:a4515 :a4515 :a4515. +:a4516 :a4516 :a4516. +:a4517 :a4517 :a4517. +:a4518 :a4518 :a4518. +:a4519 :a4519 :a4519. +:a4520 :a4520 :a4520. +:a4521 :a4521 :a4521. +:a4522 :a4522 :a4522. +:a4523 :a4523 :a4523. +:a4524 :a4524 :a4524. +:a4525 :a4525 :a4525. +:a4526 :a4526 :a4526. +:a4527 :a4527 :a4527. +:a4528 :a4528 :a4528. +:a4529 :a4529 :a4529. +:a4530 :a4530 :a4530. +:a4531 :a4531 :a4531. +:a4532 :a4532 :a4532. +:a4533 :a4533 :a4533. +:a4534 :a4534 :a4534. +:a4535 :a4535 :a4535. +:a4536 :a4536 :a4536. +:a4537 :a4537 :a4537. +:a4538 :a4538 :a4538. +:a4539 :a4539 :a4539. +:a4540 :a4540 :a4540. +:a4541 :a4541 :a4541. +:a4542 :a4542 :a4542. +:a4543 :a4543 :a4543. +:a4544 :a4544 :a4544. +:a4545 :a4545 :a4545. +:a4546 :a4546 :a4546. +:a4547 :a4547 :a4547. +:a4548 :a4548 :a4548. +:a4549 :a4549 :a4549. +:a4550 :a4550 :a4550. +:a4551 :a4551 :a4551. +:a4552 :a4552 :a4552. +:a4553 :a4553 :a4553. +:a4554 :a4554 :a4554. +:a4555 :a4555 :a4555. +:a4556 :a4556 :a4556. +:a4557 :a4557 :a4557. +:a4558 :a4558 :a4558. +:a4559 :a4559 :a4559. +:a4560 :a4560 :a4560. +:a4561 :a4561 :a4561. +:a4562 :a4562 :a4562. +:a4563 :a4563 :a4563. +:a4564 :a4564 :a4564. +:a4565 :a4565 :a4565. +:a4566 :a4566 :a4566. +:a4567 :a4567 :a4567. +:a4568 :a4568 :a4568. +:a4569 :a4569 :a4569. +:a4570 :a4570 :a4570. +:a4571 :a4571 :a4571. +:a4572 :a4572 :a4572. +:a4573 :a4573 :a4573. +:a4574 :a4574 :a4574. +:a4575 :a4575 :a4575. +:a4576 :a4576 :a4576. +:a4577 :a4577 :a4577. +:a4578 :a4578 :a4578. +:a4579 :a4579 :a4579. +:a4580 :a4580 :a4580. +:a4581 :a4581 :a4581. +:a4582 :a4582 :a4582. +:a4583 :a4583 :a4583. +:a4584 :a4584 :a4584. +:a4585 :a4585 :a4585. +:a4586 :a4586 :a4586. +:a4587 :a4587 :a4587. +:a4588 :a4588 :a4588. +:a4589 :a4589 :a4589. +:a4590 :a4590 :a4590. +:a4591 :a4591 :a4591. +:a4592 :a4592 :a4592. +:a4593 :a4593 :a4593. +:a4594 :a4594 :a4594. +:a4595 :a4595 :a4595. +:a4596 :a4596 :a4596. +:a4597 :a4597 :a4597. +:a4598 :a4598 :a4598. +:a4599 :a4599 :a4599. +:a4600 :a4600 :a4600. +:a4601 :a4601 :a4601. +:a4602 :a4602 :a4602. +:a4603 :a4603 :a4603. +:a4604 :a4604 :a4604. +:a4605 :a4605 :a4605. +:a4606 :a4606 :a4606. +:a4607 :a4607 :a4607. +:a4608 :a4608 :a4608. +:a4609 :a4609 :a4609. +:a4610 :a4610 :a4610. +:a4611 :a4611 :a4611. +:a4612 :a4612 :a4612. +:a4613 :a4613 :a4613. +:a4614 :a4614 :a4614. +:a4615 :a4615 :a4615. +:a4616 :a4616 :a4616. +:a4617 :a4617 :a4617. +:a4618 :a4618 :a4618. +:a4619 :a4619 :a4619. +:a4620 :a4620 :a4620. +:a4621 :a4621 :a4621. +:a4622 :a4622 :a4622. +:a4623 :a4623 :a4623. +:a4624 :a4624 :a4624. +:a4625 :a4625 :a4625. +:a4626 :a4626 :a4626. +:a4627 :a4627 :a4627. +:a4628 :a4628 :a4628. +:a4629 :a4629 :a4629. +:a4630 :a4630 :a4630. +:a4631 :a4631 :a4631. +:a4632 :a4632 :a4632. +:a4633 :a4633 :a4633. +:a4634 :a4634 :a4634. +:a4635 :a4635 :a4635. +:a4636 :a4636 :a4636. +:a4637 :a4637 :a4637. +:a4638 :a4638 :a4638. +:a4639 :a4639 :a4639. +:a4640 :a4640 :a4640. +:a4641 :a4641 :a4641. +:a4642 :a4642 :a4642. +:a4643 :a4643 :a4643. +:a4644 :a4644 :a4644. +:a4645 :a4645 :a4645. +:a4646 :a4646 :a4646. +:a4647 :a4647 :a4647. +:a4648 :a4648 :a4648. +:a4649 :a4649 :a4649. +:a4650 :a4650 :a4650. +:a4651 :a4651 :a4651. +:a4652 :a4652 :a4652. +:a4653 :a4653 :a4653. +:a4654 :a4654 :a4654. +:a4655 :a4655 :a4655. +:a4656 :a4656 :a4656. +:a4657 :a4657 :a4657. +:a4658 :a4658 :a4658. +:a4659 :a4659 :a4659. +:a4660 :a4660 :a4660. +:a4661 :a4661 :a4661. +:a4662 :a4662 :a4662. +:a4663 :a4663 :a4663. +:a4664 :a4664 :a4664. +:a4665 :a4665 :a4665. +:a4666 :a4666 :a4666. +:a4667 :a4667 :a4667. +:a4668 :a4668 :a4668. +:a4669 :a4669 :a4669. +:a4670 :a4670 :a4670. +:a4671 :a4671 :a4671. +:a4672 :a4672 :a4672. +:a4673 :a4673 :a4673. +:a4674 :a4674 :a4674. +:a4675 :a4675 :a4675. +:a4676 :a4676 :a4676. +:a4677 :a4677 :a4677. +:a4678 :a4678 :a4678. +:a4679 :a4679 :a4679. +:a4680 :a4680 :a4680. +:a4681 :a4681 :a4681. +:a4682 :a4682 :a4682. +:a4683 :a4683 :a4683. +:a4684 :a4684 :a4684. +:a4685 :a4685 :a4685. +:a4686 :a4686 :a4686. +:a4687 :a4687 :a4687. +:a4688 :a4688 :a4688. +:a4689 :a4689 :a4689. +:a4690 :a4690 :a4690. +:a4691 :a4691 :a4691. +:a4692 :a4692 :a4692. +:a4693 :a4693 :a4693. +:a4694 :a4694 :a4694. +:a4695 :a4695 :a4695. +:a4696 :a4696 :a4696. +:a4697 :a4697 :a4697. +:a4698 :a4698 :a4698. +:a4699 :a4699 :a4699. +:a4700 :a4700 :a4700. +:a4701 :a4701 :a4701. +:a4702 :a4702 :a4702. +:a4703 :a4703 :a4703. +:a4704 :a4704 :a4704. +:a4705 :a4705 :a4705. +:a4706 :a4706 :a4706. +:a4707 :a4707 :a4707. +:a4708 :a4708 :a4708. +:a4709 :a4709 :a4709. +:a4710 :a4710 :a4710. +:a4711 :a4711 :a4711. +:a4712 :a4712 :a4712. +:a4713 :a4713 :a4713. +:a4714 :a4714 :a4714. +:a4715 :a4715 :a4715. +:a4716 :a4716 :a4716. +:a4717 :a4717 :a4717. +:a4718 :a4718 :a4718. +:a4719 :a4719 :a4719. +:a4720 :a4720 :a4720. +:a4721 :a4721 :a4721. +:a4722 :a4722 :a4722. +:a4723 :a4723 :a4723. +:a4724 :a4724 :a4724. +:a4725 :a4725 :a4725. +:a4726 :a4726 :a4726. +:a4727 :a4727 :a4727. +:a4728 :a4728 :a4728. +:a4729 :a4729 :a4729. +:a4730 :a4730 :a4730. +:a4731 :a4731 :a4731. +:a4732 :a4732 :a4732. +:a4733 :a4733 :a4733. +:a4734 :a4734 :a4734. +:a4735 :a4735 :a4735. +:a4736 :a4736 :a4736. +:a4737 :a4737 :a4737. +:a4738 :a4738 :a4738. +:a4739 :a4739 :a4739. +:a4740 :a4740 :a4740. +:a4741 :a4741 :a4741. +:a4742 :a4742 :a4742. +:a4743 :a4743 :a4743. +:a4744 :a4744 :a4744. +:a4745 :a4745 :a4745. +:a4746 :a4746 :a4746. +:a4747 :a4747 :a4747. +:a4748 :a4748 :a4748. +:a4749 :a4749 :a4749. +:a4750 :a4750 :a4750. +:a4751 :a4751 :a4751. +:a4752 :a4752 :a4752. +:a4753 :a4753 :a4753. +:a4754 :a4754 :a4754. +:a4755 :a4755 :a4755. +:a4756 :a4756 :a4756. +:a4757 :a4757 :a4757. +:a4758 :a4758 :a4758. +:a4759 :a4759 :a4759. +:a4760 :a4760 :a4760. +:a4761 :a4761 :a4761. +:a4762 :a4762 :a4762. +:a4763 :a4763 :a4763. +:a4764 :a4764 :a4764. +:a4765 :a4765 :a4765. +:a4766 :a4766 :a4766. +:a4767 :a4767 :a4767. +:a4768 :a4768 :a4768. +:a4769 :a4769 :a4769. +:a4770 :a4770 :a4770. +:a4771 :a4771 :a4771. +:a4772 :a4772 :a4772. +:a4773 :a4773 :a4773. +:a4774 :a4774 :a4774. +:a4775 :a4775 :a4775. +:a4776 :a4776 :a4776. +:a4777 :a4777 :a4777. +:a4778 :a4778 :a4778. +:a4779 :a4779 :a4779. +:a4780 :a4780 :a4780. +:a4781 :a4781 :a4781. +:a4782 :a4782 :a4782. +:a4783 :a4783 :a4783. +:a4784 :a4784 :a4784. +:a4785 :a4785 :a4785. +:a4786 :a4786 :a4786. +:a4787 :a4787 :a4787. +:a4788 :a4788 :a4788. +:a4789 :a4789 :a4789. +:a4790 :a4790 :a4790. +:a4791 :a4791 :a4791. +:a4792 :a4792 :a4792. +:a4793 :a4793 :a4793. +:a4794 :a4794 :a4794. +:a4795 :a4795 :a4795. +:a4796 :a4796 :a4796. +:a4797 :a4797 :a4797. +:a4798 :a4798 :a4798. +:a4799 :a4799 :a4799. +:a4800 :a4800 :a4800. +:a4801 :a4801 :a4801. +:a4802 :a4802 :a4802. +:a4803 :a4803 :a4803. +:a4804 :a4804 :a4804. +:a4805 :a4805 :a4805. +:a4806 :a4806 :a4806. +:a4807 :a4807 :a4807. +:a4808 :a4808 :a4808. +:a4809 :a4809 :a4809. +:a4810 :a4810 :a4810. +:a4811 :a4811 :a4811. +:a4812 :a4812 :a4812. +:a4813 :a4813 :a4813. +:a4814 :a4814 :a4814. +:a4815 :a4815 :a4815. +:a4816 :a4816 :a4816. +:a4817 :a4817 :a4817. +:a4818 :a4818 :a4818. +:a4819 :a4819 :a4819. +:a4820 :a4820 :a4820. +:a4821 :a4821 :a4821. +:a4822 :a4822 :a4822. +:a4823 :a4823 :a4823. +:a4824 :a4824 :a4824. +:a4825 :a4825 :a4825. +:a4826 :a4826 :a4826. +:a4827 :a4827 :a4827. +:a4828 :a4828 :a4828. +:a4829 :a4829 :a4829. +:a4830 :a4830 :a4830. +:a4831 :a4831 :a4831. +:a4832 :a4832 :a4832. +:a4833 :a4833 :a4833. +:a4834 :a4834 :a4834. +:a4835 :a4835 :a4835. +:a4836 :a4836 :a4836. +:a4837 :a4837 :a4837. +:a4838 :a4838 :a4838. +:a4839 :a4839 :a4839. +:a4840 :a4840 :a4840. +:a4841 :a4841 :a4841. +:a4842 :a4842 :a4842. +:a4843 :a4843 :a4843. +:a4844 :a4844 :a4844. +:a4845 :a4845 :a4845. +:a4846 :a4846 :a4846. +:a4847 :a4847 :a4847. +:a4848 :a4848 :a4848. +:a4849 :a4849 :a4849. +:a4850 :a4850 :a4850. +:a4851 :a4851 :a4851. +:a4852 :a4852 :a4852. +:a4853 :a4853 :a4853. +:a4854 :a4854 :a4854. +:a4855 :a4855 :a4855. +:a4856 :a4856 :a4856. +:a4857 :a4857 :a4857. +:a4858 :a4858 :a4858. +:a4859 :a4859 :a4859. +:a4860 :a4860 :a4860. +:a4861 :a4861 :a4861. +:a4862 :a4862 :a4862. +:a4863 :a4863 :a4863. +:a4864 :a4864 :a4864. +:a4865 :a4865 :a4865. +:a4866 :a4866 :a4866. +:a4867 :a4867 :a4867. +:a4868 :a4868 :a4868. +:a4869 :a4869 :a4869. +:a4870 :a4870 :a4870. +:a4871 :a4871 :a4871. +:a4872 :a4872 :a4872. +:a4873 :a4873 :a4873. +:a4874 :a4874 :a4874. +:a4875 :a4875 :a4875. +:a4876 :a4876 :a4876. +:a4877 :a4877 :a4877. +:a4878 :a4878 :a4878. +:a4879 :a4879 :a4879. +:a4880 :a4880 :a4880. +:a4881 :a4881 :a4881. +:a4882 :a4882 :a4882. +:a4883 :a4883 :a4883. +:a4884 :a4884 :a4884. +:a4885 :a4885 :a4885. +:a4886 :a4886 :a4886. +:a4887 :a4887 :a4887. +:a4888 :a4888 :a4888. +:a4889 :a4889 :a4889. +:a4890 :a4890 :a4890. +:a4891 :a4891 :a4891. +:a4892 :a4892 :a4892. +:a4893 :a4893 :a4893. +:a4894 :a4894 :a4894. +:a4895 :a4895 :a4895. +:a4896 :a4896 :a4896. +:a4897 :a4897 :a4897. +:a4898 :a4898 :a4898. +:a4899 :a4899 :a4899. +:a4900 :a4900 :a4900. +:a4901 :a4901 :a4901. +:a4902 :a4902 :a4902. +:a4903 :a4903 :a4903. +:a4904 :a4904 :a4904. +:a4905 :a4905 :a4905. +:a4906 :a4906 :a4906. +:a4907 :a4907 :a4907. +:a4908 :a4908 :a4908. +:a4909 :a4909 :a4909. +:a4910 :a4910 :a4910. +:a4911 :a4911 :a4911. +:a4912 :a4912 :a4912. +:a4913 :a4913 :a4913. +:a4914 :a4914 :a4914. +:a4915 :a4915 :a4915. +:a4916 :a4916 :a4916. +:a4917 :a4917 :a4917. +:a4918 :a4918 :a4918. +:a4919 :a4919 :a4919. +:a4920 :a4920 :a4920. +:a4921 :a4921 :a4921. +:a4922 :a4922 :a4922. +:a4923 :a4923 :a4923. +:a4924 :a4924 :a4924. +:a4925 :a4925 :a4925. +:a4926 :a4926 :a4926. +:a4927 :a4927 :a4927. +:a4928 :a4928 :a4928. +:a4929 :a4929 :a4929. +:a4930 :a4930 :a4930. +:a4931 :a4931 :a4931. +:a4932 :a4932 :a4932. +:a4933 :a4933 :a4933. +:a4934 :a4934 :a4934. +:a4935 :a4935 :a4935. +:a4936 :a4936 :a4936. +:a4937 :a4937 :a4937. +:a4938 :a4938 :a4938. +:a4939 :a4939 :a4939. +:a4940 :a4940 :a4940. +:a4941 :a4941 :a4941. +:a4942 :a4942 :a4942. +:a4943 :a4943 :a4943. +:a4944 :a4944 :a4944. +:a4945 :a4945 :a4945. +:a4946 :a4946 :a4946. +:a4947 :a4947 :a4947. +:a4948 :a4948 :a4948. +:a4949 :a4949 :a4949. +:a4950 :a4950 :a4950. +:a4951 :a4951 :a4951. +:a4952 :a4952 :a4952. +:a4953 :a4953 :a4953. +:a4954 :a4954 :a4954. +:a4955 :a4955 :a4955. +:a4956 :a4956 :a4956. +:a4957 :a4957 :a4957. +:a4958 :a4958 :a4958. +:a4959 :a4959 :a4959. +:a4960 :a4960 :a4960. +:a4961 :a4961 :a4961. +:a4962 :a4962 :a4962. +:a4963 :a4963 :a4963. +:a4964 :a4964 :a4964. +:a4965 :a4965 :a4965. +:a4966 :a4966 :a4966. +:a4967 :a4967 :a4967. +:a4968 :a4968 :a4968. +:a4969 :a4969 :a4969. +:a4970 :a4970 :a4970. +:a4971 :a4971 :a4971. +:a4972 :a4972 :a4972. +:a4973 :a4973 :a4973. +:a4974 :a4974 :a4974. +:a4975 :a4975 :a4975. +:a4976 :a4976 :a4976. +:a4977 :a4977 :a4977. +:a4978 :a4978 :a4978. +:a4979 :a4979 :a4979. +:a4980 :a4980 :a4980. +:a4981 :a4981 :a4981. +:a4982 :a4982 :a4982. +:a4983 :a4983 :a4983. +:a4984 :a4984 :a4984. +:a4985 :a4985 :a4985. +:a4986 :a4986 :a4986. +:a4987 :a4987 :a4987. +:a4988 :a4988 :a4988. +:a4989 :a4989 :a4989. +:a4990 :a4990 :a4990. +:a4991 :a4991 :a4991. +:a4992 :a4992 :a4992. +:a4993 :a4993 :a4993. +:a4994 :a4994 :a4994. +:a4995 :a4995 :a4995. +:a4996 :a4996 :a4996. +:a4997 :a4997 :a4997. +:a4998 :a4998 :a4998. +:a4999 :a4999 :a4999. +:a5000 :a5000 :a5000. +:a5001 :a5001 :a5001. +:a5002 :a5002 :a5002. +:a5003 :a5003 :a5003. +:a5004 :a5004 :a5004. +:a5005 :a5005 :a5005. +:a5006 :a5006 :a5006. +:a5007 :a5007 :a5007. +:a5008 :a5008 :a5008. +:a5009 :a5009 :a5009. +:a5010 :a5010 :a5010. +:a5011 :a5011 :a5011. +:a5012 :a5012 :a5012. +:a5013 :a5013 :a5013. +:a5014 :a5014 :a5014. +:a5015 :a5015 :a5015. +:a5016 :a5016 :a5016. +:a5017 :a5017 :a5017. +:a5018 :a5018 :a5018. +:a5019 :a5019 :a5019. +:a5020 :a5020 :a5020. +:a5021 :a5021 :a5021. +:a5022 :a5022 :a5022. +:a5023 :a5023 :a5023. +:a5024 :a5024 :a5024. +:a5025 :a5025 :a5025. +:a5026 :a5026 :a5026. +:a5027 :a5027 :a5027. +:a5028 :a5028 :a5028. +:a5029 :a5029 :a5029. +:a5030 :a5030 :a5030. +:a5031 :a5031 :a5031. +:a5032 :a5032 :a5032. +:a5033 :a5033 :a5033. +:a5034 :a5034 :a5034. +:a5035 :a5035 :a5035. +:a5036 :a5036 :a5036. +:a5037 :a5037 :a5037. +:a5038 :a5038 :a5038. +:a5039 :a5039 :a5039. +:a5040 :a5040 :a5040. +:a5041 :a5041 :a5041. +:a5042 :a5042 :a5042. +:a5043 :a5043 :a5043. +:a5044 :a5044 :a5044. +:a5045 :a5045 :a5045. +:a5046 :a5046 :a5046. +:a5047 :a5047 :a5047. +:a5048 :a5048 :a5048. +:a5049 :a5049 :a5049. +:a5050 :a5050 :a5050. +:a5051 :a5051 :a5051. +:a5052 :a5052 :a5052. +:a5053 :a5053 :a5053. +:a5054 :a5054 :a5054. +:a5055 :a5055 :a5055. +:a5056 :a5056 :a5056. +:a5057 :a5057 :a5057. +:a5058 :a5058 :a5058. +:a5059 :a5059 :a5059. +:a5060 :a5060 :a5060. +:a5061 :a5061 :a5061. +:a5062 :a5062 :a5062. +:a5063 :a5063 :a5063. +:a5064 :a5064 :a5064. +:a5065 :a5065 :a5065. +:a5066 :a5066 :a5066. +:a5067 :a5067 :a5067. +:a5068 :a5068 :a5068. +:a5069 :a5069 :a5069. +:a5070 :a5070 :a5070. +:a5071 :a5071 :a5071. +:a5072 :a5072 :a5072. +:a5073 :a5073 :a5073. +:a5074 :a5074 :a5074. +:a5075 :a5075 :a5075. +:a5076 :a5076 :a5076. +:a5077 :a5077 :a5077. +:a5078 :a5078 :a5078. +:a5079 :a5079 :a5079. +:a5080 :a5080 :a5080. +:a5081 :a5081 :a5081. +:a5082 :a5082 :a5082. +:a5083 :a5083 :a5083. +:a5084 :a5084 :a5084. +:a5085 :a5085 :a5085. +:a5086 :a5086 :a5086. +:a5087 :a5087 :a5087. +:a5088 :a5088 :a5088. +:a5089 :a5089 :a5089. +:a5090 :a5090 :a5090. +:a5091 :a5091 :a5091. +:a5092 :a5092 :a5092. +:a5093 :a5093 :a5093. +:a5094 :a5094 :a5094. +:a5095 :a5095 :a5095. +:a5096 :a5096 :a5096. +:a5097 :a5097 :a5097. +:a5098 :a5098 :a5098. +:a5099 :a5099 :a5099. +:a5100 :a5100 :a5100. +:a5101 :a5101 :a5101. +:a5102 :a5102 :a5102. +:a5103 :a5103 :a5103. +:a5104 :a5104 :a5104. +:a5105 :a5105 :a5105. +:a5106 :a5106 :a5106. +:a5107 :a5107 :a5107. +:a5108 :a5108 :a5108. +:a5109 :a5109 :a5109. +:a5110 :a5110 :a5110. +:a5111 :a5111 :a5111. +:a5112 :a5112 :a5112. +:a5113 :a5113 :a5113. +:a5114 :a5114 :a5114. +:a5115 :a5115 :a5115. +:a5116 :a5116 :a5116. +:a5117 :a5117 :a5117. +:a5118 :a5118 :a5118. +:a5119 :a5119 :a5119. +:a5120 :a5120 :a5120. +:a5121 :a5121 :a5121. +:a5122 :a5122 :a5122. +:a5123 :a5123 :a5123. +:a5124 :a5124 :a5124. +:a5125 :a5125 :a5125. +:a5126 :a5126 :a5126. +:a5127 :a5127 :a5127. +:a5128 :a5128 :a5128. +:a5129 :a5129 :a5129. +:a5130 :a5130 :a5130. +:a5131 :a5131 :a5131. +:a5132 :a5132 :a5132. +:a5133 :a5133 :a5133. +:a5134 :a5134 :a5134. +:a5135 :a5135 :a5135. +:a5136 :a5136 :a5136. +:a5137 :a5137 :a5137. +:a5138 :a5138 :a5138. +:a5139 :a5139 :a5139. +:a5140 :a5140 :a5140. +:a5141 :a5141 :a5141. +:a5142 :a5142 :a5142. +:a5143 :a5143 :a5143. +:a5144 :a5144 :a5144. +:a5145 :a5145 :a5145. +:a5146 :a5146 :a5146. +:a5147 :a5147 :a5147. +:a5148 :a5148 :a5148. +:a5149 :a5149 :a5149. +:a5150 :a5150 :a5150. +:a5151 :a5151 :a5151. +:a5152 :a5152 :a5152. +:a5153 :a5153 :a5153. +:a5154 :a5154 :a5154. +:a5155 :a5155 :a5155. +:a5156 :a5156 :a5156. +:a5157 :a5157 :a5157. +:a5158 :a5158 :a5158. +:a5159 :a5159 :a5159. +:a5160 :a5160 :a5160. +:a5161 :a5161 :a5161. +:a5162 :a5162 :a5162. +:a5163 :a5163 :a5163. +:a5164 :a5164 :a5164. +:a5165 :a5165 :a5165. +:a5166 :a5166 :a5166. +:a5167 :a5167 :a5167. +:a5168 :a5168 :a5168. +:a5169 :a5169 :a5169. +:a5170 :a5170 :a5170. +:a5171 :a5171 :a5171. +:a5172 :a5172 :a5172. +:a5173 :a5173 :a5173. +:a5174 :a5174 :a5174. +:a5175 :a5175 :a5175. +:a5176 :a5176 :a5176. +:a5177 :a5177 :a5177. +:a5178 :a5178 :a5178. +:a5179 :a5179 :a5179. +:a5180 :a5180 :a5180. +:a5181 :a5181 :a5181. +:a5182 :a5182 :a5182. +:a5183 :a5183 :a5183. +:a5184 :a5184 :a5184. +:a5185 :a5185 :a5185. +:a5186 :a5186 :a5186. +:a5187 :a5187 :a5187. +:a5188 :a5188 :a5188. +:a5189 :a5189 :a5189. +:a5190 :a5190 :a5190. +:a5191 :a5191 :a5191. +:a5192 :a5192 :a5192. +:a5193 :a5193 :a5193. +:a5194 :a5194 :a5194. +:a5195 :a5195 :a5195. +:a5196 :a5196 :a5196. +:a5197 :a5197 :a5197. +:a5198 :a5198 :a5198. +:a5199 :a5199 :a5199. +:a5200 :a5200 :a5200. +:a5201 :a5201 :a5201. +:a5202 :a5202 :a5202. +:a5203 :a5203 :a5203. +:a5204 :a5204 :a5204. +:a5205 :a5205 :a5205. +:a5206 :a5206 :a5206. +:a5207 :a5207 :a5207. +:a5208 :a5208 :a5208. +:a5209 :a5209 :a5209. +:a5210 :a5210 :a5210. +:a5211 :a5211 :a5211. +:a5212 :a5212 :a5212. +:a5213 :a5213 :a5213. +:a5214 :a5214 :a5214. +:a5215 :a5215 :a5215. +:a5216 :a5216 :a5216. +:a5217 :a5217 :a5217. +:a5218 :a5218 :a5218. +:a5219 :a5219 :a5219. +:a5220 :a5220 :a5220. +:a5221 :a5221 :a5221. +:a5222 :a5222 :a5222. +:a5223 :a5223 :a5223. +:a5224 :a5224 :a5224. +:a5225 :a5225 :a5225. +:a5226 :a5226 :a5226. +:a5227 :a5227 :a5227. +:a5228 :a5228 :a5228. +:a5229 :a5229 :a5229. +:a5230 :a5230 :a5230. +:a5231 :a5231 :a5231. +:a5232 :a5232 :a5232. +:a5233 :a5233 :a5233. +:a5234 :a5234 :a5234. +:a5235 :a5235 :a5235. +:a5236 :a5236 :a5236. +:a5237 :a5237 :a5237. +:a5238 :a5238 :a5238. +:a5239 :a5239 :a5239. +:a5240 :a5240 :a5240. +:a5241 :a5241 :a5241. +:a5242 :a5242 :a5242. +:a5243 :a5243 :a5243. +:a5244 :a5244 :a5244. +:a5245 :a5245 :a5245. +:a5246 :a5246 :a5246. +:a5247 :a5247 :a5247. +:a5248 :a5248 :a5248. +:a5249 :a5249 :a5249. +:a5250 :a5250 :a5250. +:a5251 :a5251 :a5251. +:a5252 :a5252 :a5252. +:a5253 :a5253 :a5253. +:a5254 :a5254 :a5254. +:a5255 :a5255 :a5255. +:a5256 :a5256 :a5256. +:a5257 :a5257 :a5257. +:a5258 :a5258 :a5258. +:a5259 :a5259 :a5259. +:a5260 :a5260 :a5260. +:a5261 :a5261 :a5261. +:a5262 :a5262 :a5262. +:a5263 :a5263 :a5263. +:a5264 :a5264 :a5264. +:a5265 :a5265 :a5265. +:a5266 :a5266 :a5266. +:a5267 :a5267 :a5267. +:a5268 :a5268 :a5268. +:a5269 :a5269 :a5269. +:a5270 :a5270 :a5270. +:a5271 :a5271 :a5271. +:a5272 :a5272 :a5272. +:a5273 :a5273 :a5273. +:a5274 :a5274 :a5274. +:a5275 :a5275 :a5275. +:a5276 :a5276 :a5276. +:a5277 :a5277 :a5277. +:a5278 :a5278 :a5278. +:a5279 :a5279 :a5279. +:a5280 :a5280 :a5280. +:a5281 :a5281 :a5281. +:a5282 :a5282 :a5282. +:a5283 :a5283 :a5283. +:a5284 :a5284 :a5284. +:a5285 :a5285 :a5285. +:a5286 :a5286 :a5286. +:a5287 :a5287 :a5287. +:a5288 :a5288 :a5288. +:a5289 :a5289 :a5289. +:a5290 :a5290 :a5290. +:a5291 :a5291 :a5291. +:a5292 :a5292 :a5292. +:a5293 :a5293 :a5293. +:a5294 :a5294 :a5294. +:a5295 :a5295 :a5295. +:a5296 :a5296 :a5296. +:a5297 :a5297 :a5297. +:a5298 :a5298 :a5298. +:a5299 :a5299 :a5299. +:a5300 :a5300 :a5300. +:a5301 :a5301 :a5301. +:a5302 :a5302 :a5302. +:a5303 :a5303 :a5303. +:a5304 :a5304 :a5304. +:a5305 :a5305 :a5305. +:a5306 :a5306 :a5306. +:a5307 :a5307 :a5307. +:a5308 :a5308 :a5308. +:a5309 :a5309 :a5309. +:a5310 :a5310 :a5310. +:a5311 :a5311 :a5311. +:a5312 :a5312 :a5312. +:a5313 :a5313 :a5313. +:a5314 :a5314 :a5314. +:a5315 :a5315 :a5315. +:a5316 :a5316 :a5316. +:a5317 :a5317 :a5317. +:a5318 :a5318 :a5318. +:a5319 :a5319 :a5319. +:a5320 :a5320 :a5320. +:a5321 :a5321 :a5321. +:a5322 :a5322 :a5322. +:a5323 :a5323 :a5323. +:a5324 :a5324 :a5324. +:a5325 :a5325 :a5325. +:a5326 :a5326 :a5326. +:a5327 :a5327 :a5327. +:a5328 :a5328 :a5328. +:a5329 :a5329 :a5329. +:a5330 :a5330 :a5330. +:a5331 :a5331 :a5331. +:a5332 :a5332 :a5332. +:a5333 :a5333 :a5333. +:a5334 :a5334 :a5334. +:a5335 :a5335 :a5335. +:a5336 :a5336 :a5336. +:a5337 :a5337 :a5337. +:a5338 :a5338 :a5338. +:a5339 :a5339 :a5339. +:a5340 :a5340 :a5340. +:a5341 :a5341 :a5341. +:a5342 :a5342 :a5342. +:a5343 :a5343 :a5343. +:a5344 :a5344 :a5344. +:a5345 :a5345 :a5345. +:a5346 :a5346 :a5346. +:a5347 :a5347 :a5347. +:a5348 :a5348 :a5348. +:a5349 :a5349 :a5349. +:a5350 :a5350 :a5350. +:a5351 :a5351 :a5351. +:a5352 :a5352 :a5352. +:a5353 :a5353 :a5353. +:a5354 :a5354 :a5354. +:a5355 :a5355 :a5355. +:a5356 :a5356 :a5356. +:a5357 :a5357 :a5357. +:a5358 :a5358 :a5358. +:a5359 :a5359 :a5359. +:a5360 :a5360 :a5360. +:a5361 :a5361 :a5361. +:a5362 :a5362 :a5362. +:a5363 :a5363 :a5363. +:a5364 :a5364 :a5364. +:a5365 :a5365 :a5365. +:a5366 :a5366 :a5366. +:a5367 :a5367 :a5367. +:a5368 :a5368 :a5368. +:a5369 :a5369 :a5369. +:a5370 :a5370 :a5370. +:a5371 :a5371 :a5371. +:a5372 :a5372 :a5372. +:a5373 :a5373 :a5373. +:a5374 :a5374 :a5374. +:a5375 :a5375 :a5375. +:a5376 :a5376 :a5376. +:a5377 :a5377 :a5377. +:a5378 :a5378 :a5378. +:a5379 :a5379 :a5379. +:a5380 :a5380 :a5380. +:a5381 :a5381 :a5381. +:a5382 :a5382 :a5382. +:a5383 :a5383 :a5383. +:a5384 :a5384 :a5384. +:a5385 :a5385 :a5385. +:a5386 :a5386 :a5386. +:a5387 :a5387 :a5387. +:a5388 :a5388 :a5388. +:a5389 :a5389 :a5389. +:a5390 :a5390 :a5390. +:a5391 :a5391 :a5391. +:a5392 :a5392 :a5392. +:a5393 :a5393 :a5393. +:a5394 :a5394 :a5394. +:a5395 :a5395 :a5395. +:a5396 :a5396 :a5396. +:a5397 :a5397 :a5397. +:a5398 :a5398 :a5398. +:a5399 :a5399 :a5399. +:a5400 :a5400 :a5400. +:a5401 :a5401 :a5401. +:a5402 :a5402 :a5402. +:a5403 :a5403 :a5403. +:a5404 :a5404 :a5404. +:a5405 :a5405 :a5405. +:a5406 :a5406 :a5406. +:a5407 :a5407 :a5407. +:a5408 :a5408 :a5408. +:a5409 :a5409 :a5409. +:a5410 :a5410 :a5410. +:a5411 :a5411 :a5411. +:a5412 :a5412 :a5412. +:a5413 :a5413 :a5413. +:a5414 :a5414 :a5414. +:a5415 :a5415 :a5415. +:a5416 :a5416 :a5416. +:a5417 :a5417 :a5417. +:a5418 :a5418 :a5418. +:a5419 :a5419 :a5419. +:a5420 :a5420 :a5420. +:a5421 :a5421 :a5421. +:a5422 :a5422 :a5422. +:a5423 :a5423 :a5423. +:a5424 :a5424 :a5424. +:a5425 :a5425 :a5425. +:a5426 :a5426 :a5426. +:a5427 :a5427 :a5427. +:a5428 :a5428 :a5428. +:a5429 :a5429 :a5429. +:a5430 :a5430 :a5430. +:a5431 :a5431 :a5431. +:a5432 :a5432 :a5432. +:a5433 :a5433 :a5433. +:a5434 :a5434 :a5434. +:a5435 :a5435 :a5435. +:a5436 :a5436 :a5436. +:a5437 :a5437 :a5437. +:a5438 :a5438 :a5438. +:a5439 :a5439 :a5439. +:a5440 :a5440 :a5440. +:a5441 :a5441 :a5441. +:a5442 :a5442 :a5442. +:a5443 :a5443 :a5443. +:a5444 :a5444 :a5444. +:a5445 :a5445 :a5445. +:a5446 :a5446 :a5446. +:a5447 :a5447 :a5447. +:a5448 :a5448 :a5448. +:a5449 :a5449 :a5449. +:a5450 :a5450 :a5450. +:a5451 :a5451 :a5451. +:a5452 :a5452 :a5452. +:a5453 :a5453 :a5453. +:a5454 :a5454 :a5454. +:a5455 :a5455 :a5455. +:a5456 :a5456 :a5456. +:a5457 :a5457 :a5457. +:a5458 :a5458 :a5458. +:a5459 :a5459 :a5459. +:a5460 :a5460 :a5460. +:a5461 :a5461 :a5461. +:a5462 :a5462 :a5462. +:a5463 :a5463 :a5463. +:a5464 :a5464 :a5464. +:a5465 :a5465 :a5465. +:a5466 :a5466 :a5466. +:a5467 :a5467 :a5467. +:a5468 :a5468 :a5468. +:a5469 :a5469 :a5469. +:a5470 :a5470 :a5470. +:a5471 :a5471 :a5471. +:a5472 :a5472 :a5472. +:a5473 :a5473 :a5473. +:a5474 :a5474 :a5474. +:a5475 :a5475 :a5475. +:a5476 :a5476 :a5476. +:a5477 :a5477 :a5477. +:a5478 :a5478 :a5478. +:a5479 :a5479 :a5479. +:a5480 :a5480 :a5480. +:a5481 :a5481 :a5481. +:a5482 :a5482 :a5482. +:a5483 :a5483 :a5483. +:a5484 :a5484 :a5484. +:a5485 :a5485 :a5485. +:a5486 :a5486 :a5486. +:a5487 :a5487 :a5487. +:a5488 :a5488 :a5488. +:a5489 :a5489 :a5489. +:a5490 :a5490 :a5490. +:a5491 :a5491 :a5491. +:a5492 :a5492 :a5492. +:a5493 :a5493 :a5493. +:a5494 :a5494 :a5494. +:a5495 :a5495 :a5495. +:a5496 :a5496 :a5496. +:a5497 :a5497 :a5497. +:a5498 :a5498 :a5498. +:a5499 :a5499 :a5499. +:a5500 :a5500 :a5500. +:a5501 :a5501 :a5501. +:a5502 :a5502 :a5502. +:a5503 :a5503 :a5503. +:a5504 :a5504 :a5504. +:a5505 :a5505 :a5505. +:a5506 :a5506 :a5506. +:a5507 :a5507 :a5507. +:a5508 :a5508 :a5508. +:a5509 :a5509 :a5509. +:a5510 :a5510 :a5510. +:a5511 :a5511 :a5511. +:a5512 :a5512 :a5512. +:a5513 :a5513 :a5513. +:a5514 :a5514 :a5514. +:a5515 :a5515 :a5515. +:a5516 :a5516 :a5516. +:a5517 :a5517 :a5517. +:a5518 :a5518 :a5518. +:a5519 :a5519 :a5519. +:a5520 :a5520 :a5520. +:a5521 :a5521 :a5521. +:a5522 :a5522 :a5522. +:a5523 :a5523 :a5523. +:a5524 :a5524 :a5524. +:a5525 :a5525 :a5525. +:a5526 :a5526 :a5526. +:a5527 :a5527 :a5527. +:a5528 :a5528 :a5528. +:a5529 :a5529 :a5529. +:a5530 :a5530 :a5530. +:a5531 :a5531 :a5531. +:a5532 :a5532 :a5532. +:a5533 :a5533 :a5533. +:a5534 :a5534 :a5534. +:a5535 :a5535 :a5535. +:a5536 :a5536 :a5536. +:a5537 :a5537 :a5537. +:a5538 :a5538 :a5538. +:a5539 :a5539 :a5539. +:a5540 :a5540 :a5540. +:a5541 :a5541 :a5541. +:a5542 :a5542 :a5542. +:a5543 :a5543 :a5543. +:a5544 :a5544 :a5544. +:a5545 :a5545 :a5545. +:a5546 :a5546 :a5546. +:a5547 :a5547 :a5547. +:a5548 :a5548 :a5548. +:a5549 :a5549 :a5549. +:a5550 :a5550 :a5550. +:a5551 :a5551 :a5551. +:a5552 :a5552 :a5552. +:a5553 :a5553 :a5553. +:a5554 :a5554 :a5554. +:a5555 :a5555 :a5555. +:a5556 :a5556 :a5556. +:a5557 :a5557 :a5557. +:a5558 :a5558 :a5558. +:a5559 :a5559 :a5559. +:a5560 :a5560 :a5560. +:a5561 :a5561 :a5561. +:a5562 :a5562 :a5562. +:a5563 :a5563 :a5563. +:a5564 :a5564 :a5564. +:a5565 :a5565 :a5565. +:a5566 :a5566 :a5566. +:a5567 :a5567 :a5567. +:a5568 :a5568 :a5568. +:a5569 :a5569 :a5569. +:a5570 :a5570 :a5570. +:a5571 :a5571 :a5571. +:a5572 :a5572 :a5572. +:a5573 :a5573 :a5573. +:a5574 :a5574 :a5574. +:a5575 :a5575 :a5575. +:a5576 :a5576 :a5576. +:a5577 :a5577 :a5577. +:a5578 :a5578 :a5578. +:a5579 :a5579 :a5579. +:a5580 :a5580 :a5580. +:a5581 :a5581 :a5581. +:a5582 :a5582 :a5582. +:a5583 :a5583 :a5583. +:a5584 :a5584 :a5584. +:a5585 :a5585 :a5585. +:a5586 :a5586 :a5586. +:a5587 :a5587 :a5587. +:a5588 :a5588 :a5588. +:a5589 :a5589 :a5589. +:a5590 :a5590 :a5590. +:a5591 :a5591 :a5591. +:a5592 :a5592 :a5592. +:a5593 :a5593 :a5593. +:a5594 :a5594 :a5594. +:a5595 :a5595 :a5595. +:a5596 :a5596 :a5596. +:a5597 :a5597 :a5597. +:a5598 :a5598 :a5598. +:a5599 :a5599 :a5599. +:a5600 :a5600 :a5600. +:a5601 :a5601 :a5601. +:a5602 :a5602 :a5602. +:a5603 :a5603 :a5603. +:a5604 :a5604 :a5604. +:a5605 :a5605 :a5605. +:a5606 :a5606 :a5606. +:a5607 :a5607 :a5607. +:a5608 :a5608 :a5608. +:a5609 :a5609 :a5609. +:a5610 :a5610 :a5610. +:a5611 :a5611 :a5611. +:a5612 :a5612 :a5612. +:a5613 :a5613 :a5613. +:a5614 :a5614 :a5614. +:a5615 :a5615 :a5615. +:a5616 :a5616 :a5616. +:a5617 :a5617 :a5617. +:a5618 :a5618 :a5618. +:a5619 :a5619 :a5619. +:a5620 :a5620 :a5620. +:a5621 :a5621 :a5621. +:a5622 :a5622 :a5622. +:a5623 :a5623 :a5623. +:a5624 :a5624 :a5624. +:a5625 :a5625 :a5625. +:a5626 :a5626 :a5626. +:a5627 :a5627 :a5627. +:a5628 :a5628 :a5628. +:a5629 :a5629 :a5629. +:a5630 :a5630 :a5630. +:a5631 :a5631 :a5631. +:a5632 :a5632 :a5632. +:a5633 :a5633 :a5633. +:a5634 :a5634 :a5634. +:a5635 :a5635 :a5635. +:a5636 :a5636 :a5636. +:a5637 :a5637 :a5637. +:a5638 :a5638 :a5638. +:a5639 :a5639 :a5639. +:a5640 :a5640 :a5640. +:a5641 :a5641 :a5641. +:a5642 :a5642 :a5642. +:a5643 :a5643 :a5643. +:a5644 :a5644 :a5644. +:a5645 :a5645 :a5645. +:a5646 :a5646 :a5646. +:a5647 :a5647 :a5647. +:a5648 :a5648 :a5648. +:a5649 :a5649 :a5649. +:a5650 :a5650 :a5650. +:a5651 :a5651 :a5651. +:a5652 :a5652 :a5652. +:a5653 :a5653 :a5653. +:a5654 :a5654 :a5654. +:a5655 :a5655 :a5655. +:a5656 :a5656 :a5656. +:a5657 :a5657 :a5657. +:a5658 :a5658 :a5658. +:a5659 :a5659 :a5659. +:a5660 :a5660 :a5660. +:a5661 :a5661 :a5661. +:a5662 :a5662 :a5662. +:a5663 :a5663 :a5663. +:a5664 :a5664 :a5664. +:a5665 :a5665 :a5665. +:a5666 :a5666 :a5666. +:a5667 :a5667 :a5667. +:a5668 :a5668 :a5668. +:a5669 :a5669 :a5669. +:a5670 :a5670 :a5670. +:a5671 :a5671 :a5671. +:a5672 :a5672 :a5672. +:a5673 :a5673 :a5673. +:a5674 :a5674 :a5674. +:a5675 :a5675 :a5675. +:a5676 :a5676 :a5676. +:a5677 :a5677 :a5677. +:a5678 :a5678 :a5678. +:a5679 :a5679 :a5679. +:a5680 :a5680 :a5680. +:a5681 :a5681 :a5681. +:a5682 :a5682 :a5682. +:a5683 :a5683 :a5683. +:a5684 :a5684 :a5684. +:a5685 :a5685 :a5685. +:a5686 :a5686 :a5686. +:a5687 :a5687 :a5687. +:a5688 :a5688 :a5688. +:a5689 :a5689 :a5689. +:a5690 :a5690 :a5690. +:a5691 :a5691 :a5691. +:a5692 :a5692 :a5692. +:a5693 :a5693 :a5693. +:a5694 :a5694 :a5694. +:a5695 :a5695 :a5695. +:a5696 :a5696 :a5696. +:a5697 :a5697 :a5697. +:a5698 :a5698 :a5698. +:a5699 :a5699 :a5699. +:a5700 :a5700 :a5700. +:a5701 :a5701 :a5701. +:a5702 :a5702 :a5702. +:a5703 :a5703 :a5703. +:a5704 :a5704 :a5704. +:a5705 :a5705 :a5705. +:a5706 :a5706 :a5706. +:a5707 :a5707 :a5707. +:a5708 :a5708 :a5708. +:a5709 :a5709 :a5709. +:a5710 :a5710 :a5710. +:a5711 :a5711 :a5711. +:a5712 :a5712 :a5712. +:a5713 :a5713 :a5713. +:a5714 :a5714 :a5714. +:a5715 :a5715 :a5715. +:a5716 :a5716 :a5716. +:a5717 :a5717 :a5717. +:a5718 :a5718 :a5718. +:a5719 :a5719 :a5719. +:a5720 :a5720 :a5720. +:a5721 :a5721 :a5721. +:a5722 :a5722 :a5722. +:a5723 :a5723 :a5723. +:a5724 :a5724 :a5724. +:a5725 :a5725 :a5725. +:a5726 :a5726 :a5726. +:a5727 :a5727 :a5727. +:a5728 :a5728 :a5728. +:a5729 :a5729 :a5729. +:a5730 :a5730 :a5730. +:a5731 :a5731 :a5731. +:a5732 :a5732 :a5732. +:a5733 :a5733 :a5733. +:a5734 :a5734 :a5734. +:a5735 :a5735 :a5735. +:a5736 :a5736 :a5736. +:a5737 :a5737 :a5737. +:a5738 :a5738 :a5738. +:a5739 :a5739 :a5739. +:a5740 :a5740 :a5740. +:a5741 :a5741 :a5741. +:a5742 :a5742 :a5742. +:a5743 :a5743 :a5743. +:a5744 :a5744 :a5744. +:a5745 :a5745 :a5745. +:a5746 :a5746 :a5746. +:a5747 :a5747 :a5747. +:a5748 :a5748 :a5748. +:a5749 :a5749 :a5749. +:a5750 :a5750 :a5750. +:a5751 :a5751 :a5751. +:a5752 :a5752 :a5752. +:a5753 :a5753 :a5753. +:a5754 :a5754 :a5754. +:a5755 :a5755 :a5755. +:a5756 :a5756 :a5756. +:a5757 :a5757 :a5757. +:a5758 :a5758 :a5758. +:a5759 :a5759 :a5759. +:a5760 :a5760 :a5760. +:a5761 :a5761 :a5761. +:a5762 :a5762 :a5762. +:a5763 :a5763 :a5763. +:a5764 :a5764 :a5764. +:a5765 :a5765 :a5765. +:a5766 :a5766 :a5766. +:a5767 :a5767 :a5767. +:a5768 :a5768 :a5768. +:a5769 :a5769 :a5769. +:a5770 :a5770 :a5770. +:a5771 :a5771 :a5771. +:a5772 :a5772 :a5772. +:a5773 :a5773 :a5773. +:a5774 :a5774 :a5774. +:a5775 :a5775 :a5775. +:a5776 :a5776 :a5776. +:a5777 :a5777 :a5777. +:a5778 :a5778 :a5778. +:a5779 :a5779 :a5779. +:a5780 :a5780 :a5780. +:a5781 :a5781 :a5781. +:a5782 :a5782 :a5782. +:a5783 :a5783 :a5783. +:a5784 :a5784 :a5784. +:a5785 :a5785 :a5785. +:a5786 :a5786 :a5786. +:a5787 :a5787 :a5787. +:a5788 :a5788 :a5788. +:a5789 :a5789 :a5789. +:a5790 :a5790 :a5790. +:a5791 :a5791 :a5791. +:a5792 :a5792 :a5792. +:a5793 :a5793 :a5793. +:a5794 :a5794 :a5794. +:a5795 :a5795 :a5795. +:a5796 :a5796 :a5796. +:a5797 :a5797 :a5797. +:a5798 :a5798 :a5798. +:a5799 :a5799 :a5799. +:a5800 :a5800 :a5800. +:a5801 :a5801 :a5801. +:a5802 :a5802 :a5802. +:a5803 :a5803 :a5803. +:a5804 :a5804 :a5804. +:a5805 :a5805 :a5805. +:a5806 :a5806 :a5806. +:a5807 :a5807 :a5807. +:a5808 :a5808 :a5808. +:a5809 :a5809 :a5809. +:a5810 :a5810 :a5810. +:a5811 :a5811 :a5811. +:a5812 :a5812 :a5812. +:a5813 :a5813 :a5813. +:a5814 :a5814 :a5814. +:a5815 :a5815 :a5815. +:a5816 :a5816 :a5816. +:a5817 :a5817 :a5817. +:a5818 :a5818 :a5818. +:a5819 :a5819 :a5819. +:a5820 :a5820 :a5820. +:a5821 :a5821 :a5821. +:a5822 :a5822 :a5822. +:a5823 :a5823 :a5823. +:a5824 :a5824 :a5824. +:a5825 :a5825 :a5825. +:a5826 :a5826 :a5826. +:a5827 :a5827 :a5827. +:a5828 :a5828 :a5828. +:a5829 :a5829 :a5829. +:a5830 :a5830 :a5830. +:a5831 :a5831 :a5831. +:a5832 :a5832 :a5832. +:a5833 :a5833 :a5833. +:a5834 :a5834 :a5834. +:a5835 :a5835 :a5835. +:a5836 :a5836 :a5836. +:a5837 :a5837 :a5837. +:a5838 :a5838 :a5838. +:a5839 :a5839 :a5839. +:a5840 :a5840 :a5840. +:a5841 :a5841 :a5841. +:a5842 :a5842 :a5842. +:a5843 :a5843 :a5843. +:a5844 :a5844 :a5844. +:a5845 :a5845 :a5845. +:a5846 :a5846 :a5846. +:a5847 :a5847 :a5847. +:a5848 :a5848 :a5848. +:a5849 :a5849 :a5849. +:a5850 :a5850 :a5850. +:a5851 :a5851 :a5851. +:a5852 :a5852 :a5852. +:a5853 :a5853 :a5853. +:a5854 :a5854 :a5854. +:a5855 :a5855 :a5855. +:a5856 :a5856 :a5856. +:a5857 :a5857 :a5857. +:a5858 :a5858 :a5858. +:a5859 :a5859 :a5859. +:a5860 :a5860 :a5860. +:a5861 :a5861 :a5861. +:a5862 :a5862 :a5862. +:a5863 :a5863 :a5863. +:a5864 :a5864 :a5864. +:a5865 :a5865 :a5865. +:a5866 :a5866 :a5866. +:a5867 :a5867 :a5867. +:a5868 :a5868 :a5868. +:a5869 :a5869 :a5869. +:a5870 :a5870 :a5870. +:a5871 :a5871 :a5871. +:a5872 :a5872 :a5872. +:a5873 :a5873 :a5873. +:a5874 :a5874 :a5874. +:a5875 :a5875 :a5875. +:a5876 :a5876 :a5876. +:a5877 :a5877 :a5877. +:a5878 :a5878 :a5878. +:a5879 :a5879 :a5879. +:a5880 :a5880 :a5880. +:a5881 :a5881 :a5881. +:a5882 :a5882 :a5882. +:a5883 :a5883 :a5883. +:a5884 :a5884 :a5884. +:a5885 :a5885 :a5885. +:a5886 :a5886 :a5886. +:a5887 :a5887 :a5887. +:a5888 :a5888 :a5888. +:a5889 :a5889 :a5889. +:a5890 :a5890 :a5890. +:a5891 :a5891 :a5891. +:a5892 :a5892 :a5892. +:a5893 :a5893 :a5893. +:a5894 :a5894 :a5894. +:a5895 :a5895 :a5895. +:a5896 :a5896 :a5896. +:a5897 :a5897 :a5897. +:a5898 :a5898 :a5898. +:a5899 :a5899 :a5899. +:a5900 :a5900 :a5900. +:a5901 :a5901 :a5901. +:a5902 :a5902 :a5902. +:a5903 :a5903 :a5903. +:a5904 :a5904 :a5904. +:a5905 :a5905 :a5905. +:a5906 :a5906 :a5906. +:a5907 :a5907 :a5907. +:a5908 :a5908 :a5908. +:a5909 :a5909 :a5909. +:a5910 :a5910 :a5910. +:a5911 :a5911 :a5911. +:a5912 :a5912 :a5912. +:a5913 :a5913 :a5913. +:a5914 :a5914 :a5914. +:a5915 :a5915 :a5915. +:a5916 :a5916 :a5916. +:a5917 :a5917 :a5917. +:a5918 :a5918 :a5918. +:a5919 :a5919 :a5919. +:a5920 :a5920 :a5920. +:a5921 :a5921 :a5921. +:a5922 :a5922 :a5922. +:a5923 :a5923 :a5923. +:a5924 :a5924 :a5924. +:a5925 :a5925 :a5925. +:a5926 :a5926 :a5926. +:a5927 :a5927 :a5927. +:a5928 :a5928 :a5928. +:a5929 :a5929 :a5929. +:a5930 :a5930 :a5930. +:a5931 :a5931 :a5931. +:a5932 :a5932 :a5932. +:a5933 :a5933 :a5933. +:a5934 :a5934 :a5934. +:a5935 :a5935 :a5935. +:a5936 :a5936 :a5936. +:a5937 :a5937 :a5937. +:a5938 :a5938 :a5938. +:a5939 :a5939 :a5939. +:a5940 :a5940 :a5940. +:a5941 :a5941 :a5941. +:a5942 :a5942 :a5942. +:a5943 :a5943 :a5943. +:a5944 :a5944 :a5944. +:a5945 :a5945 :a5945. +:a5946 :a5946 :a5946. +:a5947 :a5947 :a5947. +:a5948 :a5948 :a5948. +:a5949 :a5949 :a5949. +:a5950 :a5950 :a5950. +:a5951 :a5951 :a5951. +:a5952 :a5952 :a5952. +:a5953 :a5953 :a5953. +:a5954 :a5954 :a5954. +:a5955 :a5955 :a5955. +:a5956 :a5956 :a5956. +:a5957 :a5957 :a5957. +:a5958 :a5958 :a5958. +:a5959 :a5959 :a5959. +:a5960 :a5960 :a5960. +:a5961 :a5961 :a5961. +:a5962 :a5962 :a5962. +:a5963 :a5963 :a5963. +:a5964 :a5964 :a5964. +:a5965 :a5965 :a5965. +:a5966 :a5966 :a5966. +:a5967 :a5967 :a5967. +:a5968 :a5968 :a5968. +:a5969 :a5969 :a5969. +:a5970 :a5970 :a5970. +:a5971 :a5971 :a5971. +:a5972 :a5972 :a5972. +:a5973 :a5973 :a5973. +:a5974 :a5974 :a5974. +:a5975 :a5975 :a5975. +:a5976 :a5976 :a5976. +:a5977 :a5977 :a5977. +:a5978 :a5978 :a5978. +:a5979 :a5979 :a5979. +:a5980 :a5980 :a5980. +:a5981 :a5981 :a5981. +:a5982 :a5982 :a5982. +:a5983 :a5983 :a5983. +:a5984 :a5984 :a5984. +:a5985 :a5985 :a5985. +:a5986 :a5986 :a5986. +:a5987 :a5987 :a5987. +:a5988 :a5988 :a5988. +:a5989 :a5989 :a5989. +:a5990 :a5990 :a5990. +:a5991 :a5991 :a5991. +:a5992 :a5992 :a5992. +:a5993 :a5993 :a5993. +:a5994 :a5994 :a5994. +:a5995 :a5995 :a5995. +:a5996 :a5996 :a5996. +:a5997 :a5997 :a5997. +:a5998 :a5998 :a5998. +:a5999 :a5999 :a5999. +:a6000 :a6000 :a6000. +:a6001 :a6001 :a6001. +:a6002 :a6002 :a6002. +:a6003 :a6003 :a6003. +:a6004 :a6004 :a6004. +:a6005 :a6005 :a6005. +:a6006 :a6006 :a6006. +:a6007 :a6007 :a6007. +:a6008 :a6008 :a6008. +:a6009 :a6009 :a6009. +:a6010 :a6010 :a6010. +:a6011 :a6011 :a6011. +:a6012 :a6012 :a6012. +:a6013 :a6013 :a6013. +:a6014 :a6014 :a6014. +:a6015 :a6015 :a6015. +:a6016 :a6016 :a6016. +:a6017 :a6017 :a6017. +:a6018 :a6018 :a6018. +:a6019 :a6019 :a6019. +:a6020 :a6020 :a6020. +:a6021 :a6021 :a6021. +:a6022 :a6022 :a6022. +:a6023 :a6023 :a6023. +:a6024 :a6024 :a6024. +:a6025 :a6025 :a6025. +:a6026 :a6026 :a6026. +:a6027 :a6027 :a6027. +:a6028 :a6028 :a6028. +:a6029 :a6029 :a6029. +:a6030 :a6030 :a6030. +:a6031 :a6031 :a6031. +:a6032 :a6032 :a6032. +:a6033 :a6033 :a6033. +:a6034 :a6034 :a6034. +:a6035 :a6035 :a6035. +:a6036 :a6036 :a6036. +:a6037 :a6037 :a6037. +:a6038 :a6038 :a6038. +:a6039 :a6039 :a6039. +:a6040 :a6040 :a6040. +:a6041 :a6041 :a6041. +:a6042 :a6042 :a6042. +:a6043 :a6043 :a6043. +:a6044 :a6044 :a6044. +:a6045 :a6045 :a6045. +:a6046 :a6046 :a6046. +:a6047 :a6047 :a6047. +:a6048 :a6048 :a6048. +:a6049 :a6049 :a6049. +:a6050 :a6050 :a6050. +:a6051 :a6051 :a6051. +:a6052 :a6052 :a6052. +:a6053 :a6053 :a6053. +:a6054 :a6054 :a6054. +:a6055 :a6055 :a6055. +:a6056 :a6056 :a6056. +:a6057 :a6057 :a6057. +:a6058 :a6058 :a6058. +:a6059 :a6059 :a6059. +:a6060 :a6060 :a6060. +:a6061 :a6061 :a6061. +:a6062 :a6062 :a6062. +:a6063 :a6063 :a6063. +:a6064 :a6064 :a6064. +:a6065 :a6065 :a6065. +:a6066 :a6066 :a6066. +:a6067 :a6067 :a6067. +:a6068 :a6068 :a6068. +:a6069 :a6069 :a6069. +:a6070 :a6070 :a6070. +:a6071 :a6071 :a6071. +:a6072 :a6072 :a6072. +:a6073 :a6073 :a6073. +:a6074 :a6074 :a6074. +:a6075 :a6075 :a6075. +:a6076 :a6076 :a6076. +:a6077 :a6077 :a6077. +:a6078 :a6078 :a6078. +:a6079 :a6079 :a6079. +:a6080 :a6080 :a6080. +:a6081 :a6081 :a6081. +:a6082 :a6082 :a6082. +:a6083 :a6083 :a6083. +:a6084 :a6084 :a6084. +:a6085 :a6085 :a6085. +:a6086 :a6086 :a6086. +:a6087 :a6087 :a6087. +:a6088 :a6088 :a6088. +:a6089 :a6089 :a6089. +:a6090 :a6090 :a6090. +:a6091 :a6091 :a6091. +:a6092 :a6092 :a6092. +:a6093 :a6093 :a6093. +:a6094 :a6094 :a6094. +:a6095 :a6095 :a6095. +:a6096 :a6096 :a6096. +:a6097 :a6097 :a6097. +:a6098 :a6098 :a6098. +:a6099 :a6099 :a6099. +:a6100 :a6100 :a6100. +:a6101 :a6101 :a6101. +:a6102 :a6102 :a6102. +:a6103 :a6103 :a6103. +:a6104 :a6104 :a6104. +:a6105 :a6105 :a6105. +:a6106 :a6106 :a6106. +:a6107 :a6107 :a6107. +:a6108 :a6108 :a6108. +:a6109 :a6109 :a6109. +:a6110 :a6110 :a6110. +:a6111 :a6111 :a6111. +:a6112 :a6112 :a6112. +:a6113 :a6113 :a6113. +:a6114 :a6114 :a6114. +:a6115 :a6115 :a6115. +:a6116 :a6116 :a6116. +:a6117 :a6117 :a6117. +:a6118 :a6118 :a6118. +:a6119 :a6119 :a6119. +:a6120 :a6120 :a6120. +:a6121 :a6121 :a6121. +:a6122 :a6122 :a6122. +:a6123 :a6123 :a6123. +:a6124 :a6124 :a6124. +:a6125 :a6125 :a6125. +:a6126 :a6126 :a6126. +:a6127 :a6127 :a6127. +:a6128 :a6128 :a6128. +:a6129 :a6129 :a6129. +:a6130 :a6130 :a6130. +:a6131 :a6131 :a6131. +:a6132 :a6132 :a6132. +:a6133 :a6133 :a6133. +:a6134 :a6134 :a6134. +:a6135 :a6135 :a6135. +:a6136 :a6136 :a6136. +:a6137 :a6137 :a6137. +:a6138 :a6138 :a6138. +:a6139 :a6139 :a6139. +:a6140 :a6140 :a6140. +:a6141 :a6141 :a6141. +:a6142 :a6142 :a6142. +:a6143 :a6143 :a6143. +:a6144 :a6144 :a6144. +:a6145 :a6145 :a6145. +:a6146 :a6146 :a6146. +:a6147 :a6147 :a6147. +:a6148 :a6148 :a6148. +:a6149 :a6149 :a6149. +:a6150 :a6150 :a6150. +:a6151 :a6151 :a6151. +:a6152 :a6152 :a6152. +:a6153 :a6153 :a6153. +:a6154 :a6154 :a6154. +:a6155 :a6155 :a6155. +:a6156 :a6156 :a6156. +:a6157 :a6157 :a6157. +:a6158 :a6158 :a6158. +:a6159 :a6159 :a6159. +:a6160 :a6160 :a6160. +:a6161 :a6161 :a6161. +:a6162 :a6162 :a6162. +:a6163 :a6163 :a6163. +:a6164 :a6164 :a6164. +:a6165 :a6165 :a6165. +:a6166 :a6166 :a6166. +:a6167 :a6167 :a6167. +:a6168 :a6168 :a6168. +:a6169 :a6169 :a6169. +:a6170 :a6170 :a6170. +:a6171 :a6171 :a6171. +:a6172 :a6172 :a6172. +:a6173 :a6173 :a6173. +:a6174 :a6174 :a6174. +:a6175 :a6175 :a6175. +:a6176 :a6176 :a6176. +:a6177 :a6177 :a6177. +:a6178 :a6178 :a6178. +:a6179 :a6179 :a6179. +:a6180 :a6180 :a6180. +:a6181 :a6181 :a6181. +:a6182 :a6182 :a6182. +:a6183 :a6183 :a6183. +:a6184 :a6184 :a6184. +:a6185 :a6185 :a6185. +:a6186 :a6186 :a6186. +:a6187 :a6187 :a6187. +:a6188 :a6188 :a6188. +:a6189 :a6189 :a6189. +:a6190 :a6190 :a6190. +:a6191 :a6191 :a6191. +:a6192 :a6192 :a6192. +:a6193 :a6193 :a6193. +:a6194 :a6194 :a6194. +:a6195 :a6195 :a6195. +:a6196 :a6196 :a6196. +:a6197 :a6197 :a6197. +:a6198 :a6198 :a6198. +:a6199 :a6199 :a6199. +:a6200 :a6200 :a6200. +:a6201 :a6201 :a6201. +:a6202 :a6202 :a6202. +:a6203 :a6203 :a6203. +:a6204 :a6204 :a6204. +:a6205 :a6205 :a6205. +:a6206 :a6206 :a6206. +:a6207 :a6207 :a6207. +:a6208 :a6208 :a6208. +:a6209 :a6209 :a6209. +:a6210 :a6210 :a6210. +:a6211 :a6211 :a6211. +:a6212 :a6212 :a6212. +:a6213 :a6213 :a6213. +:a6214 :a6214 :a6214. +:a6215 :a6215 :a6215. +:a6216 :a6216 :a6216. +:a6217 :a6217 :a6217. +:a6218 :a6218 :a6218. +:a6219 :a6219 :a6219. +:a6220 :a6220 :a6220. +:a6221 :a6221 :a6221. +:a6222 :a6222 :a6222. +:a6223 :a6223 :a6223. +:a6224 :a6224 :a6224. +:a6225 :a6225 :a6225. +:a6226 :a6226 :a6226. +:a6227 :a6227 :a6227. +:a6228 :a6228 :a6228. +:a6229 :a6229 :a6229. +:a6230 :a6230 :a6230. +:a6231 :a6231 :a6231. +:a6232 :a6232 :a6232. +:a6233 :a6233 :a6233. +:a6234 :a6234 :a6234. +:a6235 :a6235 :a6235. +:a6236 :a6236 :a6236. +:a6237 :a6237 :a6237. +:a6238 :a6238 :a6238. +:a6239 :a6239 :a6239. +:a6240 :a6240 :a6240. +:a6241 :a6241 :a6241. +:a6242 :a6242 :a6242. +:a6243 :a6243 :a6243. +:a6244 :a6244 :a6244. +:a6245 :a6245 :a6245. +:a6246 :a6246 :a6246. +:a6247 :a6247 :a6247. +:a6248 :a6248 :a6248. +:a6249 :a6249 :a6249. +:a6250 :a6250 :a6250. +:a6251 :a6251 :a6251. +:a6252 :a6252 :a6252. +:a6253 :a6253 :a6253. +:a6254 :a6254 :a6254. +:a6255 :a6255 :a6255. +:a6256 :a6256 :a6256. +:a6257 :a6257 :a6257. +:a6258 :a6258 :a6258. +:a6259 :a6259 :a6259. +:a6260 :a6260 :a6260. +:a6261 :a6261 :a6261. +:a6262 :a6262 :a6262. +:a6263 :a6263 :a6263. +:a6264 :a6264 :a6264. +:a6265 :a6265 :a6265. +:a6266 :a6266 :a6266. +:a6267 :a6267 :a6267. +:a6268 :a6268 :a6268. +:a6269 :a6269 :a6269. +:a6270 :a6270 :a6270. +:a6271 :a6271 :a6271. +:a6272 :a6272 :a6272. +:a6273 :a6273 :a6273. +:a6274 :a6274 :a6274. +:a6275 :a6275 :a6275. +:a6276 :a6276 :a6276. +:a6277 :a6277 :a6277. +:a6278 :a6278 :a6278. +:a6279 :a6279 :a6279. +:a6280 :a6280 :a6280. +:a6281 :a6281 :a6281. +:a6282 :a6282 :a6282. +:a6283 :a6283 :a6283. +:a6284 :a6284 :a6284. +:a6285 :a6285 :a6285. +:a6286 :a6286 :a6286. +:a6287 :a6287 :a6287. +:a6288 :a6288 :a6288. +:a6289 :a6289 :a6289. +:a6290 :a6290 :a6290. +:a6291 :a6291 :a6291. +:a6292 :a6292 :a6292. +:a6293 :a6293 :a6293. +:a6294 :a6294 :a6294. +:a6295 :a6295 :a6295. +:a6296 :a6296 :a6296. +:a6297 :a6297 :a6297. +:a6298 :a6298 :a6298. +:a6299 :a6299 :a6299. +:a6300 :a6300 :a6300. +:a6301 :a6301 :a6301. +:a6302 :a6302 :a6302. +:a6303 :a6303 :a6303. +:a6304 :a6304 :a6304. +:a6305 :a6305 :a6305. +:a6306 :a6306 :a6306. +:a6307 :a6307 :a6307. +:a6308 :a6308 :a6308. +:a6309 :a6309 :a6309. +:a6310 :a6310 :a6310. +:a6311 :a6311 :a6311. +:a6312 :a6312 :a6312. +:a6313 :a6313 :a6313. +:a6314 :a6314 :a6314. +:a6315 :a6315 :a6315. +:a6316 :a6316 :a6316. +:a6317 :a6317 :a6317. +:a6318 :a6318 :a6318. +:a6319 :a6319 :a6319. +:a6320 :a6320 :a6320. +:a6321 :a6321 :a6321. +:a6322 :a6322 :a6322. +:a6323 :a6323 :a6323. +:a6324 :a6324 :a6324. +:a6325 :a6325 :a6325. +:a6326 :a6326 :a6326. +:a6327 :a6327 :a6327. +:a6328 :a6328 :a6328. +:a6329 :a6329 :a6329. +:a6330 :a6330 :a6330. +:a6331 :a6331 :a6331. +:a6332 :a6332 :a6332. +:a6333 :a6333 :a6333. +:a6334 :a6334 :a6334. +:a6335 :a6335 :a6335. +:a6336 :a6336 :a6336. +:a6337 :a6337 :a6337. +:a6338 :a6338 :a6338. +:a6339 :a6339 :a6339. +:a6340 :a6340 :a6340. +:a6341 :a6341 :a6341. +:a6342 :a6342 :a6342. +:a6343 :a6343 :a6343. +:a6344 :a6344 :a6344. +:a6345 :a6345 :a6345. +:a6346 :a6346 :a6346. +:a6347 :a6347 :a6347. +:a6348 :a6348 :a6348. +:a6349 :a6349 :a6349. +:a6350 :a6350 :a6350. +:a6351 :a6351 :a6351. +:a6352 :a6352 :a6352. +:a6353 :a6353 :a6353. +:a6354 :a6354 :a6354. +:a6355 :a6355 :a6355. +:a6356 :a6356 :a6356. +:a6357 :a6357 :a6357. +:a6358 :a6358 :a6358. +:a6359 :a6359 :a6359. +:a6360 :a6360 :a6360. +:a6361 :a6361 :a6361. +:a6362 :a6362 :a6362. +:a6363 :a6363 :a6363. +:a6364 :a6364 :a6364. +:a6365 :a6365 :a6365. +:a6366 :a6366 :a6366. +:a6367 :a6367 :a6367. +:a6368 :a6368 :a6368. +:a6369 :a6369 :a6369. +:a6370 :a6370 :a6370. +:a6371 :a6371 :a6371. +:a6372 :a6372 :a6372. +:a6373 :a6373 :a6373. +:a6374 :a6374 :a6374. +:a6375 :a6375 :a6375. +:a6376 :a6376 :a6376. +:a6377 :a6377 :a6377. +:a6378 :a6378 :a6378. +:a6379 :a6379 :a6379. +:a6380 :a6380 :a6380. +:a6381 :a6381 :a6381. +:a6382 :a6382 :a6382. +:a6383 :a6383 :a6383. +:a6384 :a6384 :a6384. +:a6385 :a6385 :a6385. +:a6386 :a6386 :a6386. +:a6387 :a6387 :a6387. +:a6388 :a6388 :a6388. +:a6389 :a6389 :a6389. +:a6390 :a6390 :a6390. +:a6391 :a6391 :a6391. +:a6392 :a6392 :a6392. +:a6393 :a6393 :a6393. +:a6394 :a6394 :a6394. +:a6395 :a6395 :a6395. +:a6396 :a6396 :a6396. +:a6397 :a6397 :a6397. +:a6398 :a6398 :a6398. +:a6399 :a6399 :a6399. +:a6400 :a6400 :a6400. +:a6401 :a6401 :a6401. +:a6402 :a6402 :a6402. +:a6403 :a6403 :a6403. +:a6404 :a6404 :a6404. +:a6405 :a6405 :a6405. +:a6406 :a6406 :a6406. +:a6407 :a6407 :a6407. +:a6408 :a6408 :a6408. +:a6409 :a6409 :a6409. +:a6410 :a6410 :a6410. +:a6411 :a6411 :a6411. +:a6412 :a6412 :a6412. +:a6413 :a6413 :a6413. +:a6414 :a6414 :a6414. +:a6415 :a6415 :a6415. +:a6416 :a6416 :a6416. +:a6417 :a6417 :a6417. +:a6418 :a6418 :a6418. +:a6419 :a6419 :a6419. +:a6420 :a6420 :a6420. +:a6421 :a6421 :a6421. +:a6422 :a6422 :a6422. +:a6423 :a6423 :a6423. +:a6424 :a6424 :a6424. +:a6425 :a6425 :a6425. +:a6426 :a6426 :a6426. +:a6427 :a6427 :a6427. +:a6428 :a6428 :a6428. +:a6429 :a6429 :a6429. +:a6430 :a6430 :a6430. +:a6431 :a6431 :a6431. +:a6432 :a6432 :a6432. +:a6433 :a6433 :a6433. +:a6434 :a6434 :a6434. +:a6435 :a6435 :a6435. +:a6436 :a6436 :a6436. +:a6437 :a6437 :a6437. +:a6438 :a6438 :a6438. +:a6439 :a6439 :a6439. +:a6440 :a6440 :a6440. +:a6441 :a6441 :a6441. +:a6442 :a6442 :a6442. +:a6443 :a6443 :a6443. +:a6444 :a6444 :a6444. +:a6445 :a6445 :a6445. +:a6446 :a6446 :a6446. +:a6447 :a6447 :a6447. +:a6448 :a6448 :a6448. +:a6449 :a6449 :a6449. +:a6450 :a6450 :a6450. +:a6451 :a6451 :a6451. +:a6452 :a6452 :a6452. +:a6453 :a6453 :a6453. +:a6454 :a6454 :a6454. +:a6455 :a6455 :a6455. +:a6456 :a6456 :a6456. +:a6457 :a6457 :a6457. +:a6458 :a6458 :a6458. +:a6459 :a6459 :a6459. +:a6460 :a6460 :a6460. +:a6461 :a6461 :a6461. +:a6462 :a6462 :a6462. +:a6463 :a6463 :a6463. +:a6464 :a6464 :a6464. +:a6465 :a6465 :a6465. +:a6466 :a6466 :a6466. +:a6467 :a6467 :a6467. +:a6468 :a6468 :a6468. +:a6469 :a6469 :a6469. +:a6470 :a6470 :a6470. +:a6471 :a6471 :a6471. +:a6472 :a6472 :a6472. +:a6473 :a6473 :a6473. +:a6474 :a6474 :a6474. +:a6475 :a6475 :a6475. +:a6476 :a6476 :a6476. +:a6477 :a6477 :a6477. +:a6478 :a6478 :a6478. +:a6479 :a6479 :a6479. +:a6480 :a6480 :a6480. +:a6481 :a6481 :a6481. +:a6482 :a6482 :a6482. +:a6483 :a6483 :a6483. +:a6484 :a6484 :a6484. +:a6485 :a6485 :a6485. +:a6486 :a6486 :a6486. +:a6487 :a6487 :a6487. +:a6488 :a6488 :a6488. +:a6489 :a6489 :a6489. +:a6490 :a6490 :a6490. +:a6491 :a6491 :a6491. +:a6492 :a6492 :a6492. +:a6493 :a6493 :a6493. +:a6494 :a6494 :a6494. +:a6495 :a6495 :a6495. +:a6496 :a6496 :a6496. +:a6497 :a6497 :a6497. +:a6498 :a6498 :a6498. +:a6499 :a6499 :a6499. +:a6500 :a6500 :a6500. +:a6501 :a6501 :a6501. +:a6502 :a6502 :a6502. +:a6503 :a6503 :a6503. +:a6504 :a6504 :a6504. +:a6505 :a6505 :a6505. +:a6506 :a6506 :a6506. +:a6507 :a6507 :a6507. +:a6508 :a6508 :a6508. +:a6509 :a6509 :a6509. +:a6510 :a6510 :a6510. +:a6511 :a6511 :a6511. +:a6512 :a6512 :a6512. +:a6513 :a6513 :a6513. +:a6514 :a6514 :a6514. +:a6515 :a6515 :a6515. +:a6516 :a6516 :a6516. +:a6517 :a6517 :a6517. +:a6518 :a6518 :a6518. +:a6519 :a6519 :a6519. +:a6520 :a6520 :a6520. +:a6521 :a6521 :a6521. +:a6522 :a6522 :a6522. +:a6523 :a6523 :a6523. +:a6524 :a6524 :a6524. +:a6525 :a6525 :a6525. +:a6526 :a6526 :a6526. +:a6527 :a6527 :a6527. +:a6528 :a6528 :a6528. +:a6529 :a6529 :a6529. +:a6530 :a6530 :a6530. +:a6531 :a6531 :a6531. +:a6532 :a6532 :a6532. +:a6533 :a6533 :a6533. +:a6534 :a6534 :a6534. +:a6535 :a6535 :a6535. +:a6536 :a6536 :a6536. +:a6537 :a6537 :a6537. +:a6538 :a6538 :a6538. +:a6539 :a6539 :a6539. +:a6540 :a6540 :a6540. +:a6541 :a6541 :a6541. +:a6542 :a6542 :a6542. +:a6543 :a6543 :a6543. +:a6544 :a6544 :a6544. +:a6545 :a6545 :a6545. +:a6546 :a6546 :a6546. +:a6547 :a6547 :a6547. +:a6548 :a6548 :a6548. +:a6549 :a6549 :a6549. +:a6550 :a6550 :a6550. +:a6551 :a6551 :a6551. +:a6552 :a6552 :a6552. +:a6553 :a6553 :a6553. +:a6554 :a6554 :a6554. +:a6555 :a6555 :a6555. +:a6556 :a6556 :a6556. +:a6557 :a6557 :a6557. +:a6558 :a6558 :a6558. +:a6559 :a6559 :a6559. +:a6560 :a6560 :a6560. +:a6561 :a6561 :a6561. +:a6562 :a6562 :a6562. +:a6563 :a6563 :a6563. +:a6564 :a6564 :a6564. +:a6565 :a6565 :a6565. +:a6566 :a6566 :a6566. +:a6567 :a6567 :a6567. +:a6568 :a6568 :a6568. +:a6569 :a6569 :a6569. +:a6570 :a6570 :a6570. +:a6571 :a6571 :a6571. +:a6572 :a6572 :a6572. +:a6573 :a6573 :a6573. +:a6574 :a6574 :a6574. +:a6575 :a6575 :a6575. +:a6576 :a6576 :a6576. +:a6577 :a6577 :a6577. +:a6578 :a6578 :a6578. +:a6579 :a6579 :a6579. +:a6580 :a6580 :a6580. +:a6581 :a6581 :a6581. +:a6582 :a6582 :a6582. +:a6583 :a6583 :a6583. +:a6584 :a6584 :a6584. +:a6585 :a6585 :a6585. +:a6586 :a6586 :a6586. +:a6587 :a6587 :a6587. +:a6588 :a6588 :a6588. +:a6589 :a6589 :a6589. +:a6590 :a6590 :a6590. +:a6591 :a6591 :a6591. +:a6592 :a6592 :a6592. +:a6593 :a6593 :a6593. +:a6594 :a6594 :a6594. +:a6595 :a6595 :a6595. +:a6596 :a6596 :a6596. +:a6597 :a6597 :a6597. +:a6598 :a6598 :a6598. +:a6599 :a6599 :a6599. +:a6600 :a6600 :a6600. +:a6601 :a6601 :a6601. +:a6602 :a6602 :a6602. +:a6603 :a6603 :a6603. +:a6604 :a6604 :a6604. +:a6605 :a6605 :a6605. +:a6606 :a6606 :a6606. +:a6607 :a6607 :a6607. +:a6608 :a6608 :a6608. +:a6609 :a6609 :a6609. +:a6610 :a6610 :a6610. +:a6611 :a6611 :a6611. +:a6612 :a6612 :a6612. +:a6613 :a6613 :a6613. +:a6614 :a6614 :a6614. +:a6615 :a6615 :a6615. +:a6616 :a6616 :a6616. +:a6617 :a6617 :a6617. +:a6618 :a6618 :a6618. +:a6619 :a6619 :a6619. +:a6620 :a6620 :a6620. +:a6621 :a6621 :a6621. +:a6622 :a6622 :a6622. +:a6623 :a6623 :a6623. +:a6624 :a6624 :a6624. +:a6625 :a6625 :a6625. +:a6626 :a6626 :a6626. +:a6627 :a6627 :a6627. +:a6628 :a6628 :a6628. +:a6629 :a6629 :a6629. +:a6630 :a6630 :a6630. +:a6631 :a6631 :a6631. +:a6632 :a6632 :a6632. +:a6633 :a6633 :a6633. +:a6634 :a6634 :a6634. +:a6635 :a6635 :a6635. +:a6636 :a6636 :a6636. +:a6637 :a6637 :a6637. +:a6638 :a6638 :a6638. +:a6639 :a6639 :a6639. +:a6640 :a6640 :a6640. +:a6641 :a6641 :a6641. +:a6642 :a6642 :a6642. +:a6643 :a6643 :a6643. +:a6644 :a6644 :a6644. +:a6645 :a6645 :a6645. +:a6646 :a6646 :a6646. +:a6647 :a6647 :a6647. +:a6648 :a6648 :a6648. +:a6649 :a6649 :a6649. +:a6650 :a6650 :a6650. +:a6651 :a6651 :a6651. +:a6652 :a6652 :a6652. +:a6653 :a6653 :a6653. +:a6654 :a6654 :a6654. +:a6655 :a6655 :a6655. +:a6656 :a6656 :a6656. +:a6657 :a6657 :a6657. +:a6658 :a6658 :a6658. +:a6659 :a6659 :a6659. +:a6660 :a6660 :a6660. +:a6661 :a6661 :a6661. +:a6662 :a6662 :a6662. +:a6663 :a6663 :a6663. +:a6664 :a6664 :a6664. +:a6665 :a6665 :a6665. +:a6666 :a6666 :a6666. +:a6667 :a6667 :a6667. +:a6668 :a6668 :a6668. +:a6669 :a6669 :a6669. +:a6670 :a6670 :a6670. +:a6671 :a6671 :a6671. +:a6672 :a6672 :a6672. +:a6673 :a6673 :a6673. +:a6674 :a6674 :a6674. +:a6675 :a6675 :a6675. +:a6676 :a6676 :a6676. +:a6677 :a6677 :a6677. +:a6678 :a6678 :a6678. +:a6679 :a6679 :a6679. +:a6680 :a6680 :a6680. +:a6681 :a6681 :a6681. +:a6682 :a6682 :a6682. +:a6683 :a6683 :a6683. +:a6684 :a6684 :a6684. +:a6685 :a6685 :a6685. +:a6686 :a6686 :a6686. +:a6687 :a6687 :a6687. +:a6688 :a6688 :a6688. +:a6689 :a6689 :a6689. +:a6690 :a6690 :a6690. +:a6691 :a6691 :a6691. +:a6692 :a6692 :a6692. +:a6693 :a6693 :a6693. +:a6694 :a6694 :a6694. +:a6695 :a6695 :a6695. +:a6696 :a6696 :a6696. +:a6697 :a6697 :a6697. +:a6698 :a6698 :a6698. +:a6699 :a6699 :a6699. +:a6700 :a6700 :a6700. +:a6701 :a6701 :a6701. +:a6702 :a6702 :a6702. +:a6703 :a6703 :a6703. +:a6704 :a6704 :a6704. +:a6705 :a6705 :a6705. +:a6706 :a6706 :a6706. +:a6707 :a6707 :a6707. +:a6708 :a6708 :a6708. +:a6709 :a6709 :a6709. +:a6710 :a6710 :a6710. +:a6711 :a6711 :a6711. +:a6712 :a6712 :a6712. +:a6713 :a6713 :a6713. +:a6714 :a6714 :a6714. +:a6715 :a6715 :a6715. +:a6716 :a6716 :a6716. +:a6717 :a6717 :a6717. +:a6718 :a6718 :a6718. +:a6719 :a6719 :a6719. +:a6720 :a6720 :a6720. +:a6721 :a6721 :a6721. +:a6722 :a6722 :a6722. +:a6723 :a6723 :a6723. +:a6724 :a6724 :a6724. +:a6725 :a6725 :a6725. +:a6726 :a6726 :a6726. +:a6727 :a6727 :a6727. +:a6728 :a6728 :a6728. +:a6729 :a6729 :a6729. +:a6730 :a6730 :a6730. +:a6731 :a6731 :a6731. +:a6732 :a6732 :a6732. +:a6733 :a6733 :a6733. +:a6734 :a6734 :a6734. +:a6735 :a6735 :a6735. +:a6736 :a6736 :a6736. +:a6737 :a6737 :a6737. +:a6738 :a6738 :a6738. +:a6739 :a6739 :a6739. +:a6740 :a6740 :a6740. +:a6741 :a6741 :a6741. +:a6742 :a6742 :a6742. +:a6743 :a6743 :a6743. +:a6744 :a6744 :a6744. +:a6745 :a6745 :a6745. +:a6746 :a6746 :a6746. +:a6747 :a6747 :a6747. +:a6748 :a6748 :a6748. +:a6749 :a6749 :a6749. +:a6750 :a6750 :a6750. +:a6751 :a6751 :a6751. +:a6752 :a6752 :a6752. +:a6753 :a6753 :a6753. +:a6754 :a6754 :a6754. +:a6755 :a6755 :a6755. +:a6756 :a6756 :a6756. +:a6757 :a6757 :a6757. +:a6758 :a6758 :a6758. +:a6759 :a6759 :a6759. +:a6760 :a6760 :a6760. +:a6761 :a6761 :a6761. +:a6762 :a6762 :a6762. +:a6763 :a6763 :a6763. +:a6764 :a6764 :a6764. +:a6765 :a6765 :a6765. +:a6766 :a6766 :a6766. +:a6767 :a6767 :a6767. +:a6768 :a6768 :a6768. +:a6769 :a6769 :a6769. +:a6770 :a6770 :a6770. +:a6771 :a6771 :a6771. +:a6772 :a6772 :a6772. +:a6773 :a6773 :a6773. +:a6774 :a6774 :a6774. +:a6775 :a6775 :a6775. +:a6776 :a6776 :a6776. +:a6777 :a6777 :a6777. +:a6778 :a6778 :a6778. +:a6779 :a6779 :a6779. +:a6780 :a6780 :a6780. +:a6781 :a6781 :a6781. +:a6782 :a6782 :a6782. +:a6783 :a6783 :a6783. +:a6784 :a6784 :a6784. +:a6785 :a6785 :a6785. +:a6786 :a6786 :a6786. +:a6787 :a6787 :a6787. +:a6788 :a6788 :a6788. +:a6789 :a6789 :a6789. +:a6790 :a6790 :a6790. +:a6791 :a6791 :a6791. +:a6792 :a6792 :a6792. +:a6793 :a6793 :a6793. +:a6794 :a6794 :a6794. +:a6795 :a6795 :a6795. +:a6796 :a6796 :a6796. +:a6797 :a6797 :a6797. +:a6798 :a6798 :a6798. +:a6799 :a6799 :a6799. +:a6800 :a6800 :a6800. +:a6801 :a6801 :a6801. +:a6802 :a6802 :a6802. +:a6803 :a6803 :a6803. +:a6804 :a6804 :a6804. +:a6805 :a6805 :a6805. +:a6806 :a6806 :a6806. +:a6807 :a6807 :a6807. +:a6808 :a6808 :a6808. +:a6809 :a6809 :a6809. +:a6810 :a6810 :a6810. +:a6811 :a6811 :a6811. +:a6812 :a6812 :a6812. +:a6813 :a6813 :a6813. +:a6814 :a6814 :a6814. +:a6815 :a6815 :a6815. +:a6816 :a6816 :a6816. +:a6817 :a6817 :a6817. +:a6818 :a6818 :a6818. +:a6819 :a6819 :a6819. +:a6820 :a6820 :a6820. +:a6821 :a6821 :a6821. +:a6822 :a6822 :a6822. +:a6823 :a6823 :a6823. +:a6824 :a6824 :a6824. +:a6825 :a6825 :a6825. +:a6826 :a6826 :a6826. +:a6827 :a6827 :a6827. +:a6828 :a6828 :a6828. +:a6829 :a6829 :a6829. +:a6830 :a6830 :a6830. +:a6831 :a6831 :a6831. +:a6832 :a6832 :a6832. +:a6833 :a6833 :a6833. +:a6834 :a6834 :a6834. +:a6835 :a6835 :a6835. +:a6836 :a6836 :a6836. +:a6837 :a6837 :a6837. +:a6838 :a6838 :a6838. +:a6839 :a6839 :a6839. +:a6840 :a6840 :a6840. +:a6841 :a6841 :a6841. +:a6842 :a6842 :a6842. +:a6843 :a6843 :a6843. +:a6844 :a6844 :a6844. +:a6845 :a6845 :a6845. +:a6846 :a6846 :a6846. +:a6847 :a6847 :a6847. +:a6848 :a6848 :a6848. +:a6849 :a6849 :a6849. +:a6850 :a6850 :a6850. +:a6851 :a6851 :a6851. +:a6852 :a6852 :a6852. +:a6853 :a6853 :a6853. +:a6854 :a6854 :a6854. +:a6855 :a6855 :a6855. +:a6856 :a6856 :a6856. +:a6857 :a6857 :a6857. +:a6858 :a6858 :a6858. +:a6859 :a6859 :a6859. +:a6860 :a6860 :a6860. +:a6861 :a6861 :a6861. +:a6862 :a6862 :a6862. +:a6863 :a6863 :a6863. +:a6864 :a6864 :a6864. +:a6865 :a6865 :a6865. +:a6866 :a6866 :a6866. +:a6867 :a6867 :a6867. +:a6868 :a6868 :a6868. +:a6869 :a6869 :a6869. +:a6870 :a6870 :a6870. +:a6871 :a6871 :a6871. +:a6872 :a6872 :a6872. +:a6873 :a6873 :a6873. +:a6874 :a6874 :a6874. +:a6875 :a6875 :a6875. +:a6876 :a6876 :a6876. +:a6877 :a6877 :a6877. +:a6878 :a6878 :a6878. +:a6879 :a6879 :a6879. +:a6880 :a6880 :a6880. +:a6881 :a6881 :a6881. +:a6882 :a6882 :a6882. +:a6883 :a6883 :a6883. +:a6884 :a6884 :a6884. +:a6885 :a6885 :a6885. +:a6886 :a6886 :a6886. +:a6887 :a6887 :a6887. +:a6888 :a6888 :a6888. +:a6889 :a6889 :a6889. +:a6890 :a6890 :a6890. +:a6891 :a6891 :a6891. +:a6892 :a6892 :a6892. +:a6893 :a6893 :a6893. +:a6894 :a6894 :a6894. +:a6895 :a6895 :a6895. +:a6896 :a6896 :a6896. +:a6897 :a6897 :a6897. +:a6898 :a6898 :a6898. +:a6899 :a6899 :a6899. +:a6900 :a6900 :a6900. +:a6901 :a6901 :a6901. +:a6902 :a6902 :a6902. +:a6903 :a6903 :a6903. +:a6904 :a6904 :a6904. +:a6905 :a6905 :a6905. +:a6906 :a6906 :a6906. +:a6907 :a6907 :a6907. +:a6908 :a6908 :a6908. +:a6909 :a6909 :a6909. +:a6910 :a6910 :a6910. +:a6911 :a6911 :a6911. +:a6912 :a6912 :a6912. +:a6913 :a6913 :a6913. +:a6914 :a6914 :a6914. +:a6915 :a6915 :a6915. +:a6916 :a6916 :a6916. +:a6917 :a6917 :a6917. +:a6918 :a6918 :a6918. +:a6919 :a6919 :a6919. +:a6920 :a6920 :a6920. +:a6921 :a6921 :a6921. +:a6922 :a6922 :a6922. +:a6923 :a6923 :a6923. +:a6924 :a6924 :a6924. +:a6925 :a6925 :a6925. +:a6926 :a6926 :a6926. +:a6927 :a6927 :a6927. +:a6928 :a6928 :a6928. +:a6929 :a6929 :a6929. +:a6930 :a6930 :a6930. +:a6931 :a6931 :a6931. +:a6932 :a6932 :a6932. +:a6933 :a6933 :a6933. +:a6934 :a6934 :a6934. +:a6935 :a6935 :a6935. +:a6936 :a6936 :a6936. +:a6937 :a6937 :a6937. +:a6938 :a6938 :a6938. +:a6939 :a6939 :a6939. +:a6940 :a6940 :a6940. +:a6941 :a6941 :a6941. +:a6942 :a6942 :a6942. +:a6943 :a6943 :a6943. +:a6944 :a6944 :a6944. +:a6945 :a6945 :a6945. +:a6946 :a6946 :a6946. +:a6947 :a6947 :a6947. +:a6948 :a6948 :a6948. +:a6949 :a6949 :a6949. +:a6950 :a6950 :a6950. +:a6951 :a6951 :a6951. +:a6952 :a6952 :a6952. +:a6953 :a6953 :a6953. +:a6954 :a6954 :a6954. +:a6955 :a6955 :a6955. +:a6956 :a6956 :a6956. +:a6957 :a6957 :a6957. +:a6958 :a6958 :a6958. +:a6959 :a6959 :a6959. +:a6960 :a6960 :a6960. +:a6961 :a6961 :a6961. +:a6962 :a6962 :a6962. +:a6963 :a6963 :a6963. +:a6964 :a6964 :a6964. +:a6965 :a6965 :a6965. +:a6966 :a6966 :a6966. +:a6967 :a6967 :a6967. +:a6968 :a6968 :a6968. +:a6969 :a6969 :a6969. +:a6970 :a6970 :a6970. +:a6971 :a6971 :a6971. +:a6972 :a6972 :a6972. +:a6973 :a6973 :a6973. +:a6974 :a6974 :a6974. +:a6975 :a6975 :a6975. +:a6976 :a6976 :a6976. +:a6977 :a6977 :a6977. +:a6978 :a6978 :a6978. +:a6979 :a6979 :a6979. +:a6980 :a6980 :a6980. +:a6981 :a6981 :a6981. +:a6982 :a6982 :a6982. +:a6983 :a6983 :a6983. +:a6984 :a6984 :a6984. +:a6985 :a6985 :a6985. +:a6986 :a6986 :a6986. +:a6987 :a6987 :a6987. +:a6988 :a6988 :a6988. +:a6989 :a6989 :a6989. +:a6990 :a6990 :a6990. +:a6991 :a6991 :a6991. +:a6992 :a6992 :a6992. +:a6993 :a6993 :a6993. +:a6994 :a6994 :a6994. +:a6995 :a6995 :a6995. +:a6996 :a6996 :a6996. +:a6997 :a6997 :a6997. +:a6998 :a6998 :a6998. +:a6999 :a6999 :a6999. +:a7000 :a7000 :a7000. +:a7001 :a7001 :a7001. +:a7002 :a7002 :a7002. +:a7003 :a7003 :a7003. +:a7004 :a7004 :a7004. +:a7005 :a7005 :a7005. +:a7006 :a7006 :a7006. +:a7007 :a7007 :a7007. +:a7008 :a7008 :a7008. +:a7009 :a7009 :a7009. +:a7010 :a7010 :a7010. +:a7011 :a7011 :a7011. +:a7012 :a7012 :a7012. +:a7013 :a7013 :a7013. +:a7014 :a7014 :a7014. +:a7015 :a7015 :a7015. +:a7016 :a7016 :a7016. +:a7017 :a7017 :a7017. +:a7018 :a7018 :a7018. +:a7019 :a7019 :a7019. +:a7020 :a7020 :a7020. +:a7021 :a7021 :a7021. +:a7022 :a7022 :a7022. +:a7023 :a7023 :a7023. +:a7024 :a7024 :a7024. +:a7025 :a7025 :a7025. +:a7026 :a7026 :a7026. +:a7027 :a7027 :a7027. +:a7028 :a7028 :a7028. +:a7029 :a7029 :a7029. +:a7030 :a7030 :a7030. +:a7031 :a7031 :a7031. +:a7032 :a7032 :a7032. +:a7033 :a7033 :a7033. +:a7034 :a7034 :a7034. +:a7035 :a7035 :a7035. +:a7036 :a7036 :a7036. +:a7037 :a7037 :a7037. +:a7038 :a7038 :a7038. +:a7039 :a7039 :a7039. +:a7040 :a7040 :a7040. +:a7041 :a7041 :a7041. +:a7042 :a7042 :a7042. +:a7043 :a7043 :a7043. +:a7044 :a7044 :a7044. +:a7045 :a7045 :a7045. +:a7046 :a7046 :a7046. +:a7047 :a7047 :a7047. +:a7048 :a7048 :a7048. +:a7049 :a7049 :a7049. +:a7050 :a7050 :a7050. +:a7051 :a7051 :a7051. +:a7052 :a7052 :a7052. +:a7053 :a7053 :a7053. +:a7054 :a7054 :a7054. +:a7055 :a7055 :a7055. +:a7056 :a7056 :a7056. +:a7057 :a7057 :a7057. +:a7058 :a7058 :a7058. +:a7059 :a7059 :a7059. +:a7060 :a7060 :a7060. +:a7061 :a7061 :a7061. +:a7062 :a7062 :a7062. +:a7063 :a7063 :a7063. +:a7064 :a7064 :a7064. +:a7065 :a7065 :a7065. +:a7066 :a7066 :a7066. +:a7067 :a7067 :a7067. +:a7068 :a7068 :a7068. +:a7069 :a7069 :a7069. +:a7070 :a7070 :a7070. +:a7071 :a7071 :a7071. +:a7072 :a7072 :a7072. +:a7073 :a7073 :a7073. +:a7074 :a7074 :a7074. +:a7075 :a7075 :a7075. +:a7076 :a7076 :a7076. +:a7077 :a7077 :a7077. +:a7078 :a7078 :a7078. +:a7079 :a7079 :a7079. +:a7080 :a7080 :a7080. +:a7081 :a7081 :a7081. +:a7082 :a7082 :a7082. +:a7083 :a7083 :a7083. +:a7084 :a7084 :a7084. +:a7085 :a7085 :a7085. +:a7086 :a7086 :a7086. +:a7087 :a7087 :a7087. +:a7088 :a7088 :a7088. +:a7089 :a7089 :a7089. +:a7090 :a7090 :a7090. +:a7091 :a7091 :a7091. +:a7092 :a7092 :a7092. +:a7093 :a7093 :a7093. +:a7094 :a7094 :a7094. +:a7095 :a7095 :a7095. +:a7096 :a7096 :a7096. +:a7097 :a7097 :a7097. +:a7098 :a7098 :a7098. +:a7099 :a7099 :a7099. +:a7100 :a7100 :a7100. +:a7101 :a7101 :a7101. +:a7102 :a7102 :a7102. +:a7103 :a7103 :a7103. +:a7104 :a7104 :a7104. +:a7105 :a7105 :a7105. +:a7106 :a7106 :a7106. +:a7107 :a7107 :a7107. +:a7108 :a7108 :a7108. +:a7109 :a7109 :a7109. +:a7110 :a7110 :a7110. +:a7111 :a7111 :a7111. +:a7112 :a7112 :a7112. +:a7113 :a7113 :a7113. +:a7114 :a7114 :a7114. +:a7115 :a7115 :a7115. +:a7116 :a7116 :a7116. +:a7117 :a7117 :a7117. +:a7118 :a7118 :a7118. +:a7119 :a7119 :a7119. +:a7120 :a7120 :a7120. +:a7121 :a7121 :a7121. +:a7122 :a7122 :a7122. +:a7123 :a7123 :a7123. +:a7124 :a7124 :a7124. +:a7125 :a7125 :a7125. +:a7126 :a7126 :a7126. +:a7127 :a7127 :a7127. +:a7128 :a7128 :a7128. +:a7129 :a7129 :a7129. +:a7130 :a7130 :a7130. +:a7131 :a7131 :a7131. +:a7132 :a7132 :a7132. +:a7133 :a7133 :a7133. +:a7134 :a7134 :a7134. +:a7135 :a7135 :a7135. +:a7136 :a7136 :a7136. +:a7137 :a7137 :a7137. +:a7138 :a7138 :a7138. +:a7139 :a7139 :a7139. +:a7140 :a7140 :a7140. +:a7141 :a7141 :a7141. +:a7142 :a7142 :a7142. +:a7143 :a7143 :a7143. +:a7144 :a7144 :a7144. +:a7145 :a7145 :a7145. +:a7146 :a7146 :a7146. +:a7147 :a7147 :a7147. +:a7148 :a7148 :a7148. +:a7149 :a7149 :a7149. +:a7150 :a7150 :a7150. +:a7151 :a7151 :a7151. +:a7152 :a7152 :a7152. +:a7153 :a7153 :a7153. +:a7154 :a7154 :a7154. +:a7155 :a7155 :a7155. +:a7156 :a7156 :a7156. +:a7157 :a7157 :a7157. +:a7158 :a7158 :a7158. +:a7159 :a7159 :a7159. +:a7160 :a7160 :a7160. +:a7161 :a7161 :a7161. +:a7162 :a7162 :a7162. +:a7163 :a7163 :a7163. +:a7164 :a7164 :a7164. +:a7165 :a7165 :a7165. +:a7166 :a7166 :a7166. +:a7167 :a7167 :a7167. +:a7168 :a7168 :a7168. +:a7169 :a7169 :a7169. +:a7170 :a7170 :a7170. +:a7171 :a7171 :a7171. +:a7172 :a7172 :a7172. +:a7173 :a7173 :a7173. +:a7174 :a7174 :a7174. +:a7175 :a7175 :a7175. +:a7176 :a7176 :a7176. +:a7177 :a7177 :a7177. +:a7178 :a7178 :a7178. +:a7179 :a7179 :a7179. +:a7180 :a7180 :a7180. +:a7181 :a7181 :a7181. +:a7182 :a7182 :a7182. +:a7183 :a7183 :a7183. +:a7184 :a7184 :a7184. +:a7185 :a7185 :a7185. +:a7186 :a7186 :a7186. +:a7187 :a7187 :a7187. +:a7188 :a7188 :a7188. +:a7189 :a7189 :a7189. +:a7190 :a7190 :a7190. +:a7191 :a7191 :a7191. +:a7192 :a7192 :a7192. +:a7193 :a7193 :a7193. +:a7194 :a7194 :a7194. +:a7195 :a7195 :a7195. +:a7196 :a7196 :a7196. +:a7197 :a7197 :a7197. +:a7198 :a7198 :a7198. +:a7199 :a7199 :a7199. +:a7200 :a7200 :a7200. +:a7201 :a7201 :a7201. +:a7202 :a7202 :a7202. +:a7203 :a7203 :a7203. +:a7204 :a7204 :a7204. +:a7205 :a7205 :a7205. +:a7206 :a7206 :a7206. +:a7207 :a7207 :a7207. +:a7208 :a7208 :a7208. +:a7209 :a7209 :a7209. +:a7210 :a7210 :a7210. +:a7211 :a7211 :a7211. +:a7212 :a7212 :a7212. +:a7213 :a7213 :a7213. +:a7214 :a7214 :a7214. +:a7215 :a7215 :a7215. +:a7216 :a7216 :a7216. +:a7217 :a7217 :a7217. +:a7218 :a7218 :a7218. +:a7219 :a7219 :a7219. +:a7220 :a7220 :a7220. +:a7221 :a7221 :a7221. +:a7222 :a7222 :a7222. +:a7223 :a7223 :a7223. +:a7224 :a7224 :a7224. +:a7225 :a7225 :a7225. +:a7226 :a7226 :a7226. +:a7227 :a7227 :a7227. +:a7228 :a7228 :a7228. +:a7229 :a7229 :a7229. +:a7230 :a7230 :a7230. +:a7231 :a7231 :a7231. +:a7232 :a7232 :a7232. +:a7233 :a7233 :a7233. +:a7234 :a7234 :a7234. +:a7235 :a7235 :a7235. +:a7236 :a7236 :a7236. +:a7237 :a7237 :a7237. +:a7238 :a7238 :a7238. +:a7239 :a7239 :a7239. +:a7240 :a7240 :a7240. +:a7241 :a7241 :a7241. +:a7242 :a7242 :a7242. +:a7243 :a7243 :a7243. +:a7244 :a7244 :a7244. +:a7245 :a7245 :a7245. +:a7246 :a7246 :a7246. +:a7247 :a7247 :a7247. +:a7248 :a7248 :a7248. +:a7249 :a7249 :a7249. +:a7250 :a7250 :a7250. +:a7251 :a7251 :a7251. +:a7252 :a7252 :a7252. +:a7253 :a7253 :a7253. +:a7254 :a7254 :a7254. +:a7255 :a7255 :a7255. +:a7256 :a7256 :a7256. +:a7257 :a7257 :a7257. +:a7258 :a7258 :a7258. +:a7259 :a7259 :a7259. +:a7260 :a7260 :a7260. +:a7261 :a7261 :a7261. +:a7262 :a7262 :a7262. +:a7263 :a7263 :a7263. +:a7264 :a7264 :a7264. +:a7265 :a7265 :a7265. +:a7266 :a7266 :a7266. +:a7267 :a7267 :a7267. +:a7268 :a7268 :a7268. +:a7269 :a7269 :a7269. +:a7270 :a7270 :a7270. +:a7271 :a7271 :a7271. +:a7272 :a7272 :a7272. +:a7273 :a7273 :a7273. +:a7274 :a7274 :a7274. +:a7275 :a7275 :a7275. +:a7276 :a7276 :a7276. +:a7277 :a7277 :a7277. +:a7278 :a7278 :a7278. +:a7279 :a7279 :a7279. +:a7280 :a7280 :a7280. +:a7281 :a7281 :a7281. +:a7282 :a7282 :a7282. +:a7283 :a7283 :a7283. +:a7284 :a7284 :a7284. +:a7285 :a7285 :a7285. +:a7286 :a7286 :a7286. +:a7287 :a7287 :a7287. +:a7288 :a7288 :a7288. +:a7289 :a7289 :a7289. +:a7290 :a7290 :a7290. +:a7291 :a7291 :a7291. +:a7292 :a7292 :a7292. +:a7293 :a7293 :a7293. +:a7294 :a7294 :a7294. +:a7295 :a7295 :a7295. +:a7296 :a7296 :a7296. +:a7297 :a7297 :a7297. +:a7298 :a7298 :a7298. +:a7299 :a7299 :a7299. +:a7300 :a7300 :a7300. +:a7301 :a7301 :a7301. +:a7302 :a7302 :a7302. +:a7303 :a7303 :a7303. +:a7304 :a7304 :a7304. +:a7305 :a7305 :a7305. +:a7306 :a7306 :a7306. +:a7307 :a7307 :a7307. +:a7308 :a7308 :a7308. +:a7309 :a7309 :a7309. +:a7310 :a7310 :a7310. +:a7311 :a7311 :a7311. +:a7312 :a7312 :a7312. +:a7313 :a7313 :a7313. +:a7314 :a7314 :a7314. +:a7315 :a7315 :a7315. +:a7316 :a7316 :a7316. +:a7317 :a7317 :a7317. +:a7318 :a7318 :a7318. +:a7319 :a7319 :a7319. +:a7320 :a7320 :a7320. +:a7321 :a7321 :a7321. +:a7322 :a7322 :a7322. +:a7323 :a7323 :a7323. +:a7324 :a7324 :a7324. +:a7325 :a7325 :a7325. +:a7326 :a7326 :a7326. +:a7327 :a7327 :a7327. +:a7328 :a7328 :a7328. +:a7329 :a7329 :a7329. +:a7330 :a7330 :a7330. +:a7331 :a7331 :a7331. +:a7332 :a7332 :a7332. +:a7333 :a7333 :a7333. +:a7334 :a7334 :a7334. +:a7335 :a7335 :a7335. +:a7336 :a7336 :a7336. +:a7337 :a7337 :a7337. +:a7338 :a7338 :a7338. +:a7339 :a7339 :a7339. +:a7340 :a7340 :a7340. +:a7341 :a7341 :a7341. +:a7342 :a7342 :a7342. +:a7343 :a7343 :a7343. +:a7344 :a7344 :a7344. +:a7345 :a7345 :a7345. +:a7346 :a7346 :a7346. +:a7347 :a7347 :a7347. +:a7348 :a7348 :a7348. +:a7349 :a7349 :a7349. +:a7350 :a7350 :a7350. +:a7351 :a7351 :a7351. +:a7352 :a7352 :a7352. +:a7353 :a7353 :a7353. +:a7354 :a7354 :a7354. +:a7355 :a7355 :a7355. +:a7356 :a7356 :a7356. +:a7357 :a7357 :a7357. +:a7358 :a7358 :a7358. +:a7359 :a7359 :a7359. +:a7360 :a7360 :a7360. +:a7361 :a7361 :a7361. +:a7362 :a7362 :a7362. +:a7363 :a7363 :a7363. +:a7364 :a7364 :a7364. +:a7365 :a7365 :a7365. +:a7366 :a7366 :a7366. +:a7367 :a7367 :a7367. +:a7368 :a7368 :a7368. +:a7369 :a7369 :a7369. +:a7370 :a7370 :a7370. +:a7371 :a7371 :a7371. +:a7372 :a7372 :a7372. +:a7373 :a7373 :a7373. +:a7374 :a7374 :a7374. +:a7375 :a7375 :a7375. +:a7376 :a7376 :a7376. +:a7377 :a7377 :a7377. +:a7378 :a7378 :a7378. +:a7379 :a7379 :a7379. +:a7380 :a7380 :a7380. +:a7381 :a7381 :a7381. +:a7382 :a7382 :a7382. +:a7383 :a7383 :a7383. +:a7384 :a7384 :a7384. +:a7385 :a7385 :a7385. +:a7386 :a7386 :a7386. +:a7387 :a7387 :a7387. +:a7388 :a7388 :a7388. +:a7389 :a7389 :a7389. +:a7390 :a7390 :a7390. +:a7391 :a7391 :a7391. +:a7392 :a7392 :a7392. +:a7393 :a7393 :a7393. +:a7394 :a7394 :a7394. +:a7395 :a7395 :a7395. +:a7396 :a7396 :a7396. +:a7397 :a7397 :a7397. +:a7398 :a7398 :a7398. +:a7399 :a7399 :a7399. +:a7400 :a7400 :a7400. +:a7401 :a7401 :a7401. +:a7402 :a7402 :a7402. +:a7403 :a7403 :a7403. +:a7404 :a7404 :a7404. +:a7405 :a7405 :a7405. +:a7406 :a7406 :a7406. +:a7407 :a7407 :a7407. +:a7408 :a7408 :a7408. +:a7409 :a7409 :a7409. +:a7410 :a7410 :a7410. +:a7411 :a7411 :a7411. +:a7412 :a7412 :a7412. +:a7413 :a7413 :a7413. +:a7414 :a7414 :a7414. +:a7415 :a7415 :a7415. +:a7416 :a7416 :a7416. +:a7417 :a7417 :a7417. +:a7418 :a7418 :a7418. +:a7419 :a7419 :a7419. +:a7420 :a7420 :a7420. +:a7421 :a7421 :a7421. +:a7422 :a7422 :a7422. +:a7423 :a7423 :a7423. +:a7424 :a7424 :a7424. +:a7425 :a7425 :a7425. +:a7426 :a7426 :a7426. +:a7427 :a7427 :a7427. +:a7428 :a7428 :a7428. +:a7429 :a7429 :a7429. +:a7430 :a7430 :a7430. +:a7431 :a7431 :a7431. +:a7432 :a7432 :a7432. +:a7433 :a7433 :a7433. +:a7434 :a7434 :a7434. +:a7435 :a7435 :a7435. +:a7436 :a7436 :a7436. +:a7437 :a7437 :a7437. +:a7438 :a7438 :a7438. +:a7439 :a7439 :a7439. +:a7440 :a7440 :a7440. +:a7441 :a7441 :a7441. +:a7442 :a7442 :a7442. +:a7443 :a7443 :a7443. +:a7444 :a7444 :a7444. +:a7445 :a7445 :a7445. +:a7446 :a7446 :a7446. +:a7447 :a7447 :a7447. +:a7448 :a7448 :a7448. +:a7449 :a7449 :a7449. +:a7450 :a7450 :a7450. +:a7451 :a7451 :a7451. +:a7452 :a7452 :a7452. +:a7453 :a7453 :a7453. +:a7454 :a7454 :a7454. +:a7455 :a7455 :a7455. +:a7456 :a7456 :a7456. +:a7457 :a7457 :a7457. +:a7458 :a7458 :a7458. +:a7459 :a7459 :a7459. +:a7460 :a7460 :a7460. +:a7461 :a7461 :a7461. +:a7462 :a7462 :a7462. +:a7463 :a7463 :a7463. +:a7464 :a7464 :a7464. +:a7465 :a7465 :a7465. +:a7466 :a7466 :a7466. +:a7467 :a7467 :a7467. +:a7468 :a7468 :a7468. +:a7469 :a7469 :a7469. +:a7470 :a7470 :a7470. +:a7471 :a7471 :a7471. +:a7472 :a7472 :a7472. +:a7473 :a7473 :a7473. +:a7474 :a7474 :a7474. +:a7475 :a7475 :a7475. +:a7476 :a7476 :a7476. +:a7477 :a7477 :a7477. +:a7478 :a7478 :a7478. +:a7479 :a7479 :a7479. +:a7480 :a7480 :a7480. +:a7481 :a7481 :a7481. +:a7482 :a7482 :a7482. +:a7483 :a7483 :a7483. +:a7484 :a7484 :a7484. +:a7485 :a7485 :a7485. +:a7486 :a7486 :a7486. +:a7487 :a7487 :a7487. +:a7488 :a7488 :a7488. +:a7489 :a7489 :a7489. +:a7490 :a7490 :a7490. +:a7491 :a7491 :a7491. +:a7492 :a7492 :a7492. +:a7493 :a7493 :a7493. +:a7494 :a7494 :a7494. +:a7495 :a7495 :a7495. +:a7496 :a7496 :a7496. +:a7497 :a7497 :a7497. +:a7498 :a7498 :a7498. +:a7499 :a7499 :a7499. +:a7500 :a7500 :a7500. +:a7501 :a7501 :a7501. +:a7502 :a7502 :a7502. +:a7503 :a7503 :a7503. +:a7504 :a7504 :a7504. +:a7505 :a7505 :a7505. +:a7506 :a7506 :a7506. +:a7507 :a7507 :a7507. +:a7508 :a7508 :a7508. +:a7509 :a7509 :a7509. +:a7510 :a7510 :a7510. +:a7511 :a7511 :a7511. +:a7512 :a7512 :a7512. +:a7513 :a7513 :a7513. +:a7514 :a7514 :a7514. +:a7515 :a7515 :a7515. +:a7516 :a7516 :a7516. +:a7517 :a7517 :a7517. +:a7518 :a7518 :a7518. +:a7519 :a7519 :a7519. +:a7520 :a7520 :a7520. +:a7521 :a7521 :a7521. +:a7522 :a7522 :a7522. +:a7523 :a7523 :a7523. +:a7524 :a7524 :a7524. +:a7525 :a7525 :a7525. +:a7526 :a7526 :a7526. +:a7527 :a7527 :a7527. +:a7528 :a7528 :a7528. +:a7529 :a7529 :a7529. +:a7530 :a7530 :a7530. +:a7531 :a7531 :a7531. +:a7532 :a7532 :a7532. +:a7533 :a7533 :a7533. +:a7534 :a7534 :a7534. +:a7535 :a7535 :a7535. +:a7536 :a7536 :a7536. +:a7537 :a7537 :a7537. +:a7538 :a7538 :a7538. +:a7539 :a7539 :a7539. +:a7540 :a7540 :a7540. +:a7541 :a7541 :a7541. +:a7542 :a7542 :a7542. +:a7543 :a7543 :a7543. +:a7544 :a7544 :a7544. +:a7545 :a7545 :a7545. +:a7546 :a7546 :a7546. +:a7547 :a7547 :a7547. +:a7548 :a7548 :a7548. +:a7549 :a7549 :a7549. +:a7550 :a7550 :a7550. +:a7551 :a7551 :a7551. +:a7552 :a7552 :a7552. +:a7553 :a7553 :a7553. +:a7554 :a7554 :a7554. +:a7555 :a7555 :a7555. +:a7556 :a7556 :a7556. +:a7557 :a7557 :a7557. +:a7558 :a7558 :a7558. +:a7559 :a7559 :a7559. +:a7560 :a7560 :a7560. +:a7561 :a7561 :a7561. +:a7562 :a7562 :a7562. +:a7563 :a7563 :a7563. +:a7564 :a7564 :a7564. +:a7565 :a7565 :a7565. +:a7566 :a7566 :a7566. +:a7567 :a7567 :a7567. +:a7568 :a7568 :a7568. +:a7569 :a7569 :a7569. +:a7570 :a7570 :a7570. +:a7571 :a7571 :a7571. +:a7572 :a7572 :a7572. +:a7573 :a7573 :a7573. +:a7574 :a7574 :a7574. +:a7575 :a7575 :a7575. +:a7576 :a7576 :a7576. +:a7577 :a7577 :a7577. +:a7578 :a7578 :a7578. +:a7579 :a7579 :a7579. +:a7580 :a7580 :a7580. +:a7581 :a7581 :a7581. +:a7582 :a7582 :a7582. +:a7583 :a7583 :a7583. +:a7584 :a7584 :a7584. +:a7585 :a7585 :a7585. +:a7586 :a7586 :a7586. +:a7587 :a7587 :a7587. +:a7588 :a7588 :a7588. +:a7589 :a7589 :a7589. +:a7590 :a7590 :a7590. +:a7591 :a7591 :a7591. +:a7592 :a7592 :a7592. +:a7593 :a7593 :a7593. +:a7594 :a7594 :a7594. +:a7595 :a7595 :a7595. +:a7596 :a7596 :a7596. +:a7597 :a7597 :a7597. +:a7598 :a7598 :a7598. +:a7599 :a7599 :a7599. +:a7600 :a7600 :a7600. +:a7601 :a7601 :a7601. +:a7602 :a7602 :a7602. +:a7603 :a7603 :a7603. +:a7604 :a7604 :a7604. +:a7605 :a7605 :a7605. +:a7606 :a7606 :a7606. +:a7607 :a7607 :a7607. +:a7608 :a7608 :a7608. +:a7609 :a7609 :a7609. +:a7610 :a7610 :a7610. +:a7611 :a7611 :a7611. +:a7612 :a7612 :a7612. +:a7613 :a7613 :a7613. +:a7614 :a7614 :a7614. +:a7615 :a7615 :a7615. +:a7616 :a7616 :a7616. +:a7617 :a7617 :a7617. +:a7618 :a7618 :a7618. +:a7619 :a7619 :a7619. +:a7620 :a7620 :a7620. +:a7621 :a7621 :a7621. +:a7622 :a7622 :a7622. +:a7623 :a7623 :a7623. +:a7624 :a7624 :a7624. +:a7625 :a7625 :a7625. +:a7626 :a7626 :a7626. +:a7627 :a7627 :a7627. +:a7628 :a7628 :a7628. +:a7629 :a7629 :a7629. +:a7630 :a7630 :a7630. +:a7631 :a7631 :a7631. +:a7632 :a7632 :a7632. +:a7633 :a7633 :a7633. +:a7634 :a7634 :a7634. +:a7635 :a7635 :a7635. +:a7636 :a7636 :a7636. +:a7637 :a7637 :a7637. +:a7638 :a7638 :a7638. +:a7639 :a7639 :a7639. +:a7640 :a7640 :a7640. +:a7641 :a7641 :a7641. +:a7642 :a7642 :a7642. +:a7643 :a7643 :a7643. +:a7644 :a7644 :a7644. +:a7645 :a7645 :a7645. +:a7646 :a7646 :a7646. +:a7647 :a7647 :a7647. +:a7648 :a7648 :a7648. +:a7649 :a7649 :a7649. +:a7650 :a7650 :a7650. +:a7651 :a7651 :a7651. +:a7652 :a7652 :a7652. +:a7653 :a7653 :a7653. +:a7654 :a7654 :a7654. +:a7655 :a7655 :a7655. +:a7656 :a7656 :a7656. +:a7657 :a7657 :a7657. +:a7658 :a7658 :a7658. +:a7659 :a7659 :a7659. +:a7660 :a7660 :a7660. +:a7661 :a7661 :a7661. +:a7662 :a7662 :a7662. +:a7663 :a7663 :a7663. +:a7664 :a7664 :a7664. +:a7665 :a7665 :a7665. +:a7666 :a7666 :a7666. +:a7667 :a7667 :a7667. +:a7668 :a7668 :a7668. +:a7669 :a7669 :a7669. +:a7670 :a7670 :a7670. +:a7671 :a7671 :a7671. +:a7672 :a7672 :a7672. +:a7673 :a7673 :a7673. +:a7674 :a7674 :a7674. +:a7675 :a7675 :a7675. +:a7676 :a7676 :a7676. +:a7677 :a7677 :a7677. +:a7678 :a7678 :a7678. +:a7679 :a7679 :a7679. +:a7680 :a7680 :a7680. +:a7681 :a7681 :a7681. +:a7682 :a7682 :a7682. +:a7683 :a7683 :a7683. +:a7684 :a7684 :a7684. +:a7685 :a7685 :a7685. +:a7686 :a7686 :a7686. +:a7687 :a7687 :a7687. +:a7688 :a7688 :a7688. +:a7689 :a7689 :a7689. +:a7690 :a7690 :a7690. +:a7691 :a7691 :a7691. +:a7692 :a7692 :a7692. +:a7693 :a7693 :a7693. +:a7694 :a7694 :a7694. +:a7695 :a7695 :a7695. +:a7696 :a7696 :a7696. +:a7697 :a7697 :a7697. +:a7698 :a7698 :a7698. +:a7699 :a7699 :a7699. +:a7700 :a7700 :a7700. +:a7701 :a7701 :a7701. +:a7702 :a7702 :a7702. +:a7703 :a7703 :a7703. +:a7704 :a7704 :a7704. +:a7705 :a7705 :a7705. +:a7706 :a7706 :a7706. +:a7707 :a7707 :a7707. +:a7708 :a7708 :a7708. +:a7709 :a7709 :a7709. +:a7710 :a7710 :a7710. +:a7711 :a7711 :a7711. +:a7712 :a7712 :a7712. +:a7713 :a7713 :a7713. +:a7714 :a7714 :a7714. +:a7715 :a7715 :a7715. +:a7716 :a7716 :a7716. +:a7717 :a7717 :a7717. +:a7718 :a7718 :a7718. +:a7719 :a7719 :a7719. +:a7720 :a7720 :a7720. +:a7721 :a7721 :a7721. +:a7722 :a7722 :a7722. +:a7723 :a7723 :a7723. +:a7724 :a7724 :a7724. +:a7725 :a7725 :a7725. +:a7726 :a7726 :a7726. +:a7727 :a7727 :a7727. +:a7728 :a7728 :a7728. +:a7729 :a7729 :a7729. +:a7730 :a7730 :a7730. +:a7731 :a7731 :a7731. +:a7732 :a7732 :a7732. +:a7733 :a7733 :a7733. +:a7734 :a7734 :a7734. +:a7735 :a7735 :a7735. +:a7736 :a7736 :a7736. +:a7737 :a7737 :a7737. +:a7738 :a7738 :a7738. +:a7739 :a7739 :a7739. +:a7740 :a7740 :a7740. +:a7741 :a7741 :a7741. +:a7742 :a7742 :a7742. +:a7743 :a7743 :a7743. +:a7744 :a7744 :a7744. +:a7745 :a7745 :a7745. +:a7746 :a7746 :a7746. +:a7747 :a7747 :a7747. +:a7748 :a7748 :a7748. +:a7749 :a7749 :a7749. +:a7750 :a7750 :a7750. +:a7751 :a7751 :a7751. +:a7752 :a7752 :a7752. +:a7753 :a7753 :a7753. +:a7754 :a7754 :a7754. +:a7755 :a7755 :a7755. +:a7756 :a7756 :a7756. +:a7757 :a7757 :a7757. +:a7758 :a7758 :a7758. +:a7759 :a7759 :a7759. +:a7760 :a7760 :a7760. +:a7761 :a7761 :a7761. +:a7762 :a7762 :a7762. +:a7763 :a7763 :a7763. +:a7764 :a7764 :a7764. +:a7765 :a7765 :a7765. +:a7766 :a7766 :a7766. +:a7767 :a7767 :a7767. +:a7768 :a7768 :a7768. +:a7769 :a7769 :a7769. +:a7770 :a7770 :a7770. +:a7771 :a7771 :a7771. +:a7772 :a7772 :a7772. +:a7773 :a7773 :a7773. +:a7774 :a7774 :a7774. +:a7775 :a7775 :a7775. +:a7776 :a7776 :a7776. +:a7777 :a7777 :a7777. +:a7778 :a7778 :a7778. +:a7779 :a7779 :a7779. +:a7780 :a7780 :a7780. +:a7781 :a7781 :a7781. +:a7782 :a7782 :a7782. +:a7783 :a7783 :a7783. +:a7784 :a7784 :a7784. +:a7785 :a7785 :a7785. +:a7786 :a7786 :a7786. +:a7787 :a7787 :a7787. +:a7788 :a7788 :a7788. +:a7789 :a7789 :a7789. +:a7790 :a7790 :a7790. +:a7791 :a7791 :a7791. +:a7792 :a7792 :a7792. +:a7793 :a7793 :a7793. +:a7794 :a7794 :a7794. +:a7795 :a7795 :a7795. +:a7796 :a7796 :a7796. +:a7797 :a7797 :a7797. +:a7798 :a7798 :a7798. +:a7799 :a7799 :a7799. +:a7800 :a7800 :a7800. +:a7801 :a7801 :a7801. +:a7802 :a7802 :a7802. +:a7803 :a7803 :a7803. +:a7804 :a7804 :a7804. +:a7805 :a7805 :a7805. +:a7806 :a7806 :a7806. +:a7807 :a7807 :a7807. +:a7808 :a7808 :a7808. +:a7809 :a7809 :a7809. +:a7810 :a7810 :a7810. +:a7811 :a7811 :a7811. +:a7812 :a7812 :a7812. +:a7813 :a7813 :a7813. +:a7814 :a7814 :a7814. +:a7815 :a7815 :a7815. +:a7816 :a7816 :a7816. +:a7817 :a7817 :a7817. +:a7818 :a7818 :a7818. +:a7819 :a7819 :a7819. +:a7820 :a7820 :a7820. +:a7821 :a7821 :a7821. +:a7822 :a7822 :a7822. +:a7823 :a7823 :a7823. +:a7824 :a7824 :a7824. +:a7825 :a7825 :a7825. +:a7826 :a7826 :a7826. +:a7827 :a7827 :a7827. +:a7828 :a7828 :a7828. +:a7829 :a7829 :a7829. +:a7830 :a7830 :a7830. +:a7831 :a7831 :a7831. +:a7832 :a7832 :a7832. +:a7833 :a7833 :a7833. +:a7834 :a7834 :a7834. +:a7835 :a7835 :a7835. +:a7836 :a7836 :a7836. +:a7837 :a7837 :a7837. +:a7838 :a7838 :a7838. +:a7839 :a7839 :a7839. +:a7840 :a7840 :a7840. +:a7841 :a7841 :a7841. +:a7842 :a7842 :a7842. +:a7843 :a7843 :a7843. +:a7844 :a7844 :a7844. +:a7845 :a7845 :a7845. +:a7846 :a7846 :a7846. +:a7847 :a7847 :a7847. +:a7848 :a7848 :a7848. +:a7849 :a7849 :a7849. +:a7850 :a7850 :a7850. +:a7851 :a7851 :a7851. +:a7852 :a7852 :a7852. +:a7853 :a7853 :a7853. +:a7854 :a7854 :a7854. +:a7855 :a7855 :a7855. +:a7856 :a7856 :a7856. +:a7857 :a7857 :a7857. +:a7858 :a7858 :a7858. +:a7859 :a7859 :a7859. +:a7860 :a7860 :a7860. +:a7861 :a7861 :a7861. +:a7862 :a7862 :a7862. +:a7863 :a7863 :a7863. +:a7864 :a7864 :a7864. +:a7865 :a7865 :a7865. +:a7866 :a7866 :a7866. +:a7867 :a7867 :a7867. +:a7868 :a7868 :a7868. +:a7869 :a7869 :a7869. +:a7870 :a7870 :a7870. +:a7871 :a7871 :a7871. +:a7872 :a7872 :a7872. +:a7873 :a7873 :a7873. +:a7874 :a7874 :a7874. +:a7875 :a7875 :a7875. +:a7876 :a7876 :a7876. +:a7877 :a7877 :a7877. +:a7878 :a7878 :a7878. +:a7879 :a7879 :a7879. +:a7880 :a7880 :a7880. +:a7881 :a7881 :a7881. +:a7882 :a7882 :a7882. +:a7883 :a7883 :a7883. +:a7884 :a7884 :a7884. +:a7885 :a7885 :a7885. +:a7886 :a7886 :a7886. +:a7887 :a7887 :a7887. +:a7888 :a7888 :a7888. +:a7889 :a7889 :a7889. +:a7890 :a7890 :a7890. +:a7891 :a7891 :a7891. +:a7892 :a7892 :a7892. +:a7893 :a7893 :a7893. +:a7894 :a7894 :a7894. +:a7895 :a7895 :a7895. +:a7896 :a7896 :a7896. +:a7897 :a7897 :a7897. +:a7898 :a7898 :a7898. +:a7899 :a7899 :a7899. +:a7900 :a7900 :a7900. +:a7901 :a7901 :a7901. +:a7902 :a7902 :a7902. +:a7903 :a7903 :a7903. +:a7904 :a7904 :a7904. +:a7905 :a7905 :a7905. +:a7906 :a7906 :a7906. +:a7907 :a7907 :a7907. +:a7908 :a7908 :a7908. +:a7909 :a7909 :a7909. +:a7910 :a7910 :a7910. +:a7911 :a7911 :a7911. +:a7912 :a7912 :a7912. +:a7913 :a7913 :a7913. +:a7914 :a7914 :a7914. +:a7915 :a7915 :a7915. +:a7916 :a7916 :a7916. +:a7917 :a7917 :a7917. +:a7918 :a7918 :a7918. +:a7919 :a7919 :a7919. +:a7920 :a7920 :a7920. +:a7921 :a7921 :a7921. +:a7922 :a7922 :a7922. +:a7923 :a7923 :a7923. +:a7924 :a7924 :a7924. +:a7925 :a7925 :a7925. +:a7926 :a7926 :a7926. +:a7927 :a7927 :a7927. +:a7928 :a7928 :a7928. +:a7929 :a7929 :a7929. +:a7930 :a7930 :a7930. +:a7931 :a7931 :a7931. +:a7932 :a7932 :a7932. +:a7933 :a7933 :a7933. +:a7934 :a7934 :a7934. +:a7935 :a7935 :a7935. +:a7936 :a7936 :a7936. +:a7937 :a7937 :a7937. +:a7938 :a7938 :a7938. +:a7939 :a7939 :a7939. +:a7940 :a7940 :a7940. +:a7941 :a7941 :a7941. +:a7942 :a7942 :a7942. +:a7943 :a7943 :a7943. +:a7944 :a7944 :a7944. +:a7945 :a7945 :a7945. +:a7946 :a7946 :a7946. +:a7947 :a7947 :a7947. +:a7948 :a7948 :a7948. +:a7949 :a7949 :a7949. +:a7950 :a7950 :a7950. +:a7951 :a7951 :a7951. +:a7952 :a7952 :a7952. +:a7953 :a7953 :a7953. +:a7954 :a7954 :a7954. +:a7955 :a7955 :a7955. +:a7956 :a7956 :a7956. +:a7957 :a7957 :a7957. +:a7958 :a7958 :a7958. +:a7959 :a7959 :a7959. +:a7960 :a7960 :a7960. +:a7961 :a7961 :a7961. +:a7962 :a7962 :a7962. +:a7963 :a7963 :a7963. +:a7964 :a7964 :a7964. +:a7965 :a7965 :a7965. +:a7966 :a7966 :a7966. +:a7967 :a7967 :a7967. +:a7968 :a7968 :a7968. +:a7969 :a7969 :a7969. +:a7970 :a7970 :a7970. +:a7971 :a7971 :a7971. +:a7972 :a7972 :a7972. +:a7973 :a7973 :a7973. +:a7974 :a7974 :a7974. +:a7975 :a7975 :a7975. +:a7976 :a7976 :a7976. +:a7977 :a7977 :a7977. +:a7978 :a7978 :a7978. +:a7979 :a7979 :a7979. +:a7980 :a7980 :a7980. +:a7981 :a7981 :a7981. +:a7982 :a7982 :a7982. +:a7983 :a7983 :a7983. +:a7984 :a7984 :a7984. +:a7985 :a7985 :a7985. +:a7986 :a7986 :a7986. +:a7987 :a7987 :a7987. +:a7988 :a7988 :a7988. +:a7989 :a7989 :a7989. +:a7990 :a7990 :a7990. +:a7991 :a7991 :a7991. +:a7992 :a7992 :a7992. +:a7993 :a7993 :a7993. +:a7994 :a7994 :a7994. +:a7995 :a7995 :a7995. +:a7996 :a7996 :a7996. +:a7997 :a7997 :a7997. +:a7998 :a7998 :a7998. +:a7999 :a7999 :a7999. +:a8000 :a8000 :a8000. +:a8001 :a8001 :a8001. +:a8002 :a8002 :a8002. +:a8003 :a8003 :a8003. +:a8004 :a8004 :a8004. +:a8005 :a8005 :a8005. +:a8006 :a8006 :a8006. +:a8007 :a8007 :a8007. +:a8008 :a8008 :a8008. +:a8009 :a8009 :a8009. +:a8010 :a8010 :a8010. +:a8011 :a8011 :a8011. +:a8012 :a8012 :a8012. +:a8013 :a8013 :a8013. +:a8014 :a8014 :a8014. +:a8015 :a8015 :a8015. +:a8016 :a8016 :a8016. +:a8017 :a8017 :a8017. +:a8018 :a8018 :a8018. +:a8019 :a8019 :a8019. +:a8020 :a8020 :a8020. +:a8021 :a8021 :a8021. +:a8022 :a8022 :a8022. +:a8023 :a8023 :a8023. +:a8024 :a8024 :a8024. +:a8025 :a8025 :a8025. +:a8026 :a8026 :a8026. +:a8027 :a8027 :a8027. +:a8028 :a8028 :a8028. +:a8029 :a8029 :a8029. +:a8030 :a8030 :a8030. +:a8031 :a8031 :a8031. +:a8032 :a8032 :a8032. +:a8033 :a8033 :a8033. +:a8034 :a8034 :a8034. +:a8035 :a8035 :a8035. +:a8036 :a8036 :a8036. +:a8037 :a8037 :a8037. +:a8038 :a8038 :a8038. +:a8039 :a8039 :a8039. +:a8040 :a8040 :a8040. +:a8041 :a8041 :a8041. +:a8042 :a8042 :a8042. +:a8043 :a8043 :a8043. +:a8044 :a8044 :a8044. +:a8045 :a8045 :a8045. +:a8046 :a8046 :a8046. +:a8047 :a8047 :a8047. +:a8048 :a8048 :a8048. +:a8049 :a8049 :a8049. +:a8050 :a8050 :a8050. +:a8051 :a8051 :a8051. +:a8052 :a8052 :a8052. +:a8053 :a8053 :a8053. +:a8054 :a8054 :a8054. +:a8055 :a8055 :a8055. +:a8056 :a8056 :a8056. +:a8057 :a8057 :a8057. +:a8058 :a8058 :a8058. +:a8059 :a8059 :a8059. +:a8060 :a8060 :a8060. +:a8061 :a8061 :a8061. +:a8062 :a8062 :a8062. +:a8063 :a8063 :a8063. +:a8064 :a8064 :a8064. +:a8065 :a8065 :a8065. +:a8066 :a8066 :a8066. +:a8067 :a8067 :a8067. +:a8068 :a8068 :a8068. +:a8069 :a8069 :a8069. +:a8070 :a8070 :a8070. +:a8071 :a8071 :a8071. +:a8072 :a8072 :a8072. +:a8073 :a8073 :a8073. +:a8074 :a8074 :a8074. +:a8075 :a8075 :a8075. +:a8076 :a8076 :a8076. +:a8077 :a8077 :a8077. +:a8078 :a8078 :a8078. +:a8079 :a8079 :a8079. +:a8080 :a8080 :a8080. +:a8081 :a8081 :a8081. +:a8082 :a8082 :a8082. +:a8083 :a8083 :a8083. +:a8084 :a8084 :a8084. +:a8085 :a8085 :a8085. +:a8086 :a8086 :a8086. +:a8087 :a8087 :a8087. +:a8088 :a8088 :a8088. +:a8089 :a8089 :a8089. +:a8090 :a8090 :a8090. +:a8091 :a8091 :a8091. +:a8092 :a8092 :a8092. +:a8093 :a8093 :a8093. +:a8094 :a8094 :a8094. +:a8095 :a8095 :a8095. +:a8096 :a8096 :a8096. +:a8097 :a8097 :a8097. +:a8098 :a8098 :a8098. +:a8099 :a8099 :a8099. +:a8100 :a8100 :a8100. +:a8101 :a8101 :a8101. +:a8102 :a8102 :a8102. +:a8103 :a8103 :a8103. +:a8104 :a8104 :a8104. +:a8105 :a8105 :a8105. +:a8106 :a8106 :a8106. +:a8107 :a8107 :a8107. +:a8108 :a8108 :a8108. +:a8109 :a8109 :a8109. +:a8110 :a8110 :a8110. +:a8111 :a8111 :a8111. +:a8112 :a8112 :a8112. +:a8113 :a8113 :a8113. +:a8114 :a8114 :a8114. +:a8115 :a8115 :a8115. +:a8116 :a8116 :a8116. +:a8117 :a8117 :a8117. +:a8118 :a8118 :a8118. +:a8119 :a8119 :a8119. +:a8120 :a8120 :a8120. +:a8121 :a8121 :a8121. +:a8122 :a8122 :a8122. +:a8123 :a8123 :a8123. +:a8124 :a8124 :a8124. +:a8125 :a8125 :a8125. +:a8126 :a8126 :a8126. +:a8127 :a8127 :a8127. +:a8128 :a8128 :a8128. +:a8129 :a8129 :a8129. +:a8130 :a8130 :a8130. +:a8131 :a8131 :a8131. +:a8132 :a8132 :a8132. +:a8133 :a8133 :a8133. +:a8134 :a8134 :a8134. +:a8135 :a8135 :a8135. +:a8136 :a8136 :a8136. +:a8137 :a8137 :a8137. +:a8138 :a8138 :a8138. +:a8139 :a8139 :a8139. +:a8140 :a8140 :a8140. +:a8141 :a8141 :a8141. +:a8142 :a8142 :a8142. +:a8143 :a8143 :a8143. +:a8144 :a8144 :a8144. +:a8145 :a8145 :a8145. +:a8146 :a8146 :a8146. +:a8147 :a8147 :a8147. +:a8148 :a8148 :a8148. +:a8149 :a8149 :a8149. +:a8150 :a8150 :a8150. +:a8151 :a8151 :a8151. +:a8152 :a8152 :a8152. +:a8153 :a8153 :a8153. +:a8154 :a8154 :a8154. +:a8155 :a8155 :a8155. +:a8156 :a8156 :a8156. +:a8157 :a8157 :a8157. +:a8158 :a8158 :a8158. +:a8159 :a8159 :a8159. +:a8160 :a8160 :a8160. +:a8161 :a8161 :a8161. +:a8162 :a8162 :a8162. +:a8163 :a8163 :a8163. +:a8164 :a8164 :a8164. +:a8165 :a8165 :a8165. +:a8166 :a8166 :a8166. +:a8167 :a8167 :a8167. +:a8168 :a8168 :a8168. +:a8169 :a8169 :a8169. +:a8170 :a8170 :a8170. +:a8171 :a8171 :a8171. +:a8172 :a8172 :a8172. +:a8173 :a8173 :a8173. +:a8174 :a8174 :a8174. +:a8175 :a8175 :a8175. +:a8176 :a8176 :a8176. +:a8177 :a8177 :a8177. +:a8178 :a8178 :a8178. +:a8179 :a8179 :a8179. +:a8180 :a8180 :a8180. +:a8181 :a8181 :a8181. +:a8182 :a8182 :a8182. +:a8183 :a8183 :a8183. +:a8184 :a8184 :a8184. +:a8185 :a8185 :a8185. +:a8186 :a8186 :a8186. +:a8187 :a8187 :a8187. +:a8188 :a8188 :a8188. +:a8189 :a8189 :a8189. +:a8190 :a8190 :a8190. +:a8191 :a8191 :a8191. +:a8192 :a8192 :a8192. +:a8193 :a8193 :a8193. +:a8194 :a8194 :a8194. +:a8195 :a8195 :a8195. +:a8196 :a8196 :a8196. +:a8197 :a8197 :a8197. +:a8198 :a8198 :a8198. +:a8199 :a8199 :a8199. +:a8200 :a8200 :a8200. +:a8201 :a8201 :a8201. +:a8202 :a8202 :a8202. +:a8203 :a8203 :a8203. +:a8204 :a8204 :a8204. +:a8205 :a8205 :a8205. +:a8206 :a8206 :a8206. +:a8207 :a8207 :a8207. +:a8208 :a8208 :a8208. +:a8209 :a8209 :a8209. +:a8210 :a8210 :a8210. +:a8211 :a8211 :a8211. +:a8212 :a8212 :a8212. +:a8213 :a8213 :a8213. +:a8214 :a8214 :a8214. +:a8215 :a8215 :a8215. +:a8216 :a8216 :a8216. +:a8217 :a8217 :a8217. +:a8218 :a8218 :a8218. +:a8219 :a8219 :a8219. +:a8220 :a8220 :a8220. +:a8221 :a8221 :a8221. +:a8222 :a8222 :a8222. +:a8223 :a8223 :a8223. +:a8224 :a8224 :a8224. +:a8225 :a8225 :a8225. +:a8226 :a8226 :a8226. +:a8227 :a8227 :a8227. +:a8228 :a8228 :a8228. +:a8229 :a8229 :a8229. +:a8230 :a8230 :a8230. +:a8231 :a8231 :a8231. +:a8232 :a8232 :a8232. +:a8233 :a8233 :a8233. +:a8234 :a8234 :a8234. +:a8235 :a8235 :a8235. +:a8236 :a8236 :a8236. +:a8237 :a8237 :a8237. +:a8238 :a8238 :a8238. +:a8239 :a8239 :a8239. +:a8240 :a8240 :a8240. +:a8241 :a8241 :a8241. +:a8242 :a8242 :a8242. +:a8243 :a8243 :a8243. +:a8244 :a8244 :a8244. +:a8245 :a8245 :a8245. +:a8246 :a8246 :a8246. +:a8247 :a8247 :a8247. +:a8248 :a8248 :a8248. +:a8249 :a8249 :a8249. +:a8250 :a8250 :a8250. +:a8251 :a8251 :a8251. +:a8252 :a8252 :a8252. +:a8253 :a8253 :a8253. +:a8254 :a8254 :a8254. +:a8255 :a8255 :a8255. +:a8256 :a8256 :a8256. +:a8257 :a8257 :a8257. +:a8258 :a8258 :a8258. +:a8259 :a8259 :a8259. +:a8260 :a8260 :a8260. +:a8261 :a8261 :a8261. +:a8262 :a8262 :a8262. +:a8263 :a8263 :a8263. +:a8264 :a8264 :a8264. +:a8265 :a8265 :a8265. +:a8266 :a8266 :a8266. +:a8267 :a8267 :a8267. +:a8268 :a8268 :a8268. +:a8269 :a8269 :a8269. +:a8270 :a8270 :a8270. +:a8271 :a8271 :a8271. +:a8272 :a8272 :a8272. +:a8273 :a8273 :a8273. +:a8274 :a8274 :a8274. +:a8275 :a8275 :a8275. +:a8276 :a8276 :a8276. +:a8277 :a8277 :a8277. +:a8278 :a8278 :a8278. +:a8279 :a8279 :a8279. +:a8280 :a8280 :a8280. +:a8281 :a8281 :a8281. +:a8282 :a8282 :a8282. +:a8283 :a8283 :a8283. +:a8284 :a8284 :a8284. +:a8285 :a8285 :a8285. +:a8286 :a8286 :a8286. +:a8287 :a8287 :a8287. +:a8288 :a8288 :a8288. +:a8289 :a8289 :a8289. +:a8290 :a8290 :a8290. +:a8291 :a8291 :a8291. +:a8292 :a8292 :a8292. +:a8293 :a8293 :a8293. +:a8294 :a8294 :a8294. +:a8295 :a8295 :a8295. +:a8296 :a8296 :a8296. +:a8297 :a8297 :a8297. +:a8298 :a8298 :a8298. +:a8299 :a8299 :a8299. +:a8300 :a8300 :a8300. +:a8301 :a8301 :a8301. +:a8302 :a8302 :a8302. +:a8303 :a8303 :a8303. +:a8304 :a8304 :a8304. +:a8305 :a8305 :a8305. +:a8306 :a8306 :a8306. +:a8307 :a8307 :a8307. +:a8308 :a8308 :a8308. +:a8309 :a8309 :a8309. +:a8310 :a8310 :a8310. +:a8311 :a8311 :a8311. +:a8312 :a8312 :a8312. +:a8313 :a8313 :a8313. +:a8314 :a8314 :a8314. +:a8315 :a8315 :a8315. +:a8316 :a8316 :a8316. +:a8317 :a8317 :a8317. +:a8318 :a8318 :a8318. +:a8319 :a8319 :a8319. +:a8320 :a8320 :a8320. +:a8321 :a8321 :a8321. +:a8322 :a8322 :a8322. +:a8323 :a8323 :a8323. +:a8324 :a8324 :a8324. +:a8325 :a8325 :a8325. +:a8326 :a8326 :a8326. +:a8327 :a8327 :a8327. +:a8328 :a8328 :a8328. +:a8329 :a8329 :a8329. +:a8330 :a8330 :a8330. +:a8331 :a8331 :a8331. +:a8332 :a8332 :a8332. +:a8333 :a8333 :a8333. +:a8334 :a8334 :a8334. +:a8335 :a8335 :a8335. +:a8336 :a8336 :a8336. +:a8337 :a8337 :a8337. +:a8338 :a8338 :a8338. +:a8339 :a8339 :a8339. +:a8340 :a8340 :a8340. +:a8341 :a8341 :a8341. +:a8342 :a8342 :a8342. +:a8343 :a8343 :a8343. +:a8344 :a8344 :a8344. +:a8345 :a8345 :a8345. +:a8346 :a8346 :a8346. +:a8347 :a8347 :a8347. +:a8348 :a8348 :a8348. +:a8349 :a8349 :a8349. +:a8350 :a8350 :a8350. +:a8351 :a8351 :a8351. +:a8352 :a8352 :a8352. +:a8353 :a8353 :a8353. +:a8354 :a8354 :a8354. +:a8355 :a8355 :a8355. +:a8356 :a8356 :a8356. +:a8357 :a8357 :a8357. +:a8358 :a8358 :a8358. +:a8359 :a8359 :a8359. +:a8360 :a8360 :a8360. +:a8361 :a8361 :a8361. +:a8362 :a8362 :a8362. +:a8363 :a8363 :a8363. +:a8364 :a8364 :a8364. +:a8365 :a8365 :a8365. +:a8366 :a8366 :a8366. +:a8367 :a8367 :a8367. +:a8368 :a8368 :a8368. +:a8369 :a8369 :a8369. +:a8370 :a8370 :a8370. +:a8371 :a8371 :a8371. +:a8372 :a8372 :a8372. +:a8373 :a8373 :a8373. +:a8374 :a8374 :a8374. +:a8375 :a8375 :a8375. +:a8376 :a8376 :a8376. +:a8377 :a8377 :a8377. +:a8378 :a8378 :a8378. +:a8379 :a8379 :a8379. +:a8380 :a8380 :a8380. +:a8381 :a8381 :a8381. +:a8382 :a8382 :a8382. +:a8383 :a8383 :a8383. +:a8384 :a8384 :a8384. +:a8385 :a8385 :a8385. +:a8386 :a8386 :a8386. +:a8387 :a8387 :a8387. +:a8388 :a8388 :a8388. +:a8389 :a8389 :a8389. +:a8390 :a8390 :a8390. +:a8391 :a8391 :a8391. +:a8392 :a8392 :a8392. +:a8393 :a8393 :a8393. +:a8394 :a8394 :a8394. +:a8395 :a8395 :a8395. +:a8396 :a8396 :a8396. +:a8397 :a8397 :a8397. +:a8398 :a8398 :a8398. +:a8399 :a8399 :a8399. +:a8400 :a8400 :a8400. +:a8401 :a8401 :a8401. +:a8402 :a8402 :a8402. +:a8403 :a8403 :a8403. +:a8404 :a8404 :a8404. +:a8405 :a8405 :a8405. +:a8406 :a8406 :a8406. +:a8407 :a8407 :a8407. +:a8408 :a8408 :a8408. +:a8409 :a8409 :a8409. +:a8410 :a8410 :a8410. +:a8411 :a8411 :a8411. +:a8412 :a8412 :a8412. +:a8413 :a8413 :a8413. +:a8414 :a8414 :a8414. +:a8415 :a8415 :a8415. +:a8416 :a8416 :a8416. +:a8417 :a8417 :a8417. +:a8418 :a8418 :a8418. +:a8419 :a8419 :a8419. +:a8420 :a8420 :a8420. +:a8421 :a8421 :a8421. +:a8422 :a8422 :a8422. +:a8423 :a8423 :a8423. +:a8424 :a8424 :a8424. +:a8425 :a8425 :a8425. +:a8426 :a8426 :a8426. +:a8427 :a8427 :a8427. +:a8428 :a8428 :a8428. +:a8429 :a8429 :a8429. +:a8430 :a8430 :a8430. +:a8431 :a8431 :a8431. +:a8432 :a8432 :a8432. +:a8433 :a8433 :a8433. +:a8434 :a8434 :a8434. +:a8435 :a8435 :a8435. +:a8436 :a8436 :a8436. +:a8437 :a8437 :a8437. +:a8438 :a8438 :a8438. +:a8439 :a8439 :a8439. +:a8440 :a8440 :a8440. +:a8441 :a8441 :a8441. +:a8442 :a8442 :a8442. +:a8443 :a8443 :a8443. +:a8444 :a8444 :a8444. +:a8445 :a8445 :a8445. +:a8446 :a8446 :a8446. +:a8447 :a8447 :a8447. +:a8448 :a8448 :a8448. +:a8449 :a8449 :a8449. +:a8450 :a8450 :a8450. +:a8451 :a8451 :a8451. +:a8452 :a8452 :a8452. +:a8453 :a8453 :a8453. +:a8454 :a8454 :a8454. +:a8455 :a8455 :a8455. +:a8456 :a8456 :a8456. +:a8457 :a8457 :a8457. +:a8458 :a8458 :a8458. +:a8459 :a8459 :a8459. +:a8460 :a8460 :a8460. +:a8461 :a8461 :a8461. +:a8462 :a8462 :a8462. +:a8463 :a8463 :a8463. +:a8464 :a8464 :a8464. +:a8465 :a8465 :a8465. +:a8466 :a8466 :a8466. +:a8467 :a8467 :a8467. +:a8468 :a8468 :a8468. +:a8469 :a8469 :a8469. +:a8470 :a8470 :a8470. +:a8471 :a8471 :a8471. +:a8472 :a8472 :a8472. +:a8473 :a8473 :a8473. +:a8474 :a8474 :a8474. +:a8475 :a8475 :a8475. +:a8476 :a8476 :a8476. +:a8477 :a8477 :a8477. +:a8478 :a8478 :a8478. +:a8479 :a8479 :a8479. +:a8480 :a8480 :a8480. +:a8481 :a8481 :a8481. +:a8482 :a8482 :a8482. +:a8483 :a8483 :a8483. +:a8484 :a8484 :a8484. +:a8485 :a8485 :a8485. +:a8486 :a8486 :a8486. +:a8487 :a8487 :a8487. +:a8488 :a8488 :a8488. +:a8489 :a8489 :a8489. +:a8490 :a8490 :a8490. +:a8491 :a8491 :a8491. +:a8492 :a8492 :a8492. +:a8493 :a8493 :a8493. +:a8494 :a8494 :a8494. +:a8495 :a8495 :a8495. +:a8496 :a8496 :a8496. +:a8497 :a8497 :a8497. +:a8498 :a8498 :a8498. +:a8499 :a8499 :a8499. +:a8500 :a8500 :a8500. +:a8501 :a8501 :a8501. +:a8502 :a8502 :a8502. +:a8503 :a8503 :a8503. +:a8504 :a8504 :a8504. +:a8505 :a8505 :a8505. +:a8506 :a8506 :a8506. +:a8507 :a8507 :a8507. +:a8508 :a8508 :a8508. +:a8509 :a8509 :a8509. +:a8510 :a8510 :a8510. +:a8511 :a8511 :a8511. +:a8512 :a8512 :a8512. +:a8513 :a8513 :a8513. +:a8514 :a8514 :a8514. +:a8515 :a8515 :a8515. +:a8516 :a8516 :a8516. +:a8517 :a8517 :a8517. +:a8518 :a8518 :a8518. +:a8519 :a8519 :a8519. +:a8520 :a8520 :a8520. +:a8521 :a8521 :a8521. +:a8522 :a8522 :a8522. +:a8523 :a8523 :a8523. +:a8524 :a8524 :a8524. +:a8525 :a8525 :a8525. +:a8526 :a8526 :a8526. +:a8527 :a8527 :a8527. +:a8528 :a8528 :a8528. +:a8529 :a8529 :a8529. +:a8530 :a8530 :a8530. +:a8531 :a8531 :a8531. +:a8532 :a8532 :a8532. +:a8533 :a8533 :a8533. +:a8534 :a8534 :a8534. +:a8535 :a8535 :a8535. +:a8536 :a8536 :a8536. +:a8537 :a8537 :a8537. +:a8538 :a8538 :a8538. +:a8539 :a8539 :a8539. +:a8540 :a8540 :a8540. +:a8541 :a8541 :a8541. +:a8542 :a8542 :a8542. +:a8543 :a8543 :a8543. +:a8544 :a8544 :a8544. +:a8545 :a8545 :a8545. +:a8546 :a8546 :a8546. +:a8547 :a8547 :a8547. +:a8548 :a8548 :a8548. +:a8549 :a8549 :a8549. +:a8550 :a8550 :a8550. +:a8551 :a8551 :a8551. +:a8552 :a8552 :a8552. +:a8553 :a8553 :a8553. +:a8554 :a8554 :a8554. +:a8555 :a8555 :a8555. +:a8556 :a8556 :a8556. +:a8557 :a8557 :a8557. +:a8558 :a8558 :a8558. +:a8559 :a8559 :a8559. +:a8560 :a8560 :a8560. +:a8561 :a8561 :a8561. +:a8562 :a8562 :a8562. +:a8563 :a8563 :a8563. +:a8564 :a8564 :a8564. +:a8565 :a8565 :a8565. +:a8566 :a8566 :a8566. +:a8567 :a8567 :a8567. +:a8568 :a8568 :a8568. +:a8569 :a8569 :a8569. +:a8570 :a8570 :a8570. +:a8571 :a8571 :a8571. +:a8572 :a8572 :a8572. +:a8573 :a8573 :a8573. +:a8574 :a8574 :a8574. +:a8575 :a8575 :a8575. +:a8576 :a8576 :a8576. +:a8577 :a8577 :a8577. +:a8578 :a8578 :a8578. +:a8579 :a8579 :a8579. +:a8580 :a8580 :a8580. +:a8581 :a8581 :a8581. +:a8582 :a8582 :a8582. +:a8583 :a8583 :a8583. +:a8584 :a8584 :a8584. +:a8585 :a8585 :a8585. +:a8586 :a8586 :a8586. +:a8587 :a8587 :a8587. +:a8588 :a8588 :a8588. +:a8589 :a8589 :a8589. +:a8590 :a8590 :a8590. +:a8591 :a8591 :a8591. +:a8592 :a8592 :a8592. +:a8593 :a8593 :a8593. +:a8594 :a8594 :a8594. +:a8595 :a8595 :a8595. +:a8596 :a8596 :a8596. +:a8597 :a8597 :a8597. +:a8598 :a8598 :a8598. +:a8599 :a8599 :a8599. +:a8600 :a8600 :a8600. +:a8601 :a8601 :a8601. +:a8602 :a8602 :a8602. +:a8603 :a8603 :a8603. +:a8604 :a8604 :a8604. +:a8605 :a8605 :a8605. +:a8606 :a8606 :a8606. +:a8607 :a8607 :a8607. +:a8608 :a8608 :a8608. +:a8609 :a8609 :a8609. +:a8610 :a8610 :a8610. +:a8611 :a8611 :a8611. +:a8612 :a8612 :a8612. +:a8613 :a8613 :a8613. +:a8614 :a8614 :a8614. +:a8615 :a8615 :a8615. +:a8616 :a8616 :a8616. +:a8617 :a8617 :a8617. +:a8618 :a8618 :a8618. +:a8619 :a8619 :a8619. +:a8620 :a8620 :a8620. +:a8621 :a8621 :a8621. +:a8622 :a8622 :a8622. +:a8623 :a8623 :a8623. +:a8624 :a8624 :a8624. +:a8625 :a8625 :a8625. +:a8626 :a8626 :a8626. +:a8627 :a8627 :a8627. +:a8628 :a8628 :a8628. +:a8629 :a8629 :a8629. +:a8630 :a8630 :a8630. +:a8631 :a8631 :a8631. +:a8632 :a8632 :a8632. +:a8633 :a8633 :a8633. +:a8634 :a8634 :a8634. +:a8635 :a8635 :a8635. +:a8636 :a8636 :a8636. +:a8637 :a8637 :a8637. +:a8638 :a8638 :a8638. +:a8639 :a8639 :a8639. +:a8640 :a8640 :a8640. +:a8641 :a8641 :a8641. +:a8642 :a8642 :a8642. +:a8643 :a8643 :a8643. +:a8644 :a8644 :a8644. +:a8645 :a8645 :a8645. +:a8646 :a8646 :a8646. +:a8647 :a8647 :a8647. +:a8648 :a8648 :a8648. +:a8649 :a8649 :a8649. +:a8650 :a8650 :a8650. +:a8651 :a8651 :a8651. +:a8652 :a8652 :a8652. +:a8653 :a8653 :a8653. +:a8654 :a8654 :a8654. +:a8655 :a8655 :a8655. +:a8656 :a8656 :a8656. +:a8657 :a8657 :a8657. +:a8658 :a8658 :a8658. +:a8659 :a8659 :a8659. +:a8660 :a8660 :a8660. +:a8661 :a8661 :a8661. +:a8662 :a8662 :a8662. +:a8663 :a8663 :a8663. +:a8664 :a8664 :a8664. +:a8665 :a8665 :a8665. +:a8666 :a8666 :a8666. +:a8667 :a8667 :a8667. +:a8668 :a8668 :a8668. +:a8669 :a8669 :a8669. +:a8670 :a8670 :a8670. +:a8671 :a8671 :a8671. +:a8672 :a8672 :a8672. +:a8673 :a8673 :a8673. +:a8674 :a8674 :a8674. +:a8675 :a8675 :a8675. +:a8676 :a8676 :a8676. +:a8677 :a8677 :a8677. +:a8678 :a8678 :a8678. +:a8679 :a8679 :a8679. +:a8680 :a8680 :a8680. +:a8681 :a8681 :a8681. +:a8682 :a8682 :a8682. +:a8683 :a8683 :a8683. +:a8684 :a8684 :a8684. +:a8685 :a8685 :a8685. +:a8686 :a8686 :a8686. +:a8687 :a8687 :a8687. +:a8688 :a8688 :a8688. +:a8689 :a8689 :a8689. +:a8690 :a8690 :a8690. +:a8691 :a8691 :a8691. +:a8692 :a8692 :a8692. +:a8693 :a8693 :a8693. +:a8694 :a8694 :a8694. +:a8695 :a8695 :a8695. +:a8696 :a8696 :a8696. +:a8697 :a8697 :a8697. +:a8698 :a8698 :a8698. +:a8699 :a8699 :a8699. +:a8700 :a8700 :a8700. +:a8701 :a8701 :a8701. +:a8702 :a8702 :a8702. +:a8703 :a8703 :a8703. +:a8704 :a8704 :a8704. +:a8705 :a8705 :a8705. +:a8706 :a8706 :a8706. +:a8707 :a8707 :a8707. +:a8708 :a8708 :a8708. +:a8709 :a8709 :a8709. +:a8710 :a8710 :a8710. +:a8711 :a8711 :a8711. +:a8712 :a8712 :a8712. +:a8713 :a8713 :a8713. +:a8714 :a8714 :a8714. +:a8715 :a8715 :a8715. +:a8716 :a8716 :a8716. +:a8717 :a8717 :a8717. +:a8718 :a8718 :a8718. +:a8719 :a8719 :a8719. +:a8720 :a8720 :a8720. +:a8721 :a8721 :a8721. +:a8722 :a8722 :a8722. +:a8723 :a8723 :a8723. +:a8724 :a8724 :a8724. +:a8725 :a8725 :a8725. +:a8726 :a8726 :a8726. +:a8727 :a8727 :a8727. +:a8728 :a8728 :a8728. +:a8729 :a8729 :a8729. +:a8730 :a8730 :a8730. +:a8731 :a8731 :a8731. +:a8732 :a8732 :a8732. +:a8733 :a8733 :a8733. +:a8734 :a8734 :a8734. +:a8735 :a8735 :a8735. +:a8736 :a8736 :a8736. +:a8737 :a8737 :a8737. +:a8738 :a8738 :a8738. +:a8739 :a8739 :a8739. +:a8740 :a8740 :a8740. +:a8741 :a8741 :a8741. +:a8742 :a8742 :a8742. +:a8743 :a8743 :a8743. +:a8744 :a8744 :a8744. +:a8745 :a8745 :a8745. +:a8746 :a8746 :a8746. +:a8747 :a8747 :a8747. +:a8748 :a8748 :a8748. +:a8749 :a8749 :a8749. +:a8750 :a8750 :a8750. +:a8751 :a8751 :a8751. +:a8752 :a8752 :a8752. +:a8753 :a8753 :a8753. +:a8754 :a8754 :a8754. +:a8755 :a8755 :a8755. +:a8756 :a8756 :a8756. +:a8757 :a8757 :a8757. +:a8758 :a8758 :a8758. +:a8759 :a8759 :a8759. +:a8760 :a8760 :a8760. +:a8761 :a8761 :a8761. +:a8762 :a8762 :a8762. +:a8763 :a8763 :a8763. +:a8764 :a8764 :a8764. +:a8765 :a8765 :a8765. +:a8766 :a8766 :a8766. +:a8767 :a8767 :a8767. +:a8768 :a8768 :a8768. +:a8769 :a8769 :a8769. +:a8770 :a8770 :a8770. +:a8771 :a8771 :a8771. +:a8772 :a8772 :a8772. +:a8773 :a8773 :a8773. +:a8774 :a8774 :a8774. +:a8775 :a8775 :a8775. +:a8776 :a8776 :a8776. +:a8777 :a8777 :a8777. +:a8778 :a8778 :a8778. +:a8779 :a8779 :a8779. +:a8780 :a8780 :a8780. +:a8781 :a8781 :a8781. +:a8782 :a8782 :a8782. +:a8783 :a8783 :a8783. +:a8784 :a8784 :a8784. +:a8785 :a8785 :a8785. +:a8786 :a8786 :a8786. +:a8787 :a8787 :a8787. +:a8788 :a8788 :a8788. +:a8789 :a8789 :a8789. +:a8790 :a8790 :a8790. +:a8791 :a8791 :a8791. +:a8792 :a8792 :a8792. +:a8793 :a8793 :a8793. +:a8794 :a8794 :a8794. +:a8795 :a8795 :a8795. +:a8796 :a8796 :a8796. +:a8797 :a8797 :a8797. +:a8798 :a8798 :a8798. +:a8799 :a8799 :a8799. +:a8800 :a8800 :a8800. +:a8801 :a8801 :a8801. +:a8802 :a8802 :a8802. +:a8803 :a8803 :a8803. +:a8804 :a8804 :a8804. +:a8805 :a8805 :a8805. +:a8806 :a8806 :a8806. +:a8807 :a8807 :a8807. +:a8808 :a8808 :a8808. +:a8809 :a8809 :a8809. +:a8810 :a8810 :a8810. +:a8811 :a8811 :a8811. +:a8812 :a8812 :a8812. +:a8813 :a8813 :a8813. +:a8814 :a8814 :a8814. +:a8815 :a8815 :a8815. +:a8816 :a8816 :a8816. +:a8817 :a8817 :a8817. +:a8818 :a8818 :a8818. +:a8819 :a8819 :a8819. +:a8820 :a8820 :a8820. +:a8821 :a8821 :a8821. +:a8822 :a8822 :a8822. +:a8823 :a8823 :a8823. +:a8824 :a8824 :a8824. +:a8825 :a8825 :a8825. +:a8826 :a8826 :a8826. +:a8827 :a8827 :a8827. +:a8828 :a8828 :a8828. +:a8829 :a8829 :a8829. +:a8830 :a8830 :a8830. +:a8831 :a8831 :a8831. +:a8832 :a8832 :a8832. +:a8833 :a8833 :a8833. +:a8834 :a8834 :a8834. +:a8835 :a8835 :a8835. +:a8836 :a8836 :a8836. +:a8837 :a8837 :a8837. +:a8838 :a8838 :a8838. +:a8839 :a8839 :a8839. +:a8840 :a8840 :a8840. +:a8841 :a8841 :a8841. +:a8842 :a8842 :a8842. +:a8843 :a8843 :a8843. +:a8844 :a8844 :a8844. +:a8845 :a8845 :a8845. +:a8846 :a8846 :a8846. +:a8847 :a8847 :a8847. +:a8848 :a8848 :a8848. +:a8849 :a8849 :a8849. +:a8850 :a8850 :a8850. +:a8851 :a8851 :a8851. +:a8852 :a8852 :a8852. +:a8853 :a8853 :a8853. +:a8854 :a8854 :a8854. +:a8855 :a8855 :a8855. +:a8856 :a8856 :a8856. +:a8857 :a8857 :a8857. +:a8858 :a8858 :a8858. +:a8859 :a8859 :a8859. +:a8860 :a8860 :a8860. +:a8861 :a8861 :a8861. +:a8862 :a8862 :a8862. +:a8863 :a8863 :a8863. +:a8864 :a8864 :a8864. +:a8865 :a8865 :a8865. +:a8866 :a8866 :a8866. +:a8867 :a8867 :a8867. +:a8868 :a8868 :a8868. +:a8869 :a8869 :a8869. +:a8870 :a8870 :a8870. +:a8871 :a8871 :a8871. +:a8872 :a8872 :a8872. +:a8873 :a8873 :a8873. +:a8874 :a8874 :a8874. +:a8875 :a8875 :a8875. +:a8876 :a8876 :a8876. +:a8877 :a8877 :a8877. +:a8878 :a8878 :a8878. +:a8879 :a8879 :a8879. +:a8880 :a8880 :a8880. +:a8881 :a8881 :a8881. +:a8882 :a8882 :a8882. +:a8883 :a8883 :a8883. +:a8884 :a8884 :a8884. +:a8885 :a8885 :a8885. +:a8886 :a8886 :a8886. +:a8887 :a8887 :a8887. +:a8888 :a8888 :a8888. +:a8889 :a8889 :a8889. +:a8890 :a8890 :a8890. +:a8891 :a8891 :a8891. +:a8892 :a8892 :a8892. +:a8893 :a8893 :a8893. +:a8894 :a8894 :a8894. +:a8895 :a8895 :a8895. +:a8896 :a8896 :a8896. +:a8897 :a8897 :a8897. +:a8898 :a8898 :a8898. +:a8899 :a8899 :a8899. +:a8900 :a8900 :a8900. +:a8901 :a8901 :a8901. +:a8902 :a8902 :a8902. +:a8903 :a8903 :a8903. +:a8904 :a8904 :a8904. +:a8905 :a8905 :a8905. +:a8906 :a8906 :a8906. +:a8907 :a8907 :a8907. +:a8908 :a8908 :a8908. +:a8909 :a8909 :a8909. +:a8910 :a8910 :a8910. +:a8911 :a8911 :a8911. +:a8912 :a8912 :a8912. +:a8913 :a8913 :a8913. +:a8914 :a8914 :a8914. +:a8915 :a8915 :a8915. +:a8916 :a8916 :a8916. +:a8917 :a8917 :a8917. +:a8918 :a8918 :a8918. +:a8919 :a8919 :a8919. +:a8920 :a8920 :a8920. +:a8921 :a8921 :a8921. +:a8922 :a8922 :a8922. +:a8923 :a8923 :a8923. +:a8924 :a8924 :a8924. +:a8925 :a8925 :a8925. +:a8926 :a8926 :a8926. +:a8927 :a8927 :a8927. +:a8928 :a8928 :a8928. +:a8929 :a8929 :a8929. +:a8930 :a8930 :a8930. +:a8931 :a8931 :a8931. +:a8932 :a8932 :a8932. +:a8933 :a8933 :a8933. +:a8934 :a8934 :a8934. +:a8935 :a8935 :a8935. +:a8936 :a8936 :a8936. +:a8937 :a8937 :a8937. +:a8938 :a8938 :a8938. +:a8939 :a8939 :a8939. +:a8940 :a8940 :a8940. +:a8941 :a8941 :a8941. +:a8942 :a8942 :a8942. +:a8943 :a8943 :a8943. +:a8944 :a8944 :a8944. +:a8945 :a8945 :a8945. +:a8946 :a8946 :a8946. +:a8947 :a8947 :a8947. +:a8948 :a8948 :a8948. +:a8949 :a8949 :a8949. +:a8950 :a8950 :a8950. +:a8951 :a8951 :a8951. +:a8952 :a8952 :a8952. +:a8953 :a8953 :a8953. +:a8954 :a8954 :a8954. +:a8955 :a8955 :a8955. +:a8956 :a8956 :a8956. +:a8957 :a8957 :a8957. +:a8958 :a8958 :a8958. +:a8959 :a8959 :a8959. +:a8960 :a8960 :a8960. +:a8961 :a8961 :a8961. +:a8962 :a8962 :a8962. +:a8963 :a8963 :a8963. +:a8964 :a8964 :a8964. +:a8965 :a8965 :a8965. +:a8966 :a8966 :a8966. +:a8967 :a8967 :a8967. +:a8968 :a8968 :a8968. +:a8969 :a8969 :a8969. +:a8970 :a8970 :a8970. +:a8971 :a8971 :a8971. +:a8972 :a8972 :a8972. +:a8973 :a8973 :a8973. +:a8974 :a8974 :a8974. +:a8975 :a8975 :a8975. +:a8976 :a8976 :a8976. +:a8977 :a8977 :a8977. +:a8978 :a8978 :a8978. +:a8979 :a8979 :a8979. +:a8980 :a8980 :a8980. +:a8981 :a8981 :a8981. +:a8982 :a8982 :a8982. +:a8983 :a8983 :a8983. +:a8984 :a8984 :a8984. +:a8985 :a8985 :a8985. +:a8986 :a8986 :a8986. +:a8987 :a8987 :a8987. +:a8988 :a8988 :a8988. +:a8989 :a8989 :a8989. +:a8990 :a8990 :a8990. +:a8991 :a8991 :a8991. +:a8992 :a8992 :a8992. +:a8993 :a8993 :a8993. +:a8994 :a8994 :a8994. +:a8995 :a8995 :a8995. +:a8996 :a8996 :a8996. +:a8997 :a8997 :a8997. +:a8998 :a8998 :a8998. +:a8999 :a8999 :a8999. +:a9000 :a9000 :a9000. +:a9001 :a9001 :a9001. +:a9002 :a9002 :a9002. +:a9003 :a9003 :a9003. +:a9004 :a9004 :a9004. +:a9005 :a9005 :a9005. +:a9006 :a9006 :a9006. +:a9007 :a9007 :a9007. +:a9008 :a9008 :a9008. +:a9009 :a9009 :a9009. +:a9010 :a9010 :a9010. +:a9011 :a9011 :a9011. +:a9012 :a9012 :a9012. +:a9013 :a9013 :a9013. +:a9014 :a9014 :a9014. +:a9015 :a9015 :a9015. +:a9016 :a9016 :a9016. +:a9017 :a9017 :a9017. +:a9018 :a9018 :a9018. +:a9019 :a9019 :a9019. +:a9020 :a9020 :a9020. +:a9021 :a9021 :a9021. +:a9022 :a9022 :a9022. +:a9023 :a9023 :a9023. +:a9024 :a9024 :a9024. +:a9025 :a9025 :a9025. +:a9026 :a9026 :a9026. +:a9027 :a9027 :a9027. +:a9028 :a9028 :a9028. +:a9029 :a9029 :a9029. +:a9030 :a9030 :a9030. +:a9031 :a9031 :a9031. +:a9032 :a9032 :a9032. +:a9033 :a9033 :a9033. +:a9034 :a9034 :a9034. +:a9035 :a9035 :a9035. +:a9036 :a9036 :a9036. +:a9037 :a9037 :a9037. +:a9038 :a9038 :a9038. +:a9039 :a9039 :a9039. +:a9040 :a9040 :a9040. +:a9041 :a9041 :a9041. +:a9042 :a9042 :a9042. +:a9043 :a9043 :a9043. +:a9044 :a9044 :a9044. +:a9045 :a9045 :a9045. +:a9046 :a9046 :a9046. +:a9047 :a9047 :a9047. +:a9048 :a9048 :a9048. +:a9049 :a9049 :a9049. +:a9050 :a9050 :a9050. +:a9051 :a9051 :a9051. +:a9052 :a9052 :a9052. +:a9053 :a9053 :a9053. +:a9054 :a9054 :a9054. +:a9055 :a9055 :a9055. +:a9056 :a9056 :a9056. +:a9057 :a9057 :a9057. +:a9058 :a9058 :a9058. +:a9059 :a9059 :a9059. +:a9060 :a9060 :a9060. +:a9061 :a9061 :a9061. +:a9062 :a9062 :a9062. +:a9063 :a9063 :a9063. +:a9064 :a9064 :a9064. +:a9065 :a9065 :a9065. +:a9066 :a9066 :a9066. +:a9067 :a9067 :a9067. +:a9068 :a9068 :a9068. +:a9069 :a9069 :a9069. +:a9070 :a9070 :a9070. +:a9071 :a9071 :a9071. +:a9072 :a9072 :a9072. +:a9073 :a9073 :a9073. +:a9074 :a9074 :a9074. +:a9075 :a9075 :a9075. +:a9076 :a9076 :a9076. +:a9077 :a9077 :a9077. +:a9078 :a9078 :a9078. +:a9079 :a9079 :a9079. +:a9080 :a9080 :a9080. +:a9081 :a9081 :a9081. +:a9082 :a9082 :a9082. +:a9083 :a9083 :a9083. +:a9084 :a9084 :a9084. +:a9085 :a9085 :a9085. +:a9086 :a9086 :a9086. +:a9087 :a9087 :a9087. +:a9088 :a9088 :a9088. +:a9089 :a9089 :a9089. +:a9090 :a9090 :a9090. +:a9091 :a9091 :a9091. +:a9092 :a9092 :a9092. +:a9093 :a9093 :a9093. +:a9094 :a9094 :a9094. +:a9095 :a9095 :a9095. +:a9096 :a9096 :a9096. +:a9097 :a9097 :a9097. +:a9098 :a9098 :a9098. +:a9099 :a9099 :a9099. +:a9100 :a9100 :a9100. +:a9101 :a9101 :a9101. +:a9102 :a9102 :a9102. +:a9103 :a9103 :a9103. +:a9104 :a9104 :a9104. +:a9105 :a9105 :a9105. +:a9106 :a9106 :a9106. +:a9107 :a9107 :a9107. +:a9108 :a9108 :a9108. +:a9109 :a9109 :a9109. +:a9110 :a9110 :a9110. +:a9111 :a9111 :a9111. +:a9112 :a9112 :a9112. +:a9113 :a9113 :a9113. +:a9114 :a9114 :a9114. +:a9115 :a9115 :a9115. +:a9116 :a9116 :a9116. +:a9117 :a9117 :a9117. +:a9118 :a9118 :a9118. +:a9119 :a9119 :a9119. +:a9120 :a9120 :a9120. +:a9121 :a9121 :a9121. +:a9122 :a9122 :a9122. +:a9123 :a9123 :a9123. +:a9124 :a9124 :a9124. +:a9125 :a9125 :a9125. +:a9126 :a9126 :a9126. +:a9127 :a9127 :a9127. +:a9128 :a9128 :a9128. +:a9129 :a9129 :a9129. +:a9130 :a9130 :a9130. +:a9131 :a9131 :a9131. +:a9132 :a9132 :a9132. +:a9133 :a9133 :a9133. +:a9134 :a9134 :a9134. +:a9135 :a9135 :a9135. +:a9136 :a9136 :a9136. +:a9137 :a9137 :a9137. +:a9138 :a9138 :a9138. +:a9139 :a9139 :a9139. +:a9140 :a9140 :a9140. +:a9141 :a9141 :a9141. +:a9142 :a9142 :a9142. +:a9143 :a9143 :a9143. +:a9144 :a9144 :a9144. +:a9145 :a9145 :a9145. +:a9146 :a9146 :a9146. +:a9147 :a9147 :a9147. +:a9148 :a9148 :a9148. +:a9149 :a9149 :a9149. +:a9150 :a9150 :a9150. +:a9151 :a9151 :a9151. +:a9152 :a9152 :a9152. +:a9153 :a9153 :a9153. +:a9154 :a9154 :a9154. +:a9155 :a9155 :a9155. +:a9156 :a9156 :a9156. +:a9157 :a9157 :a9157. +:a9158 :a9158 :a9158. +:a9159 :a9159 :a9159. +:a9160 :a9160 :a9160. +:a9161 :a9161 :a9161. +:a9162 :a9162 :a9162. +:a9163 :a9163 :a9163. +:a9164 :a9164 :a9164. +:a9165 :a9165 :a9165. +:a9166 :a9166 :a9166. +:a9167 :a9167 :a9167. +:a9168 :a9168 :a9168. +:a9169 :a9169 :a9169. +:a9170 :a9170 :a9170. +:a9171 :a9171 :a9171. +:a9172 :a9172 :a9172. +:a9173 :a9173 :a9173. +:a9174 :a9174 :a9174. +:a9175 :a9175 :a9175. +:a9176 :a9176 :a9176. +:a9177 :a9177 :a9177. +:a9178 :a9178 :a9178. +:a9179 :a9179 :a9179. +:a9180 :a9180 :a9180. +:a9181 :a9181 :a9181. +:a9182 :a9182 :a9182. +:a9183 :a9183 :a9183. +:a9184 :a9184 :a9184. +:a9185 :a9185 :a9185. +:a9186 :a9186 :a9186. +:a9187 :a9187 :a9187. +:a9188 :a9188 :a9188. +:a9189 :a9189 :a9189. +:a9190 :a9190 :a9190. +:a9191 :a9191 :a9191. +:a9192 :a9192 :a9192. +:a9193 :a9193 :a9193. +:a9194 :a9194 :a9194. +:a9195 :a9195 :a9195. +:a9196 :a9196 :a9196. +:a9197 :a9197 :a9197. +:a9198 :a9198 :a9198. +:a9199 :a9199 :a9199. +:a9200 :a9200 :a9200. +:a9201 :a9201 :a9201. +:a9202 :a9202 :a9202. +:a9203 :a9203 :a9203. +:a9204 :a9204 :a9204. +:a9205 :a9205 :a9205. +:a9206 :a9206 :a9206. +:a9207 :a9207 :a9207. +:a9208 :a9208 :a9208. +:a9209 :a9209 :a9209. +:a9210 :a9210 :a9210. +:a9211 :a9211 :a9211. +:a9212 :a9212 :a9212. +:a9213 :a9213 :a9213. +:a9214 :a9214 :a9214. +:a9215 :a9215 :a9215. +:a9216 :a9216 :a9216. +:a9217 :a9217 :a9217. +:a9218 :a9218 :a9218. +:a9219 :a9219 :a9219. +:a9220 :a9220 :a9220. +:a9221 :a9221 :a9221. +:a9222 :a9222 :a9222. +:a9223 :a9223 :a9223. +:a9224 :a9224 :a9224. +:a9225 :a9225 :a9225. +:a9226 :a9226 :a9226. +:a9227 :a9227 :a9227. +:a9228 :a9228 :a9228. +:a9229 :a9229 :a9229. +:a9230 :a9230 :a9230. +:a9231 :a9231 :a9231. +:a9232 :a9232 :a9232. +:a9233 :a9233 :a9233. +:a9234 :a9234 :a9234. +:a9235 :a9235 :a9235. +:a9236 :a9236 :a9236. +:a9237 :a9237 :a9237. +:a9238 :a9238 :a9238. +:a9239 :a9239 :a9239. +:a9240 :a9240 :a9240. +:a9241 :a9241 :a9241. +:a9242 :a9242 :a9242. +:a9243 :a9243 :a9243. +:a9244 :a9244 :a9244. +:a9245 :a9245 :a9245. +:a9246 :a9246 :a9246. +:a9247 :a9247 :a9247. +:a9248 :a9248 :a9248. +:a9249 :a9249 :a9249. +:a9250 :a9250 :a9250. +:a9251 :a9251 :a9251. +:a9252 :a9252 :a9252. +:a9253 :a9253 :a9253. +:a9254 :a9254 :a9254. +:a9255 :a9255 :a9255. +:a9256 :a9256 :a9256. +:a9257 :a9257 :a9257. +:a9258 :a9258 :a9258. +:a9259 :a9259 :a9259. +:a9260 :a9260 :a9260. +:a9261 :a9261 :a9261. +:a9262 :a9262 :a9262. +:a9263 :a9263 :a9263. +:a9264 :a9264 :a9264. +:a9265 :a9265 :a9265. +:a9266 :a9266 :a9266. +:a9267 :a9267 :a9267. +:a9268 :a9268 :a9268. +:a9269 :a9269 :a9269. +:a9270 :a9270 :a9270. +:a9271 :a9271 :a9271. +:a9272 :a9272 :a9272. +:a9273 :a9273 :a9273. +:a9274 :a9274 :a9274. +:a9275 :a9275 :a9275. +:a9276 :a9276 :a9276. +:a9277 :a9277 :a9277. +:a9278 :a9278 :a9278. +:a9279 :a9279 :a9279. +:a9280 :a9280 :a9280. +:a9281 :a9281 :a9281. +:a9282 :a9282 :a9282. +:a9283 :a9283 :a9283. +:a9284 :a9284 :a9284. +:a9285 :a9285 :a9285. +:a9286 :a9286 :a9286. +:a9287 :a9287 :a9287. +:a9288 :a9288 :a9288. +:a9289 :a9289 :a9289. +:a9290 :a9290 :a9290. +:a9291 :a9291 :a9291. +:a9292 :a9292 :a9292. +:a9293 :a9293 :a9293. +:a9294 :a9294 :a9294. +:a9295 :a9295 :a9295. +:a9296 :a9296 :a9296. +:a9297 :a9297 :a9297. +:a9298 :a9298 :a9298. +:a9299 :a9299 :a9299. +:a9300 :a9300 :a9300. +:a9301 :a9301 :a9301. +:a9302 :a9302 :a9302. +:a9303 :a9303 :a9303. +:a9304 :a9304 :a9304. +:a9305 :a9305 :a9305. +:a9306 :a9306 :a9306. +:a9307 :a9307 :a9307. +:a9308 :a9308 :a9308. +:a9309 :a9309 :a9309. +:a9310 :a9310 :a9310. +:a9311 :a9311 :a9311. +:a9312 :a9312 :a9312. +:a9313 :a9313 :a9313. +:a9314 :a9314 :a9314. +:a9315 :a9315 :a9315. +:a9316 :a9316 :a9316. +:a9317 :a9317 :a9317. +:a9318 :a9318 :a9318. +:a9319 :a9319 :a9319. +:a9320 :a9320 :a9320. +:a9321 :a9321 :a9321. +:a9322 :a9322 :a9322. +:a9323 :a9323 :a9323. +:a9324 :a9324 :a9324. +:a9325 :a9325 :a9325. +:a9326 :a9326 :a9326. +:a9327 :a9327 :a9327. +:a9328 :a9328 :a9328. +:a9329 :a9329 :a9329. +:a9330 :a9330 :a9330. +:a9331 :a9331 :a9331. +:a9332 :a9332 :a9332. +:a9333 :a9333 :a9333. +:a9334 :a9334 :a9334. +:a9335 :a9335 :a9335. +:a9336 :a9336 :a9336. +:a9337 :a9337 :a9337. +:a9338 :a9338 :a9338. +:a9339 :a9339 :a9339. +:a9340 :a9340 :a9340. +:a9341 :a9341 :a9341. +:a9342 :a9342 :a9342. +:a9343 :a9343 :a9343. +:a9344 :a9344 :a9344. +:a9345 :a9345 :a9345. +:a9346 :a9346 :a9346. +:a9347 :a9347 :a9347. +:a9348 :a9348 :a9348. +:a9349 :a9349 :a9349. +:a9350 :a9350 :a9350. +:a9351 :a9351 :a9351. +:a9352 :a9352 :a9352. +:a9353 :a9353 :a9353. +:a9354 :a9354 :a9354. +:a9355 :a9355 :a9355. +:a9356 :a9356 :a9356. +:a9357 :a9357 :a9357. +:a9358 :a9358 :a9358. +:a9359 :a9359 :a9359. +:a9360 :a9360 :a9360. +:a9361 :a9361 :a9361. +:a9362 :a9362 :a9362. +:a9363 :a9363 :a9363. +:a9364 :a9364 :a9364. +:a9365 :a9365 :a9365. +:a9366 :a9366 :a9366. +:a9367 :a9367 :a9367. +:a9368 :a9368 :a9368. +:a9369 :a9369 :a9369. +:a9370 :a9370 :a9370. +:a9371 :a9371 :a9371. +:a9372 :a9372 :a9372. +:a9373 :a9373 :a9373. +:a9374 :a9374 :a9374. +:a9375 :a9375 :a9375. +:a9376 :a9376 :a9376. +:a9377 :a9377 :a9377. +:a9378 :a9378 :a9378. +:a9379 :a9379 :a9379. +:a9380 :a9380 :a9380. +:a9381 :a9381 :a9381. +:a9382 :a9382 :a9382. +:a9383 :a9383 :a9383. +:a9384 :a9384 :a9384. +:a9385 :a9385 :a9385. +:a9386 :a9386 :a9386. +:a9387 :a9387 :a9387. +:a9388 :a9388 :a9388. +:a9389 :a9389 :a9389. +:a9390 :a9390 :a9390. +:a9391 :a9391 :a9391. +:a9392 :a9392 :a9392. +:a9393 :a9393 :a9393. +:a9394 :a9394 :a9394. +:a9395 :a9395 :a9395. +:a9396 :a9396 :a9396. +:a9397 :a9397 :a9397. +:a9398 :a9398 :a9398. +:a9399 :a9399 :a9399. +:a9400 :a9400 :a9400. +:a9401 :a9401 :a9401. +:a9402 :a9402 :a9402. +:a9403 :a9403 :a9403. +:a9404 :a9404 :a9404. +:a9405 :a9405 :a9405. +:a9406 :a9406 :a9406. +:a9407 :a9407 :a9407. +:a9408 :a9408 :a9408. +:a9409 :a9409 :a9409. +:a9410 :a9410 :a9410. +:a9411 :a9411 :a9411. +:a9412 :a9412 :a9412. +:a9413 :a9413 :a9413. +:a9414 :a9414 :a9414. +:a9415 :a9415 :a9415. +:a9416 :a9416 :a9416. +:a9417 :a9417 :a9417. +:a9418 :a9418 :a9418. +:a9419 :a9419 :a9419. +:a9420 :a9420 :a9420. +:a9421 :a9421 :a9421. +:a9422 :a9422 :a9422. +:a9423 :a9423 :a9423. +:a9424 :a9424 :a9424. +:a9425 :a9425 :a9425. +:a9426 :a9426 :a9426. +:a9427 :a9427 :a9427. +:a9428 :a9428 :a9428. +:a9429 :a9429 :a9429. +:a9430 :a9430 :a9430. +:a9431 :a9431 :a9431. +:a9432 :a9432 :a9432. +:a9433 :a9433 :a9433. +:a9434 :a9434 :a9434. +:a9435 :a9435 :a9435. +:a9436 :a9436 :a9436. +:a9437 :a9437 :a9437. +:a9438 :a9438 :a9438. +:a9439 :a9439 :a9439. +:a9440 :a9440 :a9440. +:a9441 :a9441 :a9441. +:a9442 :a9442 :a9442. +:a9443 :a9443 :a9443. +:a9444 :a9444 :a9444. +:a9445 :a9445 :a9445. +:a9446 :a9446 :a9446. +:a9447 :a9447 :a9447. +:a9448 :a9448 :a9448. +:a9449 :a9449 :a9449. +:a9450 :a9450 :a9450. +:a9451 :a9451 :a9451. +:a9452 :a9452 :a9452. +:a9453 :a9453 :a9453. +:a9454 :a9454 :a9454. +:a9455 :a9455 :a9455. +:a9456 :a9456 :a9456. +:a9457 :a9457 :a9457. +:a9458 :a9458 :a9458. +:a9459 :a9459 :a9459. +:a9460 :a9460 :a9460. +:a9461 :a9461 :a9461. +:a9462 :a9462 :a9462. +:a9463 :a9463 :a9463. +:a9464 :a9464 :a9464. +:a9465 :a9465 :a9465. +:a9466 :a9466 :a9466. +:a9467 :a9467 :a9467. +:a9468 :a9468 :a9468. +:a9469 :a9469 :a9469. +:a9470 :a9470 :a9470. +:a9471 :a9471 :a9471. +:a9472 :a9472 :a9472. +:a9473 :a9473 :a9473. +:a9474 :a9474 :a9474. +:a9475 :a9475 :a9475. +:a9476 :a9476 :a9476. +:a9477 :a9477 :a9477. +:a9478 :a9478 :a9478. +:a9479 :a9479 :a9479. +:a9480 :a9480 :a9480. +:a9481 :a9481 :a9481. +:a9482 :a9482 :a9482. +:a9483 :a9483 :a9483. +:a9484 :a9484 :a9484. +:a9485 :a9485 :a9485. +:a9486 :a9486 :a9486. +:a9487 :a9487 :a9487. +:a9488 :a9488 :a9488. +:a9489 :a9489 :a9489. +:a9490 :a9490 :a9490. +:a9491 :a9491 :a9491. +:a9492 :a9492 :a9492. +:a9493 :a9493 :a9493. +:a9494 :a9494 :a9494. +:a9495 :a9495 :a9495. +:a9496 :a9496 :a9496. +:a9497 :a9497 :a9497. +:a9498 :a9498 :a9498. +:a9499 :a9499 :a9499. +:a9500 :a9500 :a9500. +:a9501 :a9501 :a9501. +:a9502 :a9502 :a9502. +:a9503 :a9503 :a9503. +:a9504 :a9504 :a9504. +:a9505 :a9505 :a9505. +:a9506 :a9506 :a9506. +:a9507 :a9507 :a9507. +:a9508 :a9508 :a9508. +:a9509 :a9509 :a9509. +:a9510 :a9510 :a9510. +:a9511 :a9511 :a9511. +:a9512 :a9512 :a9512. +:a9513 :a9513 :a9513. +:a9514 :a9514 :a9514. +:a9515 :a9515 :a9515. +:a9516 :a9516 :a9516. +:a9517 :a9517 :a9517. +:a9518 :a9518 :a9518. +:a9519 :a9519 :a9519. +:a9520 :a9520 :a9520. +:a9521 :a9521 :a9521. +:a9522 :a9522 :a9522. +:a9523 :a9523 :a9523. +:a9524 :a9524 :a9524. +:a9525 :a9525 :a9525. +:a9526 :a9526 :a9526. +:a9527 :a9527 :a9527. +:a9528 :a9528 :a9528. +:a9529 :a9529 :a9529. +:a9530 :a9530 :a9530. +:a9531 :a9531 :a9531. +:a9532 :a9532 :a9532. +:a9533 :a9533 :a9533. +:a9534 :a9534 :a9534. +:a9535 :a9535 :a9535. +:a9536 :a9536 :a9536. +:a9537 :a9537 :a9537. +:a9538 :a9538 :a9538. +:a9539 :a9539 :a9539. +:a9540 :a9540 :a9540. +:a9541 :a9541 :a9541. +:a9542 :a9542 :a9542. +:a9543 :a9543 :a9543. +:a9544 :a9544 :a9544. +:a9545 :a9545 :a9545. +:a9546 :a9546 :a9546. +:a9547 :a9547 :a9547. +:a9548 :a9548 :a9548. +:a9549 :a9549 :a9549. +:a9550 :a9550 :a9550. +:a9551 :a9551 :a9551. +:a9552 :a9552 :a9552. +:a9553 :a9553 :a9553. +:a9554 :a9554 :a9554. +:a9555 :a9555 :a9555. +:a9556 :a9556 :a9556. +:a9557 :a9557 :a9557. +:a9558 :a9558 :a9558. +:a9559 :a9559 :a9559. +:a9560 :a9560 :a9560. +:a9561 :a9561 :a9561. +:a9562 :a9562 :a9562. +:a9563 :a9563 :a9563. +:a9564 :a9564 :a9564. +:a9565 :a9565 :a9565. +:a9566 :a9566 :a9566. +:a9567 :a9567 :a9567. +:a9568 :a9568 :a9568. +:a9569 :a9569 :a9569. +:a9570 :a9570 :a9570. +:a9571 :a9571 :a9571. +:a9572 :a9572 :a9572. +:a9573 :a9573 :a9573. +:a9574 :a9574 :a9574. +:a9575 :a9575 :a9575. +:a9576 :a9576 :a9576. +:a9577 :a9577 :a9577. +:a9578 :a9578 :a9578. +:a9579 :a9579 :a9579. +:a9580 :a9580 :a9580. +:a9581 :a9581 :a9581. +:a9582 :a9582 :a9582. +:a9583 :a9583 :a9583. +:a9584 :a9584 :a9584. +:a9585 :a9585 :a9585. +:a9586 :a9586 :a9586. +:a9587 :a9587 :a9587. +:a9588 :a9588 :a9588. +:a9589 :a9589 :a9589. +:a9590 :a9590 :a9590. +:a9591 :a9591 :a9591. +:a9592 :a9592 :a9592. +:a9593 :a9593 :a9593. +:a9594 :a9594 :a9594. +:a9595 :a9595 :a9595. +:a9596 :a9596 :a9596. +:a9597 :a9597 :a9597. +:a9598 :a9598 :a9598. +:a9599 :a9599 :a9599. +:a9600 :a9600 :a9600. +:a9601 :a9601 :a9601. +:a9602 :a9602 :a9602. +:a9603 :a9603 :a9603. +:a9604 :a9604 :a9604. +:a9605 :a9605 :a9605. +:a9606 :a9606 :a9606. +:a9607 :a9607 :a9607. +:a9608 :a9608 :a9608. +:a9609 :a9609 :a9609. +:a9610 :a9610 :a9610. +:a9611 :a9611 :a9611. +:a9612 :a9612 :a9612. +:a9613 :a9613 :a9613. +:a9614 :a9614 :a9614. +:a9615 :a9615 :a9615. +:a9616 :a9616 :a9616. +:a9617 :a9617 :a9617. +:a9618 :a9618 :a9618. +:a9619 :a9619 :a9619. +:a9620 :a9620 :a9620. +:a9621 :a9621 :a9621. +:a9622 :a9622 :a9622. +:a9623 :a9623 :a9623. +:a9624 :a9624 :a9624. +:a9625 :a9625 :a9625. +:a9626 :a9626 :a9626. +:a9627 :a9627 :a9627. +:a9628 :a9628 :a9628. +:a9629 :a9629 :a9629. +:a9630 :a9630 :a9630. +:a9631 :a9631 :a9631. +:a9632 :a9632 :a9632. +:a9633 :a9633 :a9633. +:a9634 :a9634 :a9634. +:a9635 :a9635 :a9635. +:a9636 :a9636 :a9636. +:a9637 :a9637 :a9637. +:a9638 :a9638 :a9638. +:a9639 :a9639 :a9639. +:a9640 :a9640 :a9640. +:a9641 :a9641 :a9641. +:a9642 :a9642 :a9642. +:a9643 :a9643 :a9643. +:a9644 :a9644 :a9644. +:a9645 :a9645 :a9645. +:a9646 :a9646 :a9646. +:a9647 :a9647 :a9647. +:a9648 :a9648 :a9648. +:a9649 :a9649 :a9649. +:a9650 :a9650 :a9650. +:a9651 :a9651 :a9651. +:a9652 :a9652 :a9652. +:a9653 :a9653 :a9653. +:a9654 :a9654 :a9654. +:a9655 :a9655 :a9655. +:a9656 :a9656 :a9656. +:a9657 :a9657 :a9657. +:a9658 :a9658 :a9658. +:a9659 :a9659 :a9659. +:a9660 :a9660 :a9660. +:a9661 :a9661 :a9661. +:a9662 :a9662 :a9662. +:a9663 :a9663 :a9663. +:a9664 :a9664 :a9664. +:a9665 :a9665 :a9665. +:a9666 :a9666 :a9666. +:a9667 :a9667 :a9667. +:a9668 :a9668 :a9668. +:a9669 :a9669 :a9669. +:a9670 :a9670 :a9670. +:a9671 :a9671 :a9671. +:a9672 :a9672 :a9672. +:a9673 :a9673 :a9673. +:a9674 :a9674 :a9674. +:a9675 :a9675 :a9675. +:a9676 :a9676 :a9676. +:a9677 :a9677 :a9677. +:a9678 :a9678 :a9678. +:a9679 :a9679 :a9679. +:a9680 :a9680 :a9680. +:a9681 :a9681 :a9681. +:a9682 :a9682 :a9682. +:a9683 :a9683 :a9683. +:a9684 :a9684 :a9684. +:a9685 :a9685 :a9685. +:a9686 :a9686 :a9686. +:a9687 :a9687 :a9687. +:a9688 :a9688 :a9688. +:a9689 :a9689 :a9689. +:a9690 :a9690 :a9690. +:a9691 :a9691 :a9691. +:a9692 :a9692 :a9692. +:a9693 :a9693 :a9693. +:a9694 :a9694 :a9694. +:a9695 :a9695 :a9695. +:a9696 :a9696 :a9696. +:a9697 :a9697 :a9697. +:a9698 :a9698 :a9698. +:a9699 :a9699 :a9699. +:a9700 :a9700 :a9700. +:a9701 :a9701 :a9701. +:a9702 :a9702 :a9702. +:a9703 :a9703 :a9703. +:a9704 :a9704 :a9704. +:a9705 :a9705 :a9705. +:a9706 :a9706 :a9706. +:a9707 :a9707 :a9707. +:a9708 :a9708 :a9708. +:a9709 :a9709 :a9709. +:a9710 :a9710 :a9710. +:a9711 :a9711 :a9711. +:a9712 :a9712 :a9712. +:a9713 :a9713 :a9713. +:a9714 :a9714 :a9714. +:a9715 :a9715 :a9715. +:a9716 :a9716 :a9716. +:a9717 :a9717 :a9717. +:a9718 :a9718 :a9718. +:a9719 :a9719 :a9719. +:a9720 :a9720 :a9720. +:a9721 :a9721 :a9721. +:a9722 :a9722 :a9722. +:a9723 :a9723 :a9723. +:a9724 :a9724 :a9724. +:a9725 :a9725 :a9725. +:a9726 :a9726 :a9726. +:a9727 :a9727 :a9727. +:a9728 :a9728 :a9728. +:a9729 :a9729 :a9729. +:a9730 :a9730 :a9730. +:a9731 :a9731 :a9731. +:a9732 :a9732 :a9732. +:a9733 :a9733 :a9733. +:a9734 :a9734 :a9734. +:a9735 :a9735 :a9735. +:a9736 :a9736 :a9736. +:a9737 :a9737 :a9737. +:a9738 :a9738 :a9738. +:a9739 :a9739 :a9739. +:a9740 :a9740 :a9740. +:a9741 :a9741 :a9741. +:a9742 :a9742 :a9742. +:a9743 :a9743 :a9743. +:a9744 :a9744 :a9744. +:a9745 :a9745 :a9745. +:a9746 :a9746 :a9746. +:a9747 :a9747 :a9747. +:a9748 :a9748 :a9748. +:a9749 :a9749 :a9749. +:a9750 :a9750 :a9750. +:a9751 :a9751 :a9751. +:a9752 :a9752 :a9752. +:a9753 :a9753 :a9753. +:a9754 :a9754 :a9754. +:a9755 :a9755 :a9755. +:a9756 :a9756 :a9756. +:a9757 :a9757 :a9757. +:a9758 :a9758 :a9758. +:a9759 :a9759 :a9759. +:a9760 :a9760 :a9760. +:a9761 :a9761 :a9761. +:a9762 :a9762 :a9762. +:a9763 :a9763 :a9763. +:a9764 :a9764 :a9764. +:a9765 :a9765 :a9765. +:a9766 :a9766 :a9766. +:a9767 :a9767 :a9767. +:a9768 :a9768 :a9768. +:a9769 :a9769 :a9769. +:a9770 :a9770 :a9770. +:a9771 :a9771 :a9771. +:a9772 :a9772 :a9772. +:a9773 :a9773 :a9773. +:a9774 :a9774 :a9774. +:a9775 :a9775 :a9775. +:a9776 :a9776 :a9776. +:a9777 :a9777 :a9777. +:a9778 :a9778 :a9778. +:a9779 :a9779 :a9779. +:a9780 :a9780 :a9780. +:a9781 :a9781 :a9781. +:a9782 :a9782 :a9782. +:a9783 :a9783 :a9783. +:a9784 :a9784 :a9784. +:a9785 :a9785 :a9785. +:a9786 :a9786 :a9786. +:a9787 :a9787 :a9787. +:a9788 :a9788 :a9788. +:a9789 :a9789 :a9789. +:a9790 :a9790 :a9790. +:a9791 :a9791 :a9791. +:a9792 :a9792 :a9792. +:a9793 :a9793 :a9793. +:a9794 :a9794 :a9794. +:a9795 :a9795 :a9795. +:a9796 :a9796 :a9796. +:a9797 :a9797 :a9797. +:a9798 :a9798 :a9798. +:a9799 :a9799 :a9799. +:a9800 :a9800 :a9800. +:a9801 :a9801 :a9801. +:a9802 :a9802 :a9802. +:a9803 :a9803 :a9803. +:a9804 :a9804 :a9804. +:a9805 :a9805 :a9805. +:a9806 :a9806 :a9806. +:a9807 :a9807 :a9807. +:a9808 :a9808 :a9808. +:a9809 :a9809 :a9809. +:a9810 :a9810 :a9810. +:a9811 :a9811 :a9811. +:a9812 :a9812 :a9812. +:a9813 :a9813 :a9813. +:a9814 :a9814 :a9814. +:a9815 :a9815 :a9815. +:a9816 :a9816 :a9816. +:a9817 :a9817 :a9817. +:a9818 :a9818 :a9818. +:a9819 :a9819 :a9819. +:a9820 :a9820 :a9820. +:a9821 :a9821 :a9821. +:a9822 :a9822 :a9822. +:a9823 :a9823 :a9823. +:a9824 :a9824 :a9824. +:a9825 :a9825 :a9825. +:a9826 :a9826 :a9826. +:a9827 :a9827 :a9827. +:a9828 :a9828 :a9828. +:a9829 :a9829 :a9829. +:a9830 :a9830 :a9830. +:a9831 :a9831 :a9831. +:a9832 :a9832 :a9832. +:a9833 :a9833 :a9833. +:a9834 :a9834 :a9834. +:a9835 :a9835 :a9835. +:a9836 :a9836 :a9836. +:a9837 :a9837 :a9837. +:a9838 :a9838 :a9838. +:a9839 :a9839 :a9839. +:a9840 :a9840 :a9840. +:a9841 :a9841 :a9841. +:a9842 :a9842 :a9842. +:a9843 :a9843 :a9843. +:a9844 :a9844 :a9844. +:a9845 :a9845 :a9845. +:a9846 :a9846 :a9846. +:a9847 :a9847 :a9847. +:a9848 :a9848 :a9848. +:a9849 :a9849 :a9849. +:a9850 :a9850 :a9850. +:a9851 :a9851 :a9851. +:a9852 :a9852 :a9852. +:a9853 :a9853 :a9853. +:a9854 :a9854 :a9854. +:a9855 :a9855 :a9855. +:a9856 :a9856 :a9856. +:a9857 :a9857 :a9857. +:a9858 :a9858 :a9858. +:a9859 :a9859 :a9859. +:a9860 :a9860 :a9860. +:a9861 :a9861 :a9861. +:a9862 :a9862 :a9862. +:a9863 :a9863 :a9863. +:a9864 :a9864 :a9864. +:a9865 :a9865 :a9865. +:a9866 :a9866 :a9866. +:a9867 :a9867 :a9867. +:a9868 :a9868 :a9868. +:a9869 :a9869 :a9869. +:a9870 :a9870 :a9870. +:a9871 :a9871 :a9871. +:a9872 :a9872 :a9872. +:a9873 :a9873 :a9873. +:a9874 :a9874 :a9874. +:a9875 :a9875 :a9875. +:a9876 :a9876 :a9876. +:a9877 :a9877 :a9877. +:a9878 :a9878 :a9878. +:a9879 :a9879 :a9879. +:a9880 :a9880 :a9880. +:a9881 :a9881 :a9881. +:a9882 :a9882 :a9882. +:a9883 :a9883 :a9883. +:a9884 :a9884 :a9884. +:a9885 :a9885 :a9885. +:a9886 :a9886 :a9886. +:a9887 :a9887 :a9887. +:a9888 :a9888 :a9888. +:a9889 :a9889 :a9889. +:a9890 :a9890 :a9890. +:a9891 :a9891 :a9891. +:a9892 :a9892 :a9892. +:a9893 :a9893 :a9893. +:a9894 :a9894 :a9894. +:a9895 :a9895 :a9895. +:a9896 :a9896 :a9896. +:a9897 :a9897 :a9897. +:a9898 :a9898 :a9898. +:a9899 :a9899 :a9899. +:a9900 :a9900 :a9900. +:a9901 :a9901 :a9901. +:a9902 :a9902 :a9902. +:a9903 :a9903 :a9903. +:a9904 :a9904 :a9904. +:a9905 :a9905 :a9905. +:a9906 :a9906 :a9906. +:a9907 :a9907 :a9907. +:a9908 :a9908 :a9908. +:a9909 :a9909 :a9909. +:a9910 :a9910 :a9910. +:a9911 :a9911 :a9911. +:a9912 :a9912 :a9912. +:a9913 :a9913 :a9913. +:a9914 :a9914 :a9914. +:a9915 :a9915 :a9915. +:a9916 :a9916 :a9916. +:a9917 :a9917 :a9917. +:a9918 :a9918 :a9918. +:a9919 :a9919 :a9919. +:a9920 :a9920 :a9920. +:a9921 :a9921 :a9921. +:a9922 :a9922 :a9922. +:a9923 :a9923 :a9923. +:a9924 :a9924 :a9924. +:a9925 :a9925 :a9925. +:a9926 :a9926 :a9926. +:a9927 :a9927 :a9927. +:a9928 :a9928 :a9928. +:a9929 :a9929 :a9929. +:a9930 :a9930 :a9930. +:a9931 :a9931 :a9931. +:a9932 :a9932 :a9932. +:a9933 :a9933 :a9933. +:a9934 :a9934 :a9934. +:a9935 :a9935 :a9935. +:a9936 :a9936 :a9936. +:a9937 :a9937 :a9937. +:a9938 :a9938 :a9938. +:a9939 :a9939 :a9939. +:a9940 :a9940 :a9940. +:a9941 :a9941 :a9941. +:a9942 :a9942 :a9942. +:a9943 :a9943 :a9943. +:a9944 :a9944 :a9944. +:a9945 :a9945 :a9945. +:a9946 :a9946 :a9946. +:a9947 :a9947 :a9947. +:a9948 :a9948 :a9948. +:a9949 :a9949 :a9949. +:a9950 :a9950 :a9950. +:a9951 :a9951 :a9951. +:a9952 :a9952 :a9952. +:a9953 :a9953 :a9953. +:a9954 :a9954 :a9954. +:a9955 :a9955 :a9955. +:a9956 :a9956 :a9956. +:a9957 :a9957 :a9957. +:a9958 :a9958 :a9958. +:a9959 :a9959 :a9959. +:a9960 :a9960 :a9960. +:a9961 :a9961 :a9961. +:a9962 :a9962 :a9962. +:a9963 :a9963 :a9963. +:a9964 :a9964 :a9964. +:a9965 :a9965 :a9965. +:a9966 :a9966 :a9966. +:a9967 :a9967 :a9967. +:a9968 :a9968 :a9968. +:a9969 :a9969 :a9969. +:a9970 :a9970 :a9970. +:a9971 :a9971 :a9971. +:a9972 :a9972 :a9972. +:a9973 :a9973 :a9973. +:a9974 :a9974 :a9974. +:a9975 :a9975 :a9975. +:a9976 :a9976 :a9976. +:a9977 :a9977 :a9977. +:a9978 :a9978 :a9978. +:a9979 :a9979 :a9979. +:a9980 :a9980 :a9980. +:a9981 :a9981 :a9981. +:a9982 :a9982 :a9982. +:a9983 :a9983 :a9983. +:a9984 :a9984 :a9984. +:a9985 :a9985 :a9985. +:a9986 :a9986 :a9986. +:a9987 :a9987 :a9987. +:a9988 :a9988 :a9988. +:a9989 :a9989 :a9989. +:a9990 :a9990 :a9990. +:a9991 :a9991 :a9991. +:a9992 :a9992 :a9992. +:a9993 :a9993 :a9993. +:a9994 :a9994 :a9994. +:a9995 :a9995 :a9995. +:a9996 :a9996 :a9996. +:a9997 :a9997 :a9997. +:a9998 :a9998 :a9998. +:a9999 :a9999 :a9999. +:a10000 :a10000 :a10000. diff --git a/tests/turtle/test-15.out b/tests/turtle/test-15.out new file mode 100644 index 0000000..c0604b3 --- /dev/null +++ b/tests/turtle/test-15.out @@ -0,0 +1,10000 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/turtle/test-15.ttl b/tests/turtle/test-15.ttl new file mode 100644 index 0000000..10df17d --- /dev/null +++ b/tests/turtle/test-15.ttl @@ -0,0 +1,3 @@ +# 10000 triple objects (10000 triples) more than the default Bison stack size +@prefix : . +:a :b :c1, :c2, :c3, :c4, :c5, :c6, :c7, :c8, :c9, :c10, :c11, :c12, :c13, :c14, :c15, :c16, :c17, :c18, :c19, :c20, :c21, :c22, :c23, :c24, :c25, :c26, :c27, :c28, :c29, :c30, :c31, :c32, :c33, :c34, :c35, :c36, :c37, :c38, :c39, :c40, :c41, :c42, :c43, :c44, :c45, :c46, :c47, :c48, :c49, :c50, :c51, :c52, :c53, :c54, :c55, :c56, :c57, :c58, :c59, :c60, :c61, :c62, :c63, :c64, :c65, :c66, :c67, :c68, :c69, :c70, :c71, :c72, :c73, :c74, :c75, :c76, :c77, :c78, :c79, :c80, :c81, :c82, :c83, :c84, :c85, :c86, :c87, :c88, :c89, :c90, :c91, :c92, :c93, :c94, :c95, :c96, :c97, :c98, :c99, :c100, :c101, :c102, :c103, :c104, :c105, :c106, :c107, :c108, :c109, :c110, :c111, :c112, :c113, :c114, :c115, :c116, :c117, :c118, :c119, :c120, :c121, :c122, :c123, :c124, :c125, :c126, :c127, :c128, :c129, :c130, :c131, :c132, :c133, :c134, :c135, :c136, :c137, :c138, :c139, :c140, :c141, :c142, :c143, :c144, :c145, :c146, :c147, :c148, :c149, :c150, :c151, :c152, :c153, :c154, :c155, :c156, :c157, :c158, :c159, :c160, :c161, :c162, :c163, :c164, :c165, :c166, :c167, :c168, :c169, :c170, :c171, :c172, :c173, :c174, :c175, :c176, :c177, :c178, :c179, :c180, :c181, :c182, :c183, :c184, :c185, :c186, :c187, :c188, :c189, :c190, :c191, :c192, :c193, :c194, :c195, :c196, :c197, :c198, :c199, :c200, :c201, :c202, :c203, :c204, :c205, :c206, :c207, :c208, :c209, :c210, :c211, :c212, :c213, :c214, :c215, :c216, :c217, :c218, :c219, :c220, :c221, :c222, :c223, :c224, :c225, :c226, :c227, :c228, :c229, :c230, :c231, :c232, :c233, :c234, :c235, :c236, :c237, :c238, :c239, :c240, :c241, :c242, :c243, :c244, :c245, :c246, :c247, :c248, :c249, :c250, :c251, :c252, :c253, :c254, :c255, :c256, :c257, :c258, :c259, :c260, :c261, :c262, :c263, :c264, :c265, :c266, :c267, :c268, :c269, :c270, :c271, :c272, :c273, :c274, :c275, :c276, :c277, :c278, :c279, :c280, :c281, :c282, :c283, :c284, :c285, :c286, :c287, :c288, :c289, :c290, :c291, :c292, :c293, :c294, :c295, :c296, :c297, :c298, :c299, :c300, :c301, :c302, :c303, :c304, :c305, :c306, :c307, :c308, :c309, :c310, :c311, :c312, :c313, :c314, :c315, :c316, :c317, :c318, :c319, :c320, :c321, :c322, :c323, :c324, :c325, :c326, :c327, :c328, :c329, :c330, :c331, :c332, :c333, :c334, :c335, :c336, :c337, :c338, :c339, :c340, :c341, :c342, :c343, :c344, :c345, :c346, :c347, :c348, :c349, :c350, :c351, :c352, :c353, :c354, :c355, :c356, :c357, :c358, :c359, :c360, :c361, :c362, :c363, :c364, :c365, :c366, :c367, :c368, :c369, :c370, :c371, :c372, :c373, :c374, :c375, :c376, :c377, :c378, :c379, :c380, :c381, :c382, :c383, :c384, :c385, :c386, :c387, :c388, :c389, :c390, :c391, :c392, :c393, :c394, :c395, :c396, :c397, :c398, :c399, :c400, :c401, :c402, :c403, :c404, :c405, :c406, :c407, :c408, :c409, :c410, :c411, :c412, :c413, :c414, :c415, :c416, :c417, :c418, :c419, :c420, :c421, :c422, :c423, :c424, :c425, :c426, :c427, :c428, :c429, :c430, :c431, :c432, :c433, :c434, :c435, :c436, :c437, :c438, :c439, :c440, :c441, :c442, :c443, :c444, :c445, :c446, :c447, :c448, :c449, :c450, :c451, :c452, :c453, :c454, :c455, :c456, :c457, :c458, :c459, :c460, :c461, :c462, :c463, :c464, :c465, :c466, :c467, :c468, :c469, :c470, :c471, :c472, :c473, :c474, :c475, :c476, :c477, :c478, :c479, :c480, :c481, :c482, :c483, :c484, :c485, :c486, :c487, :c488, :c489, :c490, :c491, :c492, :c493, :c494, :c495, :c496, :c497, :c498, :c499, :c500, :c501, :c502, :c503, :c504, :c505, :c506, :c507, :c508, :c509, :c510, :c511, :c512, :c513, :c514, :c515, :c516, :c517, :c518, :c519, :c520, :c521, :c522, :c523, :c524, :c525, :c526, :c527, :c528, :c529, :c530, :c531, :c532, :c533, :c534, :c535, :c536, :c537, :c538, :c539, :c540, :c541, :c542, :c543, :c544, :c545, :c546, :c547, :c548, :c549, :c550, :c551, :c552, :c553, :c554, :c555, :c556, :c557, :c558, :c559, :c560, :c561, :c562, :c563, :c564, :c565, :c566, :c567, :c568, :c569, :c570, :c571, :c572, :c573, :c574, :c575, :c576, :c577, :c578, :c579, :c580, :c581, :c582, :c583, :c584, :c585, :c586, :c587, :c588, :c589, :c590, :c591, :c592, :c593, :c594, :c595, :c596, :c597, :c598, :c599, :c600, :c601, :c602, :c603, :c604, :c605, :c606, :c607, :c608, :c609, :c610, :c611, :c612, :c613, :c614, :c615, :c616, :c617, :c618, :c619, :c620, :c621, :c622, :c623, :c624, :c625, :c626, :c627, :c628, :c629, :c630, :c631, :c632, :c633, :c634, :c635, :c636, :c637, :c638, :c639, :c640, :c641, :c642, :c643, :c644, :c645, :c646, :c647, :c648, :c649, :c650, :c651, :c652, :c653, :c654, :c655, :c656, :c657, :c658, :c659, :c660, :c661, :c662, :c663, :c664, :c665, :c666, :c667, :c668, :c669, :c670, :c671, :c672, :c673, :c674, :c675, :c676, :c677, :c678, :c679, :c680, :c681, :c682, :c683, :c684, :c685, :c686, :c687, :c688, :c689, :c690, :c691, :c692, :c693, :c694, :c695, :c696, :c697, :c698, :c699, :c700, :c701, :c702, :c703, :c704, :c705, :c706, :c707, :c708, :c709, :c710, :c711, :c712, :c713, :c714, :c715, :c716, :c717, :c718, :c719, :c720, :c721, :c722, :c723, :c724, :c725, :c726, :c727, :c728, :c729, :c730, :c731, :c732, :c733, :c734, :c735, :c736, :c737, :c738, :c739, :c740, :c741, :c742, :c743, :c744, :c745, :c746, :c747, :c748, :c749, :c750, :c751, :c752, :c753, :c754, :c755, :c756, :c757, :c758, :c759, :c760, :c761, :c762, :c763, :c764, :c765, :c766, :c767, :c768, :c769, :c770, :c771, :c772, :c773, :c774, :c775, :c776, :c777, :c778, :c779, :c780, :c781, :c782, :c783, :c784, :c785, :c786, :c787, :c788, :c789, :c790, :c791, :c792, :c793, :c794, :c795, :c796, :c797, :c798, :c799, :c800, :c801, :c802, :c803, :c804, :c805, :c806, :c807, :c808, :c809, :c810, :c811, :c812, :c813, :c814, :c815, :c816, :c817, :c818, :c819, :c820, :c821, :c822, :c823, :c824, :c825, :c826, :c827, :c828, :c829, :c830, :c831, :c832, :c833, :c834, :c835, :c836, :c837, :c838, :c839, :c840, :c841, :c842, :c843, :c844, :c845, :c846, :c847, :c848, :c849, :c850, :c851, :c852, :c853, :c854, :c855, :c856, :c857, :c858, :c859, :c860, :c861, :c862, :c863, :c864, :c865, :c866, :c867, :c868, :c869, :c870, :c871, :c872, :c873, :c874, :c875, :c876, :c877, :c878, :c879, :c880, :c881, :c882, :c883, :c884, :c885, :c886, :c887, :c888, :c889, :c890, :c891, :c892, :c893, :c894, :c895, :c896, :c897, :c898, :c899, :c900, :c901, :c902, :c903, :c904, :c905, :c906, :c907, :c908, :c909, :c910, :c911, :c912, :c913, :c914, :c915, :c916, :c917, :c918, :c919, :c920, :c921, :c922, :c923, :c924, :c925, :c926, :c927, :c928, :c929, :c930, :c931, :c932, :c933, :c934, :c935, :c936, :c937, :c938, :c939, :c940, :c941, :c942, :c943, :c944, :c945, :c946, :c947, :c948, :c949, :c950, :c951, :c952, :c953, :c954, :c955, :c956, :c957, :c958, :c959, :c960, :c961, :c962, :c963, :c964, :c965, :c966, :c967, :c968, :c969, :c970, :c971, :c972, :c973, :c974, :c975, :c976, :c977, :c978, :c979, :c980, :c981, :c982, :c983, :c984, :c985, :c986, :c987, :c988, :c989, :c990, :c991, :c992, :c993, :c994, :c995, :c996, :c997, :c998, :c999, :c1000, :c1001, :c1002, :c1003, :c1004, :c1005, :c1006, :c1007, :c1008, :c1009, :c1010, :c1011, :c1012, :c1013, :c1014, :c1015, :c1016, :c1017, :c1018, :c1019, :c1020, :c1021, :c1022, :c1023, :c1024, :c1025, :c1026, :c1027, :c1028, :c1029, :c1030, :c1031, :c1032, :c1033, :c1034, :c1035, :c1036, :c1037, :c1038, :c1039, :c1040, :c1041, :c1042, :c1043, :c1044, :c1045, :c1046, :c1047, :c1048, :c1049, :c1050, :c1051, :c1052, :c1053, :c1054, :c1055, :c1056, :c1057, :c1058, :c1059, :c1060, :c1061, :c1062, :c1063, :c1064, :c1065, :c1066, :c1067, :c1068, :c1069, :c1070, :c1071, :c1072, :c1073, :c1074, :c1075, :c1076, :c1077, :c1078, :c1079, :c1080, :c1081, :c1082, :c1083, :c1084, :c1085, :c1086, :c1087, :c1088, :c1089, :c1090, :c1091, :c1092, :c1093, :c1094, :c1095, :c1096, :c1097, :c1098, :c1099, :c1100, :c1101, :c1102, :c1103, :c1104, :c1105, :c1106, :c1107, :c1108, :c1109, :c1110, :c1111, :c1112, :c1113, :c1114, :c1115, :c1116, :c1117, :c1118, :c1119, :c1120, :c1121, :c1122, :c1123, :c1124, :c1125, :c1126, :c1127, :c1128, :c1129, :c1130, :c1131, :c1132, :c1133, :c1134, :c1135, :c1136, :c1137, :c1138, :c1139, :c1140, :c1141, :c1142, :c1143, :c1144, :c1145, :c1146, :c1147, :c1148, :c1149, :c1150, :c1151, :c1152, :c1153, :c1154, :c1155, :c1156, :c1157, :c1158, :c1159, :c1160, :c1161, :c1162, :c1163, :c1164, :c1165, :c1166, :c1167, :c1168, :c1169, :c1170, :c1171, :c1172, :c1173, :c1174, :c1175, :c1176, :c1177, :c1178, :c1179, :c1180, :c1181, :c1182, :c1183, :c1184, :c1185, :c1186, :c1187, :c1188, :c1189, :c1190, :c1191, :c1192, :c1193, :c1194, :c1195, :c1196, :c1197, :c1198, :c1199, :c1200, :c1201, :c1202, :c1203, :c1204, :c1205, :c1206, :c1207, :c1208, :c1209, :c1210, :c1211, :c1212, :c1213, :c1214, :c1215, :c1216, :c1217, :c1218, :c1219, :c1220, :c1221, :c1222, :c1223, :c1224, :c1225, :c1226, :c1227, :c1228, :c1229, :c1230, :c1231, :c1232, :c1233, :c1234, :c1235, :c1236, :c1237, :c1238, :c1239, :c1240, :c1241, :c1242, :c1243, :c1244, :c1245, :c1246, :c1247, :c1248, :c1249, :c1250, :c1251, :c1252, :c1253, :c1254, :c1255, :c1256, :c1257, :c1258, :c1259, :c1260, :c1261, :c1262, :c1263, :c1264, :c1265, :c1266, :c1267, :c1268, :c1269, :c1270, :c1271, :c1272, :c1273, :c1274, :c1275, :c1276, :c1277, :c1278, :c1279, :c1280, :c1281, :c1282, :c1283, :c1284, :c1285, :c1286, :c1287, :c1288, :c1289, :c1290, :c1291, :c1292, :c1293, :c1294, :c1295, :c1296, :c1297, :c1298, :c1299, :c1300, :c1301, :c1302, :c1303, :c1304, :c1305, :c1306, :c1307, :c1308, :c1309, :c1310, :c1311, :c1312, :c1313, :c1314, :c1315, :c1316, :c1317, :c1318, :c1319, :c1320, :c1321, :c1322, :c1323, :c1324, :c1325, :c1326, :c1327, :c1328, :c1329, :c1330, :c1331, :c1332, :c1333, :c1334, :c1335, :c1336, :c1337, :c1338, :c1339, :c1340, :c1341, :c1342, :c1343, :c1344, :c1345, :c1346, :c1347, :c1348, :c1349, :c1350, :c1351, :c1352, :c1353, :c1354, :c1355, :c1356, :c1357, :c1358, :c1359, :c1360, :c1361, :c1362, :c1363, :c1364, :c1365, :c1366, :c1367, :c1368, :c1369, :c1370, :c1371, :c1372, :c1373, :c1374, :c1375, :c1376, :c1377, :c1378, :c1379, :c1380, :c1381, :c1382, :c1383, :c1384, :c1385, :c1386, :c1387, :c1388, :c1389, :c1390, :c1391, :c1392, :c1393, :c1394, :c1395, :c1396, :c1397, :c1398, :c1399, :c1400, :c1401, :c1402, :c1403, :c1404, :c1405, :c1406, :c1407, :c1408, :c1409, :c1410, :c1411, :c1412, :c1413, :c1414, :c1415, :c1416, :c1417, :c1418, :c1419, :c1420, :c1421, :c1422, :c1423, :c1424, :c1425, :c1426, :c1427, :c1428, :c1429, :c1430, :c1431, :c1432, :c1433, :c1434, :c1435, :c1436, :c1437, :c1438, :c1439, :c1440, :c1441, :c1442, :c1443, :c1444, :c1445, :c1446, :c1447, :c1448, :c1449, :c1450, :c1451, :c1452, :c1453, :c1454, :c1455, :c1456, :c1457, :c1458, :c1459, :c1460, :c1461, :c1462, :c1463, :c1464, :c1465, :c1466, :c1467, :c1468, :c1469, :c1470, :c1471, :c1472, :c1473, :c1474, :c1475, :c1476, :c1477, :c1478, :c1479, :c1480, :c1481, :c1482, :c1483, :c1484, :c1485, :c1486, :c1487, :c1488, :c1489, :c1490, :c1491, :c1492, :c1493, :c1494, :c1495, :c1496, :c1497, :c1498, :c1499, :c1500, :c1501, :c1502, :c1503, :c1504, :c1505, :c1506, :c1507, :c1508, :c1509, :c1510, :c1511, :c1512, :c1513, :c1514, :c1515, :c1516, :c1517, :c1518, :c1519, :c1520, :c1521, :c1522, :c1523, :c1524, :c1525, :c1526, :c1527, :c1528, :c1529, :c1530, :c1531, :c1532, :c1533, :c1534, :c1535, :c1536, :c1537, :c1538, :c1539, :c1540, :c1541, :c1542, :c1543, :c1544, :c1545, :c1546, :c1547, :c1548, :c1549, :c1550, :c1551, :c1552, :c1553, :c1554, :c1555, :c1556, :c1557, :c1558, :c1559, :c1560, :c1561, :c1562, :c1563, :c1564, :c1565, :c1566, :c1567, :c1568, :c1569, :c1570, :c1571, :c1572, :c1573, :c1574, :c1575, :c1576, :c1577, :c1578, :c1579, :c1580, :c1581, :c1582, :c1583, :c1584, :c1585, :c1586, :c1587, :c1588, :c1589, :c1590, :c1591, :c1592, :c1593, :c1594, :c1595, :c1596, :c1597, :c1598, :c1599, :c1600, :c1601, :c1602, :c1603, :c1604, :c1605, :c1606, :c1607, :c1608, :c1609, :c1610, :c1611, :c1612, :c1613, :c1614, :c1615, :c1616, :c1617, :c1618, :c1619, :c1620, :c1621, :c1622, :c1623, :c1624, :c1625, :c1626, :c1627, :c1628, :c1629, :c1630, :c1631, :c1632, :c1633, :c1634, :c1635, :c1636, :c1637, :c1638, :c1639, :c1640, :c1641, :c1642, :c1643, :c1644, :c1645, :c1646, :c1647, :c1648, :c1649, :c1650, :c1651, :c1652, :c1653, :c1654, :c1655, :c1656, :c1657, :c1658, :c1659, :c1660, :c1661, :c1662, :c1663, :c1664, :c1665, :c1666, :c1667, :c1668, :c1669, :c1670, :c1671, :c1672, :c1673, :c1674, :c1675, :c1676, :c1677, :c1678, :c1679, :c1680, :c1681, :c1682, :c1683, :c1684, :c1685, :c1686, :c1687, :c1688, :c1689, :c1690, :c1691, :c1692, :c1693, :c1694, :c1695, :c1696, :c1697, :c1698, :c1699, :c1700, :c1701, :c1702, :c1703, :c1704, :c1705, :c1706, :c1707, :c1708, :c1709, :c1710, :c1711, :c1712, :c1713, :c1714, :c1715, :c1716, :c1717, :c1718, :c1719, :c1720, :c1721, :c1722, :c1723, :c1724, :c1725, :c1726, :c1727, :c1728, :c1729, :c1730, :c1731, :c1732, :c1733, :c1734, :c1735, :c1736, :c1737, :c1738, :c1739, :c1740, :c1741, :c1742, :c1743, :c1744, :c1745, :c1746, :c1747, :c1748, :c1749, :c1750, :c1751, :c1752, :c1753, :c1754, :c1755, :c1756, :c1757, :c1758, :c1759, :c1760, :c1761, :c1762, :c1763, :c1764, :c1765, :c1766, :c1767, :c1768, :c1769, :c1770, :c1771, :c1772, :c1773, :c1774, :c1775, :c1776, :c1777, :c1778, :c1779, :c1780, :c1781, :c1782, :c1783, :c1784, :c1785, :c1786, :c1787, :c1788, :c1789, :c1790, :c1791, :c1792, :c1793, :c1794, :c1795, :c1796, :c1797, :c1798, :c1799, :c1800, :c1801, :c1802, :c1803, :c1804, :c1805, :c1806, :c1807, :c1808, :c1809, :c1810, :c1811, :c1812, :c1813, :c1814, :c1815, :c1816, :c1817, :c1818, :c1819, :c1820, :c1821, :c1822, :c1823, :c1824, :c1825, :c1826, :c1827, :c1828, :c1829, :c1830, :c1831, :c1832, :c1833, :c1834, :c1835, :c1836, :c1837, :c1838, :c1839, :c1840, :c1841, :c1842, :c1843, :c1844, :c1845, :c1846, :c1847, :c1848, :c1849, :c1850, :c1851, :c1852, :c1853, :c1854, :c1855, :c1856, :c1857, :c1858, :c1859, :c1860, :c1861, :c1862, :c1863, :c1864, :c1865, :c1866, :c1867, :c1868, :c1869, :c1870, :c1871, :c1872, :c1873, :c1874, :c1875, :c1876, :c1877, :c1878, :c1879, :c1880, :c1881, :c1882, :c1883, :c1884, :c1885, :c1886, :c1887, :c1888, :c1889, :c1890, :c1891, :c1892, :c1893, :c1894, :c1895, :c1896, :c1897, :c1898, :c1899, :c1900, :c1901, :c1902, :c1903, :c1904, :c1905, :c1906, :c1907, :c1908, :c1909, :c1910, :c1911, :c1912, :c1913, :c1914, :c1915, :c1916, :c1917, :c1918, :c1919, :c1920, :c1921, :c1922, :c1923, :c1924, :c1925, :c1926, :c1927, :c1928, :c1929, :c1930, :c1931, :c1932, :c1933, :c1934, :c1935, :c1936, :c1937, :c1938, :c1939, :c1940, :c1941, :c1942, :c1943, :c1944, :c1945, :c1946, :c1947, :c1948, :c1949, :c1950, :c1951, :c1952, :c1953, :c1954, :c1955, :c1956, :c1957, :c1958, :c1959, :c1960, :c1961, :c1962, :c1963, :c1964, :c1965, :c1966, :c1967, :c1968, :c1969, :c1970, :c1971, :c1972, :c1973, :c1974, :c1975, :c1976, :c1977, :c1978, :c1979, :c1980, :c1981, :c1982, :c1983, :c1984, :c1985, :c1986, :c1987, :c1988, :c1989, :c1990, :c1991, :c1992, :c1993, :c1994, :c1995, :c1996, :c1997, :c1998, :c1999, :c2000, :c2001, :c2002, :c2003, :c2004, :c2005, :c2006, :c2007, :c2008, :c2009, :c2010, :c2011, :c2012, :c2013, :c2014, :c2015, :c2016, :c2017, :c2018, :c2019, :c2020, :c2021, :c2022, :c2023, :c2024, :c2025, :c2026, :c2027, :c2028, :c2029, :c2030, :c2031, :c2032, :c2033, :c2034, :c2035, :c2036, :c2037, :c2038, :c2039, :c2040, :c2041, :c2042, :c2043, :c2044, :c2045, :c2046, :c2047, :c2048, :c2049, :c2050, :c2051, :c2052, :c2053, :c2054, :c2055, :c2056, :c2057, :c2058, :c2059, :c2060, :c2061, :c2062, :c2063, :c2064, :c2065, :c2066, :c2067, :c2068, :c2069, :c2070, :c2071, :c2072, :c2073, :c2074, :c2075, :c2076, :c2077, :c2078, :c2079, :c2080, :c2081, :c2082, :c2083, :c2084, :c2085, :c2086, :c2087, :c2088, :c2089, :c2090, :c2091, :c2092, :c2093, :c2094, :c2095, :c2096, :c2097, :c2098, :c2099, :c2100, :c2101, :c2102, :c2103, :c2104, :c2105, :c2106, :c2107, :c2108, :c2109, :c2110, :c2111, :c2112, :c2113, :c2114, :c2115, :c2116, :c2117, :c2118, :c2119, :c2120, :c2121, :c2122, :c2123, :c2124, :c2125, :c2126, :c2127, :c2128, :c2129, :c2130, :c2131, :c2132, :c2133, :c2134, :c2135, :c2136, :c2137, :c2138, :c2139, :c2140, :c2141, :c2142, :c2143, :c2144, :c2145, :c2146, :c2147, :c2148, :c2149, :c2150, :c2151, :c2152, :c2153, :c2154, :c2155, :c2156, :c2157, :c2158, :c2159, :c2160, :c2161, :c2162, :c2163, :c2164, :c2165, :c2166, :c2167, :c2168, :c2169, :c2170, :c2171, :c2172, :c2173, :c2174, :c2175, :c2176, :c2177, :c2178, :c2179, :c2180, :c2181, :c2182, :c2183, :c2184, :c2185, :c2186, :c2187, :c2188, :c2189, :c2190, :c2191, :c2192, :c2193, :c2194, :c2195, :c2196, :c2197, :c2198, :c2199, :c2200, :c2201, :c2202, :c2203, :c2204, :c2205, :c2206, :c2207, :c2208, :c2209, :c2210, :c2211, :c2212, :c2213, :c2214, :c2215, :c2216, :c2217, :c2218, :c2219, :c2220, :c2221, :c2222, :c2223, :c2224, :c2225, :c2226, :c2227, :c2228, :c2229, :c2230, :c2231, :c2232, :c2233, :c2234, :c2235, :c2236, :c2237, :c2238, :c2239, :c2240, :c2241, :c2242, :c2243, :c2244, :c2245, :c2246, :c2247, :c2248, :c2249, :c2250, :c2251, :c2252, :c2253, :c2254, :c2255, :c2256, :c2257, :c2258, :c2259, :c2260, :c2261, :c2262, :c2263, :c2264, :c2265, :c2266, :c2267, :c2268, :c2269, :c2270, :c2271, :c2272, :c2273, :c2274, :c2275, :c2276, :c2277, :c2278, :c2279, :c2280, :c2281, :c2282, :c2283, :c2284, :c2285, :c2286, :c2287, :c2288, :c2289, :c2290, :c2291, :c2292, :c2293, :c2294, :c2295, :c2296, :c2297, :c2298, :c2299, :c2300, :c2301, :c2302, :c2303, :c2304, :c2305, :c2306, :c2307, :c2308, :c2309, :c2310, :c2311, :c2312, :c2313, :c2314, :c2315, :c2316, :c2317, :c2318, :c2319, :c2320, :c2321, :c2322, :c2323, :c2324, :c2325, :c2326, :c2327, :c2328, :c2329, :c2330, :c2331, :c2332, :c2333, :c2334, :c2335, :c2336, :c2337, :c2338, :c2339, :c2340, :c2341, :c2342, :c2343, :c2344, :c2345, :c2346, :c2347, :c2348, :c2349, :c2350, :c2351, :c2352, :c2353, :c2354, :c2355, :c2356, :c2357, :c2358, :c2359, :c2360, :c2361, :c2362, :c2363, :c2364, :c2365, :c2366, :c2367, :c2368, :c2369, :c2370, :c2371, :c2372, :c2373, :c2374, :c2375, :c2376, :c2377, :c2378, :c2379, :c2380, :c2381, :c2382, :c2383, :c2384, :c2385, :c2386, :c2387, :c2388, :c2389, :c2390, :c2391, :c2392, :c2393, :c2394, :c2395, :c2396, :c2397, :c2398, :c2399, :c2400, :c2401, :c2402, :c2403, :c2404, :c2405, :c2406, :c2407, :c2408, :c2409, :c2410, :c2411, :c2412, :c2413, :c2414, :c2415, :c2416, :c2417, :c2418, :c2419, :c2420, :c2421, :c2422, :c2423, :c2424, :c2425, :c2426, :c2427, :c2428, :c2429, :c2430, :c2431, :c2432, :c2433, :c2434, :c2435, :c2436, :c2437, :c2438, :c2439, :c2440, :c2441, :c2442, :c2443, :c2444, :c2445, :c2446, :c2447, :c2448, :c2449, :c2450, :c2451, :c2452, :c2453, :c2454, :c2455, :c2456, :c2457, :c2458, :c2459, :c2460, :c2461, :c2462, :c2463, :c2464, :c2465, :c2466, :c2467, :c2468, :c2469, :c2470, :c2471, :c2472, :c2473, :c2474, :c2475, :c2476, :c2477, :c2478, :c2479, :c2480, :c2481, :c2482, :c2483, :c2484, :c2485, :c2486, :c2487, :c2488, :c2489, :c2490, :c2491, :c2492, :c2493, :c2494, :c2495, :c2496, :c2497, :c2498, :c2499, :c2500, :c2501, :c2502, :c2503, :c2504, :c2505, :c2506, :c2507, :c2508, :c2509, :c2510, :c2511, :c2512, :c2513, :c2514, :c2515, :c2516, :c2517, :c2518, :c2519, :c2520, :c2521, :c2522, :c2523, :c2524, :c2525, :c2526, :c2527, :c2528, :c2529, :c2530, :c2531, :c2532, :c2533, :c2534, :c2535, :c2536, :c2537, :c2538, :c2539, :c2540, :c2541, :c2542, :c2543, :c2544, :c2545, :c2546, :c2547, :c2548, :c2549, :c2550, :c2551, :c2552, :c2553, :c2554, :c2555, :c2556, :c2557, :c2558, :c2559, :c2560, :c2561, :c2562, :c2563, :c2564, :c2565, :c2566, :c2567, :c2568, :c2569, :c2570, :c2571, :c2572, :c2573, :c2574, :c2575, :c2576, :c2577, :c2578, :c2579, :c2580, :c2581, :c2582, :c2583, :c2584, :c2585, :c2586, :c2587, :c2588, :c2589, :c2590, :c2591, :c2592, :c2593, :c2594, :c2595, :c2596, :c2597, :c2598, :c2599, :c2600, :c2601, :c2602, :c2603, :c2604, :c2605, :c2606, :c2607, :c2608, :c2609, :c2610, :c2611, :c2612, :c2613, :c2614, :c2615, :c2616, :c2617, :c2618, :c2619, :c2620, :c2621, :c2622, :c2623, :c2624, :c2625, :c2626, :c2627, :c2628, :c2629, :c2630, :c2631, :c2632, :c2633, :c2634, :c2635, :c2636, :c2637, :c2638, :c2639, :c2640, :c2641, :c2642, :c2643, :c2644, :c2645, :c2646, :c2647, :c2648, :c2649, :c2650, :c2651, :c2652, :c2653, :c2654, :c2655, :c2656, :c2657, :c2658, :c2659, :c2660, :c2661, :c2662, :c2663, :c2664, :c2665, :c2666, :c2667, :c2668, :c2669, :c2670, :c2671, :c2672, :c2673, :c2674, :c2675, :c2676, :c2677, :c2678, :c2679, :c2680, :c2681, :c2682, :c2683, :c2684, :c2685, :c2686, :c2687, :c2688, :c2689, :c2690, :c2691, :c2692, :c2693, :c2694, :c2695, :c2696, :c2697, :c2698, :c2699, :c2700, :c2701, :c2702, :c2703, :c2704, :c2705, :c2706, :c2707, :c2708, :c2709, :c2710, :c2711, :c2712, :c2713, :c2714, :c2715, :c2716, :c2717, :c2718, :c2719, :c2720, :c2721, :c2722, :c2723, :c2724, :c2725, :c2726, :c2727, :c2728, :c2729, :c2730, :c2731, :c2732, :c2733, :c2734, :c2735, :c2736, :c2737, :c2738, :c2739, :c2740, :c2741, :c2742, :c2743, :c2744, :c2745, :c2746, :c2747, :c2748, :c2749, :c2750, :c2751, :c2752, :c2753, :c2754, :c2755, :c2756, :c2757, :c2758, :c2759, :c2760, :c2761, :c2762, :c2763, :c2764, :c2765, :c2766, :c2767, :c2768, :c2769, :c2770, :c2771, :c2772, :c2773, :c2774, :c2775, :c2776, :c2777, :c2778, :c2779, :c2780, :c2781, :c2782, :c2783, :c2784, :c2785, :c2786, :c2787, :c2788, :c2789, :c2790, :c2791, :c2792, :c2793, :c2794, :c2795, :c2796, :c2797, :c2798, :c2799, :c2800, :c2801, :c2802, :c2803, :c2804, :c2805, :c2806, :c2807, :c2808, :c2809, :c2810, :c2811, :c2812, :c2813, :c2814, :c2815, :c2816, :c2817, :c2818, :c2819, :c2820, :c2821, :c2822, :c2823, :c2824, :c2825, :c2826, :c2827, :c2828, :c2829, :c2830, :c2831, :c2832, :c2833, :c2834, :c2835, :c2836, :c2837, :c2838, :c2839, :c2840, :c2841, :c2842, :c2843, :c2844, :c2845, :c2846, :c2847, :c2848, :c2849, :c2850, :c2851, :c2852, :c2853, :c2854, :c2855, :c2856, :c2857, :c2858, :c2859, :c2860, :c2861, :c2862, :c2863, :c2864, :c2865, :c2866, :c2867, :c2868, :c2869, :c2870, :c2871, :c2872, :c2873, :c2874, :c2875, :c2876, :c2877, :c2878, :c2879, :c2880, :c2881, :c2882, :c2883, :c2884, :c2885, :c2886, :c2887, :c2888, :c2889, :c2890, :c2891, :c2892, :c2893, :c2894, :c2895, :c2896, :c2897, :c2898, :c2899, :c2900, :c2901, :c2902, :c2903, :c2904, :c2905, :c2906, :c2907, :c2908, :c2909, :c2910, :c2911, :c2912, :c2913, :c2914, :c2915, :c2916, :c2917, :c2918, :c2919, :c2920, :c2921, :c2922, :c2923, :c2924, :c2925, :c2926, :c2927, :c2928, :c2929, :c2930, :c2931, :c2932, :c2933, :c2934, :c2935, :c2936, :c2937, :c2938, :c2939, :c2940, :c2941, :c2942, :c2943, :c2944, :c2945, :c2946, :c2947, :c2948, :c2949, :c2950, :c2951, :c2952, :c2953, :c2954, :c2955, :c2956, :c2957, :c2958, :c2959, :c2960, :c2961, :c2962, :c2963, :c2964, :c2965, :c2966, :c2967, :c2968, :c2969, :c2970, :c2971, :c2972, :c2973, :c2974, :c2975, :c2976, :c2977, :c2978, :c2979, :c2980, :c2981, :c2982, :c2983, :c2984, :c2985, :c2986, :c2987, :c2988, :c2989, :c2990, :c2991, :c2992, :c2993, :c2994, :c2995, :c2996, :c2997, :c2998, :c2999, :c3000, :c3001, :c3002, :c3003, :c3004, :c3005, :c3006, :c3007, :c3008, :c3009, :c3010, :c3011, :c3012, :c3013, :c3014, :c3015, :c3016, :c3017, :c3018, :c3019, :c3020, :c3021, :c3022, :c3023, :c3024, :c3025, :c3026, :c3027, :c3028, :c3029, :c3030, :c3031, :c3032, :c3033, :c3034, :c3035, :c3036, :c3037, :c3038, :c3039, :c3040, :c3041, :c3042, :c3043, :c3044, :c3045, :c3046, :c3047, :c3048, :c3049, :c3050, :c3051, :c3052, :c3053, :c3054, :c3055, :c3056, :c3057, :c3058, :c3059, :c3060, :c3061, :c3062, :c3063, :c3064, :c3065, :c3066, :c3067, :c3068, :c3069, :c3070, :c3071, :c3072, :c3073, :c3074, :c3075, :c3076, :c3077, :c3078, :c3079, :c3080, :c3081, :c3082, :c3083, :c3084, :c3085, :c3086, :c3087, :c3088, :c3089, :c3090, :c3091, :c3092, :c3093, :c3094, :c3095, :c3096, :c3097, :c3098, :c3099, :c3100, :c3101, :c3102, :c3103, :c3104, :c3105, :c3106, :c3107, :c3108, :c3109, :c3110, :c3111, :c3112, :c3113, :c3114, :c3115, :c3116, :c3117, :c3118, :c3119, :c3120, :c3121, :c3122, :c3123, :c3124, :c3125, :c3126, :c3127, :c3128, :c3129, :c3130, :c3131, :c3132, :c3133, :c3134, :c3135, :c3136, :c3137, :c3138, :c3139, :c3140, :c3141, :c3142, :c3143, :c3144, :c3145, :c3146, :c3147, :c3148, :c3149, :c3150, :c3151, :c3152, :c3153, :c3154, :c3155, :c3156, :c3157, :c3158, :c3159, :c3160, :c3161, :c3162, :c3163, :c3164, :c3165, :c3166, :c3167, :c3168, :c3169, :c3170, :c3171, :c3172, :c3173, :c3174, :c3175, :c3176, :c3177, :c3178, :c3179, :c3180, :c3181, :c3182, :c3183, :c3184, :c3185, :c3186, :c3187, :c3188, :c3189, :c3190, :c3191, :c3192, :c3193, :c3194, :c3195, :c3196, :c3197, :c3198, :c3199, :c3200, :c3201, :c3202, :c3203, :c3204, :c3205, :c3206, :c3207, :c3208, :c3209, :c3210, :c3211, :c3212, :c3213, :c3214, :c3215, :c3216, :c3217, :c3218, :c3219, :c3220, :c3221, :c3222, :c3223, :c3224, :c3225, :c3226, :c3227, :c3228, :c3229, :c3230, :c3231, :c3232, :c3233, :c3234, :c3235, :c3236, :c3237, :c3238, :c3239, :c3240, :c3241, :c3242, :c3243, :c3244, :c3245, :c3246, :c3247, :c3248, :c3249, :c3250, :c3251, :c3252, :c3253, :c3254, :c3255, :c3256, :c3257, :c3258, :c3259, :c3260, :c3261, :c3262, :c3263, :c3264, :c3265, :c3266, :c3267, :c3268, :c3269, :c3270, :c3271, :c3272, :c3273, :c3274, :c3275, :c3276, :c3277, :c3278, :c3279, :c3280, :c3281, :c3282, :c3283, :c3284, :c3285, :c3286, :c3287, :c3288, :c3289, :c3290, :c3291, :c3292, :c3293, :c3294, :c3295, :c3296, :c3297, :c3298, :c3299, :c3300, :c3301, :c3302, :c3303, :c3304, :c3305, :c3306, :c3307, :c3308, :c3309, :c3310, :c3311, :c3312, :c3313, :c3314, :c3315, :c3316, :c3317, :c3318, :c3319, :c3320, :c3321, :c3322, :c3323, :c3324, :c3325, :c3326, :c3327, :c3328, :c3329, :c3330, :c3331, :c3332, :c3333, :c3334, :c3335, :c3336, :c3337, :c3338, :c3339, :c3340, :c3341, :c3342, :c3343, :c3344, :c3345, :c3346, :c3347, :c3348, :c3349, :c3350, :c3351, :c3352, :c3353, :c3354, :c3355, :c3356, :c3357, :c3358, :c3359, :c3360, :c3361, :c3362, :c3363, :c3364, :c3365, :c3366, :c3367, :c3368, :c3369, :c3370, :c3371, :c3372, :c3373, :c3374, :c3375, :c3376, :c3377, :c3378, :c3379, :c3380, :c3381, :c3382, :c3383, :c3384, :c3385, :c3386, :c3387, :c3388, :c3389, :c3390, :c3391, :c3392, :c3393, :c3394, :c3395, :c3396, :c3397, :c3398, :c3399, :c3400, :c3401, :c3402, :c3403, :c3404, :c3405, :c3406, :c3407, :c3408, :c3409, :c3410, :c3411, :c3412, :c3413, :c3414, :c3415, :c3416, :c3417, :c3418, :c3419, :c3420, :c3421, :c3422, :c3423, :c3424, :c3425, :c3426, :c3427, :c3428, :c3429, :c3430, :c3431, :c3432, :c3433, :c3434, :c3435, :c3436, :c3437, :c3438, :c3439, :c3440, :c3441, :c3442, :c3443, :c3444, :c3445, :c3446, :c3447, :c3448, :c3449, :c3450, :c3451, :c3452, :c3453, :c3454, :c3455, :c3456, :c3457, :c3458, :c3459, :c3460, :c3461, :c3462, :c3463, :c3464, :c3465, :c3466, :c3467, :c3468, :c3469, :c3470, :c3471, :c3472, :c3473, :c3474, :c3475, :c3476, :c3477, :c3478, :c3479, :c3480, :c3481, :c3482, :c3483, :c3484, :c3485, :c3486, :c3487, :c3488, :c3489, :c3490, :c3491, :c3492, :c3493, :c3494, :c3495, :c3496, :c3497, :c3498, :c3499, :c3500, :c3501, :c3502, :c3503, :c3504, :c3505, :c3506, :c3507, :c3508, :c3509, :c3510, :c3511, :c3512, :c3513, :c3514, :c3515, :c3516, :c3517, :c3518, :c3519, :c3520, :c3521, :c3522, :c3523, :c3524, :c3525, :c3526, :c3527, :c3528, :c3529, :c3530, :c3531, :c3532, :c3533, :c3534, :c3535, :c3536, :c3537, :c3538, :c3539, :c3540, :c3541, :c3542, :c3543, :c3544, :c3545, :c3546, :c3547, :c3548, :c3549, :c3550, :c3551, :c3552, :c3553, :c3554, :c3555, :c3556, :c3557, :c3558, :c3559, :c3560, :c3561, :c3562, :c3563, :c3564, :c3565, :c3566, :c3567, :c3568, :c3569, :c3570, :c3571, :c3572, :c3573, :c3574, :c3575, :c3576, :c3577, :c3578, :c3579, :c3580, :c3581, :c3582, :c3583, :c3584, :c3585, :c3586, :c3587, :c3588, :c3589, :c3590, :c3591, :c3592, :c3593, :c3594, :c3595, :c3596, :c3597, :c3598, :c3599, :c3600, :c3601, :c3602, :c3603, :c3604, :c3605, :c3606, :c3607, :c3608, :c3609, :c3610, :c3611, :c3612, :c3613, :c3614, :c3615, :c3616, :c3617, :c3618, :c3619, :c3620, :c3621, :c3622, :c3623, :c3624, :c3625, :c3626, :c3627, :c3628, :c3629, :c3630, :c3631, :c3632, :c3633, :c3634, :c3635, :c3636, :c3637, :c3638, :c3639, :c3640, :c3641, :c3642, :c3643, :c3644, :c3645, :c3646, :c3647, :c3648, :c3649, :c3650, :c3651, :c3652, :c3653, :c3654, :c3655, :c3656, :c3657, :c3658, :c3659, :c3660, :c3661, :c3662, :c3663, :c3664, :c3665, :c3666, :c3667, :c3668, :c3669, :c3670, :c3671, :c3672, :c3673, :c3674, :c3675, :c3676, :c3677, :c3678, :c3679, :c3680, :c3681, :c3682, :c3683, :c3684, :c3685, :c3686, :c3687, :c3688, :c3689, :c3690, :c3691, :c3692, :c3693, :c3694, :c3695, :c3696, :c3697, :c3698, :c3699, :c3700, :c3701, :c3702, :c3703, :c3704, :c3705, :c3706, :c3707, :c3708, :c3709, :c3710, :c3711, :c3712, :c3713, :c3714, :c3715, :c3716, :c3717, :c3718, :c3719, :c3720, :c3721, :c3722, :c3723, :c3724, :c3725, :c3726, :c3727, :c3728, :c3729, :c3730, :c3731, :c3732, :c3733, :c3734, :c3735, :c3736, :c3737, :c3738, :c3739, :c3740, :c3741, :c3742, :c3743, :c3744, :c3745, :c3746, :c3747, :c3748, :c3749, :c3750, :c3751, :c3752, :c3753, :c3754, :c3755, :c3756, :c3757, :c3758, :c3759, :c3760, :c3761, :c3762, :c3763, :c3764, :c3765, :c3766, :c3767, :c3768, :c3769, :c3770, :c3771, :c3772, :c3773, :c3774, :c3775, :c3776, :c3777, :c3778, :c3779, :c3780, :c3781, :c3782, :c3783, :c3784, :c3785, :c3786, :c3787, :c3788, :c3789, :c3790, :c3791, :c3792, :c3793, :c3794, :c3795, :c3796, :c3797, :c3798, :c3799, :c3800, :c3801, :c3802, :c3803, :c3804, :c3805, :c3806, :c3807, :c3808, :c3809, :c3810, :c3811, :c3812, :c3813, :c3814, :c3815, :c3816, :c3817, :c3818, :c3819, :c3820, :c3821, :c3822, :c3823, :c3824, :c3825, :c3826, :c3827, :c3828, :c3829, :c3830, :c3831, :c3832, :c3833, :c3834, :c3835, :c3836, :c3837, :c3838, :c3839, :c3840, :c3841, :c3842, :c3843, :c3844, :c3845, :c3846, :c3847, :c3848, :c3849, :c3850, :c3851, :c3852, :c3853, :c3854, :c3855, :c3856, :c3857, :c3858, :c3859, :c3860, :c3861, :c3862, :c3863, :c3864, :c3865, :c3866, :c3867, :c3868, :c3869, :c3870, :c3871, :c3872, :c3873, :c3874, :c3875, :c3876, :c3877, :c3878, :c3879, :c3880, :c3881, :c3882, :c3883, :c3884, :c3885, :c3886, :c3887, :c3888, :c3889, :c3890, :c3891, :c3892, :c3893, :c3894, :c3895, :c3896, :c3897, :c3898, :c3899, :c3900, :c3901, :c3902, :c3903, :c3904, :c3905, :c3906, :c3907, :c3908, :c3909, :c3910, :c3911, :c3912, :c3913, :c3914, :c3915, :c3916, :c3917, :c3918, :c3919, :c3920, :c3921, :c3922, :c3923, :c3924, :c3925, :c3926, :c3927, :c3928, :c3929, :c3930, :c3931, :c3932, :c3933, :c3934, :c3935, :c3936, :c3937, :c3938, :c3939, :c3940, :c3941, :c3942, :c3943, :c3944, :c3945, :c3946, :c3947, :c3948, :c3949, :c3950, :c3951, :c3952, :c3953, :c3954, :c3955, :c3956, :c3957, :c3958, :c3959, :c3960, :c3961, :c3962, :c3963, :c3964, :c3965, :c3966, :c3967, :c3968, :c3969, :c3970, :c3971, :c3972, :c3973, :c3974, :c3975, :c3976, :c3977, :c3978, :c3979, :c3980, :c3981, :c3982, :c3983, :c3984, :c3985, :c3986, :c3987, :c3988, :c3989, :c3990, :c3991, :c3992, :c3993, :c3994, :c3995, :c3996, :c3997, :c3998, :c3999, :c4000, :c4001, :c4002, :c4003, :c4004, :c4005, :c4006, :c4007, :c4008, :c4009, :c4010, :c4011, :c4012, :c4013, :c4014, :c4015, :c4016, :c4017, :c4018, :c4019, :c4020, :c4021, :c4022, :c4023, :c4024, :c4025, :c4026, :c4027, :c4028, :c4029, :c4030, :c4031, :c4032, :c4033, :c4034, :c4035, :c4036, :c4037, :c4038, :c4039, :c4040, :c4041, :c4042, :c4043, :c4044, :c4045, :c4046, :c4047, :c4048, :c4049, :c4050, :c4051, :c4052, :c4053, :c4054, :c4055, :c4056, :c4057, :c4058, :c4059, :c4060, :c4061, :c4062, :c4063, :c4064, :c4065, :c4066, :c4067, :c4068, :c4069, :c4070, :c4071, :c4072, :c4073, :c4074, :c4075, :c4076, :c4077, :c4078, :c4079, :c4080, :c4081, :c4082, :c4083, :c4084, :c4085, :c4086, :c4087, :c4088, :c4089, :c4090, :c4091, :c4092, :c4093, :c4094, :c4095, :c4096, :c4097, :c4098, :c4099, :c4100, :c4101, :c4102, :c4103, :c4104, :c4105, :c4106, :c4107, :c4108, :c4109, :c4110, :c4111, :c4112, :c4113, :c4114, :c4115, :c4116, :c4117, :c4118, :c4119, :c4120, :c4121, :c4122, :c4123, :c4124, :c4125, :c4126, :c4127, :c4128, :c4129, :c4130, :c4131, :c4132, :c4133, :c4134, :c4135, :c4136, :c4137, :c4138, :c4139, :c4140, :c4141, :c4142, :c4143, :c4144, :c4145, :c4146, :c4147, :c4148, :c4149, :c4150, :c4151, :c4152, :c4153, :c4154, :c4155, :c4156, :c4157, :c4158, :c4159, :c4160, :c4161, :c4162, :c4163, :c4164, :c4165, :c4166, :c4167, :c4168, :c4169, :c4170, :c4171, :c4172, :c4173, :c4174, :c4175, :c4176, :c4177, :c4178, :c4179, :c4180, :c4181, :c4182, :c4183, :c4184, :c4185, :c4186, :c4187, :c4188, :c4189, :c4190, :c4191, :c4192, :c4193, :c4194, :c4195, :c4196, :c4197, :c4198, :c4199, :c4200, :c4201, :c4202, :c4203, :c4204, :c4205, :c4206, :c4207, :c4208, :c4209, :c4210, :c4211, :c4212, :c4213, :c4214, :c4215, :c4216, :c4217, :c4218, :c4219, :c4220, :c4221, :c4222, :c4223, :c4224, :c4225, :c4226, :c4227, :c4228, :c4229, :c4230, :c4231, :c4232, :c4233, :c4234, :c4235, :c4236, :c4237, :c4238, :c4239, :c4240, :c4241, :c4242, :c4243, :c4244, :c4245, :c4246, :c4247, :c4248, :c4249, :c4250, :c4251, :c4252, :c4253, :c4254, :c4255, :c4256, :c4257, :c4258, :c4259, :c4260, :c4261, :c4262, :c4263, :c4264, :c4265, :c4266, :c4267, :c4268, :c4269, :c4270, :c4271, :c4272, :c4273, :c4274, :c4275, :c4276, :c4277, :c4278, :c4279, :c4280, :c4281, :c4282, :c4283, :c4284, :c4285, :c4286, :c4287, :c4288, :c4289, :c4290, :c4291, :c4292, :c4293, :c4294, :c4295, :c4296, :c4297, :c4298, :c4299, :c4300, :c4301, :c4302, :c4303, :c4304, :c4305, :c4306, :c4307, :c4308, :c4309, :c4310, :c4311, :c4312, :c4313, :c4314, :c4315, :c4316, :c4317, :c4318, :c4319, :c4320, :c4321, :c4322, :c4323, :c4324, :c4325, :c4326, :c4327, :c4328, :c4329, :c4330, :c4331, :c4332, :c4333, :c4334, :c4335, :c4336, :c4337, :c4338, :c4339, :c4340, :c4341, :c4342, :c4343, :c4344, :c4345, :c4346, :c4347, :c4348, :c4349, :c4350, :c4351, :c4352, :c4353, :c4354, :c4355, :c4356, :c4357, :c4358, :c4359, :c4360, :c4361, :c4362, :c4363, :c4364, :c4365, :c4366, :c4367, :c4368, :c4369, :c4370, :c4371, :c4372, :c4373, :c4374, :c4375, :c4376, :c4377, :c4378, :c4379, :c4380, :c4381, :c4382, :c4383, :c4384, :c4385, :c4386, :c4387, :c4388, :c4389, :c4390, :c4391, :c4392, :c4393, :c4394, :c4395, :c4396, :c4397, :c4398, :c4399, :c4400, :c4401, :c4402, :c4403, :c4404, :c4405, :c4406, :c4407, :c4408, :c4409, :c4410, :c4411, :c4412, :c4413, :c4414, :c4415, :c4416, :c4417, :c4418, :c4419, :c4420, :c4421, :c4422, :c4423, :c4424, :c4425, :c4426, :c4427, :c4428, :c4429, :c4430, :c4431, :c4432, :c4433, :c4434, :c4435, :c4436, :c4437, :c4438, :c4439, :c4440, :c4441, :c4442, :c4443, :c4444, :c4445, :c4446, :c4447, :c4448, :c4449, :c4450, :c4451, :c4452, :c4453, :c4454, :c4455, :c4456, :c4457, :c4458, :c4459, :c4460, :c4461, :c4462, :c4463, :c4464, :c4465, :c4466, :c4467, :c4468, :c4469, :c4470, :c4471, :c4472, :c4473, :c4474, :c4475, :c4476, :c4477, :c4478, :c4479, :c4480, :c4481, :c4482, :c4483, :c4484, :c4485, :c4486, :c4487, :c4488, :c4489, :c4490, :c4491, :c4492, :c4493, :c4494, :c4495, :c4496, :c4497, :c4498, :c4499, :c4500, :c4501, :c4502, :c4503, :c4504, :c4505, :c4506, :c4507, :c4508, :c4509, :c4510, :c4511, :c4512, :c4513, :c4514, :c4515, :c4516, :c4517, :c4518, :c4519, :c4520, :c4521, :c4522, :c4523, :c4524, :c4525, :c4526, :c4527, :c4528, :c4529, :c4530, :c4531, :c4532, :c4533, :c4534, :c4535, :c4536, :c4537, :c4538, :c4539, :c4540, :c4541, :c4542, :c4543, :c4544, :c4545, :c4546, :c4547, :c4548, :c4549, :c4550, :c4551, :c4552, :c4553, :c4554, :c4555, :c4556, :c4557, :c4558, :c4559, :c4560, :c4561, :c4562, :c4563, :c4564, :c4565, :c4566, :c4567, :c4568, :c4569, :c4570, :c4571, :c4572, :c4573, :c4574, :c4575, :c4576, :c4577, :c4578, :c4579, :c4580, :c4581, :c4582, :c4583, :c4584, :c4585, :c4586, :c4587, :c4588, :c4589, :c4590, :c4591, :c4592, :c4593, :c4594, :c4595, :c4596, :c4597, :c4598, :c4599, :c4600, :c4601, :c4602, :c4603, :c4604, :c4605, :c4606, :c4607, :c4608, :c4609, :c4610, :c4611, :c4612, :c4613, :c4614, :c4615, :c4616, :c4617, :c4618, :c4619, :c4620, :c4621, :c4622, :c4623, :c4624, :c4625, :c4626, :c4627, :c4628, :c4629, :c4630, :c4631, :c4632, :c4633, :c4634, :c4635, :c4636, :c4637, :c4638, :c4639, :c4640, :c4641, :c4642, :c4643, :c4644, :c4645, :c4646, :c4647, :c4648, :c4649, :c4650, :c4651, :c4652, :c4653, :c4654, :c4655, :c4656, :c4657, :c4658, :c4659, :c4660, :c4661, :c4662, :c4663, :c4664, :c4665, :c4666, :c4667, :c4668, :c4669, :c4670, :c4671, :c4672, :c4673, :c4674, :c4675, :c4676, :c4677, :c4678, :c4679, :c4680, :c4681, :c4682, :c4683, :c4684, :c4685, :c4686, :c4687, :c4688, :c4689, :c4690, :c4691, :c4692, :c4693, :c4694, :c4695, :c4696, :c4697, :c4698, :c4699, :c4700, :c4701, :c4702, :c4703, :c4704, :c4705, :c4706, :c4707, :c4708, :c4709, :c4710, :c4711, :c4712, :c4713, :c4714, :c4715, :c4716, :c4717, :c4718, :c4719, :c4720, :c4721, :c4722, :c4723, :c4724, :c4725, :c4726, :c4727, :c4728, :c4729, :c4730, :c4731, :c4732, :c4733, :c4734, :c4735, :c4736, :c4737, :c4738, :c4739, :c4740, :c4741, :c4742, :c4743, :c4744, :c4745, :c4746, :c4747, :c4748, :c4749, :c4750, :c4751, :c4752, :c4753, :c4754, :c4755, :c4756, :c4757, :c4758, :c4759, :c4760, :c4761, :c4762, :c4763, :c4764, :c4765, :c4766, :c4767, :c4768, :c4769, :c4770, :c4771, :c4772, :c4773, :c4774, :c4775, :c4776, :c4777, :c4778, :c4779, :c4780, :c4781, :c4782, :c4783, :c4784, :c4785, :c4786, :c4787, :c4788, :c4789, :c4790, :c4791, :c4792, :c4793, :c4794, :c4795, :c4796, :c4797, :c4798, :c4799, :c4800, :c4801, :c4802, :c4803, :c4804, :c4805, :c4806, :c4807, :c4808, :c4809, :c4810, :c4811, :c4812, :c4813, :c4814, :c4815, :c4816, :c4817, :c4818, :c4819, :c4820, :c4821, :c4822, :c4823, :c4824, :c4825, :c4826, :c4827, :c4828, :c4829, :c4830, :c4831, :c4832, :c4833, :c4834, :c4835, :c4836, :c4837, :c4838, :c4839, :c4840, :c4841, :c4842, :c4843, :c4844, :c4845, :c4846, :c4847, :c4848, :c4849, :c4850, :c4851, :c4852, :c4853, :c4854, :c4855, :c4856, :c4857, :c4858, :c4859, :c4860, :c4861, :c4862, :c4863, :c4864, :c4865, :c4866, :c4867, :c4868, :c4869, :c4870, :c4871, :c4872, :c4873, :c4874, :c4875, :c4876, :c4877, :c4878, :c4879, :c4880, :c4881, :c4882, :c4883, :c4884, :c4885, :c4886, :c4887, :c4888, :c4889, :c4890, :c4891, :c4892, :c4893, :c4894, :c4895, :c4896, :c4897, :c4898, :c4899, :c4900, :c4901, :c4902, :c4903, :c4904, :c4905, :c4906, :c4907, :c4908, :c4909, :c4910, :c4911, :c4912, :c4913, :c4914, :c4915, :c4916, :c4917, :c4918, :c4919, :c4920, :c4921, :c4922, :c4923, :c4924, :c4925, :c4926, :c4927, :c4928, :c4929, :c4930, :c4931, :c4932, :c4933, :c4934, :c4935, :c4936, :c4937, :c4938, :c4939, :c4940, :c4941, :c4942, :c4943, :c4944, :c4945, :c4946, :c4947, :c4948, :c4949, :c4950, :c4951, :c4952, :c4953, :c4954, :c4955, :c4956, :c4957, :c4958, :c4959, :c4960, :c4961, :c4962, :c4963, :c4964, :c4965, :c4966, :c4967, :c4968, :c4969, :c4970, :c4971, :c4972, :c4973, :c4974, :c4975, :c4976, :c4977, :c4978, :c4979, :c4980, :c4981, :c4982, :c4983, :c4984, :c4985, :c4986, :c4987, :c4988, :c4989, :c4990, :c4991, :c4992, :c4993, :c4994, :c4995, :c4996, :c4997, :c4998, :c4999, :c5000, :c5001, :c5002, :c5003, :c5004, :c5005, :c5006, :c5007, :c5008, :c5009, :c5010, :c5011, :c5012, :c5013, :c5014, :c5015, :c5016, :c5017, :c5018, :c5019, :c5020, :c5021, :c5022, :c5023, :c5024, :c5025, :c5026, :c5027, :c5028, :c5029, :c5030, :c5031, :c5032, :c5033, :c5034, :c5035, :c5036, :c5037, :c5038, :c5039, :c5040, :c5041, :c5042, :c5043, :c5044, :c5045, :c5046, :c5047, :c5048, :c5049, :c5050, :c5051, :c5052, :c5053, :c5054, :c5055, :c5056, :c5057, :c5058, :c5059, :c5060, :c5061, :c5062, :c5063, :c5064, :c5065, :c5066, :c5067, :c5068, :c5069, :c5070, :c5071, :c5072, :c5073, :c5074, :c5075, :c5076, :c5077, :c5078, :c5079, :c5080, :c5081, :c5082, :c5083, :c5084, :c5085, :c5086, :c5087, :c5088, :c5089, :c5090, :c5091, :c5092, :c5093, :c5094, :c5095, :c5096, :c5097, :c5098, :c5099, :c5100, :c5101, :c5102, :c5103, :c5104, :c5105, :c5106, :c5107, :c5108, :c5109, :c5110, :c5111, :c5112, :c5113, :c5114, :c5115, :c5116, :c5117, :c5118, :c5119, :c5120, :c5121, :c5122, :c5123, :c5124, :c5125, :c5126, :c5127, :c5128, :c5129, :c5130, :c5131, :c5132, :c5133, :c5134, :c5135, :c5136, :c5137, :c5138, :c5139, :c5140, :c5141, :c5142, :c5143, :c5144, :c5145, :c5146, :c5147, :c5148, :c5149, :c5150, :c5151, :c5152, :c5153, :c5154, :c5155, :c5156, :c5157, :c5158, :c5159, :c5160, :c5161, :c5162, :c5163, :c5164, :c5165, :c5166, :c5167, :c5168, :c5169, :c5170, :c5171, :c5172, :c5173, :c5174, :c5175, :c5176, :c5177, :c5178, :c5179, :c5180, :c5181, :c5182, :c5183, :c5184, :c5185, :c5186, :c5187, :c5188, :c5189, :c5190, :c5191, :c5192, :c5193, :c5194, :c5195, :c5196, :c5197, :c5198, :c5199, :c5200, :c5201, :c5202, :c5203, :c5204, :c5205, :c5206, :c5207, :c5208, :c5209, :c5210, :c5211, :c5212, :c5213, :c5214, :c5215, :c5216, :c5217, :c5218, :c5219, :c5220, :c5221, :c5222, :c5223, :c5224, :c5225, :c5226, :c5227, :c5228, :c5229, :c5230, :c5231, :c5232, :c5233, :c5234, :c5235, :c5236, :c5237, :c5238, :c5239, :c5240, :c5241, :c5242, :c5243, :c5244, :c5245, :c5246, :c5247, :c5248, :c5249, :c5250, :c5251, :c5252, :c5253, :c5254, :c5255, :c5256, :c5257, :c5258, :c5259, :c5260, :c5261, :c5262, :c5263, :c5264, :c5265, :c5266, :c5267, :c5268, :c5269, :c5270, :c5271, :c5272, :c5273, :c5274, :c5275, :c5276, :c5277, :c5278, :c5279, :c5280, :c5281, :c5282, :c5283, :c5284, :c5285, :c5286, :c5287, :c5288, :c5289, :c5290, :c5291, :c5292, :c5293, :c5294, :c5295, :c5296, :c5297, :c5298, :c5299, :c5300, :c5301, :c5302, :c5303, :c5304, :c5305, :c5306, :c5307, :c5308, :c5309, :c5310, :c5311, :c5312, :c5313, :c5314, :c5315, :c5316, :c5317, :c5318, :c5319, :c5320, :c5321, :c5322, :c5323, :c5324, :c5325, :c5326, :c5327, :c5328, :c5329, :c5330, :c5331, :c5332, :c5333, :c5334, :c5335, :c5336, :c5337, :c5338, :c5339, :c5340, :c5341, :c5342, :c5343, :c5344, :c5345, :c5346, :c5347, :c5348, :c5349, :c5350, :c5351, :c5352, :c5353, :c5354, :c5355, :c5356, :c5357, :c5358, :c5359, :c5360, :c5361, :c5362, :c5363, :c5364, :c5365, :c5366, :c5367, :c5368, :c5369, :c5370, :c5371, :c5372, :c5373, :c5374, :c5375, :c5376, :c5377, :c5378, :c5379, :c5380, :c5381, :c5382, :c5383, :c5384, :c5385, :c5386, :c5387, :c5388, :c5389, :c5390, :c5391, :c5392, :c5393, :c5394, :c5395, :c5396, :c5397, :c5398, :c5399, :c5400, :c5401, :c5402, :c5403, :c5404, :c5405, :c5406, :c5407, :c5408, :c5409, :c5410, :c5411, :c5412, :c5413, :c5414, :c5415, :c5416, :c5417, :c5418, :c5419, :c5420, :c5421, :c5422, :c5423, :c5424, :c5425, :c5426, :c5427, :c5428, :c5429, :c5430, :c5431, :c5432, :c5433, :c5434, :c5435, :c5436, :c5437, :c5438, :c5439, :c5440, :c5441, :c5442, :c5443, :c5444, :c5445, :c5446, :c5447, :c5448, :c5449, :c5450, :c5451, :c5452, :c5453, :c5454, :c5455, :c5456, :c5457, :c5458, :c5459, :c5460, :c5461, :c5462, :c5463, :c5464, :c5465, :c5466, :c5467, :c5468, :c5469, :c5470, :c5471, :c5472, :c5473, :c5474, :c5475, :c5476, :c5477, :c5478, :c5479, :c5480, :c5481, :c5482, :c5483, :c5484, :c5485, :c5486, :c5487, :c5488, :c5489, :c5490, :c5491, :c5492, :c5493, :c5494, :c5495, :c5496, :c5497, :c5498, :c5499, :c5500, :c5501, :c5502, :c5503, :c5504, :c5505, :c5506, :c5507, :c5508, :c5509, :c5510, :c5511, :c5512, :c5513, :c5514, :c5515, :c5516, :c5517, :c5518, :c5519, :c5520, :c5521, :c5522, :c5523, :c5524, :c5525, :c5526, :c5527, :c5528, :c5529, :c5530, :c5531, :c5532, :c5533, :c5534, :c5535, :c5536, :c5537, :c5538, :c5539, :c5540, :c5541, :c5542, :c5543, :c5544, :c5545, :c5546, :c5547, :c5548, :c5549, :c5550, :c5551, :c5552, :c5553, :c5554, :c5555, :c5556, :c5557, :c5558, :c5559, :c5560, :c5561, :c5562, :c5563, :c5564, :c5565, :c5566, :c5567, :c5568, :c5569, :c5570, :c5571, :c5572, :c5573, :c5574, :c5575, :c5576, :c5577, :c5578, :c5579, :c5580, :c5581, :c5582, :c5583, :c5584, :c5585, :c5586, :c5587, :c5588, :c5589, :c5590, :c5591, :c5592, :c5593, :c5594, :c5595, :c5596, :c5597, :c5598, :c5599, :c5600, :c5601, :c5602, :c5603, :c5604, :c5605, :c5606, :c5607, :c5608, :c5609, :c5610, :c5611, :c5612, :c5613, :c5614, :c5615, :c5616, :c5617, :c5618, :c5619, :c5620, :c5621, :c5622, :c5623, :c5624, :c5625, :c5626, :c5627, :c5628, :c5629, :c5630, :c5631, :c5632, :c5633, :c5634, :c5635, :c5636, :c5637, :c5638, :c5639, :c5640, :c5641, :c5642, :c5643, :c5644, :c5645, :c5646, :c5647, :c5648, :c5649, :c5650, :c5651, :c5652, :c5653, :c5654, :c5655, :c5656, :c5657, :c5658, :c5659, :c5660, :c5661, :c5662, :c5663, :c5664, :c5665, :c5666, :c5667, :c5668, :c5669, :c5670, :c5671, :c5672, :c5673, :c5674, :c5675, :c5676, :c5677, :c5678, :c5679, :c5680, :c5681, :c5682, :c5683, :c5684, :c5685, :c5686, :c5687, :c5688, :c5689, :c5690, :c5691, :c5692, :c5693, :c5694, :c5695, :c5696, :c5697, :c5698, :c5699, :c5700, :c5701, :c5702, :c5703, :c5704, :c5705, :c5706, :c5707, :c5708, :c5709, :c5710, :c5711, :c5712, :c5713, :c5714, :c5715, :c5716, :c5717, :c5718, :c5719, :c5720, :c5721, :c5722, :c5723, :c5724, :c5725, :c5726, :c5727, :c5728, :c5729, :c5730, :c5731, :c5732, :c5733, :c5734, :c5735, :c5736, :c5737, :c5738, :c5739, :c5740, :c5741, :c5742, :c5743, :c5744, :c5745, :c5746, :c5747, :c5748, :c5749, :c5750, :c5751, :c5752, :c5753, :c5754, :c5755, :c5756, :c5757, :c5758, :c5759, :c5760, :c5761, :c5762, :c5763, :c5764, :c5765, :c5766, :c5767, :c5768, :c5769, :c5770, :c5771, :c5772, :c5773, :c5774, :c5775, :c5776, :c5777, :c5778, :c5779, :c5780, :c5781, :c5782, :c5783, :c5784, :c5785, :c5786, :c5787, :c5788, :c5789, :c5790, :c5791, :c5792, :c5793, :c5794, :c5795, :c5796, :c5797, :c5798, :c5799, :c5800, :c5801, :c5802, :c5803, :c5804, :c5805, :c5806, :c5807, :c5808, :c5809, :c5810, :c5811, :c5812, :c5813, :c5814, :c5815, :c5816, :c5817, :c5818, :c5819, :c5820, :c5821, :c5822, :c5823, :c5824, :c5825, :c5826, :c5827, :c5828, :c5829, :c5830, :c5831, :c5832, :c5833, :c5834, :c5835, :c5836, :c5837, :c5838, :c5839, :c5840, :c5841, :c5842, :c5843, :c5844, :c5845, :c5846, :c5847, :c5848, :c5849, :c5850, :c5851, :c5852, :c5853, :c5854, :c5855, :c5856, :c5857, :c5858, :c5859, :c5860, :c5861, :c5862, :c5863, :c5864, :c5865, :c5866, :c5867, :c5868, :c5869, :c5870, :c5871, :c5872, :c5873, :c5874, :c5875, :c5876, :c5877, :c5878, :c5879, :c5880, :c5881, :c5882, :c5883, :c5884, :c5885, :c5886, :c5887, :c5888, :c5889, :c5890, :c5891, :c5892, :c5893, :c5894, :c5895, :c5896, :c5897, :c5898, :c5899, :c5900, :c5901, :c5902, :c5903, :c5904, :c5905, :c5906, :c5907, :c5908, :c5909, :c5910, :c5911, :c5912, :c5913, :c5914, :c5915, :c5916, :c5917, :c5918, :c5919, :c5920, :c5921, :c5922, :c5923, :c5924, :c5925, :c5926, :c5927, :c5928, :c5929, :c5930, :c5931, :c5932, :c5933, :c5934, :c5935, :c5936, :c5937, :c5938, :c5939, :c5940, :c5941, :c5942, :c5943, :c5944, :c5945, :c5946, :c5947, :c5948, :c5949, :c5950, :c5951, :c5952, :c5953, :c5954, :c5955, :c5956, :c5957, :c5958, :c5959, :c5960, :c5961, :c5962, :c5963, :c5964, :c5965, :c5966, :c5967, :c5968, :c5969, :c5970, :c5971, :c5972, :c5973, :c5974, :c5975, :c5976, :c5977, :c5978, :c5979, :c5980, :c5981, :c5982, :c5983, :c5984, :c5985, :c5986, :c5987, :c5988, :c5989, :c5990, :c5991, :c5992, :c5993, :c5994, :c5995, :c5996, :c5997, :c5998, :c5999, :c6000, :c6001, :c6002, :c6003, :c6004, :c6005, :c6006, :c6007, :c6008, :c6009, :c6010, :c6011, :c6012, :c6013, :c6014, :c6015, :c6016, :c6017, :c6018, :c6019, :c6020, :c6021, :c6022, :c6023, :c6024, :c6025, :c6026, :c6027, :c6028, :c6029, :c6030, :c6031, :c6032, :c6033, :c6034, :c6035, :c6036, :c6037, :c6038, :c6039, :c6040, :c6041, :c6042, :c6043, :c6044, :c6045, :c6046, :c6047, :c6048, :c6049, :c6050, :c6051, :c6052, :c6053, :c6054, :c6055, :c6056, :c6057, :c6058, :c6059, :c6060, :c6061, :c6062, :c6063, :c6064, :c6065, :c6066, :c6067, :c6068, :c6069, :c6070, :c6071, :c6072, :c6073, :c6074, :c6075, :c6076, :c6077, :c6078, :c6079, :c6080, :c6081, :c6082, :c6083, :c6084, :c6085, :c6086, :c6087, :c6088, :c6089, :c6090, :c6091, :c6092, :c6093, :c6094, :c6095, :c6096, :c6097, :c6098, :c6099, :c6100, :c6101, :c6102, :c6103, :c6104, :c6105, :c6106, :c6107, :c6108, :c6109, :c6110, :c6111, :c6112, :c6113, :c6114, :c6115, :c6116, :c6117, :c6118, :c6119, :c6120, :c6121, :c6122, :c6123, :c6124, :c6125, :c6126, :c6127, :c6128, :c6129, :c6130, :c6131, :c6132, :c6133, :c6134, :c6135, :c6136, :c6137, :c6138, :c6139, :c6140, :c6141, :c6142, :c6143, :c6144, :c6145, :c6146, :c6147, :c6148, :c6149, :c6150, :c6151, :c6152, :c6153, :c6154, :c6155, :c6156, :c6157, :c6158, :c6159, :c6160, :c6161, :c6162, :c6163, :c6164, :c6165, :c6166, :c6167, :c6168, :c6169, :c6170, :c6171, :c6172, :c6173, :c6174, :c6175, :c6176, :c6177, :c6178, :c6179, :c6180, :c6181, :c6182, :c6183, :c6184, :c6185, :c6186, :c6187, :c6188, :c6189, :c6190, :c6191, :c6192, :c6193, :c6194, :c6195, :c6196, :c6197, :c6198, :c6199, :c6200, :c6201, :c6202, :c6203, :c6204, :c6205, :c6206, :c6207, :c6208, :c6209, :c6210, :c6211, :c6212, :c6213, :c6214, :c6215, :c6216, :c6217, :c6218, :c6219, :c6220, :c6221, :c6222, :c6223, :c6224, :c6225, :c6226, :c6227, :c6228, :c6229, :c6230, :c6231, :c6232, :c6233, :c6234, :c6235, :c6236, :c6237, :c6238, :c6239, :c6240, :c6241, :c6242, :c6243, :c6244, :c6245, :c6246, :c6247, :c6248, :c6249, :c6250, :c6251, :c6252, :c6253, :c6254, :c6255, :c6256, :c6257, :c6258, :c6259, :c6260, :c6261, :c6262, :c6263, :c6264, :c6265, :c6266, :c6267, :c6268, :c6269, :c6270, :c6271, :c6272, :c6273, :c6274, :c6275, :c6276, :c6277, :c6278, :c6279, :c6280, :c6281, :c6282, :c6283, :c6284, :c6285, :c6286, :c6287, :c6288, :c6289, :c6290, :c6291, :c6292, :c6293, :c6294, :c6295, :c6296, :c6297, :c6298, :c6299, :c6300, :c6301, :c6302, :c6303, :c6304, :c6305, :c6306, :c6307, :c6308, :c6309, :c6310, :c6311, :c6312, :c6313, :c6314, :c6315, :c6316, :c6317, :c6318, :c6319, :c6320, :c6321, :c6322, :c6323, :c6324, :c6325, :c6326, :c6327, :c6328, :c6329, :c6330, :c6331, :c6332, :c6333, :c6334, :c6335, :c6336, :c6337, :c6338, :c6339, :c6340, :c6341, :c6342, :c6343, :c6344, :c6345, :c6346, :c6347, :c6348, :c6349, :c6350, :c6351, :c6352, :c6353, :c6354, :c6355, :c6356, :c6357, :c6358, :c6359, :c6360, :c6361, :c6362, :c6363, :c6364, :c6365, :c6366, :c6367, :c6368, :c6369, :c6370, :c6371, :c6372, :c6373, :c6374, :c6375, :c6376, :c6377, :c6378, :c6379, :c6380, :c6381, :c6382, :c6383, :c6384, :c6385, :c6386, :c6387, :c6388, :c6389, :c6390, :c6391, :c6392, :c6393, :c6394, :c6395, :c6396, :c6397, :c6398, :c6399, :c6400, :c6401, :c6402, :c6403, :c6404, :c6405, :c6406, :c6407, :c6408, :c6409, :c6410, :c6411, :c6412, :c6413, :c6414, :c6415, :c6416, :c6417, :c6418, :c6419, :c6420, :c6421, :c6422, :c6423, :c6424, :c6425, :c6426, :c6427, :c6428, :c6429, :c6430, :c6431, :c6432, :c6433, :c6434, :c6435, :c6436, :c6437, :c6438, :c6439, :c6440, :c6441, :c6442, :c6443, :c6444, :c6445, :c6446, :c6447, :c6448, :c6449, :c6450, :c6451, :c6452, :c6453, :c6454, :c6455, :c6456, :c6457, :c6458, :c6459, :c6460, :c6461, :c6462, :c6463, :c6464, :c6465, :c6466, :c6467, :c6468, :c6469, :c6470, :c6471, :c6472, :c6473, :c6474, :c6475, :c6476, :c6477, :c6478, :c6479, :c6480, :c6481, :c6482, :c6483, :c6484, :c6485, :c6486, :c6487, :c6488, :c6489, :c6490, :c6491, :c6492, :c6493, :c6494, :c6495, :c6496, :c6497, :c6498, :c6499, :c6500, :c6501, :c6502, :c6503, :c6504, :c6505, :c6506, :c6507, :c6508, :c6509, :c6510, :c6511, :c6512, :c6513, :c6514, :c6515, :c6516, :c6517, :c6518, :c6519, :c6520, :c6521, :c6522, :c6523, :c6524, :c6525, :c6526, :c6527, :c6528, :c6529, :c6530, :c6531, :c6532, :c6533, :c6534, :c6535, :c6536, :c6537, :c6538, :c6539, :c6540, :c6541, :c6542, :c6543, :c6544, :c6545, :c6546, :c6547, :c6548, :c6549, :c6550, :c6551, :c6552, :c6553, :c6554, :c6555, :c6556, :c6557, :c6558, :c6559, :c6560, :c6561, :c6562, :c6563, :c6564, :c6565, :c6566, :c6567, :c6568, :c6569, :c6570, :c6571, :c6572, :c6573, :c6574, :c6575, :c6576, :c6577, :c6578, :c6579, :c6580, :c6581, :c6582, :c6583, :c6584, :c6585, :c6586, :c6587, :c6588, :c6589, :c6590, :c6591, :c6592, :c6593, :c6594, :c6595, :c6596, :c6597, :c6598, :c6599, :c6600, :c6601, :c6602, :c6603, :c6604, :c6605, :c6606, :c6607, :c6608, :c6609, :c6610, :c6611, :c6612, :c6613, :c6614, :c6615, :c6616, :c6617, :c6618, :c6619, :c6620, :c6621, :c6622, :c6623, :c6624, :c6625, :c6626, :c6627, :c6628, :c6629, :c6630, :c6631, :c6632, :c6633, :c6634, :c6635, :c6636, :c6637, :c6638, :c6639, :c6640, :c6641, :c6642, :c6643, :c6644, :c6645, :c6646, :c6647, :c6648, :c6649, :c6650, :c6651, :c6652, :c6653, :c6654, :c6655, :c6656, :c6657, :c6658, :c6659, :c6660, :c6661, :c6662, :c6663, :c6664, :c6665, :c6666, :c6667, :c6668, :c6669, :c6670, :c6671, :c6672, :c6673, :c6674, :c6675, :c6676, :c6677, :c6678, :c6679, :c6680, :c6681, :c6682, :c6683, :c6684, :c6685, :c6686, :c6687, :c6688, :c6689, :c6690, :c6691, :c6692, :c6693, :c6694, :c6695, :c6696, :c6697, :c6698, :c6699, :c6700, :c6701, :c6702, :c6703, :c6704, :c6705, :c6706, :c6707, :c6708, :c6709, :c6710, :c6711, :c6712, :c6713, :c6714, :c6715, :c6716, :c6717, :c6718, :c6719, :c6720, :c6721, :c6722, :c6723, :c6724, :c6725, :c6726, :c6727, :c6728, :c6729, :c6730, :c6731, :c6732, :c6733, :c6734, :c6735, :c6736, :c6737, :c6738, :c6739, :c6740, :c6741, :c6742, :c6743, :c6744, :c6745, :c6746, :c6747, :c6748, :c6749, :c6750, :c6751, :c6752, :c6753, :c6754, :c6755, :c6756, :c6757, :c6758, :c6759, :c6760, :c6761, :c6762, :c6763, :c6764, :c6765, :c6766, :c6767, :c6768, :c6769, :c6770, :c6771, :c6772, :c6773, :c6774, :c6775, :c6776, :c6777, :c6778, :c6779, :c6780, :c6781, :c6782, :c6783, :c6784, :c6785, :c6786, :c6787, :c6788, :c6789, :c6790, :c6791, :c6792, :c6793, :c6794, :c6795, :c6796, :c6797, :c6798, :c6799, :c6800, :c6801, :c6802, :c6803, :c6804, :c6805, :c6806, :c6807, :c6808, :c6809, :c6810, :c6811, :c6812, :c6813, :c6814, :c6815, :c6816, :c6817, :c6818, :c6819, :c6820, :c6821, :c6822, :c6823, :c6824, :c6825, :c6826, :c6827, :c6828, :c6829, :c6830, :c6831, :c6832, :c6833, :c6834, :c6835, :c6836, :c6837, :c6838, :c6839, :c6840, :c6841, :c6842, :c6843, :c6844, :c6845, :c6846, :c6847, :c6848, :c6849, :c6850, :c6851, :c6852, :c6853, :c6854, :c6855, :c6856, :c6857, :c6858, :c6859, :c6860, :c6861, :c6862, :c6863, :c6864, :c6865, :c6866, :c6867, :c6868, :c6869, :c6870, :c6871, :c6872, :c6873, :c6874, :c6875, :c6876, :c6877, :c6878, :c6879, :c6880, :c6881, :c6882, :c6883, :c6884, :c6885, :c6886, :c6887, :c6888, :c6889, :c6890, :c6891, :c6892, :c6893, :c6894, :c6895, :c6896, :c6897, :c6898, :c6899, :c6900, :c6901, :c6902, :c6903, :c6904, :c6905, :c6906, :c6907, :c6908, :c6909, :c6910, :c6911, :c6912, :c6913, :c6914, :c6915, :c6916, :c6917, :c6918, :c6919, :c6920, :c6921, :c6922, :c6923, :c6924, :c6925, :c6926, :c6927, :c6928, :c6929, :c6930, :c6931, :c6932, :c6933, :c6934, :c6935, :c6936, :c6937, :c6938, :c6939, :c6940, :c6941, :c6942, :c6943, :c6944, :c6945, :c6946, :c6947, :c6948, :c6949, :c6950, :c6951, :c6952, :c6953, :c6954, :c6955, :c6956, :c6957, :c6958, :c6959, :c6960, :c6961, :c6962, :c6963, :c6964, :c6965, :c6966, :c6967, :c6968, :c6969, :c6970, :c6971, :c6972, :c6973, :c6974, :c6975, :c6976, :c6977, :c6978, :c6979, :c6980, :c6981, :c6982, :c6983, :c6984, :c6985, :c6986, :c6987, :c6988, :c6989, :c6990, :c6991, :c6992, :c6993, :c6994, :c6995, :c6996, :c6997, :c6998, :c6999, :c7000, :c7001, :c7002, :c7003, :c7004, :c7005, :c7006, :c7007, :c7008, :c7009, :c7010, :c7011, :c7012, :c7013, :c7014, :c7015, :c7016, :c7017, :c7018, :c7019, :c7020, :c7021, :c7022, :c7023, :c7024, :c7025, :c7026, :c7027, :c7028, :c7029, :c7030, :c7031, :c7032, :c7033, :c7034, :c7035, :c7036, :c7037, :c7038, :c7039, :c7040, :c7041, :c7042, :c7043, :c7044, :c7045, :c7046, :c7047, :c7048, :c7049, :c7050, :c7051, :c7052, :c7053, :c7054, :c7055, :c7056, :c7057, :c7058, :c7059, :c7060, :c7061, :c7062, :c7063, :c7064, :c7065, :c7066, :c7067, :c7068, :c7069, :c7070, :c7071, :c7072, :c7073, :c7074, :c7075, :c7076, :c7077, :c7078, :c7079, :c7080, :c7081, :c7082, :c7083, :c7084, :c7085, :c7086, :c7087, :c7088, :c7089, :c7090, :c7091, :c7092, :c7093, :c7094, :c7095, :c7096, :c7097, :c7098, :c7099, :c7100, :c7101, :c7102, :c7103, :c7104, :c7105, :c7106, :c7107, :c7108, :c7109, :c7110, :c7111, :c7112, :c7113, :c7114, :c7115, :c7116, :c7117, :c7118, :c7119, :c7120, :c7121, :c7122, :c7123, :c7124, :c7125, :c7126, :c7127, :c7128, :c7129, :c7130, :c7131, :c7132, :c7133, :c7134, :c7135, :c7136, :c7137, :c7138, :c7139, :c7140, :c7141, :c7142, :c7143, :c7144, :c7145, :c7146, :c7147, :c7148, :c7149, :c7150, :c7151, :c7152, :c7153, :c7154, :c7155, :c7156, :c7157, :c7158, :c7159, :c7160, :c7161, :c7162, :c7163, :c7164, :c7165, :c7166, :c7167, :c7168, :c7169, :c7170, :c7171, :c7172, :c7173, :c7174, :c7175, :c7176, :c7177, :c7178, :c7179, :c7180, :c7181, :c7182, :c7183, :c7184, :c7185, :c7186, :c7187, :c7188, :c7189, :c7190, :c7191, :c7192, :c7193, :c7194, :c7195, :c7196, :c7197, :c7198, :c7199, :c7200, :c7201, :c7202, :c7203, :c7204, :c7205, :c7206, :c7207, :c7208, :c7209, :c7210, :c7211, :c7212, :c7213, :c7214, :c7215, :c7216, :c7217, :c7218, :c7219, :c7220, :c7221, :c7222, :c7223, :c7224, :c7225, :c7226, :c7227, :c7228, :c7229, :c7230, :c7231, :c7232, :c7233, :c7234, :c7235, :c7236, :c7237, :c7238, :c7239, :c7240, :c7241, :c7242, :c7243, :c7244, :c7245, :c7246, :c7247, :c7248, :c7249, :c7250, :c7251, :c7252, :c7253, :c7254, :c7255, :c7256, :c7257, :c7258, :c7259, :c7260, :c7261, :c7262, :c7263, :c7264, :c7265, :c7266, :c7267, :c7268, :c7269, :c7270, :c7271, :c7272, :c7273, :c7274, :c7275, :c7276, :c7277, :c7278, :c7279, :c7280, :c7281, :c7282, :c7283, :c7284, :c7285, :c7286, :c7287, :c7288, :c7289, :c7290, :c7291, :c7292, :c7293, :c7294, :c7295, :c7296, :c7297, :c7298, :c7299, :c7300, :c7301, :c7302, :c7303, :c7304, :c7305, :c7306, :c7307, :c7308, :c7309, :c7310, :c7311, :c7312, :c7313, :c7314, :c7315, :c7316, :c7317, :c7318, :c7319, :c7320, :c7321, :c7322, :c7323, :c7324, :c7325, :c7326, :c7327, :c7328, :c7329, :c7330, :c7331, :c7332, :c7333, :c7334, :c7335, :c7336, :c7337, :c7338, :c7339, :c7340, :c7341, :c7342, :c7343, :c7344, :c7345, :c7346, :c7347, :c7348, :c7349, :c7350, :c7351, :c7352, :c7353, :c7354, :c7355, :c7356, :c7357, :c7358, :c7359, :c7360, :c7361, :c7362, :c7363, :c7364, :c7365, :c7366, :c7367, :c7368, :c7369, :c7370, :c7371, :c7372, :c7373, :c7374, :c7375, :c7376, :c7377, :c7378, :c7379, :c7380, :c7381, :c7382, :c7383, :c7384, :c7385, :c7386, :c7387, :c7388, :c7389, :c7390, :c7391, :c7392, :c7393, :c7394, :c7395, :c7396, :c7397, :c7398, :c7399, :c7400, :c7401, :c7402, :c7403, :c7404, :c7405, :c7406, :c7407, :c7408, :c7409, :c7410, :c7411, :c7412, :c7413, :c7414, :c7415, :c7416, :c7417, :c7418, :c7419, :c7420, :c7421, :c7422, :c7423, :c7424, :c7425, :c7426, :c7427, :c7428, :c7429, :c7430, :c7431, :c7432, :c7433, :c7434, :c7435, :c7436, :c7437, :c7438, :c7439, :c7440, :c7441, :c7442, :c7443, :c7444, :c7445, :c7446, :c7447, :c7448, :c7449, :c7450, :c7451, :c7452, :c7453, :c7454, :c7455, :c7456, :c7457, :c7458, :c7459, :c7460, :c7461, :c7462, :c7463, :c7464, :c7465, :c7466, :c7467, :c7468, :c7469, :c7470, :c7471, :c7472, :c7473, :c7474, :c7475, :c7476, :c7477, :c7478, :c7479, :c7480, :c7481, :c7482, :c7483, :c7484, :c7485, :c7486, :c7487, :c7488, :c7489, :c7490, :c7491, :c7492, :c7493, :c7494, :c7495, :c7496, :c7497, :c7498, :c7499, :c7500, :c7501, :c7502, :c7503, :c7504, :c7505, :c7506, :c7507, :c7508, :c7509, :c7510, :c7511, :c7512, :c7513, :c7514, :c7515, :c7516, :c7517, :c7518, :c7519, :c7520, :c7521, :c7522, :c7523, :c7524, :c7525, :c7526, :c7527, :c7528, :c7529, :c7530, :c7531, :c7532, :c7533, :c7534, :c7535, :c7536, :c7537, :c7538, :c7539, :c7540, :c7541, :c7542, :c7543, :c7544, :c7545, :c7546, :c7547, :c7548, :c7549, :c7550, :c7551, :c7552, :c7553, :c7554, :c7555, :c7556, :c7557, :c7558, :c7559, :c7560, :c7561, :c7562, :c7563, :c7564, :c7565, :c7566, :c7567, :c7568, :c7569, :c7570, :c7571, :c7572, :c7573, :c7574, :c7575, :c7576, :c7577, :c7578, :c7579, :c7580, :c7581, :c7582, :c7583, :c7584, :c7585, :c7586, :c7587, :c7588, :c7589, :c7590, :c7591, :c7592, :c7593, :c7594, :c7595, :c7596, :c7597, :c7598, :c7599, :c7600, :c7601, :c7602, :c7603, :c7604, :c7605, :c7606, :c7607, :c7608, :c7609, :c7610, :c7611, :c7612, :c7613, :c7614, :c7615, :c7616, :c7617, :c7618, :c7619, :c7620, :c7621, :c7622, :c7623, :c7624, :c7625, :c7626, :c7627, :c7628, :c7629, :c7630, :c7631, :c7632, :c7633, :c7634, :c7635, :c7636, :c7637, :c7638, :c7639, :c7640, :c7641, :c7642, :c7643, :c7644, :c7645, :c7646, :c7647, :c7648, :c7649, :c7650, :c7651, :c7652, :c7653, :c7654, :c7655, :c7656, :c7657, :c7658, :c7659, :c7660, :c7661, :c7662, :c7663, :c7664, :c7665, :c7666, :c7667, :c7668, :c7669, :c7670, :c7671, :c7672, :c7673, :c7674, :c7675, :c7676, :c7677, :c7678, :c7679, :c7680, :c7681, :c7682, :c7683, :c7684, :c7685, :c7686, :c7687, :c7688, :c7689, :c7690, :c7691, :c7692, :c7693, :c7694, :c7695, :c7696, :c7697, :c7698, :c7699, :c7700, :c7701, :c7702, :c7703, :c7704, :c7705, :c7706, :c7707, :c7708, :c7709, :c7710, :c7711, :c7712, :c7713, :c7714, :c7715, :c7716, :c7717, :c7718, :c7719, :c7720, :c7721, :c7722, :c7723, :c7724, :c7725, :c7726, :c7727, :c7728, :c7729, :c7730, :c7731, :c7732, :c7733, :c7734, :c7735, :c7736, :c7737, :c7738, :c7739, :c7740, :c7741, :c7742, :c7743, :c7744, :c7745, :c7746, :c7747, :c7748, :c7749, :c7750, :c7751, :c7752, :c7753, :c7754, :c7755, :c7756, :c7757, :c7758, :c7759, :c7760, :c7761, :c7762, :c7763, :c7764, :c7765, :c7766, :c7767, :c7768, :c7769, :c7770, :c7771, :c7772, :c7773, :c7774, :c7775, :c7776, :c7777, :c7778, :c7779, :c7780, :c7781, :c7782, :c7783, :c7784, :c7785, :c7786, :c7787, :c7788, :c7789, :c7790, :c7791, :c7792, :c7793, :c7794, :c7795, :c7796, :c7797, :c7798, :c7799, :c7800, :c7801, :c7802, :c7803, :c7804, :c7805, :c7806, :c7807, :c7808, :c7809, :c7810, :c7811, :c7812, :c7813, :c7814, :c7815, :c7816, :c7817, :c7818, :c7819, :c7820, :c7821, :c7822, :c7823, :c7824, :c7825, :c7826, :c7827, :c7828, :c7829, :c7830, :c7831, :c7832, :c7833, :c7834, :c7835, :c7836, :c7837, :c7838, :c7839, :c7840, :c7841, :c7842, :c7843, :c7844, :c7845, :c7846, :c7847, :c7848, :c7849, :c7850, :c7851, :c7852, :c7853, :c7854, :c7855, :c7856, :c7857, :c7858, :c7859, :c7860, :c7861, :c7862, :c7863, :c7864, :c7865, :c7866, :c7867, :c7868, :c7869, :c7870, :c7871, :c7872, :c7873, :c7874, :c7875, :c7876, :c7877, :c7878, :c7879, :c7880, :c7881, :c7882, :c7883, :c7884, :c7885, :c7886, :c7887, :c7888, :c7889, :c7890, :c7891, :c7892, :c7893, :c7894, :c7895, :c7896, :c7897, :c7898, :c7899, :c7900, :c7901, :c7902, :c7903, :c7904, :c7905, :c7906, :c7907, :c7908, :c7909, :c7910, :c7911, :c7912, :c7913, :c7914, :c7915, :c7916, :c7917, :c7918, :c7919, :c7920, :c7921, :c7922, :c7923, :c7924, :c7925, :c7926, :c7927, :c7928, :c7929, :c7930, :c7931, :c7932, :c7933, :c7934, :c7935, :c7936, :c7937, :c7938, :c7939, :c7940, :c7941, :c7942, :c7943, :c7944, :c7945, :c7946, :c7947, :c7948, :c7949, :c7950, :c7951, :c7952, :c7953, :c7954, :c7955, :c7956, :c7957, :c7958, :c7959, :c7960, :c7961, :c7962, :c7963, :c7964, :c7965, :c7966, :c7967, :c7968, :c7969, :c7970, :c7971, :c7972, :c7973, :c7974, :c7975, :c7976, :c7977, :c7978, :c7979, :c7980, :c7981, :c7982, :c7983, :c7984, :c7985, :c7986, :c7987, :c7988, :c7989, :c7990, :c7991, :c7992, :c7993, :c7994, :c7995, :c7996, :c7997, :c7998, :c7999, :c8000, :c8001, :c8002, :c8003, :c8004, :c8005, :c8006, :c8007, :c8008, :c8009, :c8010, :c8011, :c8012, :c8013, :c8014, :c8015, :c8016, :c8017, :c8018, :c8019, :c8020, :c8021, :c8022, :c8023, :c8024, :c8025, :c8026, :c8027, :c8028, :c8029, :c8030, :c8031, :c8032, :c8033, :c8034, :c8035, :c8036, :c8037, :c8038, :c8039, :c8040, :c8041, :c8042, :c8043, :c8044, :c8045, :c8046, :c8047, :c8048, :c8049, :c8050, :c8051, :c8052, :c8053, :c8054, :c8055, :c8056, :c8057, :c8058, :c8059, :c8060, :c8061, :c8062, :c8063, :c8064, :c8065, :c8066, :c8067, :c8068, :c8069, :c8070, :c8071, :c8072, :c8073, :c8074, :c8075, :c8076, :c8077, :c8078, :c8079, :c8080, :c8081, :c8082, :c8083, :c8084, :c8085, :c8086, :c8087, :c8088, :c8089, :c8090, :c8091, :c8092, :c8093, :c8094, :c8095, :c8096, :c8097, :c8098, :c8099, :c8100, :c8101, :c8102, :c8103, :c8104, :c8105, :c8106, :c8107, :c8108, :c8109, :c8110, :c8111, :c8112, :c8113, :c8114, :c8115, :c8116, :c8117, :c8118, :c8119, :c8120, :c8121, :c8122, :c8123, :c8124, :c8125, :c8126, :c8127, :c8128, :c8129, :c8130, :c8131, :c8132, :c8133, :c8134, :c8135, :c8136, :c8137, :c8138, :c8139, :c8140, :c8141, :c8142, :c8143, :c8144, :c8145, :c8146, :c8147, :c8148, :c8149, :c8150, :c8151, :c8152, :c8153, :c8154, :c8155, :c8156, :c8157, :c8158, :c8159, :c8160, :c8161, :c8162, :c8163, :c8164, :c8165, :c8166, :c8167, :c8168, :c8169, :c8170, :c8171, :c8172, :c8173, :c8174, :c8175, :c8176, :c8177, :c8178, :c8179, :c8180, :c8181, :c8182, :c8183, :c8184, :c8185, :c8186, :c8187, :c8188, :c8189, :c8190, :c8191, :c8192, :c8193, :c8194, :c8195, :c8196, :c8197, :c8198, :c8199, :c8200, :c8201, :c8202, :c8203, :c8204, :c8205, :c8206, :c8207, :c8208, :c8209, :c8210, :c8211, :c8212, :c8213, :c8214, :c8215, :c8216, :c8217, :c8218, :c8219, :c8220, :c8221, :c8222, :c8223, :c8224, :c8225, :c8226, :c8227, :c8228, :c8229, :c8230, :c8231, :c8232, :c8233, :c8234, :c8235, :c8236, :c8237, :c8238, :c8239, :c8240, :c8241, :c8242, :c8243, :c8244, :c8245, :c8246, :c8247, :c8248, :c8249, :c8250, :c8251, :c8252, :c8253, :c8254, :c8255, :c8256, :c8257, :c8258, :c8259, :c8260, :c8261, :c8262, :c8263, :c8264, :c8265, :c8266, :c8267, :c8268, :c8269, :c8270, :c8271, :c8272, :c8273, :c8274, :c8275, :c8276, :c8277, :c8278, :c8279, :c8280, :c8281, :c8282, :c8283, :c8284, :c8285, :c8286, :c8287, :c8288, :c8289, :c8290, :c8291, :c8292, :c8293, :c8294, :c8295, :c8296, :c8297, :c8298, :c8299, :c8300, :c8301, :c8302, :c8303, :c8304, :c8305, :c8306, :c8307, :c8308, :c8309, :c8310, :c8311, :c8312, :c8313, :c8314, :c8315, :c8316, :c8317, :c8318, :c8319, :c8320, :c8321, :c8322, :c8323, :c8324, :c8325, :c8326, :c8327, :c8328, :c8329, :c8330, :c8331, :c8332, :c8333, :c8334, :c8335, :c8336, :c8337, :c8338, :c8339, :c8340, :c8341, :c8342, :c8343, :c8344, :c8345, :c8346, :c8347, :c8348, :c8349, :c8350, :c8351, :c8352, :c8353, :c8354, :c8355, :c8356, :c8357, :c8358, :c8359, :c8360, :c8361, :c8362, :c8363, :c8364, :c8365, :c8366, :c8367, :c8368, :c8369, :c8370, :c8371, :c8372, :c8373, :c8374, :c8375, :c8376, :c8377, :c8378, :c8379, :c8380, :c8381, :c8382, :c8383, :c8384, :c8385, :c8386, :c8387, :c8388, :c8389, :c8390, :c8391, :c8392, :c8393, :c8394, :c8395, :c8396, :c8397, :c8398, :c8399, :c8400, :c8401, :c8402, :c8403, :c8404, :c8405, :c8406, :c8407, :c8408, :c8409, :c8410, :c8411, :c8412, :c8413, :c8414, :c8415, :c8416, :c8417, :c8418, :c8419, :c8420, :c8421, :c8422, :c8423, :c8424, :c8425, :c8426, :c8427, :c8428, :c8429, :c8430, :c8431, :c8432, :c8433, :c8434, :c8435, :c8436, :c8437, :c8438, :c8439, :c8440, :c8441, :c8442, :c8443, :c8444, :c8445, :c8446, :c8447, :c8448, :c8449, :c8450, :c8451, :c8452, :c8453, :c8454, :c8455, :c8456, :c8457, :c8458, :c8459, :c8460, :c8461, :c8462, :c8463, :c8464, :c8465, :c8466, :c8467, :c8468, :c8469, :c8470, :c8471, :c8472, :c8473, :c8474, :c8475, :c8476, :c8477, :c8478, :c8479, :c8480, :c8481, :c8482, :c8483, :c8484, :c8485, :c8486, :c8487, :c8488, :c8489, :c8490, :c8491, :c8492, :c8493, :c8494, :c8495, :c8496, :c8497, :c8498, :c8499, :c8500, :c8501, :c8502, :c8503, :c8504, :c8505, :c8506, :c8507, :c8508, :c8509, :c8510, :c8511, :c8512, :c8513, :c8514, :c8515, :c8516, :c8517, :c8518, :c8519, :c8520, :c8521, :c8522, :c8523, :c8524, :c8525, :c8526, :c8527, :c8528, :c8529, :c8530, :c8531, :c8532, :c8533, :c8534, :c8535, :c8536, :c8537, :c8538, :c8539, :c8540, :c8541, :c8542, :c8543, :c8544, :c8545, :c8546, :c8547, :c8548, :c8549, :c8550, :c8551, :c8552, :c8553, :c8554, :c8555, :c8556, :c8557, :c8558, :c8559, :c8560, :c8561, :c8562, :c8563, :c8564, :c8565, :c8566, :c8567, :c8568, :c8569, :c8570, :c8571, :c8572, :c8573, :c8574, :c8575, :c8576, :c8577, :c8578, :c8579, :c8580, :c8581, :c8582, :c8583, :c8584, :c8585, :c8586, :c8587, :c8588, :c8589, :c8590, :c8591, :c8592, :c8593, :c8594, :c8595, :c8596, :c8597, :c8598, :c8599, :c8600, :c8601, :c8602, :c8603, :c8604, :c8605, :c8606, :c8607, :c8608, :c8609, :c8610, :c8611, :c8612, :c8613, :c8614, :c8615, :c8616, :c8617, :c8618, :c8619, :c8620, :c8621, :c8622, :c8623, :c8624, :c8625, :c8626, :c8627, :c8628, :c8629, :c8630, :c8631, :c8632, :c8633, :c8634, :c8635, :c8636, :c8637, :c8638, :c8639, :c8640, :c8641, :c8642, :c8643, :c8644, :c8645, :c8646, :c8647, :c8648, :c8649, :c8650, :c8651, :c8652, :c8653, :c8654, :c8655, :c8656, :c8657, :c8658, :c8659, :c8660, :c8661, :c8662, :c8663, :c8664, :c8665, :c8666, :c8667, :c8668, :c8669, :c8670, :c8671, :c8672, :c8673, :c8674, :c8675, :c8676, :c8677, :c8678, :c8679, :c8680, :c8681, :c8682, :c8683, :c8684, :c8685, :c8686, :c8687, :c8688, :c8689, :c8690, :c8691, :c8692, :c8693, :c8694, :c8695, :c8696, :c8697, :c8698, :c8699, :c8700, :c8701, :c8702, :c8703, :c8704, :c8705, :c8706, :c8707, :c8708, :c8709, :c8710, :c8711, :c8712, :c8713, :c8714, :c8715, :c8716, :c8717, :c8718, :c8719, :c8720, :c8721, :c8722, :c8723, :c8724, :c8725, :c8726, :c8727, :c8728, :c8729, :c8730, :c8731, :c8732, :c8733, :c8734, :c8735, :c8736, :c8737, :c8738, :c8739, :c8740, :c8741, :c8742, :c8743, :c8744, :c8745, :c8746, :c8747, :c8748, :c8749, :c8750, :c8751, :c8752, :c8753, :c8754, :c8755, :c8756, :c8757, :c8758, :c8759, :c8760, :c8761, :c8762, :c8763, :c8764, :c8765, :c8766, :c8767, :c8768, :c8769, :c8770, :c8771, :c8772, :c8773, :c8774, :c8775, :c8776, :c8777, :c8778, :c8779, :c8780, :c8781, :c8782, :c8783, :c8784, :c8785, :c8786, :c8787, :c8788, :c8789, :c8790, :c8791, :c8792, :c8793, :c8794, :c8795, :c8796, :c8797, :c8798, :c8799, :c8800, :c8801, :c8802, :c8803, :c8804, :c8805, :c8806, :c8807, :c8808, :c8809, :c8810, :c8811, :c8812, :c8813, :c8814, :c8815, :c8816, :c8817, :c8818, :c8819, :c8820, :c8821, :c8822, :c8823, :c8824, :c8825, :c8826, :c8827, :c8828, :c8829, :c8830, :c8831, :c8832, :c8833, :c8834, :c8835, :c8836, :c8837, :c8838, :c8839, :c8840, :c8841, :c8842, :c8843, :c8844, :c8845, :c8846, :c8847, :c8848, :c8849, :c8850, :c8851, :c8852, :c8853, :c8854, :c8855, :c8856, :c8857, :c8858, :c8859, :c8860, :c8861, :c8862, :c8863, :c8864, :c8865, :c8866, :c8867, :c8868, :c8869, :c8870, :c8871, :c8872, :c8873, :c8874, :c8875, :c8876, :c8877, :c8878, :c8879, :c8880, :c8881, :c8882, :c8883, :c8884, :c8885, :c8886, :c8887, :c8888, :c8889, :c8890, :c8891, :c8892, :c8893, :c8894, :c8895, :c8896, :c8897, :c8898, :c8899, :c8900, :c8901, :c8902, :c8903, :c8904, :c8905, :c8906, :c8907, :c8908, :c8909, :c8910, :c8911, :c8912, :c8913, :c8914, :c8915, :c8916, :c8917, :c8918, :c8919, :c8920, :c8921, :c8922, :c8923, :c8924, :c8925, :c8926, :c8927, :c8928, :c8929, :c8930, :c8931, :c8932, :c8933, :c8934, :c8935, :c8936, :c8937, :c8938, :c8939, :c8940, :c8941, :c8942, :c8943, :c8944, :c8945, :c8946, :c8947, :c8948, :c8949, :c8950, :c8951, :c8952, :c8953, :c8954, :c8955, :c8956, :c8957, :c8958, :c8959, :c8960, :c8961, :c8962, :c8963, :c8964, :c8965, :c8966, :c8967, :c8968, :c8969, :c8970, :c8971, :c8972, :c8973, :c8974, :c8975, :c8976, :c8977, :c8978, :c8979, :c8980, :c8981, :c8982, :c8983, :c8984, :c8985, :c8986, :c8987, :c8988, :c8989, :c8990, :c8991, :c8992, :c8993, :c8994, :c8995, :c8996, :c8997, :c8998, :c8999, :c9000, :c9001, :c9002, :c9003, :c9004, :c9005, :c9006, :c9007, :c9008, :c9009, :c9010, :c9011, :c9012, :c9013, :c9014, :c9015, :c9016, :c9017, :c9018, :c9019, :c9020, :c9021, :c9022, :c9023, :c9024, :c9025, :c9026, :c9027, :c9028, :c9029, :c9030, :c9031, :c9032, :c9033, :c9034, :c9035, :c9036, :c9037, :c9038, :c9039, :c9040, :c9041, :c9042, :c9043, :c9044, :c9045, :c9046, :c9047, :c9048, :c9049, :c9050, :c9051, :c9052, :c9053, :c9054, :c9055, :c9056, :c9057, :c9058, :c9059, :c9060, :c9061, :c9062, :c9063, :c9064, :c9065, :c9066, :c9067, :c9068, :c9069, :c9070, :c9071, :c9072, :c9073, :c9074, :c9075, :c9076, :c9077, :c9078, :c9079, :c9080, :c9081, :c9082, :c9083, :c9084, :c9085, :c9086, :c9087, :c9088, :c9089, :c9090, :c9091, :c9092, :c9093, :c9094, :c9095, :c9096, :c9097, :c9098, :c9099, :c9100, :c9101, :c9102, :c9103, :c9104, :c9105, :c9106, :c9107, :c9108, :c9109, :c9110, :c9111, :c9112, :c9113, :c9114, :c9115, :c9116, :c9117, :c9118, :c9119, :c9120, :c9121, :c9122, :c9123, :c9124, :c9125, :c9126, :c9127, :c9128, :c9129, :c9130, :c9131, :c9132, :c9133, :c9134, :c9135, :c9136, :c9137, :c9138, :c9139, :c9140, :c9141, :c9142, :c9143, :c9144, :c9145, :c9146, :c9147, :c9148, :c9149, :c9150, :c9151, :c9152, :c9153, :c9154, :c9155, :c9156, :c9157, :c9158, :c9159, :c9160, :c9161, :c9162, :c9163, :c9164, :c9165, :c9166, :c9167, :c9168, :c9169, :c9170, :c9171, :c9172, :c9173, :c9174, :c9175, :c9176, :c9177, :c9178, :c9179, :c9180, :c9181, :c9182, :c9183, :c9184, :c9185, :c9186, :c9187, :c9188, :c9189, :c9190, :c9191, :c9192, :c9193, :c9194, :c9195, :c9196, :c9197, :c9198, :c9199, :c9200, :c9201, :c9202, :c9203, :c9204, :c9205, :c9206, :c9207, :c9208, :c9209, :c9210, :c9211, :c9212, :c9213, :c9214, :c9215, :c9216, :c9217, :c9218, :c9219, :c9220, :c9221, :c9222, :c9223, :c9224, :c9225, :c9226, :c9227, :c9228, :c9229, :c9230, :c9231, :c9232, :c9233, :c9234, :c9235, :c9236, :c9237, :c9238, :c9239, :c9240, :c9241, :c9242, :c9243, :c9244, :c9245, :c9246, :c9247, :c9248, :c9249, :c9250, :c9251, :c9252, :c9253, :c9254, :c9255, :c9256, :c9257, :c9258, :c9259, :c9260, :c9261, :c9262, :c9263, :c9264, :c9265, :c9266, :c9267, :c9268, :c9269, :c9270, :c9271, :c9272, :c9273, :c9274, :c9275, :c9276, :c9277, :c9278, :c9279, :c9280, :c9281, :c9282, :c9283, :c9284, :c9285, :c9286, :c9287, :c9288, :c9289, :c9290, :c9291, :c9292, :c9293, :c9294, :c9295, :c9296, :c9297, :c9298, :c9299, :c9300, :c9301, :c9302, :c9303, :c9304, :c9305, :c9306, :c9307, :c9308, :c9309, :c9310, :c9311, :c9312, :c9313, :c9314, :c9315, :c9316, :c9317, :c9318, :c9319, :c9320, :c9321, :c9322, :c9323, :c9324, :c9325, :c9326, :c9327, :c9328, :c9329, :c9330, :c9331, :c9332, :c9333, :c9334, :c9335, :c9336, :c9337, :c9338, :c9339, :c9340, :c9341, :c9342, :c9343, :c9344, :c9345, :c9346, :c9347, :c9348, :c9349, :c9350, :c9351, :c9352, :c9353, :c9354, :c9355, :c9356, :c9357, :c9358, :c9359, :c9360, :c9361, :c9362, :c9363, :c9364, :c9365, :c9366, :c9367, :c9368, :c9369, :c9370, :c9371, :c9372, :c9373, :c9374, :c9375, :c9376, :c9377, :c9378, :c9379, :c9380, :c9381, :c9382, :c9383, :c9384, :c9385, :c9386, :c9387, :c9388, :c9389, :c9390, :c9391, :c9392, :c9393, :c9394, :c9395, :c9396, :c9397, :c9398, :c9399, :c9400, :c9401, :c9402, :c9403, :c9404, :c9405, :c9406, :c9407, :c9408, :c9409, :c9410, :c9411, :c9412, :c9413, :c9414, :c9415, :c9416, :c9417, :c9418, :c9419, :c9420, :c9421, :c9422, :c9423, :c9424, :c9425, :c9426, :c9427, :c9428, :c9429, :c9430, :c9431, :c9432, :c9433, :c9434, :c9435, :c9436, :c9437, :c9438, :c9439, :c9440, :c9441, :c9442, :c9443, :c9444, :c9445, :c9446, :c9447, :c9448, :c9449, :c9450, :c9451, :c9452, :c9453, :c9454, :c9455, :c9456, :c9457, :c9458, :c9459, :c9460, :c9461, :c9462, :c9463, :c9464, :c9465, :c9466, :c9467, :c9468, :c9469, :c9470, :c9471, :c9472, :c9473, :c9474, :c9475, :c9476, :c9477, :c9478, :c9479, :c9480, :c9481, :c9482, :c9483, :c9484, :c9485, :c9486, :c9487, :c9488, :c9489, :c9490, :c9491, :c9492, :c9493, :c9494, :c9495, :c9496, :c9497, :c9498, :c9499, :c9500, :c9501, :c9502, :c9503, :c9504, :c9505, :c9506, :c9507, :c9508, :c9509, :c9510, :c9511, :c9512, :c9513, :c9514, :c9515, :c9516, :c9517, :c9518, :c9519, :c9520, :c9521, :c9522, :c9523, :c9524, :c9525, :c9526, :c9527, :c9528, :c9529, :c9530, :c9531, :c9532, :c9533, :c9534, :c9535, :c9536, :c9537, :c9538, :c9539, :c9540, :c9541, :c9542, :c9543, :c9544, :c9545, :c9546, :c9547, :c9548, :c9549, :c9550, :c9551, :c9552, :c9553, :c9554, :c9555, :c9556, :c9557, :c9558, :c9559, :c9560, :c9561, :c9562, :c9563, :c9564, :c9565, :c9566, :c9567, :c9568, :c9569, :c9570, :c9571, :c9572, :c9573, :c9574, :c9575, :c9576, :c9577, :c9578, :c9579, :c9580, :c9581, :c9582, :c9583, :c9584, :c9585, :c9586, :c9587, :c9588, :c9589, :c9590, :c9591, :c9592, :c9593, :c9594, :c9595, :c9596, :c9597, :c9598, :c9599, :c9600, :c9601, :c9602, :c9603, :c9604, :c9605, :c9606, :c9607, :c9608, :c9609, :c9610, :c9611, :c9612, :c9613, :c9614, :c9615, :c9616, :c9617, :c9618, :c9619, :c9620, :c9621, :c9622, :c9623, :c9624, :c9625, :c9626, :c9627, :c9628, :c9629, :c9630, :c9631, :c9632, :c9633, :c9634, :c9635, :c9636, :c9637, :c9638, :c9639, :c9640, :c9641, :c9642, :c9643, :c9644, :c9645, :c9646, :c9647, :c9648, :c9649, :c9650, :c9651, :c9652, :c9653, :c9654, :c9655, :c9656, :c9657, :c9658, :c9659, :c9660, :c9661, :c9662, :c9663, :c9664, :c9665, :c9666, :c9667, :c9668, :c9669, :c9670, :c9671, :c9672, :c9673, :c9674, :c9675, :c9676, :c9677, :c9678, :c9679, :c9680, :c9681, :c9682, :c9683, :c9684, :c9685, :c9686, :c9687, :c9688, :c9689, :c9690, :c9691, :c9692, :c9693, :c9694, :c9695, :c9696, :c9697, :c9698, :c9699, :c9700, :c9701, :c9702, :c9703, :c9704, :c9705, :c9706, :c9707, :c9708, :c9709, :c9710, :c9711, :c9712, :c9713, :c9714, :c9715, :c9716, :c9717, :c9718, :c9719, :c9720, :c9721, :c9722, :c9723, :c9724, :c9725, :c9726, :c9727, :c9728, :c9729, :c9730, :c9731, :c9732, :c9733, :c9734, :c9735, :c9736, :c9737, :c9738, :c9739, :c9740, :c9741, :c9742, :c9743, :c9744, :c9745, :c9746, :c9747, :c9748, :c9749, :c9750, :c9751, :c9752, :c9753, :c9754, :c9755, :c9756, :c9757, :c9758, :c9759, :c9760, :c9761, :c9762, :c9763, :c9764, :c9765, :c9766, :c9767, :c9768, :c9769, :c9770, :c9771, :c9772, :c9773, :c9774, :c9775, :c9776, :c9777, :c9778, :c9779, :c9780, :c9781, :c9782, :c9783, :c9784, :c9785, :c9786, :c9787, :c9788, :c9789, :c9790, :c9791, :c9792, :c9793, :c9794, :c9795, :c9796, :c9797, :c9798, :c9799, :c9800, :c9801, :c9802, :c9803, :c9804, :c9805, :c9806, :c9807, :c9808, :c9809, :c9810, :c9811, :c9812, :c9813, :c9814, :c9815, :c9816, :c9817, :c9818, :c9819, :c9820, :c9821, :c9822, :c9823, :c9824, :c9825, :c9826, :c9827, :c9828, :c9829, :c9830, :c9831, :c9832, :c9833, :c9834, :c9835, :c9836, :c9837, :c9838, :c9839, :c9840, :c9841, :c9842, :c9843, :c9844, :c9845, :c9846, :c9847, :c9848, :c9849, :c9850, :c9851, :c9852, :c9853, :c9854, :c9855, :c9856, :c9857, :c9858, :c9859, :c9860, :c9861, :c9862, :c9863, :c9864, :c9865, :c9866, :c9867, :c9868, :c9869, :c9870, :c9871, :c9872, :c9873, :c9874, :c9875, :c9876, :c9877, :c9878, :c9879, :c9880, :c9881, :c9882, :c9883, :c9884, :c9885, :c9886, :c9887, :c9888, :c9889, :c9890, :c9891, :c9892, :c9893, :c9894, :c9895, :c9896, :c9897, :c9898, :c9899, :c9900, :c9901, :c9902, :c9903, :c9904, :c9905, :c9906, :c9907, :c9908, :c9909, :c9910, :c9911, :c9912, :c9913, :c9914, :c9915, :c9916, :c9917, :c9918, :c9919, :c9920, :c9921, :c9922, :c9923, :c9924, :c9925, :c9926, :c9927, :c9928, :c9929, :c9930, :c9931, :c9932, :c9933, :c9934, :c9935, :c9936, :c9937, :c9938, :c9939, :c9940, :c9941, :c9942, :c9943, :c9944, :c9945, :c9946, :c9947, :c9948, :c9949, :c9950, :c9951, :c9952, :c9953, :c9954, :c9955, :c9956, :c9957, :c9958, :c9959, :c9960, :c9961, :c9962, :c9963, :c9964, :c9965, :c9966, :c9967, :c9968, :c9969, :c9970, :c9971, :c9972, :c9973, :c9974, :c9975, :c9976, :c9977, :c9978, :c9979, :c9980, :c9981, :c9982, :c9983, :c9984, :c9985, :c9986, :c9987, :c9988, :c9989, :c9990, :c9991, :c9992, :c9993, :c9994, :c9995, :c9996, :c9997, :c9998, :c9999, :c10000 . diff --git a/tests/turtle/test-16.out b/tests/turtle/test-16.out new file mode 100644 index 0000000..c0604b3 --- /dev/null +++ b/tests/turtle/test-16.out @@ -0,0 +1,10000 @@ + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . + . diff --git a/tests/turtle/test-16.ttl b/tests/turtle/test-16.ttl new file mode 100644 index 0000000..a9ac37f --- /dev/null +++ b/tests/turtle/test-16.ttl @@ -0,0 +1,10002 @@ +# 10000 items (10000 triples) more than the default Bison stack size +@prefix : . +:a :b :c1; + :b :c2; + :b :c3; + :b :c4; + :b :c5; + :b :c6; + :b :c7; + :b :c8; + :b :c9; + :b :c10; + :b :c11; + :b :c12; + :b :c13; + :b :c14; + :b :c15; + :b :c16; + :b :c17; + :b :c18; + :b :c19; + :b :c20; + :b :c21; + :b :c22; + :b :c23; + :b :c24; + :b :c25; + :b :c26; + :b :c27; + :b :c28; + :b :c29; + :b :c30; + :b :c31; + :b :c32; + :b :c33; + :b :c34; + :b :c35; + :b :c36; + :b :c37; + :b :c38; + :b :c39; + :b :c40; + :b :c41; + :b :c42; + :b :c43; + :b :c44; + :b :c45; + :b :c46; + :b :c47; + :b :c48; + :b :c49; + :b :c50; + :b :c51; + :b :c52; + :b :c53; + :b :c54; + :b :c55; + :b :c56; + :b :c57; + :b :c58; + :b :c59; + :b :c60; + :b :c61; + :b :c62; + :b :c63; + :b :c64; + :b :c65; + :b :c66; + :b :c67; + :b :c68; + :b :c69; + :b :c70; + :b :c71; + :b :c72; + :b :c73; + :b :c74; + :b :c75; + :b :c76; + :b :c77; + :b :c78; + :b :c79; + :b :c80; + :b :c81; + :b :c82; + :b :c83; + :b :c84; + :b :c85; + :b :c86; + :b :c87; + :b :c88; + :b :c89; + :b :c90; + :b :c91; + :b :c92; + :b :c93; + :b :c94; + :b :c95; + :b :c96; + :b :c97; + :b :c98; + :b :c99; + :b :c100; + :b :c101; + :b :c102; + :b :c103; + :b :c104; + :b :c105; + :b :c106; + :b :c107; + :b :c108; + :b :c109; + :b :c110; + :b :c111; + :b :c112; + :b :c113; + :b :c114; + :b :c115; + :b :c116; + :b :c117; + :b :c118; + :b :c119; + :b :c120; + :b :c121; + :b :c122; + :b :c123; + :b :c124; + :b :c125; + :b :c126; + :b :c127; + :b :c128; + :b :c129; + :b :c130; + :b :c131; + :b :c132; + :b :c133; + :b :c134; + :b :c135; + :b :c136; + :b :c137; + :b :c138; + :b :c139; + :b :c140; + :b :c141; + :b :c142; + :b :c143; + :b :c144; + :b :c145; + :b :c146; + :b :c147; + :b :c148; + :b :c149; + :b :c150; + :b :c151; + :b :c152; + :b :c153; + :b :c154; + :b :c155; + :b :c156; + :b :c157; + :b :c158; + :b :c159; + :b :c160; + :b :c161; + :b :c162; + :b :c163; + :b :c164; + :b :c165; + :b :c166; + :b :c167; + :b :c168; + :b :c169; + :b :c170; + :b :c171; + :b :c172; + :b :c173; + :b :c174; + :b :c175; + :b :c176; + :b :c177; + :b :c178; + :b :c179; + :b :c180; + :b :c181; + :b :c182; + :b :c183; + :b :c184; + :b :c185; + :b :c186; + :b :c187; + :b :c188; + :b :c189; + :b :c190; + :b :c191; + :b :c192; + :b :c193; + :b :c194; + :b :c195; + :b :c196; + :b :c197; + :b :c198; + :b :c199; + :b :c200; + :b :c201; + :b :c202; + :b :c203; + :b :c204; + :b :c205; + :b :c206; + :b :c207; + :b :c208; + :b :c209; + :b :c210; + :b :c211; + :b :c212; + :b :c213; + :b :c214; + :b :c215; + :b :c216; + :b :c217; + :b :c218; + :b :c219; + :b :c220; + :b :c221; + :b :c222; + :b :c223; + :b :c224; + :b :c225; + :b :c226; + :b :c227; + :b :c228; + :b :c229; + :b :c230; + :b :c231; + :b :c232; + :b :c233; + :b :c234; + :b :c235; + :b :c236; + :b :c237; + :b :c238; + :b :c239; + :b :c240; + :b :c241; + :b :c242; + :b :c243; + :b :c244; + :b :c245; + :b :c246; + :b :c247; + :b :c248; + :b :c249; + :b :c250; + :b :c251; + :b :c252; + :b :c253; + :b :c254; + :b :c255; + :b :c256; + :b :c257; + :b :c258; + :b :c259; + :b :c260; + :b :c261; + :b :c262; + :b :c263; + :b :c264; + :b :c265; + :b :c266; + :b :c267; + :b :c268; + :b :c269; + :b :c270; + :b :c271; + :b :c272; + :b :c273; + :b :c274; + :b :c275; + :b :c276; + :b :c277; + :b :c278; + :b :c279; + :b :c280; + :b :c281; + :b :c282; + :b :c283; + :b :c284; + :b :c285; + :b :c286; + :b :c287; + :b :c288; + :b :c289; + :b :c290; + :b :c291; + :b :c292; + :b :c293; + :b :c294; + :b :c295; + :b :c296; + :b :c297; + :b :c298; + :b :c299; + :b :c300; + :b :c301; + :b :c302; + :b :c303; + :b :c304; + :b :c305; + :b :c306; + :b :c307; + :b :c308; + :b :c309; + :b :c310; + :b :c311; + :b :c312; + :b :c313; + :b :c314; + :b :c315; + :b :c316; + :b :c317; + :b :c318; + :b :c319; + :b :c320; + :b :c321; + :b :c322; + :b :c323; + :b :c324; + :b :c325; + :b :c326; + :b :c327; + :b :c328; + :b :c329; + :b :c330; + :b :c331; + :b :c332; + :b :c333; + :b :c334; + :b :c335; + :b :c336; + :b :c337; + :b :c338; + :b :c339; + :b :c340; + :b :c341; + :b :c342; + :b :c343; + :b :c344; + :b :c345; + :b :c346; + :b :c347; + :b :c348; + :b :c349; + :b :c350; + :b :c351; + :b :c352; + :b :c353; + :b :c354; + :b :c355; + :b :c356; + :b :c357; + :b :c358; + :b :c359; + :b :c360; + :b :c361; + :b :c362; + :b :c363; + :b :c364; + :b :c365; + :b :c366; + :b :c367; + :b :c368; + :b :c369; + :b :c370; + :b :c371; + :b :c372; + :b :c373; + :b :c374; + :b :c375; + :b :c376; + :b :c377; + :b :c378; + :b :c379; + :b :c380; + :b :c381; + :b :c382; + :b :c383; + :b :c384; + :b :c385; + :b :c386; + :b :c387; + :b :c388; + :b :c389; + :b :c390; + :b :c391; + :b :c392; + :b :c393; + :b :c394; + :b :c395; + :b :c396; + :b :c397; + :b :c398; + :b :c399; + :b :c400; + :b :c401; + :b :c402; + :b :c403; + :b :c404; + :b :c405; + :b :c406; + :b :c407; + :b :c408; + :b :c409; + :b :c410; + :b :c411; + :b :c412; + :b :c413; + :b :c414; + :b :c415; + :b :c416; + :b :c417; + :b :c418; + :b :c419; + :b :c420; + :b :c421; + :b :c422; + :b :c423; + :b :c424; + :b :c425; + :b :c426; + :b :c427; + :b :c428; + :b :c429; + :b :c430; + :b :c431; + :b :c432; + :b :c433; + :b :c434; + :b :c435; + :b :c436; + :b :c437; + :b :c438; + :b :c439; + :b :c440; + :b :c441; + :b :c442; + :b :c443; + :b :c444; + :b :c445; + :b :c446; + :b :c447; + :b :c448; + :b :c449; + :b :c450; + :b :c451; + :b :c452; + :b :c453; + :b :c454; + :b :c455; + :b :c456; + :b :c457; + :b :c458; + :b :c459; + :b :c460; + :b :c461; + :b :c462; + :b :c463; + :b :c464; + :b :c465; + :b :c466; + :b :c467; + :b :c468; + :b :c469; + :b :c470; + :b :c471; + :b :c472; + :b :c473; + :b :c474; + :b :c475; + :b :c476; + :b :c477; + :b :c478; + :b :c479; + :b :c480; + :b :c481; + :b :c482; + :b :c483; + :b :c484; + :b :c485; + :b :c486; + :b :c487; + :b :c488; + :b :c489; + :b :c490; + :b :c491; + :b :c492; + :b :c493; + :b :c494; + :b :c495; + :b :c496; + :b :c497; + :b :c498; + :b :c499; + :b :c500; + :b :c501; + :b :c502; + :b :c503; + :b :c504; + :b :c505; + :b :c506; + :b :c507; + :b :c508; + :b :c509; + :b :c510; + :b :c511; + :b :c512; + :b :c513; + :b :c514; + :b :c515; + :b :c516; + :b :c517; + :b :c518; + :b :c519; + :b :c520; + :b :c521; + :b :c522; + :b :c523; + :b :c524; + :b :c525; + :b :c526; + :b :c527; + :b :c528; + :b :c529; + :b :c530; + :b :c531; + :b :c532; + :b :c533; + :b :c534; + :b :c535; + :b :c536; + :b :c537; + :b :c538; + :b :c539; + :b :c540; + :b :c541; + :b :c542; + :b :c543; + :b :c544; + :b :c545; + :b :c546; + :b :c547; + :b :c548; + :b :c549; + :b :c550; + :b :c551; + :b :c552; + :b :c553; + :b :c554; + :b :c555; + :b :c556; + :b :c557; + :b :c558; + :b :c559; + :b :c560; + :b :c561; + :b :c562; + :b :c563; + :b :c564; + :b :c565; + :b :c566; + :b :c567; + :b :c568; + :b :c569; + :b :c570; + :b :c571; + :b :c572; + :b :c573; + :b :c574; + :b :c575; + :b :c576; + :b :c577; + :b :c578; + :b :c579; + :b :c580; + :b :c581; + :b :c582; + :b :c583; + :b :c584; + :b :c585; + :b :c586; + :b :c587; + :b :c588; + :b :c589; + :b :c590; + :b :c591; + :b :c592; + :b :c593; + :b :c594; + :b :c595; + :b :c596; + :b :c597; + :b :c598; + :b :c599; + :b :c600; + :b :c601; + :b :c602; + :b :c603; + :b :c604; + :b :c605; + :b :c606; + :b :c607; + :b :c608; + :b :c609; + :b :c610; + :b :c611; + :b :c612; + :b :c613; + :b :c614; + :b :c615; + :b :c616; + :b :c617; + :b :c618; + :b :c619; + :b :c620; + :b :c621; + :b :c622; + :b :c623; + :b :c624; + :b :c625; + :b :c626; + :b :c627; + :b :c628; + :b :c629; + :b :c630; + :b :c631; + :b :c632; + :b :c633; + :b :c634; + :b :c635; + :b :c636; + :b :c637; + :b :c638; + :b :c639; + :b :c640; + :b :c641; + :b :c642; + :b :c643; + :b :c644; + :b :c645; + :b :c646; + :b :c647; + :b :c648; + :b :c649; + :b :c650; + :b :c651; + :b :c652; + :b :c653; + :b :c654; + :b :c655; + :b :c656; + :b :c657; + :b :c658; + :b :c659; + :b :c660; + :b :c661; + :b :c662; + :b :c663; + :b :c664; + :b :c665; + :b :c666; + :b :c667; + :b :c668; + :b :c669; + :b :c670; + :b :c671; + :b :c672; + :b :c673; + :b :c674; + :b :c675; + :b :c676; + :b :c677; + :b :c678; + :b :c679; + :b :c680; + :b :c681; + :b :c682; + :b :c683; + :b :c684; + :b :c685; + :b :c686; + :b :c687; + :b :c688; + :b :c689; + :b :c690; + :b :c691; + :b :c692; + :b :c693; + :b :c694; + :b :c695; + :b :c696; + :b :c697; + :b :c698; + :b :c699; + :b :c700; + :b :c701; + :b :c702; + :b :c703; + :b :c704; + :b :c705; + :b :c706; + :b :c707; + :b :c708; + :b :c709; + :b :c710; + :b :c711; + :b :c712; + :b :c713; + :b :c714; + :b :c715; + :b :c716; + :b :c717; + :b :c718; + :b :c719; + :b :c720; + :b :c721; + :b :c722; + :b :c723; + :b :c724; + :b :c725; + :b :c726; + :b :c727; + :b :c728; + :b :c729; + :b :c730; + :b :c731; + :b :c732; + :b :c733; + :b :c734; + :b :c735; + :b :c736; + :b :c737; + :b :c738; + :b :c739; + :b :c740; + :b :c741; + :b :c742; + :b :c743; + :b :c744; + :b :c745; + :b :c746; + :b :c747; + :b :c748; + :b :c749; + :b :c750; + :b :c751; + :b :c752; + :b :c753; + :b :c754; + :b :c755; + :b :c756; + :b :c757; + :b :c758; + :b :c759; + :b :c760; + :b :c761; + :b :c762; + :b :c763; + :b :c764; + :b :c765; + :b :c766; + :b :c767; + :b :c768; + :b :c769; + :b :c770; + :b :c771; + :b :c772; + :b :c773; + :b :c774; + :b :c775; + :b :c776; + :b :c777; + :b :c778; + :b :c779; + :b :c780; + :b :c781; + :b :c782; + :b :c783; + :b :c784; + :b :c785; + :b :c786; + :b :c787; + :b :c788; + :b :c789; + :b :c790; + :b :c791; + :b :c792; + :b :c793; + :b :c794; + :b :c795; + :b :c796; + :b :c797; + :b :c798; + :b :c799; + :b :c800; + :b :c801; + :b :c802; + :b :c803; + :b :c804; + :b :c805; + :b :c806; + :b :c807; + :b :c808; + :b :c809; + :b :c810; + :b :c811; + :b :c812; + :b :c813; + :b :c814; + :b :c815; + :b :c816; + :b :c817; + :b :c818; + :b :c819; + :b :c820; + :b :c821; + :b :c822; + :b :c823; + :b :c824; + :b :c825; + :b :c826; + :b :c827; + :b :c828; + :b :c829; + :b :c830; + :b :c831; + :b :c832; + :b :c833; + :b :c834; + :b :c835; + :b :c836; + :b :c837; + :b :c838; + :b :c839; + :b :c840; + :b :c841; + :b :c842; + :b :c843; + :b :c844; + :b :c845; + :b :c846; + :b :c847; + :b :c848; + :b :c849; + :b :c850; + :b :c851; + :b :c852; + :b :c853; + :b :c854; + :b :c855; + :b :c856; + :b :c857; + :b :c858; + :b :c859; + :b :c860; + :b :c861; + :b :c862; + :b :c863; + :b :c864; + :b :c865; + :b :c866; + :b :c867; + :b :c868; + :b :c869; + :b :c870; + :b :c871; + :b :c872; + :b :c873; + :b :c874; + :b :c875; + :b :c876; + :b :c877; + :b :c878; + :b :c879; + :b :c880; + :b :c881; + :b :c882; + :b :c883; + :b :c884; + :b :c885; + :b :c886; + :b :c887; + :b :c888; + :b :c889; + :b :c890; + :b :c891; + :b :c892; + :b :c893; + :b :c894; + :b :c895; + :b :c896; + :b :c897; + :b :c898; + :b :c899; + :b :c900; + :b :c901; + :b :c902; + :b :c903; + :b :c904; + :b :c905; + :b :c906; + :b :c907; + :b :c908; + :b :c909; + :b :c910; + :b :c911; + :b :c912; + :b :c913; + :b :c914; + :b :c915; + :b :c916; + :b :c917; + :b :c918; + :b :c919; + :b :c920; + :b :c921; + :b :c922; + :b :c923; + :b :c924; + :b :c925; + :b :c926; + :b :c927; + :b :c928; + :b :c929; + :b :c930; + :b :c931; + :b :c932; + :b :c933; + :b :c934; + :b :c935; + :b :c936; + :b :c937; + :b :c938; + :b :c939; + :b :c940; + :b :c941; + :b :c942; + :b :c943; + :b :c944; + :b :c945; + :b :c946; + :b :c947; + :b :c948; + :b :c949; + :b :c950; + :b :c951; + :b :c952; + :b :c953; + :b :c954; + :b :c955; + :b :c956; + :b :c957; + :b :c958; + :b :c959; + :b :c960; + :b :c961; + :b :c962; + :b :c963; + :b :c964; + :b :c965; + :b :c966; + :b :c967; + :b :c968; + :b :c969; + :b :c970; + :b :c971; + :b :c972; + :b :c973; + :b :c974; + :b :c975; + :b :c976; + :b :c977; + :b :c978; + :b :c979; + :b :c980; + :b :c981; + :b :c982; + :b :c983; + :b :c984; + :b :c985; + :b :c986; + :b :c987; + :b :c988; + :b :c989; + :b :c990; + :b :c991; + :b :c992; + :b :c993; + :b :c994; + :b :c995; + :b :c996; + :b :c997; + :b :c998; + :b :c999; + :b :c1000; + :b :c1001; + :b :c1002; + :b :c1003; + :b :c1004; + :b :c1005; + :b :c1006; + :b :c1007; + :b :c1008; + :b :c1009; + :b :c1010; + :b :c1011; + :b :c1012; + :b :c1013; + :b :c1014; + :b :c1015; + :b :c1016; + :b :c1017; + :b :c1018; + :b :c1019; + :b :c1020; + :b :c1021; + :b :c1022; + :b :c1023; + :b :c1024; + :b :c1025; + :b :c1026; + :b :c1027; + :b :c1028; + :b :c1029; + :b :c1030; + :b :c1031; + :b :c1032; + :b :c1033; + :b :c1034; + :b :c1035; + :b :c1036; + :b :c1037; + :b :c1038; + :b :c1039; + :b :c1040; + :b :c1041; + :b :c1042; + :b :c1043; + :b :c1044; + :b :c1045; + :b :c1046; + :b :c1047; + :b :c1048; + :b :c1049; + :b :c1050; + :b :c1051; + :b :c1052; + :b :c1053; + :b :c1054; + :b :c1055; + :b :c1056; + :b :c1057; + :b :c1058; + :b :c1059; + :b :c1060; + :b :c1061; + :b :c1062; + :b :c1063; + :b :c1064; + :b :c1065; + :b :c1066; + :b :c1067; + :b :c1068; + :b :c1069; + :b :c1070; + :b :c1071; + :b :c1072; + :b :c1073; + :b :c1074; + :b :c1075; + :b :c1076; + :b :c1077; + :b :c1078; + :b :c1079; + :b :c1080; + :b :c1081; + :b :c1082; + :b :c1083; + :b :c1084; + :b :c1085; + :b :c1086; + :b :c1087; + :b :c1088; + :b :c1089; + :b :c1090; + :b :c1091; + :b :c1092; + :b :c1093; + :b :c1094; + :b :c1095; + :b :c1096; + :b :c1097; + :b :c1098; + :b :c1099; + :b :c1100; + :b :c1101; + :b :c1102; + :b :c1103; + :b :c1104; + :b :c1105; + :b :c1106; + :b :c1107; + :b :c1108; + :b :c1109; + :b :c1110; + :b :c1111; + :b :c1112; + :b :c1113; + :b :c1114; + :b :c1115; + :b :c1116; + :b :c1117; + :b :c1118; + :b :c1119; + :b :c1120; + :b :c1121; + :b :c1122; + :b :c1123; + :b :c1124; + :b :c1125; + :b :c1126; + :b :c1127; + :b :c1128; + :b :c1129; + :b :c1130; + :b :c1131; + :b :c1132; + :b :c1133; + :b :c1134; + :b :c1135; + :b :c1136; + :b :c1137; + :b :c1138; + :b :c1139; + :b :c1140; + :b :c1141; + :b :c1142; + :b :c1143; + :b :c1144; + :b :c1145; + :b :c1146; + :b :c1147; + :b :c1148; + :b :c1149; + :b :c1150; + :b :c1151; + :b :c1152; + :b :c1153; + :b :c1154; + :b :c1155; + :b :c1156; + :b :c1157; + :b :c1158; + :b :c1159; + :b :c1160; + :b :c1161; + :b :c1162; + :b :c1163; + :b :c1164; + :b :c1165; + :b :c1166; + :b :c1167; + :b :c1168; + :b :c1169; + :b :c1170; + :b :c1171; + :b :c1172; + :b :c1173; + :b :c1174; + :b :c1175; + :b :c1176; + :b :c1177; + :b :c1178; + :b :c1179; + :b :c1180; + :b :c1181; + :b :c1182; + :b :c1183; + :b :c1184; + :b :c1185; + :b :c1186; + :b :c1187; + :b :c1188; + :b :c1189; + :b :c1190; + :b :c1191; + :b :c1192; + :b :c1193; + :b :c1194; + :b :c1195; + :b :c1196; + :b :c1197; + :b :c1198; + :b :c1199; + :b :c1200; + :b :c1201; + :b :c1202; + :b :c1203; + :b :c1204; + :b :c1205; + :b :c1206; + :b :c1207; + :b :c1208; + :b :c1209; + :b :c1210; + :b :c1211; + :b :c1212; + :b :c1213; + :b :c1214; + :b :c1215; + :b :c1216; + :b :c1217; + :b :c1218; + :b :c1219; + :b :c1220; + :b :c1221; + :b :c1222; + :b :c1223; + :b :c1224; + :b :c1225; + :b :c1226; + :b :c1227; + :b :c1228; + :b :c1229; + :b :c1230; + :b :c1231; + :b :c1232; + :b :c1233; + :b :c1234; + :b :c1235; + :b :c1236; + :b :c1237; + :b :c1238; + :b :c1239; + :b :c1240; + :b :c1241; + :b :c1242; + :b :c1243; + :b :c1244; + :b :c1245; + :b :c1246; + :b :c1247; + :b :c1248; + :b :c1249; + :b :c1250; + :b :c1251; + :b :c1252; + :b :c1253; + :b :c1254; + :b :c1255; + :b :c1256; + :b :c1257; + :b :c1258; + :b :c1259; + :b :c1260; + :b :c1261; + :b :c1262; + :b :c1263; + :b :c1264; + :b :c1265; + :b :c1266; + :b :c1267; + :b :c1268; + :b :c1269; + :b :c1270; + :b :c1271; + :b :c1272; + :b :c1273; + :b :c1274; + :b :c1275; + :b :c1276; + :b :c1277; + :b :c1278; + :b :c1279; + :b :c1280; + :b :c1281; + :b :c1282; + :b :c1283; + :b :c1284; + :b :c1285; + :b :c1286; + :b :c1287; + :b :c1288; + :b :c1289; + :b :c1290; + :b :c1291; + :b :c1292; + :b :c1293; + :b :c1294; + :b :c1295; + :b :c1296; + :b :c1297; + :b :c1298; + :b :c1299; + :b :c1300; + :b :c1301; + :b :c1302; + :b :c1303; + :b :c1304; + :b :c1305; + :b :c1306; + :b :c1307; + :b :c1308; + :b :c1309; + :b :c1310; + :b :c1311; + :b :c1312; + :b :c1313; + :b :c1314; + :b :c1315; + :b :c1316; + :b :c1317; + :b :c1318; + :b :c1319; + :b :c1320; + :b :c1321; + :b :c1322; + :b :c1323; + :b :c1324; + :b :c1325; + :b :c1326; + :b :c1327; + :b :c1328; + :b :c1329; + :b :c1330; + :b :c1331; + :b :c1332; + :b :c1333; + :b :c1334; + :b :c1335; + :b :c1336; + :b :c1337; + :b :c1338; + :b :c1339; + :b :c1340; + :b :c1341; + :b :c1342; + :b :c1343; + :b :c1344; + :b :c1345; + :b :c1346; + :b :c1347; + :b :c1348; + :b :c1349; + :b :c1350; + :b :c1351; + :b :c1352; + :b :c1353; + :b :c1354; + :b :c1355; + :b :c1356; + :b :c1357; + :b :c1358; + :b :c1359; + :b :c1360; + :b :c1361; + :b :c1362; + :b :c1363; + :b :c1364; + :b :c1365; + :b :c1366; + :b :c1367; + :b :c1368; + :b :c1369; + :b :c1370; + :b :c1371; + :b :c1372; + :b :c1373; + :b :c1374; + :b :c1375; + :b :c1376; + :b :c1377; + :b :c1378; + :b :c1379; + :b :c1380; + :b :c1381; + :b :c1382; + :b :c1383; + :b :c1384; + :b :c1385; + :b :c1386; + :b :c1387; + :b :c1388; + :b :c1389; + :b :c1390; + :b :c1391; + :b :c1392; + :b :c1393; + :b :c1394; + :b :c1395; + :b :c1396; + :b :c1397; + :b :c1398; + :b :c1399; + :b :c1400; + :b :c1401; + :b :c1402; + :b :c1403; + :b :c1404; + :b :c1405; + :b :c1406; + :b :c1407; + :b :c1408; + :b :c1409; + :b :c1410; + :b :c1411; + :b :c1412; + :b :c1413; + :b :c1414; + :b :c1415; + :b :c1416; + :b :c1417; + :b :c1418; + :b :c1419; + :b :c1420; + :b :c1421; + :b :c1422; + :b :c1423; + :b :c1424; + :b :c1425; + :b :c1426; + :b :c1427; + :b :c1428; + :b :c1429; + :b :c1430; + :b :c1431; + :b :c1432; + :b :c1433; + :b :c1434; + :b :c1435; + :b :c1436; + :b :c1437; + :b :c1438; + :b :c1439; + :b :c1440; + :b :c1441; + :b :c1442; + :b :c1443; + :b :c1444; + :b :c1445; + :b :c1446; + :b :c1447; + :b :c1448; + :b :c1449; + :b :c1450; + :b :c1451; + :b :c1452; + :b :c1453; + :b :c1454; + :b :c1455; + :b :c1456; + :b :c1457; + :b :c1458; + :b :c1459; + :b :c1460; + :b :c1461; + :b :c1462; + :b :c1463; + :b :c1464; + :b :c1465; + :b :c1466; + :b :c1467; + :b :c1468; + :b :c1469; + :b :c1470; + :b :c1471; + :b :c1472; + :b :c1473; + :b :c1474; + :b :c1475; + :b :c1476; + :b :c1477; + :b :c1478; + :b :c1479; + :b :c1480; + :b :c1481; + :b :c1482; + :b :c1483; + :b :c1484; + :b :c1485; + :b :c1486; + :b :c1487; + :b :c1488; + :b :c1489; + :b :c1490; + :b :c1491; + :b :c1492; + :b :c1493; + :b :c1494; + :b :c1495; + :b :c1496; + :b :c1497; + :b :c1498; + :b :c1499; + :b :c1500; + :b :c1501; + :b :c1502; + :b :c1503; + :b :c1504; + :b :c1505; + :b :c1506; + :b :c1507; + :b :c1508; + :b :c1509; + :b :c1510; + :b :c1511; + :b :c1512; + :b :c1513; + :b :c1514; + :b :c1515; + :b :c1516; + :b :c1517; + :b :c1518; + :b :c1519; + :b :c1520; + :b :c1521; + :b :c1522; + :b :c1523; + :b :c1524; + :b :c1525; + :b :c1526; + :b :c1527; + :b :c1528; + :b :c1529; + :b :c1530; + :b :c1531; + :b :c1532; + :b :c1533; + :b :c1534; + :b :c1535; + :b :c1536; + :b :c1537; + :b :c1538; + :b :c1539; + :b :c1540; + :b :c1541; + :b :c1542; + :b :c1543; + :b :c1544; + :b :c1545; + :b :c1546; + :b :c1547; + :b :c1548; + :b :c1549; + :b :c1550; + :b :c1551; + :b :c1552; + :b :c1553; + :b :c1554; + :b :c1555; + :b :c1556; + :b :c1557; + :b :c1558; + :b :c1559; + :b :c1560; + :b :c1561; + :b :c1562; + :b :c1563; + :b :c1564; + :b :c1565; + :b :c1566; + :b :c1567; + :b :c1568; + :b :c1569; + :b :c1570; + :b :c1571; + :b :c1572; + :b :c1573; + :b :c1574; + :b :c1575; + :b :c1576; + :b :c1577; + :b :c1578; + :b :c1579; + :b :c1580; + :b :c1581; + :b :c1582; + :b :c1583; + :b :c1584; + :b :c1585; + :b :c1586; + :b :c1587; + :b :c1588; + :b :c1589; + :b :c1590; + :b :c1591; + :b :c1592; + :b :c1593; + :b :c1594; + :b :c1595; + :b :c1596; + :b :c1597; + :b :c1598; + :b :c1599; + :b :c1600; + :b :c1601; + :b :c1602; + :b :c1603; + :b :c1604; + :b :c1605; + :b :c1606; + :b :c1607; + :b :c1608; + :b :c1609; + :b :c1610; + :b :c1611; + :b :c1612; + :b :c1613; + :b :c1614; + :b :c1615; + :b :c1616; + :b :c1617; + :b :c1618; + :b :c1619; + :b :c1620; + :b :c1621; + :b :c1622; + :b :c1623; + :b :c1624; + :b :c1625; + :b :c1626; + :b :c1627; + :b :c1628; + :b :c1629; + :b :c1630; + :b :c1631; + :b :c1632; + :b :c1633; + :b :c1634; + :b :c1635; + :b :c1636; + :b :c1637; + :b :c1638; + :b :c1639; + :b :c1640; + :b :c1641; + :b :c1642; + :b :c1643; + :b :c1644; + :b :c1645; + :b :c1646; + :b :c1647; + :b :c1648; + :b :c1649; + :b :c1650; + :b :c1651; + :b :c1652; + :b :c1653; + :b :c1654; + :b :c1655; + :b :c1656; + :b :c1657; + :b :c1658; + :b :c1659; + :b :c1660; + :b :c1661; + :b :c1662; + :b :c1663; + :b :c1664; + :b :c1665; + :b :c1666; + :b :c1667; + :b :c1668; + :b :c1669; + :b :c1670; + :b :c1671; + :b :c1672; + :b :c1673; + :b :c1674; + :b :c1675; + :b :c1676; + :b :c1677; + :b :c1678; + :b :c1679; + :b :c1680; + :b :c1681; + :b :c1682; + :b :c1683; + :b :c1684; + :b :c1685; + :b :c1686; + :b :c1687; + :b :c1688; + :b :c1689; + :b :c1690; + :b :c1691; + :b :c1692; + :b :c1693; + :b :c1694; + :b :c1695; + :b :c1696; + :b :c1697; + :b :c1698; + :b :c1699; + :b :c1700; + :b :c1701; + :b :c1702; + :b :c1703; + :b :c1704; + :b :c1705; + :b :c1706; + :b :c1707; + :b :c1708; + :b :c1709; + :b :c1710; + :b :c1711; + :b :c1712; + :b :c1713; + :b :c1714; + :b :c1715; + :b :c1716; + :b :c1717; + :b :c1718; + :b :c1719; + :b :c1720; + :b :c1721; + :b :c1722; + :b :c1723; + :b :c1724; + :b :c1725; + :b :c1726; + :b :c1727; + :b :c1728; + :b :c1729; + :b :c1730; + :b :c1731; + :b :c1732; + :b :c1733; + :b :c1734; + :b :c1735; + :b :c1736; + :b :c1737; + :b :c1738; + :b :c1739; + :b :c1740; + :b :c1741; + :b :c1742; + :b :c1743; + :b :c1744; + :b :c1745; + :b :c1746; + :b :c1747; + :b :c1748; + :b :c1749; + :b :c1750; + :b :c1751; + :b :c1752; + :b :c1753; + :b :c1754; + :b :c1755; + :b :c1756; + :b :c1757; + :b :c1758; + :b :c1759; + :b :c1760; + :b :c1761; + :b :c1762; + :b :c1763; + :b :c1764; + :b :c1765; + :b :c1766; + :b :c1767; + :b :c1768; + :b :c1769; + :b :c1770; + :b :c1771; + :b :c1772; + :b :c1773; + :b :c1774; + :b :c1775; + :b :c1776; + :b :c1777; + :b :c1778; + :b :c1779; + :b :c1780; + :b :c1781; + :b :c1782; + :b :c1783; + :b :c1784; + :b :c1785; + :b :c1786; + :b :c1787; + :b :c1788; + :b :c1789; + :b :c1790; + :b :c1791; + :b :c1792; + :b :c1793; + :b :c1794; + :b :c1795; + :b :c1796; + :b :c1797; + :b :c1798; + :b :c1799; + :b :c1800; + :b :c1801; + :b :c1802; + :b :c1803; + :b :c1804; + :b :c1805; + :b :c1806; + :b :c1807; + :b :c1808; + :b :c1809; + :b :c1810; + :b :c1811; + :b :c1812; + :b :c1813; + :b :c1814; + :b :c1815; + :b :c1816; + :b :c1817; + :b :c1818; + :b :c1819; + :b :c1820; + :b :c1821; + :b :c1822; + :b :c1823; + :b :c1824; + :b :c1825; + :b :c1826; + :b :c1827; + :b :c1828; + :b :c1829; + :b :c1830; + :b :c1831; + :b :c1832; + :b :c1833; + :b :c1834; + :b :c1835; + :b :c1836; + :b :c1837; + :b :c1838; + :b :c1839; + :b :c1840; + :b :c1841; + :b :c1842; + :b :c1843; + :b :c1844; + :b :c1845; + :b :c1846; + :b :c1847; + :b :c1848; + :b :c1849; + :b :c1850; + :b :c1851; + :b :c1852; + :b :c1853; + :b :c1854; + :b :c1855; + :b :c1856; + :b :c1857; + :b :c1858; + :b :c1859; + :b :c1860; + :b :c1861; + :b :c1862; + :b :c1863; + :b :c1864; + :b :c1865; + :b :c1866; + :b :c1867; + :b :c1868; + :b :c1869; + :b :c1870; + :b :c1871; + :b :c1872; + :b :c1873; + :b :c1874; + :b :c1875; + :b :c1876; + :b :c1877; + :b :c1878; + :b :c1879; + :b :c1880; + :b :c1881; + :b :c1882; + :b :c1883; + :b :c1884; + :b :c1885; + :b :c1886; + :b :c1887; + :b :c1888; + :b :c1889; + :b :c1890; + :b :c1891; + :b :c1892; + :b :c1893; + :b :c1894; + :b :c1895; + :b :c1896; + :b :c1897; + :b :c1898; + :b :c1899; + :b :c1900; + :b :c1901; + :b :c1902; + :b :c1903; + :b :c1904; + :b :c1905; + :b :c1906; + :b :c1907; + :b :c1908; + :b :c1909; + :b :c1910; + :b :c1911; + :b :c1912; + :b :c1913; + :b :c1914; + :b :c1915; + :b :c1916; + :b :c1917; + :b :c1918; + :b :c1919; + :b :c1920; + :b :c1921; + :b :c1922; + :b :c1923; + :b :c1924; + :b :c1925; + :b :c1926; + :b :c1927; + :b :c1928; + :b :c1929; + :b :c1930; + :b :c1931; + :b :c1932; + :b :c1933; + :b :c1934; + :b :c1935; + :b :c1936; + :b :c1937; + :b :c1938; + :b :c1939; + :b :c1940; + :b :c1941; + :b :c1942; + :b :c1943; + :b :c1944; + :b :c1945; + :b :c1946; + :b :c1947; + :b :c1948; + :b :c1949; + :b :c1950; + :b :c1951; + :b :c1952; + :b :c1953; + :b :c1954; + :b :c1955; + :b :c1956; + :b :c1957; + :b :c1958; + :b :c1959; + :b :c1960; + :b :c1961; + :b :c1962; + :b :c1963; + :b :c1964; + :b :c1965; + :b :c1966; + :b :c1967; + :b :c1968; + :b :c1969; + :b :c1970; + :b :c1971; + :b :c1972; + :b :c1973; + :b :c1974; + :b :c1975; + :b :c1976; + :b :c1977; + :b :c1978; + :b :c1979; + :b :c1980; + :b :c1981; + :b :c1982; + :b :c1983; + :b :c1984; + :b :c1985; + :b :c1986; + :b :c1987; + :b :c1988; + :b :c1989; + :b :c1990; + :b :c1991; + :b :c1992; + :b :c1993; + :b :c1994; + :b :c1995; + :b :c1996; + :b :c1997; + :b :c1998; + :b :c1999; + :b :c2000; + :b :c2001; + :b :c2002; + :b :c2003; + :b :c2004; + :b :c2005; + :b :c2006; + :b :c2007; + :b :c2008; + :b :c2009; + :b :c2010; + :b :c2011; + :b :c2012; + :b :c2013; + :b :c2014; + :b :c2015; + :b :c2016; + :b :c2017; + :b :c2018; + :b :c2019; + :b :c2020; + :b :c2021; + :b :c2022; + :b :c2023; + :b :c2024; + :b :c2025; + :b :c2026; + :b :c2027; + :b :c2028; + :b :c2029; + :b :c2030; + :b :c2031; + :b :c2032; + :b :c2033; + :b :c2034; + :b :c2035; + :b :c2036; + :b :c2037; + :b :c2038; + :b :c2039; + :b :c2040; + :b :c2041; + :b :c2042; + :b :c2043; + :b :c2044; + :b :c2045; + :b :c2046; + :b :c2047; + :b :c2048; + :b :c2049; + :b :c2050; + :b :c2051; + :b :c2052; + :b :c2053; + :b :c2054; + :b :c2055; + :b :c2056; + :b :c2057; + :b :c2058; + :b :c2059; + :b :c2060; + :b :c2061; + :b :c2062; + :b :c2063; + :b :c2064; + :b :c2065; + :b :c2066; + :b :c2067; + :b :c2068; + :b :c2069; + :b :c2070; + :b :c2071; + :b :c2072; + :b :c2073; + :b :c2074; + :b :c2075; + :b :c2076; + :b :c2077; + :b :c2078; + :b :c2079; + :b :c2080; + :b :c2081; + :b :c2082; + :b :c2083; + :b :c2084; + :b :c2085; + :b :c2086; + :b :c2087; + :b :c2088; + :b :c2089; + :b :c2090; + :b :c2091; + :b :c2092; + :b :c2093; + :b :c2094; + :b :c2095; + :b :c2096; + :b :c2097; + :b :c2098; + :b :c2099; + :b :c2100; + :b :c2101; + :b :c2102; + :b :c2103; + :b :c2104; + :b :c2105; + :b :c2106; + :b :c2107; + :b :c2108; + :b :c2109; + :b :c2110; + :b :c2111; + :b :c2112; + :b :c2113; + :b :c2114; + :b :c2115; + :b :c2116; + :b :c2117; + :b :c2118; + :b :c2119; + :b :c2120; + :b :c2121; + :b :c2122; + :b :c2123; + :b :c2124; + :b :c2125; + :b :c2126; + :b :c2127; + :b :c2128; + :b :c2129; + :b :c2130; + :b :c2131; + :b :c2132; + :b :c2133; + :b :c2134; + :b :c2135; + :b :c2136; + :b :c2137; + :b :c2138; + :b :c2139; + :b :c2140; + :b :c2141; + :b :c2142; + :b :c2143; + :b :c2144; + :b :c2145; + :b :c2146; + :b :c2147; + :b :c2148; + :b :c2149; + :b :c2150; + :b :c2151; + :b :c2152; + :b :c2153; + :b :c2154; + :b :c2155; + :b :c2156; + :b :c2157; + :b :c2158; + :b :c2159; + :b :c2160; + :b :c2161; + :b :c2162; + :b :c2163; + :b :c2164; + :b :c2165; + :b :c2166; + :b :c2167; + :b :c2168; + :b :c2169; + :b :c2170; + :b :c2171; + :b :c2172; + :b :c2173; + :b :c2174; + :b :c2175; + :b :c2176; + :b :c2177; + :b :c2178; + :b :c2179; + :b :c2180; + :b :c2181; + :b :c2182; + :b :c2183; + :b :c2184; + :b :c2185; + :b :c2186; + :b :c2187; + :b :c2188; + :b :c2189; + :b :c2190; + :b :c2191; + :b :c2192; + :b :c2193; + :b :c2194; + :b :c2195; + :b :c2196; + :b :c2197; + :b :c2198; + :b :c2199; + :b :c2200; + :b :c2201; + :b :c2202; + :b :c2203; + :b :c2204; + :b :c2205; + :b :c2206; + :b :c2207; + :b :c2208; + :b :c2209; + :b :c2210; + :b :c2211; + :b :c2212; + :b :c2213; + :b :c2214; + :b :c2215; + :b :c2216; + :b :c2217; + :b :c2218; + :b :c2219; + :b :c2220; + :b :c2221; + :b :c2222; + :b :c2223; + :b :c2224; + :b :c2225; + :b :c2226; + :b :c2227; + :b :c2228; + :b :c2229; + :b :c2230; + :b :c2231; + :b :c2232; + :b :c2233; + :b :c2234; + :b :c2235; + :b :c2236; + :b :c2237; + :b :c2238; + :b :c2239; + :b :c2240; + :b :c2241; + :b :c2242; + :b :c2243; + :b :c2244; + :b :c2245; + :b :c2246; + :b :c2247; + :b :c2248; + :b :c2249; + :b :c2250; + :b :c2251; + :b :c2252; + :b :c2253; + :b :c2254; + :b :c2255; + :b :c2256; + :b :c2257; + :b :c2258; + :b :c2259; + :b :c2260; + :b :c2261; + :b :c2262; + :b :c2263; + :b :c2264; + :b :c2265; + :b :c2266; + :b :c2267; + :b :c2268; + :b :c2269; + :b :c2270; + :b :c2271; + :b :c2272; + :b :c2273; + :b :c2274; + :b :c2275; + :b :c2276; + :b :c2277; + :b :c2278; + :b :c2279; + :b :c2280; + :b :c2281; + :b :c2282; + :b :c2283; + :b :c2284; + :b :c2285; + :b :c2286; + :b :c2287; + :b :c2288; + :b :c2289; + :b :c2290; + :b :c2291; + :b :c2292; + :b :c2293; + :b :c2294; + :b :c2295; + :b :c2296; + :b :c2297; + :b :c2298; + :b :c2299; + :b :c2300; + :b :c2301; + :b :c2302; + :b :c2303; + :b :c2304; + :b :c2305; + :b :c2306; + :b :c2307; + :b :c2308; + :b :c2309; + :b :c2310; + :b :c2311; + :b :c2312; + :b :c2313; + :b :c2314; + :b :c2315; + :b :c2316; + :b :c2317; + :b :c2318; + :b :c2319; + :b :c2320; + :b :c2321; + :b :c2322; + :b :c2323; + :b :c2324; + :b :c2325; + :b :c2326; + :b :c2327; + :b :c2328; + :b :c2329; + :b :c2330; + :b :c2331; + :b :c2332; + :b :c2333; + :b :c2334; + :b :c2335; + :b :c2336; + :b :c2337; + :b :c2338; + :b :c2339; + :b :c2340; + :b :c2341; + :b :c2342; + :b :c2343; + :b :c2344; + :b :c2345; + :b :c2346; + :b :c2347; + :b :c2348; + :b :c2349; + :b :c2350; + :b :c2351; + :b :c2352; + :b :c2353; + :b :c2354; + :b :c2355; + :b :c2356; + :b :c2357; + :b :c2358; + :b :c2359; + :b :c2360; + :b :c2361; + :b :c2362; + :b :c2363; + :b :c2364; + :b :c2365; + :b :c2366; + :b :c2367; + :b :c2368; + :b :c2369; + :b :c2370; + :b :c2371; + :b :c2372; + :b :c2373; + :b :c2374; + :b :c2375; + :b :c2376; + :b :c2377; + :b :c2378; + :b :c2379; + :b :c2380; + :b :c2381; + :b :c2382; + :b :c2383; + :b :c2384; + :b :c2385; + :b :c2386; + :b :c2387; + :b :c2388; + :b :c2389; + :b :c2390; + :b :c2391; + :b :c2392; + :b :c2393; + :b :c2394; + :b :c2395; + :b :c2396; + :b :c2397; + :b :c2398; + :b :c2399; + :b :c2400; + :b :c2401; + :b :c2402; + :b :c2403; + :b :c2404; + :b :c2405; + :b :c2406; + :b :c2407; + :b :c2408; + :b :c2409; + :b :c2410; + :b :c2411; + :b :c2412; + :b :c2413; + :b :c2414; + :b :c2415; + :b :c2416; + :b :c2417; + :b :c2418; + :b :c2419; + :b :c2420; + :b :c2421; + :b :c2422; + :b :c2423; + :b :c2424; + :b :c2425; + :b :c2426; + :b :c2427; + :b :c2428; + :b :c2429; + :b :c2430; + :b :c2431; + :b :c2432; + :b :c2433; + :b :c2434; + :b :c2435; + :b :c2436; + :b :c2437; + :b :c2438; + :b :c2439; + :b :c2440; + :b :c2441; + :b :c2442; + :b :c2443; + :b :c2444; + :b :c2445; + :b :c2446; + :b :c2447; + :b :c2448; + :b :c2449; + :b :c2450; + :b :c2451; + :b :c2452; + :b :c2453; + :b :c2454; + :b :c2455; + :b :c2456; + :b :c2457; + :b :c2458; + :b :c2459; + :b :c2460; + :b :c2461; + :b :c2462; + :b :c2463; + :b :c2464; + :b :c2465; + :b :c2466; + :b :c2467; + :b :c2468; + :b :c2469; + :b :c2470; + :b :c2471; + :b :c2472; + :b :c2473; + :b :c2474; + :b :c2475; + :b :c2476; + :b :c2477; + :b :c2478; + :b :c2479; + :b :c2480; + :b :c2481; + :b :c2482; + :b :c2483; + :b :c2484; + :b :c2485; + :b :c2486; + :b :c2487; + :b :c2488; + :b :c2489; + :b :c2490; + :b :c2491; + :b :c2492; + :b :c2493; + :b :c2494; + :b :c2495; + :b :c2496; + :b :c2497; + :b :c2498; + :b :c2499; + :b :c2500; + :b :c2501; + :b :c2502; + :b :c2503; + :b :c2504; + :b :c2505; + :b :c2506; + :b :c2507; + :b :c2508; + :b :c2509; + :b :c2510; + :b :c2511; + :b :c2512; + :b :c2513; + :b :c2514; + :b :c2515; + :b :c2516; + :b :c2517; + :b :c2518; + :b :c2519; + :b :c2520; + :b :c2521; + :b :c2522; + :b :c2523; + :b :c2524; + :b :c2525; + :b :c2526; + :b :c2527; + :b :c2528; + :b :c2529; + :b :c2530; + :b :c2531; + :b :c2532; + :b :c2533; + :b :c2534; + :b :c2535; + :b :c2536; + :b :c2537; + :b :c2538; + :b :c2539; + :b :c2540; + :b :c2541; + :b :c2542; + :b :c2543; + :b :c2544; + :b :c2545; + :b :c2546; + :b :c2547; + :b :c2548; + :b :c2549; + :b :c2550; + :b :c2551; + :b :c2552; + :b :c2553; + :b :c2554; + :b :c2555; + :b :c2556; + :b :c2557; + :b :c2558; + :b :c2559; + :b :c2560; + :b :c2561; + :b :c2562; + :b :c2563; + :b :c2564; + :b :c2565; + :b :c2566; + :b :c2567; + :b :c2568; + :b :c2569; + :b :c2570; + :b :c2571; + :b :c2572; + :b :c2573; + :b :c2574; + :b :c2575; + :b :c2576; + :b :c2577; + :b :c2578; + :b :c2579; + :b :c2580; + :b :c2581; + :b :c2582; + :b :c2583; + :b :c2584; + :b :c2585; + :b :c2586; + :b :c2587; + :b :c2588; + :b :c2589; + :b :c2590; + :b :c2591; + :b :c2592; + :b :c2593; + :b :c2594; + :b :c2595; + :b :c2596; + :b :c2597; + :b :c2598; + :b :c2599; + :b :c2600; + :b :c2601; + :b :c2602; + :b :c2603; + :b :c2604; + :b :c2605; + :b :c2606; + :b :c2607; + :b :c2608; + :b :c2609; + :b :c2610; + :b :c2611; + :b :c2612; + :b :c2613; + :b :c2614; + :b :c2615; + :b :c2616; + :b :c2617; + :b :c2618; + :b :c2619; + :b :c2620; + :b :c2621; + :b :c2622; + :b :c2623; + :b :c2624; + :b :c2625; + :b :c2626; + :b :c2627; + :b :c2628; + :b :c2629; + :b :c2630; + :b :c2631; + :b :c2632; + :b :c2633; + :b :c2634; + :b :c2635; + :b :c2636; + :b :c2637; + :b :c2638; + :b :c2639; + :b :c2640; + :b :c2641; + :b :c2642; + :b :c2643; + :b :c2644; + :b :c2645; + :b :c2646; + :b :c2647; + :b :c2648; + :b :c2649; + :b :c2650; + :b :c2651; + :b :c2652; + :b :c2653; + :b :c2654; + :b :c2655; + :b :c2656; + :b :c2657; + :b :c2658; + :b :c2659; + :b :c2660; + :b :c2661; + :b :c2662; + :b :c2663; + :b :c2664; + :b :c2665; + :b :c2666; + :b :c2667; + :b :c2668; + :b :c2669; + :b :c2670; + :b :c2671; + :b :c2672; + :b :c2673; + :b :c2674; + :b :c2675; + :b :c2676; + :b :c2677; + :b :c2678; + :b :c2679; + :b :c2680; + :b :c2681; + :b :c2682; + :b :c2683; + :b :c2684; + :b :c2685; + :b :c2686; + :b :c2687; + :b :c2688; + :b :c2689; + :b :c2690; + :b :c2691; + :b :c2692; + :b :c2693; + :b :c2694; + :b :c2695; + :b :c2696; + :b :c2697; + :b :c2698; + :b :c2699; + :b :c2700; + :b :c2701; + :b :c2702; + :b :c2703; + :b :c2704; + :b :c2705; + :b :c2706; + :b :c2707; + :b :c2708; + :b :c2709; + :b :c2710; + :b :c2711; + :b :c2712; + :b :c2713; + :b :c2714; + :b :c2715; + :b :c2716; + :b :c2717; + :b :c2718; + :b :c2719; + :b :c2720; + :b :c2721; + :b :c2722; + :b :c2723; + :b :c2724; + :b :c2725; + :b :c2726; + :b :c2727; + :b :c2728; + :b :c2729; + :b :c2730; + :b :c2731; + :b :c2732; + :b :c2733; + :b :c2734; + :b :c2735; + :b :c2736; + :b :c2737; + :b :c2738; + :b :c2739; + :b :c2740; + :b :c2741; + :b :c2742; + :b :c2743; + :b :c2744; + :b :c2745; + :b :c2746; + :b :c2747; + :b :c2748; + :b :c2749; + :b :c2750; + :b :c2751; + :b :c2752; + :b :c2753; + :b :c2754; + :b :c2755; + :b :c2756; + :b :c2757; + :b :c2758; + :b :c2759; + :b :c2760; + :b :c2761; + :b :c2762; + :b :c2763; + :b :c2764; + :b :c2765; + :b :c2766; + :b :c2767; + :b :c2768; + :b :c2769; + :b :c2770; + :b :c2771; + :b :c2772; + :b :c2773; + :b :c2774; + :b :c2775; + :b :c2776; + :b :c2777; + :b :c2778; + :b :c2779; + :b :c2780; + :b :c2781; + :b :c2782; + :b :c2783; + :b :c2784; + :b :c2785; + :b :c2786; + :b :c2787; + :b :c2788; + :b :c2789; + :b :c2790; + :b :c2791; + :b :c2792; + :b :c2793; + :b :c2794; + :b :c2795; + :b :c2796; + :b :c2797; + :b :c2798; + :b :c2799; + :b :c2800; + :b :c2801; + :b :c2802; + :b :c2803; + :b :c2804; + :b :c2805; + :b :c2806; + :b :c2807; + :b :c2808; + :b :c2809; + :b :c2810; + :b :c2811; + :b :c2812; + :b :c2813; + :b :c2814; + :b :c2815; + :b :c2816; + :b :c2817; + :b :c2818; + :b :c2819; + :b :c2820; + :b :c2821; + :b :c2822; + :b :c2823; + :b :c2824; + :b :c2825; + :b :c2826; + :b :c2827; + :b :c2828; + :b :c2829; + :b :c2830; + :b :c2831; + :b :c2832; + :b :c2833; + :b :c2834; + :b :c2835; + :b :c2836; + :b :c2837; + :b :c2838; + :b :c2839; + :b :c2840; + :b :c2841; + :b :c2842; + :b :c2843; + :b :c2844; + :b :c2845; + :b :c2846; + :b :c2847; + :b :c2848; + :b :c2849; + :b :c2850; + :b :c2851; + :b :c2852; + :b :c2853; + :b :c2854; + :b :c2855; + :b :c2856; + :b :c2857; + :b :c2858; + :b :c2859; + :b :c2860; + :b :c2861; + :b :c2862; + :b :c2863; + :b :c2864; + :b :c2865; + :b :c2866; + :b :c2867; + :b :c2868; + :b :c2869; + :b :c2870; + :b :c2871; + :b :c2872; + :b :c2873; + :b :c2874; + :b :c2875; + :b :c2876; + :b :c2877; + :b :c2878; + :b :c2879; + :b :c2880; + :b :c2881; + :b :c2882; + :b :c2883; + :b :c2884; + :b :c2885; + :b :c2886; + :b :c2887; + :b :c2888; + :b :c2889; + :b :c2890; + :b :c2891; + :b :c2892; + :b :c2893; + :b :c2894; + :b :c2895; + :b :c2896; + :b :c2897; + :b :c2898; + :b :c2899; + :b :c2900; + :b :c2901; + :b :c2902; + :b :c2903; + :b :c2904; + :b :c2905; + :b :c2906; + :b :c2907; + :b :c2908; + :b :c2909; + :b :c2910; + :b :c2911; + :b :c2912; + :b :c2913; + :b :c2914; + :b :c2915; + :b :c2916; + :b :c2917; + :b :c2918; + :b :c2919; + :b :c2920; + :b :c2921; + :b :c2922; + :b :c2923; + :b :c2924; + :b :c2925; + :b :c2926; + :b :c2927; + :b :c2928; + :b :c2929; + :b :c2930; + :b :c2931; + :b :c2932; + :b :c2933; + :b :c2934; + :b :c2935; + :b :c2936; + :b :c2937; + :b :c2938; + :b :c2939; + :b :c2940; + :b :c2941; + :b :c2942; + :b :c2943; + :b :c2944; + :b :c2945; + :b :c2946; + :b :c2947; + :b :c2948; + :b :c2949; + :b :c2950; + :b :c2951; + :b :c2952; + :b :c2953; + :b :c2954; + :b :c2955; + :b :c2956; + :b :c2957; + :b :c2958; + :b :c2959; + :b :c2960; + :b :c2961; + :b :c2962; + :b :c2963; + :b :c2964; + :b :c2965; + :b :c2966; + :b :c2967; + :b :c2968; + :b :c2969; + :b :c2970; + :b :c2971; + :b :c2972; + :b :c2973; + :b :c2974; + :b :c2975; + :b :c2976; + :b :c2977; + :b :c2978; + :b :c2979; + :b :c2980; + :b :c2981; + :b :c2982; + :b :c2983; + :b :c2984; + :b :c2985; + :b :c2986; + :b :c2987; + :b :c2988; + :b :c2989; + :b :c2990; + :b :c2991; + :b :c2992; + :b :c2993; + :b :c2994; + :b :c2995; + :b :c2996; + :b :c2997; + :b :c2998; + :b :c2999; + :b :c3000; + :b :c3001; + :b :c3002; + :b :c3003; + :b :c3004; + :b :c3005; + :b :c3006; + :b :c3007; + :b :c3008; + :b :c3009; + :b :c3010; + :b :c3011; + :b :c3012; + :b :c3013; + :b :c3014; + :b :c3015; + :b :c3016; + :b :c3017; + :b :c3018; + :b :c3019; + :b :c3020; + :b :c3021; + :b :c3022; + :b :c3023; + :b :c3024; + :b :c3025; + :b :c3026; + :b :c3027; + :b :c3028; + :b :c3029; + :b :c3030; + :b :c3031; + :b :c3032; + :b :c3033; + :b :c3034; + :b :c3035; + :b :c3036; + :b :c3037; + :b :c3038; + :b :c3039; + :b :c3040; + :b :c3041; + :b :c3042; + :b :c3043; + :b :c3044; + :b :c3045; + :b :c3046; + :b :c3047; + :b :c3048; + :b :c3049; + :b :c3050; + :b :c3051; + :b :c3052; + :b :c3053; + :b :c3054; + :b :c3055; + :b :c3056; + :b :c3057; + :b :c3058; + :b :c3059; + :b :c3060; + :b :c3061; + :b :c3062; + :b :c3063; + :b :c3064; + :b :c3065; + :b :c3066; + :b :c3067; + :b :c3068; + :b :c3069; + :b :c3070; + :b :c3071; + :b :c3072; + :b :c3073; + :b :c3074; + :b :c3075; + :b :c3076; + :b :c3077; + :b :c3078; + :b :c3079; + :b :c3080; + :b :c3081; + :b :c3082; + :b :c3083; + :b :c3084; + :b :c3085; + :b :c3086; + :b :c3087; + :b :c3088; + :b :c3089; + :b :c3090; + :b :c3091; + :b :c3092; + :b :c3093; + :b :c3094; + :b :c3095; + :b :c3096; + :b :c3097; + :b :c3098; + :b :c3099; + :b :c3100; + :b :c3101; + :b :c3102; + :b :c3103; + :b :c3104; + :b :c3105; + :b :c3106; + :b :c3107; + :b :c3108; + :b :c3109; + :b :c3110; + :b :c3111; + :b :c3112; + :b :c3113; + :b :c3114; + :b :c3115; + :b :c3116; + :b :c3117; + :b :c3118; + :b :c3119; + :b :c3120; + :b :c3121; + :b :c3122; + :b :c3123; + :b :c3124; + :b :c3125; + :b :c3126; + :b :c3127; + :b :c3128; + :b :c3129; + :b :c3130; + :b :c3131; + :b :c3132; + :b :c3133; + :b :c3134; + :b :c3135; + :b :c3136; + :b :c3137; + :b :c3138; + :b :c3139; + :b :c3140; + :b :c3141; + :b :c3142; + :b :c3143; + :b :c3144; + :b :c3145; + :b :c3146; + :b :c3147; + :b :c3148; + :b :c3149; + :b :c3150; + :b :c3151; + :b :c3152; + :b :c3153; + :b :c3154; + :b :c3155; + :b :c3156; + :b :c3157; + :b :c3158; + :b :c3159; + :b :c3160; + :b :c3161; + :b :c3162; + :b :c3163; + :b :c3164; + :b :c3165; + :b :c3166; + :b :c3167; + :b :c3168; + :b :c3169; + :b :c3170; + :b :c3171; + :b :c3172; + :b :c3173; + :b :c3174; + :b :c3175; + :b :c3176; + :b :c3177; + :b :c3178; + :b :c3179; + :b :c3180; + :b :c3181; + :b :c3182; + :b :c3183; + :b :c3184; + :b :c3185; + :b :c3186; + :b :c3187; + :b :c3188; + :b :c3189; + :b :c3190; + :b :c3191; + :b :c3192; + :b :c3193; + :b :c3194; + :b :c3195; + :b :c3196; + :b :c3197; + :b :c3198; + :b :c3199; + :b :c3200; + :b :c3201; + :b :c3202; + :b :c3203; + :b :c3204; + :b :c3205; + :b :c3206; + :b :c3207; + :b :c3208; + :b :c3209; + :b :c3210; + :b :c3211; + :b :c3212; + :b :c3213; + :b :c3214; + :b :c3215; + :b :c3216; + :b :c3217; + :b :c3218; + :b :c3219; + :b :c3220; + :b :c3221; + :b :c3222; + :b :c3223; + :b :c3224; + :b :c3225; + :b :c3226; + :b :c3227; + :b :c3228; + :b :c3229; + :b :c3230; + :b :c3231; + :b :c3232; + :b :c3233; + :b :c3234; + :b :c3235; + :b :c3236; + :b :c3237; + :b :c3238; + :b :c3239; + :b :c3240; + :b :c3241; + :b :c3242; + :b :c3243; + :b :c3244; + :b :c3245; + :b :c3246; + :b :c3247; + :b :c3248; + :b :c3249; + :b :c3250; + :b :c3251; + :b :c3252; + :b :c3253; + :b :c3254; + :b :c3255; + :b :c3256; + :b :c3257; + :b :c3258; + :b :c3259; + :b :c3260; + :b :c3261; + :b :c3262; + :b :c3263; + :b :c3264; + :b :c3265; + :b :c3266; + :b :c3267; + :b :c3268; + :b :c3269; + :b :c3270; + :b :c3271; + :b :c3272; + :b :c3273; + :b :c3274; + :b :c3275; + :b :c3276; + :b :c3277; + :b :c3278; + :b :c3279; + :b :c3280; + :b :c3281; + :b :c3282; + :b :c3283; + :b :c3284; + :b :c3285; + :b :c3286; + :b :c3287; + :b :c3288; + :b :c3289; + :b :c3290; + :b :c3291; + :b :c3292; + :b :c3293; + :b :c3294; + :b :c3295; + :b :c3296; + :b :c3297; + :b :c3298; + :b :c3299; + :b :c3300; + :b :c3301; + :b :c3302; + :b :c3303; + :b :c3304; + :b :c3305; + :b :c3306; + :b :c3307; + :b :c3308; + :b :c3309; + :b :c3310; + :b :c3311; + :b :c3312; + :b :c3313; + :b :c3314; + :b :c3315; + :b :c3316; + :b :c3317; + :b :c3318; + :b :c3319; + :b :c3320; + :b :c3321; + :b :c3322; + :b :c3323; + :b :c3324; + :b :c3325; + :b :c3326; + :b :c3327; + :b :c3328; + :b :c3329; + :b :c3330; + :b :c3331; + :b :c3332; + :b :c3333; + :b :c3334; + :b :c3335; + :b :c3336; + :b :c3337; + :b :c3338; + :b :c3339; + :b :c3340; + :b :c3341; + :b :c3342; + :b :c3343; + :b :c3344; + :b :c3345; + :b :c3346; + :b :c3347; + :b :c3348; + :b :c3349; + :b :c3350; + :b :c3351; + :b :c3352; + :b :c3353; + :b :c3354; + :b :c3355; + :b :c3356; + :b :c3357; + :b :c3358; + :b :c3359; + :b :c3360; + :b :c3361; + :b :c3362; + :b :c3363; + :b :c3364; + :b :c3365; + :b :c3366; + :b :c3367; + :b :c3368; + :b :c3369; + :b :c3370; + :b :c3371; + :b :c3372; + :b :c3373; + :b :c3374; + :b :c3375; + :b :c3376; + :b :c3377; + :b :c3378; + :b :c3379; + :b :c3380; + :b :c3381; + :b :c3382; + :b :c3383; + :b :c3384; + :b :c3385; + :b :c3386; + :b :c3387; + :b :c3388; + :b :c3389; + :b :c3390; + :b :c3391; + :b :c3392; + :b :c3393; + :b :c3394; + :b :c3395; + :b :c3396; + :b :c3397; + :b :c3398; + :b :c3399; + :b :c3400; + :b :c3401; + :b :c3402; + :b :c3403; + :b :c3404; + :b :c3405; + :b :c3406; + :b :c3407; + :b :c3408; + :b :c3409; + :b :c3410; + :b :c3411; + :b :c3412; + :b :c3413; + :b :c3414; + :b :c3415; + :b :c3416; + :b :c3417; + :b :c3418; + :b :c3419; + :b :c3420; + :b :c3421; + :b :c3422; + :b :c3423; + :b :c3424; + :b :c3425; + :b :c3426; + :b :c3427; + :b :c3428; + :b :c3429; + :b :c3430; + :b :c3431; + :b :c3432; + :b :c3433; + :b :c3434; + :b :c3435; + :b :c3436; + :b :c3437; + :b :c3438; + :b :c3439; + :b :c3440; + :b :c3441; + :b :c3442; + :b :c3443; + :b :c3444; + :b :c3445; + :b :c3446; + :b :c3447; + :b :c3448; + :b :c3449; + :b :c3450; + :b :c3451; + :b :c3452; + :b :c3453; + :b :c3454; + :b :c3455; + :b :c3456; + :b :c3457; + :b :c3458; + :b :c3459; + :b :c3460; + :b :c3461; + :b :c3462; + :b :c3463; + :b :c3464; + :b :c3465; + :b :c3466; + :b :c3467; + :b :c3468; + :b :c3469; + :b :c3470; + :b :c3471; + :b :c3472; + :b :c3473; + :b :c3474; + :b :c3475; + :b :c3476; + :b :c3477; + :b :c3478; + :b :c3479; + :b :c3480; + :b :c3481; + :b :c3482; + :b :c3483; + :b :c3484; + :b :c3485; + :b :c3486; + :b :c3487; + :b :c3488; + :b :c3489; + :b :c3490; + :b :c3491; + :b :c3492; + :b :c3493; + :b :c3494; + :b :c3495; + :b :c3496; + :b :c3497; + :b :c3498; + :b :c3499; + :b :c3500; + :b :c3501; + :b :c3502; + :b :c3503; + :b :c3504; + :b :c3505; + :b :c3506; + :b :c3507; + :b :c3508; + :b :c3509; + :b :c3510; + :b :c3511; + :b :c3512; + :b :c3513; + :b :c3514; + :b :c3515; + :b :c3516; + :b :c3517; + :b :c3518; + :b :c3519; + :b :c3520; + :b :c3521; + :b :c3522; + :b :c3523; + :b :c3524; + :b :c3525; + :b :c3526; + :b :c3527; + :b :c3528; + :b :c3529; + :b :c3530; + :b :c3531; + :b :c3532; + :b :c3533; + :b :c3534; + :b :c3535; + :b :c3536; + :b :c3537; + :b :c3538; + :b :c3539; + :b :c3540; + :b :c3541; + :b :c3542; + :b :c3543; + :b :c3544; + :b :c3545; + :b :c3546; + :b :c3547; + :b :c3548; + :b :c3549; + :b :c3550; + :b :c3551; + :b :c3552; + :b :c3553; + :b :c3554; + :b :c3555; + :b :c3556; + :b :c3557; + :b :c3558; + :b :c3559; + :b :c3560; + :b :c3561; + :b :c3562; + :b :c3563; + :b :c3564; + :b :c3565; + :b :c3566; + :b :c3567; + :b :c3568; + :b :c3569; + :b :c3570; + :b :c3571; + :b :c3572; + :b :c3573; + :b :c3574; + :b :c3575; + :b :c3576; + :b :c3577; + :b :c3578; + :b :c3579; + :b :c3580; + :b :c3581; + :b :c3582; + :b :c3583; + :b :c3584; + :b :c3585; + :b :c3586; + :b :c3587; + :b :c3588; + :b :c3589; + :b :c3590; + :b :c3591; + :b :c3592; + :b :c3593; + :b :c3594; + :b :c3595; + :b :c3596; + :b :c3597; + :b :c3598; + :b :c3599; + :b :c3600; + :b :c3601; + :b :c3602; + :b :c3603; + :b :c3604; + :b :c3605; + :b :c3606; + :b :c3607; + :b :c3608; + :b :c3609; + :b :c3610; + :b :c3611; + :b :c3612; + :b :c3613; + :b :c3614; + :b :c3615; + :b :c3616; + :b :c3617; + :b :c3618; + :b :c3619; + :b :c3620; + :b :c3621; + :b :c3622; + :b :c3623; + :b :c3624; + :b :c3625; + :b :c3626; + :b :c3627; + :b :c3628; + :b :c3629; + :b :c3630; + :b :c3631; + :b :c3632; + :b :c3633; + :b :c3634; + :b :c3635; + :b :c3636; + :b :c3637; + :b :c3638; + :b :c3639; + :b :c3640; + :b :c3641; + :b :c3642; + :b :c3643; + :b :c3644; + :b :c3645; + :b :c3646; + :b :c3647; + :b :c3648; + :b :c3649; + :b :c3650; + :b :c3651; + :b :c3652; + :b :c3653; + :b :c3654; + :b :c3655; + :b :c3656; + :b :c3657; + :b :c3658; + :b :c3659; + :b :c3660; + :b :c3661; + :b :c3662; + :b :c3663; + :b :c3664; + :b :c3665; + :b :c3666; + :b :c3667; + :b :c3668; + :b :c3669; + :b :c3670; + :b :c3671; + :b :c3672; + :b :c3673; + :b :c3674; + :b :c3675; + :b :c3676; + :b :c3677; + :b :c3678; + :b :c3679; + :b :c3680; + :b :c3681; + :b :c3682; + :b :c3683; + :b :c3684; + :b :c3685; + :b :c3686; + :b :c3687; + :b :c3688; + :b :c3689; + :b :c3690; + :b :c3691; + :b :c3692; + :b :c3693; + :b :c3694; + :b :c3695; + :b :c3696; + :b :c3697; + :b :c3698; + :b :c3699; + :b :c3700; + :b :c3701; + :b :c3702; + :b :c3703; + :b :c3704; + :b :c3705; + :b :c3706; + :b :c3707; + :b :c3708; + :b :c3709; + :b :c3710; + :b :c3711; + :b :c3712; + :b :c3713; + :b :c3714; + :b :c3715; + :b :c3716; + :b :c3717; + :b :c3718; + :b :c3719; + :b :c3720; + :b :c3721; + :b :c3722; + :b :c3723; + :b :c3724; + :b :c3725; + :b :c3726; + :b :c3727; + :b :c3728; + :b :c3729; + :b :c3730; + :b :c3731; + :b :c3732; + :b :c3733; + :b :c3734; + :b :c3735; + :b :c3736; + :b :c3737; + :b :c3738; + :b :c3739; + :b :c3740; + :b :c3741; + :b :c3742; + :b :c3743; + :b :c3744; + :b :c3745; + :b :c3746; + :b :c3747; + :b :c3748; + :b :c3749; + :b :c3750; + :b :c3751; + :b :c3752; + :b :c3753; + :b :c3754; + :b :c3755; + :b :c3756; + :b :c3757; + :b :c3758; + :b :c3759; + :b :c3760; + :b :c3761; + :b :c3762; + :b :c3763; + :b :c3764; + :b :c3765; + :b :c3766; + :b :c3767; + :b :c3768; + :b :c3769; + :b :c3770; + :b :c3771; + :b :c3772; + :b :c3773; + :b :c3774; + :b :c3775; + :b :c3776; + :b :c3777; + :b :c3778; + :b :c3779; + :b :c3780; + :b :c3781; + :b :c3782; + :b :c3783; + :b :c3784; + :b :c3785; + :b :c3786; + :b :c3787; + :b :c3788; + :b :c3789; + :b :c3790; + :b :c3791; + :b :c3792; + :b :c3793; + :b :c3794; + :b :c3795; + :b :c3796; + :b :c3797; + :b :c3798; + :b :c3799; + :b :c3800; + :b :c3801; + :b :c3802; + :b :c3803; + :b :c3804; + :b :c3805; + :b :c3806; + :b :c3807; + :b :c3808; + :b :c3809; + :b :c3810; + :b :c3811; + :b :c3812; + :b :c3813; + :b :c3814; + :b :c3815; + :b :c3816; + :b :c3817; + :b :c3818; + :b :c3819; + :b :c3820; + :b :c3821; + :b :c3822; + :b :c3823; + :b :c3824; + :b :c3825; + :b :c3826; + :b :c3827; + :b :c3828; + :b :c3829; + :b :c3830; + :b :c3831; + :b :c3832; + :b :c3833; + :b :c3834; + :b :c3835; + :b :c3836; + :b :c3837; + :b :c3838; + :b :c3839; + :b :c3840; + :b :c3841; + :b :c3842; + :b :c3843; + :b :c3844; + :b :c3845; + :b :c3846; + :b :c3847; + :b :c3848; + :b :c3849; + :b :c3850; + :b :c3851; + :b :c3852; + :b :c3853; + :b :c3854; + :b :c3855; + :b :c3856; + :b :c3857; + :b :c3858; + :b :c3859; + :b :c3860; + :b :c3861; + :b :c3862; + :b :c3863; + :b :c3864; + :b :c3865; + :b :c3866; + :b :c3867; + :b :c3868; + :b :c3869; + :b :c3870; + :b :c3871; + :b :c3872; + :b :c3873; + :b :c3874; + :b :c3875; + :b :c3876; + :b :c3877; + :b :c3878; + :b :c3879; + :b :c3880; + :b :c3881; + :b :c3882; + :b :c3883; + :b :c3884; + :b :c3885; + :b :c3886; + :b :c3887; + :b :c3888; + :b :c3889; + :b :c3890; + :b :c3891; + :b :c3892; + :b :c3893; + :b :c3894; + :b :c3895; + :b :c3896; + :b :c3897; + :b :c3898; + :b :c3899; + :b :c3900; + :b :c3901; + :b :c3902; + :b :c3903; + :b :c3904; + :b :c3905; + :b :c3906; + :b :c3907; + :b :c3908; + :b :c3909; + :b :c3910; + :b :c3911; + :b :c3912; + :b :c3913; + :b :c3914; + :b :c3915; + :b :c3916; + :b :c3917; + :b :c3918; + :b :c3919; + :b :c3920; + :b :c3921; + :b :c3922; + :b :c3923; + :b :c3924; + :b :c3925; + :b :c3926; + :b :c3927; + :b :c3928; + :b :c3929; + :b :c3930; + :b :c3931; + :b :c3932; + :b :c3933; + :b :c3934; + :b :c3935; + :b :c3936; + :b :c3937; + :b :c3938; + :b :c3939; + :b :c3940; + :b :c3941; + :b :c3942; + :b :c3943; + :b :c3944; + :b :c3945; + :b :c3946; + :b :c3947; + :b :c3948; + :b :c3949; + :b :c3950; + :b :c3951; + :b :c3952; + :b :c3953; + :b :c3954; + :b :c3955; + :b :c3956; + :b :c3957; + :b :c3958; + :b :c3959; + :b :c3960; + :b :c3961; + :b :c3962; + :b :c3963; + :b :c3964; + :b :c3965; + :b :c3966; + :b :c3967; + :b :c3968; + :b :c3969; + :b :c3970; + :b :c3971; + :b :c3972; + :b :c3973; + :b :c3974; + :b :c3975; + :b :c3976; + :b :c3977; + :b :c3978; + :b :c3979; + :b :c3980; + :b :c3981; + :b :c3982; + :b :c3983; + :b :c3984; + :b :c3985; + :b :c3986; + :b :c3987; + :b :c3988; + :b :c3989; + :b :c3990; + :b :c3991; + :b :c3992; + :b :c3993; + :b :c3994; + :b :c3995; + :b :c3996; + :b :c3997; + :b :c3998; + :b :c3999; + :b :c4000; + :b :c4001; + :b :c4002; + :b :c4003; + :b :c4004; + :b :c4005; + :b :c4006; + :b :c4007; + :b :c4008; + :b :c4009; + :b :c4010; + :b :c4011; + :b :c4012; + :b :c4013; + :b :c4014; + :b :c4015; + :b :c4016; + :b :c4017; + :b :c4018; + :b :c4019; + :b :c4020; + :b :c4021; + :b :c4022; + :b :c4023; + :b :c4024; + :b :c4025; + :b :c4026; + :b :c4027; + :b :c4028; + :b :c4029; + :b :c4030; + :b :c4031; + :b :c4032; + :b :c4033; + :b :c4034; + :b :c4035; + :b :c4036; + :b :c4037; + :b :c4038; + :b :c4039; + :b :c4040; + :b :c4041; + :b :c4042; + :b :c4043; + :b :c4044; + :b :c4045; + :b :c4046; + :b :c4047; + :b :c4048; + :b :c4049; + :b :c4050; + :b :c4051; + :b :c4052; + :b :c4053; + :b :c4054; + :b :c4055; + :b :c4056; + :b :c4057; + :b :c4058; + :b :c4059; + :b :c4060; + :b :c4061; + :b :c4062; + :b :c4063; + :b :c4064; + :b :c4065; + :b :c4066; + :b :c4067; + :b :c4068; + :b :c4069; + :b :c4070; + :b :c4071; + :b :c4072; + :b :c4073; + :b :c4074; + :b :c4075; + :b :c4076; + :b :c4077; + :b :c4078; + :b :c4079; + :b :c4080; + :b :c4081; + :b :c4082; + :b :c4083; + :b :c4084; + :b :c4085; + :b :c4086; + :b :c4087; + :b :c4088; + :b :c4089; + :b :c4090; + :b :c4091; + :b :c4092; + :b :c4093; + :b :c4094; + :b :c4095; + :b :c4096; + :b :c4097; + :b :c4098; + :b :c4099; + :b :c4100; + :b :c4101; + :b :c4102; + :b :c4103; + :b :c4104; + :b :c4105; + :b :c4106; + :b :c4107; + :b :c4108; + :b :c4109; + :b :c4110; + :b :c4111; + :b :c4112; + :b :c4113; + :b :c4114; + :b :c4115; + :b :c4116; + :b :c4117; + :b :c4118; + :b :c4119; + :b :c4120; + :b :c4121; + :b :c4122; + :b :c4123; + :b :c4124; + :b :c4125; + :b :c4126; + :b :c4127; + :b :c4128; + :b :c4129; + :b :c4130; + :b :c4131; + :b :c4132; + :b :c4133; + :b :c4134; + :b :c4135; + :b :c4136; + :b :c4137; + :b :c4138; + :b :c4139; + :b :c4140; + :b :c4141; + :b :c4142; + :b :c4143; + :b :c4144; + :b :c4145; + :b :c4146; + :b :c4147; + :b :c4148; + :b :c4149; + :b :c4150; + :b :c4151; + :b :c4152; + :b :c4153; + :b :c4154; + :b :c4155; + :b :c4156; + :b :c4157; + :b :c4158; + :b :c4159; + :b :c4160; + :b :c4161; + :b :c4162; + :b :c4163; + :b :c4164; + :b :c4165; + :b :c4166; + :b :c4167; + :b :c4168; + :b :c4169; + :b :c4170; + :b :c4171; + :b :c4172; + :b :c4173; + :b :c4174; + :b :c4175; + :b :c4176; + :b :c4177; + :b :c4178; + :b :c4179; + :b :c4180; + :b :c4181; + :b :c4182; + :b :c4183; + :b :c4184; + :b :c4185; + :b :c4186; + :b :c4187; + :b :c4188; + :b :c4189; + :b :c4190; + :b :c4191; + :b :c4192; + :b :c4193; + :b :c4194; + :b :c4195; + :b :c4196; + :b :c4197; + :b :c4198; + :b :c4199; + :b :c4200; + :b :c4201; + :b :c4202; + :b :c4203; + :b :c4204; + :b :c4205; + :b :c4206; + :b :c4207; + :b :c4208; + :b :c4209; + :b :c4210; + :b :c4211; + :b :c4212; + :b :c4213; + :b :c4214; + :b :c4215; + :b :c4216; + :b :c4217; + :b :c4218; + :b :c4219; + :b :c4220; + :b :c4221; + :b :c4222; + :b :c4223; + :b :c4224; + :b :c4225; + :b :c4226; + :b :c4227; + :b :c4228; + :b :c4229; + :b :c4230; + :b :c4231; + :b :c4232; + :b :c4233; + :b :c4234; + :b :c4235; + :b :c4236; + :b :c4237; + :b :c4238; + :b :c4239; + :b :c4240; + :b :c4241; + :b :c4242; + :b :c4243; + :b :c4244; + :b :c4245; + :b :c4246; + :b :c4247; + :b :c4248; + :b :c4249; + :b :c4250; + :b :c4251; + :b :c4252; + :b :c4253; + :b :c4254; + :b :c4255; + :b :c4256; + :b :c4257; + :b :c4258; + :b :c4259; + :b :c4260; + :b :c4261; + :b :c4262; + :b :c4263; + :b :c4264; + :b :c4265; + :b :c4266; + :b :c4267; + :b :c4268; + :b :c4269; + :b :c4270; + :b :c4271; + :b :c4272; + :b :c4273; + :b :c4274; + :b :c4275; + :b :c4276; + :b :c4277; + :b :c4278; + :b :c4279; + :b :c4280; + :b :c4281; + :b :c4282; + :b :c4283; + :b :c4284; + :b :c4285; + :b :c4286; + :b :c4287; + :b :c4288; + :b :c4289; + :b :c4290; + :b :c4291; + :b :c4292; + :b :c4293; + :b :c4294; + :b :c4295; + :b :c4296; + :b :c4297; + :b :c4298; + :b :c4299; + :b :c4300; + :b :c4301; + :b :c4302; + :b :c4303; + :b :c4304; + :b :c4305; + :b :c4306; + :b :c4307; + :b :c4308; + :b :c4309; + :b :c4310; + :b :c4311; + :b :c4312; + :b :c4313; + :b :c4314; + :b :c4315; + :b :c4316; + :b :c4317; + :b :c4318; + :b :c4319; + :b :c4320; + :b :c4321; + :b :c4322; + :b :c4323; + :b :c4324; + :b :c4325; + :b :c4326; + :b :c4327; + :b :c4328; + :b :c4329; + :b :c4330; + :b :c4331; + :b :c4332; + :b :c4333; + :b :c4334; + :b :c4335; + :b :c4336; + :b :c4337; + :b :c4338; + :b :c4339; + :b :c4340; + :b :c4341; + :b :c4342; + :b :c4343; + :b :c4344; + :b :c4345; + :b :c4346; + :b :c4347; + :b :c4348; + :b :c4349; + :b :c4350; + :b :c4351; + :b :c4352; + :b :c4353; + :b :c4354; + :b :c4355; + :b :c4356; + :b :c4357; + :b :c4358; + :b :c4359; + :b :c4360; + :b :c4361; + :b :c4362; + :b :c4363; + :b :c4364; + :b :c4365; + :b :c4366; + :b :c4367; + :b :c4368; + :b :c4369; + :b :c4370; + :b :c4371; + :b :c4372; + :b :c4373; + :b :c4374; + :b :c4375; + :b :c4376; + :b :c4377; + :b :c4378; + :b :c4379; + :b :c4380; + :b :c4381; + :b :c4382; + :b :c4383; + :b :c4384; + :b :c4385; + :b :c4386; + :b :c4387; + :b :c4388; + :b :c4389; + :b :c4390; + :b :c4391; + :b :c4392; + :b :c4393; + :b :c4394; + :b :c4395; + :b :c4396; + :b :c4397; + :b :c4398; + :b :c4399; + :b :c4400; + :b :c4401; + :b :c4402; + :b :c4403; + :b :c4404; + :b :c4405; + :b :c4406; + :b :c4407; + :b :c4408; + :b :c4409; + :b :c4410; + :b :c4411; + :b :c4412; + :b :c4413; + :b :c4414; + :b :c4415; + :b :c4416; + :b :c4417; + :b :c4418; + :b :c4419; + :b :c4420; + :b :c4421; + :b :c4422; + :b :c4423; + :b :c4424; + :b :c4425; + :b :c4426; + :b :c4427; + :b :c4428; + :b :c4429; + :b :c4430; + :b :c4431; + :b :c4432; + :b :c4433; + :b :c4434; + :b :c4435; + :b :c4436; + :b :c4437; + :b :c4438; + :b :c4439; + :b :c4440; + :b :c4441; + :b :c4442; + :b :c4443; + :b :c4444; + :b :c4445; + :b :c4446; + :b :c4447; + :b :c4448; + :b :c4449; + :b :c4450; + :b :c4451; + :b :c4452; + :b :c4453; + :b :c4454; + :b :c4455; + :b :c4456; + :b :c4457; + :b :c4458; + :b :c4459; + :b :c4460; + :b :c4461; + :b :c4462; + :b :c4463; + :b :c4464; + :b :c4465; + :b :c4466; + :b :c4467; + :b :c4468; + :b :c4469; + :b :c4470; + :b :c4471; + :b :c4472; + :b :c4473; + :b :c4474; + :b :c4475; + :b :c4476; + :b :c4477; + :b :c4478; + :b :c4479; + :b :c4480; + :b :c4481; + :b :c4482; + :b :c4483; + :b :c4484; + :b :c4485; + :b :c4486; + :b :c4487; + :b :c4488; + :b :c4489; + :b :c4490; + :b :c4491; + :b :c4492; + :b :c4493; + :b :c4494; + :b :c4495; + :b :c4496; + :b :c4497; + :b :c4498; + :b :c4499; + :b :c4500; + :b :c4501; + :b :c4502; + :b :c4503; + :b :c4504; + :b :c4505; + :b :c4506; + :b :c4507; + :b :c4508; + :b :c4509; + :b :c4510; + :b :c4511; + :b :c4512; + :b :c4513; + :b :c4514; + :b :c4515; + :b :c4516; + :b :c4517; + :b :c4518; + :b :c4519; + :b :c4520; + :b :c4521; + :b :c4522; + :b :c4523; + :b :c4524; + :b :c4525; + :b :c4526; + :b :c4527; + :b :c4528; + :b :c4529; + :b :c4530; + :b :c4531; + :b :c4532; + :b :c4533; + :b :c4534; + :b :c4535; + :b :c4536; + :b :c4537; + :b :c4538; + :b :c4539; + :b :c4540; + :b :c4541; + :b :c4542; + :b :c4543; + :b :c4544; + :b :c4545; + :b :c4546; + :b :c4547; + :b :c4548; + :b :c4549; + :b :c4550; + :b :c4551; + :b :c4552; + :b :c4553; + :b :c4554; + :b :c4555; + :b :c4556; + :b :c4557; + :b :c4558; + :b :c4559; + :b :c4560; + :b :c4561; + :b :c4562; + :b :c4563; + :b :c4564; + :b :c4565; + :b :c4566; + :b :c4567; + :b :c4568; + :b :c4569; + :b :c4570; + :b :c4571; + :b :c4572; + :b :c4573; + :b :c4574; + :b :c4575; + :b :c4576; + :b :c4577; + :b :c4578; + :b :c4579; + :b :c4580; + :b :c4581; + :b :c4582; + :b :c4583; + :b :c4584; + :b :c4585; + :b :c4586; + :b :c4587; + :b :c4588; + :b :c4589; + :b :c4590; + :b :c4591; + :b :c4592; + :b :c4593; + :b :c4594; + :b :c4595; + :b :c4596; + :b :c4597; + :b :c4598; + :b :c4599; + :b :c4600; + :b :c4601; + :b :c4602; + :b :c4603; + :b :c4604; + :b :c4605; + :b :c4606; + :b :c4607; + :b :c4608; + :b :c4609; + :b :c4610; + :b :c4611; + :b :c4612; + :b :c4613; + :b :c4614; + :b :c4615; + :b :c4616; + :b :c4617; + :b :c4618; + :b :c4619; + :b :c4620; + :b :c4621; + :b :c4622; + :b :c4623; + :b :c4624; + :b :c4625; + :b :c4626; + :b :c4627; + :b :c4628; + :b :c4629; + :b :c4630; + :b :c4631; + :b :c4632; + :b :c4633; + :b :c4634; + :b :c4635; + :b :c4636; + :b :c4637; + :b :c4638; + :b :c4639; + :b :c4640; + :b :c4641; + :b :c4642; + :b :c4643; + :b :c4644; + :b :c4645; + :b :c4646; + :b :c4647; + :b :c4648; + :b :c4649; + :b :c4650; + :b :c4651; + :b :c4652; + :b :c4653; + :b :c4654; + :b :c4655; + :b :c4656; + :b :c4657; + :b :c4658; + :b :c4659; + :b :c4660; + :b :c4661; + :b :c4662; + :b :c4663; + :b :c4664; + :b :c4665; + :b :c4666; + :b :c4667; + :b :c4668; + :b :c4669; + :b :c4670; + :b :c4671; + :b :c4672; + :b :c4673; + :b :c4674; + :b :c4675; + :b :c4676; + :b :c4677; + :b :c4678; + :b :c4679; + :b :c4680; + :b :c4681; + :b :c4682; + :b :c4683; + :b :c4684; + :b :c4685; + :b :c4686; + :b :c4687; + :b :c4688; + :b :c4689; + :b :c4690; + :b :c4691; + :b :c4692; + :b :c4693; + :b :c4694; + :b :c4695; + :b :c4696; + :b :c4697; + :b :c4698; + :b :c4699; + :b :c4700; + :b :c4701; + :b :c4702; + :b :c4703; + :b :c4704; + :b :c4705; + :b :c4706; + :b :c4707; + :b :c4708; + :b :c4709; + :b :c4710; + :b :c4711; + :b :c4712; + :b :c4713; + :b :c4714; + :b :c4715; + :b :c4716; + :b :c4717; + :b :c4718; + :b :c4719; + :b :c4720; + :b :c4721; + :b :c4722; + :b :c4723; + :b :c4724; + :b :c4725; + :b :c4726; + :b :c4727; + :b :c4728; + :b :c4729; + :b :c4730; + :b :c4731; + :b :c4732; + :b :c4733; + :b :c4734; + :b :c4735; + :b :c4736; + :b :c4737; + :b :c4738; + :b :c4739; + :b :c4740; + :b :c4741; + :b :c4742; + :b :c4743; + :b :c4744; + :b :c4745; + :b :c4746; + :b :c4747; + :b :c4748; + :b :c4749; + :b :c4750; + :b :c4751; + :b :c4752; + :b :c4753; + :b :c4754; + :b :c4755; + :b :c4756; + :b :c4757; + :b :c4758; + :b :c4759; + :b :c4760; + :b :c4761; + :b :c4762; + :b :c4763; + :b :c4764; + :b :c4765; + :b :c4766; + :b :c4767; + :b :c4768; + :b :c4769; + :b :c4770; + :b :c4771; + :b :c4772; + :b :c4773; + :b :c4774; + :b :c4775; + :b :c4776; + :b :c4777; + :b :c4778; + :b :c4779; + :b :c4780; + :b :c4781; + :b :c4782; + :b :c4783; + :b :c4784; + :b :c4785; + :b :c4786; + :b :c4787; + :b :c4788; + :b :c4789; + :b :c4790; + :b :c4791; + :b :c4792; + :b :c4793; + :b :c4794; + :b :c4795; + :b :c4796; + :b :c4797; + :b :c4798; + :b :c4799; + :b :c4800; + :b :c4801; + :b :c4802; + :b :c4803; + :b :c4804; + :b :c4805; + :b :c4806; + :b :c4807; + :b :c4808; + :b :c4809; + :b :c4810; + :b :c4811; + :b :c4812; + :b :c4813; + :b :c4814; + :b :c4815; + :b :c4816; + :b :c4817; + :b :c4818; + :b :c4819; + :b :c4820; + :b :c4821; + :b :c4822; + :b :c4823; + :b :c4824; + :b :c4825; + :b :c4826; + :b :c4827; + :b :c4828; + :b :c4829; + :b :c4830; + :b :c4831; + :b :c4832; + :b :c4833; + :b :c4834; + :b :c4835; + :b :c4836; + :b :c4837; + :b :c4838; + :b :c4839; + :b :c4840; + :b :c4841; + :b :c4842; + :b :c4843; + :b :c4844; + :b :c4845; + :b :c4846; + :b :c4847; + :b :c4848; + :b :c4849; + :b :c4850; + :b :c4851; + :b :c4852; + :b :c4853; + :b :c4854; + :b :c4855; + :b :c4856; + :b :c4857; + :b :c4858; + :b :c4859; + :b :c4860; + :b :c4861; + :b :c4862; + :b :c4863; + :b :c4864; + :b :c4865; + :b :c4866; + :b :c4867; + :b :c4868; + :b :c4869; + :b :c4870; + :b :c4871; + :b :c4872; + :b :c4873; + :b :c4874; + :b :c4875; + :b :c4876; + :b :c4877; + :b :c4878; + :b :c4879; + :b :c4880; + :b :c4881; + :b :c4882; + :b :c4883; + :b :c4884; + :b :c4885; + :b :c4886; + :b :c4887; + :b :c4888; + :b :c4889; + :b :c4890; + :b :c4891; + :b :c4892; + :b :c4893; + :b :c4894; + :b :c4895; + :b :c4896; + :b :c4897; + :b :c4898; + :b :c4899; + :b :c4900; + :b :c4901; + :b :c4902; + :b :c4903; + :b :c4904; + :b :c4905; + :b :c4906; + :b :c4907; + :b :c4908; + :b :c4909; + :b :c4910; + :b :c4911; + :b :c4912; + :b :c4913; + :b :c4914; + :b :c4915; + :b :c4916; + :b :c4917; + :b :c4918; + :b :c4919; + :b :c4920; + :b :c4921; + :b :c4922; + :b :c4923; + :b :c4924; + :b :c4925; + :b :c4926; + :b :c4927; + :b :c4928; + :b :c4929; + :b :c4930; + :b :c4931; + :b :c4932; + :b :c4933; + :b :c4934; + :b :c4935; + :b :c4936; + :b :c4937; + :b :c4938; + :b :c4939; + :b :c4940; + :b :c4941; + :b :c4942; + :b :c4943; + :b :c4944; + :b :c4945; + :b :c4946; + :b :c4947; + :b :c4948; + :b :c4949; + :b :c4950; + :b :c4951; + :b :c4952; + :b :c4953; + :b :c4954; + :b :c4955; + :b :c4956; + :b :c4957; + :b :c4958; + :b :c4959; + :b :c4960; + :b :c4961; + :b :c4962; + :b :c4963; + :b :c4964; + :b :c4965; + :b :c4966; + :b :c4967; + :b :c4968; + :b :c4969; + :b :c4970; + :b :c4971; + :b :c4972; + :b :c4973; + :b :c4974; + :b :c4975; + :b :c4976; + :b :c4977; + :b :c4978; + :b :c4979; + :b :c4980; + :b :c4981; + :b :c4982; + :b :c4983; + :b :c4984; + :b :c4985; + :b :c4986; + :b :c4987; + :b :c4988; + :b :c4989; + :b :c4990; + :b :c4991; + :b :c4992; + :b :c4993; + :b :c4994; + :b :c4995; + :b :c4996; + :b :c4997; + :b :c4998; + :b :c4999; + :b :c5000; + :b :c5001; + :b :c5002; + :b :c5003; + :b :c5004; + :b :c5005; + :b :c5006; + :b :c5007; + :b :c5008; + :b :c5009; + :b :c5010; + :b :c5011; + :b :c5012; + :b :c5013; + :b :c5014; + :b :c5015; + :b :c5016; + :b :c5017; + :b :c5018; + :b :c5019; + :b :c5020; + :b :c5021; + :b :c5022; + :b :c5023; + :b :c5024; + :b :c5025; + :b :c5026; + :b :c5027; + :b :c5028; + :b :c5029; + :b :c5030; + :b :c5031; + :b :c5032; + :b :c5033; + :b :c5034; + :b :c5035; + :b :c5036; + :b :c5037; + :b :c5038; + :b :c5039; + :b :c5040; + :b :c5041; + :b :c5042; + :b :c5043; + :b :c5044; + :b :c5045; + :b :c5046; + :b :c5047; + :b :c5048; + :b :c5049; + :b :c5050; + :b :c5051; + :b :c5052; + :b :c5053; + :b :c5054; + :b :c5055; + :b :c5056; + :b :c5057; + :b :c5058; + :b :c5059; + :b :c5060; + :b :c5061; + :b :c5062; + :b :c5063; + :b :c5064; + :b :c5065; + :b :c5066; + :b :c5067; + :b :c5068; + :b :c5069; + :b :c5070; + :b :c5071; + :b :c5072; + :b :c5073; + :b :c5074; + :b :c5075; + :b :c5076; + :b :c5077; + :b :c5078; + :b :c5079; + :b :c5080; + :b :c5081; + :b :c5082; + :b :c5083; + :b :c5084; + :b :c5085; + :b :c5086; + :b :c5087; + :b :c5088; + :b :c5089; + :b :c5090; + :b :c5091; + :b :c5092; + :b :c5093; + :b :c5094; + :b :c5095; + :b :c5096; + :b :c5097; + :b :c5098; + :b :c5099; + :b :c5100; + :b :c5101; + :b :c5102; + :b :c5103; + :b :c5104; + :b :c5105; + :b :c5106; + :b :c5107; + :b :c5108; + :b :c5109; + :b :c5110; + :b :c5111; + :b :c5112; + :b :c5113; + :b :c5114; + :b :c5115; + :b :c5116; + :b :c5117; + :b :c5118; + :b :c5119; + :b :c5120; + :b :c5121; + :b :c5122; + :b :c5123; + :b :c5124; + :b :c5125; + :b :c5126; + :b :c5127; + :b :c5128; + :b :c5129; + :b :c5130; + :b :c5131; + :b :c5132; + :b :c5133; + :b :c5134; + :b :c5135; + :b :c5136; + :b :c5137; + :b :c5138; + :b :c5139; + :b :c5140; + :b :c5141; + :b :c5142; + :b :c5143; + :b :c5144; + :b :c5145; + :b :c5146; + :b :c5147; + :b :c5148; + :b :c5149; + :b :c5150; + :b :c5151; + :b :c5152; + :b :c5153; + :b :c5154; + :b :c5155; + :b :c5156; + :b :c5157; + :b :c5158; + :b :c5159; + :b :c5160; + :b :c5161; + :b :c5162; + :b :c5163; + :b :c5164; + :b :c5165; + :b :c5166; + :b :c5167; + :b :c5168; + :b :c5169; + :b :c5170; + :b :c5171; + :b :c5172; + :b :c5173; + :b :c5174; + :b :c5175; + :b :c5176; + :b :c5177; + :b :c5178; + :b :c5179; + :b :c5180; + :b :c5181; + :b :c5182; + :b :c5183; + :b :c5184; + :b :c5185; + :b :c5186; + :b :c5187; + :b :c5188; + :b :c5189; + :b :c5190; + :b :c5191; + :b :c5192; + :b :c5193; + :b :c5194; + :b :c5195; + :b :c5196; + :b :c5197; + :b :c5198; + :b :c5199; + :b :c5200; + :b :c5201; + :b :c5202; + :b :c5203; + :b :c5204; + :b :c5205; + :b :c5206; + :b :c5207; + :b :c5208; + :b :c5209; + :b :c5210; + :b :c5211; + :b :c5212; + :b :c5213; + :b :c5214; + :b :c5215; + :b :c5216; + :b :c5217; + :b :c5218; + :b :c5219; + :b :c5220; + :b :c5221; + :b :c5222; + :b :c5223; + :b :c5224; + :b :c5225; + :b :c5226; + :b :c5227; + :b :c5228; + :b :c5229; + :b :c5230; + :b :c5231; + :b :c5232; + :b :c5233; + :b :c5234; + :b :c5235; + :b :c5236; + :b :c5237; + :b :c5238; + :b :c5239; + :b :c5240; + :b :c5241; + :b :c5242; + :b :c5243; + :b :c5244; + :b :c5245; + :b :c5246; + :b :c5247; + :b :c5248; + :b :c5249; + :b :c5250; + :b :c5251; + :b :c5252; + :b :c5253; + :b :c5254; + :b :c5255; + :b :c5256; + :b :c5257; + :b :c5258; + :b :c5259; + :b :c5260; + :b :c5261; + :b :c5262; + :b :c5263; + :b :c5264; + :b :c5265; + :b :c5266; + :b :c5267; + :b :c5268; + :b :c5269; + :b :c5270; + :b :c5271; + :b :c5272; + :b :c5273; + :b :c5274; + :b :c5275; + :b :c5276; + :b :c5277; + :b :c5278; + :b :c5279; + :b :c5280; + :b :c5281; + :b :c5282; + :b :c5283; + :b :c5284; + :b :c5285; + :b :c5286; + :b :c5287; + :b :c5288; + :b :c5289; + :b :c5290; + :b :c5291; + :b :c5292; + :b :c5293; + :b :c5294; + :b :c5295; + :b :c5296; + :b :c5297; + :b :c5298; + :b :c5299; + :b :c5300; + :b :c5301; + :b :c5302; + :b :c5303; + :b :c5304; + :b :c5305; + :b :c5306; + :b :c5307; + :b :c5308; + :b :c5309; + :b :c5310; + :b :c5311; + :b :c5312; + :b :c5313; + :b :c5314; + :b :c5315; + :b :c5316; + :b :c5317; + :b :c5318; + :b :c5319; + :b :c5320; + :b :c5321; + :b :c5322; + :b :c5323; + :b :c5324; + :b :c5325; + :b :c5326; + :b :c5327; + :b :c5328; + :b :c5329; + :b :c5330; + :b :c5331; + :b :c5332; + :b :c5333; + :b :c5334; + :b :c5335; + :b :c5336; + :b :c5337; + :b :c5338; + :b :c5339; + :b :c5340; + :b :c5341; + :b :c5342; + :b :c5343; + :b :c5344; + :b :c5345; + :b :c5346; + :b :c5347; + :b :c5348; + :b :c5349; + :b :c5350; + :b :c5351; + :b :c5352; + :b :c5353; + :b :c5354; + :b :c5355; + :b :c5356; + :b :c5357; + :b :c5358; + :b :c5359; + :b :c5360; + :b :c5361; + :b :c5362; + :b :c5363; + :b :c5364; + :b :c5365; + :b :c5366; + :b :c5367; + :b :c5368; + :b :c5369; + :b :c5370; + :b :c5371; + :b :c5372; + :b :c5373; + :b :c5374; + :b :c5375; + :b :c5376; + :b :c5377; + :b :c5378; + :b :c5379; + :b :c5380; + :b :c5381; + :b :c5382; + :b :c5383; + :b :c5384; + :b :c5385; + :b :c5386; + :b :c5387; + :b :c5388; + :b :c5389; + :b :c5390; + :b :c5391; + :b :c5392; + :b :c5393; + :b :c5394; + :b :c5395; + :b :c5396; + :b :c5397; + :b :c5398; + :b :c5399; + :b :c5400; + :b :c5401; + :b :c5402; + :b :c5403; + :b :c5404; + :b :c5405; + :b :c5406; + :b :c5407; + :b :c5408; + :b :c5409; + :b :c5410; + :b :c5411; + :b :c5412; + :b :c5413; + :b :c5414; + :b :c5415; + :b :c5416; + :b :c5417; + :b :c5418; + :b :c5419; + :b :c5420; + :b :c5421; + :b :c5422; + :b :c5423; + :b :c5424; + :b :c5425; + :b :c5426; + :b :c5427; + :b :c5428; + :b :c5429; + :b :c5430; + :b :c5431; + :b :c5432; + :b :c5433; + :b :c5434; + :b :c5435; + :b :c5436; + :b :c5437; + :b :c5438; + :b :c5439; + :b :c5440; + :b :c5441; + :b :c5442; + :b :c5443; + :b :c5444; + :b :c5445; + :b :c5446; + :b :c5447; + :b :c5448; + :b :c5449; + :b :c5450; + :b :c5451; + :b :c5452; + :b :c5453; + :b :c5454; + :b :c5455; + :b :c5456; + :b :c5457; + :b :c5458; + :b :c5459; + :b :c5460; + :b :c5461; + :b :c5462; + :b :c5463; + :b :c5464; + :b :c5465; + :b :c5466; + :b :c5467; + :b :c5468; + :b :c5469; + :b :c5470; + :b :c5471; + :b :c5472; + :b :c5473; + :b :c5474; + :b :c5475; + :b :c5476; + :b :c5477; + :b :c5478; + :b :c5479; + :b :c5480; + :b :c5481; + :b :c5482; + :b :c5483; + :b :c5484; + :b :c5485; + :b :c5486; + :b :c5487; + :b :c5488; + :b :c5489; + :b :c5490; + :b :c5491; + :b :c5492; + :b :c5493; + :b :c5494; + :b :c5495; + :b :c5496; + :b :c5497; + :b :c5498; + :b :c5499; + :b :c5500; + :b :c5501; + :b :c5502; + :b :c5503; + :b :c5504; + :b :c5505; + :b :c5506; + :b :c5507; + :b :c5508; + :b :c5509; + :b :c5510; + :b :c5511; + :b :c5512; + :b :c5513; + :b :c5514; + :b :c5515; + :b :c5516; + :b :c5517; + :b :c5518; + :b :c5519; + :b :c5520; + :b :c5521; + :b :c5522; + :b :c5523; + :b :c5524; + :b :c5525; + :b :c5526; + :b :c5527; + :b :c5528; + :b :c5529; + :b :c5530; + :b :c5531; + :b :c5532; + :b :c5533; + :b :c5534; + :b :c5535; + :b :c5536; + :b :c5537; + :b :c5538; + :b :c5539; + :b :c5540; + :b :c5541; + :b :c5542; + :b :c5543; + :b :c5544; + :b :c5545; + :b :c5546; + :b :c5547; + :b :c5548; + :b :c5549; + :b :c5550; + :b :c5551; + :b :c5552; + :b :c5553; + :b :c5554; + :b :c5555; + :b :c5556; + :b :c5557; + :b :c5558; + :b :c5559; + :b :c5560; + :b :c5561; + :b :c5562; + :b :c5563; + :b :c5564; + :b :c5565; + :b :c5566; + :b :c5567; + :b :c5568; + :b :c5569; + :b :c5570; + :b :c5571; + :b :c5572; + :b :c5573; + :b :c5574; + :b :c5575; + :b :c5576; + :b :c5577; + :b :c5578; + :b :c5579; + :b :c5580; + :b :c5581; + :b :c5582; + :b :c5583; + :b :c5584; + :b :c5585; + :b :c5586; + :b :c5587; + :b :c5588; + :b :c5589; + :b :c5590; + :b :c5591; + :b :c5592; + :b :c5593; + :b :c5594; + :b :c5595; + :b :c5596; + :b :c5597; + :b :c5598; + :b :c5599; + :b :c5600; + :b :c5601; + :b :c5602; + :b :c5603; + :b :c5604; + :b :c5605; + :b :c5606; + :b :c5607; + :b :c5608; + :b :c5609; + :b :c5610; + :b :c5611; + :b :c5612; + :b :c5613; + :b :c5614; + :b :c5615; + :b :c5616; + :b :c5617; + :b :c5618; + :b :c5619; + :b :c5620; + :b :c5621; + :b :c5622; + :b :c5623; + :b :c5624; + :b :c5625; + :b :c5626; + :b :c5627; + :b :c5628; + :b :c5629; + :b :c5630; + :b :c5631; + :b :c5632; + :b :c5633; + :b :c5634; + :b :c5635; + :b :c5636; + :b :c5637; + :b :c5638; + :b :c5639; + :b :c5640; + :b :c5641; + :b :c5642; + :b :c5643; + :b :c5644; + :b :c5645; + :b :c5646; + :b :c5647; + :b :c5648; + :b :c5649; + :b :c5650; + :b :c5651; + :b :c5652; + :b :c5653; + :b :c5654; + :b :c5655; + :b :c5656; + :b :c5657; + :b :c5658; + :b :c5659; + :b :c5660; + :b :c5661; + :b :c5662; + :b :c5663; + :b :c5664; + :b :c5665; + :b :c5666; + :b :c5667; + :b :c5668; + :b :c5669; + :b :c5670; + :b :c5671; + :b :c5672; + :b :c5673; + :b :c5674; + :b :c5675; + :b :c5676; + :b :c5677; + :b :c5678; + :b :c5679; + :b :c5680; + :b :c5681; + :b :c5682; + :b :c5683; + :b :c5684; + :b :c5685; + :b :c5686; + :b :c5687; + :b :c5688; + :b :c5689; + :b :c5690; + :b :c5691; + :b :c5692; + :b :c5693; + :b :c5694; + :b :c5695; + :b :c5696; + :b :c5697; + :b :c5698; + :b :c5699; + :b :c5700; + :b :c5701; + :b :c5702; + :b :c5703; + :b :c5704; + :b :c5705; + :b :c5706; + :b :c5707; + :b :c5708; + :b :c5709; + :b :c5710; + :b :c5711; + :b :c5712; + :b :c5713; + :b :c5714; + :b :c5715; + :b :c5716; + :b :c5717; + :b :c5718; + :b :c5719; + :b :c5720; + :b :c5721; + :b :c5722; + :b :c5723; + :b :c5724; + :b :c5725; + :b :c5726; + :b :c5727; + :b :c5728; + :b :c5729; + :b :c5730; + :b :c5731; + :b :c5732; + :b :c5733; + :b :c5734; + :b :c5735; + :b :c5736; + :b :c5737; + :b :c5738; + :b :c5739; + :b :c5740; + :b :c5741; + :b :c5742; + :b :c5743; + :b :c5744; + :b :c5745; + :b :c5746; + :b :c5747; + :b :c5748; + :b :c5749; + :b :c5750; + :b :c5751; + :b :c5752; + :b :c5753; + :b :c5754; + :b :c5755; + :b :c5756; + :b :c5757; + :b :c5758; + :b :c5759; + :b :c5760; + :b :c5761; + :b :c5762; + :b :c5763; + :b :c5764; + :b :c5765; + :b :c5766; + :b :c5767; + :b :c5768; + :b :c5769; + :b :c5770; + :b :c5771; + :b :c5772; + :b :c5773; + :b :c5774; + :b :c5775; + :b :c5776; + :b :c5777; + :b :c5778; + :b :c5779; + :b :c5780; + :b :c5781; + :b :c5782; + :b :c5783; + :b :c5784; + :b :c5785; + :b :c5786; + :b :c5787; + :b :c5788; + :b :c5789; + :b :c5790; + :b :c5791; + :b :c5792; + :b :c5793; + :b :c5794; + :b :c5795; + :b :c5796; + :b :c5797; + :b :c5798; + :b :c5799; + :b :c5800; + :b :c5801; + :b :c5802; + :b :c5803; + :b :c5804; + :b :c5805; + :b :c5806; + :b :c5807; + :b :c5808; + :b :c5809; + :b :c5810; + :b :c5811; + :b :c5812; + :b :c5813; + :b :c5814; + :b :c5815; + :b :c5816; + :b :c5817; + :b :c5818; + :b :c5819; + :b :c5820; + :b :c5821; + :b :c5822; + :b :c5823; + :b :c5824; + :b :c5825; + :b :c5826; + :b :c5827; + :b :c5828; + :b :c5829; + :b :c5830; + :b :c5831; + :b :c5832; + :b :c5833; + :b :c5834; + :b :c5835; + :b :c5836; + :b :c5837; + :b :c5838; + :b :c5839; + :b :c5840; + :b :c5841; + :b :c5842; + :b :c5843; + :b :c5844; + :b :c5845; + :b :c5846; + :b :c5847; + :b :c5848; + :b :c5849; + :b :c5850; + :b :c5851; + :b :c5852; + :b :c5853; + :b :c5854; + :b :c5855; + :b :c5856; + :b :c5857; + :b :c5858; + :b :c5859; + :b :c5860; + :b :c5861; + :b :c5862; + :b :c5863; + :b :c5864; + :b :c5865; + :b :c5866; + :b :c5867; + :b :c5868; + :b :c5869; + :b :c5870; + :b :c5871; + :b :c5872; + :b :c5873; + :b :c5874; + :b :c5875; + :b :c5876; + :b :c5877; + :b :c5878; + :b :c5879; + :b :c5880; + :b :c5881; + :b :c5882; + :b :c5883; + :b :c5884; + :b :c5885; + :b :c5886; + :b :c5887; + :b :c5888; + :b :c5889; + :b :c5890; + :b :c5891; + :b :c5892; + :b :c5893; + :b :c5894; + :b :c5895; + :b :c5896; + :b :c5897; + :b :c5898; + :b :c5899; + :b :c5900; + :b :c5901; + :b :c5902; + :b :c5903; + :b :c5904; + :b :c5905; + :b :c5906; + :b :c5907; + :b :c5908; + :b :c5909; + :b :c5910; + :b :c5911; + :b :c5912; + :b :c5913; + :b :c5914; + :b :c5915; + :b :c5916; + :b :c5917; + :b :c5918; + :b :c5919; + :b :c5920; + :b :c5921; + :b :c5922; + :b :c5923; + :b :c5924; + :b :c5925; + :b :c5926; + :b :c5927; + :b :c5928; + :b :c5929; + :b :c5930; + :b :c5931; + :b :c5932; + :b :c5933; + :b :c5934; + :b :c5935; + :b :c5936; + :b :c5937; + :b :c5938; + :b :c5939; + :b :c5940; + :b :c5941; + :b :c5942; + :b :c5943; + :b :c5944; + :b :c5945; + :b :c5946; + :b :c5947; + :b :c5948; + :b :c5949; + :b :c5950; + :b :c5951; + :b :c5952; + :b :c5953; + :b :c5954; + :b :c5955; + :b :c5956; + :b :c5957; + :b :c5958; + :b :c5959; + :b :c5960; + :b :c5961; + :b :c5962; + :b :c5963; + :b :c5964; + :b :c5965; + :b :c5966; + :b :c5967; + :b :c5968; + :b :c5969; + :b :c5970; + :b :c5971; + :b :c5972; + :b :c5973; + :b :c5974; + :b :c5975; + :b :c5976; + :b :c5977; + :b :c5978; + :b :c5979; + :b :c5980; + :b :c5981; + :b :c5982; + :b :c5983; + :b :c5984; + :b :c5985; + :b :c5986; + :b :c5987; + :b :c5988; + :b :c5989; + :b :c5990; + :b :c5991; + :b :c5992; + :b :c5993; + :b :c5994; + :b :c5995; + :b :c5996; + :b :c5997; + :b :c5998; + :b :c5999; + :b :c6000; + :b :c6001; + :b :c6002; + :b :c6003; + :b :c6004; + :b :c6005; + :b :c6006; + :b :c6007; + :b :c6008; + :b :c6009; + :b :c6010; + :b :c6011; + :b :c6012; + :b :c6013; + :b :c6014; + :b :c6015; + :b :c6016; + :b :c6017; + :b :c6018; + :b :c6019; + :b :c6020; + :b :c6021; + :b :c6022; + :b :c6023; + :b :c6024; + :b :c6025; + :b :c6026; + :b :c6027; + :b :c6028; + :b :c6029; + :b :c6030; + :b :c6031; + :b :c6032; + :b :c6033; + :b :c6034; + :b :c6035; + :b :c6036; + :b :c6037; + :b :c6038; + :b :c6039; + :b :c6040; + :b :c6041; + :b :c6042; + :b :c6043; + :b :c6044; + :b :c6045; + :b :c6046; + :b :c6047; + :b :c6048; + :b :c6049; + :b :c6050; + :b :c6051; + :b :c6052; + :b :c6053; + :b :c6054; + :b :c6055; + :b :c6056; + :b :c6057; + :b :c6058; + :b :c6059; + :b :c6060; + :b :c6061; + :b :c6062; + :b :c6063; + :b :c6064; + :b :c6065; + :b :c6066; + :b :c6067; + :b :c6068; + :b :c6069; + :b :c6070; + :b :c6071; + :b :c6072; + :b :c6073; + :b :c6074; + :b :c6075; + :b :c6076; + :b :c6077; + :b :c6078; + :b :c6079; + :b :c6080; + :b :c6081; + :b :c6082; + :b :c6083; + :b :c6084; + :b :c6085; + :b :c6086; + :b :c6087; + :b :c6088; + :b :c6089; + :b :c6090; + :b :c6091; + :b :c6092; + :b :c6093; + :b :c6094; + :b :c6095; + :b :c6096; + :b :c6097; + :b :c6098; + :b :c6099; + :b :c6100; + :b :c6101; + :b :c6102; + :b :c6103; + :b :c6104; + :b :c6105; + :b :c6106; + :b :c6107; + :b :c6108; + :b :c6109; + :b :c6110; + :b :c6111; + :b :c6112; + :b :c6113; + :b :c6114; + :b :c6115; + :b :c6116; + :b :c6117; + :b :c6118; + :b :c6119; + :b :c6120; + :b :c6121; + :b :c6122; + :b :c6123; + :b :c6124; + :b :c6125; + :b :c6126; + :b :c6127; + :b :c6128; + :b :c6129; + :b :c6130; + :b :c6131; + :b :c6132; + :b :c6133; + :b :c6134; + :b :c6135; + :b :c6136; + :b :c6137; + :b :c6138; + :b :c6139; + :b :c6140; + :b :c6141; + :b :c6142; + :b :c6143; + :b :c6144; + :b :c6145; + :b :c6146; + :b :c6147; + :b :c6148; + :b :c6149; + :b :c6150; + :b :c6151; + :b :c6152; + :b :c6153; + :b :c6154; + :b :c6155; + :b :c6156; + :b :c6157; + :b :c6158; + :b :c6159; + :b :c6160; + :b :c6161; + :b :c6162; + :b :c6163; + :b :c6164; + :b :c6165; + :b :c6166; + :b :c6167; + :b :c6168; + :b :c6169; + :b :c6170; + :b :c6171; + :b :c6172; + :b :c6173; + :b :c6174; + :b :c6175; + :b :c6176; + :b :c6177; + :b :c6178; + :b :c6179; + :b :c6180; + :b :c6181; + :b :c6182; + :b :c6183; + :b :c6184; + :b :c6185; + :b :c6186; + :b :c6187; + :b :c6188; + :b :c6189; + :b :c6190; + :b :c6191; + :b :c6192; + :b :c6193; + :b :c6194; + :b :c6195; + :b :c6196; + :b :c6197; + :b :c6198; + :b :c6199; + :b :c6200; + :b :c6201; + :b :c6202; + :b :c6203; + :b :c6204; + :b :c6205; + :b :c6206; + :b :c6207; + :b :c6208; + :b :c6209; + :b :c6210; + :b :c6211; + :b :c6212; + :b :c6213; + :b :c6214; + :b :c6215; + :b :c6216; + :b :c6217; + :b :c6218; + :b :c6219; + :b :c6220; + :b :c6221; + :b :c6222; + :b :c6223; + :b :c6224; + :b :c6225; + :b :c6226; + :b :c6227; + :b :c6228; + :b :c6229; + :b :c6230; + :b :c6231; + :b :c6232; + :b :c6233; + :b :c6234; + :b :c6235; + :b :c6236; + :b :c6237; + :b :c6238; + :b :c6239; + :b :c6240; + :b :c6241; + :b :c6242; + :b :c6243; + :b :c6244; + :b :c6245; + :b :c6246; + :b :c6247; + :b :c6248; + :b :c6249; + :b :c6250; + :b :c6251; + :b :c6252; + :b :c6253; + :b :c6254; + :b :c6255; + :b :c6256; + :b :c6257; + :b :c6258; + :b :c6259; + :b :c6260; + :b :c6261; + :b :c6262; + :b :c6263; + :b :c6264; + :b :c6265; + :b :c6266; + :b :c6267; + :b :c6268; + :b :c6269; + :b :c6270; + :b :c6271; + :b :c6272; + :b :c6273; + :b :c6274; + :b :c6275; + :b :c6276; + :b :c6277; + :b :c6278; + :b :c6279; + :b :c6280; + :b :c6281; + :b :c6282; + :b :c6283; + :b :c6284; + :b :c6285; + :b :c6286; + :b :c6287; + :b :c6288; + :b :c6289; + :b :c6290; + :b :c6291; + :b :c6292; + :b :c6293; + :b :c6294; + :b :c6295; + :b :c6296; + :b :c6297; + :b :c6298; + :b :c6299; + :b :c6300; + :b :c6301; + :b :c6302; + :b :c6303; + :b :c6304; + :b :c6305; + :b :c6306; + :b :c6307; + :b :c6308; + :b :c6309; + :b :c6310; + :b :c6311; + :b :c6312; + :b :c6313; + :b :c6314; + :b :c6315; + :b :c6316; + :b :c6317; + :b :c6318; + :b :c6319; + :b :c6320; + :b :c6321; + :b :c6322; + :b :c6323; + :b :c6324; + :b :c6325; + :b :c6326; + :b :c6327; + :b :c6328; + :b :c6329; + :b :c6330; + :b :c6331; + :b :c6332; + :b :c6333; + :b :c6334; + :b :c6335; + :b :c6336; + :b :c6337; + :b :c6338; + :b :c6339; + :b :c6340; + :b :c6341; + :b :c6342; + :b :c6343; + :b :c6344; + :b :c6345; + :b :c6346; + :b :c6347; + :b :c6348; + :b :c6349; + :b :c6350; + :b :c6351; + :b :c6352; + :b :c6353; + :b :c6354; + :b :c6355; + :b :c6356; + :b :c6357; + :b :c6358; + :b :c6359; + :b :c6360; + :b :c6361; + :b :c6362; + :b :c6363; + :b :c6364; + :b :c6365; + :b :c6366; + :b :c6367; + :b :c6368; + :b :c6369; + :b :c6370; + :b :c6371; + :b :c6372; + :b :c6373; + :b :c6374; + :b :c6375; + :b :c6376; + :b :c6377; + :b :c6378; + :b :c6379; + :b :c6380; + :b :c6381; + :b :c6382; + :b :c6383; + :b :c6384; + :b :c6385; + :b :c6386; + :b :c6387; + :b :c6388; + :b :c6389; + :b :c6390; + :b :c6391; + :b :c6392; + :b :c6393; + :b :c6394; + :b :c6395; + :b :c6396; + :b :c6397; + :b :c6398; + :b :c6399; + :b :c6400; + :b :c6401; + :b :c6402; + :b :c6403; + :b :c6404; + :b :c6405; + :b :c6406; + :b :c6407; + :b :c6408; + :b :c6409; + :b :c6410; + :b :c6411; + :b :c6412; + :b :c6413; + :b :c6414; + :b :c6415; + :b :c6416; + :b :c6417; + :b :c6418; + :b :c6419; + :b :c6420; + :b :c6421; + :b :c6422; + :b :c6423; + :b :c6424; + :b :c6425; + :b :c6426; + :b :c6427; + :b :c6428; + :b :c6429; + :b :c6430; + :b :c6431; + :b :c6432; + :b :c6433; + :b :c6434; + :b :c6435; + :b :c6436; + :b :c6437; + :b :c6438; + :b :c6439; + :b :c6440; + :b :c6441; + :b :c6442; + :b :c6443; + :b :c6444; + :b :c6445; + :b :c6446; + :b :c6447; + :b :c6448; + :b :c6449; + :b :c6450; + :b :c6451; + :b :c6452; + :b :c6453; + :b :c6454; + :b :c6455; + :b :c6456; + :b :c6457; + :b :c6458; + :b :c6459; + :b :c6460; + :b :c6461; + :b :c6462; + :b :c6463; + :b :c6464; + :b :c6465; + :b :c6466; + :b :c6467; + :b :c6468; + :b :c6469; + :b :c6470; + :b :c6471; + :b :c6472; + :b :c6473; + :b :c6474; + :b :c6475; + :b :c6476; + :b :c6477; + :b :c6478; + :b :c6479; + :b :c6480; + :b :c6481; + :b :c6482; + :b :c6483; + :b :c6484; + :b :c6485; + :b :c6486; + :b :c6487; + :b :c6488; + :b :c6489; + :b :c6490; + :b :c6491; + :b :c6492; + :b :c6493; + :b :c6494; + :b :c6495; + :b :c6496; + :b :c6497; + :b :c6498; + :b :c6499; + :b :c6500; + :b :c6501; + :b :c6502; + :b :c6503; + :b :c6504; + :b :c6505; + :b :c6506; + :b :c6507; + :b :c6508; + :b :c6509; + :b :c6510; + :b :c6511; + :b :c6512; + :b :c6513; + :b :c6514; + :b :c6515; + :b :c6516; + :b :c6517; + :b :c6518; + :b :c6519; + :b :c6520; + :b :c6521; + :b :c6522; + :b :c6523; + :b :c6524; + :b :c6525; + :b :c6526; + :b :c6527; + :b :c6528; + :b :c6529; + :b :c6530; + :b :c6531; + :b :c6532; + :b :c6533; + :b :c6534; + :b :c6535; + :b :c6536; + :b :c6537; + :b :c6538; + :b :c6539; + :b :c6540; + :b :c6541; + :b :c6542; + :b :c6543; + :b :c6544; + :b :c6545; + :b :c6546; + :b :c6547; + :b :c6548; + :b :c6549; + :b :c6550; + :b :c6551; + :b :c6552; + :b :c6553; + :b :c6554; + :b :c6555; + :b :c6556; + :b :c6557; + :b :c6558; + :b :c6559; + :b :c6560; + :b :c6561; + :b :c6562; + :b :c6563; + :b :c6564; + :b :c6565; + :b :c6566; + :b :c6567; + :b :c6568; + :b :c6569; + :b :c6570; + :b :c6571; + :b :c6572; + :b :c6573; + :b :c6574; + :b :c6575; + :b :c6576; + :b :c6577; + :b :c6578; + :b :c6579; + :b :c6580; + :b :c6581; + :b :c6582; + :b :c6583; + :b :c6584; + :b :c6585; + :b :c6586; + :b :c6587; + :b :c6588; + :b :c6589; + :b :c6590; + :b :c6591; + :b :c6592; + :b :c6593; + :b :c6594; + :b :c6595; + :b :c6596; + :b :c6597; + :b :c6598; + :b :c6599; + :b :c6600; + :b :c6601; + :b :c6602; + :b :c6603; + :b :c6604; + :b :c6605; + :b :c6606; + :b :c6607; + :b :c6608; + :b :c6609; + :b :c6610; + :b :c6611; + :b :c6612; + :b :c6613; + :b :c6614; + :b :c6615; + :b :c6616; + :b :c6617; + :b :c6618; + :b :c6619; + :b :c6620; + :b :c6621; + :b :c6622; + :b :c6623; + :b :c6624; + :b :c6625; + :b :c6626; + :b :c6627; + :b :c6628; + :b :c6629; + :b :c6630; + :b :c6631; + :b :c6632; + :b :c6633; + :b :c6634; + :b :c6635; + :b :c6636; + :b :c6637; + :b :c6638; + :b :c6639; + :b :c6640; + :b :c6641; + :b :c6642; + :b :c6643; + :b :c6644; + :b :c6645; + :b :c6646; + :b :c6647; + :b :c6648; + :b :c6649; + :b :c6650; + :b :c6651; + :b :c6652; + :b :c6653; + :b :c6654; + :b :c6655; + :b :c6656; + :b :c6657; + :b :c6658; + :b :c6659; + :b :c6660; + :b :c6661; + :b :c6662; + :b :c6663; + :b :c6664; + :b :c6665; + :b :c6666; + :b :c6667; + :b :c6668; + :b :c6669; + :b :c6670; + :b :c6671; + :b :c6672; + :b :c6673; + :b :c6674; + :b :c6675; + :b :c6676; + :b :c6677; + :b :c6678; + :b :c6679; + :b :c6680; + :b :c6681; + :b :c6682; + :b :c6683; + :b :c6684; + :b :c6685; + :b :c6686; + :b :c6687; + :b :c6688; + :b :c6689; + :b :c6690; + :b :c6691; + :b :c6692; + :b :c6693; + :b :c6694; + :b :c6695; + :b :c6696; + :b :c6697; + :b :c6698; + :b :c6699; + :b :c6700; + :b :c6701; + :b :c6702; + :b :c6703; + :b :c6704; + :b :c6705; + :b :c6706; + :b :c6707; + :b :c6708; + :b :c6709; + :b :c6710; + :b :c6711; + :b :c6712; + :b :c6713; + :b :c6714; + :b :c6715; + :b :c6716; + :b :c6717; + :b :c6718; + :b :c6719; + :b :c6720; + :b :c6721; + :b :c6722; + :b :c6723; + :b :c6724; + :b :c6725; + :b :c6726; + :b :c6727; + :b :c6728; + :b :c6729; + :b :c6730; + :b :c6731; + :b :c6732; + :b :c6733; + :b :c6734; + :b :c6735; + :b :c6736; + :b :c6737; + :b :c6738; + :b :c6739; + :b :c6740; + :b :c6741; + :b :c6742; + :b :c6743; + :b :c6744; + :b :c6745; + :b :c6746; + :b :c6747; + :b :c6748; + :b :c6749; + :b :c6750; + :b :c6751; + :b :c6752; + :b :c6753; + :b :c6754; + :b :c6755; + :b :c6756; + :b :c6757; + :b :c6758; + :b :c6759; + :b :c6760; + :b :c6761; + :b :c6762; + :b :c6763; + :b :c6764; + :b :c6765; + :b :c6766; + :b :c6767; + :b :c6768; + :b :c6769; + :b :c6770; + :b :c6771; + :b :c6772; + :b :c6773; + :b :c6774; + :b :c6775; + :b :c6776; + :b :c6777; + :b :c6778; + :b :c6779; + :b :c6780; + :b :c6781; + :b :c6782; + :b :c6783; + :b :c6784; + :b :c6785; + :b :c6786; + :b :c6787; + :b :c6788; + :b :c6789; + :b :c6790; + :b :c6791; + :b :c6792; + :b :c6793; + :b :c6794; + :b :c6795; + :b :c6796; + :b :c6797; + :b :c6798; + :b :c6799; + :b :c6800; + :b :c6801; + :b :c6802; + :b :c6803; + :b :c6804; + :b :c6805; + :b :c6806; + :b :c6807; + :b :c6808; + :b :c6809; + :b :c6810; + :b :c6811; + :b :c6812; + :b :c6813; + :b :c6814; + :b :c6815; + :b :c6816; + :b :c6817; + :b :c6818; + :b :c6819; + :b :c6820; + :b :c6821; + :b :c6822; + :b :c6823; + :b :c6824; + :b :c6825; + :b :c6826; + :b :c6827; + :b :c6828; + :b :c6829; + :b :c6830; + :b :c6831; + :b :c6832; + :b :c6833; + :b :c6834; + :b :c6835; + :b :c6836; + :b :c6837; + :b :c6838; + :b :c6839; + :b :c6840; + :b :c6841; + :b :c6842; + :b :c6843; + :b :c6844; + :b :c6845; + :b :c6846; + :b :c6847; + :b :c6848; + :b :c6849; + :b :c6850; + :b :c6851; + :b :c6852; + :b :c6853; + :b :c6854; + :b :c6855; + :b :c6856; + :b :c6857; + :b :c6858; + :b :c6859; + :b :c6860; + :b :c6861; + :b :c6862; + :b :c6863; + :b :c6864; + :b :c6865; + :b :c6866; + :b :c6867; + :b :c6868; + :b :c6869; + :b :c6870; + :b :c6871; + :b :c6872; + :b :c6873; + :b :c6874; + :b :c6875; + :b :c6876; + :b :c6877; + :b :c6878; + :b :c6879; + :b :c6880; + :b :c6881; + :b :c6882; + :b :c6883; + :b :c6884; + :b :c6885; + :b :c6886; + :b :c6887; + :b :c6888; + :b :c6889; + :b :c6890; + :b :c6891; + :b :c6892; + :b :c6893; + :b :c6894; + :b :c6895; + :b :c6896; + :b :c6897; + :b :c6898; + :b :c6899; + :b :c6900; + :b :c6901; + :b :c6902; + :b :c6903; + :b :c6904; + :b :c6905; + :b :c6906; + :b :c6907; + :b :c6908; + :b :c6909; + :b :c6910; + :b :c6911; + :b :c6912; + :b :c6913; + :b :c6914; + :b :c6915; + :b :c6916; + :b :c6917; + :b :c6918; + :b :c6919; + :b :c6920; + :b :c6921; + :b :c6922; + :b :c6923; + :b :c6924; + :b :c6925; + :b :c6926; + :b :c6927; + :b :c6928; + :b :c6929; + :b :c6930; + :b :c6931; + :b :c6932; + :b :c6933; + :b :c6934; + :b :c6935; + :b :c6936; + :b :c6937; + :b :c6938; + :b :c6939; + :b :c6940; + :b :c6941; + :b :c6942; + :b :c6943; + :b :c6944; + :b :c6945; + :b :c6946; + :b :c6947; + :b :c6948; + :b :c6949; + :b :c6950; + :b :c6951; + :b :c6952; + :b :c6953; + :b :c6954; + :b :c6955; + :b :c6956; + :b :c6957; + :b :c6958; + :b :c6959; + :b :c6960; + :b :c6961; + :b :c6962; + :b :c6963; + :b :c6964; + :b :c6965; + :b :c6966; + :b :c6967; + :b :c6968; + :b :c6969; + :b :c6970; + :b :c6971; + :b :c6972; + :b :c6973; + :b :c6974; + :b :c6975; + :b :c6976; + :b :c6977; + :b :c6978; + :b :c6979; + :b :c6980; + :b :c6981; + :b :c6982; + :b :c6983; + :b :c6984; + :b :c6985; + :b :c6986; + :b :c6987; + :b :c6988; + :b :c6989; + :b :c6990; + :b :c6991; + :b :c6992; + :b :c6993; + :b :c6994; + :b :c6995; + :b :c6996; + :b :c6997; + :b :c6998; + :b :c6999; + :b :c7000; + :b :c7001; + :b :c7002; + :b :c7003; + :b :c7004; + :b :c7005; + :b :c7006; + :b :c7007; + :b :c7008; + :b :c7009; + :b :c7010; + :b :c7011; + :b :c7012; + :b :c7013; + :b :c7014; + :b :c7015; + :b :c7016; + :b :c7017; + :b :c7018; + :b :c7019; + :b :c7020; + :b :c7021; + :b :c7022; + :b :c7023; + :b :c7024; + :b :c7025; + :b :c7026; + :b :c7027; + :b :c7028; + :b :c7029; + :b :c7030; + :b :c7031; + :b :c7032; + :b :c7033; + :b :c7034; + :b :c7035; + :b :c7036; + :b :c7037; + :b :c7038; + :b :c7039; + :b :c7040; + :b :c7041; + :b :c7042; + :b :c7043; + :b :c7044; + :b :c7045; + :b :c7046; + :b :c7047; + :b :c7048; + :b :c7049; + :b :c7050; + :b :c7051; + :b :c7052; + :b :c7053; + :b :c7054; + :b :c7055; + :b :c7056; + :b :c7057; + :b :c7058; + :b :c7059; + :b :c7060; + :b :c7061; + :b :c7062; + :b :c7063; + :b :c7064; + :b :c7065; + :b :c7066; + :b :c7067; + :b :c7068; + :b :c7069; + :b :c7070; + :b :c7071; + :b :c7072; + :b :c7073; + :b :c7074; + :b :c7075; + :b :c7076; + :b :c7077; + :b :c7078; + :b :c7079; + :b :c7080; + :b :c7081; + :b :c7082; + :b :c7083; + :b :c7084; + :b :c7085; + :b :c7086; + :b :c7087; + :b :c7088; + :b :c7089; + :b :c7090; + :b :c7091; + :b :c7092; + :b :c7093; + :b :c7094; + :b :c7095; + :b :c7096; + :b :c7097; + :b :c7098; + :b :c7099; + :b :c7100; + :b :c7101; + :b :c7102; + :b :c7103; + :b :c7104; + :b :c7105; + :b :c7106; + :b :c7107; + :b :c7108; + :b :c7109; + :b :c7110; + :b :c7111; + :b :c7112; + :b :c7113; + :b :c7114; + :b :c7115; + :b :c7116; + :b :c7117; + :b :c7118; + :b :c7119; + :b :c7120; + :b :c7121; + :b :c7122; + :b :c7123; + :b :c7124; + :b :c7125; + :b :c7126; + :b :c7127; + :b :c7128; + :b :c7129; + :b :c7130; + :b :c7131; + :b :c7132; + :b :c7133; + :b :c7134; + :b :c7135; + :b :c7136; + :b :c7137; + :b :c7138; + :b :c7139; + :b :c7140; + :b :c7141; + :b :c7142; + :b :c7143; + :b :c7144; + :b :c7145; + :b :c7146; + :b :c7147; + :b :c7148; + :b :c7149; + :b :c7150; + :b :c7151; + :b :c7152; + :b :c7153; + :b :c7154; + :b :c7155; + :b :c7156; + :b :c7157; + :b :c7158; + :b :c7159; + :b :c7160; + :b :c7161; + :b :c7162; + :b :c7163; + :b :c7164; + :b :c7165; + :b :c7166; + :b :c7167; + :b :c7168; + :b :c7169; + :b :c7170; + :b :c7171; + :b :c7172; + :b :c7173; + :b :c7174; + :b :c7175; + :b :c7176; + :b :c7177; + :b :c7178; + :b :c7179; + :b :c7180; + :b :c7181; + :b :c7182; + :b :c7183; + :b :c7184; + :b :c7185; + :b :c7186; + :b :c7187; + :b :c7188; + :b :c7189; + :b :c7190; + :b :c7191; + :b :c7192; + :b :c7193; + :b :c7194; + :b :c7195; + :b :c7196; + :b :c7197; + :b :c7198; + :b :c7199; + :b :c7200; + :b :c7201; + :b :c7202; + :b :c7203; + :b :c7204; + :b :c7205; + :b :c7206; + :b :c7207; + :b :c7208; + :b :c7209; + :b :c7210; + :b :c7211; + :b :c7212; + :b :c7213; + :b :c7214; + :b :c7215; + :b :c7216; + :b :c7217; + :b :c7218; + :b :c7219; + :b :c7220; + :b :c7221; + :b :c7222; + :b :c7223; + :b :c7224; + :b :c7225; + :b :c7226; + :b :c7227; + :b :c7228; + :b :c7229; + :b :c7230; + :b :c7231; + :b :c7232; + :b :c7233; + :b :c7234; + :b :c7235; + :b :c7236; + :b :c7237; + :b :c7238; + :b :c7239; + :b :c7240; + :b :c7241; + :b :c7242; + :b :c7243; + :b :c7244; + :b :c7245; + :b :c7246; + :b :c7247; + :b :c7248; + :b :c7249; + :b :c7250; + :b :c7251; + :b :c7252; + :b :c7253; + :b :c7254; + :b :c7255; + :b :c7256; + :b :c7257; + :b :c7258; + :b :c7259; + :b :c7260; + :b :c7261; + :b :c7262; + :b :c7263; + :b :c7264; + :b :c7265; + :b :c7266; + :b :c7267; + :b :c7268; + :b :c7269; + :b :c7270; + :b :c7271; + :b :c7272; + :b :c7273; + :b :c7274; + :b :c7275; + :b :c7276; + :b :c7277; + :b :c7278; + :b :c7279; + :b :c7280; + :b :c7281; + :b :c7282; + :b :c7283; + :b :c7284; + :b :c7285; + :b :c7286; + :b :c7287; + :b :c7288; + :b :c7289; + :b :c7290; + :b :c7291; + :b :c7292; + :b :c7293; + :b :c7294; + :b :c7295; + :b :c7296; + :b :c7297; + :b :c7298; + :b :c7299; + :b :c7300; + :b :c7301; + :b :c7302; + :b :c7303; + :b :c7304; + :b :c7305; + :b :c7306; + :b :c7307; + :b :c7308; + :b :c7309; + :b :c7310; + :b :c7311; + :b :c7312; + :b :c7313; + :b :c7314; + :b :c7315; + :b :c7316; + :b :c7317; + :b :c7318; + :b :c7319; + :b :c7320; + :b :c7321; + :b :c7322; + :b :c7323; + :b :c7324; + :b :c7325; + :b :c7326; + :b :c7327; + :b :c7328; + :b :c7329; + :b :c7330; + :b :c7331; + :b :c7332; + :b :c7333; + :b :c7334; + :b :c7335; + :b :c7336; + :b :c7337; + :b :c7338; + :b :c7339; + :b :c7340; + :b :c7341; + :b :c7342; + :b :c7343; + :b :c7344; + :b :c7345; + :b :c7346; + :b :c7347; + :b :c7348; + :b :c7349; + :b :c7350; + :b :c7351; + :b :c7352; + :b :c7353; + :b :c7354; + :b :c7355; + :b :c7356; + :b :c7357; + :b :c7358; + :b :c7359; + :b :c7360; + :b :c7361; + :b :c7362; + :b :c7363; + :b :c7364; + :b :c7365; + :b :c7366; + :b :c7367; + :b :c7368; + :b :c7369; + :b :c7370; + :b :c7371; + :b :c7372; + :b :c7373; + :b :c7374; + :b :c7375; + :b :c7376; + :b :c7377; + :b :c7378; + :b :c7379; + :b :c7380; + :b :c7381; + :b :c7382; + :b :c7383; + :b :c7384; + :b :c7385; + :b :c7386; + :b :c7387; + :b :c7388; + :b :c7389; + :b :c7390; + :b :c7391; + :b :c7392; + :b :c7393; + :b :c7394; + :b :c7395; + :b :c7396; + :b :c7397; + :b :c7398; + :b :c7399; + :b :c7400; + :b :c7401; + :b :c7402; + :b :c7403; + :b :c7404; + :b :c7405; + :b :c7406; + :b :c7407; + :b :c7408; + :b :c7409; + :b :c7410; + :b :c7411; + :b :c7412; + :b :c7413; + :b :c7414; + :b :c7415; + :b :c7416; + :b :c7417; + :b :c7418; + :b :c7419; + :b :c7420; + :b :c7421; + :b :c7422; + :b :c7423; + :b :c7424; + :b :c7425; + :b :c7426; + :b :c7427; + :b :c7428; + :b :c7429; + :b :c7430; + :b :c7431; + :b :c7432; + :b :c7433; + :b :c7434; + :b :c7435; + :b :c7436; + :b :c7437; + :b :c7438; + :b :c7439; + :b :c7440; + :b :c7441; + :b :c7442; + :b :c7443; + :b :c7444; + :b :c7445; + :b :c7446; + :b :c7447; + :b :c7448; + :b :c7449; + :b :c7450; + :b :c7451; + :b :c7452; + :b :c7453; + :b :c7454; + :b :c7455; + :b :c7456; + :b :c7457; + :b :c7458; + :b :c7459; + :b :c7460; + :b :c7461; + :b :c7462; + :b :c7463; + :b :c7464; + :b :c7465; + :b :c7466; + :b :c7467; + :b :c7468; + :b :c7469; + :b :c7470; + :b :c7471; + :b :c7472; + :b :c7473; + :b :c7474; + :b :c7475; + :b :c7476; + :b :c7477; + :b :c7478; + :b :c7479; + :b :c7480; + :b :c7481; + :b :c7482; + :b :c7483; + :b :c7484; + :b :c7485; + :b :c7486; + :b :c7487; + :b :c7488; + :b :c7489; + :b :c7490; + :b :c7491; + :b :c7492; + :b :c7493; + :b :c7494; + :b :c7495; + :b :c7496; + :b :c7497; + :b :c7498; + :b :c7499; + :b :c7500; + :b :c7501; + :b :c7502; + :b :c7503; + :b :c7504; + :b :c7505; + :b :c7506; + :b :c7507; + :b :c7508; + :b :c7509; + :b :c7510; + :b :c7511; + :b :c7512; + :b :c7513; + :b :c7514; + :b :c7515; + :b :c7516; + :b :c7517; + :b :c7518; + :b :c7519; + :b :c7520; + :b :c7521; + :b :c7522; + :b :c7523; + :b :c7524; + :b :c7525; + :b :c7526; + :b :c7527; + :b :c7528; + :b :c7529; + :b :c7530; + :b :c7531; + :b :c7532; + :b :c7533; + :b :c7534; + :b :c7535; + :b :c7536; + :b :c7537; + :b :c7538; + :b :c7539; + :b :c7540; + :b :c7541; + :b :c7542; + :b :c7543; + :b :c7544; + :b :c7545; + :b :c7546; + :b :c7547; + :b :c7548; + :b :c7549; + :b :c7550; + :b :c7551; + :b :c7552; + :b :c7553; + :b :c7554; + :b :c7555; + :b :c7556; + :b :c7557; + :b :c7558; + :b :c7559; + :b :c7560; + :b :c7561; + :b :c7562; + :b :c7563; + :b :c7564; + :b :c7565; + :b :c7566; + :b :c7567; + :b :c7568; + :b :c7569; + :b :c7570; + :b :c7571; + :b :c7572; + :b :c7573; + :b :c7574; + :b :c7575; + :b :c7576; + :b :c7577; + :b :c7578; + :b :c7579; + :b :c7580; + :b :c7581; + :b :c7582; + :b :c7583; + :b :c7584; + :b :c7585; + :b :c7586; + :b :c7587; + :b :c7588; + :b :c7589; + :b :c7590; + :b :c7591; + :b :c7592; + :b :c7593; + :b :c7594; + :b :c7595; + :b :c7596; + :b :c7597; + :b :c7598; + :b :c7599; + :b :c7600; + :b :c7601; + :b :c7602; + :b :c7603; + :b :c7604; + :b :c7605; + :b :c7606; + :b :c7607; + :b :c7608; + :b :c7609; + :b :c7610; + :b :c7611; + :b :c7612; + :b :c7613; + :b :c7614; + :b :c7615; + :b :c7616; + :b :c7617; + :b :c7618; + :b :c7619; + :b :c7620; + :b :c7621; + :b :c7622; + :b :c7623; + :b :c7624; + :b :c7625; + :b :c7626; + :b :c7627; + :b :c7628; + :b :c7629; + :b :c7630; + :b :c7631; + :b :c7632; + :b :c7633; + :b :c7634; + :b :c7635; + :b :c7636; + :b :c7637; + :b :c7638; + :b :c7639; + :b :c7640; + :b :c7641; + :b :c7642; + :b :c7643; + :b :c7644; + :b :c7645; + :b :c7646; + :b :c7647; + :b :c7648; + :b :c7649; + :b :c7650; + :b :c7651; + :b :c7652; + :b :c7653; + :b :c7654; + :b :c7655; + :b :c7656; + :b :c7657; + :b :c7658; + :b :c7659; + :b :c7660; + :b :c7661; + :b :c7662; + :b :c7663; + :b :c7664; + :b :c7665; + :b :c7666; + :b :c7667; + :b :c7668; + :b :c7669; + :b :c7670; + :b :c7671; + :b :c7672; + :b :c7673; + :b :c7674; + :b :c7675; + :b :c7676; + :b :c7677; + :b :c7678; + :b :c7679; + :b :c7680; + :b :c7681; + :b :c7682; + :b :c7683; + :b :c7684; + :b :c7685; + :b :c7686; + :b :c7687; + :b :c7688; + :b :c7689; + :b :c7690; + :b :c7691; + :b :c7692; + :b :c7693; + :b :c7694; + :b :c7695; + :b :c7696; + :b :c7697; + :b :c7698; + :b :c7699; + :b :c7700; + :b :c7701; + :b :c7702; + :b :c7703; + :b :c7704; + :b :c7705; + :b :c7706; + :b :c7707; + :b :c7708; + :b :c7709; + :b :c7710; + :b :c7711; + :b :c7712; + :b :c7713; + :b :c7714; + :b :c7715; + :b :c7716; + :b :c7717; + :b :c7718; + :b :c7719; + :b :c7720; + :b :c7721; + :b :c7722; + :b :c7723; + :b :c7724; + :b :c7725; + :b :c7726; + :b :c7727; + :b :c7728; + :b :c7729; + :b :c7730; + :b :c7731; + :b :c7732; + :b :c7733; + :b :c7734; + :b :c7735; + :b :c7736; + :b :c7737; + :b :c7738; + :b :c7739; + :b :c7740; + :b :c7741; + :b :c7742; + :b :c7743; + :b :c7744; + :b :c7745; + :b :c7746; + :b :c7747; + :b :c7748; + :b :c7749; + :b :c7750; + :b :c7751; + :b :c7752; + :b :c7753; + :b :c7754; + :b :c7755; + :b :c7756; + :b :c7757; + :b :c7758; + :b :c7759; + :b :c7760; + :b :c7761; + :b :c7762; + :b :c7763; + :b :c7764; + :b :c7765; + :b :c7766; + :b :c7767; + :b :c7768; + :b :c7769; + :b :c7770; + :b :c7771; + :b :c7772; + :b :c7773; + :b :c7774; + :b :c7775; + :b :c7776; + :b :c7777; + :b :c7778; + :b :c7779; + :b :c7780; + :b :c7781; + :b :c7782; + :b :c7783; + :b :c7784; + :b :c7785; + :b :c7786; + :b :c7787; + :b :c7788; + :b :c7789; + :b :c7790; + :b :c7791; + :b :c7792; + :b :c7793; + :b :c7794; + :b :c7795; + :b :c7796; + :b :c7797; + :b :c7798; + :b :c7799; + :b :c7800; + :b :c7801; + :b :c7802; + :b :c7803; + :b :c7804; + :b :c7805; + :b :c7806; + :b :c7807; + :b :c7808; + :b :c7809; + :b :c7810; + :b :c7811; + :b :c7812; + :b :c7813; + :b :c7814; + :b :c7815; + :b :c7816; + :b :c7817; + :b :c7818; + :b :c7819; + :b :c7820; + :b :c7821; + :b :c7822; + :b :c7823; + :b :c7824; + :b :c7825; + :b :c7826; + :b :c7827; + :b :c7828; + :b :c7829; + :b :c7830; + :b :c7831; + :b :c7832; + :b :c7833; + :b :c7834; + :b :c7835; + :b :c7836; + :b :c7837; + :b :c7838; + :b :c7839; + :b :c7840; + :b :c7841; + :b :c7842; + :b :c7843; + :b :c7844; + :b :c7845; + :b :c7846; + :b :c7847; + :b :c7848; + :b :c7849; + :b :c7850; + :b :c7851; + :b :c7852; + :b :c7853; + :b :c7854; + :b :c7855; + :b :c7856; + :b :c7857; + :b :c7858; + :b :c7859; + :b :c7860; + :b :c7861; + :b :c7862; + :b :c7863; + :b :c7864; + :b :c7865; + :b :c7866; + :b :c7867; + :b :c7868; + :b :c7869; + :b :c7870; + :b :c7871; + :b :c7872; + :b :c7873; + :b :c7874; + :b :c7875; + :b :c7876; + :b :c7877; + :b :c7878; + :b :c7879; + :b :c7880; + :b :c7881; + :b :c7882; + :b :c7883; + :b :c7884; + :b :c7885; + :b :c7886; + :b :c7887; + :b :c7888; + :b :c7889; + :b :c7890; + :b :c7891; + :b :c7892; + :b :c7893; + :b :c7894; + :b :c7895; + :b :c7896; + :b :c7897; + :b :c7898; + :b :c7899; + :b :c7900; + :b :c7901; + :b :c7902; + :b :c7903; + :b :c7904; + :b :c7905; + :b :c7906; + :b :c7907; + :b :c7908; + :b :c7909; + :b :c7910; + :b :c7911; + :b :c7912; + :b :c7913; + :b :c7914; + :b :c7915; + :b :c7916; + :b :c7917; + :b :c7918; + :b :c7919; + :b :c7920; + :b :c7921; + :b :c7922; + :b :c7923; + :b :c7924; + :b :c7925; + :b :c7926; + :b :c7927; + :b :c7928; + :b :c7929; + :b :c7930; + :b :c7931; + :b :c7932; + :b :c7933; + :b :c7934; + :b :c7935; + :b :c7936; + :b :c7937; + :b :c7938; + :b :c7939; + :b :c7940; + :b :c7941; + :b :c7942; + :b :c7943; + :b :c7944; + :b :c7945; + :b :c7946; + :b :c7947; + :b :c7948; + :b :c7949; + :b :c7950; + :b :c7951; + :b :c7952; + :b :c7953; + :b :c7954; + :b :c7955; + :b :c7956; + :b :c7957; + :b :c7958; + :b :c7959; + :b :c7960; + :b :c7961; + :b :c7962; + :b :c7963; + :b :c7964; + :b :c7965; + :b :c7966; + :b :c7967; + :b :c7968; + :b :c7969; + :b :c7970; + :b :c7971; + :b :c7972; + :b :c7973; + :b :c7974; + :b :c7975; + :b :c7976; + :b :c7977; + :b :c7978; + :b :c7979; + :b :c7980; + :b :c7981; + :b :c7982; + :b :c7983; + :b :c7984; + :b :c7985; + :b :c7986; + :b :c7987; + :b :c7988; + :b :c7989; + :b :c7990; + :b :c7991; + :b :c7992; + :b :c7993; + :b :c7994; + :b :c7995; + :b :c7996; + :b :c7997; + :b :c7998; + :b :c7999; + :b :c8000; + :b :c8001; + :b :c8002; + :b :c8003; + :b :c8004; + :b :c8005; + :b :c8006; + :b :c8007; + :b :c8008; + :b :c8009; + :b :c8010; + :b :c8011; + :b :c8012; + :b :c8013; + :b :c8014; + :b :c8015; + :b :c8016; + :b :c8017; + :b :c8018; + :b :c8019; + :b :c8020; + :b :c8021; + :b :c8022; + :b :c8023; + :b :c8024; + :b :c8025; + :b :c8026; + :b :c8027; + :b :c8028; + :b :c8029; + :b :c8030; + :b :c8031; + :b :c8032; + :b :c8033; + :b :c8034; + :b :c8035; + :b :c8036; + :b :c8037; + :b :c8038; + :b :c8039; + :b :c8040; + :b :c8041; + :b :c8042; + :b :c8043; + :b :c8044; + :b :c8045; + :b :c8046; + :b :c8047; + :b :c8048; + :b :c8049; + :b :c8050; + :b :c8051; + :b :c8052; + :b :c8053; + :b :c8054; + :b :c8055; + :b :c8056; + :b :c8057; + :b :c8058; + :b :c8059; + :b :c8060; + :b :c8061; + :b :c8062; + :b :c8063; + :b :c8064; + :b :c8065; + :b :c8066; + :b :c8067; + :b :c8068; + :b :c8069; + :b :c8070; + :b :c8071; + :b :c8072; + :b :c8073; + :b :c8074; + :b :c8075; + :b :c8076; + :b :c8077; + :b :c8078; + :b :c8079; + :b :c8080; + :b :c8081; + :b :c8082; + :b :c8083; + :b :c8084; + :b :c8085; + :b :c8086; + :b :c8087; + :b :c8088; + :b :c8089; + :b :c8090; + :b :c8091; + :b :c8092; + :b :c8093; + :b :c8094; + :b :c8095; + :b :c8096; + :b :c8097; + :b :c8098; + :b :c8099; + :b :c8100; + :b :c8101; + :b :c8102; + :b :c8103; + :b :c8104; + :b :c8105; + :b :c8106; + :b :c8107; + :b :c8108; + :b :c8109; + :b :c8110; + :b :c8111; + :b :c8112; + :b :c8113; + :b :c8114; + :b :c8115; + :b :c8116; + :b :c8117; + :b :c8118; + :b :c8119; + :b :c8120; + :b :c8121; + :b :c8122; + :b :c8123; + :b :c8124; + :b :c8125; + :b :c8126; + :b :c8127; + :b :c8128; + :b :c8129; + :b :c8130; + :b :c8131; + :b :c8132; + :b :c8133; + :b :c8134; + :b :c8135; + :b :c8136; + :b :c8137; + :b :c8138; + :b :c8139; + :b :c8140; + :b :c8141; + :b :c8142; + :b :c8143; + :b :c8144; + :b :c8145; + :b :c8146; + :b :c8147; + :b :c8148; + :b :c8149; + :b :c8150; + :b :c8151; + :b :c8152; + :b :c8153; + :b :c8154; + :b :c8155; + :b :c8156; + :b :c8157; + :b :c8158; + :b :c8159; + :b :c8160; + :b :c8161; + :b :c8162; + :b :c8163; + :b :c8164; + :b :c8165; + :b :c8166; + :b :c8167; + :b :c8168; + :b :c8169; + :b :c8170; + :b :c8171; + :b :c8172; + :b :c8173; + :b :c8174; + :b :c8175; + :b :c8176; + :b :c8177; + :b :c8178; + :b :c8179; + :b :c8180; + :b :c8181; + :b :c8182; + :b :c8183; + :b :c8184; + :b :c8185; + :b :c8186; + :b :c8187; + :b :c8188; + :b :c8189; + :b :c8190; + :b :c8191; + :b :c8192; + :b :c8193; + :b :c8194; + :b :c8195; + :b :c8196; + :b :c8197; + :b :c8198; + :b :c8199; + :b :c8200; + :b :c8201; + :b :c8202; + :b :c8203; + :b :c8204; + :b :c8205; + :b :c8206; + :b :c8207; + :b :c8208; + :b :c8209; + :b :c8210; + :b :c8211; + :b :c8212; + :b :c8213; + :b :c8214; + :b :c8215; + :b :c8216; + :b :c8217; + :b :c8218; + :b :c8219; + :b :c8220; + :b :c8221; + :b :c8222; + :b :c8223; + :b :c8224; + :b :c8225; + :b :c8226; + :b :c8227; + :b :c8228; + :b :c8229; + :b :c8230; + :b :c8231; + :b :c8232; + :b :c8233; + :b :c8234; + :b :c8235; + :b :c8236; + :b :c8237; + :b :c8238; + :b :c8239; + :b :c8240; + :b :c8241; + :b :c8242; + :b :c8243; + :b :c8244; + :b :c8245; + :b :c8246; + :b :c8247; + :b :c8248; + :b :c8249; + :b :c8250; + :b :c8251; + :b :c8252; + :b :c8253; + :b :c8254; + :b :c8255; + :b :c8256; + :b :c8257; + :b :c8258; + :b :c8259; + :b :c8260; + :b :c8261; + :b :c8262; + :b :c8263; + :b :c8264; + :b :c8265; + :b :c8266; + :b :c8267; + :b :c8268; + :b :c8269; + :b :c8270; + :b :c8271; + :b :c8272; + :b :c8273; + :b :c8274; + :b :c8275; + :b :c8276; + :b :c8277; + :b :c8278; + :b :c8279; + :b :c8280; + :b :c8281; + :b :c8282; + :b :c8283; + :b :c8284; + :b :c8285; + :b :c8286; + :b :c8287; + :b :c8288; + :b :c8289; + :b :c8290; + :b :c8291; + :b :c8292; + :b :c8293; + :b :c8294; + :b :c8295; + :b :c8296; + :b :c8297; + :b :c8298; + :b :c8299; + :b :c8300; + :b :c8301; + :b :c8302; + :b :c8303; + :b :c8304; + :b :c8305; + :b :c8306; + :b :c8307; + :b :c8308; + :b :c8309; + :b :c8310; + :b :c8311; + :b :c8312; + :b :c8313; + :b :c8314; + :b :c8315; + :b :c8316; + :b :c8317; + :b :c8318; + :b :c8319; + :b :c8320; + :b :c8321; + :b :c8322; + :b :c8323; + :b :c8324; + :b :c8325; + :b :c8326; + :b :c8327; + :b :c8328; + :b :c8329; + :b :c8330; + :b :c8331; + :b :c8332; + :b :c8333; + :b :c8334; + :b :c8335; + :b :c8336; + :b :c8337; + :b :c8338; + :b :c8339; + :b :c8340; + :b :c8341; + :b :c8342; + :b :c8343; + :b :c8344; + :b :c8345; + :b :c8346; + :b :c8347; + :b :c8348; + :b :c8349; + :b :c8350; + :b :c8351; + :b :c8352; + :b :c8353; + :b :c8354; + :b :c8355; + :b :c8356; + :b :c8357; + :b :c8358; + :b :c8359; + :b :c8360; + :b :c8361; + :b :c8362; + :b :c8363; + :b :c8364; + :b :c8365; + :b :c8366; + :b :c8367; + :b :c8368; + :b :c8369; + :b :c8370; + :b :c8371; + :b :c8372; + :b :c8373; + :b :c8374; + :b :c8375; + :b :c8376; + :b :c8377; + :b :c8378; + :b :c8379; + :b :c8380; + :b :c8381; + :b :c8382; + :b :c8383; + :b :c8384; + :b :c8385; + :b :c8386; + :b :c8387; + :b :c8388; + :b :c8389; + :b :c8390; + :b :c8391; + :b :c8392; + :b :c8393; + :b :c8394; + :b :c8395; + :b :c8396; + :b :c8397; + :b :c8398; + :b :c8399; + :b :c8400; + :b :c8401; + :b :c8402; + :b :c8403; + :b :c8404; + :b :c8405; + :b :c8406; + :b :c8407; + :b :c8408; + :b :c8409; + :b :c8410; + :b :c8411; + :b :c8412; + :b :c8413; + :b :c8414; + :b :c8415; + :b :c8416; + :b :c8417; + :b :c8418; + :b :c8419; + :b :c8420; + :b :c8421; + :b :c8422; + :b :c8423; + :b :c8424; + :b :c8425; + :b :c8426; + :b :c8427; + :b :c8428; + :b :c8429; + :b :c8430; + :b :c8431; + :b :c8432; + :b :c8433; + :b :c8434; + :b :c8435; + :b :c8436; + :b :c8437; + :b :c8438; + :b :c8439; + :b :c8440; + :b :c8441; + :b :c8442; + :b :c8443; + :b :c8444; + :b :c8445; + :b :c8446; + :b :c8447; + :b :c8448; + :b :c8449; + :b :c8450; + :b :c8451; + :b :c8452; + :b :c8453; + :b :c8454; + :b :c8455; + :b :c8456; + :b :c8457; + :b :c8458; + :b :c8459; + :b :c8460; + :b :c8461; + :b :c8462; + :b :c8463; + :b :c8464; + :b :c8465; + :b :c8466; + :b :c8467; + :b :c8468; + :b :c8469; + :b :c8470; + :b :c8471; + :b :c8472; + :b :c8473; + :b :c8474; + :b :c8475; + :b :c8476; + :b :c8477; + :b :c8478; + :b :c8479; + :b :c8480; + :b :c8481; + :b :c8482; + :b :c8483; + :b :c8484; + :b :c8485; + :b :c8486; + :b :c8487; + :b :c8488; + :b :c8489; + :b :c8490; + :b :c8491; + :b :c8492; + :b :c8493; + :b :c8494; + :b :c8495; + :b :c8496; + :b :c8497; + :b :c8498; + :b :c8499; + :b :c8500; + :b :c8501; + :b :c8502; + :b :c8503; + :b :c8504; + :b :c8505; + :b :c8506; + :b :c8507; + :b :c8508; + :b :c8509; + :b :c8510; + :b :c8511; + :b :c8512; + :b :c8513; + :b :c8514; + :b :c8515; + :b :c8516; + :b :c8517; + :b :c8518; + :b :c8519; + :b :c8520; + :b :c8521; + :b :c8522; + :b :c8523; + :b :c8524; + :b :c8525; + :b :c8526; + :b :c8527; + :b :c8528; + :b :c8529; + :b :c8530; + :b :c8531; + :b :c8532; + :b :c8533; + :b :c8534; + :b :c8535; + :b :c8536; + :b :c8537; + :b :c8538; + :b :c8539; + :b :c8540; + :b :c8541; + :b :c8542; + :b :c8543; + :b :c8544; + :b :c8545; + :b :c8546; + :b :c8547; + :b :c8548; + :b :c8549; + :b :c8550; + :b :c8551; + :b :c8552; + :b :c8553; + :b :c8554; + :b :c8555; + :b :c8556; + :b :c8557; + :b :c8558; + :b :c8559; + :b :c8560; + :b :c8561; + :b :c8562; + :b :c8563; + :b :c8564; + :b :c8565; + :b :c8566; + :b :c8567; + :b :c8568; + :b :c8569; + :b :c8570; + :b :c8571; + :b :c8572; + :b :c8573; + :b :c8574; + :b :c8575; + :b :c8576; + :b :c8577; + :b :c8578; + :b :c8579; + :b :c8580; + :b :c8581; + :b :c8582; + :b :c8583; + :b :c8584; + :b :c8585; + :b :c8586; + :b :c8587; + :b :c8588; + :b :c8589; + :b :c8590; + :b :c8591; + :b :c8592; + :b :c8593; + :b :c8594; + :b :c8595; + :b :c8596; + :b :c8597; + :b :c8598; + :b :c8599; + :b :c8600; + :b :c8601; + :b :c8602; + :b :c8603; + :b :c8604; + :b :c8605; + :b :c8606; + :b :c8607; + :b :c8608; + :b :c8609; + :b :c8610; + :b :c8611; + :b :c8612; + :b :c8613; + :b :c8614; + :b :c8615; + :b :c8616; + :b :c8617; + :b :c8618; + :b :c8619; + :b :c8620; + :b :c8621; + :b :c8622; + :b :c8623; + :b :c8624; + :b :c8625; + :b :c8626; + :b :c8627; + :b :c8628; + :b :c8629; + :b :c8630; + :b :c8631; + :b :c8632; + :b :c8633; + :b :c8634; + :b :c8635; + :b :c8636; + :b :c8637; + :b :c8638; + :b :c8639; + :b :c8640; + :b :c8641; + :b :c8642; + :b :c8643; + :b :c8644; + :b :c8645; + :b :c8646; + :b :c8647; + :b :c8648; + :b :c8649; + :b :c8650; + :b :c8651; + :b :c8652; + :b :c8653; + :b :c8654; + :b :c8655; + :b :c8656; + :b :c8657; + :b :c8658; + :b :c8659; + :b :c8660; + :b :c8661; + :b :c8662; + :b :c8663; + :b :c8664; + :b :c8665; + :b :c8666; + :b :c8667; + :b :c8668; + :b :c8669; + :b :c8670; + :b :c8671; + :b :c8672; + :b :c8673; + :b :c8674; + :b :c8675; + :b :c8676; + :b :c8677; + :b :c8678; + :b :c8679; + :b :c8680; + :b :c8681; + :b :c8682; + :b :c8683; + :b :c8684; + :b :c8685; + :b :c8686; + :b :c8687; + :b :c8688; + :b :c8689; + :b :c8690; + :b :c8691; + :b :c8692; + :b :c8693; + :b :c8694; + :b :c8695; + :b :c8696; + :b :c8697; + :b :c8698; + :b :c8699; + :b :c8700; + :b :c8701; + :b :c8702; + :b :c8703; + :b :c8704; + :b :c8705; + :b :c8706; + :b :c8707; + :b :c8708; + :b :c8709; + :b :c8710; + :b :c8711; + :b :c8712; + :b :c8713; + :b :c8714; + :b :c8715; + :b :c8716; + :b :c8717; + :b :c8718; + :b :c8719; + :b :c8720; + :b :c8721; + :b :c8722; + :b :c8723; + :b :c8724; + :b :c8725; + :b :c8726; + :b :c8727; + :b :c8728; + :b :c8729; + :b :c8730; + :b :c8731; + :b :c8732; + :b :c8733; + :b :c8734; + :b :c8735; + :b :c8736; + :b :c8737; + :b :c8738; + :b :c8739; + :b :c8740; + :b :c8741; + :b :c8742; + :b :c8743; + :b :c8744; + :b :c8745; + :b :c8746; + :b :c8747; + :b :c8748; + :b :c8749; + :b :c8750; + :b :c8751; + :b :c8752; + :b :c8753; + :b :c8754; + :b :c8755; + :b :c8756; + :b :c8757; + :b :c8758; + :b :c8759; + :b :c8760; + :b :c8761; + :b :c8762; + :b :c8763; + :b :c8764; + :b :c8765; + :b :c8766; + :b :c8767; + :b :c8768; + :b :c8769; + :b :c8770; + :b :c8771; + :b :c8772; + :b :c8773; + :b :c8774; + :b :c8775; + :b :c8776; + :b :c8777; + :b :c8778; + :b :c8779; + :b :c8780; + :b :c8781; + :b :c8782; + :b :c8783; + :b :c8784; + :b :c8785; + :b :c8786; + :b :c8787; + :b :c8788; + :b :c8789; + :b :c8790; + :b :c8791; + :b :c8792; + :b :c8793; + :b :c8794; + :b :c8795; + :b :c8796; + :b :c8797; + :b :c8798; + :b :c8799; + :b :c8800; + :b :c8801; + :b :c8802; + :b :c8803; + :b :c8804; + :b :c8805; + :b :c8806; + :b :c8807; + :b :c8808; + :b :c8809; + :b :c8810; + :b :c8811; + :b :c8812; + :b :c8813; + :b :c8814; + :b :c8815; + :b :c8816; + :b :c8817; + :b :c8818; + :b :c8819; + :b :c8820; + :b :c8821; + :b :c8822; + :b :c8823; + :b :c8824; + :b :c8825; + :b :c8826; + :b :c8827; + :b :c8828; + :b :c8829; + :b :c8830; + :b :c8831; + :b :c8832; + :b :c8833; + :b :c8834; + :b :c8835; + :b :c8836; + :b :c8837; + :b :c8838; + :b :c8839; + :b :c8840; + :b :c8841; + :b :c8842; + :b :c8843; + :b :c8844; + :b :c8845; + :b :c8846; + :b :c8847; + :b :c8848; + :b :c8849; + :b :c8850; + :b :c8851; + :b :c8852; + :b :c8853; + :b :c8854; + :b :c8855; + :b :c8856; + :b :c8857; + :b :c8858; + :b :c8859; + :b :c8860; + :b :c8861; + :b :c8862; + :b :c8863; + :b :c8864; + :b :c8865; + :b :c8866; + :b :c8867; + :b :c8868; + :b :c8869; + :b :c8870; + :b :c8871; + :b :c8872; + :b :c8873; + :b :c8874; + :b :c8875; + :b :c8876; + :b :c8877; + :b :c8878; + :b :c8879; + :b :c8880; + :b :c8881; + :b :c8882; + :b :c8883; + :b :c8884; + :b :c8885; + :b :c8886; + :b :c8887; + :b :c8888; + :b :c8889; + :b :c8890; + :b :c8891; + :b :c8892; + :b :c8893; + :b :c8894; + :b :c8895; + :b :c8896; + :b :c8897; + :b :c8898; + :b :c8899; + :b :c8900; + :b :c8901; + :b :c8902; + :b :c8903; + :b :c8904; + :b :c8905; + :b :c8906; + :b :c8907; + :b :c8908; + :b :c8909; + :b :c8910; + :b :c8911; + :b :c8912; + :b :c8913; + :b :c8914; + :b :c8915; + :b :c8916; + :b :c8917; + :b :c8918; + :b :c8919; + :b :c8920; + :b :c8921; + :b :c8922; + :b :c8923; + :b :c8924; + :b :c8925; + :b :c8926; + :b :c8927; + :b :c8928; + :b :c8929; + :b :c8930; + :b :c8931; + :b :c8932; + :b :c8933; + :b :c8934; + :b :c8935; + :b :c8936; + :b :c8937; + :b :c8938; + :b :c8939; + :b :c8940; + :b :c8941; + :b :c8942; + :b :c8943; + :b :c8944; + :b :c8945; + :b :c8946; + :b :c8947; + :b :c8948; + :b :c8949; + :b :c8950; + :b :c8951; + :b :c8952; + :b :c8953; + :b :c8954; + :b :c8955; + :b :c8956; + :b :c8957; + :b :c8958; + :b :c8959; + :b :c8960; + :b :c8961; + :b :c8962; + :b :c8963; + :b :c8964; + :b :c8965; + :b :c8966; + :b :c8967; + :b :c8968; + :b :c8969; + :b :c8970; + :b :c8971; + :b :c8972; + :b :c8973; + :b :c8974; + :b :c8975; + :b :c8976; + :b :c8977; + :b :c8978; + :b :c8979; + :b :c8980; + :b :c8981; + :b :c8982; + :b :c8983; + :b :c8984; + :b :c8985; + :b :c8986; + :b :c8987; + :b :c8988; + :b :c8989; + :b :c8990; + :b :c8991; + :b :c8992; + :b :c8993; + :b :c8994; + :b :c8995; + :b :c8996; + :b :c8997; + :b :c8998; + :b :c8999; + :b :c9000; + :b :c9001; + :b :c9002; + :b :c9003; + :b :c9004; + :b :c9005; + :b :c9006; + :b :c9007; + :b :c9008; + :b :c9009; + :b :c9010; + :b :c9011; + :b :c9012; + :b :c9013; + :b :c9014; + :b :c9015; + :b :c9016; + :b :c9017; + :b :c9018; + :b :c9019; + :b :c9020; + :b :c9021; + :b :c9022; + :b :c9023; + :b :c9024; + :b :c9025; + :b :c9026; + :b :c9027; + :b :c9028; + :b :c9029; + :b :c9030; + :b :c9031; + :b :c9032; + :b :c9033; + :b :c9034; + :b :c9035; + :b :c9036; + :b :c9037; + :b :c9038; + :b :c9039; + :b :c9040; + :b :c9041; + :b :c9042; + :b :c9043; + :b :c9044; + :b :c9045; + :b :c9046; + :b :c9047; + :b :c9048; + :b :c9049; + :b :c9050; + :b :c9051; + :b :c9052; + :b :c9053; + :b :c9054; + :b :c9055; + :b :c9056; + :b :c9057; + :b :c9058; + :b :c9059; + :b :c9060; + :b :c9061; + :b :c9062; + :b :c9063; + :b :c9064; + :b :c9065; + :b :c9066; + :b :c9067; + :b :c9068; + :b :c9069; + :b :c9070; + :b :c9071; + :b :c9072; + :b :c9073; + :b :c9074; + :b :c9075; + :b :c9076; + :b :c9077; + :b :c9078; + :b :c9079; + :b :c9080; + :b :c9081; + :b :c9082; + :b :c9083; + :b :c9084; + :b :c9085; + :b :c9086; + :b :c9087; + :b :c9088; + :b :c9089; + :b :c9090; + :b :c9091; + :b :c9092; + :b :c9093; + :b :c9094; + :b :c9095; + :b :c9096; + :b :c9097; + :b :c9098; + :b :c9099; + :b :c9100; + :b :c9101; + :b :c9102; + :b :c9103; + :b :c9104; + :b :c9105; + :b :c9106; + :b :c9107; + :b :c9108; + :b :c9109; + :b :c9110; + :b :c9111; + :b :c9112; + :b :c9113; + :b :c9114; + :b :c9115; + :b :c9116; + :b :c9117; + :b :c9118; + :b :c9119; + :b :c9120; + :b :c9121; + :b :c9122; + :b :c9123; + :b :c9124; + :b :c9125; + :b :c9126; + :b :c9127; + :b :c9128; + :b :c9129; + :b :c9130; + :b :c9131; + :b :c9132; + :b :c9133; + :b :c9134; + :b :c9135; + :b :c9136; + :b :c9137; + :b :c9138; + :b :c9139; + :b :c9140; + :b :c9141; + :b :c9142; + :b :c9143; + :b :c9144; + :b :c9145; + :b :c9146; + :b :c9147; + :b :c9148; + :b :c9149; + :b :c9150; + :b :c9151; + :b :c9152; + :b :c9153; + :b :c9154; + :b :c9155; + :b :c9156; + :b :c9157; + :b :c9158; + :b :c9159; + :b :c9160; + :b :c9161; + :b :c9162; + :b :c9163; + :b :c9164; + :b :c9165; + :b :c9166; + :b :c9167; + :b :c9168; + :b :c9169; + :b :c9170; + :b :c9171; + :b :c9172; + :b :c9173; + :b :c9174; + :b :c9175; + :b :c9176; + :b :c9177; + :b :c9178; + :b :c9179; + :b :c9180; + :b :c9181; + :b :c9182; + :b :c9183; + :b :c9184; + :b :c9185; + :b :c9186; + :b :c9187; + :b :c9188; + :b :c9189; + :b :c9190; + :b :c9191; + :b :c9192; + :b :c9193; + :b :c9194; + :b :c9195; + :b :c9196; + :b :c9197; + :b :c9198; + :b :c9199; + :b :c9200; + :b :c9201; + :b :c9202; + :b :c9203; + :b :c9204; + :b :c9205; + :b :c9206; + :b :c9207; + :b :c9208; + :b :c9209; + :b :c9210; + :b :c9211; + :b :c9212; + :b :c9213; + :b :c9214; + :b :c9215; + :b :c9216; + :b :c9217; + :b :c9218; + :b :c9219; + :b :c9220; + :b :c9221; + :b :c9222; + :b :c9223; + :b :c9224; + :b :c9225; + :b :c9226; + :b :c9227; + :b :c9228; + :b :c9229; + :b :c9230; + :b :c9231; + :b :c9232; + :b :c9233; + :b :c9234; + :b :c9235; + :b :c9236; + :b :c9237; + :b :c9238; + :b :c9239; + :b :c9240; + :b :c9241; + :b :c9242; + :b :c9243; + :b :c9244; + :b :c9245; + :b :c9246; + :b :c9247; + :b :c9248; + :b :c9249; + :b :c9250; + :b :c9251; + :b :c9252; + :b :c9253; + :b :c9254; + :b :c9255; + :b :c9256; + :b :c9257; + :b :c9258; + :b :c9259; + :b :c9260; + :b :c9261; + :b :c9262; + :b :c9263; + :b :c9264; + :b :c9265; + :b :c9266; + :b :c9267; + :b :c9268; + :b :c9269; + :b :c9270; + :b :c9271; + :b :c9272; + :b :c9273; + :b :c9274; + :b :c9275; + :b :c9276; + :b :c9277; + :b :c9278; + :b :c9279; + :b :c9280; + :b :c9281; + :b :c9282; + :b :c9283; + :b :c9284; + :b :c9285; + :b :c9286; + :b :c9287; + :b :c9288; + :b :c9289; + :b :c9290; + :b :c9291; + :b :c9292; + :b :c9293; + :b :c9294; + :b :c9295; + :b :c9296; + :b :c9297; + :b :c9298; + :b :c9299; + :b :c9300; + :b :c9301; + :b :c9302; + :b :c9303; + :b :c9304; + :b :c9305; + :b :c9306; + :b :c9307; + :b :c9308; + :b :c9309; + :b :c9310; + :b :c9311; + :b :c9312; + :b :c9313; + :b :c9314; + :b :c9315; + :b :c9316; + :b :c9317; + :b :c9318; + :b :c9319; + :b :c9320; + :b :c9321; + :b :c9322; + :b :c9323; + :b :c9324; + :b :c9325; + :b :c9326; + :b :c9327; + :b :c9328; + :b :c9329; + :b :c9330; + :b :c9331; + :b :c9332; + :b :c9333; + :b :c9334; + :b :c9335; + :b :c9336; + :b :c9337; + :b :c9338; + :b :c9339; + :b :c9340; + :b :c9341; + :b :c9342; + :b :c9343; + :b :c9344; + :b :c9345; + :b :c9346; + :b :c9347; + :b :c9348; + :b :c9349; + :b :c9350; + :b :c9351; + :b :c9352; + :b :c9353; + :b :c9354; + :b :c9355; + :b :c9356; + :b :c9357; + :b :c9358; + :b :c9359; + :b :c9360; + :b :c9361; + :b :c9362; + :b :c9363; + :b :c9364; + :b :c9365; + :b :c9366; + :b :c9367; + :b :c9368; + :b :c9369; + :b :c9370; + :b :c9371; + :b :c9372; + :b :c9373; + :b :c9374; + :b :c9375; + :b :c9376; + :b :c9377; + :b :c9378; + :b :c9379; + :b :c9380; + :b :c9381; + :b :c9382; + :b :c9383; + :b :c9384; + :b :c9385; + :b :c9386; + :b :c9387; + :b :c9388; + :b :c9389; + :b :c9390; + :b :c9391; + :b :c9392; + :b :c9393; + :b :c9394; + :b :c9395; + :b :c9396; + :b :c9397; + :b :c9398; + :b :c9399; + :b :c9400; + :b :c9401; + :b :c9402; + :b :c9403; + :b :c9404; + :b :c9405; + :b :c9406; + :b :c9407; + :b :c9408; + :b :c9409; + :b :c9410; + :b :c9411; + :b :c9412; + :b :c9413; + :b :c9414; + :b :c9415; + :b :c9416; + :b :c9417; + :b :c9418; + :b :c9419; + :b :c9420; + :b :c9421; + :b :c9422; + :b :c9423; + :b :c9424; + :b :c9425; + :b :c9426; + :b :c9427; + :b :c9428; + :b :c9429; + :b :c9430; + :b :c9431; + :b :c9432; + :b :c9433; + :b :c9434; + :b :c9435; + :b :c9436; + :b :c9437; + :b :c9438; + :b :c9439; + :b :c9440; + :b :c9441; + :b :c9442; + :b :c9443; + :b :c9444; + :b :c9445; + :b :c9446; + :b :c9447; + :b :c9448; + :b :c9449; + :b :c9450; + :b :c9451; + :b :c9452; + :b :c9453; + :b :c9454; + :b :c9455; + :b :c9456; + :b :c9457; + :b :c9458; + :b :c9459; + :b :c9460; + :b :c9461; + :b :c9462; + :b :c9463; + :b :c9464; + :b :c9465; + :b :c9466; + :b :c9467; + :b :c9468; + :b :c9469; + :b :c9470; + :b :c9471; + :b :c9472; + :b :c9473; + :b :c9474; + :b :c9475; + :b :c9476; + :b :c9477; + :b :c9478; + :b :c9479; + :b :c9480; + :b :c9481; + :b :c9482; + :b :c9483; + :b :c9484; + :b :c9485; + :b :c9486; + :b :c9487; + :b :c9488; + :b :c9489; + :b :c9490; + :b :c9491; + :b :c9492; + :b :c9493; + :b :c9494; + :b :c9495; + :b :c9496; + :b :c9497; + :b :c9498; + :b :c9499; + :b :c9500; + :b :c9501; + :b :c9502; + :b :c9503; + :b :c9504; + :b :c9505; + :b :c9506; + :b :c9507; + :b :c9508; + :b :c9509; + :b :c9510; + :b :c9511; + :b :c9512; + :b :c9513; + :b :c9514; + :b :c9515; + :b :c9516; + :b :c9517; + :b :c9518; + :b :c9519; + :b :c9520; + :b :c9521; + :b :c9522; + :b :c9523; + :b :c9524; + :b :c9525; + :b :c9526; + :b :c9527; + :b :c9528; + :b :c9529; + :b :c9530; + :b :c9531; + :b :c9532; + :b :c9533; + :b :c9534; + :b :c9535; + :b :c9536; + :b :c9537; + :b :c9538; + :b :c9539; + :b :c9540; + :b :c9541; + :b :c9542; + :b :c9543; + :b :c9544; + :b :c9545; + :b :c9546; + :b :c9547; + :b :c9548; + :b :c9549; + :b :c9550; + :b :c9551; + :b :c9552; + :b :c9553; + :b :c9554; + :b :c9555; + :b :c9556; + :b :c9557; + :b :c9558; + :b :c9559; + :b :c9560; + :b :c9561; + :b :c9562; + :b :c9563; + :b :c9564; + :b :c9565; + :b :c9566; + :b :c9567; + :b :c9568; + :b :c9569; + :b :c9570; + :b :c9571; + :b :c9572; + :b :c9573; + :b :c9574; + :b :c9575; + :b :c9576; + :b :c9577; + :b :c9578; + :b :c9579; + :b :c9580; + :b :c9581; + :b :c9582; + :b :c9583; + :b :c9584; + :b :c9585; + :b :c9586; + :b :c9587; + :b :c9588; + :b :c9589; + :b :c9590; + :b :c9591; + :b :c9592; + :b :c9593; + :b :c9594; + :b :c9595; + :b :c9596; + :b :c9597; + :b :c9598; + :b :c9599; + :b :c9600; + :b :c9601; + :b :c9602; + :b :c9603; + :b :c9604; + :b :c9605; + :b :c9606; + :b :c9607; + :b :c9608; + :b :c9609; + :b :c9610; + :b :c9611; + :b :c9612; + :b :c9613; + :b :c9614; + :b :c9615; + :b :c9616; + :b :c9617; + :b :c9618; + :b :c9619; + :b :c9620; + :b :c9621; + :b :c9622; + :b :c9623; + :b :c9624; + :b :c9625; + :b :c9626; + :b :c9627; + :b :c9628; + :b :c9629; + :b :c9630; + :b :c9631; + :b :c9632; + :b :c9633; + :b :c9634; + :b :c9635; + :b :c9636; + :b :c9637; + :b :c9638; + :b :c9639; + :b :c9640; + :b :c9641; + :b :c9642; + :b :c9643; + :b :c9644; + :b :c9645; + :b :c9646; + :b :c9647; + :b :c9648; + :b :c9649; + :b :c9650; + :b :c9651; + :b :c9652; + :b :c9653; + :b :c9654; + :b :c9655; + :b :c9656; + :b :c9657; + :b :c9658; + :b :c9659; + :b :c9660; + :b :c9661; + :b :c9662; + :b :c9663; + :b :c9664; + :b :c9665; + :b :c9666; + :b :c9667; + :b :c9668; + :b :c9669; + :b :c9670; + :b :c9671; + :b :c9672; + :b :c9673; + :b :c9674; + :b :c9675; + :b :c9676; + :b :c9677; + :b :c9678; + :b :c9679; + :b :c9680; + :b :c9681; + :b :c9682; + :b :c9683; + :b :c9684; + :b :c9685; + :b :c9686; + :b :c9687; + :b :c9688; + :b :c9689; + :b :c9690; + :b :c9691; + :b :c9692; + :b :c9693; + :b :c9694; + :b :c9695; + :b :c9696; + :b :c9697; + :b :c9698; + :b :c9699; + :b :c9700; + :b :c9701; + :b :c9702; + :b :c9703; + :b :c9704; + :b :c9705; + :b :c9706; + :b :c9707; + :b :c9708; + :b :c9709; + :b :c9710; + :b :c9711; + :b :c9712; + :b :c9713; + :b :c9714; + :b :c9715; + :b :c9716; + :b :c9717; + :b :c9718; + :b :c9719; + :b :c9720; + :b :c9721; + :b :c9722; + :b :c9723; + :b :c9724; + :b :c9725; + :b :c9726; + :b :c9727; + :b :c9728; + :b :c9729; + :b :c9730; + :b :c9731; + :b :c9732; + :b :c9733; + :b :c9734; + :b :c9735; + :b :c9736; + :b :c9737; + :b :c9738; + :b :c9739; + :b :c9740; + :b :c9741; + :b :c9742; + :b :c9743; + :b :c9744; + :b :c9745; + :b :c9746; + :b :c9747; + :b :c9748; + :b :c9749; + :b :c9750; + :b :c9751; + :b :c9752; + :b :c9753; + :b :c9754; + :b :c9755; + :b :c9756; + :b :c9757; + :b :c9758; + :b :c9759; + :b :c9760; + :b :c9761; + :b :c9762; + :b :c9763; + :b :c9764; + :b :c9765; + :b :c9766; + :b :c9767; + :b :c9768; + :b :c9769; + :b :c9770; + :b :c9771; + :b :c9772; + :b :c9773; + :b :c9774; + :b :c9775; + :b :c9776; + :b :c9777; + :b :c9778; + :b :c9779; + :b :c9780; + :b :c9781; + :b :c9782; + :b :c9783; + :b :c9784; + :b :c9785; + :b :c9786; + :b :c9787; + :b :c9788; + :b :c9789; + :b :c9790; + :b :c9791; + :b :c9792; + :b :c9793; + :b :c9794; + :b :c9795; + :b :c9796; + :b :c9797; + :b :c9798; + :b :c9799; + :b :c9800; + :b :c9801; + :b :c9802; + :b :c9803; + :b :c9804; + :b :c9805; + :b :c9806; + :b :c9807; + :b :c9808; + :b :c9809; + :b :c9810; + :b :c9811; + :b :c9812; + :b :c9813; + :b :c9814; + :b :c9815; + :b :c9816; + :b :c9817; + :b :c9818; + :b :c9819; + :b :c9820; + :b :c9821; + :b :c9822; + :b :c9823; + :b :c9824; + :b :c9825; + :b :c9826; + :b :c9827; + :b :c9828; + :b :c9829; + :b :c9830; + :b :c9831; + :b :c9832; + :b :c9833; + :b :c9834; + :b :c9835; + :b :c9836; + :b :c9837; + :b :c9838; + :b :c9839; + :b :c9840; + :b :c9841; + :b :c9842; + :b :c9843; + :b :c9844; + :b :c9845; + :b :c9846; + :b :c9847; + :b :c9848; + :b :c9849; + :b :c9850; + :b :c9851; + :b :c9852; + :b :c9853; + :b :c9854; + :b :c9855; + :b :c9856; + :b :c9857; + :b :c9858; + :b :c9859; + :b :c9860; + :b :c9861; + :b :c9862; + :b :c9863; + :b :c9864; + :b :c9865; + :b :c9866; + :b :c9867; + :b :c9868; + :b :c9869; + :b :c9870; + :b :c9871; + :b :c9872; + :b :c9873; + :b :c9874; + :b :c9875; + :b :c9876; + :b :c9877; + :b :c9878; + :b :c9879; + :b :c9880; + :b :c9881; + :b :c9882; + :b :c9883; + :b :c9884; + :b :c9885; + :b :c9886; + :b :c9887; + :b :c9888; + :b :c9889; + :b :c9890; + :b :c9891; + :b :c9892; + :b :c9893; + :b :c9894; + :b :c9895; + :b :c9896; + :b :c9897; + :b :c9898; + :b :c9899; + :b :c9900; + :b :c9901; + :b :c9902; + :b :c9903; + :b :c9904; + :b :c9905; + :b :c9906; + :b :c9907; + :b :c9908; + :b :c9909; + :b :c9910; + :b :c9911; + :b :c9912; + :b :c9913; + :b :c9914; + :b :c9915; + :b :c9916; + :b :c9917; + :b :c9918; + :b :c9919; + :b :c9920; + :b :c9921; + :b :c9922; + :b :c9923; + :b :c9924; + :b :c9925; + :b :c9926; + :b :c9927; + :b :c9928; + :b :c9929; + :b :c9930; + :b :c9931; + :b :c9932; + :b :c9933; + :b :c9934; + :b :c9935; + :b :c9936; + :b :c9937; + :b :c9938; + :b :c9939; + :b :c9940; + :b :c9941; + :b :c9942; + :b :c9943; + :b :c9944; + :b :c9945; + :b :c9946; + :b :c9947; + :b :c9948; + :b :c9949; + :b :c9950; + :b :c9951; + :b :c9952; + :b :c9953; + :b :c9954; + :b :c9955; + :b :c9956; + :b :c9957; + :b :c9958; + :b :c9959; + :b :c9960; + :b :c9961; + :b :c9962; + :b :c9963; + :b :c9964; + :b :c9965; + :b :c9966; + :b :c9967; + :b :c9968; + :b :c9969; + :b :c9970; + :b :c9971; + :b :c9972; + :b :c9973; + :b :c9974; + :b :c9975; + :b :c9976; + :b :c9977; + :b :c9978; + :b :c9979; + :b :c9980; + :b :c9981; + :b :c9982; + :b :c9983; + :b :c9984; + :b :c9985; + :b :c9986; + :b :c9987; + :b :c9988; + :b :c9989; + :b :c9990; + :b :c9991; + :b :c9992; + :b :c9993; + :b :c9994; + :b :c9995; + :b :c9996; + :b :c9997; + :b :c9998; + :b :c9999; + :b :c10000 . diff --git a/tests/turtle/test-17.out b/tests/turtle/test-17.out new file mode 100644 index 0000000..466edbb --- /dev/null +++ b/tests/turtle/test-17.out @@ -0,0 +1 @@ + "a long\n\tliteral\nwith\nnewlines" . diff --git a/tests/turtle/test-17.ttl b/tests/turtle/test-17.ttl new file mode 100644 index 0000000..86c453b --- /dev/null +++ b/tests/turtle/test-17.ttl @@ -0,0 +1,6 @@ +# Test long literal +@prefix : . +:a :b """a long + literal +with +newlines""" . diff --git a/tests/turtle/test-18.out b/tests/turtle/test-18.out new file mode 100644 index 0000000..4ff4b95 --- /dev/null +++ b/tests/turtle/test-18.out @@ -0,0 +1,2 @@ + "\nthis \ris a \U00015678long\t\nliteral\uABCD\n" . + "\tThis \uABCDis\r \U00015678another\n\none\n" . diff --git a/tests/turtle/test-18.ttl b/tests/turtle/test-18.ttl new file mode 100644 index 0000000..1adfa45 --- /dev/null +++ b/tests/turtle/test-18.ttl @@ -0,0 +1,9 @@ +@prefix : . + +:a :b """\nthis \ris a \U00015678long\t +literal\uABCD +""" . + +:d :e """\tThis \uABCDis\r \U00015678another\n +one +""" . diff --git a/tests/turtle/test-19.out b/tests/turtle/test-19.out new file mode 100644 index 0000000..2e2dbe4 --- /dev/null +++ b/tests/turtle/test-19.out @@ -0,0 +1 @@ + "1.0"^^ . diff --git a/tests/turtle/test-19.ttl b/tests/turtle/test-19.ttl new file mode 100644 index 0000000..9de0c07 --- /dev/null +++ b/tests/turtle/test-19.ttl @@ -0,0 +1,4 @@ +@prefix : . + +:a :b 1.0 . + diff --git a/tests/turtle/test-20.out b/tests/turtle/test-20.out new file mode 100644 index 0000000..fff2da5 --- /dev/null +++ b/tests/turtle/test-20.out @@ -0,0 +1,2 @@ + "" . + "" . diff --git a/tests/turtle/test-20.ttl b/tests/turtle/test-20.ttl new file mode 100644 index 0000000..37a9a4f --- /dev/null +++ b/tests/turtle/test-20.ttl @@ -0,0 +1,6 @@ +@prefix : . + +:a :b "" . + +:c :d """""" . + diff --git a/tests/turtle/test-21.out b/tests/turtle/test-21.out new file mode 100644 index 0000000..d5dca69 --- /dev/null +++ b/tests/turtle/test-21.out @@ -0,0 +1,3 @@ + "1.0"^^ . + "1"^^ . + "1.0e0"^^ . diff --git a/tests/turtle/test-21.ttl b/tests/turtle/test-21.ttl new file mode 100644 index 0000000..a8e8dc1 --- /dev/null +++ b/tests/turtle/test-21.ttl @@ -0,0 +1,4 @@ +@prefix : . +:a :b 1.0 . +:c :d 1 . +:e :f 1.0e0 . diff --git a/tests/turtle/test-22.out b/tests/turtle/test-22.out new file mode 100644 index 0000000..3d0f970 --- /dev/null +++ b/tests/turtle/test-22.out @@ -0,0 +1,3 @@ + "-1.0"^^ . + "-1"^^ . + "-1.0e0"^^ . diff --git a/tests/turtle/test-22.ttl b/tests/turtle/test-22.ttl new file mode 100644 index 0000000..9b1a725 --- /dev/null +++ b/tests/turtle/test-22.ttl @@ -0,0 +1,4 @@ +@prefix : . +:a :b -1.0 . +:c :d -1 . +:e :f -1.0e0 . diff --git a/tests/turtle/test-23.out b/tests/turtle/test-23.out new file mode 100644 index 0000000..fde3131 --- /dev/null +++ b/tests/turtle/test-23.out @@ -0,0 +1 @@ + "John said: \"Hello World!\"" . diff --git a/tests/turtle/test-23.ttl b/tests/turtle/test-23.ttl new file mode 100644 index 0000000..9f5360a --- /dev/null +++ b/tests/turtle/test-23.ttl @@ -0,0 +1,3 @@ +# Test long literal +@prefix : . +:a :b """John said: "Hello World!\"""" . diff --git a/tests/turtle/test-24.out b/tests/turtle/test-24.out new file mode 100644 index 0000000..5a70bff --- /dev/null +++ b/tests/turtle/test-24.out @@ -0,0 +1,2 @@ + "true"^^ . + "false"^^ . diff --git a/tests/turtle/test-24.ttl b/tests/turtle/test-24.ttl new file mode 100644 index 0000000..25f3b75 --- /dev/null +++ b/tests/turtle/test-24.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b true . +:c :d false . diff --git a/tests/turtle/test-25.out b/tests/turtle/test-25.out new file mode 100644 index 0000000..1a38415 --- /dev/null +++ b/tests/turtle/test-25.out @@ -0,0 +1,7 @@ + . + . + . + . + . + . + . diff --git a/tests/turtle/test-25.ttl b/tests/turtle/test-25.ttl new file mode 100644 index 0000000..310349d --- /dev/null +++ b/tests/turtle/test-25.ttl @@ -0,0 +1,14 @@ +# comment test +@prefix : . +:a :b :c . # end of line comment +:d # ignore me + :e # and me + :f # and me + . +:g :h #ignore me + :i, # and me + :j . # and me + +:k :l :m ; #ignore me + :n :o ; # and me + :p :q . # and me diff --git a/tests/turtle/test-26.out b/tests/turtle/test-26.out new file mode 100644 index 0000000..ad105cf --- /dev/null +++ b/tests/turtle/test-26.out @@ -0,0 +1 @@ + . diff --git a/tests/turtle/test-26.ttl b/tests/turtle/test-26.ttl new file mode 100644 index 0000000..0667c6b --- /dev/null +++ b/tests/turtle/test-26.ttl @@ -0,0 +1,4 @@ +# comment line with no final newline test +@prefix : . +:a :b :c . +#foo diff --git a/tests/turtle/test-27.out b/tests/turtle/test-27.out new file mode 100644 index 0000000..7da0635 --- /dev/null +++ b/tests/turtle/test-27.out @@ -0,0 +1 @@ + . diff --git a/tests/turtle/test-27.ttl b/tests/turtle/test-27.ttl new file mode 100644 index 0000000..569023c --- /dev/null +++ b/tests/turtle/test-27.ttl @@ -0,0 +1,5 @@ +@prefix foo: . +@prefix foo: . + +foo:blah foo:blah foo:blah . + diff --git a/tests/turtle/test-28-out.ttl b/tests/turtle/test-28-out.ttl new file mode 100644 index 0000000..6a0e1a4 --- /dev/null +++ b/tests/turtle/test-28-out.ttl @@ -0,0 +1,6 @@ +@base . +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> . + + + 1, 1., 1.0, 1.000000000, 1.2345678901234567890123457890, 2.23400000000000000000005, 2.2340000000000000000005, 2.234000000000000000005, 2.23400000000000000005, 2.2340000000000000005, 2.234000000000000005, 2.23400000000000005, 2.2340000000000005, 2.234000000000005, 2.23400000000005, 2.2340000000005, 2.234000000005, 2.23400000005, 2.2340000005, 2.234000005, 2.3, 2.345 . + diff --git a/tests/turtle/test-28.out b/tests/turtle/test-28.out new file mode 100644 index 0000000..0c15476 --- /dev/null +++ b/tests/turtle/test-28.out @@ -0,0 +1,22 @@ + "2.345"^^ . + "1.0"^^ . + "1.0"^^ . + "1.0"^^ . + "1.0"^^ . + "2.30"^^ . + "2.234000005"^^ . + "2.2340000005"^^ . + "2.23400000005"^^ . + "2.234000000005"^^ . + "2.2340000000005"^^ . + "2.23400000000005"^^ . + "2.234000000000005"^^ . + "2.2340000000000005"^^ . + "2.234"^^ . + "2.234"^^ . + "2.234"^^ . + "2.234"^^ . + "2.234"^^ . + "2.234"^^ . + "2.234"^^ . + "1.2345678901234567"^^ . diff --git a/tests/turtle/test-28.ttl b/tests/turtle/test-28.ttl new file mode 100644 index 0000000..7357dd4 --- /dev/null +++ b/tests/turtle/test-28.ttl @@ -0,0 +1,22 @@ + "2.345"^^ . + "1"^^ . + "1.0"^^ . + "1."^^ . + "1.000000000"^^ . + "2.3"^^ . + "2.234000005"^^ . + "2.2340000005"^^ . + "2.23400000005"^^ . + "2.234000000005"^^ . + "2.2340000000005"^^ . + "2.23400000000005"^^ . + "2.234000000000005"^^ . + "2.2340000000000005"^^ . + "2.23400000000000005"^^ . + "2.234000000000000005"^^ . + "2.2340000000000000005"^^ . + "2.23400000000000000005"^^ . + "2.234000000000000000005"^^ . + "2.2340000000000000000005"^^ . + "2.23400000000000000000005"^^ . + "1.2345678901234567890123457890"^^ . diff --git a/tests/turtle/test-29.out b/tests/turtle/test-29.out new file mode 100644 index 0000000..8c72f74 --- /dev/null +++ b/tests/turtle/test-29.out @@ -0,0 +1 @@ + . diff --git a/tests/turtle/test-29.ttl b/tests/turtle/test-29.ttl new file mode 100644 index 0000000..8c72f74 --- /dev/null +++ b/tests/turtle/test-29.ttl @@ -0,0 +1 @@ + . diff --git a/tests/turtle/test-30.out b/tests/turtle/test-30.out new file mode 100644 index 0000000..ce5c67d --- /dev/null +++ b/tests/turtle/test-30.out @@ -0,0 +1,5 @@ + . + . + . + . + . diff --git a/tests/turtle/test-30.ttl b/tests/turtle/test-30.ttl new file mode 100644 index 0000000..6721ec2 --- /dev/null +++ b/tests/turtle/test-30.ttl @@ -0,0 +1,12 @@ +# In-scope base URI is http://www.w3.org/2001/sw/DataAccess/df1/tests/ at this point + . +@base . +# In-scope base URI is http://example.org/ns/ at this point + . +@base . +# In-scope base URI is http://example.org/ns/foo/ at this point + . +@prefix : . +:a4 :b4 :c4 . +@prefix : . +:a5 :b5 :c5 . diff --git a/tests/turtle/test-31-out.ttl b/tests/turtle/test-31-out.ttl new file mode 100644 index 0000000..c1130ed --- /dev/null +++ b/tests/turtle/test-31-out.ttl @@ -0,0 +1,10 @@ +@prefix rdf: . +@prefix rss: . + + + rss:items [ + rdf:_1 ; + rdf:_2 ; + a rdf:Seq + ] . + diff --git a/tests/turtle/test-31.ttl b/tests/turtle/test-31.ttl new file mode 100644 index 0000000..c1130ed --- /dev/null +++ b/tests/turtle/test-31.ttl @@ -0,0 +1,10 @@ +@prefix rdf: . +@prefix rss: . + + + rss:items [ + rdf:_1 ; + rdf:_2 ; + a rdf:Seq + ] . + diff --git a/tests/turtle/test-32-out.ttl b/tests/turtle/test-32-out.ttl new file mode 100644 index 0000000..47e041a --- /dev/null +++ b/tests/turtle/test-32-out.ttl @@ -0,0 +1,8 @@ +@prefix rdf: . +@prefix ex: . + +ex:node1 + rdf:value (ex:item1 + ex:item2 + ) . + diff --git a/tests/turtle/test-32.ttl b/tests/turtle/test-32.ttl new file mode 100644 index 0000000..abf26d2 --- /dev/null +++ b/tests/turtle/test-32.ttl @@ -0,0 +1,5 @@ +@prefix rdf: . +@prefix ex: . + +# Based on Issue#0000274 http://bugs.librdf.org/mantis/view.php?id=274 +ex:node1 rdf:value ( ex:item1 ex:item2 ) . diff --git a/tests/turtle/test-33.out b/tests/turtle/test-33.out new file mode 100644 index 0000000..586e364 --- /dev/null +++ b/tests/turtle/test-33.out @@ -0,0 +1 @@ + "test-\\" . diff --git a/tests/turtle/test-33.ttl b/tests/turtle/test-33.ttl new file mode 100644 index 0000000..2206e33 --- /dev/null +++ b/tests/turtle/test-33.ttl @@ -0,0 +1,3 @@ +@prefix : . + +:s :p1 """test-\\""" . diff --git a/tests/turtle/test-34-out.ttl b/tests/turtle/test-34-out.ttl new file mode 100644 index 0000000..3e925e8 --- /dev/null +++ b/tests/turtle/test-34-out.ttl @@ -0,0 +1,7 @@ +@base . +@prefix rdf: <../../../../../1999/02/22-rdf-syntax-ns#> . +@prefix dbpedia: . + + + . + diff --git a/tests/turtle/test-34.ttl b/tests/turtle/test-34.ttl new file mode 100644 index 0000000..eb39a8d --- /dev/null +++ b/tests/turtle/test-34.ttl @@ -0,0 +1,4 @@ +@prefix dbpedia: . + + + . diff --git a/tests/turtle/test-36.out b/tests/turtle/test-36.out new file mode 100644 index 0000000..af94fe6 --- /dev/null +++ b/tests/turtle/test-36.out @@ -0,0 +1,2 @@ + "first long literal" . + "second long literal" . diff --git a/tests/turtle/test-36.ttl b/tests/turtle/test-36.ttl new file mode 100644 index 0000000..ceaad3d --- /dev/null +++ b/tests/turtle/test-36.ttl @@ -0,0 +1,4 @@ +# Test long literal twice to ensure it does not over-quote +@prefix : . +:a :b """first long literal""" . +:c :d """second long literal""" . diff --git a/tests/turtle/test-37.out b/tests/turtle/test-37.out new file mode 100644 index 0000000..629cbf4 --- /dev/null +++ b/tests/turtle/test-37.out @@ -0,0 +1 @@ + "Cheers"@en-UK . diff --git a/tests/turtle/test-37.ttl b/tests/turtle/test-37.ttl new file mode 100644 index 0000000..7fd527c --- /dev/null +++ b/tests/turtle/test-37.ttl @@ -0,0 +1,3 @@ +# Test long literal with lang tag +@prefix : . +:a :b """Cheers"""@en-UK . diff --git a/tests/turtle/test-38.out b/tests/turtle/test-38.out new file mode 100644 index 0000000..34c0366 --- /dev/null +++ b/tests/turtle/test-38.out @@ -0,0 +1 @@ + "\uD801\uDC69" . diff --git a/tests/turtle/test-38.ttl b/tests/turtle/test-38.ttl new file mode 100644 index 0000000..9ab942a --- /dev/null +++ b/tests/turtle/test-38.ttl @@ -0,0 +1,5 @@ +# http://bugs.librdf.org/mantis/view.php?id=505 + +@prefix rdfs: . + + rdfs:label "\ud801\udc69" . diff --git a/tests/turtle/test-39-out.ttl b/tests/turtle/test-39-out.ttl new file mode 100644 index 0000000..3810b8a --- /dev/null +++ b/tests/turtle/test-39-out.ttl @@ -0,0 +1,6 @@ +@prefix rdf: . +@prefix : . + +:a + :b ( ) . + diff --git a/tests/turtle/test-39.ttl b/tests/turtle/test-39.ttl new file mode 100644 index 0000000..adce0a2 --- /dev/null +++ b/tests/turtle/test-39.ttl @@ -0,0 +1,3 @@ +@prefix : . +:a :b ( ) . + diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt new file mode 100644 index 0000000..0067e4c --- /dev/null +++ b/utils/CMakeLists.txt @@ -0,0 +1,26 @@ +# raptor/utils/CMakeLists.txt +# +# Original listfile by Daniel Richard G. +# This file is in the public domain. +# + +INCLUDE_DIRECTORIES(BEFORE + ${CMAKE_CURRENT_SOURCE_DIR}/../src + ${CMAKE_BINARY_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR} +) + +IF(NOT HAVE_GETOPT AND NOT HAVE_GETOPT_LONG) + SET(getopt_sources getopt.c raptor_getopt.h) +ENDIF(NOT HAVE_GETOPT AND NOT HAVE_GETOPT_LONG) + +ADD_EXECUTABLE(rapper rapper.c ${getopt_sources}) +TARGET_LINK_LIBRARIES(rapper raptor2) + +ADD_EXECUTABLE(rdfdiff rdfdiff.c ${getopt_sources}) +TARGET_LINK_LIBRARIES(rdfdiff raptor2) + +INSTALL(FILES rapper.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) +INSTALL(TARGETS rapper DESTINATION ${CMAKE_INSTALL_BINDIR}) + +# end raptor/utils/CMakeLists.txt diff --git a/utils/Makefile.am b/utils/Makefile.am new file mode 100644 index 0000000..58fcdb8 --- /dev/null +++ b/utils/Makefile.am @@ -0,0 +1,91 @@ +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor utils +# +# Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + + +bin_PROGRAMS = rapper +noinst_PROGRAMS = rdfdiff + +man_MANS = rapper.1 + +CLEANFILES = *.plist + +# Memory debugging +MEM=@MEM@ +MEM_LIBS=@MEM_LIBS@ + +AM_CPPFLAGS= $(MEM) -I$(top_srcdir)/src +LIBS=@LIBS@ $(MEM_LIBS) + + +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) + + +EXTRA_DIST= \ +CMakeLists.txt \ +rapper.html \ +$(man_MANS) + +rapper_SOURCES = rapper.c +if GETOPT +rapper_SOURCES += getopt.c raptor_getopt.h +endif +rapper_LDADD= $(top_builddir)/src/libraptor2.la + +rdfdiff_SOURCES = rdfdiff.c +if GETOPT +rdfdiff_SOURCES += getopt.c raptor_getopt.h +endif +rdfdiff_LDADD= $(top_builddir)/src/libraptor2.la + + +if MAINTAINER_MODE +rapper.html: $(srcdir)/rapper.1 $(srcdir)/../scripts/fix-groff-xhtml.pl + -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(srcdir)/../scripts/fix-groff-xhtml.pl $@ +endif + +$(top_builddir)/src/libraptor2.la: + cd $(top_builddir)/src && $(MAKE) libraptor2.la + +if MAINTAINER_MODE +# Run Clang static analyzer over sources. +analyze: $(SOURCES) + @list='$(SOURCES)'; \ + result=0; \ + for file in $$list; do \ + if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ + $(RECHO) "Analyzing $$file"; \ + $(ANALYZE_COMMAND) $(srcdir)/$$file; \ + status=$$?; \ + if test $$status != 0; then \ + result=1; \ + fi; \ + fi; \ + done; \ + set -e; exit $$result +endif diff --git a/utils/Makefile.in b/utils/Makefile.in new file mode 100644 index 0000000..0e549b5 --- /dev/null +++ b/utils/Makefile.in @@ -0,0 +1,877 @@ +# Makefile.in generated by automake 1.16.5 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2021 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# -*- Mode: Makefile -*- +# +# Makefile.am - automake file for Raptor utils +# +# Copyright (C) 2000-2009, David Beckett http://www.dajobe.org/ +# Copyright (C) 2000-2004, University of Bristol, UK http://www.bristol.ac.uk/ +# +# This package is Free Software and part of Redland http://librdf.org/ +# +# It is licensed under the following three licenses as alternatives: +# 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version +# 2. GNU General Public License (GPL) V2 or any newer version +# 3. Apache License, V2.0 or any newer version +# +# You may not use this file except in compliance with at least one of +# the above three licenses. +# +# See LICENSE.html or LICENSE.txt at the top of this package for the +# complete terms and further detail along with the license texts for +# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. +# +# + +VPATH = @srcdir@ +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = rapper$(EXEEXT) +noinst_PROGRAMS = rdfdiff$(EXEEXT) +@GETOPT_TRUE@am__append_1 = getopt.c raptor_getopt.h +@GETOPT_TRUE@am__append_2 = getopt.c raptor_getopt.h +subdir = utils +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/build/gtk-doc.m4 \ + $(top_srcdir)/build/libtool.m4 \ + $(top_srcdir)/build/ltoptions.m4 \ + $(top_srcdir)/build/ltsugar.m4 \ + $(top_srcdir)/build/ltversion.m4 \ + $(top_srcdir)/build/lt~obsolete.m4 $(top_srcdir)/build/pkg.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/src/raptor_config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) +am__rapper_SOURCES_DIST = rapper.c getopt.c raptor_getopt.h +@GETOPT_TRUE@am__objects_1 = getopt.$(OBJEXT) +am_rapper_OBJECTS = rapper.$(OBJEXT) $(am__objects_1) +rapper_OBJECTS = $(am_rapper_OBJECTS) +rapper_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +am__rdfdiff_SOURCES_DIST = rdfdiff.c getopt.c raptor_getopt.h +am_rdfdiff_OBJECTS = rdfdiff.$(OBJEXT) $(am__objects_1) +rdfdiff_OBJECTS = $(am_rdfdiff_OBJECTS) +rdfdiff_DEPENDENCIES = $(top_builddir)/src/libraptor2.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src +depcomp = $(SHELL) $(top_srcdir)/build/depcomp +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/getopt.Po ./$(DEPDIR)/rapper.Po \ + ./$(DEPDIR)/rdfdiff.Po +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(rapper_SOURCES) $(rdfdiff_SOURCES) +DIST_SOURCES = $(am__rapper_SOURCES_DIST) $(am__rdfdiff_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +man1dir = $(mandir)/man1 +NROFF = nroff +MANS = $(man_MANS) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/build/depcomp +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BISON = @BISON@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +ETAGS = @ETAGS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILECMD = @FILECMD@ +GREP = @GREP@ +GTKDOC_CHECK = @GTKDOC_CHECK@ +GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@ +GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@ +GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@ +GTKDOC_MKPDF = @GTKDOC_MKPDF@ +GTKDOC_REBASE = @GTKDOC_REBASE@ +HTML_DIR = @HTML_DIR@ +ICU_CFLAGS = @ICU_CFLAGS@ +ICU_LIBS = @ICU_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JING = @JING@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBCURL_CFLAGS = @LIBCURL_CFLAGS@ +LIBCURL_LIBS = @LIBCURL_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ $(MEM_LIBS) +LIBTOOL = @LIBTOOL@ +LIBXML_CFLAGS = @LIBXML_CFLAGS@ +LIBXML_LIBS = @LIBXML_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ + +# Memory debugging +MEM = @MEM@ +MEM_LIBS = @MEM_LIBS@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PKG_CONFIG_REQUIRES = @PKG_CONFIG_REQUIRES@ +RANLIB = @RANLIB@ +RAPTOR_LDFLAGS = @RAPTOR_LDFLAGS@ +RAPTOR_LIBTOOLLIBS = @RAPTOR_LIBTOOLLIBS@ +RAPTOR_LIBTOOL_VERSION = @RAPTOR_LIBTOOL_VERSION@ +RAPTOR_PARSERS = @RAPTOR_PARSERS@ +RAPTOR_SERIALIZERS = @RAPTOR_SERIALIZERS@ +RAPTOR_VERSION = @RAPTOR_VERSION@ +RAPTOR_VERSION_DECIMAL = @RAPTOR_VERSION_DECIMAL@ +RAPTOR_VERSION_MAJOR = @RAPTOR_VERSION_MAJOR@ +RAPTOR_VERSION_MINOR = @RAPTOR_VERSION_MINOR@ +RAPTOR_VERSION_RELEASE = @RAPTOR_VERSION_RELEASE@ +RAPTOR_WWW_LIBRARY = @RAPTOR_WWW_LIBRARY@ +RAPTOR_XML_PARSER = @RAPTOR_XML_PARSER@ +RECHO = @RECHO@ +RECHO_C = @RECHO_C@ +RECHO_N = @RECHO_N@ +RPM_RELEASE = @RPM_RELEASE@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TAR = @TAR@ +VERSION = @VERSION@ +XML_CONFIG = @XML_CONFIG@ +XSLT_CFLAGS = @XSLT_CFLAGS@ +XSLT_CONFIG = @XSLT_CONFIG@ +XSLT_LIBS = @XSLT_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +runstatedir = @runstatedir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +man_MANS = rapper.1 +CLEANFILES = *.plist +AM_CPPFLAGS = $(MEM) -I$(top_srcdir)/src +ANALYZE = clang +ANALYZE_FLAGS = "--analyze" +# Based on COMPILE target +ANALYZE_COMMAND = $(ANALYZE) \ + $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(ANALYZE_FLAGS) + +EXTRA_DIST = \ +CMakeLists.txt \ +rapper.html \ +$(man_MANS) + +rapper_SOURCES = rapper.c $(am__append_1) +rapper_LDADD = $(top_builddir)/src/libraptor2.la +rdfdiff_SOURCES = rdfdiff.c $(am__append_2) +rdfdiff_LDADD = $(top_builddir)/src/libraptor2.la +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu utils/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu utils/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(bindir)" && rm -f $$files + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +installcheck-binPROGRAMS: $(bin_PROGRAMS) + bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ + case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ + *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ + esac; \ + f=`echo "$$p" | \ + sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + for opt in --help --version; do \ + if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ + 2>c$${pid}_.err &2; bad=1; fi; \ + done; \ + done; rm -f c$${pid}_.???; exit $$bad + +clean-noinstPROGRAMS: + @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + +rapper$(EXEEXT): $(rapper_OBJECTS) $(rapper_DEPENDENCIES) $(EXTRA_rapper_DEPENDENCIES) + @rm -f rapper$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rapper_OBJECTS) $(rapper_LDADD) $(LIBS) + +rdfdiff$(EXEEXT): $(rdfdiff_OBJECTS) $(rdfdiff_DEPENDENCIES) $(EXTRA_rdfdiff_DEPENDENCIES) + @rm -f rdfdiff$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rdfdiff_OBJECTS) $(rdfdiff_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rapper.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rdfdiff.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-man1: $(man_MANS) + @$(NORMAL_INSTALL) + @list1=''; \ + list2='$(man_MANS)'; \ + test -n "$(man1dir)" \ + && test -n "`echo $$list1$$list2`" \ + || exit 0; \ + echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ + { for i in $$list1; do echo "$$i"; done; \ + if test -n "$$list2"; then \ + for i in $$list2; do echo "$$i"; done \ + | sed -n '/\.1[a-z]*$$/p'; \ + fi; \ + } | while read p; do \ + if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; echo "$$p"; \ + done | \ + sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ + sed 'N;N;s,\n, ,g' | { \ + list=; while read file base inst; do \ + if test "$$base" = "$$inst"; then list="$$list $$file"; else \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ + fi; \ + done; \ + for i in $$list; do echo "$$i"; done | $(am__base_list) | \ + while read files; do \ + test -z "$$files" || { \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ + done; } + +uninstall-man1: + @$(NORMAL_UNINSTALL) + @list=''; test -n "$(man1dir)" || exit 0; \ + files=`{ for i in $$list; do echo "$$i"; done; \ + l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ + sed -n '/\.1[a-z]*$$/p'; \ + } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ + -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ + dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(MANS) +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -f ./$(DEPDIR)/getopt.Po + -rm -f ./$(DEPDIR)/rapper.Po + -rm -f ./$(DEPDIR)/rdfdiff.Po + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-binPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: install-man1 + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: installcheck-binPROGRAMS + +maintainer-clean: maintainer-clean-am + -rm -f ./$(DEPDIR)/getopt.Po + -rm -f ./$(DEPDIR)/rapper.Po + -rm -f ./$(DEPDIR)/rdfdiff.Po + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-man + +uninstall-man: uninstall-man1 + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ + clean-binPROGRAMS clean-generic clean-libtool \ + clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-man1 install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installcheck-binPROGRAMS \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-man \ + uninstall-man1 + +.PRECIOUS: Makefile + + +@MAINTAINER_MODE_TRUE@rapper.html: $(srcdir)/rapper.1 $(srcdir)/../scripts/fix-groff-xhtml.pl +@MAINTAINER_MODE_TRUE@ -groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(srcdir)/../scripts/fix-groff-xhtml.pl $@ + +$(top_builddir)/src/libraptor2.la: + cd $(top_builddir)/src && $(MAKE) libraptor2.la + +# Run Clang static analyzer over sources. +@MAINTAINER_MODE_TRUE@analyze: $(SOURCES) +@MAINTAINER_MODE_TRUE@ @list='$(SOURCES)'; \ +@MAINTAINER_MODE_TRUE@ result=0; \ +@MAINTAINER_MODE_TRUE@ for file in $$list; do \ +@MAINTAINER_MODE_TRUE@ if echo $$file | grep '\.c$$' >/dev/null 2>&1; then \ +@MAINTAINER_MODE_TRUE@ $(RECHO) "Analyzing $$file"; \ +@MAINTAINER_MODE_TRUE@ $(ANALYZE_COMMAND) $(srcdir)/$$file; \ +@MAINTAINER_MODE_TRUE@ status=$$?; \ +@MAINTAINER_MODE_TRUE@ if test $$status != 0; then \ +@MAINTAINER_MODE_TRUE@ result=1; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ fi; \ +@MAINTAINER_MODE_TRUE@ done; \ +@MAINTAINER_MODE_TRUE@ set -e; exit $$result + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/utils/getopt.c b/utils/getopt.c new file mode 100644 index 0000000..28dad21 --- /dev/null +++ b/utils/getopt.c @@ -0,0 +1,157 @@ +/* + * Public Domain getopt - history below + * + */ + +/* + * From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.sources + * Subject: getopt library routine Date: 30 Mar 85 04:45:33 GMT + */ + +/* + * getopt -- public domain version of standard System V routine + * + * Strictly enforces the System V Command Syntax Standard; provided by D A + * Gwyn of BRL for generic ANSI C implementations + * + * #define STRICT to prevent acceptance of clustered options with arguments + * and ommision of whitespace between option and arg. + */ + +/* + * Modified by Manuel Novoa III on 1/5/01 to use weak symbols. + * Programs needing long options will link gnu_getopt instead. + */ + +/* + * Last public domain version 1.5 downloaded from uclibc CVS: + * http://www.uclibc.org/cgi-bin/cvsweb/uClibc/libc/unistd/getopt.c + * on 2003-02-18 by Dave Beckett and tidied: + * Ran through "indent getopt.c -gnu" then fixed up the mess + * Removed register - compilers are smart these days + * ANSI-fied the declarations + * Prefixed with raptor_ so that it doesn't clash with any getopt + * linked in later. + */ + + +#include +#include + +#include + +int opterr; /* error => print message */ +int optind; /* next argv[] index */ +int optopt; /* Set for unknown arguments */ +char *optarg; /* option parameter if any */ + +/* + * Err: + * program name argv[0] + * specific message + * defective option letter + */ +static int +Err (char *name, char *mess, int c) /* returns '?' */ +{ + optopt = c; + if(opterr) + { + (void) fprintf (stderr, "%s: %s -- %c\n", name, mess, c); + } + + return '?'; /* erroneous-option marker */ +} + + +int +getopt (int argc, char * const argv[], const char *optstring) +{ + static int sp = 1; /* position within argument */ + int osp; /* saved `sp' for param test */ + +#ifndef STRICT + int oind; /* saved `optind' for param test */ +#endif + int c; /* option letter */ + char *cp; /* -> option in `optstring' */ + + optarg = NULL; + + /* initialise getopt vars */ + if(optind == 0) + { + optind = 1; + opterr = 1; + optopt = 1; + optarg = NULL; + } + + if(sp == 1) + { /* fresh argument */ + if(optind >= argc /* no more arguments */ + || argv[optind][0] != '-' /* no more options */ + || argv[optind][1] == '\0' /* not option; stdin */ + ) + return EOF; + else if(strcmp (argv[optind], "--") == 0) + { + ++optind; /* skip over "--" */ + return EOF; /* "--" marks end of options */ + } + } + + c = argv[optind][sp]; /* option letter */ + osp = sp++; /* get ready for next letter */ + +#ifndef STRICT + oind = optind; /* save optind for param test */ +#endif + if(argv[optind][sp] == '\0') + { /* end of argument */ + ++optind; /* get ready for next try */ + sp = 1; /* beginning of next argument */ + } + + if(c == ':' + || c == '?' /* optstring syntax conflict */ + || (cp = strchr (optstring, c)) == NULL) /* not found */ + { + return Err (argv[0], "illegal option", c); + } + + if(cp[1] == ':') + { /* option takes parameter */ +#ifdef STRICT + if(osp != 1) + { + return Err (argv[0], "option must not be clustered", c); + } + + /* reset by end of argument */ + if(sp != 1) + { + return Err (argv[0], "option must be followed by white space", c); + } +#else + if(oind == optind) + { /* argument w/o whitespace */ + optarg = &argv[optind][sp]; + sp = 1; /* beginning of next argument */ + } + + else +#endif + if(optind >= argc) + { + return Err (argv[0], "option requires an argument", c); + } + + else /* argument w/ whitespace */ + optarg = argv[optind]; + + ++optind; /* skip over parameter */ + } + + return c; +} diff --git a/utils/rapper.1 b/utils/rapper.1 new file mode 100644 index 0000000..43459df --- /dev/null +++ b/utils/rapper.1 @@ -0,0 +1,192 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" +.\" rapper.1 - Raptor RDF parsing and serializing utility manual page +.\" +.\" Copyright (C) 2002-2010 David Beckett - http://www.dajobe.org/ +.\" Copyright (C) 2002-2005 University of Bristol - http://www.bristol.ac.uk/ +.\" +.TH rapper 1 "2010-04-28" +.\" Please adjust this date whenever revising the manpage. +.SH NAME +rapper \- Raptor RDF parsing and serializing utility +.SH SYNOPSIS +.B rapper +.RB [ OPTIONS ] +.IR "INPUT-URI" +.IR "[INPUT-BASE-URI]" +.SH EXAMPLE +.nf +.B rapper -o ntriples http://planetrdf.com/guide/rss.rdf +.br +.B rapper -i rss-tag-soup -o rss-1.0 pile-of-rss.xml http://example.org/base/ +.br +.B rapper --count http://example.org/index.rdf +.SH DESCRIPTION +The +.B rapper +utility allows parsing of RDF content by the +.B Raptor +RDF parser toolkit emitting the results as RDF triples in +a choice of syntaxes. The \fIINPUT-URI\fR can be a file name, '-' +for standard input or if Raptor is built with a WWW retrieval +library, a general URI. The optional \fIINPUT-BASE-URI\fR is used as the +document parser base URI if present otherwise defaults to the \fIINPUT-URI\fR. +A value of '-' means no base URI. +.SH OPTIONS +rapper uses the usual GNU command line syntax, with long +options starting with two dashes (`-') if supported by the +getopt_long function. Otherwise the short options are only available. +.TP +.B \-h, \-\-help +Show a summary of the options. +.TP +.B \-i, \-\-input FORMAT +Set the input +.I FORMAT +to one of 'rdfxml' (RDF/XML, default), 'ntriples' +(N-Triples, see below), 'turtle' (Turtle, see below) +or 'rss-tag-soup' (RSS Tag Soup). The RSS Tag Soup parser +can turn the many XML RSS formats, Atom 0.3 and Atom 1.0 into RDF +triples. +.IP +The list of +parsers depends on how libraptor(3) was built. The list of +supported parsers is given in the help summary given by \-h. +.TP +.B \-I, \-\-input-uri URI +Set the input/parser base +.I URI +or use value '-' for no base. +The default is the INPUT-URI argument value. +.TP +.B \-o, \-\-output FORMAT +Set the output +.I FORMAT +to 'ntriples' (N-Triples, default), 'rdfxml' (RDF/XML), 'rdfxml-abbrev' +(RDF/XML with abbreviations) or 'rss-1.0' (RSS 1.0, also an RDF/XML syntax). +.IP +The list of +serializers depends on how libraptor(3) was built. The list of +supported serializers is given in the help summary given by \-h. +.TP +.B \-O, \-\-output-uri URI +Set the output/serializer base +.I URI +or use value '-' for no base. +The default is the input base uri, either set by the argument +INPUT-BASE-URI or via options +.B \-I, \-\-input-uri URI +.TP +.B \-c, \-\-count +Only count the triples and produce no other output. +.TP +.B \-e, \-\-ignore-errors +Ignore errors, do not emit the messages and try to continue parsing. +.TP +.B \-f, \-\-feature FEATURE[=VALUE] +Set a parser or serializer feature +.I FEATURE +to a value, or to 1 if +.I VALUE +is omitted, +Use \-f help to get lists of valid parser and serializer features. +.IP +If the form \-f 'xmlns:\fIprefix\fP=\(dq\fIuri\fP\(dq' is used, +the prefix and namespace uri given will be set for serializing. +The syntax matches XML in that either or both of \fIprefix\fP +or \fIuri\fP can be omitted. +.TP +.B \-g, \-\-guess +Guess the parser to use from the source-URI rather than use +the \-i FORMAT. +.TP +.B \-q, \-\-quiet +No extra information messages. +.TP +.B \-r, \-\-replace-newlines +Replace newlines in multi-line literals with spaces. +.TP +.B \-\-show-graphs +Print graph names (URIs) as they are seen in the input. This only +has a meaning for parsers that support graph names such as the TRiG parser. +.TP +.B \-\-show-namespaces +Print namespaces as they are seen in the input. +.TP +.B \-t, \-\-trace +Print URIs retrieved during parsing. Especially useful for +monitoring what the guess and GRDDL parsers are doing. +.TP +.B \-w, \-\-ignore-warnings +Ignore warnings, do not emit the messages. +.TP +.B \-v, \-\-version +Print the raptor version and exit. +.SH "EXAMPLES" +.br +.B rapper -q -i ntriples -o rdfxml -f 'xmlns:rss="http://purl.org/rss/1.0/"' -f 'xmlns:ex="http://example.org/"' tests/test.nt +.br +.B rapper -q -o rdfxml -f 'xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"' tests/rdf-schema.rdf 'http://www.w3.org/2000/01/rdf-schema#' +.SH "CONFORMING TO" +\fIRDF/XML Syntax (Revised)\fR, +W3C Recommendation, +.UR http://www.w3.org/TR/rdf-syntax-grammar/ +http://www.w3.org/TR/rdf-syntax-grammar/ +.UE + +\fIN-Triples\fR, in \fIRDF Test Cases\fR, Jan Grant and Dave Beckett (eds.), +W3C Recommendation, +.UR http://www.w3.org/TR/rdf-testcases/#ntriples +http://www.w3.org/TR/rdf-testcases/#ntriples +.UE + +\fITurtle Terse RDF Triple Language\fR, Dave Beckett, +.UR http://www.dajobe.org/2004/01/turtle/ +http://www.dajobe.org/2004/01/turtle/ +.UE + +\fIRDFA in XHTML: Syntax and Processing\fR, Ben Adida, Mark Birbeck, +Shane McCarron and Steven Pemberton (eds.), +W3C Candidate Recommendation, 20 June 2008 +.UR http://www.w3.org/TR/2008/CR-rdfa-syntax-20080620/ +http://www.w3.org/TR/2008/CR-rdfa-syntax-20080620/ +.UE + +\fIRDF Site Summary (RSS) 1.0\fR, 2000-12-06 +.UR http://purl.org/rss/1.0/spec +http://purl.org/rss/1.0/spec +.UE +.SH SEE ALSO +.BR libraptor(3), raptor-config(1) +.SH CHANGES +.SS 2.0.0 +Removed \-a option that did nothing. +.LP +Removed \-m option from rapper but it was never documented here. +.LP +Removed \-n option that was long hidden. +.LP +Removed \-s option that was equivalent to \-f scanForRDF +.SS 1.4.16 +Added \-I/\-\-input-uri and \-O/\-\-output\-uri to set the input and output +(parser and serializer) base URIs separately. +.SS 1.4.15 +Added \-t/\-\-trace to do URI traces. +.SS 1.4.5 +Updated to add serializer rdfxml-abbrev +.SS 1.4.3 +Updated potential parser and serializers and described \-f for +defining namespaces. +.SS 1.3.0 +Added \-f for features. +.br +Added \-g for guessing the parser to use. +.SS 1.1.0 +Removed \-a, \-\-assume since rdf:RDF is now always optional. +.br +.SH AUTHOR +Dave Beckett - +.UR http://www.dajobe.org/ +http://www.dajobe.org/ +.UE +.br diff --git a/utils/rapper.c b/utils/rapper.c new file mode 100644 index 0000000..03b163f --- /dev/null +++ b/utils/rapper.c @@ -0,0 +1,972 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * rapper.c - Raptor RDF Parsing and Serializing utility + * + * Copyright (C) 2000-2010, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +/* Raptor includes */ +#include + +/* for access() and R_OK */ +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef WIN32 +#include +#endif + +/* many places for getopt */ +#ifdef HAVE_GETOPT_H +#include +#else +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + + + + +#ifdef NEED_OPTIND_DECLARATION +extern int optind; +extern char *optarg; +#endif + +static void print_triples(void *user_data, raptor_statement *statement); +static void print_graph(void *user_data, raptor_uri *graph, int flags); +static void print_namespaces(void* user_data, raptor_namespace *nspace); +static void relay_namespaces(void* user_data, raptor_namespace *nspace); +int main(int argc, char *argv[]); + + +static char *program = NULL; + +/* replace newlines in literal string output with spaces */ +static int replace_newlines = 0; + +/* extra noise? */ +static int quiet = 0; +/* just count, no printing */ +static int count = 0; + +static long triple_count = 0; + +static raptor_serializer* serializer = NULL; + +static int guess = 0; + +static int reported_guess = 0; + +static int report_namespace = 0; + +static int report_graph = 0; + + +static +void print_triples(void *user_data, raptor_statement *triple) +{ + raptor_parser* rdf_parser = (raptor_parser*)user_data; + triple_count++; + + if(guess && !quiet && !reported_guess) { + fprintf(stderr, "%s: Guessed parser name '%s'\n", + program, raptor_parser_get_name(rdf_parser)); + reported_guess = 1; + } + + + if(count) + return; + + /* replace newlines with spaces if object is a literal string */ + if(replace_newlines && + triple->object->type == RAPTOR_TERM_TYPE_LITERAL) { + char *s; + for(s = (char*)triple->object->value.literal.string; *s; s++) + if(*s == '\n') + *s=' '; + } + + raptor_serializer_serialize_statement(serializer, triple); + return; +} + + +static +void print_graph(void *user_data, raptor_uri *graph, int flags) +{ + /* raptor_parser *parser = (raptor_parser *)user_data; */ + const char* const label = (flags & RAPTOR_GRAPH_MARK_START) + ? (const char*)"start" : (const char*)"end"; + + if(!report_graph) + return; + + if(graph) + fprintf(stderr, "%s: Graph URI %s %s\n", + program, raptor_uri_as_string(graph), label); + else + fprintf(stderr, "%s: Default graph %s\n", + program, label); +} + + +static void +print_namespaces(void* user_data, raptor_namespace *nspace) +{ + /* raptor_parser* rdf_parser = (raptor_parser*)user_data; */ + unsigned char *s; + + if(!report_namespace) + return; + + s = raptor_namespace_format_as_xml(nspace, NULL); + fprintf(stderr, "%s: Namespace declared: %s\n", + program, s); + raptor_free_memory(s); + + return; +} + + +static void +relay_namespaces(void* user_data, raptor_namespace *nspace) +{ + raptor_serializer* rdf_serializer = (raptor_serializer*)user_data; + + if(report_namespace) + print_namespaces(user_data, nspace); + + raptor_serializer_set_namespace_from_namespace(rdf_serializer, nspace); +} + + + +#ifdef HAVE_GETOPT_LONG +#define HELP_TEXT(short, long, description) " -" short ", --" long " " description +#define HELP_TEXT_LONG(long, description) " --" long " " description +#define HELP_ARG(short, long) "--" #long +#define HELP_ARG_BOTH(short, long) " \"-" short "\" or \"--" long "\"" +#define HELP_PAD "\n " +#else +#define HELP_TEXT(short, long, description) " -" short " " description +#define HELP_TEXT_LONG(long, description) +#define HELP_ARG(short, long) "-" #short +#define HELP_ARG_BOTH(short, long) "\"-" short "\"" +#define HELP_PAD "\n " +#endif + + +#define GETOPT_STRING "cef:ghi:I:o:O:qrtvw" + +#ifdef HAVE_GETOPT_LONG +#define SHOW_NAMESPACES_FLAG 0x100 +#define SHOW_GRAPHS_FLAG 0x200 + +static const struct option long_options[] = +{ + /* name, has_arg, flag, val */ + {"count", 0, 0, 'c'}, + {"ignore-errors", 0, 0, 'e'}, + {"feature", 1, 0, 'f'}, + {"guess", 0, 0, 'g'}, + {"help", 0, 0, 'h'}, + {"input", 1, 0, 'i'}, + {"input-uri", 1, 0, 'I'}, + {"output", 1, 0, 'o'}, + {"output-uri", 1, 0, 'O'}, + {"quiet", 0, 0, 'q'}, + {"replace-newlines", 0, 0, 'r'}, + {"show-graphs", 0, 0, SHOW_GRAPHS_FLAG}, + {"show-namespaces", 0, 0, SHOW_NAMESPACES_FLAG}, + {"trace", 0, 0, 't'}, + {"version", 0, 0, 'v'}, + {"ignore-warnings", 0, 0, 'w'}, + {NULL, 0, 0, 0} +}; +#endif + + +static int error_count = 0; +static int warning_count = 0; + +static int ignore_warnings = 0; +static int ignore_errors = 0; + +static const char * const title_string = + "Raptor RDF syntax parsing and serializing utility"; + + +static void +rapper_log_handler(void *data, raptor_log_message *message) +{ + raptor_parser *parser = (raptor_parser *)data; + + switch(message->level) { + case RAPTOR_LOG_LEVEL_FATAL: + case RAPTOR_LOG_LEVEL_ERROR: + if(!ignore_errors) { + fprintf(stderr, "%s: Error - ", program); + raptor_locator_print(message->locator, stderr); + fprintf(stderr, " - %s\n", message->text); + + raptor_parser_parse_abort(parser); + } + + error_count++; + break; + + case RAPTOR_LOG_LEVEL_WARN: + if(!ignore_warnings) { + fprintf(stderr, "%s: Warning - ", program); + raptor_locator_print(message->locator, stderr); + fprintf(stderr, " - %s\n", message->text); + } + + warning_count++; + break; + + case RAPTOR_LOG_LEVEL_NONE: + case RAPTOR_LOG_LEVEL_TRACE: + case RAPTOR_LOG_LEVEL_DEBUG: + case RAPTOR_LOG_LEVEL_INFO: + + fprintf(stderr, "%s: Unexpected %s message - ", program, + raptor_log_level_get_label(message->level)); + raptor_locator_print(message->locator, stderr); + fprintf(stderr, " - %s\n", message->text); + break; + } + +} + +struct namespace_decl +{ + unsigned char *prefix; + unsigned char *uri_string; +}; + + +static void +rapper_free_namespace_decl(void* data) { + struct namespace_decl* nsd = (struct namespace_decl*)data; + if(nsd->prefix) + raptor_free_memory(nsd->prefix); + if(nsd->uri_string) + raptor_free_memory(nsd->uri_string); + raptor_free_memory(nsd); +} + + +static int +rapper_uri_trace(void *user_data, raptor_uri* uri) +{ + fprintf(stderr, "%s: Tracing retrieval of URI %s\n", + program, raptor_uri_as_string(uri)); + return 0; +} + + +typedef struct +{ + raptor_option option; + int i_value; + const char* s_value; +} option_value; + + + +int +main(int argc, char *argv[]) +{ + /* input variables - parser + * 'uri_string' is set to a URI otherwise 'filename' is file name + * or if NULL, stdin. Base URI in 'base_uri_string' is required for stdin. + */ + raptor_world* world = NULL; + raptor_parser* rdf_parser = NULL; + char *filename = NULL; +#define FILENAME_LABEL(name) ((name) ? (name) : "") + unsigned char *uri_string = NULL; + int free_uri_string = 0; + raptor_uri *uri; + unsigned char *base_uri_string = NULL; + raptor_uri *base_uri = NULL; + const char *syntax_name="rdfxml"; + raptor_sequence* parser_options = NULL; + int trace = 0; + + /* output variables - serializer */ + /* 'serializer' object variable is a global */ + const char *serializer_syntax_name = "ntriples"; + const unsigned char *output_base_uri_string = NULL; + raptor_uri *output_base_uri = NULL; + raptor_sequence* serializer_options = NULL; + raptor_sequence *namespace_declarations = NULL; + + /* other variables */ + int rc; + int usage = 0; + int help = 0; + char *p; + + program = argv[0]; + if((p = strrchr(program, '/'))) + program = p + 1; + else if((p = strrchr(program, '\\'))) + program = p + 1; + argv[0] = program; + + world = raptor_new_world(); + if(!world) + exit(1); + rc = raptor_world_open(world); + if(rc) + exit(1); + + while(!usage && !help) + { + int c; +#ifdef HAVE_GETOPT_LONG + int option_index = 0; + + c = getopt_long (argc, argv, GETOPT_STRING, long_options, &option_index); +#else + c = getopt (argc, argv, GETOPT_STRING); +#endif + if(c == -1) + break; + + switch (c) { + case 0: + case '?': /* getopt() - unknown option */ + usage = 1; + break; + + case 'c': + count = 1; + if(serializer_syntax_name) + serializer_syntax_name = NULL; + break; + + case 'f': + if(optarg) { + if(!strcmp(optarg, "help")) { + int option_count = (int)raptor_option_get_count(); + int i; + + fprintf(stderr, "%s: Valid parser options are:\n", + program); + for(i = 0; i < option_count; i++) { + raptor_option_description *od; + + od = raptor_world_get_option_description(world, + RAPTOR_DOMAIN_PARSER, + (raptor_option)i); + if(od) { + fprintf(stderr, " %-21s %s (%s)\n", + od->name, od->label, + raptor_option_get_value_type_label(od->value_type)); + } + } + fprintf(stderr, "%s: Valid serializer options are:\n", + program); + for(i = 0; i < option_count; i++) { + raptor_option_description *od; + + od = raptor_world_get_option_description(world, + RAPTOR_DOMAIN_SERIALIZER, + (raptor_option)i); + if(od) { + fprintf(stderr, " %-21s %s (%s)\n", + od->name, od->label, + raptor_option_get_value_type_label(od->value_type)); + raptor_free_option_description(od); + } + } + fputs("Options are set with `" HELP_ARG(f, option) " OPTION = VALUE or `-f OPTION'\n" + "and take a decimal integer VALUE except where noted, defaulting to 1 if omitted.\n", stderr); + fputs("\nA option of the form xmlns:PREFIX=\"URI\" can be used to declare output\n" + "namespace prefixes and names for serializing using an XML-style syntax\n" + "Either or both of PREFIX or URI can be omitted such as -f xmlns=\"URI\"\n" + "This form can be repeated for multiple declarations.\n", + stderr); + + raptor_free_world(world); + exit(0); + } else if(!strncmp(optarg, "xmlns", 5)) { + struct namespace_decl *nd; + nd = (struct namespace_decl *)raptor_alloc_memory(sizeof(*nd)); + if(raptor_xml_namespace_string_parse((unsigned char*)optarg, + &nd->prefix, + &nd->uri_string)) { + fprintf(stderr, "%s: Bad xmlns syntax in '%s'\n", + program, optarg); + rapper_free_namespace_decl(nd); + + raptor_free_world(world); + exit(0); + } + + if(!namespace_declarations) + namespace_declarations = raptor_new_sequence(rapper_free_namespace_decl, NULL); + + raptor_sequence_push(namespace_declarations, nd); + } else { + int option_count = (int)raptor_option_get_count(); + int i; + size_t arg_len = strlen(optarg); + option_value* fv; + int ok = 0; + + /* parser options */ + for(i = 0; i < option_count; i++) { + raptor_domain domain; + raptor_option_description *od; + size_t name_len; + + domain = RAPTOR_DOMAIN_PARSER; + od = raptor_world_get_option_description(world, + domain, + (raptor_option)i); + if(!od) { + domain = RAPTOR_DOMAIN_SERIALIZER; + od = raptor_world_get_option_description(world, + domain, + (raptor_option)i); + if(!od) + /* Neither a parser or serializer option - skip */ + continue; + } + + name_len = od->name_len; + if(!strncmp(optarg, od->name, name_len)) { + fv = (option_value*)raptor_calloc_memory(sizeof(option_value), + 1); + + fv->option = (raptor_option)i; + if(od->value_type == RAPTOR_OPTION_VALUE_TYPE_BOOL || + od->value_type == RAPTOR_OPTION_VALUE_TYPE_INT) { + if(name_len < arg_len && optarg[name_len] == '=') + fv->i_value = atoi(&optarg[name_len + 1]); + else if(name_len == arg_len) + fv->i_value = 1; + } else { + if(name_len < arg_len && optarg[name_len] == '=') + fv->s_value = &optarg[name_len + 1]; + else if(name_len == arg_len) + fv->s_value = (const char*)""; + } + + if(domain == RAPTOR_DOMAIN_PARSER) { + if(!parser_options) + parser_options = raptor_new_sequence(raptor_free_memory, + NULL); + raptor_sequence_push(parser_options, fv); + } else { + /* RAPTOR_DOMAIN_SERIALIZER */ + if(!serializer_options) + serializer_options = raptor_new_sequence(raptor_free_memory, + NULL); + raptor_sequence_push(serializer_options, fv); + } + + ok = 1; + } + raptor_free_option_description(od); + + if(ok) + break; + } + + + if(!ok) { + fprintf(stderr, + "%s: invalid argument `%s' for `" HELP_ARG(f, option) "'\n" + "Try '%s " HELP_ARG(f, option) " help' for a list of valid options\n", + program, optarg, program); + usage = 1; + } + } + } + break; + + case 'g': + guess = 1; + break; + + case 'h': + help = 1; + break; + + case 't': + trace = 1; + break; + + case 'q': + quiet = 1; + break; + + case 'r': + replace_newlines = 1; + break; + + case 'o': + if(optarg) { + if(raptor_world_is_serializer_name(world, optarg)) + serializer_syntax_name = optarg; + else { + int i; + + fprintf(stderr, + "%s: invalid argument `%s' for `" HELP_ARG(o, output) "'\n", + program, optarg); + fprintf(stderr, "Valid arguments are:\n"); + for(i = 0; 1; i++) { + const raptor_syntax_description* sd; + sd = raptor_world_get_serializer_description(world, i); + if(!sd) + break; + fprintf(stderr, " %-14s for %s\n", sd->names[0], sd->label); + } + usage = 1; + break; + + } + } + break; + + case 'O': + if(optarg) + output_base_uri_string = (const unsigned char*)optarg; + break; + + case 'i': + if(optarg) { + if(raptor_world_is_parser_name(world, optarg)) + syntax_name = optarg; + else { + int i; + + fprintf(stderr, + "%s: invalid argument `%s' for `" HELP_ARG(i, input) "'\n", + program, optarg); + fprintf(stderr, "Valid arguments are:\n"); + for(i = 0; 1; i++) { + const raptor_syntax_description* sd; + sd = raptor_world_get_parser_description(world, i); + if(!sd) + break; + fprintf(stderr, " %-14s for %s\n", sd->names[0], sd->label); + } + usage = 1; + break; + + } + } + break; + + case 'I': + if(optarg) + base_uri_string = (unsigned char*)optarg; + break; + + case 'w': + ignore_warnings = 1; + break; + + case 'e': + ignore_errors = 1; + break; + + case 'v': + fputs(raptor_version_string, stdout); + fputc('\n', stdout); + + raptor_free_world(world); + exit(0); + +#ifdef SHOW_NAMESPACES_FLAG + case SHOW_NAMESPACES_FLAG: + report_namespace = 1; + break; +#endif + +#ifdef SHOW_GRAPHS_FLAG + case SHOW_GRAPHS_FLAG: + report_graph = 1; + break; +#endif + + } /* end switch */ + + } + + if(optind != argc-1 && optind != argc-2 && !help && !usage) { + usage = 2; /* Title and usage */ + } + + + if(usage) { + if(usage > 1) { + fputs(title_string, stderr); putc(' ', stderr); fputs(raptor_version_string, stderr); putc('\n', stderr); + fputs("Raptor home page: ", stderr); + fputs(raptor_home_url_string, stderr); + fputc('\n', stderr); + fputs(raptor_copyright_string, stderr); + fputs("\nLicense: ", stderr); + fputs(raptor_license_string, stderr); + fputs("\n\n", stderr); + } + fprintf(stderr, "Try `%s " HELP_ARG(h, help) "' for more information.\n", + program); + + raptor_free_world(world); + exit(1); + } + + if(help) { + int i; + + puts(title_string); putchar(' '); puts(raptor_version_string); putchar('\n'); + puts("Parse RDF syntax from a source into serialized RDF triples."); + printf("Usage: %s [OPTIONS] INPUT-URI [INPUT-BASE-URI]\n\n", program); + + fputs(raptor_copyright_string, stdout); + fputs("\nLicense: ", stdout); + puts(raptor_license_string); + fputs("Raptor home page: ", stdout); + puts(raptor_home_url_string); + + puts("\nArguments:"); + puts(" INPUT-URI a filename, URI or '-' for standard input (stdin)."); + puts(" INPUT-BASE-URI the input/parser base URI or '-' for none.\n" + " Default is INPUT-URI\n" + " Equivalent to" HELP_ARG_BOTH("I INPUT-BASE-URI", "input-uri INPUT-BASE-URI")); + + puts("\nMain options:"); + puts(HELP_TEXT("i FORMAT", "input FORMAT ", "Set the input format/parser to one of:")); + for(i = 0; 1; i++) { + const raptor_syntax_description* sd; + sd = raptor_world_get_parser_description(world, i); + if(!sd) + break; + printf(" %-14s %s", sd->names[0], sd->label); + if(!i) + puts(" (default)"); + else + putchar('\n'); + } + puts(HELP_TEXT("I URI", "input-uri URI ", "Set the input/parser base URI. '-' for none.") HELP_PAD " Default is INPUT-BASE-URI argument value."); + putchar('\n'); + + puts(HELP_TEXT("o FORMAT", "output FORMAT", "Set the output format/serializer to one of:")); + for(i = 0; 1; i++) { + const raptor_syntax_description* sd; + sd = raptor_world_get_serializer_description(world, i); + if(!sd) + break; + printf(" %-14s %s", sd->names[0], sd->label); + if(!i) + puts(" (default)"); + else + putchar('\n'); + } + puts(HELP_TEXT("O URI", "output-uri URI ", "Set the output/serializer base URI. '-' for none.") HELP_PAD " Default is input/parser base URI."); + putchar('\n'); + + puts("General options:"); + puts(HELP_TEXT("c", "count ", "Count triples only - do not print them.")); + puts(HELP_TEXT("e", "ignore-errors ", "Ignore error messages")); + puts(HELP_TEXT("f OPTION(=VALUE)", "feature OPTION(=VALUE)", HELP_PAD "Set parser or serializer options" HELP_PAD "Use `-f help' for a list of valid options")); + puts(HELP_TEXT("g", "guess ", "Guess the input syntax (same as -i guess)")); + puts(HELP_TEXT("h", "help ", "Print this help, then exit")); + puts(HELP_TEXT("q", "quiet ", "No extra information messages")); + puts(HELP_TEXT("r", "replace-newlines", "Replace newlines with spaces in literals")); +#ifdef SHOW_GRAPHS_FLAG + puts(HELP_TEXT_LONG("show-graphs ", "Show named graphs as they are declared")); +#endif +#ifdef SHOW_NAMESPACES_FLAG + puts(HELP_TEXT_LONG("show-namespaces ", "Show namespaces as they are declared")); +#endif + puts(HELP_TEXT("t", "trace ", "Trace URIs retrieved during parsing")); + puts(HELP_TEXT("w", "ignore-warnings ", "Ignore warning messages")); + puts(HELP_TEXT("v", "version ", "Print the Raptor version")); + puts("\nReport bugs to http://bugs.librdf.org/"); + + raptor_free_world(world); + exit(0); + } + + + if(optind == argc-1) + uri_string = (unsigned char*)argv[optind]; + else { + uri_string = (unsigned char*)argv[optind++]; + base_uri_string = (unsigned char*)argv[optind]; + } + + /* If uri_string is "path-to-file", turn it into a file: URI */ + if(!strcmp((const char*)uri_string, "-")) { + if(!base_uri_string) { + fprintf(stderr, + "%s: A Base URI is required when reading from standard input.\n", + program); + return(1); + } + uri_string = NULL; + } else if(!access((const char*)uri_string, R_OK)) { + filename = (char*)uri_string; + uri_string = raptor_uri_filename_to_uri_string(filename); + if(!uri_string) { + fprintf(stderr, "%s: Failed to create URI for file %s.\n", + program, filename); + return(1); + } + free_uri_string = 1; + } + + if(uri_string) { + uri = raptor_new_uri(world, uri_string); + if(!uri) { + fprintf(stderr, "%s: Failed to create URI for %s\n", + program, uri_string); + return(1); + } + } else + uri = NULL; /* stdin */ + + + /* Set the input/parser base URI */ + if(base_uri_string) { + if(strcmp((const char*)base_uri_string, "-")) { + base_uri = raptor_new_uri(world, base_uri_string); + if(!base_uri) { + fprintf(stderr, "%s: Failed to create URI for %s\n", + program, base_uri_string); + return(1); + } + } + } + + + /* Set the output/serializer base URI from the argument if explicitly + * set, otherwise default to the input base URI if present. + */ + if(!output_base_uri_string) { + if(base_uri) + output_base_uri = raptor_uri_copy(base_uri); + } else { + if(strcmp((const char*)output_base_uri_string, "-")) { + output_base_uri = raptor_new_uri(world, output_base_uri_string); + if(!output_base_uri) { + fprintf(stderr, "%s: Failed to create output base URI for %s\n", + program, output_base_uri_string); + return(1); + } + } else + output_base_uri = NULL; + } + + + if(guess) + syntax_name="guess"; + + rdf_parser = raptor_new_parser(world, syntax_name); + if(!rdf_parser) { + fprintf(stderr, "%s: Failed to create raptor parser type %s\n", + program, syntax_name); + return(1); + } + + raptor_world_set_log_handler(world, rdf_parser, rapper_log_handler); + + if(parser_options) { + option_value *fv; + while((fv = (option_value*)raptor_sequence_pop(parser_options))) { + raptor_parser_set_option(rdf_parser, fv->option, + fv->s_value, fv->i_value); + raptor_free_memory(fv); + } + raptor_free_sequence(parser_options); + parser_options = NULL; + } + + if(trace) + raptor_parser_set_uri_filter(rdf_parser, rapper_uri_trace, rdf_parser); + + + if(!quiet) { + if(uri_string) { + if(base_uri_string) + fprintf(stderr, "%s: Parsing URI %s with parser %s and base URI %s\n", + program, uri_string, syntax_name, base_uri_string); + else + fprintf(stderr, "%s: Parsing URI %s with parser %s\n", program, + uri_string, syntax_name); + } else { + if(base_uri_string) + fprintf(stderr, + "%s: Parsing file %s with parser %s and base URI %s\n", program, + FILENAME_LABEL(filename), syntax_name, base_uri_string); + else + fprintf(stderr, "%s: Parsing file %s with parser %s\n", program, + FILENAME_LABEL(filename), syntax_name); + } + } + + raptor_parser_set_statement_handler(rdf_parser, rdf_parser, print_triples); + + if(report_graph) + raptor_parser_set_graph_mark_handler(rdf_parser, rdf_parser, print_graph); + + if(report_namespace) + raptor_parser_set_namespace_handler(rdf_parser, rdf_parser, + print_namespaces); + + + if(serializer_syntax_name) { + if(!quiet) { + if(output_base_uri) + fprintf(stderr, "%s: Serializing with serializer %s and base URI %s\n", + program, serializer_syntax_name, + raptor_uri_as_string(output_base_uri)); + else + fprintf(stderr, "%s: Serializing with serializer %s\n", + program, serializer_syntax_name); + } + + serializer = raptor_new_serializer(world, serializer_syntax_name); + if(!serializer) { + fprintf(stderr, + "%s: Failed to create raptor serializer type %s\n", program, + serializer_syntax_name); + return(1); + } + + if(namespace_declarations) { + int i; + for(i = 0; i< raptor_sequence_size(namespace_declarations); i++) { + struct namespace_decl *nd; + raptor_uri *ns_uri = NULL; + + nd = (struct namespace_decl*)raptor_sequence_get_at(namespace_declarations, i); + if(nd->uri_string) + ns_uri = raptor_new_uri(world, nd->uri_string); + + raptor_serializer_set_namespace(serializer, ns_uri, nd->prefix); + if(ns_uri) + raptor_free_uri(ns_uri); + } + raptor_free_sequence(namespace_declarations); + namespace_declarations = NULL; + } + + if(serializer_options) { + option_value *fv; + while((fv = (option_value*)raptor_sequence_pop(serializer_options))) { + raptor_serializer_set_option(serializer, fv->option, + fv->s_value, fv->i_value); + raptor_free_memory(fv); + } + raptor_free_sequence(serializer_options); + serializer_options = NULL; + } + + raptor_serializer_start_to_file_handle(serializer, + output_base_uri, stdout); + + if(!report_namespace) + raptor_parser_set_namespace_handler(rdf_parser, serializer, + relay_namespaces); + } + + + /* Begin the parsing of the content from file or URI, + * sending it to serializer via callback print_triples() + */ + rc = 0; + if(!uri || filename) { + if(raptor_parser_parse_file(rdf_parser, uri, base_uri)) { + fprintf(stderr, "%s: Failed to parse file %s %s content\n", + program, FILENAME_LABEL(filename), syntax_name); + rc = 1; + } + } else { + if(raptor_parser_parse_uri(rdf_parser, uri, base_uri)) { + fprintf(stderr, "%s: Failed to parse URI %s %s content\n", + program, uri_string, syntax_name); + rc = 1; + } + } + + raptor_free_parser(rdf_parser); + + if(serializer) { + raptor_serializer_serialize_end(serializer); + raptor_free_serializer(serializer); + } + + + if(!quiet) { + if(triple_count == 1) + fprintf(stderr, "%s: Parsing returned 1 triple\n", + program); + else + fprintf(stderr, "%s: Parsing returned %ld triples\n", + program, triple_count); + } + + if(output_base_uri) + raptor_free_uri(output_base_uri); + if(base_uri) + raptor_free_uri(base_uri); + if(uri) + raptor_free_uri(uri); + if(free_uri_string) + raptor_free_memory(uri_string); + + if(namespace_declarations) + raptor_free_sequence(namespace_declarations); + if(parser_options) + raptor_free_sequence(parser_options); + if(serializer_options) + raptor_free_sequence(serializer_options); + + raptor_free_world(world); + + if(error_count && !ignore_errors) + return 1; + + if(warning_count && !ignore_warnings) + return 2; + + return(rc); +} diff --git a/utils/rapper.html b/utils/rapper.html new file mode 100644 index 0000000..e69de29 diff --git a/utils/raptor_getopt.h b/utils/raptor_getopt.h new file mode 100644 index 0000000..56ba8ea --- /dev/null +++ b/utils/raptor_getopt.h @@ -0,0 +1,21 @@ +/* + * Public Domain getopt header + * + */ + +#ifndef RAPTOR_GETOPT_H +#define RAPTOR_GETOPT_H + +#ifdef __cplusplus +extern "C" { +#endif + +int getopt(int argc, char * const argv[], const char *optstring); +extern char *optarg; +extern int optind, opterr, optopt; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/utils/rdfdiff.c b/utils/rdfdiff.c new file mode 100644 index 0000000..fa604e5 --- /dev/null +++ b/utils/rdfdiff.c @@ -0,0 +1,1069 @@ +/* -*- Mode: c; c-basic-offset: 2 -*- + * + * rdfdiff.c - Raptor RDF diff tool + * + * Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/ + * Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/ + * Copyright (C) 2005, Steve Shepard steveshep@gmail.com + * + * This package is Free Software and part of Redland http://librdf.org/ + * + * It is licensed under the following three licenses as alternatives: + * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version + * 2. GNU General Public License (GPL) V2 or any newer version + * 3. Apache License, V2.0 or any newer version + * + * You may not use this file except in compliance with at least one of + * the above three licenses. + * + * See LICENSE.html or LICENSE.txt at the top of this package for the + * complete terms and further detail along with the license texts for + * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. + * + * + */ + + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +/* Raptor includes */ +#include +#include + +/* for access() and R_OK */ +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef WIN32 +#include +#endif + +/* many places for getopt */ +#ifdef HAVE_GETOPT_H +#include +#else +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#if 0 +#undef RAPTOR_DEBUG +#define RAPTOR_DEBUG 2 +#endif + +#ifndef RAPTOR_INTERNAL +#define RAPTOR_MALLOC(type, size) (type)malloc(size) +#define RAPTOR_CALLOC(type, nmemb, size) (type)calloc(nmemb, size) +#define RAPTOR_FREE(type, ptr) free((void*)ptr) +#endif + +#ifdef NEED_OPTIND_DECLARATION +extern int optind; +extern char *optarg; +#endif + +#define MAX_ASCII_INT_SIZE 13 +#define RDF_NAMESPACE_URI_LEN 43 +#define ORDINAL_STRING_LEN (RDF_NAMESPACE_URI_LEN + MAX_ASCII_INT_SIZE + 1) + +#define GETOPT_STRING "bhf:t:u:" + +#ifdef HAVE_GETOPT_LONG +static const struct option long_options[] = +{ + /* name, has_arg, flag, val */ + {"brief" , 0, 0, 'b'}, + {"help" , 0, 0, 'h'}, + {"from-format" , 1, 0, 'f'}, + {"to-format" , 1, 0, 't'}, + {"base-uri" , 1, 0, 'u'}, + {NULL , 0, 0, 0} +}; +#endif + +#ifdef HAVE_GETOPT_LONG +#define HELP_TEXT(short, long, description) " -" short ", --" long " " description +#define HELP_ARG(short, long) "--" #long +#define HELP_PAD "\n " +#else +#define HELP_TEXT(short, long, description) " -" short " " description +#define HELP_ARG(short, long) "-" #short +#define HELP_PAD "\n " +#endif + +typedef struct rdfdiff_link_s { + struct rdfdiff_link_s *next; + raptor_statement *statement; +} rdfdiff_link; + +typedef struct rdfdiff_blank_s { + struct rdfdiff_blank_s *next; + raptor_world *world; + char *blank_id; + raptor_statement *owner; + rdfdiff_link *first; + rdfdiff_link *last; + int matched; +} rdfdiff_blank; + +typedef struct { + raptor_world *world; + char *name; + raptor_parser *parser; + rdfdiff_link *first; + rdfdiff_link *last; + rdfdiff_blank *first_blank; + rdfdiff_blank *last_blank; + int statement_count; + int error_count; + int warning_count; + int difference_count; +} rdfdiff_file; + +static int brief = 0; +static char *program = NULL; +static const char * const title_string="Raptor RDF diff utility"; +static int ignore_errors = 0; +static int ignore_warnings = 0; +static int emit_from_header = 1; +static int emit_to_header = 1; + +static rdfdiff_file* from_file = NULL; +static rdfdiff_file*to_file = NULL; + +static rdfdiff_file* rdfdiff_new_file(raptor_world* world, const unsigned char *name, const char *syntax); +static void rdfdiff_free_file(rdfdiff_file* file); + +static rdfdiff_blank *rdfdiff_find_blank(rdfdiff_blank *first, char *blank_id); +static rdfdiff_blank *rdfdiff_new_blank(raptor_world *world, char *blank_id); +static void rdfdiff_free_blank(rdfdiff_blank *blank); + +static int rdfdiff_blank_equals(const rdfdiff_blank *b1, const rdfdiff_blank *b2, + rdfdiff_file*b1_file, rdfdiff_file*b2_file); + +static void rdfdiff_log_handler(void *data, raptor_log_message *message); + +static void rdfdiff_collect_statements(void *user_data, raptor_statement *statement); + +int main(int argc, char *argv[]); + + +/* Version of strcmp that can take NULL parameters. Assume that + * Non-NULL strings are lexically greater than NULL strings + */ +static int +safe_strcmp(const char *s1, const char *s2) +{ + if(s1 == NULL && s2 == NULL) { + return 0; + } else if(s1 == NULL && s2 != NULL) { + return -1; + } else if(s1 != NULL && s2 == NULL) { + return 1; + } else { + return strcmp(s1, s2); + } + +} + + +static rdfdiff_file* +rdfdiff_new_file(raptor_world *world, const unsigned char *name, const char *syntax) +{ + rdfdiff_file* file = RAPTOR_CALLOC(rdfdiff_file*, 1, sizeof(*file)); + if(file) { + size_t name_len = strlen((const char*)name); + file->world = world; + file->name = RAPTOR_MALLOC(char*, name_len + 1); + if(!file->name) { + rdfdiff_free_file(file); + return(0); + } + memcpy(file->name, name, name_len + 1); + + file->parser = raptor_new_parser(world, syntax); + if(file->parser) { + raptor_world_set_log_handler(world, file, rdfdiff_log_handler); + } else { + fprintf(stderr, "%s: Failed to create raptor parser type %s for %s\n", + program, syntax, name); + rdfdiff_free_file(file); + return(0); + } + + + } + + return file; +} + + +static void +rdfdiff_free_file(rdfdiff_file* file) +{ + rdfdiff_link *cur, *next; + rdfdiff_blank *cur1, *next1; + + if(file->name) + RAPTOR_FREE(char*, file->name); + + if(file->parser) + raptor_free_parser(file->parser); + + for(cur = file->first; cur; cur = next) { + next = cur->next; + + raptor_free_statement(cur->statement); + RAPTOR_FREE(rdfdiff_link, cur); + } + + for(cur1 = file->first_blank; cur1; cur1 = next1) { + next1 = cur1->next; + + rdfdiff_free_blank(cur1); + } + + RAPTOR_FREE(rdfdiff_file, file); + +} + + +static rdfdiff_blank * +rdfdiff_new_blank(raptor_world* world, char *blank_id) +{ + rdfdiff_blank *blank = RAPTOR_CALLOC(rdfdiff_blank*, 1, sizeof(*blank)); + + if(blank) { + size_t blank_id_len = strlen(blank_id); + blank->world = world; + blank->blank_id = RAPTOR_MALLOC(char*, blank_id_len + 1); + if(!blank->blank_id) { + rdfdiff_free_blank(blank); + return NULL; + } + + memcpy(blank->blank_id, blank_id, blank_id_len + 1); + } + + return blank; +} + + +static void +rdfdiff_free_blank(rdfdiff_blank *blank) +{ + rdfdiff_link *cur, *next; + + if(blank->blank_id) + RAPTOR_FREE(char*, blank->blank_id); + + if(blank->owner) + raptor_free_statement(blank->owner); + + for(cur = blank->first; cur; cur = next) { + next = cur->next; + + raptor_free_statement(cur->statement); + RAPTOR_FREE(rdfdiff_link, cur); + } + + RAPTOR_FREE(rdfdiff_blank, blank); + +} + + +static int +rdfdiff_statement_equals(raptor_world *world, const raptor_statement *s1, const raptor_statement *s2) +{ + int rv = 0; + + if(!s1 || !s2) + return 0; + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, "(rdfdiff_statement_equals) Comparing "); + raptor_statement_print_as_ntriples(s1, stderr); + fprintf(stderr, " to "); + raptor_statement_print_as_ntriples(s2, stderr); +#endif + + /* normal comparison */ + if(s1->subject->type != s2->subject->type) { + rv = 0; + goto done; + } + + if(s1->subject->type == RAPTOR_TERM_TYPE_BLANK) { + /* Here for completeness. Anonymous nodes are taken care of + * elsewhere */ + /*if(strcmp((const char *)s1->subject, (const char *)s2->subject->value) != 0) + return 0;*/ + } else { + if(!raptor_uri_equals(s1->subject->value.uri, + s2->subject->value.uri)) { + rv = 0; + goto done; + } + } + + if(s1->predicate->type != s2->predicate->type) { + rv = 0; + goto done; + } + + if(!raptor_uri_equals(s1->predicate->value.uri, + s2->predicate->value.uri)) { + rv = 0; + goto done; + } + + if(s1->object->type != s2->object->type) { + rv = 0; + goto done; + } + + if(s1->object->type == RAPTOR_TERM_TYPE_LITERAL) { + int equal; + + equal= !safe_strcmp((char *)s1->object->value.literal.string, + (char *)s2->object->value.literal.string); + + if(equal) { + if(s1->object->value.literal.language && s2->object->value.literal.language) + equal = !strcmp((char *)s1->object->value.literal.language, + (char *)s2->object->value.literal.language); + else if(s1->object->value.literal.language || s2->object->value.literal.language) + equal = 0; + else + equal = 1; + + if(equal) + equal = raptor_uri_equals(s1->object->value.literal.datatype, + s2->object->value.literal.datatype); + } + + rv = equal; + goto done; + } else if(s1->object->type == RAPTOR_TERM_TYPE_BLANK) { + /* Here for completeness. Anonymous nodes are taken care of + * elsewhere */ + /* if(strcmp((const char *)s1->object, (const char *)s2->object->value) != 0) + return 0; */ + } else { + if(!raptor_uri_equals(s1->object->value.uri, + s2->object->value.uri)) { + rv = 0; + goto done; + } + } + + rv = 1; + done: + +#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1 + fprintf(stderr, " : %s\n", (rv ? "equal" : "not equal")); +#endif + return rv; +} + + +static int +rdfdiff_blank_equals(const rdfdiff_blank *b1, const rdfdiff_blank *b2, + rdfdiff_file *b1_file, rdfdiff_file *b2_file) +{ + /* first compare "owners". Owners are subject/predicate or arcs + * in. */ + int equal = 0; + + if(b1->owner == NULL && b2->owner == NULL) { + /* Both are "top-level" anonymous objects. I.E. Neither is the + * object of a statement. Fall through and compare based on their + * contents. */ + equal = 1; + } else if(b1->owner == NULL || b2->owner == NULL) { + equal = 0; + } else if(b1->owner->subject->type != RAPTOR_TERM_TYPE_BLANK && + b2->owner->subject->type != RAPTOR_TERM_TYPE_BLANK) { + /* Neither are anonymous. Normal comparison. This will return + * false if both the subject and the predicates don't match. We + * know the objects are blank nodes. */ + equal = rdfdiff_statement_equals(b1->world, b1->owner, b2->owner); + + } else if(b1->owner->subject->type == RAPTOR_TERM_TYPE_BLANK && + b2->owner->subject->type == RAPTOR_TERM_TYPE_BLANK) { + rdfdiff_blank *p1; + rdfdiff_blank *p2; + + /* Both are anonymous. Need further testing. Check that the + * containing anononymous nodes are eaual. */ +#if 0 + fprintf(stderr, "b1->owner: "); + raptor_statement_print_as_ntriples(b1->owner, stderr); + fprintf(stderr, "\n"); + + fprintf(stderr, "b2->owner: "); + raptor_statement_print_as_ntriples(b2->owner, stderr); + fprintf(stderr, "\n"); +#endif + p1 = rdfdiff_find_blank(b1_file->first_blank, + (char *)b1->owner->subject->value.blank.string); + p2 = rdfdiff_find_blank(b2_file->first_blank, + (char *)b2->owner->subject->value.blank.string); + equal = rdfdiff_blank_equals(p1, p2, b1_file, b2_file); + } else { + equal = 0; + } + + /* Now compare the contents. This accounts for the case where a + * subject has several properties (of the same predicate value) with + * different blank nodes as values. */ + if(equal) { + rdfdiff_link *s1 = b1->first; + while(s1) { + + rdfdiff_link *s2 = b2->first; + while(s2) { + + if(rdfdiff_statement_equals(b1->world, s1->statement, s2->statement)) + break; + + s2 = s2->next; + + } + + if(s2 == 0) { + equal = 0; + break; + } + + s1 = s1->next; + + } + + } + + return equal; +} + + +static void +rdfdiff_log_handler(void *data, raptor_log_message *message) +{ + rdfdiff_file* file = (rdfdiff_file*)data; + + switch(message->level) { + case RAPTOR_LOG_LEVEL_FATAL: + case RAPTOR_LOG_LEVEL_ERROR: + if(!ignore_errors) { + fprintf(stderr, "%s: Error - ", program); + raptor_locator_print(message->locator, stderr); + fprintf(stderr, " - %s\n", message->text); + + raptor_parser_parse_abort(file->parser); + } + + file->error_count++; + break; + + case RAPTOR_LOG_LEVEL_WARN: + if(!ignore_warnings) { + fprintf(stderr, "%s: Warning - ", program); + raptor_locator_print(message->locator, stderr); + fprintf(stderr, " - %s\n", message->text); + } + + file->warning_count++; + break; + + case RAPTOR_LOG_LEVEL_NONE: + case RAPTOR_LOG_LEVEL_TRACE: + case RAPTOR_LOG_LEVEL_DEBUG: + case RAPTOR_LOG_LEVEL_INFO: + + fprintf(stderr, "%s: Unexpected %s message - ", program, + raptor_log_level_get_label(message->level)); + raptor_locator_print(message->locator, stderr); + fprintf(stderr, " - %s\n", message->text); + break; + } + +} + + + +static rdfdiff_blank * +rdfdiff_find_blank(rdfdiff_blank *first, char *blank_id) +{ + rdfdiff_blank *rv_blank = 0; + rdfdiff_blank *cur = first; + + while(cur) { + + if(strcmp(cur->blank_id, blank_id) == 0) { + rv_blank = cur; + break; + } + + cur = cur->next; + + } + + return rv_blank; + +} + + +static rdfdiff_blank * +rdfdiff_lookup_blank(rdfdiff_file* file, char *blank_id) +{ + rdfdiff_blank *rv_blank = rdfdiff_find_blank(file->first_blank, blank_id); + + if(!rv_blank) { + rv_blank = rdfdiff_new_blank(file->world, blank_id); + if(rv_blank) { + + if(!file->first_blank) { + file->first_blank = rv_blank; + file->last_blank = rv_blank; + } else { + file->last_blank->next = rv_blank; + file->last_blank = rv_blank; + } + } + } + + return rv_blank; + +} + + +static int +rdfdiff_add_blank_statement(rdfdiff_file* file, + raptor_statement *statement) +{ + rdfdiff_blank *blank; + rdfdiff_link *dlink; + + blank = rdfdiff_lookup_blank(file, (char *)statement->subject->value.blank.string); + if(!blank) + goto failed; + + dlink = RAPTOR_MALLOC(rdfdiff_link*, sizeof(*dlink)); + if(!dlink) + goto failed; + + dlink->statement = raptor_statement_copy(statement); + if(!dlink->statement) { + RAPTOR_FREE(rdfdiff_link, dlink); + goto failed; + } + + dlink->next = NULL; + if(!blank->first) { + blank->first = dlink; + blank->last = dlink; + } else { + blank->last->next = dlink; + blank->last = dlink; + } + + return 0; + +failed: + fprintf(stderr, "%s: Internal Error\n", program); + return 1; +} + + +static int +rdfdiff_add_blank_statement_owner(rdfdiff_file* file, + raptor_statement *statement) +{ + rdfdiff_blank *blank; + + blank = rdfdiff_lookup_blank(file, + (char*)statement->object->value.blank.string); + if(!blank) + goto failed; + + if(blank->owner) + raptor_free_statement(blank->owner); + + blank->owner = raptor_statement_copy(statement); + if(!blank->owner) + goto failed; + + return 0; + +failed: + fprintf(stderr, "%s: Internal Error\n", program); + return 1; +} + + +static int +rdfdiff_add_statement(rdfdiff_file* file, raptor_statement *statement) +{ + int rv = 0; + + rdfdiff_link *dlink = RAPTOR_MALLOC(rdfdiff_link*, sizeof(*dlink)); + + if(dlink) { + + dlink->statement = raptor_statement_copy(statement); + + if(dlink->statement) { + + dlink->next = NULL; + + if(!file->first) { + file->first = dlink; + file->last = dlink; + } else { + file->last->next = dlink; + file->last = dlink; + } + + } else { + RAPTOR_FREE(rdfdiff_link, dlink); + rv = 1; + } + + } else { + rv = 1; + } + + if(rv != 0) + fprintf(stderr, "%s: Internal Error\n", program); + + return rv; + +} + + +static rdfdiff_link* +rdfdiff_statement_find(rdfdiff_file* file, const raptor_statement *statement, + rdfdiff_link** prev_p) +{ + rdfdiff_link* prev = NULL; + rdfdiff_link* cur = file->first; + + while(cur) { + if(rdfdiff_statement_equals(file->world, cur->statement, statement)) { + if(prev_p) + *prev_p=prev; + return cur; + } + prev = cur; + cur = cur->next; + } + + return NULL; +} + + +static int +rdfdiff_statement_exists(rdfdiff_file* file, const raptor_statement *statement) +{ + rdfdiff_link* node; + rdfdiff_link* prev = NULL; + node = rdfdiff_statement_find(file, statement, &prev); + return (node != NULL); +} + + +/* + * rdfdiff_collect_statements - Called when parsing "from" file to build a + * list of statements for comparison with those in the "to" file. + */ +static void +rdfdiff_collect_statements(void *user_data, raptor_statement *statement) +{ + int rv = 0; + rdfdiff_file* file = (rdfdiff_file*)user_data; + + if(rdfdiff_statement_exists(file, statement)) + return; + + file->statement_count++; + + if(statement->subject->type == RAPTOR_TERM_TYPE_BLANK || + statement->object->type == RAPTOR_TERM_TYPE_BLANK) { + + if(statement->subject->type == RAPTOR_TERM_TYPE_BLANK) + rv = rdfdiff_add_blank_statement(file, statement); + + if(rv == 0 && statement->object->type == RAPTOR_TERM_TYPE_BLANK) + rv = rdfdiff_add_blank_statement_owner(file, statement); + + } else { + rv = rdfdiff_add_statement(file, statement); + } + + if(rv != 0) { + raptor_parser_parse_abort(file->parser); + } + +} + + + +int +main(int argc, char *argv[]) +{ + raptor_world *world = NULL; + unsigned char *from_string = NULL; + unsigned char *to_string = NULL; + raptor_uri *from_uri = NULL; + raptor_uri *to_uri = NULL; + raptor_uri *base_uri = NULL; + const char *from_syntax = "rdfxml"; + const char *to_syntax = "rdfxml"; + int free_from_string = 0; + int free_to_string = 0; + int usage = 0; + int help = 0; + char *p; + int rv = 0; + rdfdiff_blank *b1; + rdfdiff_link *cur; + + program = argv[0]; + if((p = strrchr(program, '/'))) + program = p+1; + else if((p = strrchr(program, '\\'))) + program = p+1; + argv[0] = program; + + world = raptor_new_world(); + if(!world) + exit(1); + rv = raptor_world_open(world); + if(rv) + exit(1); + + while(!usage && !help) + { + int c; +#ifdef HAVE_GETOPT_LONG + int option_index = 0; + + c = getopt_long (argc, argv, GETOPT_STRING, long_options, &option_index); +#else + c = getopt (argc, argv, GETOPT_STRING); +#endif + if(c == -1) + break; + + switch (c) { + case 0: + case '?': /* getopt() - unknown option */ + usage = 1; + break; + + case 'b': + brief = 1; + break; + + case 'h': + help = 1; + break; + + case 'f': + if(optarg) + from_syntax = optarg; + break; + + case 't': + if(optarg) + to_syntax = optarg; + break; + + case 'u': + if(optarg) + base_uri = raptor_new_uri(world, (const unsigned char*)optarg); + break; + + } + + } + + if(optind != argc-2 && !help && !usage) { + usage = 2; /* Title and usage */ + } + + if(usage) { + if(usage > 1) { + fputs(title_string, stderr); putc(' ', stderr); fputs(raptor_version_string, stderr); putc('\n', stderr); + fputs(raptor_short_copyright_string, stderr); + fputc('\n', stderr); + } + fprintf(stderr, "Try `%s " HELP_ARG(h, help) "' for more information.\n", + program); + rv = 1; + goto exit; + } + + if(help) { + printf("Usage: %s [OPTIONS] \n", program); + puts(title_string); putchar(' '); puts(raptor_version_string); putchar('\n'); + puts(raptor_short_copyright_string); + puts("Find differences between two RDF files."); + puts("\nOPTIONS:"); + puts(HELP_TEXT("h", "help ", "Print this help, then exit")); + puts(HELP_TEXT("b", "brief ", "Report only whether files differ")); + puts(HELP_TEXT("u BASE-URI", "base-uri BASE-URI ", "Set the base URI for the files")); + puts(HELP_TEXT("f FORMAT", "from-format FORMAT ", "Format of (default is rdfxml)")); + puts(HELP_TEXT("t FORMAT", "to-format FORMAT ", "Format of (default is rdfxml)")); + rv = 1; + goto exit; + } + + from_string = (unsigned char *)argv[optind++]; + to_string = (unsigned char *)argv[optind]; + + if(!access((const char *)from_string, R_OK)) { + char *filename = (char *)from_string; + from_string = raptor_uri_filename_to_uri_string(filename); + if(!from_string) { + fprintf(stderr, "%s: Failed to create URI for file %s.\n", program, filename); + rv = 2; + goto exit; + } + free_from_string = 1; + } + + if(!access((const char *)to_string, R_OK)) { + char *filename = (char *)to_string; + to_string = raptor_uri_filename_to_uri_string(filename); + if(!to_string) { + fprintf(stderr, "%s: Failed to create URI for file %s.\n", program, filename); + rv = 2; + goto exit; + } + free_to_string = 1; + } + + from_uri = raptor_new_uri(world, from_string); + if(!from_uri) { + fprintf(stderr, "%s: Failed to create URI for %s\n", program, from_string); + rv = 2; + goto exit; + } + + to_uri = raptor_new_uri(world, to_string); + if(!to_uri) { + fprintf(stderr, "%s: Failed to create URI for %s\n", program, from_string); + rv = 2; + goto exit; + } + + /* create and init "from" data structures */ + from_file = rdfdiff_new_file(world, from_string, from_syntax); + if(!from_file) { + rv = 2; + goto exit; + } + + /* create and init "to" data structures */ + to_file = rdfdiff_new_file(world, to_string, to_syntax); + if(!to_file) { + rv = 2; + goto exit; + } + + /* parse the files */ + raptor_parser_set_statement_handler(from_file->parser, from_file, + rdfdiff_collect_statements); + + if(raptor_parser_parse_uri(from_file->parser, from_uri, base_uri)) { + fprintf(stderr, "%s: Failed to parse URI %s as %s content\n", program, + from_string, from_syntax); + rv = 1; + goto exit; + } else { + + /* Note intentional from_uri as base_uri */ + raptor_parser_set_statement_handler(to_file->parser, to_file, + rdfdiff_collect_statements); + if(raptor_parser_parse_uri(to_file->parser, to_uri, base_uri ? base_uri: from_uri)) { + fprintf(stderr, "%s: Failed to parse URI %s as %s content\n", program, + to_string, to_syntax); + rv = 1; + goto exit; + } + } + + + /* Compare triples with no blank nodes */ + cur = to_file->first; + while(cur) { + rdfdiff_link* node; + rdfdiff_link* prev; + node = rdfdiff_statement_find(from_file, cur->statement, &prev); + if(node) { + /* exists in from file - remove it from the list */ + if(from_file->first == node) { + from_file->first = node->next; + } else { + prev->next = node->next; + } + raptor_free_statement(node->statement); + RAPTOR_FREE(rdfdiff_link, node); + } else { + if(!brief) { + if(emit_from_header) { + fprintf(stderr, "Statements in %s but not in %s\n", + to_file->name, from_file->name); + emit_from_header = 0; + } + + fprintf(stderr, "< "); + raptor_statement_print_as_ntriples(cur->statement, stderr); + fprintf(stderr, "\n"); + } + + to_file->difference_count++; + } + cur = cur->next; + } + + + /* Now compare the blank nodes */ + b1 = to_file->first_blank; + while(b1) { + + rdfdiff_blank *b2 = from_file->first_blank; + + while(b2) { + + if(!b2->matched && rdfdiff_blank_equals(b1, b2, to_file, from_file)) { + b1->matched = 1; + b2->matched = 1; + break; + } + + b2 = b2->next; + + } + + if(b2 == 0) { + if(!brief) { +#if 0 + fprintf(stderr, "< "); + raptor_statement_print_as_ntriples(b1->owner, stderr); + fprintf(stderr, "\n"); +#else + if(emit_from_header) { + fprintf(stderr, "Statements in %s but not in %s\n", to_file->name, from_file->name); + emit_from_header = 0; + } + + fprintf(stderr, "< anonymous node %s\n", b1->blank_id); +#endif + } + + to_file->difference_count++; + } + + b1 = b1->next; + + } + + if(from_file->first) { + /* The entrys left in from_file have not been found in to_file. */ + if(!brief) { + + if(emit_to_header) { + fprintf(stderr, "Statements in %s but not in %s\n", from_file->name, + to_file->name); + emit_to_header = 0; + } + + cur = from_file->first; + while(cur) { + if(!brief) { + fprintf(stderr, "> "); + raptor_statement_print_as_ntriples(cur->statement, stderr); + fprintf(stderr, "\n"); + } + + cur = cur->next; + from_file->difference_count++; + } + } + + } + + if(from_file->first_blank) { + rdfdiff_blank *blank = from_file->first_blank; + while(blank) { + + if(!blank->matched) { + if(!brief) { +#if 0 + fprintf(stderr, "> "); + raptor_statement_print_as_ntriples(blank->owner, stderr); + fprintf(stderr, "\n"); +#else + if(emit_to_header) { + fprintf(stderr, "Statements in %s but not in %s\n", from_file->name, to_file->name); + emit_to_header = 0; + } + fprintf(stderr, "> anonymous node %s\n", blank->blank_id); +#endif + } + from_file->difference_count++; + } + + blank = blank->next; + + } + + } + + if(!(from_file->difference_count == 0 && + to_file->difference_count == 0)) { + + if(brief) + fprintf(stderr, "Files differ\n"); + + rv = 1; + } + +exit: + + if(base_uri) + raptor_free_uri(base_uri); + + if(from_file) + rdfdiff_free_file(from_file); + + if(to_file) + rdfdiff_free_file(to_file); + + if(free_from_string) + raptor_free_memory(from_string); + + if(free_to_string) + raptor_free_memory(to_string); + + if(from_uri) + raptor_free_uri(from_uri); + + if(to_uri) + raptor_free_uri(to_uri); + + raptor_free_world(world); + + return rv; + +} + -- cgit v1.2.3