2009-07-28 10:26 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* make_gnu_os2.cmd
  * make_gnu.bat
    % Deleted defaulting of HB_*_INSTALL. Now done by make files.
    ; Same should be done for *nixes.

  * contrib/xhb/inet.h
    * Converted to a stub which shows error. This header was
      making public some local structures and functions which are
      no longer supported in Harbour.

  * contrib/xhb/inet.h
  * contrib/hbct/print.c
  * contrib/hbtpathy/tpwin.c
  * source/rtl/hbinet.c
    ! *WIN_32* -> *WIN*
This commit is contained in:
Viktor Szakats
2009-07-28 08:29:54 +00:00
parent 3a74eec9e1
commit f9e33982f7
7 changed files with 23 additions and 119 deletions

View File

@@ -17,6 +17,23 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-07-28 10:26 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* make_gnu_os2.cmd
* make_gnu.bat
% Deleted defaulting of HB_*_INSTALL. Now done by make files.
; Same should be done for *nixes.
* contrib/xhb/inet.h
* Converted to a stub which shows error. This header was
making public some local structures and functions which are
no longer supported in Harbour.
* contrib/xhb/inet.h
* contrib/hbct/print.c
* contrib/hbtpathy/tpwin.c
* source/rtl/hbinet.c
! *WIN_32* -> *WIN*
2009-07-28 10:05 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* source/rtl/hbinet.c
% Deleted _HB_SOCKET

View File

@@ -199,7 +199,7 @@ HB_FUNC( PRINTSEND )
hb_retni( 0 );
}
#elif defined( HB_OS_WIN_32 )
#elif defined( HB_OS_WIN )
char szChr[ 2 ] = { ' ', '\0' };
char szPort[ 5 ] = { 'l', 'p', 't', '1', '\0' };

View File

@@ -51,13 +51,13 @@
*
*/
#define HB_OS_WIN_32_USED
#define HB_OS_WIN_USED
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbapifs.h"
#ifdef HB_OS_WIN_32
#if defined( HB_OS_WIN )
#include <stdio.h>
@@ -120,4 +120,4 @@ HB_FUNC( P_WRITEPORT )
hb_retnl( bRet ? ( long ) nWritten : -1 ); /* Put GetLastError() on error, or better a second byref param? */
}
#endif /* HB_OS_WIN_32 */
#endif /* HB_OS_WIN */

View File

@@ -52,105 +52,6 @@
#ifndef HB_INET_H_
#define HB_INET_H_
#include "hbdefs.h"
#include "hbvm.h"
#include "hbapierr.h"
#define HB_SOCKET_SIGN 0xF0123A42
#if defined( HB_OS_DOS )
#define HB_NO_DEFAULT_INET
#else
#if defined( HB_OS_WIN_32 )
#define _WINSOCKAPI_ /* Prevents inclusion of Winsock.h in Windows.h */
#define HB_SOCKET_T SOCKET
#include <winsock2.h>
#include <windows.h>
#define HB_INET_CLOSE( x ) closesocket( x )
extern char *hstrerror( int i );
#else
#if defined( HB_OS_HPUX )
#define _XOPEN_SOURCE_EXTENDED
#endif
#define HB_SOCKET_T int
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
extern int h_errno;
#define HB_INET_CLOSE( x ) close( x )
#ifdef HB_OS_DARWIN
#if !defined( socklen_t ) && !defined( _SOCKLEN_T )
#define socklen_t int
#endif
#endif
#include <errno.h>
#endif
typedef struct tag_HB_SOCKET_STRUCT
{
ULONG sign;
HB_SOCKET_T com;
char *errorDesc;
int errorCode;
struct sockaddr_in remote;
LONG count;
int timeout;
int timelimit;
PHB_ITEM caPeriodic;
int iSndBufSize;
int iRcvBufSize;
} HB_SOCKET_STRUCT;
#define HB_PARSOCKET( n ) ( ( HB_SOCKET_STRUCT * ) hb_parptrGC( hb_inetSocketFinalize, n ) )
#define HB_SOCKET_ZERO_ERROR( s ) s->errorCode = 0; s->errorDesc = ""
#if defined( HB_OS_WIN_32 )
#define HB_SOCKET_SET_ERROR( s ) \
s->errorCode = WSAGetLastError(); \
s->errorDesc = strerror( s->errorCode );\
WSASetLastError( 0 );
#else
#define HB_SOCKET_SET_ERROR( s ) s->errorCode = errno; s->errorDesc = strerror( errno )
#endif
#define HB_SOCKET_SET_ERROR1( s, code ) s->errorCode = code; s->errorDesc = strerror( code );
#define HB_SOCKET_SET_ERROR2( s, code, desc ) s->errorCode = code; s->errorDesc = desc;
#define HB_SOCKET_INIT( s, p ) \
{\
s = ( HB_SOCKET_STRUCT *) hb_gcAlloc( sizeof( HB_SOCKET_STRUCT ), hb_inetSocketFinalize );\
p = hb_itemPutPtrGC( p, s );\
HB_SOCKET_ZERO_ERROR( s );\
s->sign = HB_SOCKET_SIGN;\
s->com = 0;\
s->count = 0;\
s->timeout = -1;\
s->timelimit = -1;\
s->caPeriodic = NULL;\
}
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
#endif
#ifndef MSG_DONTWAIT
/* #define MSG_DONTWAIT 0x80 */
#define MSG_DONTWAIT 0
#endif
#ifndef MSG_WAITALL
#define MSG_WAITALL 0
#endif
#endif
#error Please use hbsocket.h in Harbour.
#endif

View File

@@ -31,12 +31,6 @@ if "%HB_COMPILER%" == "" set HB_COMPILER=djgpp
if "%HB_INSTALL_PREFIX%" == "" if "%OS%" == "Windows_NT" set HB_INSTALL_PREFIX=%~dp0
rem Set to constant value
if "%HB_BIN_INSTALL%" == "" set HB_BIN_INSTALL=%HB_INSTALL_PREFIX%\bin
if "%HB_LIB_INSTALL%" == "" set HB_LIB_INSTALL=%HB_INSTALL_PREFIX%\lib\%HB_ARCHITECTURE%\%HB_COMPILER%
if "%HB_INC_INSTALL%" == "" set HB_INC_INSTALL=%HB_INSTALL_PREFIX%\include
if "%HB_DOC_INSTALL%" == "" set HB_DOC_INSTALL=%HB_INSTALL_PREFIX%\doc
goto MAKE
:WIN_AUTODETECT

View File

@@ -16,14 +16,6 @@ rem for further information about see make_gnu.bat
if "%HB_ARCHITECTURE%" == "" set HB_ARCHITECTURE=os2
if "%HB_COMPILER%" == "" set HB_COMPILER=gcc
rem Set to constant value to be consistent with the non-GNU make files.
if "%HB_BIN_INSTALL%" == "" set HB_BIN_INSTALL=%HB_INSTALL_PREFIX%\bin
if "%HB_LIB_INSTALL%" == "" set HB_LIB_INSTALL=%HB_INSTALL_PREFIX%\lib\%HB_ARCHITECTURE%\%HB_COMPILER%
if "%HB_INC_INSTALL%" == "" set HB_INC_INSTALL=%HB_INSTALL_PREFIX%\include
if "%HB_DOC_INSTALL%" == "" set HB_DOC_INSTALL=%HB_INSTALL_PREFIX%\doc
rem In GCC3.2.2 the TCP/IP headers and libraries scheme have been changed.
rem The default is the current OS/2 tcpip toolkit (BSD 4.4 based).
rem To target the older OS/2 tcpip stack (BSD 4.3 based) and create

View File

@@ -1157,7 +1157,6 @@ HB_FUNC( HB_INETSERVER )
HB_FUNC( HB_INETACCEPT )
{
PHB_SOCKET_STRUCT socket = HB_PARSOCKET( 1 );
PHB_SOCKET_STRUCT new_socket;
HB_SOCKET_T incoming;
void * sa;
unsigned len;
@@ -1190,6 +1189,7 @@ HB_FUNC( HB_INETACCEPT )
}
else
{
PHB_SOCKET_STRUCT new_socket;
PHB_ITEM pSocket = NULL;
HB_SOCKET_INIT( new_socket, pSocket );
new_socket->remote = sa;