2010-07-02 14:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)

* harbour/include/hbpp.h
  * harbour/src/pp/ppcore.c
  * harbour/src/pp/hbpp.c
  * harbour/src/pp/pplib.c
  * harbour/src/compiler/complex.c
    * eliminated HB_USHORT limit for maximum token size
    * changed prefix of HB_SIZE numeric values from 'ul' to 'n'

  * harbour/contrib/rddads/adsfunc.c
    + added wrapper to AdsGetMemoDataType() function
This commit is contained in:
Przemyslaw Czerpak
2010-07-02 12:21:18 +00:00
parent 5502de48eb
commit b87112ecde
7 changed files with 365 additions and 331 deletions

View File

@@ -16,6 +16,18 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-07-02 14:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbpp.h
* harbour/src/pp/ppcore.c
* harbour/src/pp/hbpp.c
* harbour/src/pp/pplib.c
* harbour/src/compiler/complex.c
* eliminated HB_USHORT limit for maximum token size
* changed prefix of HB_SIZE numeric values from 'ul' to 'n'
* harbour/contrib/rddads/adsfunc.c
+ added wrapper to AdsGetMemoDataType() function
2010-07-02 10:10 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* ChangeLog
* Revised and updated status for pending TODOs TOFIXes of

View File

@@ -242,6 +242,28 @@ HB_FUNC( ADSUNLOCKRECORD )
hb_retl( pArea && AdsUnlockRecord( pArea->hTable, ( UNSIGNED32 ) hb_parnl( 1 ) ) == AE_SUCCESS );
}
HB_FUNC( ADSGETMEMODATATYPE )
{
UNSIGNED8 * pszFieldName = ( UNSIGNED8 * ) hb_parc( 1 );
if( !pszFieldName )
pszFieldName = ADSFIELD( hb_parni( 1 ) );
if( pszFieldName )
{
ADSAREAP pArea = hb_adsGetWorkAreaPointer();
UNSIGNED16 u16Type = 0;
if( pArea && AdsGetMemoDataType( pArea->hTable, pszFieldName,
&u16Type ) == AE_SUCCESS )
hb_retni( u16Type );
else
hb_errRT_DBCMD( EG_NOTABLE, 2001, NULL, HB_ERR_FUNCNAME );
}
else
hb_errRT_DBCMD( EG_ARG, 1014, NULL, HB_ERR_FUNCNAME );
}
HB_FUNC( ADSGETTABLECONTYPE )
{
UNSIGNED16 pusConnectType = 0;

View File

@@ -390,8 +390,8 @@ typedef struct _HB_PP_TOKEN
struct _HB_PP_TOKEN * pMTokens; /* restrict or optional marker token(s) */
const char * value; /* token value */
HB_USHORT len; /* token value length */
HB_USHORT spaces; /* leading spaces for stringify */
HB_SIZE len; /* token value length */
HB_SIZE spaces; /* leading spaces for stringify */
HB_USHORT type; /* token type, see HB_PP_TOKEN_* */
HB_USHORT index; /* index to match marker or 0 */
}
@@ -530,8 +530,8 @@ HB_PP_OPERATOR, * PHB_PP_OPERATOR;
typedef struct
{
char * pBufPtr;
HB_SIZE ulLen;
HB_SIZE ulAllocated;
HB_SIZE nLen;
HB_SIZE nAllocated;
}
HB_MEM_BUFFER, * PHB_MEM_BUFFER;
@@ -548,7 +548,7 @@ typedef struct _HB_PP_FILE
HB_BOOL fEof; /* the end of file reached */
const char * pLineBuf; /* buffer for parsing external lines */
HB_SIZE ulLineBufLen; /* size of external line buffer */
HB_SIZE nLineBufLen; /* size of external line buffer */
struct _HB_PP_FILE * pPrev; /* previous file, the one which included this file */
}
@@ -599,9 +599,9 @@ typedef struct
/* used to divide line per tokens and tokens manipulations */
PHB_MEM_BUFFER pBuffer; /* buffer for input and output line */
int iSpaces; /* leading spaces for next token */
int iSpacesNL; /* leading spaces ';' token (fCanNextLine) if it will not be line concatenator */
int iSpacesMin; /* minimal number of leading spaces for next token */
HB_SIZE nSpaces; /* leading spaces for next token */
HB_SIZE nSpacesNL; /* leading spaces ';' token (fCanNextLine) if it will not be line concatenator */
HB_SIZE nSpacesMin; /* minimal number of leading spaces for next token */
HB_USHORT usLastType; /* last token type */
HB_BOOL fCanNextLine; /* ';' token found and we do not know yet if it's command separator or line concatenator */
HB_BOOL fDirective; /* # directives is parsed */
@@ -659,7 +659,7 @@ extern void hb_pp_setStdRules( PHB_PP_STATE pState );
extern void hb_pp_setStdBase( PHB_PP_STATE pState );
extern void hb_pp_setStream( PHB_PP_STATE pState, int iMode );
extern void hb_pp_addSearchPath( PHB_PP_STATE pState, const char * szPath, HB_BOOL fReplace );
extern HB_BOOL hb_pp_inBuffer( PHB_PP_STATE pState, const char * pBuffer, HB_SIZE ulLen );
extern HB_BOOL hb_pp_inBuffer( PHB_PP_STATE pState, const char * pBuffer, HB_SIZE nLen );
extern HB_BOOL hb_pp_inFile( PHB_PP_STATE pState, const char * szFileName, HB_BOOL fSearchPath, FILE * file_in, HB_BOOL fError );
extern HB_BOOL hb_pp_outFile( PHB_PP_STATE pState, const char * szOutFileName, FILE * file_out );
extern HB_BOOL hb_pp_traceFile( PHB_PP_STATE pState, const char * szTraceFileName, FILE * file_trace );
@@ -669,8 +669,8 @@ extern HB_BOOL hb_pp_eof( PHB_PP_STATE pState );
extern int hb_pp_lineTot( PHB_PP_STATE pState );
extern char * hb_pp_outFileName( PHB_PP_STATE pState );
extern char * hb_pp_traceFileName( PHB_PP_STATE pState );
extern char * hb_pp_nextLine( PHB_PP_STATE pState, HB_SIZE * pulLen );
extern char * hb_pp_parseLine( PHB_PP_STATE pState, const char * pLine, HB_SIZE * pulLen );
extern char * hb_pp_nextLine( PHB_PP_STATE pState, HB_SIZE * pnLen );
extern char * hb_pp_parseLine( PHB_PP_STATE pState, const char * pLine, HB_SIZE * pnLen );
extern void hb_pp_addDefine( PHB_PP_STATE pState, const char * szDefName, const char * szDefValue );
extern void hb_pp_delDefine( PHB_PP_STATE pState, const char * szDefName );
extern HB_BOOL hb_pp_lasterror( PHB_PP_STATE pState );
@@ -680,7 +680,7 @@ extern HB_BOOL hb_pp_eof( PHB_PP_STATE pState );
extern void hb_pp_tokenUpper( PHB_PP_TOKEN pToken );
extern void hb_pp_tokenToString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken );
extern char * hb_pp_tokenBlockString( PHB_PP_STATE pState, PHB_PP_TOKEN pToken, int * piType, int * piLen );
extern PHB_PP_STATE hb_pp_lexNew( const char * pString, HB_SIZE ulLen );
extern PHB_PP_STATE hb_pp_lexNew( const char * pString, HB_SIZE nLen );
extern PHB_PP_TOKEN hb_pp_lexGet( PHB_PP_STATE pState );
extern PHB_PP_TOKEN hb_pp_tokenGet( PHB_PP_STATE pState );
extern HB_BOOL hb_pp_tokenNextExp( PHB_PP_TOKEN * pTokenPtr );

View File

@@ -100,8 +100,8 @@
typedef struct
{
const char * value; /* keyword name */
int minlen; /* minimal length */
int maxlen; /* maximal length */
HB_SIZE minlen; /* minimal length */
HB_SIZE maxlen; /* maximal length */
int type; /* terminal symbol code */
}
HB_LEX_KEY;
@@ -221,7 +221,7 @@ static int hb_comp_asType( PHB_PP_TOKEN pToken, HB_BOOL fArray )
if( pToken && HB_PP_TOKEN_TYPE( pToken->type ) == HB_PP_TOKEN_KEYWORD )
{
const HB_LEX_KEY * pKey = s_typetable;
int i = sizeof( s_typetable ) / sizeof( HB_LEX_KEY );
int i = HB_SIZEOFARRAY( s_typetable );
hb_pp_tokenUpper( pToken );
do
@@ -239,7 +239,7 @@ static int hb_comp_asType( PHB_PP_TOKEN pToken, HB_BOOL fArray )
static int hb_comp_keywordType( PHB_PP_TOKEN pToken )
{
const HB_LEX_KEY * pKey = s_keytable;
int i = sizeof( s_keytable ) / sizeof( HB_LEX_KEY );
int i = HB_SIZEOFARRAY( s_keytable );
do
{

View File

@@ -93,7 +93,7 @@ static void hb_pp_writeToken( FILE * fout, PHB_PP_TOKEN pToken,
fprintf( fout, ", \"%s\", %*s %2d,%2d, 0x%04x, %d }%s\n",
pToken->value,
i < 0 ? 0 : i, "",
pToken->len, pToken->spaces,
( int ) pToken->len, ( int ) pToken->spaces,
pToken->type | HB_PP_TOKEN_STATIC | HB_PP_TOKEN_PREDEFINED,
pToken->index,
fLast && !pToken->pNext && iOptional == 0 ? "" : "," );
@@ -260,9 +260,9 @@ static void hb_pp_undefCompilerRules( PHB_PP_STATE pState )
static int hb_pp_preprocesfile( PHB_PP_STATE pState, const char * szRuleFile )
{
int iResult = 0;
HB_SIZE ulLen;
HB_SIZE nLen;
while( hb_pp_nextLine( pState, &ulLen ) != NULL && ulLen ) {};
while( hb_pp_nextLine( pState, &nLen ) != NULL && nLen ) {};
if( szRuleFile )
{

File diff suppressed because it is too large Load Diff

View File

@@ -229,20 +229,20 @@ HB_FUNC( __PP_ADDRULE )
if( pState )
{
const char * szText = hb_parc( 2 );
HB_SIZE ulLen = hb_parclen( 2 );
HB_SIZE nLen = hb_parclen( 2 );
if( szText )
{
while( ulLen && ( szText[ 0 ] == ' ' || szText[ 0 ] == '\t' ) )
while( nLen && ( szText[ 0 ] == ' ' || szText[ 0 ] == '\t' ) )
{
++szText;
--ulLen;
--nLen;
}
}
if( szText && ulLen && szText[ 0 ] == '#' )
if( szText && nLen && szText[ 0 ] == '#' )
{
hb_pp_parseLine( pState, szText, &ulLen );
hb_pp_parseLine( pState, szText, &nLen );
/* probably for parsing #included files the old code was making
sth like that */
@@ -270,12 +270,12 @@ HB_FUNC( __PP_PROCESS )
if( pState )
{
HB_SIZE ulLen = hb_parclen( 2 );
HB_SIZE nLen = hb_parclen( 2 );
if( ulLen )
if( nLen )
{
char * szText = hb_pp_parseLine( pState, hb_parc( 2 ), &ulLen );
hb_retclen( szText, ulLen );
char * szText = hb_pp_parseLine( pState, hb_parc( 2 ), &nLen );
hb_retclen( szText, nLen );
return;
}
}