mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									16b2dab4e4
								
							
						
					
					
						commit
						05f95c85c8
					
				
					 4 changed files with 47 additions and 2 deletions
				
			
		| 
						 | 
					@ -2,7 +2,7 @@ if BUILD_DOCS
 | 
				
			||||||
doc_subdir = doc
 | 
					doc_subdir = doc
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SUBDIRS = src protocol $(doc_subdir) tests cursor
 | 
					SUBDIRS = protocol src $(doc_subdir) tests cursor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 | 
					ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -87,6 +87,9 @@ fi
 | 
				
			||||||
AC_PATH_PROG(XSLTPROC, xsltproc)
 | 
					AC_PATH_PROG(XSLTPROC, xsltproc)
 | 
				
			||||||
AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
 | 
					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])
 | 
					AC_MSG_CHECKING([for docbook manpages stylesheet])
 | 
				
			||||||
MANPAGES_STYLESHEET=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
 | 
					MANPAGES_STYLESHEET=http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl
 | 
				
			||||||
AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
 | 
					AC_PATH_PROGS_FEATURE_CHECK([XSLTPROC_TMP], [xsltproc],
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +1,14 @@
 | 
				
			||||||
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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										29
									
								
								protocol/wayland.dtd
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								protocol/wayland.dtd
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,29 @@
 | 
				
			||||||
 | 
					<!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>
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue