00001 /* 00002 FALCON - The Falcon Programming Language. 00003 FILE: globals.h 00004 00005 Engine-wide exported variables and global functions. 00006 ------------------------------------------------------------------- 00007 Author: Giancarlo Niccolai 00008 Begin: Mon, 02 Mar 2009 20:19:00 +0100 00009 00010 ------------------------------------------------------------------- 00011 (C) Copyright 2009: the FALCON developers (see list in AUTHORS file) 00012 00013 See LICENSE file for licensing details. 00014 */ 00015 #ifndef FALCON_GLOBALS_H 00016 #define FALCON_GLOBALS_H 00017 00018 #include <falcon/setup.h> 00019 #include <falcon/types.h> 00020 #include <stdlib.h> // for size_t 00021 00022 namespace Falcon 00023 { 00024 00025 class MemPool; 00026 class StringTable; 00027 class VFSProvider; 00028 class String; 00029 00030 FALCON_DYN_SYM extern void * (*memAlloc) ( size_t ); 00031 FALCON_DYN_SYM extern void (*memFree) ( void * ); 00032 FALCON_DYN_SYM extern void * (*memRealloc) ( void *, size_t ); 00033 00034 FALCON_DYN_SYM extern void * (*gcAlloc) ( size_t ); 00035 FALCON_DYN_SYM extern void (*gcFree) ( void * ); 00036 FALCON_DYN_SYM extern void * (*gcRealloc) ( void *, size_t ); 00037 FALCON_DYN_SYM extern MemPool *memPool; 00038 FALCON_DYN_SYM extern StringTable *engineStrings; 00039 00040 class MemPool; 00041 00042 namespace Engine 00043 { 00044 FALCON_DYN_SYM void Init(); 00045 FALCON_DYN_SYM void Shutdown(); 00046 00059 FALCON_DYN_SYM void setEncodings( const String &sSrcEnc, const String &sIOEnc ); 00060 00067 FALCON_DYN_SYM void getEncodings( String &sSrcEnc, String &sIOEnc ); 00068 00069 FALCON_DYN_SYM bool addVFS( const String &name, VFSProvider *prv ); 00070 FALCON_DYN_SYM VFSProvider* getVFS( const String &name ); 00071 00072 FALCON_DYN_SYM const String &getMessage( uint32 id ); 00073 FALCON_DYN_SYM bool setTable( StringTable *tab ); 00074 FALCON_DYN_SYM bool setLanguage( const String &language ); 00078 FALCON_DYN_SYM void setSearchPath( const String &path ); 00079 00081 FALCON_DYN_SYM String getSearchPath(); 00082 00083 class AutoInit { 00084 public: 00085 inline AutoInit() { Init(); } 00086 inline ~AutoInit() { Shutdown(); } 00087 }; 00088 00089 } 00090 00091 } 00092 #endif 00093 00094 /* end of globals.h */