All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
4 #include "ccutil.h"
5 
6 namespace tesseract {
8  params_(),
9  STRING_INIT_MEMBER(m_data_sub_dir,
10  "tessdata/", "Directory for data files", &params_),
11 #ifdef _WIN32
12  STRING_INIT_MEMBER(tessedit_module_name, WINDLLNAME,
13  "Module colocated with tessdata dir", &params_),
14 #endif
15  INT_INIT_MEMBER(ambigs_debug_level, 0, "Debug level for unichar ambiguities",
16  &params_),
17  BOOL_MEMBER(use_definite_ambigs_for_classifier, 0, "Use definite"
18  " ambiguities when running character classifier", &params_),
19  BOOL_MEMBER(use_ambigs_for_adaption, 0, "Use ambigs for deciding"
20  " whether to adapt to a character", &params_) {
21 }
22 
24 }
25 
26 
28 #ifdef _WIN32
29  mutex_ = CreateMutex(0, FALSE, 0);
30 #else
31  pthread_mutex_init(&mutex_, NULL);
32 #endif
33 }
34 
36 #ifdef _WIN32
37  WaitForSingleObject(mutex_, INFINITE);
38 #else
39  pthread_mutex_lock(&mutex_);
40 #endif
41 }
42 
44 #ifdef _WIN32
45  ReleaseMutex(mutex_);
46 #else
47  pthread_mutex_unlock(&mutex_);
48 #endif
49 }
50 
51 CCUtilMutex tprintfMutex; // should remain global
52 } // namespace tesseract
CCUtilMutex tprintfMutex
Definition: ccutil.cpp:51
virtual ~CCUtil()
Definition: ccutil.cpp:23
#define BOOL_MEMBER(name, val, comment, vec)
Definition: params.h:304
#define FALSE
Definition: capi.h:29
#define STRING_INIT_MEMBER(name, val, comment, vec)
Definition: params.h:319
#define NULL
Definition: host.h:144
#define INT_INIT_MEMBER(name, val, comment, vec)
Definition: params.h:313