PageRenderTime 60ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/build48/harbour/source/vm/maindll.c

#
C | 109 lines | 38 code | 16 blank | 55 comment | 0 complexity | 8da0717127b05048ce00f349da3398f7 MD5 | raw file
Possible License(s): AGPL-1.0, BSD-3-Clause, CC-BY-SA-3.0, LGPL-3.0, GPL-2.0, LGPL-2.0, LGPL-2.1
  1. /*
  2. * $Id: maindll.c 6764 2006-07-18 01:30:23Z druzus $
  3. */
  4. /*
  5. * Harbour Project source code:
  6. * Windows self-contained DLL entry point
  7. *
  8. * Copyright 1999 Antonio Linares <alinares@fivetech.com>
  9. * www - http://www.harbour-project.org
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version, with one exception:
  15. *
  16. * This program is free software; you can redistribute it and/or modify
  17. * it under the terms of the GNU General Public License as published by
  18. * the Free Software Foundation; either version 2, or (at your option)
  19. * any later version.
  20. *
  21. * This program is distributed in the hope that it will be useful,
  22. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  23. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  24. * GNU General Public License for more details.
  25. *
  26. * You should have received a copy of the GNU General Public License
  27. * along with this software; see the file COPYING. If not, write to
  28. * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  29. * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
  30. *
  31. * As a special exception, the Harbour Project gives permission for
  32. * additional uses of the text contained in its release of Harbour.
  33. *
  34. * The exception is that, if you link the Harbour libraries with other
  35. * files to produce an executable, this does not by itself cause the
  36. * resulting executable to be covered by the GNU General Public License.
  37. * Your use of that executable is in no way restricted on account of
  38. * linking the Harbour library code into it.
  39. *
  40. * This exception does not however invalidate any other reasons why
  41. * the executable file might be covered by the GNU General Public License.
  42. *
  43. * This exception applies only to the code released by the Harbour
  44. * Project under the name Harbour. If you copy code from other
  45. * Harbour Project or Free Software Foundation releases into a copy of
  46. * Harbour, as the General Public License permits, the exception does
  47. * not apply to the code that you add in this way. To avoid misleading
  48. * anyone as to the status of such modified files, you must delete
  49. * this exception notice from them.
  50. *
  51. * If you write modifications of your own for Harbour, it is your choice
  52. * whether to permit this exception to apply to your modifications.
  53. * If you do not wish that, delete this exception notice.
  54. *
  55. */
  56. #define HB_OS_WIN_32_USED
  57. #include "hbvm.h"
  58. #include "hbapiitm.h"
  59. #if defined(HB_OS_WIN_32)
  60. HB_EXPORT BOOL WINAPI DllEntryPoint( HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved )
  61. {
  62. HB_TRACE( HB_TR_DEBUG, ("DllEntryPoint(%p, %p, %p)", hInstance, fdwReason,
  63. pvReserved ) );
  64. HB_SYMBOL_UNUSED( hInstance );
  65. HB_SYMBOL_UNUSED( fdwReason );
  66. HB_SYMBOL_UNUSED( pvReserved );
  67. switch( fdwReason )
  68. {
  69. case DLL_PROCESS_ATTACH:
  70. hb_vmInit( FALSE ); /* Don't execute first linked symbol */
  71. break;
  72. case DLL_PROCESS_DETACH:
  73. hb_vmQuit();
  74. break;
  75. }
  76. return TRUE;
  77. }
  78. HB_EXPORT LONG PASCAL HBDLLENTRY( char * cProcName )
  79. {
  80. hb_itemDoC( cProcName, 0, 0 );
  81. return 0;
  82. }
  83. HB_EXPORT LONG PASCAL HBDLLENTRY1( char * cProcName, LONG pItem )
  84. {
  85. hb_itemDoC( cProcName, 1, ( PHB_ITEM ) pItem, 0 );
  86. return 0;
  87. }
  88. HB_EXPORT LONG PASCAL HBDLLENTRY2( char * cProcName, LONG pItem1, LONG pItem2 )
  89. {
  90. hb_itemDoC( cProcName, 2, ( PHB_ITEM ) pItem1, ( PHB_ITEM ) pItem2, 0 );
  91. return 0;
  92. }
  93. #endif