2010-07-04 12:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* src/rtl/cdpapi.c
  * src/rtl/cdpapihb.c
  * include/hbapicdp.h
    + Added new low level hb_cdpList() function.
    ! cdp list generation logic now protected with mutex.
    ! HB_CDPLIST() .prg level function moved to cdpapihb.c,
      thus clearing the last pending TOFIX here regarding
      layer separation. Low level can now be moved to
      common lib (or is there anything else missing?).

  * contrib/hbqt/hbmk2_plugin_qt.prg
    * Minor correction in one stdalone error msg.
This commit is contained in:
Viktor Szakats
2010-07-04 10:23:11 +00:00
parent 1ff4a5ee13
commit 1ae025e9e2
5 changed files with 50 additions and 5 deletions

View File

@@ -16,6 +16,20 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-07-04 12:21 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/cdpapi.c
* src/rtl/cdpapihb.c
* include/hbapicdp.h
+ Added new low level hb_cdpList() function.
! cdp list generation logic now protected with mutex.
! HB_CDPLIST() .prg level function moved to cdpapihb.c,
thus clearing the last pending TOFIX here regarding
layer separation. Low level can now be moved to
common lib (or is there anything else missing?).
* contrib/hbqt/hbmk2_plugin_qt.prg
* Minor correction in one stdalone error msg.
2010-07-02 10:44 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbmk2/hbmk2.prg
+ Added feature for plugins to register the file extensions

View File

@@ -377,7 +377,7 @@ PROCEDURE Main( cSrc, cDst )
FErase( cTmp )
ELSE
OutErr( "Missing parameter. Call with: <.ui|.qrc> <.prg>" + hb_osNewLine() )
OutErr( "Missing parameter. Call with: <input> <output>" + hb_osNewLine() )
nError := 8
ENDIF

View File

@@ -341,6 +341,7 @@ extern HB_EXPORT PHB_CODEPAGE hb_cdpSelect( PHB_CODEPAGE cdp );
extern HB_EXPORT const char * hb_cdpSelectID( const char * id );
extern HB_EXPORT PHB_CODEPAGE hb_cdpFind( const char * id );
extern HB_EXPORT PHB_CODEPAGE hb_cdpFindExt( const char * id );
extern HB_EXPORT const char ** hb_cdpList( void ); /* Caller must release the pointer */
extern HB_EXPORT HB_BOOL hb_cdpIsDigit( PHB_CODEPAGE cdp, int iChar );
extern HB_EXPORT HB_BOOL hb_cdpIsAlpha( PHB_CODEPAGE cdp, int iChar );

View File

@@ -2208,11 +2208,14 @@ const char * hb_cdpSelectID( const char * id )
return cdp ? cdp->id : NULL;
}
/* TOFIX: Move this to cdpapihb.c */
HB_FUNC( HB_CDPLIST )
/* Caller must release the pointer */
const char ** hb_cdpList( void )
{
PHB_CODEPAGE cdp;
int iCount;
const char ** list;
HB_CDP_LOCK
cdp = s_cdpList;
iCount = 0;
@@ -2222,12 +2225,18 @@ HB_FUNC( HB_CDPLIST )
cdp = cdp->next;
}
hb_reta( iCount );
list = ( const char ** ) hb_xgrab( ( iCount + 1 ) * sizeof( char * ) );
cdp = s_cdpList;
iCount = 0;
while( cdp )
{
hb_storvc( cdp->id, -1, ++iCount );
list[ iCount++ ] = cdp->id;
cdp = cdp->next;
}
list[ iCount ] = NULL;
HB_CDP_UNLOCK
return list;
}

View File

@@ -116,6 +116,27 @@ HB_FUNC( HB_CDPINFO )
hb_retc( cdp ? cdp->info : NULL );
}
HB_FUNC( HB_CDPLIST )
{
const char ** list = hb_cdpList();
HB_ISIZ nPos;
nPos = 0;
while( list[ nPos ] )
++nPos;
hb_reta( nPos );
nPos = 0;
while( list[ nPos ] )
{
hb_storvc( list[ nPos ], -1, nPos + 1 );
++nPos;
}
hb_xfree( ( void * ) list );
}
HB_FUNC( __NATSORTVER )
{
/* NOTE: CA-Cl*pper 5.2e Intl. will return: "NATSORT v1.2i x14 19/Mar/93" */