Skip to content

Commit

Permalink
Removing lua
Browse files Browse the repository at this point in the history
git-svn-id: https://tesseract-ocr.googlecode.com/svn/trunk@242 d0cd1f9f-072b-0410-8dd7-cf729c803f20
  • Loading branch information
theraysmith committed Jun 2, 2009
1 parent 2186613 commit 254b936
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions viewer/svutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <sys/socket.h>
#ifdef __linux__
Expand All @@ -39,9 +41,6 @@
#endif

#include <iostream>
#include <string>
#include <cstring>
#include <cstdlib>

const int kBufferSize = 65536;
const int kMaxMsgSize = 4096;
Expand Down Expand Up @@ -269,8 +268,9 @@ SVNetwork::SVNetwork(const char* hostname, int port) {
#elif defined(__linux__)
struct hostent hp;
int herr;
char buffer[kBufferSize];
char *buffer = new char[kBufferSize];
gethostbyname_r(hostname, &hp, buffer, kBufferSize, &name, &herr);
delete[] buffer;
#else
name = gethostbyname(hostname);
#endif
Expand Down Expand Up @@ -303,22 +303,22 @@ SVNetwork::SVNetwork(const char* hostname, int port) {
// this unnecessary.
// Also the path has to be separated by ; on windows and : otherwise.
#ifdef WIN32
const char* prog = "java";
const char* cmd_template = "-Djava.library.path=%s -cp %s/luajava-1.1.jar"
";%s/ScrollView.jar;%s/piccolo-1.2.jar;%s/piccolox-1.2.jar"
const char* prog = "java -Xms1024m -Xmx2048m";
const char* cmd_template = "-Djava.library.path=%s -cp %s/ScrollView.jar;"
"%s/piccolo-1.2.jar;%s/piccolox-1.2.jar"
" com.google.scrollview.ScrollView";
#else
const char* prog = "sh";
const char* cmd_template = "-c \"trap 'kill %1' 0 1 2 ; java "
"-Djava.library.path=%s -cp %s/luajava-1.1.jar:%s/ScrollView.jar:"
"-Xms1024m -Xmx2048m -Djava.library.path=%s -cp %s/ScrollView.jar:"
"%s/piccolo-1.2.jar:%s/piccolox-1.2.jar"
" com.google.scrollview.ScrollView"
" >/dev/null 2>&1 & wait\"";
#endif
int cmdlen = strlen(cmd_template) + 5*strlen(scrollview_path) + 1;
int cmdlen = strlen(cmd_template) + 4*strlen(scrollview_path) + 1;
char* cmd = new char[cmdlen];
snprintf(cmd, cmdlen, cmd_template, scrollview_path, scrollview_path,
scrollview_path, scrollview_path, scrollview_path);
scrollview_path, scrollview_path);

SVSync::StartProcess(prog, cmd);
delete [] cmd;
Expand Down

0 comments on commit 254b936

Please sign in to comment.