tesseract  4.00.00dev
ccutil.cpp
Go to the documentation of this file.
1 // Copyright 2008 Google Inc. All Rights Reserved.
2 // Author: scharron@google.com (Samuel Charron)
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 // http://www.apache.org/licenses/LICENSE-2.0
7 // Unless required by applicable law or agreed to in writing, software
8 // distributed under the License is distributed on an "AS IS" BASIS,
9 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10 // See the License for the specific language governing permissions and
11 // limitations under the License.
12 
13 #include "ccutil.h"
14 
15 namespace tesseract {
17  params_(),
18  STRING_INIT_MEMBER(m_data_sub_dir,
19  "tessdata/", "Directory for data files", &params_),
20 #ifdef _WIN32
21  STRING_INIT_MEMBER(tessedit_module_name, WINDLLNAME,
22  "Module colocated with tessdata dir", &params_),
23 #endif
24  INT_INIT_MEMBER(ambigs_debug_level, 0, "Debug level for unichar ambiguities",
25  &params_),
26  BOOL_MEMBER(use_definite_ambigs_for_classifier, 0, "Use definite"
27  " ambiguities when running character classifier", &params_),
28  BOOL_MEMBER(use_ambigs_for_adaption, 0, "Use ambigs for deciding"
29  " whether to adapt to a character", &params_) {
30 }
31 
33 }
34 
35 
37 #ifdef _WIN32
38  mutex_ = CreateMutex(0, FALSE, 0);
39 #else
40  pthread_mutex_init(&mutex_, NULL);
41 #endif
42 }
43 
45 #ifdef _WIN32
46  WaitForSingleObject(mutex_, INFINITE);
47 #else
48  pthread_mutex_lock(&mutex_);
49 #endif
50 }
51 
53 #ifdef _WIN32
54  ReleaseMutex(mutex_);
55 #else
56  pthread_mutex_unlock(&mutex_);
57 #endif
58 }
59 
60 CCUtilMutex tprintfMutex; // should remain global
61 } // namespace tesseract
CCUtilMutex tprintfMutex
Definition: ccutil.cpp:60
virtual ~CCUtil()
Definition: ccutil.cpp:32
#define FALSE
Definition: capi.h:46
#define INT_INIT_MEMBER(name, val, comment, vec)
Definition: params.h:312
#define STRING_INIT_MEMBER(name, val, comment, vec)
Definition: params.h:318
#define BOOL_MEMBER(name, val, comment, vec)
Definition: params.h:303