2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
gbx_api.h
|
|
|
|
|
2013-08-03 17:38:01 +02:00
|
|
|
(c) 2000-2013 Benoît Minisini <gambas@users.sourceforge.net>
|
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_API_H
|
|
|
|
#define __GBX_API_H
|
|
|
|
|
|
|
|
#include "gambas.h"
|
2008-01-27 15:00:04 +01:00
|
|
|
#include "gbx_type.h"
|
2008-12-28 23:41:55 +01:00
|
|
|
#include "gbx_stream.h"
|
2010-10-06 14:03:27 +02:00
|
|
|
#include "gb_hash.h"
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_GetInterface(const char *library, int version, void *iface);
|
2008-01-17 22:39:26 +01:00
|
|
|
void *GB_Hook(int type, void *hook);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_LoadComponent(const char *name);
|
2008-01-17 22:39:26 +01:00
|
|
|
const char *GB_CurrentComponent(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2012-08-25 00:29:53 +02:00
|
|
|
void GB_Wait(int);
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_Push(int nval, ...);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_CanRaise(void *object, int event_id);
|
|
|
|
bool GB_Raise(void *object, int event_id, int nparam, ...);
|
2012-02-25 02:35:55 +01:00
|
|
|
void GB_RaiseBegin(GB_RAISE_HANDLER *handler);
|
|
|
|
void GB_RaiseEnd(GB_RAISE_HANDLER *handler);
|
2008-01-17 22:39:26 +01:00
|
|
|
int GB_GetEvent(void *class, char *name);
|
|
|
|
char *GB_GetLastEventName();
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_Stopped(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
int GB_NParam(void);
|
|
|
|
const char *GB_GetUnknown(void);
|
2011-07-03 19:29:00 +02:00
|
|
|
//bool GB_IsProperty(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2011-05-02 02:46:00 +02:00
|
|
|
void GB_GetProperty(void *object, const char *property);
|
|
|
|
void GB_SetProperty(void *object, const char *property, ...);
|
|
|
|
|
2012-08-26 03:54:57 +02:00
|
|
|
bool GB_Serialize(const char *path, GB_VALUE *value);
|
|
|
|
bool GB_UnSerialize(const char *path, GB_VALUE *value);
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_Error(const char *msg, ...);
|
2012-08-15 19:02:22 +02:00
|
|
|
void GB_Deprecated(const char *msg, const char *func, const char *repl);
|
2013-07-11 00:17:27 +02:00
|
|
|
void GB_OnErrorBegin(GB_ERROR_HANDLER *handler);
|
|
|
|
void GB_OnErrorEnd(GB_ERROR_HANDLER *handler);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_Ref(void *object);
|
|
|
|
void GB_Unref(void **object);
|
|
|
|
void GB_UnrefKeep(void **object, int);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_StopEnum(void);
|
|
|
|
void *GB_GetEnum(void);
|
2012-09-06 18:20:54 +02:00
|
|
|
void *GB_BeginEnum(void *);
|
|
|
|
void GB_EndEnum(void *);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_NextEnum(void);
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_StopAllEnum(void *);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-08-03 19:54:51 +02:00
|
|
|
void GB_Return(GB_TYPE type, ...);
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_ReturnInteger(int val);
|
2007-12-30 17:41:49 +01:00
|
|
|
#define GB_ReturnInt GB_ReturnInteger
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_ReturnLong(int64_t val);
|
|
|
|
void GB_ReturnPointer(void *val);
|
|
|
|
void GB_ReturnBoolean(int val);
|
|
|
|
void GB_ReturnObject(void *val);
|
|
|
|
void GB_ReturnNull(void);
|
2010-11-16 02:49:18 +01:00
|
|
|
void GB_ReturnSingle(float val);
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_ReturnFloat(double val);
|
2009-08-03 19:54:51 +02:00
|
|
|
void GB_ReturnPtr(GB_TYPE type, void *value);
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_ReturnDate(GB_DATE *date);
|
2008-02-21 15:13:47 +01:00
|
|
|
void GB_ReturnSelf(void *object);
|
2010-05-22 20:02:34 +02:00
|
|
|
void GB_ReturnVariant(GB_VARIANT_VALUE *value);
|
2012-08-18 15:06:58 +02:00
|
|
|
|
2011-11-14 02:06:51 +01:00
|
|
|
void GB_ReturnConvVariant(void);
|
2012-08-18 15:06:58 +02:00
|
|
|
void GB_ReturnBorrow(void);
|
|
|
|
void GB_ReturnRelease(void);
|
2010-05-22 20:02:34 +02:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_ReturnString(char *str);
|
2011-10-24 16:52:20 +02:00
|
|
|
void GB_ReturnVoidString(void);
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_ReturnConstString(const char *str, int len);
|
|
|
|
void GB_ReturnConstZeroString(const char *str);
|
|
|
|
void GB_ReturnNewString(const char *src, int len);
|
|
|
|
void GB_ReturnNewZeroString(const char *src);
|
|
|
|
|
|
|
|
void *GB_GetClass(void *object);
|
|
|
|
char *GB_GetClassName(void *object);
|
|
|
|
void *GB_FindClass(const char *name);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_ExistClass(const char *name);
|
|
|
|
bool GB_ExistClassLocal(const char *name);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
|
|
|
char *GB_ToZeroString(GB_STRING *src);
|
|
|
|
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_LoadFile(const char *path, int lenp, char **addr, int *len);
|
2011-07-17 12:57:55 +02:00
|
|
|
bool GB_ExistFile(const char *path);
|
2008-12-28 23:41:55 +01:00
|
|
|
//void GB_ReleaseFile(char **addr, int len);
|
|
|
|
#define GB_ReleaseFile STREAM_unmap
|
2008-01-17 22:39:26 +01:00
|
|
|
char *GB_RealFileName(const char *path, int len);
|
2010-01-01 19:45:35 +01:00
|
|
|
char *GB_TempDir(void);
|
|
|
|
char *GB_TempFile(const char *pattern);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_CopyFile(const char *src, const char *dst);
|
2010-04-05 03:44:43 +02:00
|
|
|
//int GB_FindFile(const char *dir, int recursive, int follow, void (*found)(const char *));
|
2012-10-02 10:01:25 +02:00
|
|
|
bool GB_StatFile(const char *path, GB_FILE_STAT *info, bool follow);
|
2010-04-05 03:44:43 +02:00
|
|
|
void GB_BrowseProject(GB_BROWSE_CALLBACK func);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
|
|
|
int GB_IsMissing(int param);
|
|
|
|
|
|
|
|
void GB_Attach(void *object, void *parent, const char *name);
|
|
|
|
void GB_Detach(void *object);
|
|
|
|
|
|
|
|
void GB_Store(GB_TYPE type, GB_VALUE *src, void *dst);
|
|
|
|
void GB_StoreString(GB_STRING *src, char **dst);
|
|
|
|
void GB_StoreObject(GB_OBJECT *object, void **dst);
|
|
|
|
void GB_StoreVariant(GB_VARIANT *src, void *dst);
|
2010-07-19 14:33:57 +02:00
|
|
|
void GB_BorrowValue(GB_VALUE *value);
|
|
|
|
void GB_ReleaseValue(GB_VALUE *value);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
2008-11-05 00:53:39 +01:00
|
|
|
void GB_Watch(int fd, int flag, void *callback, intptr_t param);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
2012-07-13 01:34:14 +02:00
|
|
|
void *GB_Create(void *class_name, const char *name, void *parent);
|
2011-05-16 04:16:22 +02:00
|
|
|
void *GB_New(void *class_name, const char *name, void *parent);
|
|
|
|
bool GB_CheckObject(void *object);
|
|
|
|
bool GB_Is(void *object, void *class);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_GetFunction(GB_FUNCTION *func, void *object, const char *name, const char *sign, const char *type);
|
2008-01-17 22:39:26 +01:00
|
|
|
GB_VALUE *GB_Call(GB_FUNCTION *func, int nparam, int release);
|
|
|
|
void *GB_GetClassInterface(void *class, const char *name);
|
|
|
|
|
|
|
|
const char *GB_AppName(void);
|
|
|
|
const char *GB_AppTitle(void);
|
|
|
|
const char *GB_AppVersion(void);
|
|
|
|
const char *GB_AppPath(void);
|
2010-10-15 02:23:11 +02:00
|
|
|
void *GB_AppStartupClass(void);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
|
|
|
char *GB_SystemCharset(void);
|
2008-06-11 12:44:50 +02:00
|
|
|
char *GB_SystemDomainName(void);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_IsRightToLeft(void);
|
2011-03-24 03:15:32 +01:00
|
|
|
char *GB_SystemPath(void);
|
2013-07-27 19:23:04 +02:00
|
|
|
bool GB_SystemDebug(void);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
|
|
|
void *GB_Eval(void *, void *);
|
|
|
|
|
2010-07-08 00:06:05 +02:00
|
|
|
void GB_ArrayNew(GB_ARRAY *array, TYPE type, int size);
|
2008-01-17 22:39:26 +01:00
|
|
|
int GB_ArrayCount(GB_ARRAY array);
|
|
|
|
void *GB_ArrayAdd(GB_ARRAY array);
|
|
|
|
void *GB_ArrayGet(GB_ARRAY array, int index);
|
2008-03-31 21:04:28 +02:00
|
|
|
TYPE GB_ArrayType(GB_ARRAY array);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
|
|
|
void GB_CollectionNew(GB_COLLECTION *col, int mode);
|
|
|
|
int GB_CollectionCount(GB_COLLECTION col);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_CollectionSet(GB_COLLECTION col, const char *key, int len, GB_VARIANT *value);
|
|
|
|
bool GB_CollectionGet(GB_COLLECTION col, const char *key, int len, GB_VARIANT *value);
|
|
|
|
bool GB_CollectionEnum(GB_COLLECTION col, GB_COLLECTION_ITER *iter, GB_VARIANT *value, char **key, int *len);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
|
|
|
void GB_Alloc(void **addr, int len);
|
|
|
|
void GB_Free(void **addr);
|
|
|
|
void GB_Realloc(void **addr, int len);
|
|
|
|
|
2010-06-05 01:48:53 +02:00
|
|
|
char *GB_NewZeroString(char *src);
|
|
|
|
char *GB_TempString(char *src, int len);
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_FreeString(char **str);
|
|
|
|
int GB_StringLength(const char *str);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_ConvString(char **result, const char *str, int len, const char *src, const char *dst);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_Conv(GB_VALUE *, GB_TYPE);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_NumberToString(int flag, double value, const char *format, char **str, int *len);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
|
|
|
void GB_HashTableNew(GB_HASHTABLE *hash, int mode);
|
|
|
|
void GB_HashTableAdd(GB_HASHTABLE hash, const char *key, int len, void *data);
|
|
|
|
void GB_HashTableRemove(GB_HASHTABLE hash, const char *key, int len);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_HashTableGet(GB_HASHTABLE hash, const char *key, int len, void **data);
|
2008-01-17 22:39:26 +01:00
|
|
|
void GB_HashTableEnum(GB_HASHTABLE hash, GB_HASHTABLE_ENUM_FUNC func);
|
|
|
|
|
|
|
|
void GB_NewArray(void *pdata, int size, int count);
|
|
|
|
int GB_CountArray(void *data);
|
|
|
|
void *GB_Add(void *pdata);
|
|
|
|
|
2010-04-05 19:02:16 +02:00
|
|
|
GB_STREAM *GB_StreamGet(void *);
|
2008-10-30 01:54:18 +01:00
|
|
|
void GB_StreamSetBytesRead(GB_STREAM *, int);
|
2008-11-05 00:53:39 +01:00
|
|
|
void GB_StreamSetSwapping(GB_STREAM *, int);
|
2013-02-17 01:44:48 +01:00
|
|
|
void GB_StreamSetAvailableNow(GB_STREAM *, int);
|
2011-05-16 04:16:22 +02:00
|
|
|
bool GB_StreamBlock(GB_STREAM *, int);
|
2010-04-05 19:02:16 +02:00
|
|
|
int GB_StreamRead(GB_STREAM *stream, void *addr, int len);
|
|
|
|
int GB_StreamWrite(GB_STREAM *stream, void *addr, int len);
|
2008-01-17 22:39:26 +01:00
|
|
|
|
|
|
|
int GB_tolower(int c);
|
|
|
|
int GB_toupper(int c);
|
|
|
|
|
|
|
|
void *GB_DebugGetClass(const char *name);
|
|
|
|
void *GB_DebugGetExec(void);
|
2013-12-18 12:21:01 +01:00
|
|
|
void GB_DebugBreakOnError(bool);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#define GB_PrintString PRINT_string
|
|
|
|
|
|
|
|
#ifndef __GBX_API_C
|
|
|
|
EXTERN void *GAMBAS_Api[];
|
|
|
|
EXTERN void *GAMBAS_DebugApi[];
|
2012-05-23 21:26:15 +02:00
|
|
|
EXTERN void *GAMBAS_JitApi[];
|
2007-12-30 17:41:49 +01:00
|
|
|
EXTERN unsigned int GAMBAS_MissingParam;
|
|
|
|
EXTERN bool GAMBAS_DoNotRaiseEvent;
|
|
|
|
EXTERN bool GAMBAS_StopEvent;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|