Пример #1
0
JNIEXPORT void JNICALL Java_test_test_Harbour_vmInit( JNIEnv * env, jobject obj, jint i )
{
   s_env = env;
   s_obj = obj;

   hb_vmInit( i );
}
Пример #2
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();
}
Пример #3
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();
}
Пример #4
0
BOOL WINAPI DllMain( HINSTANCE hInstance, DWORD dwReason, PVOID pvReserved )
#endif
{
   static HB_BOOL s_fInit = HB_FALSE;
   BOOL fResult = TRUE;

   HB_SYMBOL_UNUSED( pvReserved );

   switch( dwReason )
   {
      case DLL_PROCESS_ATTACH:
         s_hInstDll = ( HINSTANCE ) hInstance;
         s_lLockCount = s_lObjectCount = 0;
         s_IClassFactoryObj.lpVtbl = ( IClassFactoryVtbl * )
                                     &IClassFactory_Vtbl;

         DisableThreadLibraryCalls( ( HMODULE ) hInstance );

         s_fInit = ! hb_vmIsActive();
         if( s_fInit )
            hb_vmInit( HB_FALSE );

         hb_oleInit();

         if( ! s_fServerReady )
         {
            PHB_DYNS pDynSym = hb_dynsymFind( "DLLMAIN" );

            if( pDynSym && hb_dynsymIsFunction( pDynSym ) &&
                hb_vmRequestReenter() )
            {
               hb_vmPushDynSym( pDynSym );
               hb_vmPushNil();
               hb_vmProc( 0 );
               hb_vmRequestRestore();
            }
         }
         fResult = s_fServerReady ? TRUE : FALSE;
         break;

      case DLL_PROCESS_DETACH:
         s_fServerReady = HB_FALSE;
         if( s_pAction )
         {
            hb_itemRelease( s_pAction );
            s_pAction = NULL;
         }
         if( s_pMsgHash )
         {
            hb_itemRelease( s_pMsgHash );
            s_pMsgHash = NULL;
         }
         if( s_fInit )
         {
            hb_vmQuit();
            s_fInit = HB_FALSE;
         }
         break;
   }

   return fResult;
}
Пример #5
0
int main( int argc, char * argv[] )
{
    hb_cmdargInit( argc, argv );
    hb_vmInit( HB_TRUE );
    return hb_vmQuit();
}
Пример #6
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;
}
Пример #7
0
void Java_su_harbour_hDroidGUI_Harbour_vmInit( JNIEnv* env, jobject thiz )
{

    hb_vmInit( 0 );
}