/*
 * The Spar Library - modular math parser
 * Copyright (C) 2000,2001 Davide Angelocola <davide178@inwind.it>
 *
 * This library 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.1 of the License.
 *
 * This library 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 library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 *
 */

/* 
 *  file module.h
 *  brief Module definition.
 *
 *  This file contains the module definition, and some basic programmer's 
 *  facilities, however is still incomplete and allow the user to do a 
 *  a basic dealing with modules.
 */

#ifndef _sl_module_h_
#define _sl_module_h_

/** 
 *  struct module
 *  brief The module structure
 *  
 *  This struct is the user module definition. Is contains all basic information
 *  to deal with this module (loading, unloading, running...). 
 */
struct sl_module_s
{
  char name[64];
  char description[256];
  char version[10];
  int (*main) (void);
};

typedef struct sl_module_s sl_module;

/*
 *  SL_MODULE_EXPORT(x)
 *
 *  Return the adress of this module. Needed by the module loader.
 */
#define SL_MODULE_EXPORT(x) 	\
	sl_module * 		\
	sl_get_module (void) 	\
	{ 			\
		return &(x); 	\
	}

/*
 *  SL_MODULE_TYPE
 */

typedef enum
{
/*
 *  Means that the module is a program that use the Spar Library
 *  It can be executed directly from the shell
 */
  SL_MODULE_STANDALONE,

/*
 *  Means that the module is builtin. You need to run spar to use 
 *  this module
 */
  SL_MODULE_BUILTIN
}
sl_module_type_t;

#endif /* _sl_module_h_ */