2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
gbx_component.h
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2022-09-12 15:13:13 +02:00
|
|
|
(c) 2000-2017 Benoît Minisini <benoit.minisini@gambas-basic.org>
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
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
|
2009-08-17 12:41:51 +02:00
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
2007-12-30 17:41:49 +01:00
|
|
|
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
|
2011-06-03 02:51:09 +02:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
2011-12-31 03:39:20 +01:00
|
|
|
MA 02110-1301, USA.
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __GBX_COMPONENT_H
|
|
|
|
#define __GBX_COMPONENT_H
|
|
|
|
|
|
|
|
#include "gambas.h"
|
|
|
|
#include "gb_list.h"
|
|
|
|
#include "gb_component.h"
|
|
|
|
|
|
|
|
#include "gbx_library.h"
|
|
|
|
#include "gbx_archive.h"
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct _COMPONENT {
|
|
|
|
void *class;
|
2012-10-27 02:28:55 +02:00
|
|
|
intptr_t ref;
|
2007-12-30 17:41:49 +01:00
|
|
|
LIST list;
|
2012-10-27 02:28:55 +02:00
|
|
|
LIST load;
|
2007-12-30 17:41:49 +01:00
|
|
|
char *name;
|
|
|
|
LIBRARY *library;
|
|
|
|
ARCHIVE *archive;
|
2011-08-21 04:27:16 +02:00
|
|
|
unsigned order : 8;
|
2007-12-30 17:41:49 +01:00
|
|
|
unsigned loaded : 1;
|
2011-08-21 04:27:16 +02:00
|
|
|
unsigned user : 1; // user library
|
2007-12-30 17:41:49 +01:00
|
|
|
unsigned warning : 1; // Set when the bytecode warning was displayed by the class loader for this component
|
2011-08-21 04:27:16 +02:00
|
|
|
unsigned loading : 1; // component is being loaded
|
2012-10-27 02:28:55 +02:00
|
|
|
unsigned _reserved : 20;
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
COMPONENT;
|
|
|
|
|
|
|
|
#ifndef __GBX_COMPONENT_C
|
|
|
|
EXTERN char *COMPONENT_path;
|
|
|
|
EXTERN COMPONENT *COMPONENT_current;
|
|
|
|
EXTERN int COMPONENT_count;
|
2019-10-21 09:44:52 +02:00
|
|
|
//EXTERN COMPONENT *COMPONENT_main;
|
2007-12-30 17:41:49 +01:00
|
|
|
#endif
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void COMPONENT_init(void);
|
|
|
|
void COMPONENT_exit(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
COMPONENT *COMPONENT_create(const char *name);
|
|
|
|
void COMPONENT_delete(COMPONENT *comp);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
COMPONENT *COMPONENT_find(const char *name);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool COMPONENT_exist(const char *name);
|
2019-01-05 03:57:08 +01:00
|
|
|
bool COMPONENT_can_load_library(const char *name);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void COMPONENT_load(COMPONENT *comp);
|
|
|
|
void COMPONENT_unload(COMPONENT *comp);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2012-09-27 22:52:08 +02:00
|
|
|
void COMPONENT_load_all(void);
|
|
|
|
void COMPONENT_load_all_finish(void);
|
|
|
|
|
2015-05-27 03:00:39 +02:00
|
|
|
bool COMPONENT_is_loaded(const char *name);
|
2012-09-27 22:52:08 +02:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
COMPONENT *COMPONENT_next(COMPONENT *comp);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void COMPONENT_translation_must_be_reloaded(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void COMPONENT_signal(int signal, void *param);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#define COMPONENT_is_library(comp) ((comp)->library != NULL)
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
bool COMPONENT_get_info(const char *key, void **value);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2012-09-27 22:52:08 +02:00
|
|
|
void COMPONENT_exec(const char *name, int argc, char **argv);
|
|
|
|
|
2021-06-05 03:11:54 +02:00
|
|
|
void COMPONENT_before_fork(void);
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
#endif
|