Diff of /api/tesseractmain.cpp [e0016b] .. [d525ab] Maximize Restore

  Switch to side-by-side view

--- a/api/tesseractmain.cpp
+++ b/api/tesseractmain.cpp
@@ -17,12 +17,6 @@
 *
 **********************************************************************/
 
-// #define USE_VLD //Uncomment for Visual Leak Detector.
-#if (defined _MSC_VER && defined USE_VLD)
-#include "mfcpch.h"
-#include <vld.h>
-#endif
-
 // Include automatically generated configuration file if running autoconf
 #ifdef HAVE_CONFIG_H
 #include "config_auto.h"
@@ -32,7 +26,6 @@
 #include "baseapi.h"
 #include "basedir.h"
 #include "strngs.h"
-#include "tesseractmain.h"
 #include "tprintf.h"
 
 /**********************************************************************
@@ -229,149 +222,3 @@
 
   return 0;                      // Normal exit
 }
-
-#ifdef _WIN32
-
-char szAppName[] = "Tesseract";   //app name
-int initialized = 0;
-
-/**********************************************************************
-* WinMain
-*
-* Main function for a windows program.
-**********************************************************************/
-
-int WINAPI WinMain(  //main for windows //command line
-        HINSTANCE hInstance,
-        HINSTANCE hPrevInstance,
-        LPSTR lpszCmdLine,
-        int nCmdShow) {
-  WNDCLASS wc;
-  HWND hwnd;
-  MSG msg;
-
-  char **argv;
-  char *argsin[2];
-  int argc;
-  int exit_code;
-
-  wc.style = CS_NOCLOSE | CS_OWNDC;
-  wc.lpfnWndProc = (WNDPROC) WndProc;
-  wc.cbClsExtra = 0;
-  wc.cbWndExtra = 0;
-  wc.hInstance = hInstance;
-  wc.hIcon = NULL;         //LoadIcon (NULL, IDI_APPLICATION);
-  wc.hCursor = NULL;       //LoadCursor (NULL, IDC_ARROW);
-  wc.hbrBackground = (HBRUSH) (COLOR_WINDOW + 1);
-  wc.lpszMenuName = NULL;
-  wc.lpszClassName = szAppName;
-
-  RegisterClass(&wc);
-
-  hwnd = CreateWindow (szAppName, szAppName,
-                       WS_OVERLAPPEDWINDOW | WS_DISABLED,
-                       CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
-                       CW_USEDEFAULT, HWND_DESKTOP, NULL, hInstance, NULL);
-
-  argsin[0] = strdup (szAppName);
-  argsin[1] = strdup (lpszCmdLine);
-  /*allocate memory for the args. There can never be more than half*/
-  /*the total number of characters in the arguments.*/
-  argv = (char **)malloc(((strlen(argsin[0]) + strlen(argsin[1])) / 2 + 1) *
-                         sizeof(char *));
-
-  /*now construct argv as it should be for C.*/
-  argc = parse_args (2, argsin, argv);
-
-  //  ShowWindow (hwnd, nCmdShow);
-  //  UpdateWindow (hwnd);
-
-  if (initialized) {
-    exit_code = main (argc, argv);
-    free (argsin[0]);
-    free (argsin[1]);
-    free(argv);
-    return exit_code;
-  }
-  while (GetMessage (&msg, NULL, 0, 0)) {
-    TranslateMessage(&msg);
-    DispatchMessage(&msg);
-    if (initialized) {
-      exit_code = main (argc, argv);
-      break;
-    }
-    else
-      exit_code = msg.wParam;
-  }
-  free (argsin[0]);
-  free (argsin[1]);
-  free(argv);
-  return exit_code;
-}
-
-
-/**********************************************************************
-* WndProc
-*
-* Function to respond to messages.
-**********************************************************************/
-
-LONG WINAPI WndProc(            //message handler
-        HWND hwnd,              //window with message
-        UINT msg,               //message typ
-        WPARAM wParam,
-        LPARAM lParam) {
-  HDC hdc;
-
-  if (msg == WM_CREATE) {
-    //
-    // Create a rendering context.
-    //
-    hdc = GetDC (hwnd);
-    ReleaseDC(hwnd, hdc);
-    initialized = 1;
-    return 0;
-  }
-  return DefWindowProc (hwnd, msg, wParam, lParam);
-}
-
-
-/**********************************************************************
-* parse_args
-*
-* Turn a list of args into a new list of args with each separate
-* whitespace spaced string being an arg.
-**********************************************************************/
-
-int
-parse_args (                     /*refine arg list */
-        int argc,                /*no of input args */
-        char *argv[],            /*input args */
-        char *arglist[]          /*output args */
-        ) {
-  int argcount;            /*converted argc */
-  char *testchar;          /*char in option string */
-  int arg;                 /*current argument */
-
-  argcount = 0;            /*no of options */
-  for (arg = 0; arg < argc; arg++) {
-    testchar = argv[arg]; /*start of arg */
-    do {
-      while (*testchar
-             && (*testchar == ' ' || *testchar == '\n'
-                 || *testchar == '\t'))
-        testchar++; /*skip white space */
-      if (*testchar) {
-        /*new arg */
-        arglist[argcount++] = testchar;
-        /*skip to white space */
-        for (testchar++; *testchar && *testchar != ' ' && *testchar != '\n' && *testchar != '\t'; testchar++) ;
-        if (*testchar)
-          *testchar++ = '\0'; /*turn to separate args */
-      }
-    }
-    while (*testchar);
-  }
-  return argcount;         /*new number of args */
-}
-#endif