<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "http://www.w3.org/2001/XMLSchema.dtd">
<!--
 * C-Pluff, a plug-in framework for C
 * Copyright 2007 Johannes Lehtinen
 * 
 * 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 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="plugin">
		<xs:complexType>
			<xs:sequence>
				<xs:element minOccurs="0" ref="backwards-compatibility"/>
            	<xs:element minOccurs="0" ref="requires"/>
            	<xs:element minOccurs="0" ref="runtime"/>
            	<xs:element minOccurs="0" maxOccurs="unbounded" ref="extension-point"/>
            	<xs:element minOccurs="0" maxOccurs="unbounded" ref="extension"/>
            </xs:sequence>
			<xs:attribute name="id" type="xs:string" use="required"/>
			<xs:attribute name="name" type="xs:string"/>
			<xs:attribute name="version" type="xs:string"/>
			<xs:attribute name="provider-name" type="xs:string"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="backwards-compatibility">
		<xs:complexType>
			<xs:attribute name="abi" type="xs:string"/>
			<xs:attribute name="api" type="xs:string"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="requires">
		<xs:complexType>
			<xs:sequence>
				<xs:element minOccurs="0" ref="c-pluff"/>
				<xs:element minOccurs="0" maxOccurs="unbounded" ref="import"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="c-pluff">
		<xs:complexType>
			<xs:attribute name="version" type="xs:string" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="import">
		<xs:complexType>
			<xs:attribute name="plugin" type="xs:string" use="required"/>
			<xs:attribute name="version" type="xs:integer"/>
			<xs:attribute name="optional" type="xs:boolean" default="false"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="runtime">
		<xs:complexType>
			<xs:attribute name="library" type="xs:string" use="required"/>
			<xs:attribute name="funcs" type="xs:string"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="extension-point">
		<xs:complexType>
			<xs:attribute name="id" type="simpleIdentifier" use="required"/>
			<xs:attribute name="name" type="xs:string"/>
			<xs:attribute name="schema" type="xs:string"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="extension">
		<xs:complexType>
			<xs:sequence>
				<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
			</xs:sequence>
			<xs:attribute name="point" type="xs:string" use="required"/>
			<xs:attribute name="id" type="simpleIdentifier"/>
			<xs:attribute name="name" type="xs:string"/>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="simpleIdentifier">
		<xs:restriction base="xs:string">
			<xs:pattern value="[^.]+"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
