<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
     Written by Laurent Lemaitre - r29173@users.sourceforge.net
     Documentation:
       http://sourceforge.net/docman/display_doc.php?docid=18993&group_id=84289
     Target Interface: ngspice
     Supported by adms-1.x.x
     This file is used by adms - http://sourceforge.net/projects/mot-adms.
     adms is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
     adms is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
     You should have received a copy of the GNU General Public License
     along with adms; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-->

<!DOCTYPE admst SYSTEM "admst.dtd">
<admst version="2.3.0" xmlns:admst="http://mot-adms.sourceforge.net/xml-files/admst">
<admst:template match="code">
#include "ngspice/config.h"

#include &quot;ngspice/devdefs.h&quot;

<admst:value-of select="attribute[name='ngspicename']/value"/>
<admst:variable name="module" select="%s"/>

#include &quot;$(module)itf.h&quot;
#include &quot;$(module)ext.h&quot;
#include &quot;$(module)init.h&quot;

SPICEdev $(module)info = {
    .DEVpublic = {
        .name = &quot;$module&quot;,
        .description = &quot;$module created by adms&quot;,
        .terms = &amp;$(module)nSize,
        .numNames = &amp;$(module)nSize,
        .termNames = $(module)names,
        .numInstanceParms = &amp;$(module)pTSize,
        .instanceParms = $(module)pTable,
        .numModelParms = &amp;$(module)mPTSize,
        .modelParms = $(module)mPTable,
        .flags = DEV_DEFAULT,

#ifdef XSPICE
        .cm_func = NULL,
        .num_conn = 0,
        .conn = NULL,
        .num_param = 0,
        .param = NULL,
        .num_inst_var = 0,
        .inst_var = NULL,
#endif
    },

    .DEVparam = $(module)par,
    .DEVmodParam = $(module)mParam,
    .DEVload = $(module)load,
    .DEVsetup = $(module)setup,
    .DEVunsetup = $(module)unsetup,
    .DEVpzSetup = $(module)setup,
    .DEVtemperature = $(module)temp,
    .DEVtrunc = $(module)trunc,
    .DEVfindBranch = NULL,
    .DEVacLoad = $(module)acLoad,
    .DEVaccept = NULL,
    .DEVdestroy = $(module)destroy,
    .DEVmodDelete = $(module)mDelete,
    .DEVdelete = $(module)delete,
    .DEVsetic = NULL,
    .DEVask = $(module)ask,
    .DEVmodAsk = $(module)mAsk,
    .DEVpzLoad = $(module)pzLoad,
    .DEVconvTest = NULL,
    .DEVsenSetup = NULL,
    .DEVsenLoad = NULL,
    .DEVsenUpdate = NULL,
    .DEVsenAcLoad = NULL,
    .DEVsenPrint = NULL,
    .DEVsenTrunc = NULL,
    .DEVdisto = NULL,
    .DEVnoise = NULL,
    .DEVsoaCheck = NULL,
    .DEVinstSize = &amp;$(module)iSize,
    .DEVmodSize = &amp;$(module)mSize,

#ifdef CIDER
    .DEVdump = NULL,
    .DEVacct = NULL,
#endif
};


SPICEdev *
get_$(module)_info(void)
{
    return &amp;$(module)info;
}
</admst:template>


<admst:for-each select="/module">
  <admst:value-of select="attribute[name='ngspicename']/value"/>
  <admst:open file="%sinit.c">
    <admst:text format="/***\n*** Interface: %(/simulator/package_string)\n"/>
    <admst:text format=" *** created by: %(/simulator/fullname) ***/\n"/>
    <admst:apply-templates select="." match="code"/>
  </admst:open>
  <admst:value-of select="attribute[name='ngspicename']/value"/>
  <admst:message format="%sinit.c: file created\n"/>
</admst:for-each>

</admst>
