<?xml version="1.0" encoding="UTF-8"?>

<?context-directive job ctxfile x-setups.ctx ?>

<cd:interface xmlns:cd="http://www.pragma-ade.com/commands">

    <cd:command name="doifelsebuffer" level="system" category="buffer conditional" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-buffer"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="doifbufferelse" level="system" category="buffer conditional" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-buffer"/>
            <cd:resolve name="argument-true"/>
            <cd:resolve name="argument-false"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="resetbuffer" level="system" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="buffer" type="environment" level="document" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="grabbufferdata" level="system" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-category-optional"/>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="grabbufferdatadirect" level="system" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-name"/>
            <cd:resolve name="argument-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="buffer" type="environment" begin="set" end="end" level="system" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="setupbuffer" level="style" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer-list-optional"/>
            <cd:assignments list="yes">
                <cd:parameter name="before">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="after">
                    <cd:constant type="cd:command"/>
                </cd:parameter>
                <cd:parameter name="strip">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="definebuffer" level="style" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-name"/>
            <cd:resolve name="keyword-buffer-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setupbuffer"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="getbuffer" level="document" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer-list-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="getdefinedbuffer" level="system" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="inlinebuffer" level="document" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer-list-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="buffer" type="environment" generated="yes" variant="instance" category="buffer" level="document" file="buff-ini.mkiv">
        <cd:sequence>
            <cd:instance value="buffer"/>
        </cd:sequence>
        <cd:instances>
            <cd:resolve name="instance-buffer"/>
        </cd:instances>
    </cd:command>

    <cd:command name="getbuffer" generated="yes" variant="instance" level="document" category="buffer" file="buff-ini.mkiv">
        <cd:sequence>
            <cd:string value="get"/>
            <cd:instance value="buffer"/>
        </cd:sequence>
    </cd:command>

    <!--

        <cd:command name="hiding" type="environment" level="document" category="buffer" file="buff-ini.mkiv"/>

    -->

    <cd:command name="processtexbuffer" level="style" category="buffer" file="buff-ini.mkiv">
        <cd:sequence>
            <cd:string value="processTEXbuffer"/>
        </cd:sequence>
        <cd:arguments>
            <cd:resolve name="keyword-buffer-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="savebuffer" variant="list" level="style" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer-list"/>
            <cd:resolve name="keyword-file"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="savebuffer" level="style" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:assignments list="yes">
                <cd:parameter name="list">
                    <cd:constant type="cd:name"/>
                </cd:parameter>
                <cd:parameter name="file">
                    <cd:constant type="cd:file"/>
                </cd:parameter>
                <cd:parameter name="prefix">
                    <cd:constant type="yes" default="yes"/>
                    <cd:constant type="no"/>
                </cd:parameter>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="ctxluabuffer" level="style" category="buffer lua" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="mkvibuffer" level="style" category="buffer" file="buff-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="getbufferdata" level="style" category="buffer" file="buff-ini.mkiv">  
        <cd:arguments>
            <cd:resolve name="keyword-buffer-optional"/>
        </cd:arguments>
    </cd:command>

    <cd:command name="typebuffer" level="document" category="buffer verbatim" file="buff-ver.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer-list-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setuptyping"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="typebuffer" generated="yes" variant="instance" level="document" category="buffer verbatim" file="buff-ver.mkiv">
        <cd:sequence>
            <cd:string value="type"/>
            <cd:instance value="buffer"/>
        </cd:sequence>
        <cd:arguments>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setuptyping"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="typedefinedbuffer" level="system" category="buffer verbatim" file="buff-ver.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setuptyping"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

    <cd:command name="prettyprintbuffer" level="style" category="buffer verbatim" file="lxml-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-buffer"/>
            <cd:keywords delimiters="braces">
                <cd:resolve name="value-verbatim"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="inlineprettyprintbuffer" level="style" category="buffer verbatim" file="lxml-ini.mkiv">
        <cd:arguments>
            <cd:resolve name="argument-buffer"/>
            <cd:keywords delimiters="braces">
                <cd:resolve name="value-verbatim"/>
            </cd:keywords>
        </cd:arguments>
    </cd:command>

    <cd:command name="typeinlinebuffer" level="style" category="buffer verbatim" file="buff-ver.mkiv">
        <cd:arguments>
            <cd:resolve name="keyword-buffer-list-optional"/>
            <cd:assignments list="yes" optional="yes">
                <cd:inherit name="setuptype"/>
            </cd:assignments>
        </cd:arguments>
    </cd:command>

</cd:interface>