static void SetGet( int iFlag ) { int iState = 0; HB_GT_INFO gtInfo; memset( >Info, 0, sizeof( gtInfo ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); if( gtInfo.pResult ) { iState = hb_itemGetNI( gtInfo.pResult ); gtInfo.pNewVal = gtInfo.pResult; gtInfo.pResult = NULL; } if( HB_ISLOG( 1 ) ) { gtInfo.pNewVal = hb_itemPutNI( gtInfo.pNewVal, hb_parl( 1 ) ? ( iState | iFlag ) : ( iState & ~iFlag ) ); hb_gtInfo( HB_GTI_KBDSHIFTS, >Info ); } if( gtInfo.pNewVal ) hb_itemRelease( gtInfo.pNewVal ); if( gtInfo.pResult ) hb_itemRelease( gtInfo.pResult ); hb_retl( ( iState & iFlag ) != 0 ); }
static void hb_compGenArgList( int iFirst, int iLast, int * pArgC, const char *** pArgV, PHB_ITEM * pIncItem, PHB_PP_OPEN_FUNC * pOpenFunc, PHB_PP_MSG_FUNC * pMsgFunc ) { PHB_ITEM pParam; HB_SIZE ul, nLen; int argc = 1, i; const char ** argv; if( pMsgFunc ) { *pMsgFunc = NULL; if( HB_ISLOG( iFirst ) ) { if( hb_parl( iFirst ) ) *pMsgFunc = s_pp_msg; ++iFirst; } } if( pIncItem && pOpenFunc ) { *pOpenFunc = NULL; *pIncItem = hb_param( iFirst, HB_IT_HASH ); if( *pIncItem ) { ++iFirst; *pOpenFunc = s_pp_openFile; } } for( i = iFirst; i <= iLast; ++i ) { pParam = hb_param( i, HB_IT_ARRAY | HB_IT_STRING ); if( pParam ) { if( HB_IS_ARRAY( pParam ) ) { ul = hb_arrayLen( pParam ); if( ul ) { do { if( hb_arrayGetType( pParam, ul ) & HB_IT_STRING ) ++argc; } while( --ul ); } } else if( HB_IS_STRING( pParam ) ) ++argc; } } argv = ( const char ** ) hb_xgrab( sizeof( char * ) * ( argc + 1 ) ); argc = 0; for( i = iFirst; i <= iLast; ++i ) { pParam = hb_param( i, HB_IT_ARRAY | HB_IT_STRING ); if( pParam ) { if( HB_IS_ARRAY( pParam ) ) { nLen = hb_arrayLen( pParam ); for( ul = 1; ul <= nLen; ++ul ) { if( hb_arrayGetType( pParam, ul ) & HB_IT_STRING ) argv[ argc++ ] = hb_arrayGetCPtr( pParam, ul ); } } else if( HB_IS_STRING( pParam ) ) argv[ argc++ ] = hb_itemGetCPtr( pParam ); } } argv[ argc ] = NULL; *pArgC = argc; *pArgV = argv; }