/*	File		:	F1types.h
**	Author		:	drclue@drclue.net (A.K.A. Ian A. Storms)
**	Description	:	While much less an issue these days , it
**			used to be that even variable types were not consostant
**			accroos all platforms , so having ones own #define'd versions
**			allows one to adapt. Even today , I have the task of migrating to
**			wide byte, which is made much easier. Another Benefit is that it
**			makes the F1 code stand out as such. All the F1xxxx libraries use this
**			one file to define their enviroments.
*/

#ifndef _F1TYPES_H
#define _F1TYPES_H

#define F1_newlineWindows	"\r\n"
#define F1_newlineUnix		"\n\n"

#ifdef  F1_WINDOIDS
#include "F1osWIN.h"
#else
#include "F1osUNIX.h"
#endif

#ifndef MAX_PATH
#define MAX_PATH 1024
#endif




/*
** FORMula_One data type declarations
*/
typedef				char		F1_char		;
typedef				F1_char*	F1_pChar	;
typedef				F1_char**	F1_ppChar	;
typedef const			char	*	F1_cpChar	;
typedef				int		F1_int		;
typedef F1_int*					F1_pInt		;
typedef unsigned		int		F1_uint16	;
typedef unsigned		long		F1_uint32	;
typedef				int		F1_int16	;
typedef				long		F1_int32	;
typedef				double		F1_double	;
typedef				F1_int32	F1_long		;
typedef				float		F1_float	;
typedef				void		F1_void		;
typedef				void	*	F1_pVoid	;
typedef				F1_uint16	F1_bool		;
typedef				F1_bool *	F1_pBool	;

/*
**	F1_szNAMVAL
**	Used to express name value pair data as a structure object.
**	Typically it is intended for staticly defined data.
*/
struct		f1_szNamVal	{	F1_pChar	szField_Name		;
					F1_pChar	szField_Value		;};
typedef struct	f1_szNamVal		F1_szNAMVAL				;
typedef					F1_szNAMVAL*	F1_pszNAMVAL		;

#define BOOL2STR(x) (x)?(F1_pChar) ".T.":(F1_pChar) ".F." 

#ifndef TRUE
#define TRUE      1
#endif

#ifndef FALSE
#define FALSE     0
#endif

#define LF       10
#define CR       13

#define F1_EXTERN_C_START extern "C" {
#define F1_EXTERN_C_END }

enum	F1_Status
		{
		F1OK
		};

enum	F1_Error			{		F1_OK				,
							F1_ERROR_NOFIELDS		,
							F1_ERROR_FILE_NOT_FOUND		,
							F1_ERROR_SOCKET_CONNECT		};

typedef int     (*F1void_sz_int )(F1_pChar	szBuffer,F1_int iLen);
typedef int     (*F1int_sz_int  )(F1_pChar	szBuffer,F1_int iLen);


/*
** This part is not yet truly implemented, but is part of the linkage 
** between the various memory piles such as forms, xml databases etc.
** since it will indeed be a base object, it seemed a good place to
** define it, so as to keep it in mind..
*/

enum	F1_OBJECTTYPE	{	F1T_UNDEFINED		,
				F1T_pChar		,
				F1T_ARRAY		,
				F1T_BOOL		,
				F1T_CHAR		,
				F1T_FLOAT		,
				F1T_INT16		,
				F1T_INT32		,
				F1T_STRING		,
				F1T_String		,
				F1T_pString		,
				F1T_UINT16		,
				F1T_UINT32		,
				F1T_MONEY		,
				F1T_MEMORY		,
				F1T_OBJECT		,
				F1T_DATE		,
				F1T_MEMO		};
#endif

