diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d806a51213..eca040a0fd 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,18 @@ +2001-07-23 21:29 UTC+0100 Viktor Szakats + + * source/rtl/tbrowse.prg + + TOFIX added, about missing AutoLite support (needed for dbEdit()) + + * source/rtl/net.c + * Cleaned up platform branching. + ! Fixed redefined constant for DJGPP (reported by Dave Pearson) + + I could not test this change, so please test it, and report any + bugs, especially under OS/2 (GCC or ICC) and DJGPP. Thanks. + + Also note that OS/2 support with ICC is/was probably broken, so a + native OS/2 solution would be better here. + 2001-07-23 22:30 MEST Martin Vogel - contrib/libct/ctposupp.c diff --git a/harbour/source/rtl/net.c b/harbour/source/rtl/net.c index d2176eef29..2dde77a3c4 100644 --- a/harbour/source/rtl/net.c +++ b/harbour/source/rtl/net.c @@ -9,9 +9,6 @@ * Copyright 1999-2001 Viktor Szakats * www - http://www.harbour-project.org * - * Copyright 2001 Luiz Rafael Culik - * Support for DJGPP/GCC/OS2 for netname - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) @@ -53,18 +50,41 @@ * */ +/* + * The following parts are Copyright of the individual authors. + * www - http://www.harbour-project.org + * + * Copyright 2001 Luiz Rafael Culik + * Support for DJGPP/GCC/OS2 for netname + * + * See doc/license.txt for licensing terms. + * + */ + #define HB_OS_WIN_32_USED #include "hbapi.h" -#include "hb_io.h" -#if defined(__EMX__) - #include -#define gethostname __gethostname -#elif defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__) && ! defined(HB_OS_OS2) && !defined(__MINGW32__) - #include +#if defined(HB_OS_OS2) + + #include "hb_io.h" + + #if defined(__EMX__) + #include + #define gethostname __gethostname + #endif + + #define MAXGETHOSTNAME 256 /* should be enough for a host name */ + +#elif defined(HB_OS_DOS) + + #if defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__) + #include "hb_io.h" + #include + #endif + #endif -#define MAXGETHOSTNAME 256 /* should be enough for a host name */ + /* NOTE: Clipper will only return a maximum of 15 bytes from this function. And it will be padded with spaces. Harbour does the same in the DOS platform. @@ -72,36 +92,52 @@ HB_FUNC( NETNAME ) { -#if defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__) && !defined(__MINGW32__) +#if defined(HB_OS_OS2) + { - char * pszValue = (char *) hb_xgrab(MAXGETHOSTNAME+1); - pszValue[ 0 ] = '\0'; - - gethostname (pszValue, MAXGETHOSTNAME); - - hb_retc( pszValue ); - hb_xfree( pszValue ); + char * pszValue = ( char * ) hb_xgrab( MAXGETHOSTNAME + 1 ); + pszValue[ 0 ] = '\0'; + + gethostname( pszValue, MAXGETHOSTNAME ); + + hb_retc( pszValue ); + hb_xfree( pszValue ); } #elif defined(HB_OS_DOS) - { - char szValue[ 16 ]; - union REGS regs; - - regs.HB_XREGS.ax = 0x5E00; + #if defined(__DJGPP__) || defined(__RSX32__) || defined(__GNUC__) { - struct SREGS sregs; - - regs.HB_XREGS.dx = FP_OFF( szValue ); - sregs.ds = FP_SEG( szValue ); - - HB_DOS_INT86X( 0x21, ®s, ®s, &sregs ); + char * pszValue = ( char * ) hb_xgrab( MAXGETHOSTNAME + 1 ); + pszValue[ 0 ] = '\0'; + + gethostname( pszValue, MAXGETHOSTNAME ); + + hb_retc( pszValue ); + hb_xfree( pszValue ); } + #else + { + char szValue[ 16 ]; + union REGS regs; + + regs.HB_XREGS.ax = 0x5E00; + + { + struct SREGS sregs; + + regs.HB_XREGS.dx = FP_OFF( szValue ); + sregs.ds = FP_SEG( szValue ); + + HB_DOS_INT86X( 0x21, ®s, ®s, &sregs ); + } + + hb_retc( regs.h.ch == 0 ? "" : szValue ); + } + #endif - hb_retc( regs.h.ch == 0 ? "" : szValue ); - } #elif defined(HB_OS_WIN_32) + { DWORD ulLen = MAX_COMPUTERNAME_LENGTH + 1; char * pszValue = ( char * ) hb_xgrab( ulLen ); @@ -113,7 +149,10 @@ HB_FUNC( NETNAME ) hb_retc( pszValue ); hb_xfree( pszValue ); } + #else + hb_retc( "" ); + #endif } diff --git a/harbour/source/rtl/tbrowse.prg b/harbour/source/rtl/tbrowse.prg index b134ae8e8f..9cf35cadc1 100644 --- a/harbour/source/rtl/tbrowse.prg +++ b/harbour/source/rtl/tbrowse.prg @@ -65,6 +65,9 @@ /* NOTE: Don't use SAY in this module, use DispOut(), DispOutAt() instead, otherwise it will not be CA-Cl*pper compatible. [vszakats] */ +/* TODO: Fix TBrowse when AutoLite = .F. + This is also needed to make dbEdit() work correctly. [vszakats] */ + /* TODO: :firstScrCol() --> nScreenCol Determines screen column where the first table column is displayed. Xbase++ compatible method */