<!--
  Document Type Definition (DTD) for gretl function packages: a package
  needs a name, author, version, date, and description.  It also needs
  at least one gretl-function.  The latter must have a name and must
  include function code; it may also have help text, zero or more 
  parameters, and zero or one return values. And the package may
  contain a sample script which illustrates a correct call.
 -->

<!ELEMENT gretl-functions (gretl-function-package?)>

<!ELEMENT gretl-function-package (author, version, date, description, 
                                  gretl-function+, sample-script?)>
<!ATTLIST gretl-function-package
   name CDATA #REQUIRED
   ID CDATA #IMPLIED
   needs-time-series-data (true|false) 'false'
   needs-qm-data (true|false) 'false'
   needs-panel-data (true|false) 'false'
   minver CDATA #IMPLIED
>

<!ELEMENT author      (#PCDATA)>
<!ELEMENT version     (#PCDATA)>
<!ELEMENT date        (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ATTLIST description
   lang CDATA #IMPLIED
>

<!ELEMENT gretl-function (help?, params?, return?, code)>
<!ATTLIST gretl-function
   name CDATA #REQUIRED
   private (0|1) '0'
>

<!ELEMENT help (#PCDATA)>

<!ELEMENT params (param+)>
<!ATTLIST params 
   count CDATA #REQUIRED
>

<!ELEMENT param (description?)>
<!ATTLIST param
   name    CDATA #REQUIRED
   default CDATA #IMPLIED
   min     CDATA #IMPLIED
   max     CDATA #IMPLIED
   optional (true|false) 'false'
   const    (true|false) 'false'
   type (bool | boolean | int | scalar | series | list |
         matrix | scalarref | seriesref | matrixref |
         string) 'series'
>

<!ELEMENT return EMPTY>
<!ATTLIST return
   name CDATA #REQUIRED
   type (bool | boolean | int | scalar | series | list | 
         matrix | string) 'series'
>

<!ELEMENT sample-script (#PCDATA)>

<!ELEMENT code (#PCDATA)>



