This commit is contained in:
Lorenzo Fiorini
2007-12-20 14:00:56 +00:00
parent 609f24e2e4
commit 7fbcb38a51
6 changed files with 132 additions and 5 deletions

View File

@@ -8,6 +8,19 @@
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
*/
2007-12-20 15:00 UTC+0100 Lorenzo Fiorini (lorenzo.fiorini/at/gmail.com)
* harbour/make_xmingw.sh
* moved -maxdepth before -name
* harbour/source/rtl/hbini.prg
* added hb_ininew()
* harbour/contrib/hbtip/sendmail.prg
* removed hbcompat.ch dependences
+ harbour/contrib/hbtip/utils.c
* fixed a type in jpeg mime string
* added TIP_HTMLSPECIALCHARS
+ harbour/contrib/hbpgsql/postgres.c
* added PQRESULT2ARRAY
2007-12-20 11:44 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
* harbour/source/rtl/Makefile

View File

@@ -441,6 +441,32 @@ HB_FUNC( PQMETADATA )
}
}
HB_FUNC( PQRESULT2ARRAY )
{
PGresult *res;
if( hb_parinfo( 1 ) )
{
res = ( PGresult * ) hb_parptr( 1 );
if( PQresultStatus( res ) == PGRES_TUPLES_OK )
{
int nRows = PQntuples(res), nRow;
int nCols = PQnfields( res ), nCol;
PHB_ITEM pResult = hb_itemArrayNew( nRows ), pRow;
for( nRow = 0; nRow < nRows ; nRow++ )
{
pRow = hb_arrayGetItemPtr( pResult, nRow + 1 );
hb_arrayNew ( pRow, nCols );
for( nCol = 0; nCol < nCols ; nCol++ )
{
hb_arraySetC( pRow, nCol + 1, PQgetvalue(res, nRow, nCol) );
}
}
hb_itemRelease( hb_itemReturnForward( pResult ) );
}
}
}
HB_FUNC(PQTRANSACTIONSTATUS)
{
if (hb_parinfo(1))

View File

@@ -116,7 +116,7 @@ FUNCTION HB_SendMail( cServer, nPort, cFrom, aTo, aCC, aBCC, cBody, cSubject, aF
IF Valtype( aTo ) == "A"
IF Len( aTo ) > 1
FOR EACH cTo IN aTo
IF HB_EnumIndex( cTo ) != 1
IF cTo:__enumIndex() != 1
cTmp += cTo + ","
ENDIF
NEXT

View File

@@ -333,7 +333,7 @@ static MIME_ENTRY s_mimeTable[ MIME_TABLE_SIZE ] =
/* 65*/ { 0, "GIF", "image/gif", 0, 0, 0 },
/* JPEG image */
/* 66*/ { 0, "\xff\xd8", "image/x-compressed-gif", 0, 0, 0 }
/* 66*/ { 0, "\xff\xd8", "image/jpg", 0, 0, 0 }
};
/* Find mime by extension */
@@ -828,3 +828,84 @@ HB_FUNC( HB_EXEC )
else
hb_errRT_BASE_SubstR( EG_ARG, 1099, NULL, &hb_errFuncName, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( TIP_HTMLSPECIALCHARS )
{
char *cData = hb_parc(1);
int nLen = hb_parclen(1);
char *cRet;
int nPos = 0, nPosRet = 0;
BYTE cElem;
if ( ! cData )
{
hb_errRT_BASE( EG_ARG, 3012, NULL,
"TIP_HTMLSPECIALCHARS", 1, hb_paramError(1) );
return;
}
if ( ! nLen )
{
hb_retc( "" );
return;
}
// Giving maximum final length possible
cRet = (char *) hb_xgrab( nLen * 6 +1);
while ( nPos < nLen )
{
cElem = ( BYTE )cData[ nPos ];
if ( cElem == '&' )
{
cRet[ nPosRet++ ] = '&';
cRet[ nPosRet++ ] = 'a';
cRet[ nPosRet++ ] = 'm';
cRet[ nPosRet++ ] = 'p';
cRet[ nPosRet++ ] = ';';
}
else if ( cElem == '<' )
{
cRet[ nPosRet++ ] = '&';
cRet[ nPosRet++ ] = 'l';
cRet[ nPosRet++ ] = 't';
cRet[ nPosRet++ ] = ';';
}
else if ( cElem == '>' )
{
cRet[ nPosRet++ ] = '&';
cRet[ nPosRet++ ] = 'g';
cRet[ nPosRet++ ] = 't';
cRet[ nPosRet++ ] = ';';
}
else if ( cElem == '"' )
{
cRet[ nPosRet++ ] = '&';
cRet[ nPosRet++ ] = 'q';
cRet[ nPosRet++ ] = 'u';
cRet[ nPosRet++ ] = 'o';
cRet[ nPosRet++ ] = 't';
cRet[ nPosRet++ ] = ';';
}
else if ( cElem == '\'' )
{
cRet[ nPosRet++ ] = '&';
cRet[ nPosRet++ ] = '#';
cRet[ nPosRet++ ] = '0';
cRet[ nPosRet++ ] = '3';
cRet[ nPosRet++ ] = '9';
cRet[ nPosRet++ ] = ';';
}
else if ( cElem >= ' ' )
{
cRet[ nPosRet ] = cElem;
nPosRet++;
}
nPos++;
}
hb_retclen_buffer( cRet, nPosRet );
}

View File

@@ -38,9 +38,9 @@ elif [ "$UNAME" = "FreeBSD" ]; then
TARGET="."
CCPREFIX=""
UNAMEL=bsd
elif find /usr/local/bin -name "i[3456]86-mingw*-gcc" -maxdepth 1 &>/dev/null; then
elif find /usr/local/bin -maxdepth 1 -name "i[3456]86-mingw*-gcc" &>/dev/null; then
MINGW_PREFIX=/usr/local
TARGET=`find /usr/local/bin -name "i[3456]86-mingw*-gcc" -maxdepth 1|sed -e '1 !d' -e 's/.*\(i[3456]86-mingw[^-]*\).*/\1/g'`
TARGET=`find /usr/local/bin -maxdepth 1 -name "i[3456]86-mingw*-gcc" |sed -e '1 !d' -e 's/.*\(i[3456]86-mingw[^-]*\).*/\1/g'`
CCPREFIX="$TARGET-"
else
echo "Can't determine the location for the MinGW32 cross-compiler."

View File

@@ -87,6 +87,14 @@ PROCEDURE hb_IniSetComment( cLc, cHlc )
s_cHalfLineComment := cHlc
RETURN
FUNCTION HB_IniNew( bAutoMain )
LOCAL hIni := hb_Hash()
IF bAutoMain
hIni[ "MAIN" ] := hb_Hash()
ENDIF
RETURN hIni
FUNCTION hb_IniRead( cFileSpec, bKeyCaseSens, cSplitters, bAutoMain )
LOCAL hIni := hb_Hash()
@@ -97,7 +105,6 @@ FUNCTION hb_IniRead( cFileSpec, bKeyCaseSens, cSplitters, bAutoMain )
DEFAULT bAutoMain TO .T.
hb_HCaseMatch( hIni, bKeyCaseSens )
hb_HAutoAdd( hIni, HB_HAUTOADD_ASSIGN )
IF bAutoMain
hIni[ "MAIN" ] := hb_Hash()