Esempio n. 1
0
static char * hb_mlGetParams( int iParAdd, ULONG * pulLen, ULONG * pulLineLength,
                              ULONG * pulTabSize, BOOL * pfWordWrap,
                              PHB_EOL_INFO * pEOLs, int * piEOLs )
{
   char * pszString = hb_parc( 1 );
   if( pszString )
   {
      if( ISNUM( 2 ) )
      {
         if( hb_parnd( 2 ) <= 0 )
            return NULL;
         * pulLineLength = hb_parnl( 2 );
      }
      else
         * pulLineLength = 79;
      * pulLen = hb_parclen( 1 );
      * pulTabSize = ISNUM( 3 + iParAdd ) ? hb_parnl( 3 + iParAdd ) : 4;
      * pfWordWrap = ISLOG( 4 + iParAdd ) ? hb_parl( 4 + iParAdd ) : TRUE;
      * pEOLs = hb_mlGetEOLs( 5 + iParAdd, piEOLs );
#ifdef HB_C52_STRICT
      if( * pulLineLength > 254 )
         * pulLineLength = 79;
#endif
      if( * pulTabSize >= * pulLineLength )
         * pulTabSize = * pulLineLength - 1;
      else if( * pulTabSize == 0 )
         * pulTabSize = 1;
   }
   return pszString;
}
Esempio n. 2
0
static double s_fileDirSpace( PHB_FILE_FUNCS pFuncs, const char * pszDirName, HB_USHORT uiType )
{
   PHB_IOUSR pIO = ( PHB_IOUSR ) pFuncs;

   s_pushMethod( pIO, IOUSR_DIRSPACE );
   hb_vmPushString( pszDirName, strlen( pszDirName ) );
   hb_vmPushInteger( uiType );
   hb_vmDo( 2 );

   return hb_parnd( -1 );
}
Esempio n. 3
0
   if( xConvert.value != 0 )
   {
      iExponent = ( int ) ( xConvert.string[ 7 ] & 0x07F );
      iExponent = iExponent << 4;
      iExponent += ( int ) ( ( xConvert.string[ 6 ] & 0xF0 ) >> 4 );
      iExponent -= 1023;
   }

   hb_retni( iExponent );

#else

   int iExponent = 0;
   double dValue;

   dValue = hb_parnd( 1 );

   if( dValue == 0.0 )
   {
      hb_retni( 0 );
      return;
   }

   if( fabs( dValue ) < 1.0 )
   {
      while( fabs( dValue ) < 1.0 )
      {
         dValue *= 2.0;
         iExponent--;
      }
   }