Commit 05f95c85 authored by Peter Hutterer's avatar Peter Hutterer Committed by Kristian Høgsberg

protocol: validate the protocol against a dtd

The scanner is not very forgiving if the protocol doesn't match it's
expectations and crashes without much of a notice. Thus, validate the protocol
against a DTD.

Move the protocol subdir forward so we validate first before trying anything
else, and install the DTD so we can validate weston's protocols as well.
parent 16b2dab4
......@@ -2,7 +2,7 @@ if BUILD_DOCS
doc_subdir = doc
endif
SUBDIRS = src protocol $(doc_subdir) tests cursor
SUBDIRS = protocol src $(doc_subdir) tests cursor
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
......
......@@ -87,6 +87,9 @@ fi
AC_PATH_PROG(XSLTPROC, xsltproc)
AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
AC_PATH_PROG(XMLLINT, xmllint)
AM_CONDITIONAL([HAVE_XMLLINT], [test "x$XMLLINT" != "x"])
AC_MSG_CHECKING([for docbook manpages stylesheet])
MANPAGES_STYLESHEET=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
......
dist_pkgdata_DATA = wayland.xml
dist_pkgdata_DATA = wayland.xml wayland.dtd
if HAVE_XMLLINT
.PHONY: validate
.%.xml.valid: %.xml
$(AM_V_GEN)$(XMLLINT) --noout --dtdvalid $(srcdir)/wayland.dtd $^ > $@
validate: .wayland.xml.valid
all-local: validate
CLEANFILES = .wayland.xml.valid
endif
<!ELEMENT protocol (copyright?, interface+)>
<!ATTLIST protocol name CDATA #REQUIRED>
<!ELEMENT copyright (#PCDATA)>
<!ELEMENT interface (description?,(request|event|enum)+)>
<!ATTLIST interface name CDATA #REQUIRED>
<!ATTLIST interface version CDATA #REQUIRED>
<!ELEMENT request (description?,arg*)>
<!ATTLIST request name CDATA #REQUIRED>
<!ATTLIST request type CDATA #IMPLIED>
<!ATTLIST request since CDATA #IMPLIED>
<!ELEMENT event (description?,arg*)>
<!ATTLIST event name CDATA #REQUIRED>
<!ATTLIST event since CDATA #IMPLIED>
<!ELEMENT enum (description?,entry*)>
<!ATTLIST enum name CDATA #REQUIRED>
<!ATTLIST enum since CDATA #IMPLIED>
<!ELEMENT entry (description?)>
<!ATTLIST entry name CDATA #REQUIRED>
<!ATTLIST entry value CDATA #REQUIRED>
<!ATTLIST entry summary CDATA #IMPLIED>
<!ATTLIST entry since CDATA #IMPLIED>
<!ELEMENT arg (description?)>
<!ATTLIST arg name CDATA #REQUIRED>
<!ATTLIST arg type CDATA #REQUIRED>
<!ATTLIST arg summary CDATA #IMPLIED>
<!ATTLIST arg interface CDATA #IMPLIED>
<!ATTLIST arg allow-null CDATA #IMPLIED>
<!ELEMENT description (#PCDATA)>
<!ATTLIST description summary CDATA #REQUIRED>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment