/*
This source file is part of Scol
For the latest info, see http://www.scolring.org

Copyright (c) 2010 Stephane Bisaro, aka Iri <iri@irizone.net>

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program 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 Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA, or go to
http://www.gnu.org/copyleft/lesser.txt

For others informations, please contact us from http://www.scolring.org/
*/


/*

    INCLUDED FILES

*/

#include "main_science.h"


#if defined _WIN32 || defined __WIN32__
cbmachine ww;
#endif
mmachine  mm;


/*

    FUNCTIONS

*/



/*
    Library initialization
    Library parts loader
*/
int SCOLinitScienceClass (mmachine m)
{
    int k;

    MMechostr(MSKDEBUG, "SCOLinitScienceClass: loading\n");

    if ((k = SCOLweatherLoadAPI (m))) return k;     /* weather */
    if ((k = SCOLdateLoadAPI (m))) return k;        /* date */
    if ((k = SCOLstatisticLoadAPI (m))) return k;        /* statistic */
    if ((k = SCOLmathsLoadAPI (m))) return k;       /* maths */

    return k;
}



/*
    Fonctions de chargement / déchargement de la librairie / bibliothèque
    - Version MS Windows
    - Version GNU / Linux
    - Version Apple MacOS X : à faire ... :)
*/
#if defined _WIN32 || defined __WIN32__
# define SCOL_SCIENCE_PLUGIN_EXPORT __declspec (dllexport) 
#elif defined linux || defined __linux
# define SCOL_SCIENCE_PLUGIN_EXPORT
#else
# error no platform supported
#endif

SCOL_SCIENCE_PLUGIN_EXPORT int ScolLoadPlugin(mmachine m, cbmachine w)
{
    ww = w;
    mm = m;

    SCOLinitplugin (w);
    return SCOLinitScienceClass (m);
}

/*
  Fonction de déchargement de la librairie
*/
SCOL_SCIENCE_PLUGIN_EXPORT int ScolUnloadPlugin()
{
    return 0;
}
