2010-11-17 12:03 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* examples/terminal/trm_srv.prg
  * examples/terminal/readme.txt
    ! Fixed to use localhost instead of IPV4 specific 127.0.0.1

  ; Patches from Tamas: (Thanks a lot!)

  + debian/postinst
  + debian/postrm
    + make deb package run ldconfig when needed

  * contrib/hbfbird/tests/simple.prg
  * contrib/hbfbird/tests/test.prg
  * contrib/hbfbird/tests/stress.prg
    * Formatting, fixes, cleanup.
    ; TOFIX: OOP layer in hbfbird.

  * contrib/sddpg/sddpg.c
  * contrib/hbpgsql/postgres.c
    ! Fixed postgres header situation.

  + contrib/hbgd/tests/test.prg
  * contrib/hbgd/gdwrp.c
    + Resolved TODO.
    + Added new test.
This commit is contained in:
Viktor Szakats
2010-11-17 11:04:43 +00:00
parent d1183b4073
commit ebaee42c22
12 changed files with 163 additions and 93 deletions

View File

@@ -16,6 +16,32 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-11-17 12:03 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* examples/terminal/trm_srv.prg
* examples/terminal/readme.txt
! Fixed to use localhost instead of IPV4 specific 127.0.0.1
; Patches from Tamas: (Thanks a lot!)
+ debian/postinst
+ debian/postrm
+ make deb package run ldconfig when needed
* contrib/hbfbird/tests/simple.prg
* contrib/hbfbird/tests/test.prg
* contrib/hbfbird/tests/stress.prg
* Formatting, fixes, cleanup.
; TOFIX: OOP layer in hbfbird.
* contrib/sddpg/sddpg.c
* contrib/hbpgsql/postgres.c
! Fixed postgres header situation.
+ contrib/hbgd/tests/test.prg
* contrib/hbgd/gdwrp.c
+ Resolved TODO.
+ Added new test.
2010-11-16 10:29 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/xhb/xthrow.prg
! removed unreachable RETURN statement reported by extended BREAK()

View File

@@ -2,27 +2,32 @@
* $Id$
*/
#include "common.ch"
#include "simpleio.ch"
Function main()
Local oServer, oQuery, oRow, i, x, aTables, aStruct, aKey
FUNCTION Main()
LOCAL oServer, oQuery, oRow, i, x, aTables, aStruct, aKey
Local cServer := "127.0.0.1:" + hb_dirBase() + "simple.gdb"
Local cUser := "sysdba"
Local cPass := "masterkey"
Local nDialect := 1
Local cQuery
LOCAL cServer := "localhost:"
LOCAL cDatabase
LOCAL cUser := "SYSDBA"
LOCAL cPass := "masterkey"
LOCAL nPageSize := 1024
LOCAL cCharSet := "ASCII"
LOCAL nDialect := 1
LOCAL cQuery, cName
IF hb_FileExists( hb_dirBase() + "simple.gdb" )
FErase( hb_dirBase() + "simple.gdb" )
hb_FNameSplit( hb_argv( 0 ), NIL, @cName, NIL )
cDatabase := hb_DirTemp() + cName + ".fdb"
IF hb_FileExists( cDatabase )
FErase( cDatabase )
ENDIF
? FBCreateDB( hb_dirBase() + "simple.gdb", cuser, cpass, 1024, "ASCII", nDialect )
? FBCreateDB( cServer + cDatabase, cUser, cPass, nPageSize, cCharSet, nDialect )
? "Connecting..."
oServer := TFBServer():New( cServer, cUser, cPass, nDialect )
oServer := TFBServer():New( cServer + cDatabase, cUser, cPass, nDialect )
IF oServer:NetErr()
? oServer:Error()

View File

@@ -4,25 +4,33 @@
/* VERY IMPORTANT: Don't use this query as sample, they are used for stress tests !!! */
#include "simpleio.ch"
FUNCTION Main()
LOCAL oServer, oQuery, oRow, i, x
LOCAL cServer := "127.0.0.1:" + hb_dirBase() + "stress.gdb"
LOCAL cUser := "sysdba"
LOCAL cServer := "localhost:"
LOCAL cDatabase
LOCAL cUser := "SYSDBA"
LOCAL cPass := "masterkey"
LOCAL nPageSize := 1024
LOCAL cCharSet := "WIN1251"
LOCAL nDialect := 1
LOCAL cQuery
LOCAL cQuery, cName
CLEAR SCREEN
IF ! hb_FileExists( hb_dirBase() + "stress.gdb" )
? FBCreateDB( hb_dirBase() + "stress.gdb", cuser, cpass, 1024, "WIN1251", nDialect )
hb_FNameSplit( hb_argv( 0 ), NIL, @cName, NIL )
cDatabase := hb_DirTemp() + cName + ".fdb"
IF ! hb_FileExists( cDatabase )
? FBCreateDB( cServer + cDatabase, cUser, cPass, nPageSize, cCharSet, nDialect )
ENDIF
? "Connecting..."
oServer := TFBServer():New( cServer, cUser, cPass, nDialect )
oServer := TFBServer():New( cServer + cDatabase, cUser, cPass, nDialect )
IF oServer:NetErr()
? oServer:Error()
@@ -65,7 +73,7 @@ FUNCTION Main()
oRow:Fieldput(1, i)
oRow:Fieldput(2, i+1)
oRow:Fieldput(3, "DEPARTMENT NAME " + strzero( i ) )
oRow:Fieldput(4, (i % 10) == 0) )
oRow:Fieldput(4, (i % 10) == 0)
oRow:Fieldput(5, 3000 + i )
oRow:fieldput(6, Date() )

View File

@@ -6,9 +6,15 @@
#include "simpleio.ch"
FUNCTION Main()
LOCAL cDir, cName
LOCAL cDBName
LOCAL cServer := "localhost:"
LOCAL cDatabase
LOCAL cUser := "SYSDBA"
LOCAL cPass := "masterkey"
LOCAL nPageSize := 1024
LOCAL cCharSet := "ASCII"
LOCAL nDialect := 1
LOCAL cName
LOCAL trans, qry
@@ -18,17 +24,18 @@ FUNCTION Main()
LOCAL fetch_stat
LOCAL tmp
hb_FNameSplit( hb_argv( 0 ), @cDir, @cName, NIL )
cDBName := hb_FNameMerge( cDir, cName, ".gdb" )
hb_FNameSplit( hb_argv( 0 ), NIL, @cName, NIL )
cDatabase := hb_DirTemp() + cName + ".fdb"
IF hb_FileExists( cDBName )
FErase( cDBName )
IF hb_FileExists( cDatabase )
FErase( cDatabase )
ENDIF
? tmp := FBCreateDB( cDBName, "sysdba", "masterkey", 1024, "ASCII", nDialect ), FBError( tmp )
? tmp := FBCreateDB( cServer + cDatabase, cUser, cPass, nPageSize, cCharSet, nDialect ), FBError( tmp )
/* Connect rdbms */
db := FBConnect( "127.0.0.1:" + cDBName, "sysdba", "masterkey" )
db := FBConnect( cServer + cDatabase, cUser, cPass )
IF ISNUMBER( db )
? "Error:", db, FBError( db )
QUIT

View File

@@ -921,7 +921,7 @@ HB_FUNC( GDIMAGEPOLYGON ) /* original: void gdImagePolygon(gdImagePtr im, gdPoin
int i;
/* Max Points of polygon */
gdPoint points[50]; /* TODO: make this dynamic */
gdPoint * points;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
@@ -929,6 +929,7 @@ HB_FUNC( GDIMAGEPOLYGON ) /* original: void gdImagePolygon(gdImagePtr im, gdPoin
/* Retrieve point array */
pPoints = hb_param( 2, HB_IT_ARRAY );
pointsTotal = ( int ) hb_arrayLen( pPoints );
points = ( gdPoint * ) hb_xgrab( sizeof( gdPoint ) * pointsTotal );
for( i = 0; i < pointsTotal; i ++ )
{
@@ -946,6 +947,7 @@ HB_FUNC( GDIMAGEPOLYGON ) /* original: void gdImagePolygon(gdImagePtr im, gdPoin
/* Draw a polygon */
gdImagePolygon( im, ( gdPointPtr ) points, pointsTotal, color );
hb_xfree( points );
}
else
{
@@ -974,7 +976,7 @@ HB_FUNC( GDIMAGEOPENPOLYGON ) /* original: void gdImageOpenPolygon(gdImagePtr im
int i;
/* Max Points of polygon */
gdPoint points[50]; /* TODO: make this dynamic */
gdPoint * points;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
@@ -982,6 +984,7 @@ HB_FUNC( GDIMAGEOPENPOLYGON ) /* original: void gdImageOpenPolygon(gdImagePtr im
/* Retrieve point array */
pPoints = hb_param( 2, HB_IT_ARRAY );
pointsTotal = ( int ) hb_arrayLen( pPoints );
points = ( gdPoint * ) hb_xgrab( sizeof( gdPoint ) * pointsTotal );
for( i = 0; i < pointsTotal; i ++ )
{
@@ -999,6 +1002,7 @@ HB_FUNC( GDIMAGEOPENPOLYGON ) /* original: void gdImageOpenPolygon(gdImagePtr im
/* Draw a polygon */
gdImageOpenPolygon( im, ( gdPointPtr ) points, pointsTotal, color );
hb_xfree( points );
}
else
{
@@ -1542,7 +1546,7 @@ HB_FUNC( GDIMAGESETSTYLE ) /* original: void gdImageSetStyle(gdImagePtr im, int
int i;
/* Max numbery of Styles */
int styles[50]; /* TODO: make this dynamic */
int * styles;
/* Retrieve image pointer */
im = hb_parGdImage( 1 );
@@ -1550,14 +1554,17 @@ HB_FUNC( GDIMAGESETSTYLE ) /* original: void gdImageSetStyle(gdImagePtr im, int
/* Retrieve style array */
pStyles = hb_param( 2, HB_IT_ARRAY );
styleLength = ( int ) hb_arrayLen( pStyles );
styles = ( int * ) hb_xgrab( sizeof( int ) * styleLength );
for( i = 0; i < styleLength; i ++ )
{
styles[ i ] = hb_arrayGetNI( pStyles, i+1 );
styles[ i ] = hb_arrayGetNI( pStyles, i + 1 );
}
/* Set style */
gdImageSetStyle( im, ( int * ) styles, styleLength);
hb_xfree( styles );
}
else
{
@@ -3528,9 +3535,7 @@ HB_FUNC( GDIMAGESQUARETOCIRCLE ) /* void gdImageSquareToCircle(gdImagePtr im, in
/* Retrieve radius value */
radius = hb_parni( 2 );
/* TODO */
gdImageSquareToCircle( im, radius );
hb_retGdImage( gdImageSquareToCircle( im, radius ) );
}
else
{

View File

@@ -0,0 +1,28 @@
/*
* $Id$
*/
#define IMAGES_OUT "imgs_out/"
PROCEDURE Main()
LOCAL im, im2, col, i
im := gdImageCreateTrueColor( 100, 100 )
col := gdImageColorAllocate( im, 255, 255, 255 )
FOR i := 0 TO 99 STEP 10
gdImageLine( im, i, 0, i, 99, col )
gdImageLine( im, 0, i, 99, i, col )
NEXT
gdImagePng( im, IMAGES_OUT + "gdtest.png" )
im2 := gdImageSquareToCircle( im, 400 )
gdImagePng( im2, IMAGES_OUT + "gdtest_squared.png" )
gdImageDestroy( im )
gdImageDestroy( im2 )
RETURN

View File

@@ -58,30 +58,8 @@
#include "hbapiitm.h"
#include "libpq-fe.h"
#define VARHDRSZ 4
#define BOOLOID 16
#define INT8OID 20
#define INT2OID 21
#define INT4OID 23
#define TEXTOID 25
#define OIDOID 26
#define FLOAT4OID 700
#define FLOAT8OID 701
#define CASHOID 790
#define BPCHAROID 1042
#define VARCHAROID 1043
#define DATEOID 1082
#define TIMEOID 1083
#define TIMESTAMPOID 1114
#define TIMESTAMPTZOID 1184
#define TIMETZOID 1266
#define BITOID 1560
#define VARBITOID 1562
#define NUMERICOID 1700
#define INV_WRITE 0x00020000
#define INV_READ 0x00040000
#include "postgres.h"
#include "catalog/pg_type.h"
#ifndef HB_PGVERSION
# ifdef PG_DIAG_INTERNAL_POSITION

View File

@@ -57,39 +57,8 @@
#include "hbrddsql.h"
#include "libpq-fe.h"
/* TOFIX: these are defined in "server/catalog/pg_type.h",
but including this file generates compile errors.
-Ic:/pgsql/include;c:/pgsql/include/server
#include "postgres.h"
#include "catalog/pg_type.h"
*/
#define BOOLOID 16
#define BYTEAOID 17
#define CHAROID 18
#define NAMEOID 19
#define INT8OID 20
#define INT2OID 21
#define INT4OID 23
#define TEXTOID 25
#define OIDOID 26
#define CIDROID 650
#define FLOAT4OID 700
#define FLOAT8OID 701
#define CASHOID 790
#define MACADDROID 829
#define INETOID 869
#define BPCHAROID 1042
#define VARCHAROID 1043
#define DATEOID 1082
#define TIMEOID 1083
#define TIMESTAMPOID 1114
#define TIMESTAMPTZOID 1184
#define TIMETZOID 1266
#define BITOID 1560
#define VARBITOID 1562
#define NUMERICOID 1700
typedef struct
{

22
harbour/debian/postinst Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
set -e
case "$1" in
configure|remove)
/sbin/ldconfig
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

22
harbour/debian/postrm Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
set -e
case "$1" in
remove)
/sbin/ldconfig
;;
purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

View File

@@ -25,7 +25,7 @@ Terminal Client
===============
Source => trm_client.prg
Link => GTWVG
Run => trm_client.exe <IP - 127.0.0.1 | vouch.dynalias.com>
Run => trm_client.exe <IP - localhost | vouch.dynalias.com>
<Port where Terminal Server is Listening - 2011>
<Harbour Application - c:\harbour\contrib\examples\terminal\trm_app.exe>
[Parameters - Norammly Supplied to Appln - Separated by SPACE ]
@@ -37,7 +37,7 @@ Terminal Client
Parameters supplied TO Harbour Client can be on command line or as an .ini file.
.Ini file may contain these entries:
ServerIP = 127.0.0.1 | vouch.dynalias.com
ServerIP = localhost | vouch.dynalias.com
ServerPort = 2011
Application = c:\harbour\contrib\examples\terminal\trm_app.exe
Parameters = any number of parameters separated by a space

View File

@@ -192,14 +192,14 @@ PROCEDURE ServeClient( Socket )
nServerPort++
SvrExecuteAPP( 'trm_app.exe', hb_ntos( nServerPort++ ), hb_dirBase() )
inkey( 5 )
cReply := 'CONNECT;' + '127.0.0.1' + ';' + hb_ntos( nServerPort++ ) + ';'
cReply := 'CONNECT;' + 'localhost' + ';' + hb_ntos( nServerPort++ ) + ';'
case cReq == 'VOUCH'
nServerPort++
cCmdLine := a_[ 3 ] +' '+ ltrim( str( nServerPort ) )
SvrExecuteAPP( a_[ 2 ], cCmdLine, a_[ 4 ] )
cReply := 'CONNECT;' + '127.0.0.1' + ';' + hb_ntos( nServerPort ) + ';' + a_[ 2 ] + ';'
cReply := 'CONNECT;' + 'localhost' + ';' + hb_ntos( nServerPort ) + ';' + a_[ 2 ] + ';'
case cReq == 'ARCONNECTED'
// No further info required, close connection