/* $Id: gensock.h 1.8 1995/01/25 23:28:11 rushing Exp $ */


#define ERR_NO_ERROR_CODE		-5000	/* this is returned by misbehaving stacks that
						 * fail, but don't set an error code
						 */

typedef void FAR * socktag;

#ifdef __cplusplus
extern "C" {
#endif
/* function prototypes */

int	FAR PASCAL gensock_connect 	(char FAR * hostname, char FAR * service, socktag FAR * pst, char UseSSL, int ipfamily = 0);
int	FAR PASCAL gensock_getchar 	(socktag st, int wait, char FAR * ch);
int	FAR PASCAL gensock_put_data (socktag st, char FAR * data, unsigned long length);
int	FAR PASCAL gensock_close	(socktag st);
int	FAR PASCAL gensock_gethostname	(char FAR * name, int namelen);
int	FAR PASCAL gensock_put_data_buffered (socktag st, char FAR * data, unsigned long length);
int	FAR PASCAL gensock_put_data_flush (socktag st);
int FAR PASCAL gensock_starttls (socktag st);
int FAR PASCAL gensock_description (socktag st, char* desc, int nLen);
int FAR PASCAL gensock_startZstream (socktag st, int nType);
int FAR PASCAL gensock_endZstream (socktag st);


typedef enum eConnection
{
	CONN_NORMAL = 0,
	CONN_SSL = 1,
	CONN_TLS = 2
};

#ifdef _INCLSSL
#define DESCR_SIZE 256
extern char  szSSLDescription[DESCR_SIZE];
DWORD GetSSLVersion(LPTSTR lpszFilename, LPTSTR szDescription, int nDescLen, BOOL& bIs64);
int InitSSL();
void DeInitSSL();
LPCTSTR SSLGetDescription();
#endif

#ifdef __cplusplus
}
#endif

