/***************************************************************************
  
  gbc_info.h
  
  (c) Benoît Minisini <benoit.minisini@gambas-basic.org>

  This program 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, 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 General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  MA 02110-1301, USA.
  
***************************************************************************/

#ifndef __GBC_INFO_H
#define __GBC_INFO_H

#include "gb_table.h"
#include "gbc_type.h"

#define INFO_GET (-2)
#define INFO_CALL (-3)

#define INFO_CONVERT (-2)

typedef
	struct {
		SYMBOL sym;
		unsigned library:1;
		char *info;
	}
	INFO_COMPONENT;

typedef
	struct {
		TYPE type;
		char *desc;
		uchar npmin;
		uchar npmax;
		unsigned parsed : 1;
	}
	INFO_DESC;
	
typedef
	struct {
		SYMBOL sym;
		int desc;
	}
	INFO_SYMBOL;
	
typedef
	struct {
		SYMBOL sym;
		TABLE *symbols;
		char *info;
		ushort array_type;
		ushort structure;
		unsigned alloc_name : 1;
		unsigned load_info : 1;
		unsigned parsed : 1;
		unsigned inherited : 1;
		unsigned has_unknown : 1;
	}
	INFO_CLASS;

void INFO_init(bool info);
void INFO_exit(void);
	
void INFO_load_component(const char *name);
void INFO_load_library(const char *path, bool ref);

void INFO_add_project_class(const char *name);;

int INFO_check_exist_symbol(TYPE type, int symbol_index);

INFO_DESC *INFO_get_desc(int desc_index);
const char *INFO_get_name_from_desc(INFO_DESC *idesc);

TYPE INFO_get_object(const char *class_name);

void INFO_load_current_class(void);
void INFO_unload_current_class(void);

#endif
