
#ifdef TURTLE_AS_DLL
#ifdef TURTLE_PRIVATE
#define T_DECLTYPE __declspec (dllexport)
#else
#define T_DECLTYPE __declspec (dllimport)
#endif
#else
#define T_DECLTYPE
#endif

#if defined(__APPLE__) && !defined(TURTLE_NOWIN) && !defined(TURTLE_PRIVATE)
#pragma weak main
#endif

#ifdef _MSC_VER
__declspec(selectany) int _turtleLibVersion = 20190914;
#else
int __attribute__((weak)) _turtleLibVersion = 20190914; 
#endif

extern T_DECLTYPE void		tResizeWindow(int width, int height);
extern T_DECLTYPE void		tMaximizeWindow(void);
extern T_DECLTYPE void		tNormalizeWindow(void);
extern T_DECLTYPE void		tCloseWindow(void);
extern T_DECLTYPE int		tSetBackground(double r, double g, double b);
extern T_DECLTYPE double	tSetSpeedAll(double speed);
extern T_DECLTYPE int		tCreateRad(double x, double y, double o);
extern T_DECLTYPE int		tCreate(double x, double y, double odeg);
extern T_DECLTYPE void		tDelete(void);
extern T_DECLTYPE int		tSelect(int id);
extern T_DECLTYPE int		tTurtleId(void);
extern T_DECLTYPE void		tPause(double sec);
extern T_DECLTYPE int		tSyncMode(void);
extern T_DECLTYPE int		tAsyncMode(void);
extern T_DECLTYPE double	tX(void);
extern T_DECLTYPE double	tY(void);
extern T_DECLTYPE double	tOrientation(void);
extern T_DECLTYPE int		tGetClick(void);
extern T_DECLTYPE int		tCheckClick(double);
extern T_DECLTYPE int		tClickButton(void);
extern T_DECLTYPE int		tClickX(void);
extern T_DECLTYPE int		tClickY(void);
extern T_DECLTYPE int		tClickCount(void);
extern T_DECLTYPE int		tShow(void);
extern T_DECLTYPE int		tHide(void);
extern T_DECLTYPE void		tMark(void);
extern T_DECLTYPE int		tPenUp(void);
extern T_DECLTYPE int		tPenDown(void);
extern T_DECLTYPE int		tSetVisual(int visualType);
extern T_DECLTYPE int		tAsTurtle();
extern T_DECLTYPE int		tAsLadybug();
extern T_DECLTYPE double	tSetSpeed(double speed);
extern T_DECLTYPE double	tSetSize(double size);
extern T_DECLTYPE int		tSetShellColor(double r, double g, double b); 
extern T_DECLTYPE int		tSetColor(double r, double g, double b);
extern T_DECLTYPE int		tSetWidth(int width);
extern T_DECLTYPE int		tSetFontSize(int fontSize);
extern T_DECLTYPE void		tText(char *text);
extern T_DECLTYPE void		tPrintf(char *format, ...);
extern T_DECLTYPE char *	tGetText(void);
extern T_DECLTYPE int		tScanf(char *format, ...);
extern T_DECLTYPE double	tMoveTo(double x, double y);
extern T_DECLTYPE double	tForward(double dist);
extern T_DECLTYPE double	tBackward(double dist);
extern T_DECLTYPE double	tHeadTo(double x, double y);
extern T_DECLTYPE double	tTurnToRad(double angle);
extern T_DECLTYPE double	tTurnTo(double deg);
extern T_DECLTYPE double	tTurnRad(double angle);
extern T_DECLTYPE double	tTurn(double deg);
extern T_DECLTYPE double	tArcRad(double radius, double angle);
extern T_DECLTYPE double	tArc(double radius, double degree);
extern T_DECLTYPE double	tCircle(double radius);
extern T_DECLTYPE void		tFill(void);
extern T_DECLTYPE void		tFillAll(void);
extern T_DECLTYPE void		tErase(int skip, int count);
extern T_DECLTYPE void		tCancel(int count);
extern T_DECLTYPE void		tClear(void);
extern T_DECLTYPE void		tClearAll(void);

extern T_DECLTYPE int		tArrayIndex(char *name, int isarray, unsigned int size, int idx);
extern T_DECLTYPE void		tRandomizeStack(void);

#define T_ARRAY_INDEX(s, a, i)	(tArrayIndex(#s, (void *)&(a)== (void *)&(a)[0], sizeof(a)/sizeof((a)[0]), (i)))

#define T_VISUAL_MIN		(1)
#define T_VISUAL_TURTLE		(1)
#define T_VISUAL_LADYBUG	(2)
#define T_VISUAL_MAX		(2)

#ifdef T_CHECK_CC_WARNING
#include <stdio.h>
#define tPrintf               printf
#define tScanf                scanf
#endif
