Exemple #1
0
int main( int argc, char * argv[] )
{
   HB_TRACE(HB_TR_DEBUG, ("main(%d, %p)", argc, argv));

   #if defined(HB_OS_WIN_32)
      hb_gtSetDefault( "win" );
   #endif

   hb_cmdargInit( argc, argv );
   hb_vmInit( TRUE );

   return hb_vmQuit();
}
Exemple #2
0
HB_EXTERN_END

int main( int argc, char * argv[] )
{
   HB_TRACE( HB_TR_DEBUG, ( "main(%d, %p)", argc, ( void * ) argv ) );

#if defined( __DJGPP__ )
   __system_flags =
      __system_redirect |
      __system_allow_long_cmds |
      __system_emulate_command |
      __system_handle_null_commands |
      __system_emulate_chdir;
#endif

   hb_cmdargInit( argc, argv );
   hb_vmInit( HB_TRUE );
   return hb_vmQuit();
}
Exemple #3
0
int main( int argc, char * argv[] )
{
    hb_cmdargInit( argc, argv );
    hb_vmInit( HB_TRUE );
    return hb_vmQuit();
}
Exemple #4
0
int APIENTRY WinMain( HINSTANCE hInstance,      /* handle to current instance */
                      HINSTANCE hPrevInstance,  /* handle to previous instance */
                      LPSTR lpCmdLine,          /* pointer to command line */
                      int iCmdShow )            /* show state of window */
{
#ifdef HB_FM_WIN32_ALLOC
   LPSTR pArgs = ( LPSTR ) LocalAlloc( LMEM_FIXED, strlen( lpCmdLine ) + 1 );
#else
   LPSTR pArgs = ( LPSTR ) malloc( strlen( lpCmdLine ) + 1 );
#endif
   LPSTR pStart, pArg = pArgs;
   BOOL  bInQuotedParam;
   int   iResult;

   HB_TRACE( HB_TR_DEBUG, ( "WinMain(%p, %p, %s, %d)", hInstance, hPrevInstance, lpCmdLine, iCmdShow ) );

   HB_SYMBOL_UNUSED( iCmdShow );

   hb_gtSetDefault( "gui" );

   GetModuleFileName( hInstance, s_szAppName, sizeof( s_szAppName ) - 1 );
   s_argv[ s_argc++ ] = s_szAppName;

   while( *lpCmdLine && s_argc < MAX_ARGS )
   {
      while( *lpCmdLine == ' ' )  /* Skip over any white space */
         lpCmdLine++;

      if( *lpCmdLine )
      {
         pStart         = NULL;
         bInQuotedParam = FALSE;

         while( *lpCmdLine )
         {
            if( *lpCmdLine == '"' )
            {
               lpCmdLine++;

               if( bInQuotedParam )
               {
                  if( pStart == NULL )
                     pStart = pArg;

                  break;
               }
               else
                  bInQuotedParam = TRUE;
            }
            else if( *lpCmdLine == ' ' )
            {
               if( bInQuotedParam )
               {
                  *pArg = *lpCmdLine++;

                  if( pStart == NULL )
                     pStart = pArg;

                  pArg++;
               }
               else
               {
                  lpCmdLine++;
                  break;
               }
            }
            else
            {
               *pArg = *lpCmdLine++;

               if( pStart == NULL )
                  pStart = pArg;

               pArg++;
            }
         }
         if( pStart )
         {
            *pArg++              = '\0';
            s_argv[ s_argc++ ]   = pStart;
         }
      }
   }

   hb_winmainArgInit( hInstance, hPrevInstance, iCmdShow );
   hb_cmdargInit( s_argc, s_argv );

   hb_vmInit( TRUE );

   iResult = hb_vmQuit();
#ifdef HB_FM_WIN32_ALLOC
   LocalFree( pArgs );
#else
   free( pArgs );
#endif

   return iResult;
}