/*
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/
*/





#ifndef __MAIN_SCIENCE_H__
#define __MAIN_SCIENCE_H__

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#if defined VERSION_WIN || defined __WIN32__ || defined WIN32
#include <windows.h>
#include "scol_plugin_win.h"
#else
#include "scol_plugin_lin.h"
#endif
#include "macros.h"





/* Load APIs */
int SCOLweatherLoadAPI (mmachine m);    /* load the Weather part */
int SCOLdateLoadAPI (mmachine m);       /* -    date    - */
int SCOLstatisticLoadAPI (mmachine m);  /* -    statistic   - */
int SCOLmathsLoadAPI (mmachine m);      /* -    maths   - */



/* Commons functions */
int nisalnum(char *, int);              /* return if all chars of any string are alphanumeric */
int nisalpha(char *, int);              /* return if all chars of any string are alphabetic only */
int nisdigit(char *, int);              /* return if all chars of any string are numeric only */
int searchChar (char * word, char c);   /* return the char position in a string */
int searchCharMem (const char * word, char c);/* same thing but from memchar */
int scienceMMalloc (mmachine m, void* object);  /* memory allocation */
int equaldouble (double a, double b);
char * removeZeroBefore (char *s);      /* remove any 0 before 1 - 9 in a string */
void ReverseString (char *string);      /* reverse any string */
char * addPrefix (char *str, const char * prefix);   /* add a substring to a string (at the begin) */
char * addPrefixChar (char *str, const char prefix);    /* add a char to a string (at the start) */
void replaceChar (char *s, char cin, char cout);    /* replace a char by another char */
int searchRCharMem (const char * word, char c);



#define bullshit int (__cdecl *)(struct Mmachine *)

#endif
