#ifndef TA_GLOBAL_H
#define TA_GLOBAL_H
#ifndef TA_COMMON_H
#include "ta_common.h"
#endif
#ifndef TA_FUNC_H
#include "ta_func.h"
#endif
typedef struct {
TA_CandleSettingType settingType;
TA_RangeType rangeType;
int avgPeriod;
double factor;
} TA_CandleSetting;
typedef enum
{
TA_ABSTRACTION_GLOBAL_ID,
TA_FUNC_GLOBAL_ID,
TA_MEMORY_GLOBAL_ID,
TA_NB_GLOBAL_ID
} TA_GlobalModuleId;
typedef TA_RetCode (*TA_GlobalInitFunc) ( void **globalToAlloc );
typedef TA_RetCode (*TA_GlobalShutdownFunc)( void *globalAllocated );
typedef struct
{
const TA_GlobalModuleId id;
const TA_GlobalInitFunc init;
const TA_GlobalShutdownFunc shutdown;
} TA_GlobalControl;
TA_RetCode TA_GetGlobal( const TA_GlobalControl * const control,
void **global );
int TA_IsTraceEnabled( void );
void TA_TraceEnable ( void );
void TA_TraceDisable ( void );
const char *TA_GetLocalCachePath( void );
typedef struct
{
unsigned int initialize;
const TA_GlobalControl * control;
void *global;
} TA_ModuleControl;
typedef struct
{
unsigned int magicNb;
TA_ModuleControl moduleControl[TA_NB_GLOBAL_ID];
unsigned int traceEnabled;
unsigned int stdioEnabled;
FILE *stdioFile;
const char *localCachePath;
TA_Compatibility compatibility;
unsigned int unstablePeriod[TA_FUNC_UNST_ALL];
TA_CandleSetting candleSettings[TA_AllCandleSettings];
} TA_LibcPriv;
extern TA_LibcPriv *TA_Globals;
#endif