1 // Created on: 1999-12-30
2 // Created by: data exchange team
3 // Copyright (c) 1999-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 // Defines common framework for declaration of main/WinMain functions
18 // for executbales on UNIX and WNT that extends DRAW Test Harness.
20 // In order to create executable in DRAW environment, in the executable
21 // the following line should be added:
24 #ifndef Draw_Main_HeaderFile
25 #define Draw_Main_HeaderFile
27 #include <Standard_TypeDef.hxx>
28 #include <Draw_Appli.hxx>
29 #include <Standard_PCharacter.hxx>
31 typedef void (*FDraw_InitAppli)(Draw_Interpretor&);
34 Standard_EXPORT Standard_Integer _main_ (Standard_Integer argc,
35 Standard_PCharacter argv[],
36 const FDraw_InitAppli Draw_InitAppli);
39 Standard_EXPORT Standard_Integer _WinMain_ (HINSTANCE hInstance,
40 HINSTANCE hPrevinstance,
42 Standard_Integer nCmdShow,
43 const FDraw_InitAppli Draw_InitAppli);
45 Standard_EXPORT Standard_Integer _main_ (int argc,
48 const FDraw_InitAppli Draw_InitAppli);
51 // Declarations of macros DRAW_MAIN to be used in executables instead of explicit main/WinMain
54 #define DRAW_MAIN int main (Standard_Integer argc, char* argv[])\
55 {return _main_ (argc, argv, Draw_InitAppli);}
57 // WinMain() and main()
58 #define DRAW_MAIN Standard_Integer PASCAL WinMain (HINSTANCE hInstance, HINSTANCE hPrevinstance, LPSTR lpCmdLine, Standard_Integer nCmdShow)\
59 {return _WinMain_ (hInstance, hPrevinstance, lpCmdLine, nCmdShow, Draw_InitAppli);}\
61 int main (int argc, char* argv[], char* envp[])\
62 {return _main_ (argc, argv, envp, Draw_InitAppli);}