<?xml version="1.0" encoding="utf-8"?>
<!--

SPDX-License-Identifier: GPL-3.0-or-later
Copyright (c) 2008-2026 Andrew Ziem.

This work is licensed under the terms of the GNU GPL, version 3 or
later.  See the COPYING file in the top-level directory.

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
  <xs:attributeGroup name="operatingSystem">
    <xs:attribute name="os" use="optional">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="bsd"/>
          <xs:enumeration value="darwin"/>
          <xs:enumeration value="linux"/>
          <xs:enumeration value="macos"/>
          <xs:enumeration value="netbsd"/>
          <xs:enumeration value="openbsd"/>
          <xs:enumeration value="freebsd"/>
          <xs:enumeration value="unix"/>
          <xs:enumeration value="windows"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:attributeGroup>

  <xs:simpleType name="depthType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:nonNegativeInteger"/>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="any"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>

  <xs:simpleType name="caseType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="sensitive"/>
      <xs:enumeration value="insensitive"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:element name="protected_paths">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="paths" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="path" type="xs:string" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attributeGroup ref="operatingSystem"/>
            <xs:attribute name="depth" type="depthType" default="0"/>
            <xs:attribute name="case" type="caseType" default="sensitive"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
