//**************************************************
//
//              libsk_access_tcp.so V1.2
//
//**************************************************
#ifndef __SK_ACCESS_TCP_H_INCLUDED__
#define __SK_ACCESS_TCP_H_INCLUDED__

#define _cdecl __attribute__((cdecl))

typedef char byte;
typedef unsigned short Word;
typedef unsigned int DWord;
  
  
typedef struct T_sockets{
  DWord ip[255];
}Tsockets;
  
typedef struct T_key_def{
    char scan,ascii;
}Tkey_def;
  
typedef struct T_Message{
  DWord Msg;
  union{
    struct{
	Word WParamLo;
	Word WParamHi;
	Word LParamLo;
	Word LParamHi;
	Word ResultLo;
	Word ResultHi;};
    struct{
	DWord WParam;
	DWord LParam;
	DWord Result;};
   };
} TMessage;
  
typedef void (_cdecl *TProcMsg)(TMessage *MSg);
typedef void (_cdecl *TProc)(DWord Wparam , DWord Lparam);
/* -----------------------------------------------------------------*/
extern void  _cdecl Set_Port(Word port);
extern void  _cdecl Set_Single_thread();
extern void  _cdecl Start_Server(TProcMsg M_CONNECT , TProcMsg M_COMMUNIC);
extern void  _cdecl ProccessMessages();
extern _Bool _cdecl Send_Data(byte data);
extern _Bool _cdecl Clear_Disp();
extern _Bool _cdecl Clear_L1();
extern _Bool _cdecl Clear_L2();
extern _Bool _cdecl Cursor_Off();
extern _Bool _cdecl Cursor_On();
extern _Bool _cdecl Cursor_Blink();
extern _Bool _cdecl Back_Space();
extern _Bool _cdecl Line_Feed();
extern _Bool _cdecl Carriage_Return();
extern _Bool _cdecl Gotoxy(byte x, byte y);
extern _Bool _cdecl Disp_Char(char data);
extern _Bool _cdecl Disp(char *data);
extern byte  _cdecl Get_Cursor(byte *x_pos, byte *y_pos);
extern byte  _cdecl Get_Status();
extern _Bool _cdecl Set_Page0();
extern _Bool _cdecl Set_Page1();
extern void  _cdecl Free_Sk_Access();
extern void  _cdecl Set_Eco_On();
extern void  _cdecl Set_Eco_Off();
extern void  _cdecl Set_Udg(byte caracter, byte def0, byte def1, byte def2, byte def3, byte def4,
		  byte def5, byte def6, byte def7);
extern int   _cdecl Set_Interface(char *interf);
extern void  _cdecl Get_Dll_Version(char *ver);
extern void  _cdecl Reset_Interface();
extern void  _cdecl Get_Firmware_Version(char *Ver);
extern _Bool _cdecl Alive(int client);
extern int   _cdecl Get_Client_Type(int client);
extern int   _cdecl Set_MClient(int client);
extern int   _cdecl Set_SClient(int client);
extern int   _cdecl Set_Client(int client);
extern void  _cdecl Get_Host_IP(char *ip);
extern void  _cdecl Kill_Server();
extern void  _cdecl Get_Client_IP(char *ip);
extern void  _cdecl List_Clients(Tsockets *lista);
extern int   _cdecl Get_Data(Tkey_def *buffer , int size);
extern _Bool _cdecl Reset_Protocol();
extern int   _cdecl Get_Same_Ip(int client);
extern int   _cdecl Get_MClient(int client);   
extern int   _cdecl Get_SClient(int client);  
extern void  _cdecl Keyb_Reset();
extern void  _cdecl Run_Silent();
extern _Bool _cdecl Ping(int client); 
extern _Bool _cdecl Lock_Ip(int client ,char *ip);
extern _Bool _cdecl Unlock_Ip(int client);
extern void  _cdecl Unlock_All();
extern _Bool _cdecl Send_Disp_Ctrl(byte data);
extern DWord _cdecl Inv_IP_HEX(DWord ip); 
extern DWord _cdecl IP_ascii2HEX(char *ip_ascii);
extern char  _cdecl *IP_HEX2ascii(char *buffer,DWord ip);
extern void  _cdecl Log_On(int level);
extern void  _cdecl Log_Off();
extern void  _cdecl Flush();
extern void  _cdecl S_Mode_Off();
extern void  _cdecl S_Mode_On();
extern _Bool _cdecl Send_Block(void *data,int size);
extern _Bool _cdecl Get_Block(byte block,byte *buffer);
extern char  _cdecl Ascii(byte Scan_code);
extern _Bool _cdecl Save(double nro ,int mem);
extern double _cdecl Recall(int mem);
extern char  _cdecl State_Ascii(DWord Lparam);
extern char  _cdecl State_Scan(DWord Lparam);
extern void  _cdecl State_Timer();
extern char  _cdecl *Recall_String(char *str ,int mem);
extern void  _cdecl Register_State(int state ,TProc Proc);
extern char  _cdecl *State_String(char *str);
extern void  _cdecl Stop_Machine();
extern _Bool _cdecl Save_String(char *str ,int mem);
extern void  _cdecl Get_Client_IP(char *ip);
extern void  _cdecl Start_Machine();
extern void  _cdecl Set_State(int state,int delay);   
extern void  _cdecl Set_Next_State(int delay);
extern int   _cdecl Mount_State_String(DWord Lparam);
extern void  _cdecl Get_State_String(DWord Lparam, int size, char delimiter);
extern void  _cdecl State_Proccess(DWord Lparam);
extern void  _cdecl Set_Caps();
extern void  _cdecl Clr_Caps();
extern void  _cdecl Set_Num();
extern void  _cdecl Clr_Num();
extern void  _cdecl Set_Scrl();
extern void  _cdecl Clr_Scrl();

/* -----------------------------------------------------------------*/	

#endif 