2009-02-17 00:40 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* common.mak
* make_b32.mak
* make_vc.mak
* make_gcc.mak
* utils/Makefile
- utils/hbmake
- Removed hbmake from repository.
This commit is contained in:
@@ -8,6 +8,15 @@
|
||||
2009-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
|
||||
*/
|
||||
|
||||
2009-02-17 00:40 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
|
||||
* common.mak
|
||||
* make_b32.mak
|
||||
* make_vc.mak
|
||||
* make_gcc.mak
|
||||
* utils/Makefile
|
||||
- utils/hbmake
|
||||
- Removed hbmake from repository.
|
||||
|
||||
2009-02-17 00:33 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
|
||||
* source/compiler/hbusage.c
|
||||
+ Added Vailton Renato to credit list.
|
||||
|
||||
@@ -168,7 +168,6 @@ HBRUN_DIR = utils\hbrun
|
||||
HBTEST_DIR = utils\hbtest
|
||||
HBI18N_DIR = utils\hbi18n
|
||||
HBDOC_DIR = utils\hbdoc
|
||||
HBMAKE_DIR = utils\hbmake
|
||||
HBMK_DIR = utils\hbmk
|
||||
|
||||
#**********************************************************
|
||||
@@ -217,7 +216,6 @@ $(HBRUN_DIR);\
|
||||
$(HBTEST_DIR);\
|
||||
$(HBI18N_DIR);\
|
||||
$(HBDOC_DIR);\
|
||||
$(HBMAKE_DIR);\
|
||||
$(HBMK_DIR)\
|
||||
|
||||
ALL_SRC_DIRS_TMP=\
|
||||
@@ -284,7 +282,6 @@ HBRUN_EXE = $(BIN_DIR)\hbrun$(EXEEXT)
|
||||
HBTEST_EXE = $(BIN_DIR)\hbtest$(EXEEXT)
|
||||
HBI18N_EXE = $(BIN_DIR)\hbi18n$(EXEEXT)
|
||||
HBDOC_EXE = $(BIN_DIR)\hbdoc$(EXEEXT)
|
||||
HBMAKE_EXE = $(BIN_DIR)\hbmake$(EXEEXT)
|
||||
HBMK_EXE = $(BIN_DIR)\hbmk$(EXEEXT)
|
||||
|
||||
HB_DLLVER = 11
|
||||
@@ -1206,14 +1203,6 @@ HBDOC_EXE_OBJS = \
|
||||
|
||||
#**********************************************************
|
||||
|
||||
HBMAKE_EXE_OBJS = \
|
||||
$(OBJ_DIR)\hbmake$(OBJEXT) \
|
||||
$(OBJ_DIR)\hbmgauge$(OBJEXT) \
|
||||
$(OBJ_DIR)\hbmfrdln$(OBJEXT) \
|
||||
$(OBJ_DIR)\hbmlang$(OBJEXT) \
|
||||
|
||||
#**********************************************************
|
||||
|
||||
HBMK_EXE_OBJS = \
|
||||
$(OBJ_DIR)\hbmk$(OBJEXT) \
|
||||
|
||||
@@ -1317,7 +1306,6 @@ HB_BUILD_TARGETS_MAIN = \
|
||||
$(HBTEST_EXE) \
|
||||
$(HBI18N_EXE) \
|
||||
$(HBDOC_EXE) \
|
||||
$(HBMAKE_EXE) \
|
||||
$(HBMK_EXE) \
|
||||
|
||||
# DLL Target is disabled by default
|
||||
|
||||
@@ -552,20 +552,6 @@ $(STANDARD_STATIC_CLIBS)
|
||||
$(MINIMAL_STATIC_HBLIBS) $(HBDOC_LIBS)
|
||||
!
|
||||
#**********************************************************
|
||||
# HBMAKE build rule
|
||||
#**********************************************************
|
||||
$(HBMAKE_EXE) :: BasicLibs BasicExes StdLibs
|
||||
$(HBMAKE_EXE) :: $(HBMAKE_EXE_OBJS)
|
||||
@if exist "$(HBMAKE_EXE)" $(DEL) "$(HBMAKE_EXE)" > NUL
|
||||
$(CC) @&&!
|
||||
$(CFLAGS)
|
||||
-e$(HBMAKE_EXE)
|
||||
$(**: = ^
|
||||
)
|
||||
$(STANDARD_STATIC_CLIBS)
|
||||
$(MINIMAL_STATIC_HBLIBS)
|
||||
!
|
||||
#**********************************************************
|
||||
# HBMK build rule
|
||||
#**********************************************************
|
||||
$(HBMK_EXE) :: BasicLibs BasicExes StdLibs
|
||||
|
||||
@@ -448,10 +448,6 @@ $(HBDOC_EXE) :: StdLibs
|
||||
$(HBDOC_EXE) :: $(HBDOC_EXE_OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
||||
#**********************************************************
|
||||
$(HBMAKE_EXE) :: StdLibs
|
||||
$(HBMAKE_EXE) :: $(HBMAKE_EXE_OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
||||
#**********************************************************
|
||||
$(HBMK_EXE) :: StdLibs
|
||||
$(HBMK_EXE) :: $(HBMK_EXE_OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
@@ -314,9 +314,6 @@ LDFLAGSDLL = /debug $(LDFLAGSDLL)
|
||||
{$(HBDOC_DIR)}.c{$(OBJ_DIR)}$(OBJEXT)::
|
||||
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $<
|
||||
#*******************************************************
|
||||
{$(HBMAKE_DIR)}.c{$(OBJ_DIR)}$(OBJEXT)::
|
||||
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $<
|
||||
#*******************************************************
|
||||
{$(HBMK_DIR)}.c{$(OBJ_DIR)}$(OBJEXT)::
|
||||
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $<
|
||||
#*******************************************************
|
||||
@@ -456,10 +453,6 @@ LDFLAGSDLL = /debug $(LDFLAGSDLL)
|
||||
$(HB) $(HARBOURFLAGSEXE) -o$(OBJ_DIR)\ $<
|
||||
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c
|
||||
#*******************************************************
|
||||
{$(HBMAKE_DIR)}.prg{$(OBJ_DIR)}$(OBJEXT):
|
||||
$(HB) $(HARBOURFLAGSEXE) -o$(OBJ_DIR)\ $<
|
||||
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c
|
||||
#*******************************************************
|
||||
{$(HBMK_DIR)}.prg{$(OBJ_DIR)}$(OBJEXT):
|
||||
$(HB) $(HARBOURFLAGSEXE) -o$(OBJ_DIR)\ $<
|
||||
$(CC) $(CLIBFLAGS) -Fo$(OBJ_DIR)\ $(OBJ_DIR)\$(*B).c
|
||||
@@ -608,9 +601,6 @@ LDFLAGSDLL = /debug $(LDFLAGSDLL)
|
||||
{$(HBDOC_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT)::
|
||||
$(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $<
|
||||
#*******************************************************
|
||||
{$(HBMAKE_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT)::
|
||||
$(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $<
|
||||
#*******************************************************
|
||||
{$(HBMK_DIR)}.c{$(DLL_OBJ_DIR)}$(OBJEXT)::
|
||||
$(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $<
|
||||
#*******************************************************
|
||||
@@ -755,10 +745,6 @@ LDFLAGSDLL = /debug $(LDFLAGSDLL)
|
||||
$(HB) $(HARBOURFLAGSEXE) -o$(DLL_OBJ_DIR)\ $<
|
||||
$(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c
|
||||
#*******************************************************
|
||||
{$(HBMAKE_DIR)}.prg{$(DLL_OBJ_DIR)}$(OBJEXT):
|
||||
$(HB) $(HARBOURFLAGSEXE) -o$(DLL_OBJ_DIR)\ $<
|
||||
$(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c
|
||||
#*******************************************************
|
||||
{$(HBMK_DIR)}.prg{$(DLL_OBJ_DIR)}$(OBJEXT):
|
||||
$(HB) $(HARBOURFLAGSEXE) -o$(DLL_OBJ_DIR)\ $<
|
||||
$(CC) $(CEXEFLAGSDLL) -Fo$(DLL_OBJ_DIR)\ $(DLL_OBJ_DIR)\$(*B).c
|
||||
@@ -969,19 +955,6 @@ $(HBDOC_LIBS)
|
||||
$(STANDARD_SYSLIBS)
|
||||
<<$(HB_KEEPSTATE)
|
||||
#**********************************************************
|
||||
# HBMAKE build rule
|
||||
#**********************************************************
|
||||
$(HBMAKE_EXE) : $(HBMAKE_EXE_OBJS)
|
||||
@if exist "$(HBMAKE_EXE)" $(DEL) "$(HBMAKE_EXE)" > nul
|
||||
$(LINKER) @<<
|
||||
$(LDFLAGS)
|
||||
/out:$(HBMAKE_EXE)
|
||||
$(**: = ^
|
||||
)
|
||||
$(MINIMAL_STATIC_HBLIBS)
|
||||
$(STANDARD_SYSLIBS)
|
||||
<<$(HB_KEEPSTATE)
|
||||
#**********************************************************
|
||||
# HBMK build rule
|
||||
#**********************************************************
|
||||
$(HBMK_EXE) : $(HBMK_EXE_OBJS)
|
||||
|
||||
@@ -9,7 +9,6 @@ DIRS=\
|
||||
hbtest \
|
||||
hbi18n \
|
||||
hbdoc \
|
||||
hbmake \
|
||||
hbmk \
|
||||
$(HB_UTILS) \
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
|
||||
ifeq ($(HB_MAIN),)
|
||||
HB_MAIN = std
|
||||
endif
|
||||
|
||||
ROOT = ../../
|
||||
|
||||
PRG_SOURCES=\
|
||||
hbmake.prg \
|
||||
|
||||
C_SOURCES=\
|
||||
hbmfrdln.c \
|
||||
hbmgauge.c \
|
||||
hbmlang.c \
|
||||
|
||||
PRG_MAIN=hbmake.prg
|
||||
|
||||
LIBS=\
|
||||
hbdebug \
|
||||
hbvm \
|
||||
hbrtl \
|
||||
hbnulrdd \
|
||||
hbrtl \
|
||||
hbvm \
|
||||
hbmacro \
|
||||
hbcommon \
|
||||
|
||||
HB_USER_PRGFLAGS += -gc0
|
||||
|
||||
include $(TOP)$(ROOT)config/bin.cf
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,241 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* xHarbour Project source code:
|
||||
* Text file reading functions
|
||||
*
|
||||
* Copyright 2003 Marcelo Lombardo - lombardo@uol.com.br
|
||||
* http://www.xharbour.org
|
||||
*
|
||||
* 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)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapifs.h"
|
||||
#include "hbset.h"
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
|
||||
#define READING_BLOCK 4096
|
||||
|
||||
BYTE * hb_fsReadLine( HB_FHANDLE hFileHandle, LONG * plBuffLen, char ** Term, int * iTermSizes, USHORT iTerms, BOOL * bFound, BOOL * bEOF )
|
||||
{
|
||||
USHORT uiPosTerm = 0, iPos, uiPosition;
|
||||
USHORT nTries;
|
||||
LONG lRead = 0, lOffset, lSize;
|
||||
BYTE * pBuff;
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_fsReadLine(%p, %ld, %p, %p, %hu, %i, %i)", ( void * ) ( HB_PTRDIFF ) hFileHandle, *plBuffLen, Term, iTermSizes, iTerms, *bFound, *bEOF ));
|
||||
|
||||
*bFound = FALSE;
|
||||
*bEOF = FALSE;
|
||||
nTries = 0;
|
||||
lOffset = 0;
|
||||
lSize = *plBuffLen;
|
||||
|
||||
if( *plBuffLen < 10 )
|
||||
*plBuffLen = READING_BLOCK;
|
||||
|
||||
pBuff = ( BYTE * ) hb_xgrab( *plBuffLen );
|
||||
|
||||
do
|
||||
{
|
||||
if( nTries > 0 )
|
||||
{
|
||||
/* pBuff can be enlarged to hold the line as needed.. */
|
||||
lSize = ( *plBuffLen * ( nTries + 1 ) ) + 1;
|
||||
pBuff = ( BYTE * ) hb_xrealloc( pBuff, lSize );
|
||||
lOffset += lRead;
|
||||
}
|
||||
|
||||
/* read from file */
|
||||
lRead = hb_fsReadLarge( hFileHandle, pBuff + lOffset, lSize - lOffset );
|
||||
|
||||
/* scan the read buffer */
|
||||
|
||||
if( lRead > 0 )
|
||||
{
|
||||
for( iPos = 0; iPos < lRead; iPos++ )
|
||||
{
|
||||
for( uiPosTerm = 0; uiPosTerm < iTerms; uiPosTerm++ )
|
||||
{
|
||||
/* Compare with the LAST terminator byte */
|
||||
if( pBuff[lOffset+iPos] == Term[uiPosTerm][iTermSizes[uiPosTerm]-1] && (iTermSizes[uiPosTerm]-1) <= (iPos+lOffset) )
|
||||
{
|
||||
*bFound = TRUE;
|
||||
|
||||
for(uiPosition=0; uiPosition < (iTermSizes[uiPosTerm]-1); uiPosition++)
|
||||
{
|
||||
if(Term[uiPosTerm][uiPosition] != pBuff[ lOffset+(iPos-iTermSizes[uiPosTerm])+uiPosition+1 ])
|
||||
{
|
||||
*bFound = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( *bFound )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if( *bFound )
|
||||
break;
|
||||
}
|
||||
|
||||
if( *bFound )
|
||||
{
|
||||
*plBuffLen = lOffset + iPos - iTermSizes[ uiPosTerm ] + 1;
|
||||
|
||||
pBuff[ *plBuffLen ] = '\0';
|
||||
|
||||
/* Set handle pointer in the end of the line */
|
||||
hb_fsSeek( hFileHandle, (((lRead-((LONG)iPos)))*-1)+1, FS_RELATIVE );
|
||||
|
||||
return( pBuff );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ! *bFound )
|
||||
{
|
||||
if( nTries == 0 )
|
||||
{
|
||||
pBuff[ 0 ] = '\0';
|
||||
*plBuffLen = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
pBuff[ lOffset + lRead ] = '\0';
|
||||
*plBuffLen = lOffset + lRead;
|
||||
}
|
||||
|
||||
*bEOF = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
nTries++;
|
||||
}
|
||||
while( ( ! *bFound ) && lRead > 0 );
|
||||
|
||||
return( pBuff );
|
||||
}
|
||||
|
||||
/* PRG level fReadLine( <Handle>, <@buffer>, [<aTerminators | cTerminator>], [<nReadingBlock>] ) */
|
||||
|
||||
HB_FUNC( HB_FREADLINE )
|
||||
{
|
||||
PHB_ITEM pTerm1;
|
||||
HB_FHANDLE hFileHandle = ( HB_FHANDLE ) hb_parnl( 1 );
|
||||
char ** Term;
|
||||
BYTE * pBuffer;
|
||||
int * iTermSizes;
|
||||
LONG lSize = hb_parnl( 4 );
|
||||
USHORT i, iTerms;
|
||||
BOOL bFound, bEOF;
|
||||
|
||||
if( ( !ISBYREF( 2 ) ) || ( !ISNUM( 1 ) ) )
|
||||
{
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, 4,
|
||||
hb_paramError( 1 ),
|
||||
hb_paramError( 2 ),
|
||||
hb_paramError( 3 ),
|
||||
hb_paramError( 4 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( ISARRAY( 3 ) || ISCHAR( 3 ) )
|
||||
{
|
||||
if( ISARRAY( 3 ) )
|
||||
{
|
||||
pTerm1 = hb_param( 3, HB_IT_ARRAY );
|
||||
iTerms = ( USHORT ) hb_arrayLen( pTerm1 );
|
||||
|
||||
if( iTerms <= 0 )
|
||||
{
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, 4,
|
||||
hb_paramError( 1 ),
|
||||
hb_paramError( 2 ),
|
||||
hb_paramError( 3 ),
|
||||
hb_paramError( 4 ) );
|
||||
return;
|
||||
}
|
||||
|
||||
Term = ( char ** ) hb_xgrab( sizeof( char * ) * iTerms );
|
||||
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) * iTerms );
|
||||
|
||||
for( i = 0; i < iTerms; i++ )
|
||||
{
|
||||
Term[ i ] = hb_arrayGetCPtr( pTerm1, i + 1 );
|
||||
iTermSizes[ i ] = hb_arrayGetCLen( pTerm1, i + 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pTerm1 = hb_param( 3, HB_IT_STRING );
|
||||
Term = ( char ** ) hb_xgrab( sizeof( char * ) );
|
||||
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) );
|
||||
Term[ 0 ] = ( char * ) hb_itemGetCPtr( pTerm1 );
|
||||
iTermSizes[ 0 ] = hb_itemGetCLen( pTerm1 );
|
||||
iTerms = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Term = ( char ** ) hb_xgrab( sizeof( char * ) );
|
||||
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) );
|
||||
Term[ 0 ] = ( char * ) "\r\n"; /* Should be preplaced with the default EOL sequence */
|
||||
iTerms = 1;
|
||||
iTermSizes[ 0 ] = 2;
|
||||
}
|
||||
|
||||
if( lSize == 0 )
|
||||
lSize = READING_BLOCK;
|
||||
|
||||
pBuffer = hb_fsReadLine( hFileHandle, &lSize, Term, iTermSizes, iTerms, &bFound, &bEOF );
|
||||
|
||||
if( ! hb_storclen_buffer( ( char * ) pBuffer, lSize, 2 ) )
|
||||
hb_xfree( pBuffer );
|
||||
hb_retnl( bEOF ? -1 : 0 );
|
||||
hb_xfree( Term );
|
||||
hb_xfree( iTermSizes );
|
||||
}
|
||||
@@ -1,197 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Gauge functions
|
||||
*
|
||||
* Copyright 2000 Jose Lalin <dezac@corevia.com>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* 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)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapigt.h"
|
||||
|
||||
/* Box array definitions */
|
||||
#define B_TOP 1
|
||||
#define B_LEFT 2
|
||||
#define B_BOTTOM 3
|
||||
#define B_RIGHT 4
|
||||
#define B_BACKCOLOR 5
|
||||
#define B_BARCOLOR 6
|
||||
#define B_DISPLAYNUM 8
|
||||
#define B_BARCHAR 7
|
||||
#define B_PERCENT 9
|
||||
#define B_LEN B_PERCENT
|
||||
|
||||
#define B_BOXLINES "ÚÄ¿³ÙÄÀ³"
|
||||
|
||||
static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
|
||||
{
|
||||
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
|
||||
SHORT iRatio = ( SHORT ) ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) - 1 );
|
||||
SHORT iRow;
|
||||
SHORT iCols;
|
||||
SHORT iMax;
|
||||
char szOldColor[ HB_CLRSTR_LEN ];
|
||||
const char * szStr = " ";
|
||||
char szPct[ 5 ];
|
||||
|
||||
hb_gtGetColorStr( szOldColor );
|
||||
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BARCOLOR ) );
|
||||
|
||||
fPercent = ( fPercent < 0 ? 0 : ( fPercent > 1 ? 1 : fPercent ) );
|
||||
iCols = ( SHORT ) ( fPercent * iRatio );
|
||||
|
||||
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
|
||||
{
|
||||
hb_snprintf( szPct, sizeof( szPct ), "%3.0f%%", fPercent * 100 );
|
||||
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
|
||||
iCenter + 2,
|
||||
( BYTE * ) szPct, 4 );
|
||||
}
|
||||
|
||||
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ) + 1,
|
||||
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ) + 1,
|
||||
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ) - 1,
|
||||
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ) - 1,
|
||||
( BYTE * ) szStr );
|
||||
|
||||
iMax = ( SHORT ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 );
|
||||
for( iRow = 1; iRow <= iMax; iRow++ )
|
||||
{
|
||||
hb_gtRepChar( ( SHORT ) ( hb_arrayGetNI( pArray, B_TOP ) + iRow ),
|
||||
( SHORT ) ( hb_arrayGetNI( pArray, B_LEFT ) + 1 ),
|
||||
( BYTE ) * hb_arrayGetCPtr( pArray, B_BARCHAR ),
|
||||
iCols );
|
||||
}
|
||||
|
||||
hb_gtSetColorStr( szOldColor );
|
||||
}
|
||||
|
||||
/* GaugeNew( <nRowTop>, <nColumnTop>, <nRowBottom>, <nColumnBottom>,
|
||||
[<cBackgroundColor>],
|
||||
[<cGaugeColor>],
|
||||
[<cGaugeCharacter>] ) --> aGauge
|
||||
*/
|
||||
HB_FUNC( GAUGENEW )
|
||||
{
|
||||
PHB_ITEM pReturn = hb_itemArrayNew( B_LEN ); /* Create array */
|
||||
|
||||
hb_arraySetNL( pReturn, B_TOP, hb_parni( B_TOP ) );
|
||||
hb_arraySetNL( pReturn, B_LEFT, hb_parni( B_LEFT ) );
|
||||
hb_arraySetNL( pReturn, B_BOTTOM,
|
||||
ISNUM( B_BOTTOM ) ?
|
||||
( hb_parni( B_BOTTOM ) < hb_parni( B_TOP ) + 2 ?
|
||||
hb_parni( B_TOP ) + 2 : hb_parni( B_BOTTOM ) ) : 0 );
|
||||
hb_arraySetNL( pReturn, B_RIGHT,
|
||||
ISNUM( B_RIGHT ) ?
|
||||
( hb_parni( B_RIGHT ) < hb_parni( B_LEFT ) + 4 ?
|
||||
hb_parni( B_LEFT ) + 4 : hb_parni( B_RIGHT ) ) : 0 );
|
||||
hb_arraySetC( pReturn, B_BACKCOLOR, ISCHAR( B_BACKCOLOR ) ? hb_parc( B_BACKCOLOR ) : "W/N" );
|
||||
hb_arraySetC( pReturn, B_BARCOLOR, ISCHAR( B_BARCOLOR ) ? hb_parc( B_BARCOLOR ) : "W+/N" );
|
||||
hb_arraySetL( pReturn, B_DISPLAYNUM,
|
||||
!( ISNUM( B_RIGHT ) &&
|
||||
ISNUM( B_LEFT ) &&
|
||||
( hb_parni( B_RIGHT ) < hb_parni( B_LEFT ) + 9 ) ) );
|
||||
hb_arraySetC( pReturn, B_BARCHAR, ISCHAR( B_BARCHAR ) ? hb_parc( B_BARCHAR ) : "\xdb" );
|
||||
hb_arraySetNL( pReturn, B_PERCENT, 0 );
|
||||
|
||||
hb_itemReturnRelease( pReturn );
|
||||
}
|
||||
|
||||
/* GaugeDisplay( aGauge ) --> aGauge
|
||||
*/
|
||||
HB_FUNC( GAUGEDISPLAY )
|
||||
{
|
||||
PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( pArray )
|
||||
{
|
||||
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
|
||||
char szOldColor[ HB_CLRSTR_LEN ];
|
||||
const char * szStr = " ";
|
||||
|
||||
hb_gtGetColorStr( szOldColor );
|
||||
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BACKCOLOR ) );
|
||||
|
||||
hb_gtBox( ( SHORT) hb_arrayGetNI( pArray, B_TOP ),
|
||||
( SHORT) hb_arrayGetNI( pArray, B_LEFT ),
|
||||
( SHORT) hb_arrayGetNI( pArray, B_BOTTOM ),
|
||||
( SHORT) hb_arrayGetNI( pArray, B_RIGHT ),
|
||||
( BYTE * ) szStr );
|
||||
|
||||
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
|
||||
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ),
|
||||
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ),
|
||||
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ),
|
||||
( BYTE * ) B_BOXLINES );
|
||||
|
||||
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
|
||||
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
|
||||
iCenter,
|
||||
( BYTE * ) "[ ]", 8 );
|
||||
|
||||
hb_gtSetColorStr( szOldColor );
|
||||
|
||||
hb_gaugeUpdate( pArray, ( float ) hb_arrayGetND( pArray, B_PERCENT ) );
|
||||
|
||||
hb_itemReturn( pArray );
|
||||
}
|
||||
}
|
||||
|
||||
/* GaugeUpdate( aGauge, nPercent ) --> aGauge
|
||||
*/
|
||||
HB_FUNC( GAUGEUPDATE )
|
||||
{
|
||||
PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY );
|
||||
|
||||
if( pArray )
|
||||
{
|
||||
hb_gaugeUpdate( pArray, ISNUM( 2 ) ? ( float ) hb_parnd( 2 ) : 0 );
|
||||
|
||||
hb_itemReturn( pArray );
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
@rem
|
||||
@rem $Id$
|
||||
@rem
|
||||
|
||||
@..\..\bin\hbmk hbmake.prg hbmfrdln.c hbmgauge.c hbmlang.c
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Hbmake detection language function
|
||||
*
|
||||
* Copyright 2000,2001 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* 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)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#define HB_OS_WIN_USED
|
||||
|
||||
#include "hbapi.h"
|
||||
|
||||
HB_FUNC( GETUSERLANG )
|
||||
{
|
||||
long lRet;
|
||||
|
||||
#if defined(HB_OS_WIN) && (!defined(__RSXNT__)) && (!defined(__CYGWIN__))
|
||||
|
||||
switch( GetSystemDefaultLangID() )
|
||||
{
|
||||
case 0x0416:
|
||||
case 0x0816:
|
||||
lRet = 1;
|
||||
break;
|
||||
|
||||
case 0x0409:
|
||||
case 0x0809:
|
||||
case 0x0C09:
|
||||
case 0x1009:
|
||||
case 0x1409:
|
||||
case 0x1809:
|
||||
case 0x1C09:
|
||||
case 0x2009:
|
||||
case 0x2409:
|
||||
case 0x2809:
|
||||
case 0x2C09:
|
||||
lRet = 2;
|
||||
break;
|
||||
|
||||
case 0x040A:
|
||||
case 0x080A:
|
||||
case 0x0C0A:
|
||||
case 0x100A:
|
||||
case 0x140A:
|
||||
case 0x180A:
|
||||
case 0x1C0A:
|
||||
case 0x200A:
|
||||
case 0x240A:
|
||||
case 0x280A:
|
||||
case 0x2C0A:
|
||||
case 0x300A:
|
||||
case 0x340A:
|
||||
case 0x380A:
|
||||
case 0x3C0A:
|
||||
case 0x400A:
|
||||
case 0x440A:
|
||||
case 0x480A:
|
||||
case 0x4C0A:
|
||||
case 0x500A:
|
||||
lRet = 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
lRet = 2;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
lRet = 2;
|
||||
#endif
|
||||
hb_retnl( lRet );
|
||||
}
|
||||
Reference in New Issue
Block a user