From GridLAB-D Wiki
Jump to: navigation, search
// $Id$
// Copyright (c) <<<YEAR>>> <<<COMPANY>>>
// Template valid as of Hassayampa (Version 3.0)
#define DLMAIN // required to enable module main code in gridlabd.h
#include "gridlabd.h"
#include "<<<CLASS>>>.h"
// TODO add class includes here
// TODO define module globals here
EXPORT CLASS *init(CALLBACKS *fntable, MODULE *module, int argc, char *argv[])
{
        if (set_callback(fntable)==NULL)
        {
                errno = EINVAL;
                return NULL;
        }
        // TODO publish module globals here
        new <<<CLASS>>>(module);
        // TODO add other classes here
        // always return the first class registered
        return <<<CLASS>>>::oclass;
}
EXPORT int do_kill(void*)
{
        // TODO module cleanup if any
        return 0;
}
// TODO add optional functions